diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 0000000..218e5e1 --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,88 @@ +# PHP is not supported by CodeQL, so this workflow runs PHPStan and uploads +# its findings as SARIF to GitHub Code Scanning (Security > Code scanning). +# It is the single PHPStan gate for the repo: findings are uploaded to the +# Security tab AND fail the workflow (and thus block the PR). +# +# Scanner: PHPStan 2.x (reuses the repo's phpstan.neon) +# Formatter: jbelien/phpstan-sarif-formatter (installed CI-only, not committed) +# Upload: github/codeql-action/upload-sarif@v4 +# +# Docs: https://docs.github.com/en/code-security/code-scanning/integrating-with-code-scanning/uploading-a-sarif-file-to-github +name: "Code Scanning (PHP)" + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + schedule: + - cron: '15 9 * * 4' + +jobs: + phpstan-sarif: + name: PHPStan → SARIF + runs-on: ubuntu-latest + permissions: + security-events: write + contents: read + actions: read + + steps: + - uses: actions/checkout@v4 + + - uses: shivammathur/setup-php@v2 + with: + php-version: '8.4' + tools: composer:v2 + coverage: none + + - name: Cache Composer dependencies + uses: actions/cache@v4 + with: + path: ~/.composer/cache + key: composer-${{ hashFiles('composer.json') }} + restore-keys: composer- + + - name: Install project dependencies + run: composer install --no-interaction --no-progress + + - name: Install PHPStan SARIF formatter (CI-only) + run: composer require --dev --no-interaction --no-progress --no-scripts jbelien/phpstan-sarif-formatter + + - name: Generate SARIF PHPStan config + run: | + cat > phpstan-sarif.neon <<'NEON' + includes: + - phpstan.neon + services: + errorFormatter.sarif: + class: PHPStanSarifErrorFormatter\SarifErrorFormatter + arguments: + relativePathHelper: @simpleRelativePathHelper + currentWorkingDirectory: %currentWorkingDirectory% + pretty: true + NEON + + - name: Run PHPStan (SARIF output) + id: phpstan + continue-on-error: true + run: | + vendor/bin/phpstan analyse \ + --configuration=phpstan-sarif.neon \ + --error-format=sarif \ + --memory-limit=512M \ + --no-progress \ + > phpstan.sarif + + - name: Upload SARIF to GitHub Code Scanning + if: always() + uses: github/codeql-action/upload-sarif@v4 + with: + sarif_file: phpstan.sarif + category: phpstan + + - name: Fail workflow if PHPStan reported findings + if: steps.phpstan.outcome == 'failure' + run: | + echo "PHPStan reported findings — see Security → Code scanning for details." + exit 1 diff --git a/.github/workflows/qa.yml b/.github/workflows/qa.yml new file mode 100644 index 0000000..67d0fdd --- /dev/null +++ b/.github/workflows/qa.yml @@ -0,0 +1,103 @@ +name: Quality Checks + +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + lint: + name: Code Style + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: shivammathur/setup-php@v2 + with: + php-version: '8.4' + tools: composer:v2 + coverage: none + - name: Cache Composer dependencies + uses: actions/cache@v4 + with: + path: ~/.composer/cache + key: composer-${{ hashFiles('composer.json') }} + restore-keys: composer- + - run: composer install --no-interaction --no-progress + - run: composer cs-check + + validate: + name: Monorepo Validation + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: shivammathur/setup-php@v2 + with: + php-version: '8.4' + tools: composer:v2 + coverage: none + - name: Cache Composer dependencies + uses: actions/cache@v4 + with: + path: ~/.composer/cache + key: composer-${{ hashFiles('composer.json') }} + restore-keys: composer- + - run: composer install --no-interaction --no-progress + - run: composer build:validate + + test: + name: Tests (PHP ${{ matrix.php-version }}, ${{ matrix.dependency-preference }}) + runs-on: ubuntu-latest + env: + CONVERT_STAGING_SDK_KEY: ${{ secrets.CONVERT_STAGING_SDK_KEY }} + CONVERT_STAGING_SDK_KEY2: ${{ secrets.CONVERT_STAGING_SDK_KEY2 }} + CONVERT_STAGING_SDK_KEY2_SECRET: ${{ secrets.CONVERT_STAGING_SDK_KEY2_SECRET }} + strategy: + fail-fast: false + matrix: + php-version: ['8.2', '8.3', '8.4'] + dependency-preference: ['prefer-lowest', 'prefer-stable'] + steps: + - uses: actions/checkout@v4 + - uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-version }} + tools: composer:v2 + coverage: pcov + - name: Cache Composer dependencies + uses: actions/cache@v4 + with: + path: ~/.composer/cache + key: composer-php${{ matrix.php-version }}-${{ matrix.dependency-preference }}-${{ hashFiles('composer.json') }} + restore-keys: | + composer-php${{ matrix.php-version }}-${{ matrix.dependency-preference }}- + composer-php${{ matrix.php-version }}- + - name: Install dependencies + run: composer update --${{ matrix.dependency-preference }} --prefer-stable --no-interaction --no-progress + - name: Run tests with coverage + if: matrix.php-version == '8.4' && matrix.dependency-preference == 'prefer-stable' + run: composer test:coverage:ci + - name: Enforce 85% coverage threshold + if: matrix.php-version == '8.4' && matrix.dependency-preference == 'prefer-stable' + run: | + php -r " + \$x = new SimpleXMLElement(file_get_contents('coverage.xml')); + \$m = \$x->project->metrics; + \$statements = (int)\$m['statements']; + if (\$statements === 0) { echo 'Error: zero statements in coverage report'; exit(1); } + \$pct = round(((int)\$m['coveredstatements'] / \$statements) * 100, 2); + echo \"Code coverage: {\$pct}%\n\"; + exit(\$pct >= 85.0 ? 0 : 1); + " + - name: Upload coverage report + if: matrix.php-version == '8.4' && matrix.dependency-preference == 'prefer-stable' + uses: actions/upload-artifact@v4 + with: + name: coverage-report + path: coverage.xml + retention-days: 30 + - name: Run tests without coverage + if: matrix.php-version != '8.4' || matrix.dependency-preference != 'prefer-stable' + run: composer test + - name: Run cross-SDK parity tests + run: composer test:cross-sdk diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..fe464b5 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,43 @@ +name: Release + +on: + workflow_run: + workflows: ['CI'] + types: [completed] + branches: [main] + +permissions: + contents: write + +jobs: + release: + name: Semantic Release + runs-on: ubuntu-latest + if: github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.event == 'push' + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + persist-credentials: true + token: ${{ secrets.GITHUB_TOKEN }} + + - uses: actions/setup-node@v4 + with: + node-version: 'lts/*' + + - uses: shivammathur/setup-php@v2 + with: + php-version: '8.4' + tools: composer:v2 + coverage: none + + - name: Install PHP dependencies + run: composer install --no-interaction --no-progress + + - name: Install Node dependencies + run: yarn install --immutable + + - name: Run semantic-release + run: yarn release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/split.yml b/.github/workflows/split.yml new file mode 100644 index 0000000..79ed188 --- /dev/null +++ b/.github/workflows/split.yml @@ -0,0 +1,50 @@ +name: Split Monorepo + +on: + workflow_dispatch: + +jobs: + split: + name: Split ${{ matrix.package.name }} + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + package: + - { name: 'Api', local_path: 'packages/Api', split_repository: 'php-sdk-api' } + - { name: 'Bucketing', local_path: 'packages/Bucketing', split_repository: 'php-sdk-bucketing' } + - { name: 'Data', local_path: 'packages/Data', split_repository: 'php-sdk-data' } + - { name: 'Enums', local_path: 'packages/Enums', split_repository: 'php-sdk-enums' } + - { name: 'Event', local_path: 'packages/Event', split_repository: 'php-sdk-event' } + - { name: 'Experience', local_path: 'packages/Experience', split_repository: 'php-sdk-experience' } + - { name: 'Logger', local_path: 'packages/Logger', split_repository: 'php-sdk-logger' } + - { name: 'Php-sdk', local_path: 'packages/Php-sdk', split_repository: 'php-sdk' } + - { name: 'Rules', local_path: 'packages/Rules', split_repository: 'php-sdk-rules' } + - { name: 'Segments', local_path: 'packages/Segments', split_repository: 'php-sdk-segments' } + - { name: 'Types', local_path: 'packages/Types', split_repository: 'php-sdk-types' } + - { name: 'Utils', local_path: 'packages/Utils', split_repository: 'php-sdk-utils' } + env: + GITHUB_TOKEN: ${{ secrets.SPLIT_TOKEN }} + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - if: "!startsWith(github.ref, 'refs/tags/')" + uses: danharrin/monorepo-split-github-action@v2.4.4 + with: + package_directory: ${{ matrix.package.local_path }} + repository_organization: 'convertcom' + repository_name: ${{ matrix.package.split_repository }} + user_name: 'convert-ci-bot' + user_email: 'ci@convert.com' + + - if: "startsWith(github.ref, 'refs/tags/')" + uses: danharrin/monorepo-split-github-action@v2.4.4 + with: + tag: ${{ github.ref_name }} + package_directory: ${{ matrix.package.local_path }} + repository_organization: 'convertcom' + repository_name: ${{ matrix.package.split_repository }} + user_name: 'convert-ci-bot' + user_email: 'ci@convert.com' diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..51934e6 --- /dev/null +++ b/.gitignore @@ -0,0 +1,11 @@ +/vendor/ +/packages/*/vendor/ +/packages/*/composer.lock +.DS_Store +.phpunit.result.cache +coverage-report/ +coverage.xml +.php-cs-fixer.cache +node_modules/ +.pnp.* +.yarn/ diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php new file mode 100644 index 0000000..cf4f041 --- /dev/null +++ b/.php-cs-fixer.dist.php @@ -0,0 +1,46 @@ +in(array_filter($directories, 'is_dir')) + ->name('*.php'); + +return (new PhpCsFixer\Config()) + ->setRules([ + '@PSR12' => true, + 'strict_param' => true, + 'declare_strict_types' => true, + 'array_syntax' => ['syntax' => 'short'], + 'no_unused_imports' => true, + 'ordered_imports' => ['sort_algorithm' => 'alpha'], + 'single_quote' => true, + 'trailing_comma_in_multiline' => true, + ]) + ->setFinder($finder) + ->setRiskyAllowed(true); diff --git a/.yarnrc.yml b/.yarnrc.yml new file mode 100644 index 0000000..3186f3f --- /dev/null +++ b/.yarnrc.yml @@ -0,0 +1 @@ +nodeLinker: node-modules diff --git a/README.md b/README.md new file mode 100644 index 0000000..f1e4ebb --- /dev/null +++ b/README.md @@ -0,0 +1,666 @@ +# Convert PHP SDK + +The official PHP SDK for [Convert Experiences](https://www.convert.com/) — a server-side A/B testing and feature flagging platform. + +Bucket visitors into experiment variations, resolve feature flags with typed variables, track goal conversions, and report revenue — all with deterministic, cross-SDK parity with the Convert JavaScript SDK. + +## Table of Contents + +- [Requirements](#requirements) +- [Installation](#installation) +- [Quick Start](#quick-start) +- [Configuration](#configuration) +- [Data Persistence](#data-persistence) +- [Visitor Context](#visitor-context) +- [Experience Bucketing](#experience-bucketing) +- [Feature Flags](#feature-flags) +- [Conversion Tracking](#conversion-tracking) +- [Revenue Reporting](#revenue-reporting) +- [Force Multiple Transactions](#force-multiple-transactions) +- [Flushing Events](#flushing-events) +- [Event System](#event-system) +- [Logging](#logging) +- [Return Types](#return-types) +- [Testing](#testing) +- [License](#license) + +## Requirements + +- PHP 8.2, 8.3, or 8.4 +- A PSR-18 HTTP client (e.g., `guzzlehttp/guzzle ^7`) +- A [Convert Experiences](https://www.convert.com/) account with an SDK key + +The SDK auto-discovers your PSR-18 client via [`php-http/discovery`](https://github.com/php-http/discovery). Install any compliant client — no adapter code needed. + +## Installation + +```bash +composer require convertcom/php-sdk +``` + +This installs the SDK and its external PSR dependencies. The key runtime dependencies are: + +- `psr/log ^3.0` (PSR-3 logging interface) +- `psr/simple-cache ^3.0` (PSR-16 caching interface) +- `php-http/discovery ^1.19` (auto-discovers your HTTP client) + +## Quick Start + +```php + 'your-sdk-key', +]); + +// 2. Create a visitor context +$context = $sdk->createContext('visitor-123', [ + 'country' => 'US', + 'plan' => 'premium', +]); + +// 3. Run an experience +$variation = $context->runExperience('homepage-redesign'); + +if ($variation !== null) { + echo "Variation: {$variation->variationKey}\n"; +} + +// 4. Resolve a feature flag +$feature = $context->runFeature('dark-mode'); + +if ($feature !== null && $feature->status->value === 'enabled') { + $theme = $feature->variables['theme'] ?? 'dark'; +} + +// 5. Track a conversion with revenue +$context->trackConversion('purchase-completed', new ConversionAttributes( + conversionData: [ + new GoalData(GoalDataKey::Amount, 49.99), + new GoalData(GoalDataKey::TransactionId, 'txn-abc-123'), + ], +)); + +// Events auto-flush on shutdown in PHP-FPM, or flush manually: +$sdk->flush(); +``` + +## Configuration + +### Initialize with SDK key (remote config fetch) + +```php +$sdk = ConvertSDK::create([ + 'sdkKey' => 'your-sdk-key', +]); +``` + +The SDK fetches project configuration from the Convert CDN on initialization. The config is cached using a PSR-16 cache (defaults to an in-memory array cache). + +### Initialize with direct config data + +```php +$sdk = ConvertSDK::create([ + 'data' => [ + 'account_id' => '100123456', + 'project' => [ + 'id' => '10045678', + // ... full project config + ], + ], +]); +``` + +Pass a config array (or `ConfigResponseData` object) directly to skip the HTTP fetch. Useful for testing or when you manage config distribution yourself. + +### Inject a PSR-3 logger + +```php +use Monolog\Logger; +use Monolog\Handler\StreamHandler; + +$logger = new Logger('convert'); +$logger->pushHandler(new StreamHandler('php://stderr')); + +$sdk = ConvertSDK::create([ + 'sdkKey' => 'your-sdk-key', + 'logger' => $logger, +]); +``` + +Pass any PSR-3 `LoggerInterface`. When omitted, a `NullLogger` is used (no output). + +### Inject a PSR-16 cache + +```php +use Symfony\Component\Cache\Psr16Cache; +use Symfony\Component\Cache\Adapter\RedisAdapter; + +$cache = new Psr16Cache(RedisAdapter::createConnection('redis://localhost')); + +$sdk = ConvertSDK::create([ + 'sdkKey' => 'your-sdk-key', + 'cache' => $cache, +]); +``` + +Pass any PSR-16 `CacheInterface`. When omitted, an in-memory `ArrayCache` is used (no persistence between requests). + +**Important:** The PSR-16 cache also serves as the visitor data store. When you provide a persistent cache (Redis, Memcached, filesystem), the SDK automatically persists visitor bucketing decisions across HTTP requests. This enables conversion tracking in later requests to be correctly attributed to experiment variations. See [Data Persistence](#data-persistence) for details. + +### Full configuration options + +```php +$sdk = ConvertSDK::create([ + 'sdkKey' => 'your-sdk-key', // SDK key for remote config + 'data' => [...], // Direct config data (alternative to sdkKey) + 'logger' => $logger, // PSR-3 LoggerInterface + 'cache' => $cache, // PSR-16 CacheInterface (also used for visitor data persistence) + 'dataStore' => $customStore, // Custom data store (overrides cache for visitor data) + 'dataRefreshInterval' => 300000, // Config cache TTL in milliseconds (default: 300000 = 5 min) + 'environment' => 'production', // Environment targeting +]); +``` + +You must provide either `sdkKey` or `data`. If both are missing, an `InvalidArgumentException` is thrown. + +## Data Persistence + +Unlike browser-based SDKs (where `localStorage` persists visitor state automatically), PHP scripts are short-lived — each HTTP request starts fresh. For conversion tracking to work across requests (e.g., bucketing on page 1, purchase on page 3), the SDK needs persistent storage for visitor bucketing decisions. + +### How it works + +The SDK uses the PSR-16 cache for two purposes: + +1. **Config caching** — caches project configuration fetched from the Convert CDN +2. **Visitor data store** — persists bucketing decisions and goal deduplication state + +When you provide a persistent PSR-16 cache (Redis, Memcached, filesystem, database), both work automatically. The default in-memory `ArrayCache` does not persist between requests. + +### Example: Redis-backed persistence + +```php +use ConvertSdk\ConvertSDK; +use Symfony\Component\Cache\Psr16Cache; +use Symfony\Component\Cache\Adapter\RedisAdapter; + +$cache = new Psr16Cache(RedisAdapter::createConnection('redis://localhost')); + +$sdk = ConvertSDK::create([ + 'sdkKey' => 'your-sdk-key', + 'cache' => $cache, +]); + +// Request 1: Visitor is bucketed +$context = $sdk->createContext('visitor-123', ['country' => 'US']); +$variation = $context->runExperience('homepage-redesign'); +// Bucketing decision is persisted to Redis + +// --- later, in a separate HTTP request --- + +// Request 2: Conversion is attributed to the correct variation +$context = $sdk->createContext('visitor-123'); +$context->trackConversion('purchase-completed'); +// SDK retrieves bucketing from Redis → conversion is linked to the variation +``` + +### Visitor ID continuity + +The SDK identifies visitors by the `$visitorId` you pass to `createContext()`. You are responsible for providing the same ID across requests. Common approaches: + +- **Session ID** — `session_id()` (works for web apps with PHP sessions) +- **Cookie** — a persistent cookie with a unique visitor token +- **Authenticated user ID** — for logged-in users + +### Custom data store + +If you need a separate storage backend for visitor data (distinct from config caching), pass a `dataStore` option. Any object with `get(string $key): mixed` and `set(string $key, mixed $value): void` methods works: + +```php +$sdk = ConvertSDK::create([ + 'sdkKey' => 'your-sdk-key', + 'cache' => $configCache, // Used for config caching only + 'dataStore' => $visitorStore, // Used for visitor data persistence +]); +``` + +When `dataStore` is provided, it takes precedence over `cache` for visitor data. + +## Visitor Context + +Create a context for each visitor. The context holds visitor attributes and provides the API for bucketing, feature flags, and conversion tracking. + +```php +$context = $sdk->createContext('visitor-123', [ + 'country' => 'US', + 'plan' => 'premium', + 'age' => 30, +]); +``` + +**Parameters:** + +| Parameter | Type | Required | Description | +|---|---|---|---| +| `$visitorId` | `string` | Yes | Unique visitor identifier. Must not be empty. | +| `$visitorAttributes` | `array\|null` | No | Key-value pairs for audience targeting. | + +**Returns:** `ContextInterface|null` — `null` if the SDK is not initialized. + +### Update attributes after creation + +```php +// Set a single attribute +$context->setAttribute('plan', 'enterprise'); + +// Set multiple attributes (merges with existing) +$context->setAttributes(['country' => 'UK', 'device' => 'mobile']); + +// Read current attributes +$attributes = $context->getAttributes(); +``` + +## Experience Bucketing + +### Run a single experience + +```php +$variation = $context->runExperience('homepage-redesign'); + +if ($variation !== null) { + echo "Experience: {$variation->experienceKey}\n"; + echo "Variation: {$variation->variationKey}\n"; + echo "Changes: " . json_encode($variation->changes) . "\n"; +} +``` + +**Returns:** `BucketedVariation|null` — `null` if the visitor does not qualify (audience/location rules, traffic allocation) or the experience key is not found. + +### Run all experiences + +```php +$variations = $context->runExperiences(); + +foreach ($variations as $variation) { + echo "{$variation->experienceKey} => {$variation->variationKey}\n"; +} +``` + +**Returns:** `BucketedVariation[]` — an array of all variations the visitor qualifies for. + +### Location-scoped bucketing + +Pass `BucketingAttributes` to scope bucketing to a specific location: + +```php +use OpenAPI\Client\BucketingAttributes; + +$variation = $context->runExperience('checkout-flow', new BucketingAttributes([ + 'locationProperties' => ['page' => '/checkout'], +])); +``` + +## Feature Flags + +### Resolve a single feature + +```php +use ConvertSdk\Enums\FeatureStatus; + +$feature = $context->runFeature('dark-mode'); + +if ($feature !== null && $feature->status === FeatureStatus::Enabled) { + $theme = $feature->variables['theme'] ?? 'dark'; + $intensity = $feature->variables['intensity'] ?? 80; + echo "Dark mode: theme={$theme}, intensity={$intensity}\n"; +} +``` + +**Returns:** `BucketedFeature|null` — `null` if the feature key is not found or the visitor does not qualify. + +### Resolve all features + +```php +$features = $context->runFeatures(); + +foreach ($features as $feature) { + echo "{$feature->featureKey}: {$feature->status->value}\n"; + foreach ($feature->variables as $key => $value) { + echo " {$key} = {$value}\n"; + } +} +``` + +**Returns:** `BucketedFeature[]` — an array of all resolved features. + +## Conversion Tracking + +Track a goal conversion for the current visitor: + +```php +$result = $context->trackConversion('signup-completed'); +``` + +**Parameters:** + +| Parameter | Type | Required | Description | +|---|---|---|---| +| `$goalKey` | `string` | Yes | The goal key defined in your Convert project. | +| `$attributes` | `ConversionAttributes\|null` | No | Optional conversion data, rule data, and settings. | + +**Returns:** `RuleError|bool|null` + +| Return Value | Meaning | +|---|---| +| `null` | Conversion tracked successfully. | +| `false` | Goal key not found in project config, or goal rules did not match. | +| `RuleError` | Rule evaluation error (e.g., missing data). | + +### Deduplication + +By default, each goal fires **once per visitor**. Calling `trackConversion()` a second time for the same visitor and goal is a no-op. See [Force Multiple Transactions](#force-multiple-transactions) to override this. + +### Goal rule matching + +If a goal has targeting rules, pass `ruleData` to evaluate them: + +```php +use ConvertSdk\DTO\ConversionAttributes; + +$context->trackConversion('checkout-goal', new ConversionAttributes( + ruleData: ['page_type' => 'checkout', 'cart_value' => 100], +)); +``` + +The conversion only fires if the rules match. + +## Revenue Reporting + +Track revenue by passing `GoalData` entries with your conversion: + +```php +use ConvertSdk\DTO\ConversionAttributes; +use ConvertSdk\DTO\GoalData; +use ConvertSdk\Enums\GoalDataKey; + +$context->trackConversion('purchase-completed', new ConversionAttributes( + conversionData: [ + new GoalData(GoalDataKey::Amount, 99.99), + new GoalData(GoalDataKey::ProductsCount, 3), + new GoalData(GoalDataKey::TransactionId, 'txn-abc-123'), + ], +)); +``` + +When `conversionData` is present, the SDK sends **two events**: a conversion event and a transaction event (with the goal data). This matches the JS SDK behavior. + +### Available GoalDataKey values + +| Key | Backed Value | Type | +|---|---|---| +| `GoalDataKey::Amount` | `'amount'` | `int\|float` | +| `GoalDataKey::ProductsCount` | `'productsCount'` | `int` | +| `GoalDataKey::TransactionId` | `'transactionId'` | `string` | +| `GoalDataKey::CustomDimension1` | `'customDimension1'` | `int\|float\|string` | +| `GoalDataKey::CustomDimension2` | `'customDimension2'` | `int\|float\|string` | +| `GoalDataKey::CustomDimension3` | `'customDimension3'` | `int\|float\|string` | +| `GoalDataKey::CustomDimension4` | `'customDimension4'` | `int\|float\|string` | +| `GoalDataKey::CustomDimension5` | `'customDimension5'` | `int\|float\|string` | + +## Force Multiple Transactions + +By default, goal deduplication prevents the same goal from firing twice for one visitor. For recurring transactions (e.g., subscription renewals), override deduplication: + +```php +use ConvertSdk\DTO\ConversionAttributes; +use ConvertSdk\DTO\GoalData; +use ConvertSdk\Enums\GoalDataKey; +use ConvertSdk\Enums\ConversionSettingKey; + +$context->trackConversion('subscription-renewal', new ConversionAttributes( + conversionData: [ + new GoalData(GoalDataKey::Amount, 29.99), + new GoalData(GoalDataKey::TransactionId, 'renewal-456'), + ], + conversionSetting: [ + ConversionSettingKey::ForceMultipleTransactions->value => true, + ], +)); +``` + +### Behavior matrix + +| Scenario | Conversion Event | Transaction Event | +|---|---|---| +| First trigger, no goal data | Sent | Not sent | +| First trigger, with goal data | Sent | Sent | +| Repeat trigger, no force | Not sent | Not sent | +| Repeat trigger, force=true, no goal data | Not sent | Not sent | +| Repeat trigger, force=true, with goal data | Not sent | Sent | + +## Flushing Events + +The SDK batches tracking events and posts them to the Convert Tracking API as a single HTTP POST. Events flush in two ways: + +1. **PHP-FPM shutdown** — `register_shutdown_function` calls `fastcgi_finish_request()` (releases the HTTP response first), then flushes all queued events. This is automatic and requires no developer action. +2. **Manual flush** — call `flush()` explicitly when you need events sent before the script ends. + +```php +// Flush all queued events +$sdk->flush(); +``` + +In typical PHP usage, the shutdown handler flushes automatically — you only need `flush()` in long-running scripts or when you need to verify events were sent (e.g., in tests). + +Failed POST requests are retried up to 2 times with exponential backoff (100ms, 300ms). HTTP 4xx errors are not retried. + +## Event System + +Subscribe to SDK lifecycle events: + +```php +use ConvertSdk\Enums\SystemEvents; + +// SDK ready (fires once, deferred — if you subscribe after init, you still get it) +$sdk->on(SystemEvents::Ready->value, function (mixed $args, mixed $err): void { + if ($err !== null) { + echo "SDK init failed: {$err->getMessage()}\n"; + return; + } + echo "SDK ready\n"; +}); + +// Bucketing event +$sdk->on(SystemEvents::Bucketing->value, function (mixed $args): void { + echo "Visitor bucketed\n"; +}); + +// Conversion tracked +$sdk->on(SystemEvents::Conversion->value, function (mixed $args): void { + echo "Conversion tracked\n"; +}); + +// API queue released (success or failure) +$sdk->on(SystemEvents::ApiQueueReleased->value, function (mixed $args): void { + echo "Events posted to tracking API\n"; +}); +``` + +### Available events + +| Event | Fired When | +|---|---| +| `SystemEvents::Ready` | SDK initialization completes (success or failure). Deferred — late subscribers still receive it. | +| `SystemEvents::ConfigUpdated` | Config is refreshed after initial load. | +| `SystemEvents::Bucketing` | A visitor is bucketed into an experience variation. | +| `SystemEvents::Conversion` | A goal conversion is tracked. | +| `SystemEvents::ApiQueueReleased` | The event queue is flushed to the Tracking API. | +| `SystemEvents::Segments` | Segments are evaluated. | +| `SystemEvents::LocationActivated` | A location rule matches. | +| `SystemEvents::LocationDeactivated` | A location rule stops matching. | +| `SystemEvents::Audiences` | Audience rules are evaluated. | + +## Logging + +The SDK uses PSR-3 logging. Pass any `LoggerInterface` at initialization: + +```php +use Monolog\Logger; +use Monolog\Handler\StreamHandler; + +$logger = new Logger('convert-sdk'); +$logger->pushHandler(new StreamHandler('php://stderr', \Monolog\Level::Debug)); + +$sdk = ConvertSDK::create([ + 'sdkKey' => 'your-sdk-key', + 'logger' => $logger, +]); +``` + +When no logger is provided, the SDK uses `Psr\Log\NullLogger` (silent). + +The SDK logs at these levels: + +| Level | What is logged | +|---|---| +| `trace` | Internal method calls, config data, initialization steps | +| `debug` | Event firing, entity lookups, bucketing internals | +| `warn` | Failed HTTP requests, retry attempts, discarded batches | +| `error` | Initialization failures, config fetch errors, invalid config | + +## Return Types + +### BucketedVariation + +Returned by `runExperience()` and `runExperiences()`. + +```php +readonly class BucketedVariation +{ + public string $experienceId; + public string $experienceKey; + public string $variationId; + public string $variationKey; + public array $changes; // Variation changes (DOM mutations, redirects, etc.) +} +``` + +### BucketedFeature + +Returned by `runFeature()` and `runFeatures()`. + +```php +readonly class BucketedFeature +{ + public string $featureId; + public string $featureKey; + public FeatureStatus $status; // FeatureStatus::Enabled or FeatureStatus::Disabled + public array $variables; // Resolved feature variables (key => value) +} +``` + +### ConversionAttributes + +Passed to `trackConversion()`. + +```php +readonly class ConversionAttributes +{ + public ?array $ruleData; // Key-value pairs for goal rule matching + public ?array $conversionData; // Array of GoalData entries + public ?array $conversionSetting; // Behavior overrides (e.g., forceMultipleTransactions) +} +``` + +### GoalData + +Individual revenue/goal data entry. + +```php +readonly class GoalData +{ + public GoalDataKey $key; // GoalDataKey enum (Amount, TransactionId, etc.) + public int|float|string $value; +} +``` + +## Testing + +Run the full test suite from the repository root: + +```bash +# All tests +composer test + +# Unit tests only +composer test:unit + +# Cross-SDK parity tests +composer test:cross-sdk + +# Integration tests +composer test:integration + +# Coverage report (requires PCOV) +composer test:coverage +``` + +Static analysis and code style: + +```bash +# PHPStan (level 6) +composer analyze + +# PHP-CS-Fixer (PSR-12) +composer cs-check + +# Fix code style +composer cs-fix +``` + +### Integration test environment variables + +The integration test suite supports three auth modes, each running the full test suite: + +- **static** — uses a bundled JSON config file (no network calls) +- **live** — fetches config from the staging CDN using `sdkKey` only (requires `CONVERT_STAGING_SDK_KEY`) +- **live-secret** — fetches config using `sdkKey` + `sdkKeySecret` Bearer auth (requires `CONVERT_STAGING_SDK_KEY2` and `CONVERT_STAGING_SDK_KEY2_SECRET`) + +When the required env vars for a live mode are absent, those tests are skipped automatically — unit and static-mode tests still run normally. + +PHP's `getenv()` reads **OS-level environment variables only** (not `.env` files). You must `export` the variables in your shell before running the tests: + +```bash +export CONVERT_STAGING_SDK_KEY=xxx CONVERT_STAGING_SDK_KEY2=yyy CONVERT_STAGING_SDK_KEY2_SECRET=zzz && composer test:integration +``` + +Or set and run in one line without persisting: + +```bash +CONVERT_STAGING_SDK_KEY=xxx CONVERT_STAGING_SDK_KEY2=yyy CONVERT_STAGING_SDK_KEY2_SECRET=zzz composer test:integration +``` + +### Supported environment variables + +| Variable | Used By | Default | Description | +|---|---|---|---| +| `CONVERT_STAGING_SDK_KEY` | Integration tests | *(none — live tests skipped when absent)* | SDK key for the Convert staging project. Enables `live` mode integration tests that fetch real config and post real tracking events. | +| `CONVERT_STAGING_SDK_KEY2` | Integration tests | *(none — live-secret tests skipped when absent)* | SDK key for the `live-secret` auth mode. Used with `sdkKeySecret` to test Bearer-authenticated config fetching. | +| `CONVERT_STAGING_SDK_KEY2_SECRET` | Integration tests | *(none — live-secret tests skipped when absent)* | SDK key secret for the `live-secret` auth mode. Sent as a `Bearer` token in the `Authorization` header. | +| `CONFIG_ENDPOINT` | SDK runtime | `https://cdn-4.convertexperiments.com/api/v1` | Override the CDN endpoint used to fetch project configuration. Useful for pointing at a staging or local server. | +| `TRACK_ENDPOINT` | SDK runtime | `https://[project_id].metrics.convertexperiments.com/v1` | Override the Tracking API endpoint used to post events. `[project_id]` is replaced at runtime with the actual project ID. | +| `VERSION` | SDK runtime | `php-sdk` | Override the source identifier sent with tracking requests (the `network.source` field). | + +> **Note:** Because `getenv()` only reads OS-level environment variables, libraries like `vlucas/phpdotenv` that populate `$_ENV` or `$_SERVER` will **not** make these values visible to the SDK. Always use `export` or inline assignment as shown above. + +## License + +Apache-2.0 — see [LICENSE](LICENSE) for details. diff --git a/RELEASE.md b/RELEASE.md new file mode 100644 index 0000000..fdee252 --- /dev/null +++ b/RELEASE.md @@ -0,0 +1,303 @@ +# Release Process + +## Release Chain Overview + +``` +PR merged to main + -> CI workflow runs (lint, analyze, test) + -> Release workflow triggers (after CI passes) + -> semantic-release analyzes commits since last tag + -> If feat:/fix:/refactor: found: + -> Calculate next version (custom rollover logic) + -> Generate/update CHANGELOG.md + -> Run monorepo-builder bump-interdependency to sync all package versions + -> Commit version bumps + CHANGELOG + -> Create git tag (v1.x.y) + -> Push tag to monorepo + -> Packagist webhook on the monorepo detects new tag + -> Auto-publishes new version of convertcom/php-sdk +``` + +## Versioning Scheme + +This project uses a **digit-capped semver** scheme. Each version position is capped at 9 and rolls over to the next position: + +| Scenario | Current | Bump Type | Next | +|----------|---------|-----------|------| +| Normal patch | 1.0.3 | patch | 1.0.4 | +| Patch at cap | 1.0.9 | patch | 1.1.0 | +| Normal minor | 1.2.5 | minor | 1.3.0 | +| Minor at cap | 1.9.3 | minor | 2.0.0 | +| Full cap | 1.9.9 | patch | 2.0.0 | +| Breaking change | 1.2.5 | major | 2.0.0 | + +Major bumps happen either directly via `BREAKING CHANGE` commits (standard semver) or via rollover when a digit exceeds 9. + +## Commit Convention + +Only conventional commits trigger releases: + +| Commit Type | Release Type | In CHANGELOG | +|-------------|-------------|-------------| +| `fix:` | patch | Yes (Bug Fixes) | +| `feat:` | patch | Yes (Features) | +| `refactor:` | minor | Yes (Refactoring) | +| `BREAKING CHANGE` (footer) | **major** | Yes | +| `chore:`, `docs:`, `ci:`, `test:`, `style:`, `perf:` | no release | No | + +## Automated Flow + +When a PR merges to `main`: + +1. **CI workflow** runs lint, static analysis, monorepo validation, and tests (6-job matrix) +2. **Release workflow** triggers after CI passes (via `workflow_run`) +3. **semantic-release** analyzes commits since the last tag +4. If releasable commits exist, it: + - Calculates the next version using the rollover plugin + - Updates `CHANGELOG.md` + - Runs `monorepo-builder bump-interdependency` and `monorepo-builder release` to sync all internal package versions (internal version sync is preserved for future split reactivation) + - Commits changes with `[skip ci]` to prevent infinite loops + - Creates and pushes a git tag (e.g., `v1.1.0`) +5. **Packagist webhook** on the monorepo detects the new tag and auto-publishes `convertcom/php-sdk` + +## Environment Requirements + +### Yarn node linker — **do not change** + +The repo ships a `.yarnrc.yml` with: + +```yaml +nodeLinker: node-modules +``` + +This is **load-bearing** for the release pipeline. Do not remove it, and do not switch to yarn's PnP linker. + +**Why:** `@semantic-release/release-notes-generator` loads the `conventionalcommits` preset via `import-from-esm`, which performs string-based dynamic imports by walking `node_modules/`. Yarn's default PnP linker does not produce a `node_modules/` tree and enforces strict dependency boundaries, so the dynamic import fails with `Cannot find module 'conventional-changelog-conventionalcommits'` — breaking every `yarn release` run. The same failure mode would surface for several other semantic-release plugins that use dynamic preset loading. + +The classic `node-modules` linker eliminates this class of problem without changing what yarn installs or locks — only where the files live on disk. This repo uses yarn solely to run semantic-release, so PnP's strict-dependency benefits are not in use; the `node-modules` linker is the correct choice. + +If you see `Cannot find module ''` errors from semantic-release plugins in CI or locally, check `.yarnrc.yml` is present and contains `nodeLinker: node-modules`, then re-run `yarn install`. + +## Packagist Setup + +One-time setup for the monorepo: + +1. Go to [packagist.org](https://packagist.org) > Submit > enter the monorepo GitHub URL +2. Enable the **GitHub Service Hook** on the monorepo, or manually configure a webhook: + - URL: `https://packagist.org/api/github?username=PACKAGIST_USERNAME` + - Add the Packagist API token as a secret in the GitHub repo settings +3. Alternative: use Packagist's **auto-update** feature (polls GitHub periodically) + +## Manual Release + +To verify what semantic-release would do without actually releasing: + +```bash +yarn release --dry-run +``` + +This analyzes commits and prints the calculated version without creating tags or commits. To run the full pipeline (including `generateNotes`) on a feature branch for pre-merge verification, push the branch to `origin` first, then: + +```bash +yarn release --dry-run --branches $(git rev-parse --abbrev-ref HEAD) +``` + +The `--branches` override lets semantic-release treat the current branch as a release branch for the dry-run only; no tags or commits are created. + +## Prerequisites + +One-time setup items required before the automated pipeline works: + +- [ ] **Monorepo registered on Packagist** pointing at the monorepo GitHub URL, with the GitHub webhook configured (see Packagist Setup above) +- [ ] `yarn install` run once to generate `yarn.lock` (committed to repo) + +## First Release + +The first release is produced automatically by the pipeline -- no manual tagging is required. On the first merge to `main` after the release workflow is configured, semantic-release observes that no prior `v*` tag exists, so it: + +1. Treats every releasable commit in history (all `fix:` / `feat:` / `refactor:` since project inception) as part of the first release +2. Emits `v1.0.0` as the version (semantic-release's fixed first-release default, regardless of the rollover logic's bump type) +3. Generates a correspondingly long `CHANGELOG.md` entry covering the full history, grouped by commit type +4. Commits `CHANGELOG.md` + bumped `composer.json` files and pushes tag `v1.0.0` +5. Packagist (once registered) picks up `v1.0.0` on the tag push and publishes + +The one-time long CHANGELOG is expected on the first release. Every subsequent release analyzes only the commits since the previous tag and will produce a small, focused CHANGELOG entry. + +Do not create a `v1.0.0` tag manually before or after the first merge -- the pipeline owns this, and a pre-existing tag will either be raced or block the automated tag push. + +## Troubleshooting + +### No release created after merge + +- Check that commits use conventional format (`feat:`, `fix:`, `refactor:`) +- `chore:`, `docs:`, `ci:`, `test:` commits do NOT trigger releases +- Run `yarn release --dry-run` locally to debug + +### Version rollover unexpected + +- Review the rollover truth table in the versioning scheme section +- Check `scripts/rollover-version-plugin.mjs` for the translation logic +- The plugin logs its analysis: `logical=, lastVersion=, effective=` + +### CI re-runs after release commit + +- The release commit message includes `[skip ci]` -- this should prevent it +- If CI still runs, verify the CI workflow respects `[skip ci]` in its trigger conditions + +### `Cannot find module ''` from a semantic-release plugin + +- Confirm `.yarnrc.yml` contains `nodeLinker: node-modules` (see Environment Requirements) +- Run `yarn install` to regenerate `node_modules/` +- Do not commit `.pnp.*` files or switch the linker to PnP + +### How to re-enable split publishing + +If you need to publish individual packages (`convertcom/php-sdk-api`, `convertcom/php-sdk-bucketing`, etc.) to their own Packagist entries, follow the [Reactivating 12-Package Split Publishing](#reactivating-12-package-split-publishing) section below. + +--- + +# Reactivating 12-Package Split Publishing + +This section describes how to switch from the current single-package publishing model (`convertcom/php-sdk` published from the monorepo root) back to 12 individually published packages, each in its own read-only split repository on GitHub. + +## When to Reactivate + +The split publishing strategy is appropriate when: + +- Consumers need to install individual sub-packages independently (e.g., `convertcom/php-sdk-bucketing` without the full SDK) +- Package-level versioning diverges (one package gets a breaking change while others stay stable) +- Downstream CI pipelines depend on per-package Packagist webhooks for fine-grained dependency tracking + +Until one of these scenarios materializes, the single-package model is simpler to maintain and has no consumer-facing downsides. + +## Reactivation Prerequisites + +- GitHub org admin access to `convertcom` (to create repos and manage secrets) +- Packagist account with publish rights on `convertcom/*` packages +- The monorepo checked out locally with push access to `main` + +## Step 1: Create 12 Split Repositories + +Create empty repositories (no README, no license, no initial commit) under the `convertcom` GitHub organization: + +```bash +for repo in php-sdk-api php-sdk-bucketing php-sdk-data php-sdk-enums \ + php-sdk-event php-sdk-experience php-sdk-logger php-sdk \ + php-sdk-rules php-sdk-segments php-sdk-types php-sdk-utils; do + gh repo create "convertcom/$repo" --public \ + --description "Convert PHP SDK - ${repo#php-sdk-}" --confirm +done +``` + +The split action pushes the first commit to each repo. Do not initialize them with any content. + +## Step 2: Configure SPLIT_TOKEN PAT + +1. Create a **fine-grained Personal Access Token** (Settings > Developer settings > Fine-grained tokens) with: + - Repository access: select all 12 split repos created above + - Permissions: Contents (Read and write) +2. Add the token as a repository secret named `SPLIT_TOKEN` in the monorepo's Settings > Secrets and variables > Actions. + +The split workflow and release workflow both need this token. `GITHUB_TOKEN` cannot trigger other workflows (GitHub limitation), so a PAT is required when the release tag push must trigger the split workflow. + +## Step 3: Configure Packagist Webhooks + +Register each of the 12 packages on [Packagist](https://packagist.org): + +1. Go to packagist.org > Submit > enter the split repo URL (e.g., `https://github.com/convertcom/php-sdk-api`) +2. Enable the **GitHub Service Hook** on each split repo, or manually configure a webhook: + - URL: `https://packagist.org/api/github?username=PACKAGIST_USERNAME` + - Add the Packagist API token as a webhook secret +3. Alternative: use Packagist's **auto-update** feature (polls GitHub periodically) + +Also update the monorepo's Packagist entry to point back to the `convertcom/php-sdk` split repo (instead of the monorepo), or deregister the monorepo from Packagist entirely. + +## Step 4: Reactivate split.yml + +Edit `.github/workflows/split.yml` and change the `on:` block from: + +```yaml +on: + workflow_dispatch: +``` + +back to: + +```yaml +on: + push: + branches: [main] + tags: ['v*'] +``` + +This re-enables automatic split propagation on every push to `main` and on every version tag. + +## Step 5: Revert Root composer.json to Monorepo Form + +The root `composer.json` needs to be reverted from "published library" mode back to "monorepo aggregator" mode. Reference commit `556084c` for the exact pre-change state. + +Changes required: + +1. Rename `"name"` from `"convertcom/php-sdk"` to `"convertcom/php-sdk-monorepo"` +2. Change `"type"` from `"library"` to `"project"` +3. Add `"private": true` +4. Restore the 12 path `"repositories"` entries: + ```json + "repositories": [ + { "type": "path", "url": "packages/Api" }, + { "type": "path", "url": "packages/Bucketing" }, + { "type": "path", "url": "packages/Data" }, + { "type": "path", "url": "packages/Enums" }, + { "type": "path", "url": "packages/Event" }, + { "type": "path", "url": "packages/Experience" }, + { "type": "path", "url": "packages/Logger" }, + { "type": "path", "url": "packages/Rules" }, + { "type": "path", "url": "packages/Segments" }, + { "type": "path", "url": "packages/Types" }, + { "type": "path", "url": "packages/Utils" }, + { "type": "path", "url": "packages/Php-sdk" } + ] + ``` +5. Replace the aggregated `"autoload"` and external `"require"` with internal package requires: + ```json + "require": { + "php": "^8.2", + "convertcom/php-sdk-api": ">=1.0.0", + "convertcom/php-sdk-data": ">=1.0.0", + "convertcom/php-sdk-enums": ">=1.0.0", + "convertcom/php-sdk-event": ">=1.0.0", + "convertcom/php-sdk-logger": ">=1.0.0", + "convertcom/php-sdk-utils": ">=1.0.0", + "convertcom/php-sdk": ">=1.0.0" + } + ``` +6. Remove the root-level `"autoload"` block (PSR-4 autoloading is handled by each package's own `composer.json` via path repositories) + +Run `rm -rf vendor composer.lock && composer install && composer test` to verify everything resolves correctly. + +## Step 6: Revert release.yml + +Edit `.github/workflows/release.yml`: + +1. In the checkout step, change `token: ${{ secrets.GITHUB_TOKEN }}` to `token: ${{ secrets.SPLIT_TOKEN }}` +2. In the semantic-release env, change `GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}` to `GITHUB_TOKEN: ${{ secrets.SPLIT_TOKEN }}` + +This ensures the tag push from semantic-release triggers the split workflow (PAT-based pushes trigger other workflows; `GITHUB_TOKEN` pushes do not). + +## Step 7: Verify + +1. **Dry-run release:** + ```bash + yarn release --dry-run + ``` + Confirm semantic-release calculates the next version without errors. + +2. **Manual-dispatch split:** + Go to Actions > Split Monorepo > Run workflow (on `main`). All 12 matrix jobs should succeed now that the split repos exist. + +3. **End-to-end test:** + Push a `feat:` commit to `main`. Verify: + - CI passes + - Release workflow creates a tag + - Split workflow triggers on the tag and propagates to all 12 repos + - Packagist shows the new version for each package diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..725b580 --- /dev/null +++ b/composer.json @@ -0,0 +1,96 @@ +{ + "name": "convertcom/php-sdk", + "description": "Convert PHP SDK - a PHP version of the Convert Insights SDK", + "type": "library", + "license": "Apache-2.0", + "authors": [ + { + "name": "Convert Insights, Inc", + "homepage": "https://www.convert.com" + } + ], + "require": { + "php": "^8.2", + "psr/log": "^3.0", + "psr/simple-cache": "^3.0", + "psr/http-client": "^1.0", + "psr/http-factory": "^1.0", + "psr/http-message": "^1.1 || ^2.0", + "php-http/discovery": "^1.19", + "lastguest/murmurhash": "^2.1", + "ext-curl": "*", + "ext-json": "*", + "ext-mbstring": "*", + "guzzlehttp/guzzle": "^7.3", + "guzzlehttp/psr7": "^1.7 || ^2.0" + }, + "require-dev": { + "phpunit/phpunit": "^11.0", + "friendsofphp/php-cs-fixer": "^3.0", + "phpstan/phpstan": "^2.0", + "symplify/monorepo-builder": "^12.0", + "php-http/mock-client": "^1.6", + "nyholm/psr7": "^1.8", + "monolog/monolog": "^3.8" + }, + "autoload": { + "psr-4": { + "ConvertSdk\\": [ + "packages/Api/src/", + "packages/Bucketing/src/", + "packages/Data/src/", + "packages/Experience/src/", + "packages/Logger/src/", + "packages/Php-sdk/src/", + "packages/Rules/src/", + "packages/Segments/src/" + ], + "ConvertSdk\\Config\\": "packages/Php-sdk/src/Config/", + "ConvertSdk\\Enums\\": "packages/Enums/src/", + "ConvertSdk\\Event\\": "packages/Event/src/", + "ConvertSdk\\Utils\\": "packages/Utils/src/", + "ConvertSdk\\Tests\\": "packages/Utils/tests/", + "OpenAPI\\Client\\": [ + "packages/Types/lib/", + "packages/Types/lib/Generated/" + ] + } + }, + "autoload-dev": { + "psr-4": { + "ConvertSdk\\Tests\\CrossSdk\\": "tests/CrossSdk/", + "ConvertSdk\\Tests\\Integration\\": "tests/Integration/" + } + }, + "scripts": { + "analyze": "phpstan analyse --memory-limit=512M", + "cs-check": "PHP_CS_FIXER_IGNORE_ENV=1 php-cs-fixer fix --dry-run --diff", + "cs-fix": "PHP_CS_FIXER_IGNORE_ENV=1 php-cs-fixer fix", + "test": "phpunit --testdox", + "test:unit": "phpunit --testsuite unit --testdox", + "test:cross-sdk": "phpunit --testsuite cross-sdk --testdox", + "test:integration": "phpunit --testsuite integration --testdox", + "test:coverage": "phpunit --coverage-html coverage-report --testdox", + "test:coverage:ci": "phpunit --testdox --coverage-clover coverage.xml --coverage-text --only-summary-for-coverage-text", + "api:build": "cd packages/Api && composer run-script build", + "data:build": "cd packages/Data && composer run-script build", + "enums:build": "cd packages/Enums && composer run-script build", + "event:build": "cd packages/Event && composer run-script build", + "logger:build": "cd packages/Logger && composer run-script build", + "utils:build": "cd packages/Utils && composer run-script build", + "sdk:build": "cd packages/Php-sdk && composer run-script build", + "build": [ + "@build:validate", + "@test", + "@analyze", + "@cs-check" + ], + "build:validate": "monorepo-builder validate", + "build:merge": "monorepo-builder merge" + }, + "config": { + "allow-plugins": { + "php-http/discovery": true + } + } +} diff --git a/composer.lock b/composer.lock new file mode 100644 index 0000000..1c3a1c4 --- /dev/null +++ b/composer.lock @@ -0,0 +1,6543 @@ +{ + "_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": "a529d34fc3aa8332cd91329a8dff16f7", + "packages": [ + { + "name": "guzzlehttp/guzzle", + "version": "7.10.0", + "source": { + "type": "git", + "url": "https://github.com/guzzle/guzzle.git", + "reference": "b51ac707cfa420b7bfd4e4d5e510ba8008e822b4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/b51ac707cfa420b7bfd4e4d5e510ba8008e822b4", + "reference": "b51ac707cfa420b7bfd4e4d5e510ba8008e822b4", + "shasum": "" + }, + "require": { + "ext-json": "*", + "guzzlehttp/promises": "^2.3", + "guzzlehttp/psr7": "^2.8", + "php": "^7.2.5 || ^8.0", + "psr/http-client": "^1.0", + "symfony/deprecation-contracts": "^2.2 || ^3.0" + }, + "provide": { + "psr/http-client-implementation": "1.0" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.8.2", + "ext-curl": "*", + "guzzle/client-integration-tests": "3.0.2", + "php-http/message-factory": "^1.1", + "phpunit/phpunit": "^8.5.39 || ^9.6.20", + "psr/log": "^1.1 || ^2.0 || ^3.0" + }, + "suggest": { + "ext-curl": "Required for CURL handler support", + "ext-intl": "Required for Internationalized Domain Name (IDN) support", + "psr/log": "Required for using the Log middleware" + }, + "type": "library", + "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": false + } + }, + "autoload": { + "files": [ + "src/functions_include.php" + ], + "psr-4": { + "GuzzleHttp\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Jeremy Lindblom", + "email": "jeremeamia@gmail.com", + "homepage": "https://github.com/jeremeamia" + }, + { + "name": "George Mponos", + "email": "gmponos@gmail.com", + "homepage": "https://github.com/gmponos" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://github.com/sagikazarmark" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" + } + ], + "description": "Guzzle is a PHP HTTP client library", + "keywords": [ + "client", + "curl", + "framework", + "http", + "http client", + "psr-18", + "psr-7", + "rest", + "web service" + ], + "support": { + "issues": "https://github.com/guzzle/guzzle/issues", + "source": "https://github.com/guzzle/guzzle/tree/7.10.0" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/guzzle", + "type": "tidelift" + } + ], + "time": "2025-08-23T22:36:01+00:00" + }, + { + "name": "guzzlehttp/promises", + "version": "2.3.0", + "source": { + "type": "git", + "url": "https://github.com/guzzle/promises.git", + "reference": "481557b130ef3790cf82b713667b43030dc9c957" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/promises/zipball/481557b130ef3790cf82b713667b43030dc9c957", + "reference": "481557b130ef3790cf82b713667b43030dc9c957", + "shasum": "" + }, + "require": { + "php": "^7.2.5 || ^8.0" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.8.2", + "phpunit/phpunit": "^8.5.44 || ^9.6.25" + }, + "type": "library", + "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": false + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Promise\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" + } + ], + "description": "Guzzle promises library", + "keywords": [ + "promise" + ], + "support": { + "issues": "https://github.com/guzzle/promises/issues", + "source": "https://github.com/guzzle/promises/tree/2.3.0" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/promises", + "type": "tidelift" + } + ], + "time": "2025-08-22T14:34:08+00:00" + }, + { + "name": "guzzlehttp/psr7", + "version": "2.9.0", + "source": { + "type": "git", + "url": "https://github.com/guzzle/psr7.git", + "reference": "7d0ed42f28e42d61352a7a79de682e5e67fec884" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/7d0ed42f28e42d61352a7a79de682e5e67fec884", + "reference": "7d0ed42f28e42d61352a7a79de682e5e67fec884", + "shasum": "" + }, + "require": { + "php": "^7.2.5 || ^8.0", + "psr/http-factory": "^1.0", + "psr/http-message": "^1.1 || ^2.0", + "ralouphie/getallheaders": "^3.0" + }, + "provide": { + "psr/http-factory-implementation": "1.0", + "psr/http-message-implementation": "1.0" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.8.2", + "http-interop/http-factory-tests": "0.9.0", + "jshttp/mime-db": "1.54.0.1", + "phpunit/phpunit": "^8.5.44 || ^9.6.25" + }, + "suggest": { + "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" + }, + "type": "library", + "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": false + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Psr7\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "George Mponos", + "email": "gmponos@gmail.com", + "homepage": "https://github.com/gmponos" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://github.com/sagikazarmark" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://sagikazarmark.hu" + } + ], + "description": "PSR-7 message implementation that also provides common utility methods", + "keywords": [ + "http", + "message", + "psr-7", + "request", + "response", + "stream", + "uri", + "url" + ], + "support": { + "issues": "https://github.com/guzzle/psr7/issues", + "source": "https://github.com/guzzle/psr7/tree/2.9.0" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/psr7", + "type": "tidelift" + } + ], + "time": "2026-03-10T16:41:02+00:00" + }, + { + "name": "lastguest/murmurhash", + "version": "2.1.1", + "source": { + "type": "git", + "url": "https://github.com/lastguest/murmurhash-php.git", + "reference": "0150ba26fb7025d1f936983a167cdc74149f87c8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/lastguest/murmurhash-php/zipball/0150ba26fb7025d1f936983a167cdc74149f87c8", + "reference": "0150ba26fb7025d1f936983a167cdc74149f87c8", + "shasum": "" + }, + "require": { + "php": "^7||^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^0.12", + "phpunit/phpunit": "^7||^9" + }, + "type": "library", + "autoload": { + "psr-4": { + "lastguest\\": "src/lastguest/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Stefano Azzolini", + "email": "lastguest@gmail.com", + "homepage": "https://github.com/lastguest/murmurhash-php" + } + ], + "description": "MurmurHash3 Hash", + "homepage": "https://github.com/lastguest/murmurhash-php", + "keywords": [ + "hash", + "hashing", + "murmur" + ], + "support": { + "issues": "https://github.com/lastguest/murmurhash-php/issues", + "source": "https://github.com/lastguest/murmurhash-php/tree/2.1.1" + }, + "time": "2021-04-13T16:23:45+00:00" + }, + { + "name": "php-http/discovery", + "version": "1.20.0", + "source": { + "type": "git", + "url": "https://github.com/php-http/discovery.git", + "reference": "82fe4c73ef3363caed49ff8dd1539ba06044910d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/discovery/zipball/82fe4c73ef3363caed49ff8dd1539ba06044910d", + "reference": "82fe4c73ef3363caed49ff8dd1539ba06044910d", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.0|^2.0", + "php": "^7.1 || ^8.0" + }, + "conflict": { + "nyholm/psr7": "<1.0", + "zendframework/zend-diactoros": "*" + }, + "provide": { + "php-http/async-client-implementation": "*", + "php-http/client-implementation": "*", + "psr/http-client-implementation": "*", + "psr/http-factory-implementation": "*", + "psr/http-message-implementation": "*" + }, + "require-dev": { + "composer/composer": "^1.0.2|^2.0", + "graham-campbell/phpspec-skip-example-extension": "^5.0", + "php-http/httplug": "^1.0 || ^2.0", + "php-http/message-factory": "^1.0", + "phpspec/phpspec": "^5.1 || ^6.1 || ^7.3", + "sebastian/comparator": "^3.0.5 || ^4.0.8", + "symfony/phpunit-bridge": "^6.4.4 || ^7.0.1" + }, + "type": "composer-plugin", + "extra": { + "class": "Http\\Discovery\\Composer\\Plugin", + "plugin-optional": true + }, + "autoload": { + "psr-4": { + "Http\\Discovery\\": "src/" + }, + "exclude-from-classmap": [ + "src/Composer/Plugin.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" + } + ], + "description": "Finds and installs PSR-7, PSR-17, PSR-18 and HTTPlug implementations", + "homepage": "http://php-http.org", + "keywords": [ + "adapter", + "client", + "discovery", + "factory", + "http", + "message", + "psr17", + "psr7" + ], + "support": { + "issues": "https://github.com/php-http/discovery/issues", + "source": "https://github.com/php-http/discovery/tree/1.20.0" + }, + "time": "2024-10-02T11:20:13+00:00" + }, + { + "name": "psr/http-client", + "version": "1.0.3", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-client.git", + "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-client/zipball/bb5906edc1c324c9a05aa0873d40117941e5fa90", + "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90", + "shasum": "" + }, + "require": { + "php": "^7.0 || ^8.0", + "psr/http-message": "^1.0 || ^2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Client\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP clients", + "homepage": "https://github.com/php-fig/http-client", + "keywords": [ + "http", + "http-client", + "psr", + "psr-18" + ], + "support": { + "source": "https://github.com/php-fig/http-client" + }, + "time": "2023-09-23T14:17:50+00:00" + }, + { + "name": "psr/http-factory", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-factory.git", + "reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-factory/zipball/2b4765fddfe3b508ac62f829e852b1501d3f6e8a", + "reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a", + "shasum": "" + }, + "require": { + "php": ">=7.1", + "psr/http-message": "^1.0 || ^2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "PSR-17: Common interfaces for PSR-7 HTTP message factories", + "keywords": [ + "factory", + "http", + "message", + "psr", + "psr-17", + "psr-7", + "request", + "response" + ], + "support": { + "source": "https://github.com/php-fig/http-factory" + }, + "time": "2024-04-15T12:06:14+00:00" + }, + { + "name": "psr/http-message", + "version": "2.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-message.git", + "reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/402d35bcb92c70c026d1a6a9883f06b2ead23d71", + "reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP messages", + "homepage": "https://github.com/php-fig/http-message", + "keywords": [ + "http", + "http-message", + "psr", + "psr-7", + "request", + "response" + ], + "support": { + "source": "https://github.com/php-fig/http-message/tree/2.0" + }, + "time": "2023-04-04T09:54:51+00:00" + }, + { + "name": "psr/log", + "version": "3.0.2", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/f16e1d5863e37f8d8c2a01719f5b34baa2b714d3", + "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3", + "shasum": "" + }, + "require": { + "php": ">=8.0.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "support": { + "source": "https://github.com/php-fig/log/tree/3.0.2" + }, + "time": "2024-09-11T13:17:53+00:00" + }, + { + "name": "psr/simple-cache", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/simple-cache.git", + "reference": "764e0b3939f5ca87cb904f570ef9be2d78a07865" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/764e0b3939f5ca87cb904f570ef9be2d78a07865", + "reference": "764e0b3939f5ca87cb904f570ef9be2d78a07865", + "shasum": "" + }, + "require": { + "php": ">=8.0.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\SimpleCache\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interfaces for simple caching", + "keywords": [ + "cache", + "caching", + "psr", + "psr-16", + "simple-cache" + ], + "support": { + "source": "https://github.com/php-fig/simple-cache/tree/3.0.0" + }, + "time": "2021-10-29T13:26:27+00:00" + }, + { + "name": "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/deprecation-contracts", + "version": "v3.6.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/deprecation-contracts.git", + "reference": "63afe740e99a13ba87ec199bb07bbdee937a5b62" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/63afe740e99a13ba87ec199bb07bbdee937a5b62", + "reference": "63afe740e99a13ba87ec199bb07bbdee937a5b62", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, + "branch-alias": { + "dev-main": "3.6-dev" + } + }, + "autoload": { + "files": [ + "function.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "A generic function and convention to trigger deprecation notices", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.6.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-09-25T14:21:43+00:00" + } + ], + "packages-dev": [ + { + "name": "clue/ndjson-react", + "version": "v1.3.0", + "source": { + "type": "git", + "url": "https://github.com/clue/reactphp-ndjson.git", + "reference": "392dc165fce93b5bb5c637b67e59619223c931b0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/clue/reactphp-ndjson/zipball/392dc165fce93b5bb5c637b67e59619223c931b0", + "reference": "392dc165fce93b5bb5c637b67e59619223c931b0", + "shasum": "" + }, + "require": { + "php": ">=5.3", + "react/stream": "^1.2" + }, + "require-dev": { + "phpunit/phpunit": "^9.5 || ^5.7 || ^4.8.35", + "react/event-loop": "^1.2" + }, + "type": "library", + "autoload": { + "psr-4": { + "Clue\\React\\NDJson\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering" + } + ], + "description": "Streaming newline-delimited JSON (NDJSON) parser and encoder for ReactPHP.", + "homepage": "https://github.com/clue/reactphp-ndjson", + "keywords": [ + "NDJSON", + "json", + "jsonlines", + "newline", + "reactphp", + "streaming" + ], + "support": { + "issues": "https://github.com/clue/reactphp-ndjson/issues", + "source": "https://github.com/clue/reactphp-ndjson/tree/v1.3.0" + }, + "funding": [ + { + "url": "https://clue.engineering/support", + "type": "custom" + }, + { + "url": "https://github.com/clue", + "type": "github" + } + ], + "time": "2022-12-23T10:58:28+00:00" + }, + { + "name": "clue/stream-filter", + "version": "v1.7.0", + "source": { + "type": "git", + "url": "https://github.com/clue/stream-filter.git", + "reference": "049509fef80032cb3f051595029ab75b49a3c2f7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/clue/stream-filter/zipball/049509fef80032cb3f051595029ab75b49a3c2f7", + "reference": "049509fef80032cb3f051595029ab75b49a3c2f7", + "shasum": "" + }, + "require": { + "php": ">=5.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36" + }, + "type": "library", + "autoload": { + "files": [ + "src/functions_include.php" + ], + "psr-4": { + "Clue\\StreamFilter\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering" + } + ], + "description": "A simple and modern approach to stream filtering in PHP", + "homepage": "https://github.com/clue/stream-filter", + "keywords": [ + "bucket brigade", + "callback", + "filter", + "php_user_filter", + "stream", + "stream_filter_append", + "stream_filter_register" + ], + "support": { + "issues": "https://github.com/clue/stream-filter/issues", + "source": "https://github.com/clue/stream-filter/tree/v1.7.0" + }, + "funding": [ + { + "url": "https://clue.engineering/support", + "type": "custom" + }, + { + "url": "https://github.com/clue", + "type": "github" + } + ], + "time": "2023-12-20T15:40:13+00:00" + }, + { + "name": "composer/pcre", + "version": "3.3.2", + "source": { + "type": "git", + "url": "https://github.com/composer/pcre.git", + "reference": "b2bed4734f0cc156ee1fe9c0da2550420d99a21e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/pcre/zipball/b2bed4734f0cc156ee1fe9c0da2550420d99a21e", + "reference": "b2bed4734f0cc156ee1fe9c0da2550420d99a21e", + "shasum": "" + }, + "require": { + "php": "^7.4 || ^8.0" + }, + "conflict": { + "phpstan/phpstan": "<1.11.10" + }, + "require-dev": { + "phpstan/phpstan": "^1.12 || ^2", + "phpstan/phpstan-strict-rules": "^1 || ^2", + "phpunit/phpunit": "^8 || ^9" + }, + "type": "library", + "extra": { + "phpstan": { + "includes": [ + "extension.neon" + ] + }, + "branch-alias": { + "dev-main": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\Pcre\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + } + ], + "description": "PCRE wrapping library that offers type-safe preg_* replacements.", + "keywords": [ + "PCRE", + "preg", + "regex", + "regular expression" + ], + "support": { + "issues": "https://github.com/composer/pcre/issues", + "source": "https://github.com/composer/pcre/tree/3.3.2" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2024-11-12T16:29:46+00:00" + }, + { + "name": "composer/semver", + "version": "3.4.4", + "source": { + "type": "git", + "url": "https://github.com/composer/semver.git", + "reference": "198166618906cb2de69b95d7d47e5fa8aa1b2b95" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/semver/zipball/198166618906cb2de69b95d7d47e5fa8aa1b2b95", + "reference": "198166618906cb2de69b95d7d47e5fa8aa1b2b95", + "shasum": "" + }, + "require": { + "php": "^5.3.2 || ^7.0 || ^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^1.11", + "symfony/phpunit-bridge": "^3 || ^7" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\Semver\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nils Adermann", + "email": "naderman@naderman.de", + "homepage": "http://www.naderman.de" + }, + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + }, + { + "name": "Rob Bast", + "email": "rob.bast@gmail.com", + "homepage": "http://robbast.nl" + } + ], + "description": "Semver library that offers utilities, version constraint parsing and validation.", + "keywords": [ + "semantic", + "semver", + "validation", + "versioning" + ], + "support": { + "irc": "ircs://irc.libera.chat:6697/composer", + "issues": "https://github.com/composer/semver/issues", + "source": "https://github.com/composer/semver/tree/3.4.4" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + } + ], + "time": "2025-08-20T19:15:30+00:00" + }, + { + "name": "composer/xdebug-handler", + "version": "3.0.5", + "source": { + "type": "git", + "url": "https://github.com/composer/xdebug-handler.git", + "reference": "6c1925561632e83d60a44492e0b344cf48ab85ef" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/6c1925561632e83d60a44492e0b344cf48ab85ef", + "reference": "6c1925561632e83d60a44492e0b344cf48ab85ef", + "shasum": "" + }, + "require": { + "composer/pcre": "^1 || ^2 || ^3", + "php": "^7.2.5 || ^8.0", + "psr/log": "^1 || ^2 || ^3" + }, + "require-dev": { + "phpstan/phpstan": "^1.0", + "phpstan/phpstan-strict-rules": "^1.1", + "phpunit/phpunit": "^8.5 || ^9.6 || ^10.5" + }, + "type": "library", + "autoload": { + "psr-4": { + "Composer\\XdebugHandler\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "John Stevenson", + "email": "john-stevenson@blueyonder.co.uk" + } + ], + "description": "Restarts a process without Xdebug.", + "keywords": [ + "Xdebug", + "performance" + ], + "support": { + "irc": "ircs://irc.libera.chat:6697/composer", + "issues": "https://github.com/composer/xdebug-handler/issues", + "source": "https://github.com/composer/xdebug-handler/tree/3.0.5" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2024-05-06T16:37:16+00:00" + }, + { + "name": "evenement/evenement", + "version": "v3.0.2", + "source": { + "type": "git", + "url": "https://github.com/igorw/evenement.git", + "reference": "0a16b0d71ab13284339abb99d9d2bd813640efbc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/igorw/evenement/zipball/0a16b0d71ab13284339abb99d9d2bd813640efbc", + "reference": "0a16b0d71ab13284339abb99d9d2bd813640efbc", + "shasum": "" + }, + "require": { + "php": ">=7.0" + }, + "require-dev": { + "phpunit/phpunit": "^9 || ^6" + }, + "type": "library", + "autoload": { + "psr-4": { + "Evenement\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Igor Wiedler", + "email": "igor@wiedler.ch" + } + ], + "description": "Événement is a very simple event dispatching library for PHP", + "keywords": [ + "event-dispatcher", + "event-emitter" + ], + "support": { + "issues": "https://github.com/igorw/evenement/issues", + "source": "https://github.com/igorw/evenement/tree/v3.0.2" + }, + "time": "2023-08-08T05:53:35+00:00" + }, + { + "name": "fidry/cpu-core-counter", + "version": "1.3.0", + "source": { + "type": "git", + "url": "https://github.com/theofidry/cpu-core-counter.git", + "reference": "db9508f7b1474469d9d3c53b86f817e344732678" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/theofidry/cpu-core-counter/zipball/db9508f7b1474469d9d3c53b86f817e344732678", + "reference": "db9508f7b1474469d9d3c53b86f817e344732678", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "require-dev": { + "fidry/makefile": "^0.2.0", + "fidry/php-cs-fixer-config": "^1.1.2", + "phpstan/extension-installer": "^1.2.0", + "phpstan/phpstan": "^2.0", + "phpstan/phpstan-deprecation-rules": "^2.0.0", + "phpstan/phpstan-phpunit": "^2.0", + "phpstan/phpstan-strict-rules": "^2.0", + "phpunit/phpunit": "^8.5.31 || ^9.5.26", + "webmozarts/strict-phpunit": "^7.5" + }, + "type": "library", + "autoload": { + "psr-4": { + "Fidry\\CpuCoreCounter\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Théo FIDRY", + "email": "theo.fidry@gmail.com" + } + ], + "description": "Tiny utility to get the number of CPU cores.", + "keywords": [ + "CPU", + "core" + ], + "support": { + "issues": "https://github.com/theofidry/cpu-core-counter/issues", + "source": "https://github.com/theofidry/cpu-core-counter/tree/1.3.0" + }, + "funding": [ + { + "url": "https://github.com/theofidry", + "type": "github" + } + ], + "time": "2025-08-14T07:29:31+00:00" + }, + { + "name": "friendsofphp/php-cs-fixer", + "version": "v3.75.0", + "source": { + "type": "git", + "url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git", + "reference": "399a128ff2fdaf4281e4e79b755693286cdf325c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/399a128ff2fdaf4281e4e79b755693286cdf325c", + "reference": "399a128ff2fdaf4281e4e79b755693286cdf325c", + "shasum": "" + }, + "require": { + "clue/ndjson-react": "^1.0", + "composer/semver": "^3.4", + "composer/xdebug-handler": "^3.0.3", + "ext-filter": "*", + "ext-hash": "*", + "ext-json": "*", + "ext-tokenizer": "*", + "fidry/cpu-core-counter": "^1.2", + "php": "^7.4 || ^8.0", + "react/child-process": "^0.6.5", + "react/event-loop": "^1.0", + "react/promise": "^2.0 || ^3.0", + "react/socket": "^1.0", + "react/stream": "^1.0", + "sebastian/diff": "^4.0 || ^5.1 || ^6.0 || ^7.0", + "symfony/console": "^5.4 || ^6.4 || ^7.0", + "symfony/event-dispatcher": "^5.4 || ^6.4 || ^7.0", + "symfony/filesystem": "^5.4 || ^6.4 || ^7.0", + "symfony/finder": "^5.4 || ^6.4 || ^7.0", + "symfony/options-resolver": "^5.4 || ^6.4 || ^7.0", + "symfony/polyfill-mbstring": "^1.31", + "symfony/polyfill-php80": "^1.31", + "symfony/polyfill-php81": "^1.31", + "symfony/process": "^5.4 || ^6.4 || ^7.2", + "symfony/stopwatch": "^5.4 || ^6.4 || ^7.0" + }, + "require-dev": { + "facile-it/paraunit": "^1.3.1 || ^2.6", + "infection/infection": "^0.29.14", + "justinrainbow/json-schema": "^5.3 || ^6.2", + "keradus/cli-executor": "^2.1", + "mikey179/vfsstream": "^1.6.12", + "php-coveralls/php-coveralls": "^2.7", + "php-cs-fixer/accessible-object": "^1.1", + "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.6", + "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.6", + "phpunit/phpunit": "^9.6.22 || ^10.5.45 || ^11.5.12", + "symfony/var-dumper": "^5.4.48 || ^6.4.18 || ^7.2.3", + "symfony/yaml": "^5.4.45 || ^6.4.18 || ^7.2.3" + }, + "suggest": { + "ext-dom": "For handling output formats in XML", + "ext-mbstring": "For handling non-UTF8 characters." + }, + "bin": [ + "php-cs-fixer" + ], + "type": "application", + "autoload": { + "psr-4": { + "PhpCsFixer\\": "src/" + }, + "exclude-from-classmap": [ + "src/Fixer/Internal/*" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Dariusz Rumiński", + "email": "dariusz.ruminski@gmail.com" + } + ], + "description": "A tool to automatically fix PHP code style", + "keywords": [ + "Static code analysis", + "fixer", + "standards", + "static analysis" + ], + "support": { + "issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues", + "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.75.0" + }, + "funding": [ + { + "url": "https://github.com/keradus", + "type": "github" + } + ], + "time": "2025-03-31T18:40:42+00:00" + }, + { + "name": "monolog/monolog", + "version": "3.10.0", + "source": { + "type": "git", + "url": "https://github.com/Seldaek/monolog.git", + "reference": "b321dd6749f0bf7189444158a3ce785cc16d69b0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/b321dd6749f0bf7189444158a3ce785cc16d69b0", + "reference": "b321dd6749f0bf7189444158a3ce785cc16d69b0", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "psr/log": "^2.0 || ^3.0" + }, + "provide": { + "psr/log-implementation": "3.0.0" + }, + "require-dev": { + "aws/aws-sdk-php": "^3.0", + "doctrine/couchdb": "~1.0@dev", + "elasticsearch/elasticsearch": "^7 || ^8", + "ext-json": "*", + "graylog2/gelf-php": "^1.4.2 || ^2.0", + "guzzlehttp/guzzle": "^7.4.5", + "guzzlehttp/psr7": "^2.2", + "mongodb/mongodb": "^1.8 || ^2.0", + "php-amqplib/php-amqplib": "~2.4 || ^3", + "php-console/php-console": "^3.1.8", + "phpstan/phpstan": "^2", + "phpstan/phpstan-deprecation-rules": "^2", + "phpstan/phpstan-strict-rules": "^2", + "phpunit/phpunit": "^10.5.17 || ^11.0.7", + "predis/predis": "^1.1 || ^2", + "rollbar/rollbar": "^4.0", + "ruflin/elastica": "^7 || ^8", + "symfony/mailer": "^5.4 || ^6", + "symfony/mime": "^5.4 || ^6" + }, + "suggest": { + "aws/aws-sdk-php": "Allow sending log messages to AWS services like DynamoDB", + "doctrine/couchdb": "Allow sending log messages to a CouchDB server", + "elasticsearch/elasticsearch": "Allow sending log messages to an Elasticsearch server via official client", + "ext-amqp": "Allow sending log messages to an AMQP server (1.0+ required)", + "ext-curl": "Required to send log messages using the IFTTTHandler, the LogglyHandler, the SendGridHandler, the SlackWebhookHandler or the TelegramBotHandler", + "ext-mbstring": "Allow to work properly with unicode symbols", + "ext-mongodb": "Allow sending log messages to a MongoDB server (via driver)", + "ext-openssl": "Required to send log messages using SSL", + "ext-sockets": "Allow sending log messages to a Syslog server (via UDP driver)", + "graylog2/gelf-php": "Allow sending log messages to a GrayLog2 server", + "mongodb/mongodb": "Allow sending log messages to a MongoDB server (via library)", + "php-amqplib/php-amqplib": "Allow sending log messages to an AMQP server using php-amqplib", + "rollbar/rollbar": "Allow sending log messages to Rollbar", + "ruflin/elastica": "Allow sending log messages to an Elastic Search server" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Monolog\\": "src/Monolog" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "https://seld.be" + } + ], + "description": "Sends your logs to files, sockets, inboxes, databases and various web services", + "homepage": "https://github.com/Seldaek/monolog", + "keywords": [ + "log", + "logging", + "psr-3" + ], + "support": { + "issues": "https://github.com/Seldaek/monolog/issues", + "source": "https://github.com/Seldaek/monolog/tree/3.10.0" + }, + "funding": [ + { + "url": "https://github.com/Seldaek", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/monolog/monolog", + "type": "tidelift" + } + ], + "time": "2026-01-02T08:56:05+00:00" + }, + { + "name": "myclabs/deep-copy", + "version": "1.13.4", + "source": { + "type": "git", + "url": "https://github.com/myclabs/DeepCopy.git", + "reference": "07d290f0c47959fd5eed98c95ee5602db07e0b6a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/07d290f0c47959fd5eed98c95ee5602db07e0b6a", + "reference": "07d290f0c47959fd5eed98c95ee5602db07e0b6a", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "conflict": { + "doctrine/collections": "<1.6.8", + "doctrine/common": "<2.13.3 || >=3 <3.2.2" + }, + "require-dev": { + "doctrine/collections": "^1.6.8", + "doctrine/common": "^2.13.3 || ^3.2.2", + "phpspec/prophecy": "^1.10", + "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13" + }, + "type": "library", + "autoload": { + "files": [ + "src/DeepCopy/deep_copy.php" + ], + "psr-4": { + "DeepCopy\\": "src/DeepCopy/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Create deep copies (clones) of your objects", + "keywords": [ + "clone", + "copy", + "duplicate", + "object", + "object graph" + ], + "support": { + "issues": "https://github.com/myclabs/DeepCopy/issues", + "source": "https://github.com/myclabs/DeepCopy/tree/1.13.4" + }, + "funding": [ + { + "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", + "type": "tidelift" + } + ], + "time": "2025-08-01T08:46:24+00:00" + }, + { + "name": "nette/utils", + "version": "v4.1.3", + "source": { + "type": "git", + "url": "https://github.com/nette/utils.git", + "reference": "bb3ea637e3d131d72acc033cfc2746ee893349fe" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nette/utils/zipball/bb3ea637e3d131d72acc033cfc2746ee893349fe", + "reference": "bb3ea637e3d131d72acc033cfc2746ee893349fe", + "shasum": "" + }, + "require": { + "php": "8.2 - 8.5" + }, + "conflict": { + "nette/finder": "<3", + "nette/schema": "<1.2.2" + }, + "require-dev": { + "jetbrains/phpstorm-attributes": "^1.2", + "nette/phpstan-rules": "^1.0", + "nette/tester": "^2.5", + "phpstan/extension-installer": "^1.4@stable", + "phpstan/phpstan": "^2.1@stable", + "tracy/tracy": "^2.9" + }, + "suggest": { + "ext-gd": "to use Image", + "ext-iconv": "to use Strings::webalize(), toAscii(), chr() and reverse()", + "ext-intl": "to use Strings::webalize(), toAscii(), normalize() and compare()", + "ext-json": "to use Nette\\Utils\\Json", + "ext-mbstring": "to use Strings::lower() etc...", + "ext-tokenizer": "to use Nette\\Utils\\Reflection::getUseStatements()" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.1-dev" + } + }, + "autoload": { + "psr-4": { + "Nette\\": "src" + }, + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause", + "GPL-2.0-only", + "GPL-3.0-only" + ], + "authors": [ + { + "name": "David Grudl", + "homepage": "https://davidgrudl.com" + }, + { + "name": "Nette Community", + "homepage": "https://nette.org/contributors" + } + ], + "description": "🛠 Nette Utils: lightweight utilities for string & array manipulation, image handling, safe JSON encoding/decoding, validation, slug or strong password generating etc.", + "homepage": "https://nette.org", + "keywords": [ + "array", + "core", + "datetime", + "images", + "json", + "nette", + "paginator", + "password", + "slugify", + "string", + "unicode", + "utf-8", + "utility", + "validation" + ], + "support": { + "issues": "https://github.com/nette/utils/issues", + "source": "https://github.com/nette/utils/tree/v4.1.3" + }, + "time": "2026-02-13T03:05:33+00:00" + }, + { + "name": "nikic/php-parser", + "version": "v5.7.0", + "source": { + "type": "git", + "url": "https://github.com/nikic/PHP-Parser.git", + "reference": "dca41cd15c2ac9d055ad70dbfd011130757d1f82" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/dca41cd15c2ac9d055ad70dbfd011130757d1f82", + "reference": "dca41cd15c2ac9d055ad70dbfd011130757d1f82", + "shasum": "" + }, + "require": { + "ext-ctype": "*", + "ext-json": "*", + "ext-tokenizer": "*", + "php": ">=7.4" + }, + "require-dev": { + "ircmaxell/php-yacc": "^0.0.7", + "phpunit/phpunit": "^9.0" + }, + "bin": [ + "bin/php-parse" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.x-dev" + } + }, + "autoload": { + "psr-4": { + "PhpParser\\": "lib/PhpParser" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Nikita Popov" + } + ], + "description": "A PHP parser written in PHP", + "keywords": [ + "parser", + "php" + ], + "support": { + "issues": "https://github.com/nikic/PHP-Parser/issues", + "source": "https://github.com/nikic/PHP-Parser/tree/v5.7.0" + }, + "time": "2025-12-06T11:56:16+00:00" + }, + { + "name": "nyholm/psr7", + "version": "1.8.2", + "source": { + "type": "git", + "url": "https://github.com/Nyholm/psr7.git", + "reference": "a71f2b11690f4b24d099d6b16690a90ae14fc6f3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Nyholm/psr7/zipball/a71f2b11690f4b24d099d6b16690a90ae14fc6f3", + "reference": "a71f2b11690f4b24d099d6b16690a90ae14fc6f3", + "shasum": "" + }, + "require": { + "php": ">=7.2", + "psr/http-factory": "^1.0", + "psr/http-message": "^1.1 || ^2.0" + }, + "provide": { + "php-http/message-factory-implementation": "1.0", + "psr/http-factory-implementation": "1.0", + "psr/http-message-implementation": "1.0" + }, + "require-dev": { + "http-interop/http-factory-tests": "^0.9", + "php-http/message-factory": "^1.0", + "php-http/psr7-integration-tests": "^1.0", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.4", + "symfony/error-handler": "^4.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.8-dev" + } + }, + "autoload": { + "psr-4": { + "Nyholm\\Psr7\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com" + }, + { + "name": "Martijn van der Ven", + "email": "martijn@vanderven.se" + } + ], + "description": "A fast PHP7 implementation of PSR-7", + "homepage": "https://tnyholm.se", + "keywords": [ + "psr-17", + "psr-7" + ], + "support": { + "issues": "https://github.com/Nyholm/psr7/issues", + "source": "https://github.com/Nyholm/psr7/tree/1.8.2" + }, + "funding": [ + { + "url": "https://github.com/Zegnat", + "type": "github" + }, + { + "url": "https://github.com/nyholm", + "type": "github" + } + ], + "time": "2024-09-09T07:06:30+00:00" + }, + { + "name": "phar-io/manifest", + "version": "2.0.4", + "source": { + "type": "git", + "url": "https://github.com/phar-io/manifest.git", + "reference": "54750ef60c58e43759730615a392c31c80e23176" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/54750ef60c58e43759730615a392c31c80e23176", + "reference": "54750ef60c58e43759730615a392c31c80e23176", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-libxml": "*", + "ext-phar": "*", + "ext-xmlwriter": "*", + "phar-io/version": "^3.0.1", + "php": "^7.2 || ^8.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", + "support": { + "issues": "https://github.com/phar-io/manifest/issues", + "source": "https://github.com/phar-io/manifest/tree/2.0.4" + }, + "funding": [ + { + "url": "https://github.com/theseer", + "type": "github" + } + ], + "time": "2024-03-03T12:33:53+00:00" + }, + { + "name": "phar-io/version", + "version": "3.2.1", + "source": { + "type": "git", + "url": "https://github.com/phar-io/version.git", + "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/version/zipball/4f7fd7836c6f332bb2933569e566a0d6c4cbed74", + "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Library for handling version information and constraints", + "support": { + "issues": "https://github.com/phar-io/version/issues", + "source": "https://github.com/phar-io/version/tree/3.2.1" + }, + "time": "2022-02-21T01:04:05+00:00" + }, + { + "name": "php-http/client-common", + "version": "2.7.3", + "source": { + "type": "git", + "url": "https://github.com/php-http/client-common.git", + "reference": "dcc6de29c90dd74faab55f71b79d89409c4bf0c1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/client-common/zipball/dcc6de29c90dd74faab55f71b79d89409c4bf0c1", + "reference": "dcc6de29c90dd74faab55f71b79d89409c4bf0c1", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0", + "php-http/httplug": "^2.0", + "php-http/message": "^1.6", + "psr/http-client": "^1.0", + "psr/http-factory": "^1.0", + "psr/http-message": "^1.0 || ^2.0", + "symfony/options-resolver": "~4.0.15 || ~4.1.9 || ^4.2.1 || ^5.0 || ^6.0 || ^7.0 || ^8.0", + "symfony/polyfill-php80": "^1.17" + }, + "require-dev": { + "doctrine/instantiator": "^1.1", + "guzzlehttp/psr7": "^1.4", + "nyholm/psr7": "^1.2", + "phpunit/phpunit": "^7.5.20 || ^8.5.33 || ^9.6.7" + }, + "suggest": { + "ext-json": "To detect JSON responses with the ContentTypePlugin", + "ext-libxml": "To detect XML responses with the ContentTypePlugin", + "php-http/cache-plugin": "PSR-6 Cache plugin", + "php-http/logger-plugin": "PSR-3 Logger plugin", + "php-http/stopwatch-plugin": "Symfony Stopwatch plugin" + }, + "type": "library", + "autoload": { + "psr-4": { + "Http\\Client\\Common\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" + } + ], + "description": "Common HTTP Client implementations and tools for HTTPlug", + "homepage": "http://httplug.io", + "keywords": [ + "client", + "common", + "http", + "httplug" + ], + "support": { + "issues": "https://github.com/php-http/client-common/issues", + "source": "https://github.com/php-http/client-common/tree/2.7.3" + }, + "time": "2025-11-29T19:12:34+00:00" + }, + { + "name": "php-http/httplug", + "version": "2.4.1", + "source": { + "type": "git", + "url": "https://github.com/php-http/httplug.git", + "reference": "5cad731844891a4c282f3f3e1b582c46839d22f4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/httplug/zipball/5cad731844891a4c282f3f3e1b582c46839d22f4", + "reference": "5cad731844891a4c282f3f3e1b582c46839d22f4", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0", + "php-http/promise": "^1.1", + "psr/http-client": "^1.0", + "psr/http-message": "^1.0 || ^2.0" + }, + "require-dev": { + "friends-of-phpspec/phpspec-code-coverage": "^4.1 || ^5.0 || ^6.0", + "phpspec/phpspec": "^5.1 || ^6.0 || ^7.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Http\\Client\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Eric GELOEN", + "email": "geloen.eric@gmail.com" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://sagikazarmark.hu" + } + ], + "description": "HTTPlug, the HTTP client abstraction for PHP", + "homepage": "http://httplug.io", + "keywords": [ + "client", + "http" + ], + "support": { + "issues": "https://github.com/php-http/httplug/issues", + "source": "https://github.com/php-http/httplug/tree/2.4.1" + }, + "time": "2024-09-23T11:39:58+00:00" + }, + { + "name": "php-http/message", + "version": "1.16.2", + "source": { + "type": "git", + "url": "https://github.com/php-http/message.git", + "reference": "06dd5e8562f84e641bf929bfe699ee0f5ce8080a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/message/zipball/06dd5e8562f84e641bf929bfe699ee0f5ce8080a", + "reference": "06dd5e8562f84e641bf929bfe699ee0f5ce8080a", + "shasum": "" + }, + "require": { + "clue/stream-filter": "^1.5", + "php": "^7.2 || ^8.0", + "psr/http-message": "^1.1 || ^2.0" + }, + "provide": { + "php-http/message-factory-implementation": "1.0" + }, + "require-dev": { + "ergebnis/composer-normalize": "^2.6", + "ext-zlib": "*", + "guzzlehttp/psr7": "^1.0 || ^2.0", + "laminas/laminas-diactoros": "^2.0 || ^3.0", + "php-http/message-factory": "^1.0.2", + "phpspec/phpspec": "^5.1 || ^6.3 || ^7.1", + "slim/slim": "^3.0" + }, + "suggest": { + "ext-zlib": "Used with compressor/decompressor streams", + "guzzlehttp/psr7": "Used with Guzzle PSR-7 Factories", + "laminas/laminas-diactoros": "Used with Diactoros Factories", + "slim/slim": "Used with Slim Framework PSR-7 implementation" + }, + "type": "library", + "autoload": { + "files": [ + "src/filters.php" + ], + "psr-4": { + "Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" + } + ], + "description": "HTTP Message related tools", + "homepage": "http://php-http.org", + "keywords": [ + "http", + "message", + "psr-7" + ], + "support": { + "issues": "https://github.com/php-http/message/issues", + "source": "https://github.com/php-http/message/tree/1.16.2" + }, + "time": "2024-10-02T11:34:13+00:00" + }, + { + "name": "php-http/mock-client", + "version": "1.6.1", + "source": { + "type": "git", + "url": "https://github.com/php-http/mock-client.git", + "reference": "81f558234421f7da58ed015604a03808996017d0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/mock-client/zipball/81f558234421f7da58ed015604a03808996017d0", + "reference": "81f558234421f7da58ed015604a03808996017d0", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0", + "php-http/client-common": "^2.0", + "php-http/discovery": "^1.16", + "php-http/httplug": "^2.0", + "psr/http-client": "^1.0", + "psr/http-factory-implementation": "^1.0", + "psr/http-message": "^1.0 || ^2.0", + "symfony/polyfill-php80": "^1.17" + }, + "provide": { + "php-http/async-client-implementation": "1.0", + "php-http/client-implementation": "1.0", + "psr/http-client-implementation": "1.0" + }, + "require-dev": { + "phpspec/phpspec": "^5.1 || ^6.1 || ^7.3" + }, + "type": "library", + "autoload": { + "psr-4": { + "Http\\Mock\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "David de Boer", + "email": "david@ddeboer.nl" + } + ], + "description": "Mock HTTP client", + "homepage": "http://httplug.io", + "keywords": [ + "client", + "http", + "mock", + "psr7" + ], + "support": { + "issues": "https://github.com/php-http/mock-client/issues", + "source": "https://github.com/php-http/mock-client/tree/1.6.1" + }, + "time": "2024-10-31T10:30:18+00:00" + }, + { + "name": "php-http/promise", + "version": "1.3.1", + "source": { + "type": "git", + "url": "https://github.com/php-http/promise.git", + "reference": "fc85b1fba37c169a69a07ef0d5a8075770cc1f83" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/promise/zipball/fc85b1fba37c169a69a07ef0d5a8075770cc1f83", + "reference": "fc85b1fba37c169a69a07ef0d5a8075770cc1f83", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "require-dev": { + "friends-of-phpspec/phpspec-code-coverage": "^4.3.2 || ^6.3", + "phpspec/phpspec": "^5.1.2 || ^6.2 || ^7.4" + }, + "type": "library", + "autoload": { + "psr-4": { + "Http\\Promise\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Joel Wurtz", + "email": "joel.wurtz@gmail.com" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" + } + ], + "description": "Promise used for asynchronous HTTP requests", + "homepage": "http://httplug.io", + "keywords": [ + "promise" + ], + "support": { + "issues": "https://github.com/php-http/promise/issues", + "source": "https://github.com/php-http/promise/tree/1.3.1" + }, + "time": "2024-03-15T13:55:21+00:00" + }, + { + "name": "phpstan/phpstan", + "version": "2.1.47", + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/79015445d8bd79e62b29140f12e5bfced1dcca65", + "reference": "79015445d8bd79e62b29140f12e5bfced1dcca65", + "shasum": "" + }, + "require": { + "php": "^7.4|^8.0" + }, + "conflict": { + "phpstan/phpstan-shim": "*" + }, + "bin": [ + "phpstan", + "phpstan.phar" + ], + "type": "library", + "autoload": { + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "PHPStan - PHP Static Analysis Tool", + "keywords": [ + "dev", + "static analysis" + ], + "support": { + "docs": "https://phpstan.org/user-guide/getting-started", + "forum": "https://github.com/phpstan/phpstan/discussions", + "issues": "https://github.com/phpstan/phpstan/issues", + "security": "https://github.com/phpstan/phpstan/security/policy", + "source": "https://github.com/phpstan/phpstan-src" + }, + "funding": [ + { + "url": "https://github.com/ondrejmirtes", + "type": "github" + }, + { + "url": "https://github.com/phpstan", + "type": "github" + } + ], + "time": "2026-04-13T15:49:08+00:00" + }, + { + "name": "phpunit/php-code-coverage", + "version": "11.0.12", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "2c1ed04922802c15e1de5d7447b4856de949cf56" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/2c1ed04922802c15e1de5d7447b4856de949cf56", + "reference": "2c1ed04922802c15e1de5d7447b4856de949cf56", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-libxml": "*", + "ext-xmlwriter": "*", + "nikic/php-parser": "^5.7.0", + "php": ">=8.2", + "phpunit/php-file-iterator": "^5.1.0", + "phpunit/php-text-template": "^4.0.1", + "sebastian/code-unit-reverse-lookup": "^4.0.1", + "sebastian/complexity": "^4.0.1", + "sebastian/environment": "^7.2.1", + "sebastian/lines-of-code": "^3.0.1", + "sebastian/version": "^5.0.2", + "theseer/tokenizer": "^1.3.1" + }, + "require-dev": { + "phpunit/phpunit": "^11.5.46" + }, + "suggest": { + "ext-pcov": "PHP extension that provides line coverage", + "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "11.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", + "homepage": "https://github.com/sebastianbergmann/php-code-coverage", + "keywords": [ + "coverage", + "testing", + "xunit" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", + "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/11.0.12" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpunit/php-code-coverage", + "type": "tidelift" + } + ], + "time": "2025-12-24T07:01:01+00:00" + }, + { + "name": "phpunit/php-file-iterator", + "version": "5.1.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "2f3a64888c814fc235386b7387dd5b5ed92ad903" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/2f3a64888c814fc235386b7387dd5b5ed92ad903", + "reference": "2f3a64888c814fc235386b7387dd5b5ed92ad903", + "shasum": "" + }, + "require": { + "php": ">=8.2" + }, + "require-dev": { + "phpunit/phpunit": "^11.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "5.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "FilterIterator implementation that filters files based on a list of suffixes.", + "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", + "keywords": [ + "filesystem", + "iterator" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", + "security": "https://github.com/sebastianbergmann/php-file-iterator/security/policy", + "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/5.1.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpunit/php-file-iterator", + "type": "tidelift" + } + ], + "time": "2026-02-02T13:52:54+00:00" + }, + { + "name": "phpunit/php-invoker", + "version": "5.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-invoker.git", + "reference": "c1ca3814734c07492b3d4c5f794f4b0995333da2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/c1ca3814734c07492b3d4c5f794f4b0995333da2", + "reference": "c1ca3814734c07492b3d4c5f794f4b0995333da2", + "shasum": "" + }, + "require": { + "php": ">=8.2" + }, + "require-dev": { + "ext-pcntl": "*", + "phpunit/phpunit": "^11.0" + }, + "suggest": { + "ext-pcntl": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "5.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Invoke callables with a timeout", + "homepage": "https://github.com/sebastianbergmann/php-invoker/", + "keywords": [ + "process" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-invoker/issues", + "security": "https://github.com/sebastianbergmann/php-invoker/security/policy", + "source": "https://github.com/sebastianbergmann/php-invoker/tree/5.0.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-07-03T05:07:44+00:00" + }, + { + "name": "phpunit/php-text-template", + "version": "4.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-text-template.git", + "reference": "3e0404dc6b300e6bf56415467ebcb3fe4f33e964" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/3e0404dc6b300e6bf56415467ebcb3fe4f33e964", + "reference": "3e0404dc6b300e6bf56415467ebcb3fe4f33e964", + "shasum": "" + }, + "require": { + "php": ">=8.2" + }, + "require-dev": { + "phpunit/phpunit": "^11.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Simple template engine.", + "homepage": "https://github.com/sebastianbergmann/php-text-template/", + "keywords": [ + "template" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-text-template/issues", + "security": "https://github.com/sebastianbergmann/php-text-template/security/policy", + "source": "https://github.com/sebastianbergmann/php-text-template/tree/4.0.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-07-03T05:08:43+00:00" + }, + { + "name": "phpunit/php-timer", + "version": "7.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "3b415def83fbcb41f991d9ebf16ae4ad8b7837b3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3b415def83fbcb41f991d9ebf16ae4ad8b7837b3", + "reference": "3b415def83fbcb41f991d9ebf16ae4ad8b7837b3", + "shasum": "" + }, + "require": { + "php": ">=8.2" + }, + "require-dev": { + "phpunit/phpunit": "^11.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "7.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", + "keywords": [ + "timer" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-timer/issues", + "security": "https://github.com/sebastianbergmann/php-timer/security/policy", + "source": "https://github.com/sebastianbergmann/php-timer/tree/7.0.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-07-03T05:09:35+00:00" + }, + { + "name": "phpunit/phpunit", + "version": "11.5.55", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "adc7262fccc12de2b30f12a8aa0b33775d814f00" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/adc7262fccc12de2b30f12a8aa0b33775d814f00", + "reference": "adc7262fccc12de2b30f12a8aa0b33775d814f00", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-json": "*", + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-xml": "*", + "ext-xmlwriter": "*", + "myclabs/deep-copy": "^1.13.4", + "phar-io/manifest": "^2.0.4", + "phar-io/version": "^3.2.1", + "php": ">=8.2", + "phpunit/php-code-coverage": "^11.0.12", + "phpunit/php-file-iterator": "^5.1.1", + "phpunit/php-invoker": "^5.0.1", + "phpunit/php-text-template": "^4.0.1", + "phpunit/php-timer": "^7.0.1", + "sebastian/cli-parser": "^3.0.2", + "sebastian/code-unit": "^3.0.3", + "sebastian/comparator": "^6.3.3", + "sebastian/diff": "^6.0.2", + "sebastian/environment": "^7.2.1", + "sebastian/exporter": "^6.3.2", + "sebastian/global-state": "^7.0.2", + "sebastian/object-enumerator": "^6.0.1", + "sebastian/recursion-context": "^6.0.3", + "sebastian/type": "^5.1.3", + "sebastian/version": "^5.0.2", + "staabm/side-effects-detector": "^1.0.5" + }, + "suggest": { + "ext-soap": "To be able to generate mocks based on WSDL files" + }, + "bin": [ + "phpunit" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "11.5-dev" + } + }, + "autoload": { + "files": [ + "src/Framework/Assert/Functions.php" + ], + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "The PHP Unit Testing framework.", + "homepage": "https://phpunit.de/", + "keywords": [ + "phpunit", + "testing", + "xunit" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/phpunit/issues", + "security": "https://github.com/sebastianbergmann/phpunit/security/policy", + "source": "https://github.com/sebastianbergmann/phpunit/tree/11.5.55" + }, + "funding": [ + { + "url": "https://phpunit.de/sponsors.html", + "type": "custom" + }, + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpunit/phpunit", + "type": "tidelift" + } + ], + "time": "2026-02-18T12:37:06+00:00" + }, + { + "name": "psr/container", + "version": "2.0.2", + "source": { + "type": "git", + "url": "https://github.com/php-fig/container.git", + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/container/zipball/c71ecc56dfe541dbd90c5360474fbc405f8d5963", + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963", + "shasum": "" + }, + "require": { + "php": ">=7.4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Container\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", + "keywords": [ + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" + ], + "support": { + "issues": "https://github.com/php-fig/container/issues", + "source": "https://github.com/php-fig/container/tree/2.0.2" + }, + "time": "2021-11-05T16:47:00+00:00" + }, + { + "name": "psr/event-dispatcher", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/event-dispatcher.git", + "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/event-dispatcher/zipball/dbefd12671e8a14ec7f180cab83036ed26714bb0", + "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0", + "shasum": "" + }, + "require": { + "php": ">=7.2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\EventDispatcher\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Standard interfaces for event handling.", + "keywords": [ + "events", + "psr", + "psr-14" + ], + "support": { + "issues": "https://github.com/php-fig/event-dispatcher/issues", + "source": "https://github.com/php-fig/event-dispatcher/tree/1.0.0" + }, + "time": "2019-01-08T18:20:26+00:00" + }, + { + "name": "react/cache", + "version": "v1.2.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/cache.git", + "reference": "d47c472b64aa5608225f47965a484b75c7817d5b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/cache/zipball/d47c472b64aa5608225f47965a484b75c7817d5b", + "reference": "d47c472b64aa5608225f47965a484b75c7817d5b", + "shasum": "" + }, + "require": { + "php": ">=5.3.0", + "react/promise": "^3.0 || ^2.0 || ^1.1" + }, + "require-dev": { + "phpunit/phpunit": "^9.5 || ^5.7 || ^4.8.35" + }, + "type": "library", + "autoload": { + "psr-4": { + "React\\Cache\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" + } + ], + "description": "Async, Promise-based cache interface for ReactPHP", + "keywords": [ + "cache", + "caching", + "promise", + "reactphp" + ], + "support": { + "issues": "https://github.com/reactphp/cache/issues", + "source": "https://github.com/reactphp/cache/tree/v1.2.0" + }, + "funding": [ + { + "url": "https://opencollective.com/reactphp", + "type": "open_collective" + } + ], + "time": "2022-11-30T15:59:55+00:00" + }, + { + "name": "react/child-process", + "version": "v0.6.7", + "source": { + "type": "git", + "url": "https://github.com/reactphp/child-process.git", + "reference": "970f0e71945556422ee4570ccbabaedc3cf04ad3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/child-process/zipball/970f0e71945556422ee4570ccbabaedc3cf04ad3", + "reference": "970f0e71945556422ee4570ccbabaedc3cf04ad3", + "shasum": "" + }, + "require": { + "evenement/evenement": "^3.0 || ^2.0 || ^1.0", + "php": ">=5.3.0", + "react/event-loop": "^1.2", + "react/stream": "^1.4" + }, + "require-dev": { + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36", + "react/socket": "^1.16", + "sebastian/environment": "^5.0 || ^3.0 || ^2.0 || ^1.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "React\\ChildProcess\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" + } + ], + "description": "Event-driven library for executing child processes with ReactPHP.", + "keywords": [ + "event-driven", + "process", + "reactphp" + ], + "support": { + "issues": "https://github.com/reactphp/child-process/issues", + "source": "https://github.com/reactphp/child-process/tree/v0.6.7" + }, + "funding": [ + { + "url": "https://opencollective.com/reactphp", + "type": "open_collective" + } + ], + "time": "2025-12-23T15:25:20+00:00" + }, + { + "name": "react/dns", + "version": "v1.14.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/dns.git", + "reference": "7562c05391f42701c1fccf189c8225fece1cd7c3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/dns/zipball/7562c05391f42701c1fccf189c8225fece1cd7c3", + "reference": "7562c05391f42701c1fccf189c8225fece1cd7c3", + "shasum": "" + }, + "require": { + "php": ">=5.3.0", + "react/cache": "^1.0 || ^0.6 || ^0.5", + "react/event-loop": "^1.2", + "react/promise": "^3.2 || ^2.7 || ^1.2.1" + }, + "require-dev": { + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36", + "react/async": "^4.3 || ^3 || ^2", + "react/promise-timer": "^1.11" + }, + "type": "library", + "autoload": { + "psr-4": { + "React\\Dns\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" + } + ], + "description": "Async DNS resolver for ReactPHP", + "keywords": [ + "async", + "dns", + "dns-resolver", + "reactphp" + ], + "support": { + "issues": "https://github.com/reactphp/dns/issues", + "source": "https://github.com/reactphp/dns/tree/v1.14.0" + }, + "funding": [ + { + "url": "https://opencollective.com/reactphp", + "type": "open_collective" + } + ], + "time": "2025-11-18T19:34:28+00:00" + }, + { + "name": "react/event-loop", + "version": "v1.6.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/event-loop.git", + "reference": "ba276bda6083df7e0050fd9b33f66ad7a4ac747a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/event-loop/zipball/ba276bda6083df7e0050fd9b33f66ad7a4ac747a", + "reference": "ba276bda6083df7e0050fd9b33f66ad7a4ac747a", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36" + }, + "suggest": { + "ext-pcntl": "For signal handling support when using the StreamSelectLoop" + }, + "type": "library", + "autoload": { + "psr-4": { + "React\\EventLoop\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" + } + ], + "description": "ReactPHP's core reactor event loop that libraries can use for evented I/O.", + "keywords": [ + "asynchronous", + "event-loop" + ], + "support": { + "issues": "https://github.com/reactphp/event-loop/issues", + "source": "https://github.com/reactphp/event-loop/tree/v1.6.0" + }, + "funding": [ + { + "url": "https://opencollective.com/reactphp", + "type": "open_collective" + } + ], + "time": "2025-11-17T20:46:25+00:00" + }, + { + "name": "react/promise", + "version": "v3.3.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/promise.git", + "reference": "23444f53a813a3296c1368bb104793ce8d88f04a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/promise/zipball/23444f53a813a3296c1368bb104793ce8d88f04a", + "reference": "23444f53a813a3296c1368bb104793ce8d88f04a", + "shasum": "" + }, + "require": { + "php": ">=7.1.0" + }, + "require-dev": { + "phpstan/phpstan": "1.12.28 || 1.4.10", + "phpunit/phpunit": "^9.6 || ^7.5" + }, + "type": "library", + "autoload": { + "files": [ + "src/functions_include.php" + ], + "psr-4": { + "React\\Promise\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" + } + ], + "description": "A lightweight implementation of CommonJS Promises/A for PHP", + "keywords": [ + "promise", + "promises" + ], + "support": { + "issues": "https://github.com/reactphp/promise/issues", + "source": "https://github.com/reactphp/promise/tree/v3.3.0" + }, + "funding": [ + { + "url": "https://opencollective.com/reactphp", + "type": "open_collective" + } + ], + "time": "2025-08-19T18:57:03+00:00" + }, + { + "name": "react/socket", + "version": "v1.17.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/socket.git", + "reference": "ef5b17b81f6f60504c539313f94f2d826c5faa08" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/socket/zipball/ef5b17b81f6f60504c539313f94f2d826c5faa08", + "reference": "ef5b17b81f6f60504c539313f94f2d826c5faa08", + "shasum": "" + }, + "require": { + "evenement/evenement": "^3.0 || ^2.0 || ^1.0", + "php": ">=5.3.0", + "react/dns": "^1.13", + "react/event-loop": "^1.2", + "react/promise": "^3.2 || ^2.6 || ^1.2.1", + "react/stream": "^1.4" + }, + "require-dev": { + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36", + "react/async": "^4.3 || ^3.3 || ^2", + "react/promise-stream": "^1.4", + "react/promise-timer": "^1.11" + }, + "type": "library", + "autoload": { + "psr-4": { + "React\\Socket\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" + } + ], + "description": "Async, streaming plaintext TCP/IP and secure TLS socket server and client connections for ReactPHP", + "keywords": [ + "Connection", + "Socket", + "async", + "reactphp", + "stream" + ], + "support": { + "issues": "https://github.com/reactphp/socket/issues", + "source": "https://github.com/reactphp/socket/tree/v1.17.0" + }, + "funding": [ + { + "url": "https://opencollective.com/reactphp", + "type": "open_collective" + } + ], + "time": "2025-11-19T20:47:34+00:00" + }, + { + "name": "react/stream", + "version": "v1.4.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/stream.git", + "reference": "1e5b0acb8fe55143b5b426817155190eb6f5b18d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/stream/zipball/1e5b0acb8fe55143b5b426817155190eb6f5b18d", + "reference": "1e5b0acb8fe55143b5b426817155190eb6f5b18d", + "shasum": "" + }, + "require": { + "evenement/evenement": "^3.0 || ^2.0 || ^1.0", + "php": ">=5.3.8", + "react/event-loop": "^1.2" + }, + "require-dev": { + "clue/stream-filter": "~1.2", + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36" + }, + "type": "library", + "autoload": { + "psr-4": { + "React\\Stream\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" + } + ], + "description": "Event-driven readable and writable streams for non-blocking I/O in ReactPHP", + "keywords": [ + "event-driven", + "io", + "non-blocking", + "pipe", + "reactphp", + "readable", + "stream", + "writable" + ], + "support": { + "issues": "https://github.com/reactphp/stream/issues", + "source": "https://github.com/reactphp/stream/tree/v1.4.0" + }, + "funding": [ + { + "url": "https://opencollective.com/reactphp", + "type": "open_collective" + } + ], + "time": "2024-06-11T12:45:25+00:00" + }, + { + "name": "sebastian/cli-parser", + "version": "3.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/cli-parser.git", + "reference": "15c5dd40dc4f38794d383bb95465193f5e0ae180" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/15c5dd40dc4f38794d383bb95465193f5e0ae180", + "reference": "15c5dd40dc4f38794d383bb95465193f5e0ae180", + "shasum": "" + }, + "require": { + "php": ">=8.2" + }, + "require-dev": { + "phpunit/phpunit": "^11.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for parsing CLI options", + "homepage": "https://github.com/sebastianbergmann/cli-parser", + "support": { + "issues": "https://github.com/sebastianbergmann/cli-parser/issues", + "security": "https://github.com/sebastianbergmann/cli-parser/security/policy", + "source": "https://github.com/sebastianbergmann/cli-parser/tree/3.0.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-07-03T04:41:36+00:00" + }, + { + "name": "sebastian/code-unit", + "version": "3.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit.git", + "reference": "54391c61e4af8078e5b276ab082b6d3c54c9ad64" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/54391c61e4af8078e5b276ab082b6d3c54c9ad64", + "reference": "54391c61e4af8078e5b276ab082b6d3c54c9ad64", + "shasum": "" + }, + "require": { + "php": ">=8.2" + }, + "require-dev": { + "phpunit/phpunit": "^11.5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Collection of value objects that represent the PHP code units", + "homepage": "https://github.com/sebastianbergmann/code-unit", + "support": { + "issues": "https://github.com/sebastianbergmann/code-unit/issues", + "security": "https://github.com/sebastianbergmann/code-unit/security/policy", + "source": "https://github.com/sebastianbergmann/code-unit/tree/3.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2025-03-19T07:56:08+00:00" + }, + { + "name": "sebastian/code-unit-reverse-lookup", + "version": "4.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", + "reference": "183a9b2632194febd219bb9246eee421dad8d45e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/183a9b2632194febd219bb9246eee421dad8d45e", + "reference": "183a9b2632194febd219bb9246eee421dad8d45e", + "shasum": "" + }, + "require": { + "php": ">=8.2" + }, + "require-dev": { + "phpunit/phpunit": "^11.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Looks up which function or method a line of code belongs to", + "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", + "support": { + "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues", + "security": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/security/policy", + "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/4.0.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-07-03T04:45:54+00:00" + }, + { + "name": "sebastian/comparator", + "version": "6.3.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "2c95e1e86cb8dd41beb8d502057d1081ccc8eca9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2c95e1e86cb8dd41beb8d502057d1081ccc8eca9", + "reference": "2c95e1e86cb8dd41beb8d502057d1081ccc8eca9", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-mbstring": "*", + "php": ">=8.2", + "sebastian/diff": "^6.0", + "sebastian/exporter": "^6.0" + }, + "require-dev": { + "phpunit/phpunit": "^11.4" + }, + "suggest": { + "ext-bcmath": "For comparing BcMath\\Number objects" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "6.3-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + } + ], + "description": "Provides the functionality to compare PHP values for equality", + "homepage": "https://github.com/sebastianbergmann/comparator", + "keywords": [ + "comparator", + "compare", + "equality" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/comparator/issues", + "security": "https://github.com/sebastianbergmann/comparator/security/policy", + "source": "https://github.com/sebastianbergmann/comparator/tree/6.3.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/comparator", + "type": "tidelift" + } + ], + "time": "2026-01-24T09:26:40+00:00" + }, + { + "name": "sebastian/complexity", + "version": "4.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/complexity.git", + "reference": "ee41d384ab1906c68852636b6de493846e13e5a0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/ee41d384ab1906c68852636b6de493846e13e5a0", + "reference": "ee41d384ab1906c68852636b6de493846e13e5a0", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^5.0", + "php": ">=8.2" + }, + "require-dev": { + "phpunit/phpunit": "^11.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for calculating the complexity of PHP code units", + "homepage": "https://github.com/sebastianbergmann/complexity", + "support": { + "issues": "https://github.com/sebastianbergmann/complexity/issues", + "security": "https://github.com/sebastianbergmann/complexity/security/policy", + "source": "https://github.com/sebastianbergmann/complexity/tree/4.0.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-07-03T04:49:50+00:00" + }, + { + "name": "sebastian/diff", + "version": "6.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "b4ccd857127db5d41a5b676f24b51371d76d8544" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/b4ccd857127db5d41a5b676f24b51371d76d8544", + "reference": "b4ccd857127db5d41a5b676f24b51371d76d8544", + "shasum": "" + }, + "require": { + "php": ">=8.2" + }, + "require-dev": { + "phpunit/phpunit": "^11.0", + "symfony/process": "^4.2 || ^5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "6.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + } + ], + "description": "Diff implementation", + "homepage": "https://github.com/sebastianbergmann/diff", + "keywords": [ + "diff", + "udiff", + "unidiff", + "unified diff" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/diff/issues", + "security": "https://github.com/sebastianbergmann/diff/security/policy", + "source": "https://github.com/sebastianbergmann/diff/tree/6.0.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-07-03T04:53:05+00:00" + }, + { + "name": "sebastian/environment", + "version": "7.2.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "a5c75038693ad2e8d4b6c15ba2403532647830c4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/a5c75038693ad2e8d4b6c15ba2403532647830c4", + "reference": "a5c75038693ad2e8d4b6c15ba2403532647830c4", + "shasum": "" + }, + "require": { + "php": ">=8.2" + }, + "require-dev": { + "phpunit/phpunit": "^11.3" + }, + "suggest": { + "ext-posix": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "7.2-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides functionality to handle HHVM/PHP environments", + "homepage": "https://github.com/sebastianbergmann/environment", + "keywords": [ + "Xdebug", + "environment", + "hhvm" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/environment/issues", + "security": "https://github.com/sebastianbergmann/environment/security/policy", + "source": "https://github.com/sebastianbergmann/environment/tree/7.2.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/environment", + "type": "tidelift" + } + ], + "time": "2025-05-21T11:55:47+00:00" + }, + { + "name": "sebastian/exporter", + "version": "6.3.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "70a298763b40b213ec087c51c739efcaa90bcd74" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/70a298763b40b213ec087c51c739efcaa90bcd74", + "reference": "70a298763b40b213ec087c51c739efcaa90bcd74", + "shasum": "" + }, + "require": { + "ext-mbstring": "*", + "php": ">=8.2", + "sebastian/recursion-context": "^6.0" + }, + "require-dev": { + "phpunit/phpunit": "^11.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "6.3-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Provides the functionality to export PHP variables for visualization", + "homepage": "https://www.github.com/sebastianbergmann/exporter", + "keywords": [ + "export", + "exporter" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/exporter/issues", + "security": "https://github.com/sebastianbergmann/exporter/security/policy", + "source": "https://github.com/sebastianbergmann/exporter/tree/6.3.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/exporter", + "type": "tidelift" + } + ], + "time": "2025-09-24T06:12:51+00:00" + }, + { + "name": "sebastian/global-state", + "version": "7.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/global-state.git", + "reference": "3be331570a721f9a4b5917f4209773de17f747d7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/3be331570a721f9a4b5917f4209773de17f747d7", + "reference": "3be331570a721f9a4b5917f4209773de17f747d7", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "sebastian/object-reflector": "^4.0", + "sebastian/recursion-context": "^6.0" + }, + "require-dev": { + "ext-dom": "*", + "phpunit/phpunit": "^11.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "7.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Snapshotting of global state", + "homepage": "https://www.github.com/sebastianbergmann/global-state", + "keywords": [ + "global state" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/global-state/issues", + "security": "https://github.com/sebastianbergmann/global-state/security/policy", + "source": "https://github.com/sebastianbergmann/global-state/tree/7.0.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-07-03T04:57:36+00:00" + }, + { + "name": "sebastian/lines-of-code", + "version": "3.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/lines-of-code.git", + "reference": "d36ad0d782e5756913e42ad87cb2890f4ffe467a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/d36ad0d782e5756913e42ad87cb2890f4ffe467a", + "reference": "d36ad0d782e5756913e42ad87cb2890f4ffe467a", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^5.0", + "php": ">=8.2" + }, + "require-dev": { + "phpunit/phpunit": "^11.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for counting the lines of code in PHP source code", + "homepage": "https://github.com/sebastianbergmann/lines-of-code", + "support": { + "issues": "https://github.com/sebastianbergmann/lines-of-code/issues", + "security": "https://github.com/sebastianbergmann/lines-of-code/security/policy", + "source": "https://github.com/sebastianbergmann/lines-of-code/tree/3.0.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-07-03T04:58:38+00:00" + }, + { + "name": "sebastian/object-enumerator", + "version": "6.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-enumerator.git", + "reference": "f5b498e631a74204185071eb41f33f38d64608aa" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/f5b498e631a74204185071eb41f33f38d64608aa", + "reference": "f5b498e631a74204185071eb41f33f38d64608aa", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "sebastian/object-reflector": "^4.0", + "sebastian/recursion-context": "^6.0" + }, + "require-dev": { + "phpunit/phpunit": "^11.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "6.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Traverses array structures and object graphs to enumerate all referenced objects", + "homepage": "https://github.com/sebastianbergmann/object-enumerator/", + "support": { + "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", + "security": "https://github.com/sebastianbergmann/object-enumerator/security/policy", + "source": "https://github.com/sebastianbergmann/object-enumerator/tree/6.0.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-07-03T05:00:13+00:00" + }, + { + "name": "sebastian/object-reflector", + "version": "4.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-reflector.git", + "reference": "6e1a43b411b2ad34146dee7524cb13a068bb35f9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/6e1a43b411b2ad34146dee7524cb13a068bb35f9", + "reference": "6e1a43b411b2ad34146dee7524cb13a068bb35f9", + "shasum": "" + }, + "require": { + "php": ">=8.2" + }, + "require-dev": { + "phpunit/phpunit": "^11.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Allows reflection of object attributes, including inherited and non-public ones", + "homepage": "https://github.com/sebastianbergmann/object-reflector/", + "support": { + "issues": "https://github.com/sebastianbergmann/object-reflector/issues", + "security": "https://github.com/sebastianbergmann/object-reflector/security/policy", + "source": "https://github.com/sebastianbergmann/object-reflector/tree/4.0.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-07-03T05:01:32+00:00" + }, + { + "name": "sebastian/recursion-context", + "version": "6.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "f6458abbf32a6c8174f8f26261475dc133b3d9dc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/f6458abbf32a6c8174f8f26261475dc133b3d9dc", + "reference": "f6458abbf32a6c8174f8f26261475dc133b3d9dc", + "shasum": "" + }, + "require": { + "php": ">=8.2" + }, + "require-dev": { + "phpunit/phpunit": "^11.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "6.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + } + ], + "description": "Provides functionality to recursively process PHP variables", + "homepage": "https://github.com/sebastianbergmann/recursion-context", + "support": { + "issues": "https://github.com/sebastianbergmann/recursion-context/issues", + "security": "https://github.com/sebastianbergmann/recursion-context/security/policy", + "source": "https://github.com/sebastianbergmann/recursion-context/tree/6.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/recursion-context", + "type": "tidelift" + } + ], + "time": "2025-08-13T04:42:22+00:00" + }, + { + "name": "sebastian/type", + "version": "5.1.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/type.git", + "reference": "f77d2d4e78738c98d9a68d2596fe5e8fa380f449" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/f77d2d4e78738c98d9a68d2596fe5e8fa380f449", + "reference": "f77d2d4e78738c98d9a68d2596fe5e8fa380f449", + "shasum": "" + }, + "require": { + "php": ">=8.2" + }, + "require-dev": { + "phpunit/phpunit": "^11.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "5.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Collection of value objects that represent the types of the PHP type system", + "homepage": "https://github.com/sebastianbergmann/type", + "support": { + "issues": "https://github.com/sebastianbergmann/type/issues", + "security": "https://github.com/sebastianbergmann/type/security/policy", + "source": "https://github.com/sebastianbergmann/type/tree/5.1.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/type", + "type": "tidelift" + } + ], + "time": "2025-08-09T06:55:48+00:00" + }, + { + "name": "sebastian/version", + "version": "5.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/version.git", + "reference": "c687e3387b99f5b03b6caa64c74b63e2936ff874" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c687e3387b99f5b03b6caa64c74b63e2936ff874", + "reference": "c687e3387b99f5b03b6caa64c74b63e2936ff874", + "shasum": "" + }, + "require": { + "php": ">=8.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "5.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library that helps with managing the version number of Git-hosted PHP projects", + "homepage": "https://github.com/sebastianbergmann/version", + "support": { + "issues": "https://github.com/sebastianbergmann/version/issues", + "security": "https://github.com/sebastianbergmann/version/security/policy", + "source": "https://github.com/sebastianbergmann/version/tree/5.0.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-10-09T05:16:32+00:00" + }, + { + "name": "staabm/side-effects-detector", + "version": "1.0.5", + "source": { + "type": "git", + "url": "https://github.com/staabm/side-effects-detector.git", + "reference": "d8334211a140ce329c13726d4a715adbddd0a163" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/staabm/side-effects-detector/zipball/d8334211a140ce329c13726d4a715adbddd0a163", + "reference": "d8334211a140ce329c13726d4a715adbddd0a163", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": "^7.4 || ^8.0" + }, + "require-dev": { + "phpstan/extension-installer": "^1.4.3", + "phpstan/phpstan": "^1.12.6", + "phpunit/phpunit": "^9.6.21", + "symfony/var-dumper": "^5.4.43", + "tomasvotruba/type-coverage": "1.0.0", + "tomasvotruba/unused-public": "1.0.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "lib/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "A static analysis tool to detect side effects in PHP code", + "keywords": [ + "static analysis" + ], + "support": { + "issues": "https://github.com/staabm/side-effects-detector/issues", + "source": "https://github.com/staabm/side-effects-detector/tree/1.0.5" + }, + "funding": [ + { + "url": "https://github.com/staabm", + "type": "github" + } + ], + "time": "2024-10-20T05:08:20+00:00" + }, + { + "name": "symfony/config", + "version": "v8.0.8", + "source": { + "type": "git", + "url": "https://github.com/symfony/config.git", + "reference": "c7369cc1da250fcbfe0c5a9d109e419661549c39" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/config/zipball/c7369cc1da250fcbfe0c5a9d109e419661549c39", + "reference": "c7369cc1da250fcbfe0c5a9d109e419661549c39", + "shasum": "" + }, + "require": { + "php": ">=8.4", + "symfony/deprecation-contracts": "^2.5|^3", + "symfony/filesystem": "^7.4|^8.0", + "symfony/polyfill-ctype": "^1.8" + }, + "conflict": { + "symfony/service-contracts": "<2.5" + }, + "require-dev": { + "symfony/event-dispatcher": "^7.4|^8.0", + "symfony/finder": "^7.4|^8.0", + "symfony/messenger": "^7.4|^8.0", + "symfony/service-contracts": "^2.5|^3", + "symfony/yaml": "^7.4|^8.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Config\\": "" + }, + "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": "Helps you find, load, combine, autofill and validate configuration values of any kind", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/config/tree/v8.0.8" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-03-30T15:14:47+00:00" + }, + { + "name": "symfony/console", + "version": "v7.4.8", + "source": { + "type": "git", + "url": "https://github.com/symfony/console.git", + "reference": "1e92e39c51f95b88e3d66fa2d9f06d1fb45dd707" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/console/zipball/1e92e39c51f95b88e3d66fa2d9f06d1fb45dd707", + "reference": "1e92e39c51f95b88e3d66fa2d9f06d1fb45dd707", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "symfony/deprecation-contracts": "^2.5|^3", + "symfony/polyfill-mbstring": "~1.0", + "symfony/service-contracts": "^2.5|^3", + "symfony/string": "^7.2|^8.0" + }, + "conflict": { + "symfony/dependency-injection": "<6.4", + "symfony/dotenv": "<6.4", + "symfony/event-dispatcher": "<6.4", + "symfony/lock": "<6.4", + "symfony/process": "<6.4" + }, + "provide": { + "psr/log-implementation": "1.0|2.0|3.0" + }, + "require-dev": { + "psr/log": "^1|^2|^3", + "symfony/config": "^6.4|^7.0|^8.0", + "symfony/dependency-injection": "^6.4|^7.0|^8.0", + "symfony/event-dispatcher": "^6.4|^7.0|^8.0", + "symfony/http-foundation": "^6.4|^7.0|^8.0", + "symfony/http-kernel": "^6.4|^7.0|^8.0", + "symfony/lock": "^6.4|^7.0|^8.0", + "symfony/messenger": "^6.4|^7.0|^8.0", + "symfony/process": "^6.4|^7.0|^8.0", + "symfony/stopwatch": "^6.4|^7.0|^8.0", + "symfony/var-dumper": "^6.4|^7.0|^8.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Console\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Eases the creation of beautiful and testable command line interfaces", + "homepage": "https://symfony.com", + "keywords": [ + "cli", + "command-line", + "console", + "terminal" + ], + "support": { + "source": "https://github.com/symfony/console/tree/v7.4.8" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-03-30T13:54:39+00:00" + }, + { + "name": "symfony/dependency-injection", + "version": "v8.0.8", + "source": { + "type": "git", + "url": "https://github.com/symfony/dependency-injection.git", + "reference": "3ce58b0fa844dc647ca1d66ea34748af985728c5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/3ce58b0fa844dc647ca1d66ea34748af985728c5", + "reference": "3ce58b0fa844dc647ca1d66ea34748af985728c5", + "shasum": "" + }, + "require": { + "php": ">=8.4", + "psr/container": "^1.1|^2.0", + "symfony/deprecation-contracts": "^2.5|^3", + "symfony/service-contracts": "^3.6", + "symfony/var-exporter": "^7.4|^8.0" + }, + "conflict": { + "ext-psr": "<1.1|>=2" + }, + "provide": { + "psr/container-implementation": "1.1|2.0", + "symfony/service-implementation": "1.1|2.0|3.0" + }, + "require-dev": { + "symfony/config": "^7.4|^8.0", + "symfony/expression-language": "^7.4|^8.0", + "symfony/yaml": "^7.4|^8.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\DependencyInjection\\": "" + }, + "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": "Allows you to standardize and centralize the way objects are constructed in your application", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/dependency-injection/tree/v8.0.8" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-03-31T07:15:36+00:00" + }, + { + "name": "symfony/error-handler", + "version": "v8.0.8", + "source": { + "type": "git", + "url": "https://github.com/symfony/error-handler.git", + "reference": "c1119fe8dcfc3825ec74ec061b96ef0c8f281517" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/error-handler/zipball/c1119fe8dcfc3825ec74ec061b96ef0c8f281517", + "reference": "c1119fe8dcfc3825ec74ec061b96ef0c8f281517", + "shasum": "" + }, + "require": { + "php": ">=8.4", + "psr/log": "^1|^2|^3", + "symfony/polyfill-php85": "^1.32", + "symfony/var-dumper": "^7.4|^8.0" + }, + "conflict": { + "symfony/deprecation-contracts": "<2.5" + }, + "require-dev": { + "symfony/console": "^7.4|^8.0", + "symfony/deprecation-contracts": "^2.5|^3", + "symfony/http-kernel": "^7.4|^8.0", + "symfony/serializer": "^7.4|^8.0", + "symfony/webpack-encore-bundle": "^1.0|^2.0" + }, + "bin": [ + "Resources/bin/patch-type-declarations" + ], + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\ErrorHandler\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides tools to manage errors and ease debugging PHP code", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/error-handler/tree/v8.0.8" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-03-30T15:14:47+00:00" + }, + { + "name": "symfony/event-dispatcher", + "version": "v7.4.8", + "source": { + "type": "git", + "url": "https://github.com/symfony/event-dispatcher.git", + "reference": "f57b899fa736fd71121168ef268f23c206083f0a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/f57b899fa736fd71121168ef268f23c206083f0a", + "reference": "f57b899fa736fd71121168ef268f23c206083f0a", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "symfony/event-dispatcher-contracts": "^2.5|^3" + }, + "conflict": { + "symfony/dependency-injection": "<6.4", + "symfony/service-contracts": "<2.5" + }, + "provide": { + "psr/event-dispatcher-implementation": "1.0", + "symfony/event-dispatcher-implementation": "2.0|3.0" + }, + "require-dev": { + "psr/log": "^1|^2|^3", + "symfony/config": "^6.4|^7.0|^8.0", + "symfony/dependency-injection": "^6.4|^7.0|^8.0", + "symfony/error-handler": "^6.4|^7.0|^8.0", + "symfony/expression-language": "^6.4|^7.0|^8.0", + "symfony/framework-bundle": "^6.4|^7.0|^8.0", + "symfony/http-foundation": "^6.4|^7.0|^8.0", + "symfony/service-contracts": "^2.5|^3", + "symfony/stopwatch": "^6.4|^7.0|^8.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\EventDispatcher\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/event-dispatcher/tree/v7.4.8" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-03-30T13:54:39+00:00" + }, + { + "name": "symfony/event-dispatcher-contracts", + "version": "v3.6.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/event-dispatcher-contracts.git", + "reference": "59eb412e93815df44f05f342958efa9f46b1e586" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/59eb412e93815df44f05f342958efa9f46b1e586", + "reference": "59eb412e93815df44f05f342958efa9f46b1e586", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "psr/event-dispatcher": "^1" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, + "branch-alias": { + "dev-main": "3.6-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\EventDispatcher\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to dispatching event", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "support": { + "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.6.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-09-25T14:21:43+00:00" + }, + { + "name": "symfony/filesystem", + "version": "v7.4.8", + "source": { + "type": "git", + "url": "https://github.com/symfony/filesystem.git", + "reference": "58b9790d12f9670b7f53a1c1738febd3108970a5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/58b9790d12f9670b7f53a1c1738febd3108970a5", + "reference": "58b9790d12f9670b7f53a1c1738febd3108970a5", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-mbstring": "~1.8" + }, + "require-dev": { + "symfony/process": "^6.4|^7.0|^8.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Filesystem\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides basic utilities for the filesystem", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/filesystem/tree/v7.4.8" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-03-24T13:12:05+00:00" + }, + { + "name": "symfony/finder", + "version": "v7.4.8", + "source": { + "type": "git", + "url": "https://github.com/symfony/finder.git", + "reference": "e0be088d22278583a82da281886e8c3592fbf149" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/finder/zipball/e0be088d22278583a82da281886e8c3592fbf149", + "reference": "e0be088d22278583a82da281886e8c3592fbf149", + "shasum": "" + }, + "require": { + "php": ">=8.2" + }, + "require-dev": { + "symfony/filesystem": "^6.4|^7.0|^8.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Finder\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Finds files and directories via an intuitive fluent interface", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/finder/tree/v7.4.8" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-03-24T13:12:05+00:00" + }, + { + "name": "symfony/http-foundation", + "version": "v8.0.8", + "source": { + "type": "git", + "url": "https://github.com/symfony/http-foundation.git", + "reference": "02656f7ebeae5c155d659e946f6b3a33df24051b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/02656f7ebeae5c155d659e946f6b3a33df24051b", + "reference": "02656f7ebeae5c155d659e946f6b3a33df24051b", + "shasum": "" + }, + "require": { + "php": ">=8.4", + "symfony/polyfill-mbstring": "^1.1" + }, + "conflict": { + "doctrine/dbal": "<4.3" + }, + "require-dev": { + "doctrine/dbal": "^4.3", + "predis/predis": "^1.1|^2.0", + "symfony/cache": "^7.4|^8.0", + "symfony/clock": "^7.4|^8.0", + "symfony/dependency-injection": "^7.4|^8.0", + "symfony/expression-language": "^7.4|^8.0", + "symfony/http-kernel": "^7.4|^8.0", + "symfony/mime": "^7.4|^8.0", + "symfony/rate-limiter": "^7.4|^8.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\HttpFoundation\\": "" + }, + "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": "Defines an object-oriented layer for the HTTP specification", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/http-foundation/tree/v8.0.8" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-03-30T15:14:47+00:00" + }, + { + "name": "symfony/http-kernel", + "version": "v8.0.8", + "source": { + "type": "git", + "url": "https://github.com/symfony/http-kernel.git", + "reference": "1770f6818d83b2fddc12185025b93f39a90cb628" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/1770f6818d83b2fddc12185025b93f39a90cb628", + "reference": "1770f6818d83b2fddc12185025b93f39a90cb628", + "shasum": "" + }, + "require": { + "php": ">=8.4", + "psr/log": "^1|^2|^3", + "symfony/error-handler": "^7.4|^8.0", + "symfony/event-dispatcher": "^7.4|^8.0", + "symfony/http-foundation": "^7.4|^8.0", + "symfony/polyfill-ctype": "^1.8" + }, + "conflict": { + "symfony/flex": "<2.10", + "symfony/http-client-contracts": "<2.5", + "symfony/translation-contracts": "<2.5", + "twig/twig": "<3.21" + }, + "provide": { + "psr/log-implementation": "1.0|2.0|3.0" + }, + "require-dev": { + "psr/cache": "^1.0|^2.0|^3.0", + "symfony/browser-kit": "^7.4|^8.0", + "symfony/clock": "^7.4|^8.0", + "symfony/config": "^7.4|^8.0", + "symfony/console": "^7.4|^8.0", + "symfony/css-selector": "^7.4|^8.0", + "symfony/dependency-injection": "^7.4|^8.0", + "symfony/dom-crawler": "^7.4|^8.0", + "symfony/expression-language": "^7.4|^8.0", + "symfony/finder": "^7.4|^8.0", + "symfony/http-client-contracts": "^2.5|^3", + "symfony/process": "^7.4|^8.0", + "symfony/property-access": "^7.4|^8.0", + "symfony/routing": "^7.4|^8.0", + "symfony/serializer": "^7.4|^8.0", + "symfony/stopwatch": "^7.4|^8.0", + "symfony/translation": "^7.4|^8.0", + "symfony/translation-contracts": "^2.5|^3", + "symfony/uid": "^7.4|^8.0", + "symfony/validator": "^7.4|^8.0", + "symfony/var-dumper": "^7.4|^8.0", + "symfony/var-exporter": "^7.4|^8.0", + "twig/twig": "^3.21" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\HttpKernel\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides a structured process for converting a Request into a Response", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/http-kernel/tree/v8.0.8" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-03-31T21:14:05+00:00" + }, + { + "name": "symfony/options-resolver", + "version": "v7.4.8", + "source": { + "type": "git", + "url": "https://github.com/symfony/options-resolver.git", + "reference": "2888fcdc4dc2fd5f7c7397be78631e8af12e02b4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/2888fcdc4dc2fd5f7c7397be78631e8af12e02b4", + "reference": "2888fcdc4dc2fd5f7c7397be78631e8af12e02b4", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "symfony/deprecation-contracts": "^2.5|^3" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\OptionsResolver\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides an improved replacement for the array_replace PHP function", + "homepage": "https://symfony.com", + "keywords": [ + "config", + "configuration", + "options" + ], + "support": { + "source": "https://github.com/symfony/options-resolver/tree/v7.4.8" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-03-24T13:12:05+00:00" + }, + { + "name": "symfony/polyfill-ctype", + "version": "v1.35.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "141046a8f9477948ff284fa65be2095baafb94f2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/141046a8f9477948ff284fa65be2095baafb94f2", + "reference": "141046a8f9477948ff284fa65be2095baafb94f2", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "provide": { + "ext-ctype": "*" + }, + "suggest": { + "ext-ctype": "For best performance" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], + "support": { + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.35.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-04-10T16:19:22+00:00" + }, + { + "name": "symfony/polyfill-intl-grapheme", + "version": "v1.35.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-grapheme.git", + "reference": "ad1b7b9092976d6c948b8a187cec9faaea9ec1df" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/ad1b7b9092976d6c948b8a187cec9faaea9ec1df", + "reference": "ad1b7b9092976d6c948b8a187cec9faaea9ec1df", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Intl\\Grapheme\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for intl's grapheme_* functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "grapheme", + "intl", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.35.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-04-10T16:19:22+00:00" + }, + { + "name": "symfony/polyfill-intl-normalizer", + "version": "v1.35.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-normalizer.git", + "reference": "3833d7255cc303546435cb650316bff708a1c75c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/3833d7255cc303546435cb650316bff708a1c75c", + "reference": "3833d7255cc303546435cb650316bff708a1c75c", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Intl\\Normalizer\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for intl's Normalizer class and related functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "intl", + "normalizer", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.35.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-09-09T11:45:10+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.31.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/85181ba99b2345b0ef10ce42ecac37612d9fd341", + "reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "provide": { + "ext-mbstring": "*" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.31.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-09-09T11:45:10+00:00" + }, + { + "name": "symfony/polyfill-php80", + "version": "v1.35.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php80.git", + "reference": "dfb55726c3a76ea3b6459fcfda1ec2d80a682411" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/dfb55726c3a76ea3b6459fcfda1ec2d80a682411", + "reference": "dfb55726c3a76ea3b6459fcfda1ec2d80a682411", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php80\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ion Bazan", + "email": "ion.bazan@gmail.com" + }, + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php80/tree/v1.35.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-04-10T16:19:22+00:00" + }, + { + "name": "symfony/polyfill-php81", + "version": "v1.35.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php81.git", + "reference": "4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c", + "reference": "4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php81\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.1+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php81/tree/v1.35.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-09-09T11:45:10+00:00" + }, + { + "name": "symfony/polyfill-php85", + "version": "v1.35.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php85.git", + "reference": "2c408a6bb0313e6001a83628dc5506100474254e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php85/zipball/2c408a6bb0313e6001a83628dc5506100474254e", + "reference": "2c408a6bb0313e6001a83628dc5506100474254e", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php85\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.5+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php85/tree/v1.35.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-04-10T16:50:15+00:00" + }, + { + "name": "symfony/process", + "version": "v7.4.8", + "source": { + "type": "git", + "url": "https://github.com/symfony/process.git", + "reference": "60f19cd3badc8de688421e21e4305eba50f8089a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/process/zipball/60f19cd3badc8de688421e21e4305eba50f8089a", + "reference": "60f19cd3badc8de688421e21e4305eba50f8089a", + "shasum": "" + }, + "require": { + "php": ">=8.2" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Process\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Executes commands in sub-processes", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/process/tree/v7.4.8" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-03-24T13:12:05+00:00" + }, + { + "name": "symfony/service-contracts", + "version": "v3.6.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/service-contracts.git", + "reference": "45112560a3ba2d715666a509a0bc9521d10b6c43" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/45112560a3ba2d715666a509a0bc9521d10b6c43", + "reference": "45112560a3ba2d715666a509a0bc9521d10b6c43", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "psr/container": "^1.1|^2.0", + "symfony/deprecation-contracts": "^2.5|^3" + }, + "conflict": { + "ext-psr": "<1.1|>=2" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, + "branch-alias": { + "dev-main": "3.6-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\Service\\": "" + }, + "exclude-from-classmap": [ + "/Test/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to writing services", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "support": { + "source": "https://github.com/symfony/service-contracts/tree/v3.6.1" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2025-07-15T11:30:57+00:00" + }, + { + "name": "symfony/stopwatch", + "version": "v7.4.8", + "source": { + "type": "git", + "url": "https://github.com/symfony/stopwatch.git", + "reference": "70a852d72fec4d51efb1f48dcd968efcaf5ccb89" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/70a852d72fec4d51efb1f48dcd968efcaf5ccb89", + "reference": "70a852d72fec4d51efb1f48dcd968efcaf5ccb89", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "symfony/service-contracts": "^2.5|^3" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Stopwatch\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides a way to profile code", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/stopwatch/tree/v7.4.8" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-03-24T13:12:05+00:00" + }, + { + "name": "symfony/string", + "version": "v8.0.8", + "source": { + "type": "git", + "url": "https://github.com/symfony/string.git", + "reference": "ae9488f874d7603f9d2dfbf120203882b645d963" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/string/zipball/ae9488f874d7603f9d2dfbf120203882b645d963", + "reference": "ae9488f874d7603f9d2dfbf120203882b645d963", + "shasum": "" + }, + "require": { + "php": ">=8.4", + "symfony/polyfill-ctype": "^1.8", + "symfony/polyfill-intl-grapheme": "^1.33", + "symfony/polyfill-intl-normalizer": "^1.0", + "symfony/polyfill-mbstring": "^1.0" + }, + "conflict": { + "symfony/translation-contracts": "<2.5" + }, + "require-dev": { + "symfony/emoji": "^7.4|^8.0", + "symfony/http-client": "^7.4|^8.0", + "symfony/intl": "^7.4|^8.0", + "symfony/translation-contracts": "^2.5|^3.0", + "symfony/var-exporter": "^7.4|^8.0" + }, + "type": "library", + "autoload": { + "files": [ + "Resources/functions.php" + ], + "psr-4": { + "Symfony\\Component\\String\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters in a unified way", + "homepage": "https://symfony.com", + "keywords": [ + "grapheme", + "i18n", + "string", + "unicode", + "utf-8", + "utf8" + ], + "support": { + "source": "https://github.com/symfony/string/tree/v8.0.8" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-03-30T15:14:47+00:00" + }, + { + "name": "symfony/var-dumper", + "version": "v8.0.8", + "source": { + "type": "git", + "url": "https://github.com/symfony/var-dumper.git", + "reference": "cfb7badd53bf4177f6e9416cfbbccc13c0e773a1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/cfb7badd53bf4177f6e9416cfbbccc13c0e773a1", + "reference": "cfb7badd53bf4177f6e9416cfbbccc13c0e773a1", + "shasum": "" + }, + "require": { + "php": ">=8.4", + "symfony/polyfill-mbstring": "^1.0" + }, + "conflict": { + "symfony/console": "<7.4", + "symfony/error-handler": "<7.4" + }, + "require-dev": { + "symfony/console": "^7.4|^8.0", + "symfony/http-kernel": "^7.4|^8.0", + "symfony/process": "^7.4|^8.0", + "symfony/uid": "^7.4|^8.0", + "twig/twig": "^3.12" + }, + "bin": [ + "Resources/bin/var-dump-server" + ], + "type": "library", + "autoload": { + "files": [ + "Resources/functions/dump.php" + ], + "psr-4": { + "Symfony\\Component\\VarDumper\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides mechanisms for walking through any arbitrary PHP variable", + "homepage": "https://symfony.com", + "keywords": [ + "debug", + "dump" + ], + "support": { + "source": "https://github.com/symfony/var-dumper/tree/v8.0.8" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-03-31T07:15:36+00:00" + }, + { + "name": "symfony/var-exporter", + "version": "v8.0.8", + "source": { + "type": "git", + "url": "https://github.com/symfony/var-exporter.git", + "reference": "15776bb07a91b089037da89f8832fa41d5fa6ec6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/var-exporter/zipball/15776bb07a91b089037da89f8832fa41d5fa6ec6", + "reference": "15776bb07a91b089037da89f8832fa41d5fa6ec6", + "shasum": "" + }, + "require": { + "php": ">=8.4" + }, + "require-dev": { + "symfony/property-access": "^7.4|^8.0", + "symfony/serializer": "^7.4|^8.0", + "symfony/var-dumper": "^7.4|^8.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\VarExporter\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Allows exporting any serializable PHP data structure to plain PHP code", + "homepage": "https://symfony.com", + "keywords": [ + "clone", + "construct", + "export", + "hydrate", + "instantiate", + "lazy-loading", + "proxy", + "serialize" + ], + "support": { + "source": "https://github.com/symfony/var-exporter/tree/v8.0.8" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-03-30T15:14:47+00:00" + }, + { + "name": "symplify/monorepo-builder", + "version": "12.5.2", + "source": { + "type": "git", + "url": "https://github.com/symplify/monorepo-builder.git", + "reference": "438102e3343930f23472fcce4021da3485dde812" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symplify/monorepo-builder/zipball/438102e3343930f23472fcce4021da3485dde812", + "reference": "438102e3343930f23472fcce4021da3485dde812", + "shasum": "" + }, + "require": { + "nette/utils": "^4.0.5", + "phar-io/version": "^3.2", + "php": ">=8.2", + "sebastian/diff": "^6.0 || ^7.0 || ^8.0", + "symfony/config": "^7.0 || ^8.0", + "symfony/console": "^7.0 || ^8.0", + "symfony/dependency-injection": "^7.0 || ^8.0", + "symfony/filesystem": "^7.0 || ^8.0", + "symfony/finder": "^7.0 || ^8.0", + "symfony/http-kernel": "^7.0 || ^8.0", + "symfony/process": "^7.0 || ^8.0", + "webmozart/assert": "^1.11 || ^2.0" + }, + "require-dev": { + "php-parallel-lint/php-parallel-lint": "^1.3", + "phpstan/extension-installer": "1.4.3", + "phpstan/phpstan": "^2.1.22", + "phpunit/phpunit": "^11.0", + "rector/rector": "^2.1.3", + "symplify/easy-ci": "^11.3", + "symplify/easy-coding-standard": "^12.0", + "symplify/phpstan-extensions": "^12.0.1", + "symplify/phpstan-rules": "^14.6.12", + "tomasvotruba/class-leak": "^2.0.5", + "tomasvotruba/unused-public": "^2.0.1", + "tracy/tracy": "^2.9" + }, + "bin": [ + "bin/monorepo-builder", + "src-deps/easy-testing/bin/easy-testing" + ], + "type": "library", + "autoload": { + "psr-4": { + "Symplify\\EasyTesting\\": "src-deps/easy-testing/src", + "Symplify\\PackageBuilder\\": "src-deps/package-builder/src", + "Symplify\\SymplifyKernel\\": "src-deps/symplify-kernel/src", + "Symplify\\MonorepoBuilder\\": [ + "src", + "packages" + ], + "Symplify\\SmartFileSystem\\": "src-deps/smart-file-system/src", + "Symplify\\AutowireArrayParameter\\": "src-deps/autowire-array-parameter/src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Not only Composer tools to build a Monorepo.", + "support": { + "issues": "https://github.com/symplify/monorepo-builder/issues", + "source": "https://github.com/symplify/monorepo-builder/tree/12.5.2" + }, + "funding": [ + { + "url": "https://www.paypal.me/rectorphp", + "type": "custom" + }, + { + "url": "https://github.com/tomasvotruba", + "type": "github" + } + ], + "time": "2026-03-26T02:21:57+00:00" + }, + { + "name": "theseer/tokenizer", + "version": "1.3.1", + "source": { + "type": "git", + "url": "https://github.com/theseer/tokenizer.git", + "reference": "b7489ce515e168639d17feec34b8847c326b0b3c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/b7489ce515e168639d17feec34b8847c326b0b3c", + "reference": "b7489ce515e168639d17feec34b8847c326b0b3c", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": "^7.2 || ^8.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + } + ], + "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", + "support": { + "issues": "https://github.com/theseer/tokenizer/issues", + "source": "https://github.com/theseer/tokenizer/tree/1.3.1" + }, + "funding": [ + { + "url": "https://github.com/theseer", + "type": "github" + } + ], + "time": "2025-11-17T20:03:58+00:00" + }, + { + "name": "webmozart/assert", + "version": "2.3.0", + "source": { + "type": "git", + "url": "https://github.com/webmozarts/assert.git", + "reference": "eb0d790f735ba6cff25c683a85a1da0eadeff9e4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webmozarts/assert/zipball/eb0d790f735ba6cff25c683a85a1da0eadeff9e4", + "reference": "eb0d790f735ba6cff25c683a85a1da0eadeff9e4", + "shasum": "" + }, + "require": { + "ext-ctype": "*", + "ext-date": "*", + "ext-filter": "*", + "php": "^8.2" + }, + "suggest": { + "ext-intl": "", + "ext-simplexml": "", + "ext-spl": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-feature/2-0": "2.0-dev" + } + }, + "autoload": { + "psr-4": { + "Webmozart\\Assert\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + }, + { + "name": "Woody Gilk", + "email": "woody.gilk@gmail.com" + } + ], + "description": "Assertions to validate method input/output with nice error messages.", + "keywords": [ + "assert", + "check", + "validate" + ], + "support": { + "issues": "https://github.com/webmozarts/assert/issues", + "source": "https://github.com/webmozarts/assert/tree/2.3.0" + }, + "time": "2026-04-11T10:33:05+00:00" + } + ], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": {}, + "prefer-stable": false, + "prefer-lowest": false, + "platform": { + "php": "^8.2", + "ext-curl": "*", + "ext-json": "*", + "ext-mbstring": "*" + }, + "platform-dev": {}, + "plugin-api-version": "2.9.0" +} diff --git a/demo/laravel/.env.example b/demo/laravel/.env.example new file mode 100644 index 0000000..d5e2eac --- /dev/null +++ b/demo/laravel/.env.example @@ -0,0 +1,23 @@ +APP_NAME="Convert PHP SDK Demo" +APP_ENV=local +APP_KEY= +APP_DEBUG=true +APP_URL=http://localhost:8080 + +LOG_CHANNEL=stderr +LOG_LEVEL=debug + +SESSION_DRIVER=file +SESSION_LIFETIME=120 + +CACHE_STORE=file + +# Convert SDK Configuration +CONVERT_SDK_KEY=10035569/10034190 +CONVERT_ENVIRONMENT=staging +CONVERT_EXPERIENCE_KEY=test-experience-ab-fullstack-1 +CONVERT_FEATURE_ROLLOUT_KEY=test-experience-ab-fullstack-4 +CONVERT_FEATURE_KEY_PRICING=feature-5 +CONVERT_FEATURE_KEY_STATS=feature-4 +CONVERT_GOAL_KEY=button-primary-click +CONVERT_SEGMENT_KEY=test-segment-1 diff --git a/demo/laravel/.gitattributes b/demo/laravel/.gitattributes new file mode 100644 index 0000000..fcb21d3 --- /dev/null +++ b/demo/laravel/.gitattributes @@ -0,0 +1,11 @@ +* text=auto eol=lf + +*.blade.php diff=html +*.css diff=css +*.html diff=html +*.md diff=markdown +*.php diff=php + +/.github export-ignore +CHANGELOG.md export-ignore +.styleci.yml export-ignore diff --git a/demo/laravel/.gitignore b/demo/laravel/.gitignore new file mode 100644 index 0000000..75537a9 --- /dev/null +++ b/demo/laravel/.gitignore @@ -0,0 +1,25 @@ +*.log +.DS_Store +.env +.env.backup +.env.production +.phpactor.json +.phpunit.result.cache +/.fleet +/.idea +/.nova +/.phpunit.cache +/.vscode +/.zed +/auth.json +/node_modules +/public/build +/public/hot +/public/storage +/storage/*.key +/storage/framework/cache/ +/storage/pail +/vendor +Homestead.json +Homestead.yaml +Thumbs.db diff --git a/demo/laravel/Dockerfile b/demo/laravel/Dockerfile new file mode 100644 index 0000000..8964bb0 --- /dev/null +++ b/demo/laravel/Dockerfile @@ -0,0 +1,39 @@ +FROM composer:2 AS deps +WORKDIR /build + +# Copy SDK packages for path repository resolution +COPY packages/ /sdk-packages/ + +# Copy demo app composer files (lock file excluded — path repos differ in Docker) +COPY demo/laravel/composer.json ./ + +# Rewrite path repositories to /sdk-packages/ for Docker build context +RUN sed -i 's|../../packages/|/sdk-packages/|g' composer.json + +# COMPOSER_MIRROR_PATH_REPOS=1 forces path repos to be copied (not symlinked), +# which is required for multi-stage Docker builds +ENV COMPOSER_MIRROR_PATH_REPOS=1 +RUN composer update --no-dev --no-scripts --prefer-dist --no-interaction + +FROM php:8.4-cli + +# Install PHP extensions required by Laravel +RUN apt-get update && apt-get install -y --no-install-recommends \ + libxml2-dev libonig-dev libcurl4-openssl-dev \ + && docker-php-ext-install opcache mbstring xml ctype curl \ + && rm -rf /var/lib/apt/lists/* + +WORKDIR /app + +COPY --exclude=vendor --exclude=.env demo/laravel/ . +COPY --from=deps /build/vendor ./vendor + +# Create .env from example, generate app key, set up storage directories +RUN cp .env.example .env \ + && php artisan key:generate --no-interaction \ + && mkdir -p storage/framework/cache/convert storage/framework/sessions storage/framework/views storage/logs bootstrap/cache \ + && chmod -R 775 storage bootstrap/cache + +EXPOSE 8080 + +CMD ["php", "artisan", "serve", "--host=0.0.0.0", "--port=8080"] diff --git a/demo/laravel/README.md b/demo/laravel/README.md new file mode 100644 index 0000000..176381d --- /dev/null +++ b/demo/laravel/README.md @@ -0,0 +1,87 @@ +# Convert PHP SDK Demo — Laravel + +A Laravel application demonstrating server-side A/B testing, feature flags, and conversion tracking with the [Convert PHP SDK](../../README.md). + +Uses the staging environment of project `10035569/10034190` — the same project as the [Node.js demo](../../../javascript-sdk/demo/nodejs/). + +## Quick Start (Docker) + +```bash +docker compose up --build +``` + +Visit [http://localhost:8080](http://localhost:8080). + +## Quick Start (Local) + +Requires PHP 8.4+ and Composer. + +```bash +composer install +cp .env.example .env +php artisan key:generate +php artisan serve --port=8080 +``` + +Visit [http://localhost:8080](http://localhost:8080). + +## Pages + +| Route | What it demonstrates | +| --- | --- | +| `/` | Home — intro and tips | +| `/events` | Single experience bucketing (`runExperience`), feature rollout variables, custom segments | +| `/pricing` | Multiple experiments (`runExperiences`), feature flag (`runFeature`), buy form for conversion tracking | +| `/statistics` | Multiple experiments and feature flag (different key) | +| `POST /api/buy` | Conversion tracking (`trackConversion`) with goal data (amount, products count) | + +## Configuration + +Override the default Convert project keys via `.env`: + +```env +CONVERT_SDK_KEY=your-account-id/your-project-id +CONVERT_ENVIRONMENT=staging +CONVERT_EXPERIENCE_KEY=test-experience-ab-fullstack-1 +CONVERT_FEATURE_ROLLOUT_KEY=test-experience-ab-fullstack-4 +CONVERT_FEATURE_KEY_PRICING=feature-5 +CONVERT_FEATURE_KEY_STATS=feature-4 +CONVERT_GOAL_KEY=button-primary-click +CONVERT_SEGMENT_KEY=test-segment-1 +``` + +## Architecture + +``` +Request + → ConvertContext middleware + ├ Read/generate userId cookie (1-hour expiry) + ├ Resolve SDK singleton (ConvertServiceProvider) + ├ Create visitor context with attributes + └ Set default segments + → Controller + ├ runExperience / runExperiences / runFeature + ├ setCustomSegments / trackConversion + └ Pass results to Blade view + → View renders variation/feature data +``` + +### SDK Integration Points + +All SDK calls are marked with `[ConvertSDK]` comments. Search for them: + +```bash +grep -r '\[ConvertSDK\]' app/ +``` + +**Key files:** +- `app/Providers/ConvertServiceProvider.php` — SDK singleton with PSR-16 filesystem cache +- `app/Http/Middleware/ConvertContext.php` — Per-request visitor context creation +- `app/Http/Controllers/` — SDK method calls per route +- `config/convert.php` — All Convert keys (env-configurable) + +## Links + +- [PHP SDK README](../../README.md) +- [PHP SDK Wiki](https://github.com/nicoardizzle/convert-php-sdk/wiki) +- [Convert.com](https://www.convert.com) diff --git a/demo/laravel/app/Http/Controllers/ApiController.php b/demo/laravel/app/Http/Controllers/ApiController.php new file mode 100644 index 0000000..dd97f08 --- /dev/null +++ b/demo/laravel/app/Http/Controllers/ApiController.php @@ -0,0 +1,31 @@ +attributes->get('sdkContext'); + $goalKey = $request->input('goalKey', config('convert.goal_key')); + + if ($sdkContext) { + // [ConvertSDK] Track conversion with goal data + $sdkContext->trackConversion($goalKey, new ConversionAttributes( + ruleData: ['action' => 'buy'], + conversionData: [ + new GoalData(GoalDataKey::Amount, 10.3), + new GoalData(GoalDataKey::ProductsCount, 2), + ], + )); + } + + return view('buy', ['title' => 'Purchase Confirmation']); + } +} diff --git a/demo/laravel/app/Http/Controllers/Controller.php b/demo/laravel/app/Http/Controllers/Controller.php new file mode 100644 index 0000000..8677cd5 --- /dev/null +++ b/demo/laravel/app/Http/Controllers/Controller.php @@ -0,0 +1,8 @@ +attributes->get('sdkContext'); + $data = [ + 'title' => 'Events', + 'variation' => null, + 'feature' => null, + 'callForActionLabel' => null, + ]; + + if ($sdkContext) { + // [ConvertSDK] Run single experience + $data['variation'] = $sdkContext->runExperience( + config('convert.experience_key'), + new BucketingAttributes(['locationProperties' => ['location' => 'events']]) + ); + + // [ConvertSDK] Run feature rollout (uses runExperience, not runFeature — mirrors JS demo) + $featureRollout = $sdkContext->runExperience( + config('convert.feature_rollout_key'), + new BucketingAttributes(['locationProperties' => ['location' => 'events']]) + ); + $data['feature'] = $featureRollout; + + // [ConvertSDK] Extract feature variables from changes + if ($featureRollout !== null && !empty($featureRollout->changes)) { + $data['callForActionLabel'] = $featureRollout->changes[0]['data']['variables_data']['caption'] ?? null; + } + + // [ConvertSDK] Set custom segments + $sdkContext->setCustomSegments([config('convert.segment_key')], [ + 'ruleData' => ['enabled' => false], + ]); + } + + return view('events', $data); + } +} diff --git a/demo/laravel/app/Http/Controllers/HomeController.php b/demo/laravel/app/Http/Controllers/HomeController.php new file mode 100644 index 0000000..ebed4fd --- /dev/null +++ b/demo/laravel/app/Http/Controllers/HomeController.php @@ -0,0 +1,14 @@ + 'Laravel Demo']); + } +} diff --git a/demo/laravel/app/Http/Controllers/PricingController.php b/demo/laravel/app/Http/Controllers/PricingController.php new file mode 100644 index 0000000..6f18a30 --- /dev/null +++ b/demo/laravel/app/Http/Controllers/PricingController.php @@ -0,0 +1,41 @@ +attributes->get('sdkContext'); + $data = [ + 'title' => 'Pricing', + 'variations' => [], + 'feature' => null, + 'goalKey' => config('convert.goal_key'), + ]; + + if ($sdkContext) { + // [ConvertSDK] Run all applicable experiences + $data['variations'] = $sdkContext->runExperiences( + new BucketingAttributes(['locationProperties' => ['location' => 'pricing']]) + ); + + // [ConvertSDK] Run feature flag + $feature = $sdkContext->runFeature( + config('convert.feature_key_pricing'), + new BucketingAttributes(['locationProperties' => ['location' => 'pricing']]) + ); + + if ($feature !== null && $feature->status === FeatureStatus::Enabled) { + $data['feature'] = $feature; + } + } + + return view('pricing', $data); + } +} diff --git a/demo/laravel/app/Http/Controllers/StatisticsController.php b/demo/laravel/app/Http/Controllers/StatisticsController.php new file mode 100644 index 0000000..8cc8690 --- /dev/null +++ b/demo/laravel/app/Http/Controllers/StatisticsController.php @@ -0,0 +1,40 @@ +attributes->get('sdkContext'); + $data = [ + 'title' => 'Statistics', + 'variations' => [], + 'feature' => null, + ]; + + if ($sdkContext) { + // [ConvertSDK] Run all applicable experiences + $data['variations'] = $sdkContext->runExperiences( + new BucketingAttributes(['locationProperties' => ['location' => 'statistics']]) + ); + + // [ConvertSDK] Run feature flag + $feature = $sdkContext->runFeature( + config('convert.feature_key_stats'), + new BucketingAttributes(['locationProperties' => ['location' => 'statistics']]) + ); + + if ($feature !== null && $feature->status === FeatureStatus::Enabled) { + $data['feature'] = $feature; + } + } + + return view('statistics', $data); + } +} diff --git a/demo/laravel/app/Http/Middleware/ConvertContext.php b/demo/laravel/app/Http/Middleware/ConvertContext.php new file mode 100644 index 0000000..17d3d6d --- /dev/null +++ b/demo/laravel/app/Http/Middleware/ConvertContext.php @@ -0,0 +1,54 @@ +cookie('userId'); + $newVisitor = false; + + if (!$userId) { + $userId = time() . '-' . microtime(true); + $newVisitor = true; + } + + // [ConvertSDK] Resolve SDK singleton from container + try { + $sdk = app('convert.sdk'); + + if ($sdk->isReady()) { + // [ConvertSDK] Create visitor context with attributes matching JS demo + $context = $sdk->createContext($userId, ['mobile' => true]); + + if ($context) { + // [ConvertSDK] Set default segments matching JS demo + $context->setDefaultSegments(['country' => 'US']); + $request->attributes->set('sdkContext', $context); + } + } else { + Log::warning('[ConvertSDK] SDK is not ready — pages will render without experiment data'); + } + } catch (\Throwable $e) { + Log::warning('[ConvertSDK] SDK initialization failed: ' . $e->getMessage()); + } + + $response = $next($request); + + // Set visitor ID cookie on response if newly generated (1-hour expiry) + if ($newVisitor) { + $response->headers->setCookie( + cookie('userId', $userId, 60) // 60 minutes + ); + } + + return $response; + } +} diff --git a/demo/laravel/app/Providers/AppServiceProvider.php b/demo/laravel/app/Providers/AppServiceProvider.php new file mode 100644 index 0000000..452e6b6 --- /dev/null +++ b/demo/laravel/app/Providers/AppServiceProvider.php @@ -0,0 +1,24 @@ +app->singleton('convert.sdk', function ($app) { + $cache = new Psr16Cache(new FilesystemAdapter( + namespace: 'convert_sdk', + defaultLifetime: 3600, + directory: storage_path('framework/cache/convert'), + )); + + return ConvertSDK::create([ + 'sdkKey' => config('convert.sdk_key'), // [ConvertSDK] + 'cache' => $cache, // [ConvertSDK] + 'environment' => config('convert.environment'), // [ConvertSDK] + 'logger' => [ // [ConvertSDK] + 'logLevel' => LogLevel::Trace, + 'customLoggers' => [$app->make(LoggerInterface::class)], + ], + ]); + }); + } +} diff --git a/demo/laravel/artisan b/demo/laravel/artisan new file mode 100755 index 0000000..c35e31d --- /dev/null +++ b/demo/laravel/artisan @@ -0,0 +1,18 @@ +#!/usr/bin/env php +handleCommand(new ArgvInput); + +exit($status); diff --git a/demo/laravel/bootstrap/app.php b/demo/laravel/bootstrap/app.php new file mode 100644 index 0000000..854c269 --- /dev/null +++ b/demo/laravel/bootstrap/app.php @@ -0,0 +1,19 @@ +withRouting( + web: __DIR__.'/../routes/web.php', + health: '/up', + ) + ->withMiddleware(function (Middleware $middleware): void { + $middleware->web(append: [ + \App\Http\Middleware\ConvertContext::class, + ]); + }) + ->withExceptions(function (Exceptions $exceptions): void { + // + })->create(); diff --git a/demo/laravel/bootstrap/cache/.gitignore b/demo/laravel/bootstrap/cache/.gitignore new file mode 100644 index 0000000..d6b7ef3 --- /dev/null +++ b/demo/laravel/bootstrap/cache/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/demo/laravel/bootstrap/providers.php b/demo/laravel/bootstrap/providers.php new file mode 100644 index 0000000..ac20552 --- /dev/null +++ b/demo/laravel/bootstrap/providers.php @@ -0,0 +1,9 @@ +=1.0.0", + "guzzlehttp/guzzle": "^7.0", + "symfony/cache": "^7.0" + }, + "repositories": [ + { "type": "path", "url": "../../packages/Api" }, + { "type": "path", "url": "../../packages/Bucketing" }, + { "type": "path", "url": "../../packages/Data" }, + { "type": "path", "url": "../../packages/Enums" }, + { "type": "path", "url": "../../packages/Event" }, + { "type": "path", "url": "../../packages/Experience" }, + { "type": "path", "url": "../../packages/Logger" }, + { "type": "path", "url": "../../packages/Rules" }, + { "type": "path", "url": "../../packages/Segments" }, + { "type": "path", "url": "../../packages/Types" }, + { "type": "path", "url": "../../packages/Utils" }, + { "type": "path", "url": "../../packages/Php-sdk" } + ], + "autoload": { + "psr-4": { + "App\\": "app/" + } + }, + "scripts": { + "post-autoload-dump": [ + "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump", + "@php artisan package:discover --ansi" + ], + "post-root-package-install": [ + "@php -r \"file_exists('.env') || copy('.env.example', '.env');\"" + ] + }, + "extra": { + "laravel": { + "dont-discover": [] + } + }, + "config": { + "optimize-autoloader": true, + "preferred-install": "dist", + "sort-packages": true, + "allow-plugins": { + "php-http/discovery": true + } + }, + "minimum-stability": "stable", + "prefer-stable": true +} diff --git a/demo/laravel/composer.lock b/demo/laravel/composer.lock new file mode 100644 index 0000000..1b3f065 --- /dev/null +++ b/demo/laravel/composer.lock @@ -0,0 +1,6834 @@ +{ + "_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": "d1821695b7cea08bf70cb7df5789c4a6", + "packages": [ + { + "name": "brick/math", + "version": "0.14.8", + "source": { + "type": "git", + "url": "https://github.com/brick/math.git", + "reference": "63422359a44b7f06cae63c3b429b59e8efcc0629" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/brick/math/zipball/63422359a44b7f06cae63c3b429b59e8efcc0629", + "reference": "63422359a44b7f06cae63c3b429b59e8efcc0629", + "shasum": "" + }, + "require": { + "php": "^8.2" + }, + "require-dev": { + "php-coveralls/php-coveralls": "^2.2", + "phpstan/phpstan": "2.1.22", + "phpunit/phpunit": "^11.5" + }, + "type": "library", + "autoload": { + "psr-4": { + "Brick\\Math\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Arbitrary-precision arithmetic library", + "keywords": [ + "Arbitrary-precision", + "BigInteger", + "BigRational", + "arithmetic", + "bigdecimal", + "bignum", + "bignumber", + "brick", + "decimal", + "integer", + "math", + "mathematics", + "rational" + ], + "support": { + "issues": "https://github.com/brick/math/issues", + "source": "https://github.com/brick/math/tree/0.14.8" + }, + "funding": [ + { + "url": "https://github.com/BenMorel", + "type": "github" + } + ], + "time": "2026-02-10T14:33:43+00:00" + }, + { + "name": "carbonphp/carbon-doctrine-types", + "version": "3.2.0", + "source": { + "type": "git", + "url": "https://github.com/CarbonPHP/carbon-doctrine-types.git", + "reference": "18ba5ddfec8976260ead6e866180bd5d2f71aa1d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/CarbonPHP/carbon-doctrine-types/zipball/18ba5ddfec8976260ead6e866180bd5d2f71aa1d", + "reference": "18ba5ddfec8976260ead6e866180bd5d2f71aa1d", + "shasum": "" + }, + "require": { + "php": "^8.1" + }, + "conflict": { + "doctrine/dbal": "<4.0.0 || >=5.0.0" + }, + "require-dev": { + "doctrine/dbal": "^4.0.0", + "nesbot/carbon": "^2.71.0 || ^3.0.0", + "phpunit/phpunit": "^10.3" + }, + "type": "library", + "autoload": { + "psr-4": { + "Carbon\\Doctrine\\": "src/Carbon/Doctrine/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "KyleKatarn", + "email": "kylekatarnls@gmail.com" + } + ], + "description": "Types to use Carbon in Doctrine", + "keywords": [ + "carbon", + "date", + "datetime", + "doctrine", + "time" + ], + "support": { + "issues": "https://github.com/CarbonPHP/carbon-doctrine-types/issues", + "source": "https://github.com/CarbonPHP/carbon-doctrine-types/tree/3.2.0" + }, + "funding": [ + { + "url": "https://github.com/kylekatarnls", + "type": "github" + }, + { + "url": "https://opencollective.com/Carbon", + "type": "open_collective" + }, + { + "url": "https://tidelift.com/funding/github/packagist/nesbot/carbon", + "type": "tidelift" + } + ], + "time": "2024-02-09T16:56:22+00:00" + }, + { + "name": "convertcom/php-sdk", + "version": "1.0.0", + "dist": { + "type": "path", + "url": "../../packages/Php-sdk", + "reference": "56d0e60cf9c97ac62f1c10fa03ea2ecfc76344cb" + }, + "require": { + "convertcom/php-sdk-api": ">=1.0.0", + "convertcom/php-sdk-bucketing": ">=1.0.0", + "convertcom/php-sdk-data": ">=1.0.0", + "convertcom/php-sdk-enums": ">=1.0.0", + "convertcom/php-sdk-event": ">=1.0.0", + "convertcom/php-sdk-experience": ">=1.0.0", + "convertcom/php-sdk-logger": ">=1.0.0", + "convertcom/php-sdk-rules": ">=1.0.0", + "convertcom/php-sdk-segments": ">=1.0.0", + "convertcom/php-sdk-types": ">=1.0.0", + "convertcom/php-sdk-utils": ">=1.0.0", + "php": "^8.2", + "php-http/discovery": "^1.19", + "psr/log": "^3.0", + "psr/simple-cache": "^3.0" + }, + "require-dev": { + "phpunit/phpunit": "^11.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "ConvertSdk\\": "src/" + } + }, + "scripts": { + "test": [ + "phpunit" + ] + }, + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "Convert Insights, Inc" + } + ], + "description": "Convert PHP SDK – a PHP version of the Convert Insights SDK", + "transport-options": { + "relative": true + } + }, + { + "name": "convertcom/php-sdk-api", + "version": "1.0.0", + "dist": { + "type": "path", + "url": "../../packages/Api", + "reference": "0ad87717b5efa37751c61161a04925176a2ccd93" + }, + "require": { + "convertcom/php-sdk-enums": ">=1.0.0", + "convertcom/php-sdk-event": ">=1.0.0", + "convertcom/php-sdk-logger": ">=1.0.0", + "convertcom/php-sdk-types": ">=1.0.0", + "convertcom/php-sdk-utils": ">=1.0.0", + "php": "^8.2", + "php-http/discovery": "^1.19", + "psr/http-client": "^1.0", + "psr/http-factory": "^1.0", + "psr/http-message": "^1.1 || ^2.0" + }, + "require-dev": { + "guzzlehttp/guzzle": "^7.3", + "nyholm/psr7": "^1.8", + "php-http/mock-client": "^1.6", + "phpunit/phpunit": "^11.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "ConvertSdk\\": "src/", + "ConvertSdk\\Config\\": "../Php-sdk/src/Config/" + } + }, + "scripts": { + "test": [ + "phpunit" + ], + "build": [ + "php build.php" + ] + }, + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "Convert Insights, Inc" + } + ], + "description": "Convert PHP SDK API package", + "transport-options": { + "relative": true + } + }, + { + "name": "convertcom/php-sdk-bucketing", + "version": "1.0.0", + "dist": { + "type": "path", + "url": "../../packages/Bucketing", + "reference": "cfcf705ad2bb714b28c95e0355b96a6cb8bb56c4" + }, + "require": { + "convertcom/php-sdk-api": ">=1.0.0", + "convertcom/php-sdk-enums": ">=1.0.0", + "convertcom/php-sdk-event": ">=1.0.0", + "convertcom/php-sdk-logger": ">=1.0.0", + "convertcom/php-sdk-types": ">=1.0.0", + "convertcom/php-sdk-utils": ">=1.0.0", + "php": "^8.2" + }, + "require-dev": { + "phpunit/phpunit": "^11.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "ConvertSdk\\": "src/" + } + }, + "scripts": { + "test": [ + "phpunit" + ], + "build": [ + "php build.php" + ] + }, + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "Convert Insights, Inc" + } + ], + "description": "PHP SDK for Convert Bucketing", + "transport-options": { + "relative": true + } + }, + { + "name": "convertcom/php-sdk-data", + "version": "1.0.0", + "dist": { + "type": "path", + "url": "../../packages/Data", + "reference": "0b544204d553d505596ff4d9d596b25155beb807" + }, + "require": { + "convertcom/php-sdk-api": ">=1.0.0", + "convertcom/php-sdk-bucketing": ">=1.0.0", + "convertcom/php-sdk-enums": ">=1.0.0", + "convertcom/php-sdk-event": ">=1.0.0", + "convertcom/php-sdk-logger": ">=1.0.0", + "convertcom/php-sdk-rules": ">=1.0.0", + "convertcom/php-sdk-types": ">=1.0.0", + "convertcom/php-sdk-utils": ">=1.0.0", + "php": "^8.2", + "psy/psysh": "@stable" + }, + "require-dev": { + "nyholm/psr7": "^1.8", + "php-http/mock-client": "^1.6", + "phpunit/phpunit": "^11.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "ConvertSdk\\": "src/", + "ConvertSdk\\Config\\": "../Php-sdk/src/Config/" + } + }, + "scripts": { + "test": [ + "phpunit" + ], + "coverage": [ + "vendor/bin/phpunit --coverage-text" + ] + }, + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "Convert Insights, Inc" + } + ], + "description": "PHP SDK Data package for Convert Insights, Inc.", + "transport-options": { + "relative": true + } + }, + { + "name": "convertcom/php-sdk-enums", + "version": "1.0.0", + "dist": { + "type": "path", + "url": "../../packages/Enums", + "reference": "db813601d9c97998603a39fdb0827b768a12a692" + }, + "require": { + "php": "^8.2" + }, + "type": "library", + "autoload": { + "psr-4": { + "ConvertSdk\\Enums\\": "src/" + } + }, + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "Convert Insights, Inc" + } + ], + "description": "PHP implementation of Convert JS SDK enums", + "transport-options": { + "relative": true + } + }, + { + "name": "convertcom/php-sdk-event", + "version": "1.0.0", + "dist": { + "type": "path", + "url": "../../packages/Event", + "reference": "9f52e2b3aa905283a413253b2855556756f7fe89" + }, + "require": { + "convertcom/php-sdk-enums": ">=1.0.0", + "convertcom/php-sdk-logger": ">=1.0.0", + "php": "^8.2" + }, + "require-dev": { + "phpunit/phpunit": "^11.0", + "vlucas/phpdotenv": "^5.5" + }, + "type": "library", + "autoload": { + "psr-4": { + "ConvertSdk\\Event\\": "src/" + } + }, + "scripts": { + "test": [ + "phpunit" + ] + }, + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "Convert Insights, Inc" + } + ], + "description": "Convert PHP SDK Event Manager", + "transport-options": { + "relative": true + } + }, + { + "name": "convertcom/php-sdk-experience", + "version": "1.0.0", + "dist": { + "type": "path", + "url": "../../packages/Experience", + "reference": "edf3dac731043f2a0636afa18f14746cec4437db" + }, + "require": { + "convertcom/php-sdk-api": ">=1.0.0", + "convertcom/php-sdk-bucketing": ">=1.0.0", + "convertcom/php-sdk-data": ">=1.0.0", + "convertcom/php-sdk-enums": ">=1.0.0", + "convertcom/php-sdk-event": ">=1.0.0", + "convertcom/php-sdk-logger": ">=1.0.0", + "convertcom/php-sdk-rules": ">=1.0.0", + "convertcom/php-sdk-types": ">=1.0.0", + "convertcom/php-sdk-utils": ">=1.0.0", + "php": "^8.2" + }, + "require-dev": { + "mockery/mockery": "^1.4", + "phpunit/phpunit": "^11.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "ConvertSdk\\": "src/", + "ConvertSdk\\Config\\": "../Php-sdk/src/Config/" + } + }, + "scripts": { + "test": [ + "phpunit --config phpunit.xml" + ], + "clean": [ + "rm -rf vendor/ composer.lock" + ] + }, + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "Convert Insights, Inc", + "email": "support@convert.com" + } + ], + "description": "PHP SDK for Convert Experience Management", + "transport-options": { + "relative": true + } + }, + { + "name": "convertcom/php-sdk-logger", + "version": "1.0.0", + "dist": { + "type": "path", + "url": "../../packages/Logger", + "reference": "3c66661858c8a2641f479b6cfb1b88e54d8b4399" + }, + "require": { + "convertcom/php-sdk-enums": ">=1.0.0", + "php": "^8.2", + "psr/log": "^3.0" + }, + "require-dev": { + "monolog/monolog": "^3.8", + "phpunit/phpunit": "^11.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "ConvertSdk\\": "src/" + } + }, + "scripts": { + "test": [ + "phpunit" + ] + }, + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "Convert Insights, Inc" + } + ], + "description": "PHP implementation of Convert SDK Logger package", + "transport-options": { + "relative": true + } + }, + { + "name": "convertcom/php-sdk-rules", + "version": "1.0.0", + "dist": { + "type": "path", + "url": "../../packages/Rules", + "reference": "4f4d50c536224e438d92b849a0bd6cc7f5d14a08" + }, + "require": { + "convertcom/php-sdk-enums": ">=1.0.0", + "convertcom/php-sdk-logger": ">=1.0.0", + "convertcom/php-sdk-types": ">=1.0.0", + "convertcom/php-sdk-utils": ">=1.0.0", + "php": "^8.2" + }, + "require-dev": { + "phpunit/phpunit": "^11.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "ConvertSdk\\": "src/", + "ConvertSdk\\Config\\": "../Php-sdk/src/Config/" + } + }, + "scripts": { + "test": [ + "phpunit" + ], + "build": [ + "php build.php" + ] + }, + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "Convert Insights, Inc" + } + ], + "description": "PHP SDK for Convert Rules", + "transport-options": { + "relative": true + } + }, + { + "name": "convertcom/php-sdk-segments", + "version": "1.0.0", + "dist": { + "type": "path", + "url": "../../packages/Segments", + "reference": "fc0d9573898006c1ec403931f655838dc1d68542" + }, + "require": { + "convertcom/php-sdk-api": ">=1.0.0", + "convertcom/php-sdk-bucketing": ">=1.0.0", + "convertcom/php-sdk-data": ">=1.0.0", + "convertcom/php-sdk-enums": ">=1.0.0", + "convertcom/php-sdk-event": ">=1.0.0", + "convertcom/php-sdk-logger": ">=1.0.0", + "convertcom/php-sdk-rules": ">=1.0.0", + "convertcom/php-sdk-types": ">=1.0.0", + "convertcom/php-sdk-utils": ">=1.0.0", + "php": "^8.2" + }, + "require-dev": { + "phpunit/phpunit": "^11.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "ConvertSdk\\": "src/", + "ConvertSdk\\Config\\": "../Php-sdk/src/Config/" + } + }, + "autoload-dev": { + "psr-4": { + "ConvertSdk\\Tests\\": "tests/" + } + }, + "scripts": { + "test": [ + "phpunit --configuration phpunit.xml" + ], + "test-coverage": [ + "phpunit --configuration phpunit.xml --coverage-text --coverage-html coverage" + ] + }, + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "Convert Insights, Inc", + "email": "support@convert.com" + } + ], + "description": "Segments management module for the Convert PHP SDK", + "transport-options": { + "relative": true + } + }, + { + "name": "convertcom/php-sdk-types", + "version": "1.0.0", + "dist": { + "type": "path", + "url": "../../packages/Types", + "reference": "e72a316d171c77fd52910cb9ff0fe55f87705e20" + }, + "require": { + "ext-curl": "*", + "ext-json": "*", + "ext-mbstring": "*", + "guzzlehttp/guzzle": "^7.3", + "guzzlehttp/psr7": "^1.7 || ^2.0", + "php": "^8.2" + }, + "require-dev": { + "phpunit/phpunit": "^11.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "OpenAPI\\Client\\": "lib/" + } + }, + "autoload-dev": { + "psr-4": { + "OpenAPI\\Client\\Test\\": "test/" + } + }, + "license": [ + "unlicense" + ], + "authors": [ + { + "name": "OpenAPI", + "homepage": "https://openapi-generator.tech" + } + ], + "description": "Serve and track experiences to your users using Convert APIs and tools", + "homepage": "https://openapi-generator.tech", + "keywords": [ + "api", + "openapi", + "openapi-generator", + "openapitools", + "php", + "rest", + "sdk" + ], + "transport-options": { + "relative": true + } + }, + { + "name": "convertcom/php-sdk-utils", + "version": "1.0.0", + "dist": { + "type": "path", + "url": "../../packages/Utils", + "reference": "6cb32e4dd6490c0947fa7132b2734001e914fefe" + }, + "require": { + "convertcom/php-sdk-enums": ">=1.0.0", + "lastguest/murmurhash": "^2.1", + "php": "^8.2" + }, + "require-dev": { + "phpunit/phpunit": "^11.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "ConvertSdk\\Utils\\": "src/", + "ConvertSdk\\Tests\\": "tests/" + } + }, + "scripts": { + "test": [ + "phpunit" + ] + }, + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "Convert Insights, Inc", + "homepage": "https://www.convert.com" + } + ], + "description": "Convert Insights PHP SDK Utils", + "transport-options": { + "relative": true + } + }, + { + "name": "dflydev/dot-access-data", + "version": "v3.0.3", + "source": { + "type": "git", + "url": "https://github.com/dflydev/dflydev-dot-access-data.git", + "reference": "a23a2bf4f31d3518f3ecb38660c95715dfead60f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/dflydev/dflydev-dot-access-data/zipball/a23a2bf4f31d3518f3ecb38660c95715dfead60f", + "reference": "a23a2bf4f31d3518f3ecb38660c95715dfead60f", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^0.12.42", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.3", + "scrutinizer/ocular": "1.6.0", + "squizlabs/php_codesniffer": "^3.5", + "vimeo/psalm": "^4.0.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Dflydev\\DotAccessData\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Dragonfly Development Inc.", + "email": "info@dflydev.com", + "homepage": "http://dflydev.com" + }, + { + "name": "Beau Simensen", + "email": "beau@dflydev.com", + "homepage": "http://beausimensen.com" + }, + { + "name": "Carlos Frutos", + "email": "carlos@kiwing.it", + "homepage": "https://github.com/cfrutos" + }, + { + "name": "Colin O'Dell", + "email": "colinodell@gmail.com", + "homepage": "https://www.colinodell.com" + } + ], + "description": "Given a deep data structure, access data by dot notation.", + "homepage": "https://github.com/dflydev/dflydev-dot-access-data", + "keywords": [ + "access", + "data", + "dot", + "notation" + ], + "support": { + "issues": "https://github.com/dflydev/dflydev-dot-access-data/issues", + "source": "https://github.com/dflydev/dflydev-dot-access-data/tree/v3.0.3" + }, + "time": "2024-07-08T12:26:09+00:00" + }, + { + "name": "doctrine/inflector", + "version": "2.1.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/inflector.git", + "reference": "6d6c96277ea252fc1304627204c3d5e6e15faa3b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/inflector/zipball/6d6c96277ea252fc1304627204c3d5e6e15faa3b", + "reference": "6d6c96277ea252fc1304627204c3d5e6e15faa3b", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "require-dev": { + "doctrine/coding-standard": "^12.0 || ^13.0", + "phpstan/phpstan": "^1.12 || ^2.0", + "phpstan/phpstan-phpunit": "^1.4 || ^2.0", + "phpstan/phpstan-strict-rules": "^1.6 || ^2.0", + "phpunit/phpunit": "^8.5 || ^12.2" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Inflector\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "PHP Doctrine Inflector is a small library that can perform string manipulations with regard to upper/lowercase and singular/plural forms of words.", + "homepage": "https://www.doctrine-project.org/projects/inflector.html", + "keywords": [ + "inflection", + "inflector", + "lowercase", + "manipulation", + "php", + "plural", + "singular", + "strings", + "uppercase", + "words" + ], + "support": { + "issues": "https://github.com/doctrine/inflector/issues", + "source": "https://github.com/doctrine/inflector/tree/2.1.0" + }, + "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%2Finflector", + "type": "tidelift" + } + ], + "time": "2025-08-10T19:31:58+00:00" + }, + { + "name": "doctrine/lexer", + "version": "3.0.1", + "source": { + "type": "git", + "url": "https://github.com/doctrine/lexer.git", + "reference": "31ad66abc0fc9e1a1f2d9bc6a42668d2fbbcd6dd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/lexer/zipball/31ad66abc0fc9e1a1f2d9bc6a42668d2fbbcd6dd", + "reference": "31ad66abc0fc9e1a1f2d9bc6a42668d2fbbcd6dd", + "shasum": "" + }, + "require": { + "php": "^8.1" + }, + "require-dev": { + "doctrine/coding-standard": "^12", + "phpstan/phpstan": "^1.10", + "phpunit/phpunit": "^10.5", + "psalm/plugin-phpunit": "^0.18.3", + "vimeo/psalm": "^5.21" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Common\\Lexer\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "PHP Doctrine Lexer parser library that can be used in Top-Down, Recursive Descent Parsers.", + "homepage": "https://www.doctrine-project.org/projects/lexer.html", + "keywords": [ + "annotations", + "docblock", + "lexer", + "parser", + "php" + ], + "support": { + "issues": "https://github.com/doctrine/lexer/issues", + "source": "https://github.com/doctrine/lexer/tree/3.0.1" + }, + "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%2Flexer", + "type": "tidelift" + } + ], + "time": "2024-02-05T11:56:58+00:00" + }, + { + "name": "dragonmantank/cron-expression", + "version": "v3.6.0", + "source": { + "type": "git", + "url": "https://github.com/dragonmantank/cron-expression.git", + "reference": "d61a8a9604ec1f8c3d150d09db6ce98b32675013" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/dragonmantank/cron-expression/zipball/d61a8a9604ec1f8c3d150d09db6ce98b32675013", + "reference": "d61a8a9604ec1f8c3d150d09db6ce98b32675013", + "shasum": "" + }, + "require": { + "php": "^8.2|^8.3|^8.4|^8.5" + }, + "replace": { + "mtdowling/cron-expression": "^1.0" + }, + "require-dev": { + "phpstan/extension-installer": "^1.4.3", + "phpstan/phpstan": "^1.12.32|^2.1.31", + "phpunit/phpunit": "^8.5.48|^9.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Cron\\": "src/Cron/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Chris Tankersley", + "email": "chris@ctankersley.com", + "homepage": "https://github.com/dragonmantank" + } + ], + "description": "CRON for PHP: Calculate the next or previous run date and determine if a CRON expression is due", + "keywords": [ + "cron", + "schedule" + ], + "support": { + "issues": "https://github.com/dragonmantank/cron-expression/issues", + "source": "https://github.com/dragonmantank/cron-expression/tree/v3.6.0" + }, + "funding": [ + { + "url": "https://github.com/dragonmantank", + "type": "github" + } + ], + "time": "2025-10-31T18:51:33+00:00" + }, + { + "name": "egulias/email-validator", + "version": "4.0.4", + "source": { + "type": "git", + "url": "https://github.com/egulias/EmailValidator.git", + "reference": "d42c8731f0624ad6bdc8d3e5e9a4524f68801cfa" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/egulias/EmailValidator/zipball/d42c8731f0624ad6bdc8d3e5e9a4524f68801cfa", + "reference": "d42c8731f0624ad6bdc8d3e5e9a4524f68801cfa", + "shasum": "" + }, + "require": { + "doctrine/lexer": "^2.0 || ^3.0", + "php": ">=8.1", + "symfony/polyfill-intl-idn": "^1.26" + }, + "require-dev": { + "phpunit/phpunit": "^10.2", + "vimeo/psalm": "^5.12" + }, + "suggest": { + "ext-intl": "PHP Internationalization Libraries are required to use the SpoofChecking validation" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Egulias\\EmailValidator\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Eduardo Gulias Davis" + } + ], + "description": "A library for validating emails against several RFCs", + "homepage": "https://github.com/egulias/EmailValidator", + "keywords": [ + "email", + "emailvalidation", + "emailvalidator", + "validation", + "validator" + ], + "support": { + "issues": "https://github.com/egulias/EmailValidator/issues", + "source": "https://github.com/egulias/EmailValidator/tree/4.0.4" + }, + "funding": [ + { + "url": "https://github.com/egulias", + "type": "github" + } + ], + "time": "2025-03-06T22:45:56+00:00" + }, + { + "name": "fruitcake/php-cors", + "version": "v1.4.0", + "source": { + "type": "git", + "url": "https://github.com/fruitcake/php-cors.git", + "reference": "38aaa6c3fd4c157ffe2a4d10aa8b9b16ba8de379" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/fruitcake/php-cors/zipball/38aaa6c3fd4c157ffe2a4d10aa8b9b16ba8de379", + "reference": "38aaa6c3fd4c157ffe2a4d10aa8b9b16ba8de379", + "shasum": "" + }, + "require": { + "php": "^8.1", + "symfony/http-foundation": "^5.4|^6.4|^7.3|^8" + }, + "require-dev": { + "phpstan/phpstan": "^2", + "phpunit/phpunit": "^9", + "squizlabs/php_codesniffer": "^4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3-dev" + } + }, + "autoload": { + "psr-4": { + "Fruitcake\\Cors\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fruitcake", + "homepage": "https://fruitcake.nl" + }, + { + "name": "Barryvdh", + "email": "barryvdh@gmail.com" + } + ], + "description": "Cross-origin resource sharing library for the Symfony HttpFoundation", + "homepage": "https://github.com/fruitcake/php-cors", + "keywords": [ + "cors", + "laravel", + "symfony" + ], + "support": { + "issues": "https://github.com/fruitcake/php-cors/issues", + "source": "https://github.com/fruitcake/php-cors/tree/v1.4.0" + }, + "funding": [ + { + "url": "https://fruitcake.nl", + "type": "custom" + }, + { + "url": "https://github.com/barryvdh", + "type": "github" + } + ], + "time": "2025-12-03T09:33:47+00:00" + }, + { + "name": "graham-campbell/result-type", + "version": "v1.1.4", + "source": { + "type": "git", + "url": "https://github.com/GrahamCampbell/Result-Type.git", + "reference": "e01f4a821471308ba86aa202fed6698b6b695e3b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/GrahamCampbell/Result-Type/zipball/e01f4a821471308ba86aa202fed6698b6b695e3b", + "reference": "e01f4a821471308ba86aa202fed6698b6b695e3b", + "shasum": "" + }, + "require": { + "php": "^7.2.5 || ^8.0", + "phpoption/phpoption": "^1.9.5" + }, + "require-dev": { + "phpunit/phpunit": "^8.5.41 || ^9.6.22 || ^10.5.45 || ^11.5.7" + }, + "type": "library", + "autoload": { + "psr-4": { + "GrahamCampbell\\ResultType\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + } + ], + "description": "An Implementation Of The Result Type", + "keywords": [ + "Graham Campbell", + "GrahamCampbell", + "Result Type", + "Result-Type", + "result" + ], + "support": { + "issues": "https://github.com/GrahamCampbell/Result-Type/issues", + "source": "https://github.com/GrahamCampbell/Result-Type/tree/v1.1.4" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/graham-campbell/result-type", + "type": "tidelift" + } + ], + "time": "2025-12-27T19:43:20+00:00" + }, + { + "name": "guzzlehttp/guzzle", + "version": "7.10.0", + "source": { + "type": "git", + "url": "https://github.com/guzzle/guzzle.git", + "reference": "b51ac707cfa420b7bfd4e4d5e510ba8008e822b4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/b51ac707cfa420b7bfd4e4d5e510ba8008e822b4", + "reference": "b51ac707cfa420b7bfd4e4d5e510ba8008e822b4", + "shasum": "" + }, + "require": { + "ext-json": "*", + "guzzlehttp/promises": "^2.3", + "guzzlehttp/psr7": "^2.8", + "php": "^7.2.5 || ^8.0", + "psr/http-client": "^1.0", + "symfony/deprecation-contracts": "^2.2 || ^3.0" + }, + "provide": { + "psr/http-client-implementation": "1.0" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.8.2", + "ext-curl": "*", + "guzzle/client-integration-tests": "3.0.2", + "php-http/message-factory": "^1.1", + "phpunit/phpunit": "^8.5.39 || ^9.6.20", + "psr/log": "^1.1 || ^2.0 || ^3.0" + }, + "suggest": { + "ext-curl": "Required for CURL handler support", + "ext-intl": "Required for Internationalized Domain Name (IDN) support", + "psr/log": "Required for using the Log middleware" + }, + "type": "library", + "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": false + } + }, + "autoload": { + "files": [ + "src/functions_include.php" + ], + "psr-4": { + "GuzzleHttp\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Jeremy Lindblom", + "email": "jeremeamia@gmail.com", + "homepage": "https://github.com/jeremeamia" + }, + { + "name": "George Mponos", + "email": "gmponos@gmail.com", + "homepage": "https://github.com/gmponos" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://github.com/sagikazarmark" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" + } + ], + "description": "Guzzle is a PHP HTTP client library", + "keywords": [ + "client", + "curl", + "framework", + "http", + "http client", + "psr-18", + "psr-7", + "rest", + "web service" + ], + "support": { + "issues": "https://github.com/guzzle/guzzle/issues", + "source": "https://github.com/guzzle/guzzle/tree/7.10.0" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/guzzle", + "type": "tidelift" + } + ], + "time": "2025-08-23T22:36:01+00:00" + }, + { + "name": "guzzlehttp/promises", + "version": "2.3.0", + "source": { + "type": "git", + "url": "https://github.com/guzzle/promises.git", + "reference": "481557b130ef3790cf82b713667b43030dc9c957" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/promises/zipball/481557b130ef3790cf82b713667b43030dc9c957", + "reference": "481557b130ef3790cf82b713667b43030dc9c957", + "shasum": "" + }, + "require": { + "php": "^7.2.5 || ^8.0" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.8.2", + "phpunit/phpunit": "^8.5.44 || ^9.6.25" + }, + "type": "library", + "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": false + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Promise\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" + } + ], + "description": "Guzzle promises library", + "keywords": [ + "promise" + ], + "support": { + "issues": "https://github.com/guzzle/promises/issues", + "source": "https://github.com/guzzle/promises/tree/2.3.0" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/promises", + "type": "tidelift" + } + ], + "time": "2025-08-22T14:34:08+00:00" + }, + { + "name": "guzzlehttp/psr7", + "version": "2.9.0", + "source": { + "type": "git", + "url": "https://github.com/guzzle/psr7.git", + "reference": "7d0ed42f28e42d61352a7a79de682e5e67fec884" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/7d0ed42f28e42d61352a7a79de682e5e67fec884", + "reference": "7d0ed42f28e42d61352a7a79de682e5e67fec884", + "shasum": "" + }, + "require": { + "php": "^7.2.5 || ^8.0", + "psr/http-factory": "^1.0", + "psr/http-message": "^1.1 || ^2.0", + "ralouphie/getallheaders": "^3.0" + }, + "provide": { + "psr/http-factory-implementation": "1.0", + "psr/http-message-implementation": "1.0" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.8.2", + "http-interop/http-factory-tests": "0.9.0", + "jshttp/mime-db": "1.54.0.1", + "phpunit/phpunit": "^8.5.44 || ^9.6.25" + }, + "suggest": { + "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" + }, + "type": "library", + "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": false + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Psr7\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "George Mponos", + "email": "gmponos@gmail.com", + "homepage": "https://github.com/gmponos" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://github.com/sagikazarmark" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://sagikazarmark.hu" + } + ], + "description": "PSR-7 message implementation that also provides common utility methods", + "keywords": [ + "http", + "message", + "psr-7", + "request", + "response", + "stream", + "uri", + "url" + ], + "support": { + "issues": "https://github.com/guzzle/psr7/issues", + "source": "https://github.com/guzzle/psr7/tree/2.9.0" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/psr7", + "type": "tidelift" + } + ], + "time": "2026-03-10T16:41:02+00:00" + }, + { + "name": "guzzlehttp/uri-template", + "version": "v1.0.5", + "source": { + "type": "git", + "url": "https://github.com/guzzle/uri-template.git", + "reference": "4f4bbd4e7172148801e76e3decc1e559bdee34e1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/uri-template/zipball/4f4bbd4e7172148801e76e3decc1e559bdee34e1", + "reference": "4f4bbd4e7172148801e76e3decc1e559bdee34e1", + "shasum": "" + }, + "require": { + "php": "^7.2.5 || ^8.0", + "symfony/polyfill-php80": "^1.24" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.8.2", + "phpunit/phpunit": "^8.5.44 || ^9.6.25", + "uri-template/tests": "1.0.0" + }, + "type": "library", + "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": false + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\UriTemplate\\": "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" + } + ], + "description": "A polyfill class for uri_template of PHP", + "keywords": [ + "guzzlehttp", + "uri-template" + ], + "support": { + "issues": "https://github.com/guzzle/uri-template/issues", + "source": "https://github.com/guzzle/uri-template/tree/v1.0.5" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/uri-template", + "type": "tidelift" + } + ], + "time": "2025-08-22T14:27:06+00:00" + }, + { + "name": "laravel/framework", + "version": "v13.1.1", + "source": { + "type": "git", + "url": "https://github.com/laravel/framework.git", + "reference": "5525d87797815c55f7a89d0dfc1dd89e9de98b63" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laravel/framework/zipball/5525d87797815c55f7a89d0dfc1dd89e9de98b63", + "reference": "5525d87797815c55f7a89d0dfc1dd89e9de98b63", + "shasum": "" + }, + "require": { + "brick/math": "^0.14.2 || ^0.15 || ^0.16 || ^0.17", + "composer-runtime-api": "^2.2", + "doctrine/inflector": "^2.0.5", + "dragonmantank/cron-expression": "^3.4", + "egulias/email-validator": "^4.0", + "ext-ctype": "*", + "ext-filter": "*", + "ext-hash": "*", + "ext-mbstring": "*", + "ext-openssl": "*", + "ext-session": "*", + "ext-tokenizer": "*", + "fruitcake/php-cors": "^1.3", + "guzzlehttp/guzzle": "^7.8.2", + "guzzlehttp/uri-template": "^1.0", + "laravel/prompts": "^0.3.0", + "laravel/serializable-closure": "^2.0.10", + "league/commonmark": "^2.8.1", + "league/flysystem": "^3.25.1", + "league/flysystem-local": "^3.25.1", + "league/uri": "^7.5.1", + "monolog/monolog": "^3.0", + "nesbot/carbon": "^3.8.4", + "nunomaduro/termwind": "^2.0", + "php": "^8.3", + "psr/container": "^1.1.1 || ^2.0.1", + "psr/log": "^1.0 || ^2.0 || ^3.0", + "psr/simple-cache": "^1.0 || ^2.0 || ^3.0", + "ramsey/uuid": "^4.7", + "symfony/console": "^7.4.0 || ^8.0.0", + "symfony/error-handler": "^7.4.0 || ^8.0.0", + "symfony/finder": "^7.4.0 || ^8.0.0", + "symfony/http-foundation": "^7.4.0 || ^8.0.0", + "symfony/http-kernel": "^7.4.0 || ^8.0.0", + "symfony/mailer": "^7.4.0 || ^8.0.0", + "symfony/mime": "^7.4.0 || ^8.0.0", + "symfony/polyfill-php84": "^1.33", + "symfony/polyfill-php85": "^1.33", + "symfony/process": "^7.4.5 || ^8.0.5", + "symfony/routing": "^7.4.0 || ^8.0.0", + "symfony/uid": "^7.4.0 || ^8.0.0", + "symfony/var-dumper": "^7.4.0 || ^8.0.0", + "tijsverkoyen/css-to-inline-styles": "^2.2.5", + "vlucas/phpdotenv": "^5.6.1", + "voku/portable-ascii": "^2.0.2" + }, + "conflict": { + "tightenco/collect": "<5.5.33" + }, + "provide": { + "psr/container-implementation": "1.1 || 2.0", + "psr/log-implementation": "1.0 || 2.0 || 3.0", + "psr/simple-cache-implementation": "1.0 || 2.0 || 3.0" + }, + "replace": { + "illuminate/auth": "self.version", + "illuminate/broadcasting": "self.version", + "illuminate/bus": "self.version", + "illuminate/cache": "self.version", + "illuminate/collections": "self.version", + "illuminate/concurrency": "self.version", + "illuminate/conditionable": "self.version", + "illuminate/config": "self.version", + "illuminate/console": "self.version", + "illuminate/container": "self.version", + "illuminate/contracts": "self.version", + "illuminate/cookie": "self.version", + "illuminate/database": "self.version", + "illuminate/encryption": "self.version", + "illuminate/events": "self.version", + "illuminate/filesystem": "self.version", + "illuminate/hashing": "self.version", + "illuminate/http": "self.version", + "illuminate/json-schema": "self.version", + "illuminate/log": "self.version", + "illuminate/macroable": "self.version", + "illuminate/mail": "self.version", + "illuminate/notifications": "self.version", + "illuminate/pagination": "self.version", + "illuminate/pipeline": "self.version", + "illuminate/process": "self.version", + "illuminate/queue": "self.version", + "illuminate/redis": "self.version", + "illuminate/reflection": "self.version", + "illuminate/routing": "self.version", + "illuminate/session": "self.version", + "illuminate/support": "self.version", + "illuminate/testing": "self.version", + "illuminate/translation": "self.version", + "illuminate/validation": "self.version", + "illuminate/view": "self.version", + "spatie/once": "*" + }, + "require-dev": { + "ably/ably-php": "^1.0", + "aws/aws-sdk-php": "^3.322.9", + "ext-gmp": "*", + "fakerphp/faker": "^1.24", + "guzzlehttp/promises": "^2.0.3", + "guzzlehttp/psr7": "^2.4", + "laravel/pint": "^1.18", + "league/flysystem-aws-s3-v3": "^3.25.1", + "league/flysystem-ftp": "^3.25.1", + "league/flysystem-path-prefixing": "^3.25.1", + "league/flysystem-read-only": "^3.25.1", + "league/flysystem-sftp-v3": "^3.25.1", + "mockery/mockery": "^1.6.10", + "opis/json-schema": "^2.4.1", + "orchestra/testbench-core": "^11.0.0", + "pda/pheanstalk": "^7.0.0 || ^8.0.0", + "php-http/discovery": "^1.15", + "phpstan/phpstan": "^2.0", + "phpunit/phpunit": "^11.5.50 || ^12.5.8 || ^13.0.3", + "predis/predis": "^2.3 || ^3.0", + "resend/resend-php": "^1.0", + "symfony/cache": "^7.4.0 || ^8.0.0", + "symfony/http-client": "^7.4.0 || ^8.0.0", + "symfony/psr-http-message-bridge": "^7.4.0 || ^8.0.0", + "symfony/translation": "^7.4.0 || ^8.0.0" + }, + "suggest": { + "ably/ably-php": "Required to use the Ably broadcast driver (^1.0).", + "aws/aws-sdk-php": "Required to use the SQS queue driver, DynamoDb failed job storage, and SES mail driver (^3.322.9).", + "brianium/paratest": "Required to run tests in parallel (^7.0 || ^8.0).", + "ext-apcu": "Required to use the APC cache driver.", + "ext-fileinfo": "Required to use the Filesystem class.", + "ext-ftp": "Required to use the Flysystem FTP driver.", + "ext-gd": "Required to use Illuminate\\Http\\Testing\\FileFactory::image().", + "ext-memcached": "Required to use the memcache cache driver.", + "ext-pcntl": "Required to use all features of the queue worker and console signal trapping.", + "ext-pdo": "Required to use all database features.", + "ext-posix": "Required to use all features of the queue worker.", + "ext-redis": "Required to use the Redis cache and queue drivers (^4.0 || ^5.0 || ^6.0).", + "fakerphp/faker": "Required to generate fake data using the fake() helper (^1.23).", + "filp/whoops": "Required for friendly error pages in development (^2.14.3).", + "laravel/tinker": "Required to use the tinker console command (^2.0).", + "league/flysystem-aws-s3-v3": "Required to use the Flysystem S3 driver (^3.25.1).", + "league/flysystem-ftp": "Required to use the Flysystem FTP driver (^3.25.1).", + "league/flysystem-path-prefixing": "Required to use the scoped driver (^3.25.1).", + "league/flysystem-read-only": "Required to use read-only disks (^3.25.1)", + "league/flysystem-sftp-v3": "Required to use the Flysystem SFTP driver (^3.25.1).", + "mockery/mockery": "Required to use mocking (^1.6).", + "pda/pheanstalk": "Required to use the beanstalk queue driver (^7.0 || ^8.0).", + "php-http/discovery": "Required to use PSR-7 bridging features (^1.15).", + "phpunit/phpunit": "Required to use assertions and run tests (^11.5.50 || ^12.5.8 || ^13.0.3).", + "predis/predis": "Required to use the predis connector (^2.3 || ^3.0).", + "psr/http-message": "Required to allow Storage::put to accept a StreamInterface (^1.0).", + "pusher/pusher-php-server": "Required to use the Pusher broadcast driver (^6.0 || ^7.0).", + "resend/resend-php": "Required to enable support for the Resend mail transport (^0.10.0 || ^1.0).", + "symfony/cache": "Required to PSR-6 cache bridge (^7.4 || ^8.0).", + "symfony/filesystem": "Required to enable support for relative symbolic links (^7.4 || ^8.0).", + "symfony/http-client": "Required to enable support for the Symfony API mail transports (^7.4 || ^8.0).", + "symfony/mailgun-mailer": "Required to enable support for the Mailgun mail transport (^7.4 || ^8.0).", + "symfony/postmark-mailer": "Required to enable support for the Postmark mail transport (^7.4 || ^8.0).", + "symfony/psr-http-message-bridge": "Required to use PSR-7 bridging features (^7.4 || ^8.0)." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "13.0.x-dev" + } + }, + "autoload": { + "files": [ + "src/Illuminate/Collections/functions.php", + "src/Illuminate/Collections/helpers.php", + "src/Illuminate/Events/functions.php", + "src/Illuminate/Filesystem/functions.php", + "src/Illuminate/Foundation/helpers.php", + "src/Illuminate/Log/functions.php", + "src/Illuminate/Reflection/helpers.php", + "src/Illuminate/Support/functions.php", + "src/Illuminate/Support/helpers.php" + ], + "psr-4": { + "Illuminate\\": "src/Illuminate/", + "Illuminate\\Support\\": [ + "src/Illuminate/Macroable/", + "src/Illuminate/Collections/", + "src/Illuminate/Conditionable/", + "src/Illuminate/Reflection/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "The Laravel Framework.", + "homepage": "https://laravel.com", + "keywords": [ + "framework", + "laravel" + ], + "support": { + "issues": "https://github.com/laravel/framework/issues", + "source": "https://github.com/laravel/framework" + }, + "time": "2026-03-18T17:10:25+00:00" + }, + { + "name": "laravel/prompts", + "version": "v0.3.15", + "source": { + "type": "git", + "url": "https://github.com/laravel/prompts.git", + "reference": "4bb8107ec97651fd3f17f897d6489dbc4d8fb999" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laravel/prompts/zipball/4bb8107ec97651fd3f17f897d6489dbc4d8fb999", + "reference": "4bb8107ec97651fd3f17f897d6489dbc4d8fb999", + "shasum": "" + }, + "require": { + "composer-runtime-api": "^2.2", + "ext-mbstring": "*", + "php": "^8.1", + "symfony/console": "^6.2|^7.0|^8.0" + }, + "conflict": { + "illuminate/console": ">=10.17.0 <10.25.0", + "laravel/framework": ">=10.17.0 <10.25.0" + }, + "require-dev": { + "illuminate/collections": "^10.0|^11.0|^12.0|^13.0", + "mockery/mockery": "^1.5", + "pestphp/pest": "^2.3|^3.4|^4.0", + "phpstan/phpstan": "^1.12.28", + "phpstan/phpstan-mockery": "^1.1.3" + }, + "suggest": { + "ext-pcntl": "Required for the spinner to be animated." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "0.3.x-dev" + } + }, + "autoload": { + "files": [ + "src/helpers.php" + ], + "psr-4": { + "Laravel\\Prompts\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Add beautiful and user-friendly forms to your command-line applications.", + "support": { + "issues": "https://github.com/laravel/prompts/issues", + "source": "https://github.com/laravel/prompts/tree/v0.3.15" + }, + "time": "2026-03-17T13:45:17+00:00" + }, + { + "name": "laravel/serializable-closure", + "version": "v2.0.10", + "source": { + "type": "git", + "url": "https://github.com/laravel/serializable-closure.git", + "reference": "870fc81d2f879903dfc5b60bf8a0f94a1609e669" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laravel/serializable-closure/zipball/870fc81d2f879903dfc5b60bf8a0f94a1609e669", + "reference": "870fc81d2f879903dfc5b60bf8a0f94a1609e669", + "shasum": "" + }, + "require": { + "php": "^8.1" + }, + "require-dev": { + "illuminate/support": "^10.0|^11.0|^12.0|^13.0", + "nesbot/carbon": "^2.67|^3.0", + "pestphp/pest": "^2.36|^3.0|^4.0", + "phpstan/phpstan": "^2.0", + "symfony/var-dumper": "^6.2.0|^7.0.0|^8.0.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.x-dev" + } + }, + "autoload": { + "psr-4": { + "Laravel\\SerializableClosure\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + }, + { + "name": "Nuno Maduro", + "email": "nuno@laravel.com" + } + ], + "description": "Laravel Serializable Closure provides an easy and secure way to serialize closures in PHP.", + "keywords": [ + "closure", + "laravel", + "serializable" + ], + "support": { + "issues": "https://github.com/laravel/serializable-closure/issues", + "source": "https://github.com/laravel/serializable-closure" + }, + "time": "2026-02-20T19:59:49+00:00" + }, + { + "name": "lastguest/murmurhash", + "version": "2.1.1", + "source": { + "type": "git", + "url": "https://github.com/lastguest/murmurhash-php.git", + "reference": "0150ba26fb7025d1f936983a167cdc74149f87c8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/lastguest/murmurhash-php/zipball/0150ba26fb7025d1f936983a167cdc74149f87c8", + "reference": "0150ba26fb7025d1f936983a167cdc74149f87c8", + "shasum": "" + }, + "require": { + "php": "^7||^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^0.12", + "phpunit/phpunit": "^7||^9" + }, + "type": "library", + "autoload": { + "psr-4": { + "lastguest\\": "src/lastguest/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Stefano Azzolini", + "email": "lastguest@gmail.com", + "homepage": "https://github.com/lastguest/murmurhash-php" + } + ], + "description": "MurmurHash3 Hash", + "homepage": "https://github.com/lastguest/murmurhash-php", + "keywords": [ + "hash", + "hashing", + "murmur" + ], + "support": { + "issues": "https://github.com/lastguest/murmurhash-php/issues", + "source": "https://github.com/lastguest/murmurhash-php/tree/2.1.1" + }, + "time": "2021-04-13T16:23:45+00:00" + }, + { + "name": "league/commonmark", + "version": "2.8.2", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/commonmark.git", + "reference": "59fb075d2101740c337c7216e3f32b36c204218b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/commonmark/zipball/59fb075d2101740c337c7216e3f32b36c204218b", + "reference": "59fb075d2101740c337c7216e3f32b36c204218b", + "shasum": "" + }, + "require": { + "ext-mbstring": "*", + "league/config": "^1.1.1", + "php": "^7.4 || ^8.0", + "psr/event-dispatcher": "^1.0", + "symfony/deprecation-contracts": "^2.1 || ^3.0", + "symfony/polyfill-php80": "^1.16" + }, + "require-dev": { + "cebe/markdown": "^1.0", + "commonmark/cmark": "0.31.1", + "commonmark/commonmark.js": "0.31.1", + "composer/package-versions-deprecated": "^1.8", + "embed/embed": "^4.4", + "erusev/parsedown": "^1.0", + "ext-json": "*", + "github/gfm": "0.29.0", + "michelf/php-markdown": "^1.4 || ^2.0", + "nyholm/psr7": "^1.5", + "phpstan/phpstan": "^1.8.2", + "phpunit/phpunit": "^9.5.21 || ^10.5.9 || ^11.0.0", + "scrutinizer/ocular": "^1.8.1", + "symfony/finder": "^5.3 | ^6.0 | ^7.0 || ^8.0", + "symfony/process": "^5.4 | ^6.0 | ^7.0 || ^8.0", + "symfony/yaml": "^2.3 | ^3.0 | ^4.0 | ^5.0 | ^6.0 | ^7.0 || ^8.0", + "unleashedtech/php-coding-standard": "^3.1.1", + "vimeo/psalm": "^4.24.0 || ^5.0.0 || ^6.0.0" + }, + "suggest": { + "symfony/yaml": "v2.3+ required if using the Front Matter extension" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.9-dev" + } + }, + "autoload": { + "psr-4": { + "League\\CommonMark\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Colin O'Dell", + "email": "colinodell@gmail.com", + "homepage": "https://www.colinodell.com", + "role": "Lead Developer" + } + ], + "description": "Highly-extensible PHP Markdown parser which fully supports the CommonMark spec and GitHub-Flavored Markdown (GFM)", + "homepage": "https://commonmark.thephpleague.com", + "keywords": [ + "commonmark", + "flavored", + "gfm", + "github", + "github-flavored", + "markdown", + "md", + "parser" + ], + "support": { + "docs": "https://commonmark.thephpleague.com/", + "forum": "https://github.com/thephpleague/commonmark/discussions", + "issues": "https://github.com/thephpleague/commonmark/issues", + "rss": "https://github.com/thephpleague/commonmark/releases.atom", + "source": "https://github.com/thephpleague/commonmark" + }, + "funding": [ + { + "url": "https://www.colinodell.com/sponsor", + "type": "custom" + }, + { + "url": "https://www.paypal.me/colinpodell/10.00", + "type": "custom" + }, + { + "url": "https://github.com/colinodell", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/league/commonmark", + "type": "tidelift" + } + ], + "time": "2026-03-19T13:16:38+00:00" + }, + { + "name": "league/config", + "version": "v1.2.0", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/config.git", + "reference": "754b3604fb2984c71f4af4a9cbe7b57f346ec1f3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/config/zipball/754b3604fb2984c71f4af4a9cbe7b57f346ec1f3", + "reference": "754b3604fb2984c71f4af4a9cbe7b57f346ec1f3", + "shasum": "" + }, + "require": { + "dflydev/dot-access-data": "^3.0.1", + "nette/schema": "^1.2", + "php": "^7.4 || ^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^1.8.2", + "phpunit/phpunit": "^9.5.5", + "scrutinizer/ocular": "^1.8.1", + "unleashedtech/php-coding-standard": "^3.1", + "vimeo/psalm": "^4.7.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.2-dev" + } + }, + "autoload": { + "psr-4": { + "League\\Config\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Colin O'Dell", + "email": "colinodell@gmail.com", + "homepage": "https://www.colinodell.com", + "role": "Lead Developer" + } + ], + "description": "Define configuration arrays with strict schemas and access values with dot notation", + "homepage": "https://config.thephpleague.com", + "keywords": [ + "array", + "config", + "configuration", + "dot", + "dot-access", + "nested", + "schema" + ], + "support": { + "docs": "https://config.thephpleague.com/", + "issues": "https://github.com/thephpleague/config/issues", + "rss": "https://github.com/thephpleague/config/releases.atom", + "source": "https://github.com/thephpleague/config" + }, + "funding": [ + { + "url": "https://www.colinodell.com/sponsor", + "type": "custom" + }, + { + "url": "https://www.paypal.me/colinpodell/10.00", + "type": "custom" + }, + { + "url": "https://github.com/colinodell", + "type": "github" + } + ], + "time": "2022-12-11T20:36:23+00:00" + }, + { + "name": "league/flysystem", + "version": "3.32.0", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/flysystem.git", + "reference": "254b1595b16b22dbddaaef9ed6ca9fdac4956725" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/254b1595b16b22dbddaaef9ed6ca9fdac4956725", + "reference": "254b1595b16b22dbddaaef9ed6ca9fdac4956725", + "shasum": "" + }, + "require": { + "league/flysystem-local": "^3.0.0", + "league/mime-type-detection": "^1.0.0", + "php": "^8.0.2" + }, + "conflict": { + "async-aws/core": "<1.19.0", + "async-aws/s3": "<1.14.0", + "aws/aws-sdk-php": "3.209.31 || 3.210.0", + "guzzlehttp/guzzle": "<7.0", + "guzzlehttp/ringphp": "<1.1.1", + "phpseclib/phpseclib": "3.0.15", + "symfony/http-client": "<5.2" + }, + "require-dev": { + "async-aws/s3": "^1.5 || ^2.0", + "async-aws/simple-s3": "^1.1 || ^2.0", + "aws/aws-sdk-php": "^3.295.10", + "composer/semver": "^3.0", + "ext-fileinfo": "*", + "ext-ftp": "*", + "ext-mongodb": "^1.3|^2", + "ext-zip": "*", + "friendsofphp/php-cs-fixer": "^3.5", + "google/cloud-storage": "^1.23", + "guzzlehttp/psr7": "^2.6", + "microsoft/azure-storage-blob": "^1.1", + "mongodb/mongodb": "^1.2|^2", + "phpseclib/phpseclib": "^3.0.36", + "phpstan/phpstan": "^1.10", + "phpunit/phpunit": "^9.5.11|^10.0", + "sabre/dav": "^4.6.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "League\\Flysystem\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Frank de Jonge", + "email": "info@frankdejonge.nl" + } + ], + "description": "File storage abstraction for PHP", + "keywords": [ + "WebDAV", + "aws", + "cloud", + "file", + "files", + "filesystem", + "filesystems", + "ftp", + "s3", + "sftp", + "storage" + ], + "support": { + "issues": "https://github.com/thephpleague/flysystem/issues", + "source": "https://github.com/thephpleague/flysystem/tree/3.32.0" + }, + "time": "2026-02-25T17:01:41+00:00" + }, + { + "name": "league/flysystem-local", + "version": "3.31.0", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/flysystem-local.git", + "reference": "2f669db18a4c20c755c2bb7d3a7b0b2340488079" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/flysystem-local/zipball/2f669db18a4c20c755c2bb7d3a7b0b2340488079", + "reference": "2f669db18a4c20c755c2bb7d3a7b0b2340488079", + "shasum": "" + }, + "require": { + "ext-fileinfo": "*", + "league/flysystem": "^3.0.0", + "league/mime-type-detection": "^1.0.0", + "php": "^8.0.2" + }, + "type": "library", + "autoload": { + "psr-4": { + "League\\Flysystem\\Local\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Frank de Jonge", + "email": "info@frankdejonge.nl" + } + ], + "description": "Local filesystem adapter for Flysystem.", + "keywords": [ + "Flysystem", + "file", + "files", + "filesystem", + "local" + ], + "support": { + "source": "https://github.com/thephpleague/flysystem-local/tree/3.31.0" + }, + "time": "2026-01-23T15:30:45+00:00" + }, + { + "name": "league/mime-type-detection", + "version": "1.16.0", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/mime-type-detection.git", + "reference": "2d6702ff215bf922936ccc1ad31007edc76451b9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/mime-type-detection/zipball/2d6702ff215bf922936ccc1ad31007edc76451b9", + "reference": "2d6702ff215bf922936ccc1ad31007edc76451b9", + "shasum": "" + }, + "require": { + "ext-fileinfo": "*", + "php": "^7.4 || ^8.0" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^3.2", + "phpstan/phpstan": "^0.12.68", + "phpunit/phpunit": "^8.5.8 || ^9.3 || ^10.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "League\\MimeTypeDetection\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Frank de Jonge", + "email": "info@frankdejonge.nl" + } + ], + "description": "Mime-type detection for Flysystem", + "support": { + "issues": "https://github.com/thephpleague/mime-type-detection/issues", + "source": "https://github.com/thephpleague/mime-type-detection/tree/1.16.0" + }, + "funding": [ + { + "url": "https://github.com/frankdejonge", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/league/flysystem", + "type": "tidelift" + } + ], + "time": "2024-09-21T08:32:55+00:00" + }, + { + "name": "league/uri", + "version": "7.8.1", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/uri.git", + "reference": "08cf38e3924d4f56238125547b5720496fac8fd4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/uri/zipball/08cf38e3924d4f56238125547b5720496fac8fd4", + "reference": "08cf38e3924d4f56238125547b5720496fac8fd4", + "shasum": "" + }, + "require": { + "league/uri-interfaces": "^7.8.1", + "php": "^8.1", + "psr/http-factory": "^1" + }, + "conflict": { + "league/uri-schemes": "^1.0" + }, + "suggest": { + "ext-bcmath": "to improve IPV4 host parsing", + "ext-dom": "to convert the URI into an HTML anchor tag", + "ext-fileinfo": "to create Data URI from file contennts", + "ext-gmp": "to improve IPV4 host parsing", + "ext-intl": "to handle IDN host with the best performance", + "ext-uri": "to use the PHP native URI class", + "jeremykendall/php-domain-parser": "to further parse the URI host and resolve its Public Suffix and Top Level Domain", + "league/uri-components": "to provide additional tools to manipulate URI objects components", + "league/uri-polyfill": "to backport the PHP URI extension for older versions of PHP", + "php-64bit": "to improve IPV4 host parsing", + "rowbot/url": "to handle URLs using the WHATWG URL Living Standard specification", + "symfony/polyfill-intl-idn": "to handle IDN host via the Symfony polyfill if ext-intl is not present" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "7.x-dev" + } + }, + "autoload": { + "psr-4": { + "League\\Uri\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ignace Nyamagana Butera", + "email": "nyamsprod@gmail.com", + "homepage": "https://nyamsprod.com" + } + ], + "description": "URI manipulation library", + "homepage": "https://uri.thephpleague.com", + "keywords": [ + "URN", + "data-uri", + "file-uri", + "ftp", + "hostname", + "http", + "https", + "middleware", + "parse_str", + "parse_url", + "psr-7", + "query-string", + "querystring", + "rfc2141", + "rfc3986", + "rfc3987", + "rfc6570", + "rfc8141", + "uri", + "uri-template", + "url", + "ws" + ], + "support": { + "docs": "https://uri.thephpleague.com", + "forum": "https://thephpleague.slack.com", + "issues": "https://github.com/thephpleague/uri-src/issues", + "source": "https://github.com/thephpleague/uri/tree/7.8.1" + }, + "funding": [ + { + "url": "https://github.com/sponsors/nyamsprod", + "type": "github" + } + ], + "time": "2026-03-15T20:22:25+00:00" + }, + { + "name": "league/uri-interfaces", + "version": "7.8.1", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/uri-interfaces.git", + "reference": "85d5c77c5d6d3af6c54db4a78246364908f3c928" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/uri-interfaces/zipball/85d5c77c5d6d3af6c54db4a78246364908f3c928", + "reference": "85d5c77c5d6d3af6c54db4a78246364908f3c928", + "shasum": "" + }, + "require": { + "ext-filter": "*", + "php": "^8.1", + "psr/http-message": "^1.1 || ^2.0" + }, + "suggest": { + "ext-bcmath": "to improve IPV4 host parsing", + "ext-gmp": "to improve IPV4 host parsing", + "ext-intl": "to handle IDN host with the best performance", + "php-64bit": "to improve IPV4 host parsing", + "rowbot/url": "to handle URLs using the WHATWG URL Living Standard specification", + "symfony/polyfill-intl-idn": "to handle IDN host via the Symfony polyfill if ext-intl is not present" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "7.x-dev" + } + }, + "autoload": { + "psr-4": { + "League\\Uri\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ignace Nyamagana Butera", + "email": "nyamsprod@gmail.com", + "homepage": "https://nyamsprod.com" + } + ], + "description": "Common tools for parsing and resolving RFC3987/RFC3986 URI", + "homepage": "https://uri.thephpleague.com", + "keywords": [ + "data-uri", + "file-uri", + "ftp", + "hostname", + "http", + "https", + "parse_str", + "parse_url", + "psr-7", + "query-string", + "querystring", + "rfc3986", + "rfc3987", + "rfc6570", + "uri", + "url", + "ws" + ], + "support": { + "docs": "https://uri.thephpleague.com", + "forum": "https://thephpleague.slack.com", + "issues": "https://github.com/thephpleague/uri-src/issues", + "source": "https://github.com/thephpleague/uri-interfaces/tree/7.8.1" + }, + "funding": [ + { + "url": "https://github.com/sponsors/nyamsprod", + "type": "github" + } + ], + "time": "2026-03-08T20:05:35+00:00" + }, + { + "name": "monolog/monolog", + "version": "3.10.0", + "source": { + "type": "git", + "url": "https://github.com/Seldaek/monolog.git", + "reference": "b321dd6749f0bf7189444158a3ce785cc16d69b0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/b321dd6749f0bf7189444158a3ce785cc16d69b0", + "reference": "b321dd6749f0bf7189444158a3ce785cc16d69b0", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "psr/log": "^2.0 || ^3.0" + }, + "provide": { + "psr/log-implementation": "3.0.0" + }, + "require-dev": { + "aws/aws-sdk-php": "^3.0", + "doctrine/couchdb": "~1.0@dev", + "elasticsearch/elasticsearch": "^7 || ^8", + "ext-json": "*", + "graylog2/gelf-php": "^1.4.2 || ^2.0", + "guzzlehttp/guzzle": "^7.4.5", + "guzzlehttp/psr7": "^2.2", + "mongodb/mongodb": "^1.8 || ^2.0", + "php-amqplib/php-amqplib": "~2.4 || ^3", + "php-console/php-console": "^3.1.8", + "phpstan/phpstan": "^2", + "phpstan/phpstan-deprecation-rules": "^2", + "phpstan/phpstan-strict-rules": "^2", + "phpunit/phpunit": "^10.5.17 || ^11.0.7", + "predis/predis": "^1.1 || ^2", + "rollbar/rollbar": "^4.0", + "ruflin/elastica": "^7 || ^8", + "symfony/mailer": "^5.4 || ^6", + "symfony/mime": "^5.4 || ^6" + }, + "suggest": { + "aws/aws-sdk-php": "Allow sending log messages to AWS services like DynamoDB", + "doctrine/couchdb": "Allow sending log messages to a CouchDB server", + "elasticsearch/elasticsearch": "Allow sending log messages to an Elasticsearch server via official client", + "ext-amqp": "Allow sending log messages to an AMQP server (1.0+ required)", + "ext-curl": "Required to send log messages using the IFTTTHandler, the LogglyHandler, the SendGridHandler, the SlackWebhookHandler or the TelegramBotHandler", + "ext-mbstring": "Allow to work properly with unicode symbols", + "ext-mongodb": "Allow sending log messages to a MongoDB server (via driver)", + "ext-openssl": "Required to send log messages using SSL", + "ext-sockets": "Allow sending log messages to a Syslog server (via UDP driver)", + "graylog2/gelf-php": "Allow sending log messages to a GrayLog2 server", + "mongodb/mongodb": "Allow sending log messages to a MongoDB server (via library)", + "php-amqplib/php-amqplib": "Allow sending log messages to an AMQP server using php-amqplib", + "rollbar/rollbar": "Allow sending log messages to Rollbar", + "ruflin/elastica": "Allow sending log messages to an Elastic Search server" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Monolog\\": "src/Monolog" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "https://seld.be" + } + ], + "description": "Sends your logs to files, sockets, inboxes, databases and various web services", + "homepage": "https://github.com/Seldaek/monolog", + "keywords": [ + "log", + "logging", + "psr-3" + ], + "support": { + "issues": "https://github.com/Seldaek/monolog/issues", + "source": "https://github.com/Seldaek/monolog/tree/3.10.0" + }, + "funding": [ + { + "url": "https://github.com/Seldaek", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/monolog/monolog", + "type": "tidelift" + } + ], + "time": "2026-01-02T08:56:05+00:00" + }, + { + "name": "nesbot/carbon", + "version": "3.11.3", + "source": { + "type": "git", + "url": "https://github.com/CarbonPHP/carbon.git", + "reference": "6a7e652845bb018c668220c2a545aded8594fbbf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/CarbonPHP/carbon/zipball/6a7e652845bb018c668220c2a545aded8594fbbf", + "reference": "6a7e652845bb018c668220c2a545aded8594fbbf", + "shasum": "" + }, + "require": { + "carbonphp/carbon-doctrine-types": "<100.0", + "ext-json": "*", + "php": "^8.1", + "psr/clock": "^1.0", + "symfony/clock": "^6.3.12 || ^7.0 || ^8.0", + "symfony/polyfill-mbstring": "^1.0", + "symfony/translation": "^4.4.18 || ^5.2.1 || ^6.0 || ^7.0 || ^8.0" + }, + "provide": { + "psr/clock-implementation": "1.0" + }, + "require-dev": { + "doctrine/dbal": "^3.6.3 || ^4.0", + "doctrine/orm": "^2.15.2 || ^3.0", + "friendsofphp/php-cs-fixer": "^v3.87.1", + "kylekatarnls/multi-tester": "^2.5.3", + "phpmd/phpmd": "^2.15.0", + "phpstan/extension-installer": "^1.4.3", + "phpstan/phpstan": "^2.1.22", + "phpunit/phpunit": "^10.5.53", + "squizlabs/php_codesniffer": "^3.13.4 || ^4.0.0" + }, + "bin": [ + "bin/carbon" + ], + "type": "library", + "extra": { + "laravel": { + "providers": [ + "Carbon\\Laravel\\ServiceProvider" + ] + }, + "phpstan": { + "includes": [ + "extension.neon" + ] + }, + "branch-alias": { + "dev-2.x": "2.x-dev", + "dev-master": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Carbon\\": "src/Carbon/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Brian Nesbitt", + "email": "brian@nesbot.com", + "homepage": "https://markido.com" + }, + { + "name": "kylekatarnls", + "homepage": "https://github.com/kylekatarnls" + } + ], + "description": "An API extension for DateTime that supports 281 different languages.", + "homepage": "https://carbonphp.github.io/carbon/", + "keywords": [ + "date", + "datetime", + "time" + ], + "support": { + "docs": "https://carbonphp.github.io/carbon/guide/getting-started/introduction.html", + "issues": "https://github.com/CarbonPHP/carbon/issues", + "source": "https://github.com/CarbonPHP/carbon" + }, + "funding": [ + { + "url": "https://github.com/sponsors/kylekatarnls", + "type": "github" + }, + { + "url": "https://opencollective.com/Carbon#sponsor", + "type": "opencollective" + }, + { + "url": "https://tidelift.com/subscription/pkg/packagist-nesbot-carbon?utm_source=packagist-nesbot-carbon&utm_medium=referral&utm_campaign=readme", + "type": "tidelift" + } + ], + "time": "2026-03-11T17:23:39+00:00" + }, + { + "name": "nette/schema", + "version": "v1.3.5", + "source": { + "type": "git", + "url": "https://github.com/nette/schema.git", + "reference": "f0ab1a3cda782dbc5da270d28545236aa80c4002" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nette/schema/zipball/f0ab1a3cda782dbc5da270d28545236aa80c4002", + "reference": "f0ab1a3cda782dbc5da270d28545236aa80c4002", + "shasum": "" + }, + "require": { + "nette/utils": "^4.0", + "php": "8.1 - 8.5" + }, + "require-dev": { + "nette/phpstan-rules": "^1.0", + "nette/tester": "^2.6", + "phpstan/extension-installer": "^1.4@stable", + "phpstan/phpstan": "^2.1.39@stable", + "tracy/tracy": "^2.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3-dev" + } + }, + "autoload": { + "psr-4": { + "Nette\\": "src" + }, + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause", + "GPL-2.0-only", + "GPL-3.0-only" + ], + "authors": [ + { + "name": "David Grudl", + "homepage": "https://davidgrudl.com" + }, + { + "name": "Nette Community", + "homepage": "https://nette.org/contributors" + } + ], + "description": "📐 Nette Schema: validating data structures against a given Schema.", + "homepage": "https://nette.org", + "keywords": [ + "config", + "nette" + ], + "support": { + "issues": "https://github.com/nette/schema/issues", + "source": "https://github.com/nette/schema/tree/v1.3.5" + }, + "time": "2026-02-23T03:47:12+00:00" + }, + { + "name": "nette/utils", + "version": "v4.1.3", + "source": { + "type": "git", + "url": "https://github.com/nette/utils.git", + "reference": "bb3ea637e3d131d72acc033cfc2746ee893349fe" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nette/utils/zipball/bb3ea637e3d131d72acc033cfc2746ee893349fe", + "reference": "bb3ea637e3d131d72acc033cfc2746ee893349fe", + "shasum": "" + }, + "require": { + "php": "8.2 - 8.5" + }, + "conflict": { + "nette/finder": "<3", + "nette/schema": "<1.2.2" + }, + "require-dev": { + "jetbrains/phpstorm-attributes": "^1.2", + "nette/phpstan-rules": "^1.0", + "nette/tester": "^2.5", + "phpstan/extension-installer": "^1.4@stable", + "phpstan/phpstan": "^2.1@stable", + "tracy/tracy": "^2.9" + }, + "suggest": { + "ext-gd": "to use Image", + "ext-iconv": "to use Strings::webalize(), toAscii(), chr() and reverse()", + "ext-intl": "to use Strings::webalize(), toAscii(), normalize() and compare()", + "ext-json": "to use Nette\\Utils\\Json", + "ext-mbstring": "to use Strings::lower() etc...", + "ext-tokenizer": "to use Nette\\Utils\\Reflection::getUseStatements()" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.1-dev" + } + }, + "autoload": { + "psr-4": { + "Nette\\": "src" + }, + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause", + "GPL-2.0-only", + "GPL-3.0-only" + ], + "authors": [ + { + "name": "David Grudl", + "homepage": "https://davidgrudl.com" + }, + { + "name": "Nette Community", + "homepage": "https://nette.org/contributors" + } + ], + "description": "🛠 Nette Utils: lightweight utilities for string & array manipulation, image handling, safe JSON encoding/decoding, validation, slug or strong password generating etc.", + "homepage": "https://nette.org", + "keywords": [ + "array", + "core", + "datetime", + "images", + "json", + "nette", + "paginator", + "password", + "slugify", + "string", + "unicode", + "utf-8", + "utility", + "validation" + ], + "support": { + "issues": "https://github.com/nette/utils/issues", + "source": "https://github.com/nette/utils/tree/v4.1.3" + }, + "time": "2026-02-13T03:05:33+00:00" + }, + { + "name": "nikic/php-parser", + "version": "v5.7.0", + "source": { + "type": "git", + "url": "https://github.com/nikic/PHP-Parser.git", + "reference": "dca41cd15c2ac9d055ad70dbfd011130757d1f82" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/dca41cd15c2ac9d055ad70dbfd011130757d1f82", + "reference": "dca41cd15c2ac9d055ad70dbfd011130757d1f82", + "shasum": "" + }, + "require": { + "ext-ctype": "*", + "ext-json": "*", + "ext-tokenizer": "*", + "php": ">=7.4" + }, + "require-dev": { + "ircmaxell/php-yacc": "^0.0.7", + "phpunit/phpunit": "^9.0" + }, + "bin": [ + "bin/php-parse" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.x-dev" + } + }, + "autoload": { + "psr-4": { + "PhpParser\\": "lib/PhpParser" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Nikita Popov" + } + ], + "description": "A PHP parser written in PHP", + "keywords": [ + "parser", + "php" + ], + "support": { + "issues": "https://github.com/nikic/PHP-Parser/issues", + "source": "https://github.com/nikic/PHP-Parser/tree/v5.7.0" + }, + "time": "2025-12-06T11:56:16+00:00" + }, + { + "name": "nunomaduro/termwind", + "version": "v2.4.0", + "source": { + "type": "git", + "url": "https://github.com/nunomaduro/termwind.git", + "reference": "712a31b768f5daea284c2169a7d227031001b9a8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nunomaduro/termwind/zipball/712a31b768f5daea284c2169a7d227031001b9a8", + "reference": "712a31b768f5daea284c2169a7d227031001b9a8", + "shasum": "" + }, + "require": { + "ext-mbstring": "*", + "php": "^8.2", + "symfony/console": "^7.4.4 || ^8.0.4" + }, + "require-dev": { + "illuminate/console": "^11.47.0", + "laravel/pint": "^1.27.1", + "mockery/mockery": "^1.6.12", + "pestphp/pest": "^2.36.0 || ^3.8.4 || ^4.3.2", + "phpstan/phpstan": "^1.12.32", + "phpstan/phpstan-strict-rules": "^1.6.2", + "symfony/var-dumper": "^7.3.5 || ^8.0.4", + "thecodingmachine/phpstan-strict-rules": "^1.0.0" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "Termwind\\Laravel\\TermwindServiceProvider" + ] + }, + "branch-alias": { + "dev-2.x": "2.x-dev" + } + }, + "autoload": { + "files": [ + "src/Functions.php" + ], + "psr-4": { + "Termwind\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nuno Maduro", + "email": "enunomaduro@gmail.com" + } + ], + "description": "It's like Tailwind CSS, but for the console.", + "keywords": [ + "cli", + "console", + "css", + "package", + "php", + "style" + ], + "support": { + "issues": "https://github.com/nunomaduro/termwind/issues", + "source": "https://github.com/nunomaduro/termwind/tree/v2.4.0" + }, + "funding": [ + { + "url": "https://www.paypal.com/paypalme/enunomaduro", + "type": "custom" + }, + { + "url": "https://github.com/nunomaduro", + "type": "github" + }, + { + "url": "https://github.com/xiCO2k", + "type": "github" + } + ], + "time": "2026-02-16T23:10:27+00:00" + }, + { + "name": "php-http/discovery", + "version": "1.20.0", + "source": { + "type": "git", + "url": "https://github.com/php-http/discovery.git", + "reference": "82fe4c73ef3363caed49ff8dd1539ba06044910d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/discovery/zipball/82fe4c73ef3363caed49ff8dd1539ba06044910d", + "reference": "82fe4c73ef3363caed49ff8dd1539ba06044910d", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.0|^2.0", + "php": "^7.1 || ^8.0" + }, + "conflict": { + "nyholm/psr7": "<1.0", + "zendframework/zend-diactoros": "*" + }, + "provide": { + "php-http/async-client-implementation": "*", + "php-http/client-implementation": "*", + "psr/http-client-implementation": "*", + "psr/http-factory-implementation": "*", + "psr/http-message-implementation": "*" + }, + "require-dev": { + "composer/composer": "^1.0.2|^2.0", + "graham-campbell/phpspec-skip-example-extension": "^5.0", + "php-http/httplug": "^1.0 || ^2.0", + "php-http/message-factory": "^1.0", + "phpspec/phpspec": "^5.1 || ^6.1 || ^7.3", + "sebastian/comparator": "^3.0.5 || ^4.0.8", + "symfony/phpunit-bridge": "^6.4.4 || ^7.0.1" + }, + "type": "composer-plugin", + "extra": { + "class": "Http\\Discovery\\Composer\\Plugin", + "plugin-optional": true + }, + "autoload": { + "psr-4": { + "Http\\Discovery\\": "src/" + }, + "exclude-from-classmap": [ + "src/Composer/Plugin.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" + } + ], + "description": "Finds and installs PSR-7, PSR-17, PSR-18 and HTTPlug implementations", + "homepage": "http://php-http.org", + "keywords": [ + "adapter", + "client", + "discovery", + "factory", + "http", + "message", + "psr17", + "psr7" + ], + "support": { + "issues": "https://github.com/php-http/discovery/issues", + "source": "https://github.com/php-http/discovery/tree/1.20.0" + }, + "time": "2024-10-02T11:20:13+00:00" + }, + { + "name": "phpoption/phpoption", + "version": "1.9.5", + "source": { + "type": "git", + "url": "https://github.com/schmittjoh/php-option.git", + "reference": "75365b91986c2405cf5e1e012c5595cd487a98be" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/schmittjoh/php-option/zipball/75365b91986c2405cf5e1e012c5595cd487a98be", + "reference": "75365b91986c2405cf5e1e012c5595cd487a98be", + "shasum": "" + }, + "require": { + "php": "^7.2.5 || ^8.0" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.8.2", + "phpunit/phpunit": "^8.5.44 || ^9.6.25 || ^10.5.53 || ^11.5.34" + }, + "type": "library", + "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": false + }, + "branch-alias": { + "dev-master": "1.9-dev" + } + }, + "autoload": { + "psr-4": { + "PhpOption\\": "src/PhpOption/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "Johannes M. Schmitt", + "email": "schmittjoh@gmail.com", + "homepage": "https://github.com/schmittjoh" + }, + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + } + ], + "description": "Option Type for PHP", + "keywords": [ + "language", + "option", + "php", + "type" + ], + "support": { + "issues": "https://github.com/schmittjoh/php-option/issues", + "source": "https://github.com/schmittjoh/php-option/tree/1.9.5" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpoption/phpoption", + "type": "tidelift" + } + ], + "time": "2025-12-27T19:41:33+00:00" + }, + { + "name": "psr/cache", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/cache.git", + "reference": "aa5030cfa5405eccfdcb1083ce040c2cb8d253bf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/cache/zipball/aa5030cfa5405eccfdcb1083ce040c2cb8d253bf", + "reference": "aa5030cfa5405eccfdcb1083ce040c2cb8d253bf", + "shasum": "" + }, + "require": { + "php": ">=8.0.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Cache\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for caching libraries", + "keywords": [ + "cache", + "psr", + "psr-6" + ], + "support": { + "source": "https://github.com/php-fig/cache/tree/3.0.0" + }, + "time": "2021-02-03T23:26:27+00:00" + }, + { + "name": "psr/clock", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/clock.git", + "reference": "e41a24703d4560fd0acb709162f73b8adfc3aa0d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/clock/zipball/e41a24703d4560fd0acb709162f73b8adfc3aa0d", + "reference": "e41a24703d4560fd0acb709162f73b8adfc3aa0d", + "shasum": "" + }, + "require": { + "php": "^7.0 || ^8.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Psr\\Clock\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for reading the clock.", + "homepage": "https://github.com/php-fig/clock", + "keywords": [ + "clock", + "now", + "psr", + "psr-20", + "time" + ], + "support": { + "issues": "https://github.com/php-fig/clock/issues", + "source": "https://github.com/php-fig/clock/tree/1.0.0" + }, + "time": "2022-11-25T14:36:26+00:00" + }, + { + "name": "psr/container", + "version": "2.0.2", + "source": { + "type": "git", + "url": "https://github.com/php-fig/container.git", + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/container/zipball/c71ecc56dfe541dbd90c5360474fbc405f8d5963", + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963", + "shasum": "" + }, + "require": { + "php": ">=7.4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Container\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", + "keywords": [ + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" + ], + "support": { + "issues": "https://github.com/php-fig/container/issues", + "source": "https://github.com/php-fig/container/tree/2.0.2" + }, + "time": "2021-11-05T16:47:00+00:00" + }, + { + "name": "psr/event-dispatcher", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/event-dispatcher.git", + "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/event-dispatcher/zipball/dbefd12671e8a14ec7f180cab83036ed26714bb0", + "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0", + "shasum": "" + }, + "require": { + "php": ">=7.2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\EventDispatcher\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Standard interfaces for event handling.", + "keywords": [ + "events", + "psr", + "psr-14" + ], + "support": { + "issues": "https://github.com/php-fig/event-dispatcher/issues", + "source": "https://github.com/php-fig/event-dispatcher/tree/1.0.0" + }, + "time": "2019-01-08T18:20:26+00:00" + }, + { + "name": "psr/http-client", + "version": "1.0.3", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-client.git", + "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-client/zipball/bb5906edc1c324c9a05aa0873d40117941e5fa90", + "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90", + "shasum": "" + }, + "require": { + "php": "^7.0 || ^8.0", + "psr/http-message": "^1.0 || ^2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Client\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP clients", + "homepage": "https://github.com/php-fig/http-client", + "keywords": [ + "http", + "http-client", + "psr", + "psr-18" + ], + "support": { + "source": "https://github.com/php-fig/http-client" + }, + "time": "2023-09-23T14:17:50+00:00" + }, + { + "name": "psr/http-factory", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-factory.git", + "reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-factory/zipball/2b4765fddfe3b508ac62f829e852b1501d3f6e8a", + "reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a", + "shasum": "" + }, + "require": { + "php": ">=7.1", + "psr/http-message": "^1.0 || ^2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "PSR-17: Common interfaces for PSR-7 HTTP message factories", + "keywords": [ + "factory", + "http", + "message", + "psr", + "psr-17", + "psr-7", + "request", + "response" + ], + "support": { + "source": "https://github.com/php-fig/http-factory" + }, + "time": "2024-04-15T12:06:14+00:00" + }, + { + "name": "psr/http-message", + "version": "2.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-message.git", + "reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/402d35bcb92c70c026d1a6a9883f06b2ead23d71", + "reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP messages", + "homepage": "https://github.com/php-fig/http-message", + "keywords": [ + "http", + "http-message", + "psr", + "psr-7", + "request", + "response" + ], + "support": { + "source": "https://github.com/php-fig/http-message/tree/2.0" + }, + "time": "2023-04-04T09:54:51+00:00" + }, + { + "name": "psr/log", + "version": "3.0.2", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/f16e1d5863e37f8d8c2a01719f5b34baa2b714d3", + "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3", + "shasum": "" + }, + "require": { + "php": ">=8.0.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "support": { + "source": "https://github.com/php-fig/log/tree/3.0.2" + }, + "time": "2024-09-11T13:17:53+00:00" + }, + { + "name": "psr/simple-cache", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/simple-cache.git", + "reference": "764e0b3939f5ca87cb904f570ef9be2d78a07865" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/764e0b3939f5ca87cb904f570ef9be2d78a07865", + "reference": "764e0b3939f5ca87cb904f570ef9be2d78a07865", + "shasum": "" + }, + "require": { + "php": ">=8.0.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\SimpleCache\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interfaces for simple caching", + "keywords": [ + "cache", + "caching", + "psr", + "psr-16", + "simple-cache" + ], + "support": { + "source": "https://github.com/php-fig/simple-cache/tree/3.0.0" + }, + "time": "2021-10-29T13:26:27+00:00" + }, + { + "name": "psy/psysh", + "version": "v0.12.21", + "source": { + "type": "git", + "url": "https://github.com/bobthecow/psysh.git", + "reference": "4821fab5b7cd8c49a673a9fd5754dc9162bb9e97" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/bobthecow/psysh/zipball/4821fab5b7cd8c49a673a9fd5754dc9162bb9e97", + "reference": "4821fab5b7cd8c49a673a9fd5754dc9162bb9e97", + "shasum": "" + }, + "require": { + "ext-json": "*", + "ext-tokenizer": "*", + "nikic/php-parser": "^5.0 || ^4.0", + "php": "^8.0 || ^7.4", + "symfony/console": "^8.0 || ^7.0 || ^6.0 || ^5.0 || ^4.0 || ^3.4", + "symfony/var-dumper": "^8.0 || ^7.0 || ^6.0 || ^5.0 || ^4.0 || ^3.4" + }, + "conflict": { + "symfony/console": "4.4.37 || 5.3.14 || 5.3.15 || 5.4.3 || 5.4.4 || 6.0.3 || 6.0.4" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.2", + "composer/class-map-generator": "^1.6" + }, + "suggest": { + "composer/class-map-generator": "Improved tab completion performance with better class discovery.", + "ext-pcntl": "Enabling the PCNTL extension makes PsySH a lot happier :)", + "ext-posix": "If you have PCNTL, you'll want the POSIX extension as well." + }, + "bin": [ + "bin/psysh" + ], + "type": "library", + "extra": { + "bamarni-bin": { + "bin-links": false, + "forward-command": false + }, + "branch-alias": { + "dev-main": "0.12.x-dev" + } + }, + "autoload": { + "files": [ + "src/functions.php" + ], + "psr-4": { + "Psy\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Justin Hileman", + "email": "justin@justinhileman.info" + } + ], + "description": "An interactive shell for modern PHP.", + "homepage": "https://psysh.org", + "keywords": [ + "REPL", + "console", + "interactive", + "shell" + ], + "support": { + "issues": "https://github.com/bobthecow/psysh/issues", + "source": "https://github.com/bobthecow/psysh/tree/v0.12.21" + }, + "time": "2026-03-06T21:21:28+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": "ramsey/collection", + "version": "2.1.1", + "source": { + "type": "git", + "url": "https://github.com/ramsey/collection.git", + "reference": "344572933ad0181accbf4ba763e85a0306a8c5e2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ramsey/collection/zipball/344572933ad0181accbf4ba763e85a0306a8c5e2", + "reference": "344572933ad0181accbf4ba763e85a0306a8c5e2", + "shasum": "" + }, + "require": { + "php": "^8.1" + }, + "require-dev": { + "captainhook/plugin-composer": "^5.3", + "ergebnis/composer-normalize": "^2.45", + "fakerphp/faker": "^1.24", + "hamcrest/hamcrest-php": "^2.0", + "jangregor/phpstan-prophecy": "^2.1", + "mockery/mockery": "^1.6", + "php-parallel-lint/php-console-highlighter": "^1.0", + "php-parallel-lint/php-parallel-lint": "^1.4", + "phpspec/prophecy-phpunit": "^2.3", + "phpstan/extension-installer": "^1.4", + "phpstan/phpstan": "^2.1", + "phpstan/phpstan-mockery": "^2.0", + "phpstan/phpstan-phpunit": "^2.0", + "phpunit/phpunit": "^10.5", + "ramsey/coding-standard": "^2.3", + "ramsey/conventional-commits": "^1.6", + "roave/security-advisories": "dev-latest" + }, + "type": "library", + "extra": { + "captainhook": { + "force-install": true + }, + "ramsey/conventional-commits": { + "configFile": "conventional-commits.json" + } + }, + "autoload": { + "psr-4": { + "Ramsey\\Collection\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ben Ramsey", + "email": "ben@benramsey.com", + "homepage": "https://benramsey.com" + } + ], + "description": "A PHP library for representing and manipulating collections.", + "keywords": [ + "array", + "collection", + "hash", + "map", + "queue", + "set" + ], + "support": { + "issues": "https://github.com/ramsey/collection/issues", + "source": "https://github.com/ramsey/collection/tree/2.1.1" + }, + "time": "2025-03-22T05:38:12+00:00" + }, + { + "name": "ramsey/uuid", + "version": "4.9.2", + "source": { + "type": "git", + "url": "https://github.com/ramsey/uuid.git", + "reference": "8429c78ca35a09f27565311b98101e2826affde0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ramsey/uuid/zipball/8429c78ca35a09f27565311b98101e2826affde0", + "reference": "8429c78ca35a09f27565311b98101e2826affde0", + "shasum": "" + }, + "require": { + "brick/math": "^0.8.16 || ^0.9 || ^0.10 || ^0.11 || ^0.12 || ^0.13 || ^0.14", + "php": "^8.0", + "ramsey/collection": "^1.2 || ^2.0" + }, + "replace": { + "rhumsaa/uuid": "self.version" + }, + "require-dev": { + "captainhook/captainhook": "^5.25", + "captainhook/plugin-composer": "^5.3", + "dealerdirect/phpcodesniffer-composer-installer": "^1.0", + "ergebnis/composer-normalize": "^2.47", + "mockery/mockery": "^1.6", + "paragonie/random-lib": "^2", + "php-mock/php-mock": "^2.6", + "php-mock/php-mock-mockery": "^1.5", + "php-parallel-lint/php-parallel-lint": "^1.4.0", + "phpbench/phpbench": "^1.2.14", + "phpstan/extension-installer": "^1.4", + "phpstan/phpstan": "^2.1", + "phpstan/phpstan-mockery": "^2.0", + "phpstan/phpstan-phpunit": "^2.0", + "phpunit/phpunit": "^9.6", + "slevomat/coding-standard": "^8.18", + "squizlabs/php_codesniffer": "^3.13" + }, + "suggest": { + "ext-bcmath": "Enables faster math with arbitrary-precision integers using BCMath.", + "ext-gmp": "Enables faster math with arbitrary-precision integers using GMP.", + "ext-uuid": "Enables the use of PeclUuidTimeGenerator and PeclUuidRandomGenerator.", + "paragonie/random-lib": "Provides RandomLib for use with the RandomLibAdapter", + "ramsey/uuid-doctrine": "Allows the use of Ramsey\\Uuid\\Uuid as Doctrine field type." + }, + "type": "library", + "extra": { + "captainhook": { + "force-install": true + } + }, + "autoload": { + "files": [ + "src/functions.php" + ], + "psr-4": { + "Ramsey\\Uuid\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "A PHP library for generating and working with universally unique identifiers (UUIDs).", + "keywords": [ + "guid", + "identifier", + "uuid" + ], + "support": { + "issues": "https://github.com/ramsey/uuid/issues", + "source": "https://github.com/ramsey/uuid/tree/4.9.2" + }, + "time": "2025-12-14T04:43:48+00:00" + }, + { + "name": "symfony/cache", + "version": "v7.4.7", + "source": { + "type": "git", + "url": "https://github.com/symfony/cache.git", + "reference": "665522ec357540e66c294c08583b40ee576574f0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/cache/zipball/665522ec357540e66c294c08583b40ee576574f0", + "reference": "665522ec357540e66c294c08583b40ee576574f0", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "psr/cache": "^2.0|^3.0", + "psr/log": "^1.1|^2|^3", + "symfony/cache-contracts": "^3.6", + "symfony/deprecation-contracts": "^2.5|^3", + "symfony/service-contracts": "^2.5|^3", + "symfony/var-exporter": "^6.4|^7.0|^8.0" + }, + "conflict": { + "doctrine/dbal": "<3.6", + "ext-redis": "<6.1", + "ext-relay": "<0.12.1", + "symfony/dependency-injection": "<6.4", + "symfony/http-kernel": "<6.4", + "symfony/var-dumper": "<6.4" + }, + "provide": { + "psr/cache-implementation": "2.0|3.0", + "psr/simple-cache-implementation": "1.0|2.0|3.0", + "symfony/cache-implementation": "1.1|2.0|3.0" + }, + "require-dev": { + "cache/integration-tests": "dev-master", + "doctrine/dbal": "^3.6|^4", + "predis/predis": "^1.1|^2.0", + "psr/simple-cache": "^1.0|^2.0|^3.0", + "symfony/clock": "^6.4|^7.0|^8.0", + "symfony/config": "^6.4|^7.0|^8.0", + "symfony/dependency-injection": "^6.4|^7.0|^8.0", + "symfony/filesystem": "^6.4|^7.0|^8.0", + "symfony/http-kernel": "^6.4|^7.0|^8.0", + "symfony/messenger": "^6.4|^7.0|^8.0", + "symfony/var-dumper": "^6.4|^7.0|^8.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Cache\\": "" + }, + "classmap": [ + "Traits/ValueWrapper.php" + ], + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides extended PSR-6, PSR-16 (and tags) implementations", + "homepage": "https://symfony.com", + "keywords": [ + "caching", + "psr6" + ], + "support": { + "source": "https://github.com/symfony/cache/tree/v7.4.7" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-03-06T08:14:57+00:00" + }, + { + "name": "symfony/cache-contracts", + "version": "v3.6.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/cache-contracts.git", + "reference": "5d68a57d66910405e5c0b63d6f0af941e66fc868" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/cache-contracts/zipball/5d68a57d66910405e5c0b63d6f0af941e66fc868", + "reference": "5d68a57d66910405e5c0b63d6f0af941e66fc868", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "psr/cache": "^3.0" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, + "branch-alias": { + "dev-main": "3.6-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\Cache\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to caching", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "support": { + "source": "https://github.com/symfony/cache-contracts/tree/v3.6.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2025-03-13T15:25:07+00:00" + }, + { + "name": "symfony/clock", + "version": "v8.0.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/clock.git", + "reference": "832119f9b8dbc6c8e6f65f30c5969eca1e88764f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/clock/zipball/832119f9b8dbc6c8e6f65f30c5969eca1e88764f", + "reference": "832119f9b8dbc6c8e6f65f30c5969eca1e88764f", + "shasum": "" + }, + "require": { + "php": ">=8.4", + "psr/clock": "^1.0" + }, + "provide": { + "psr/clock-implementation": "1.0" + }, + "type": "library", + "autoload": { + "files": [ + "Resources/now.php" + ], + "psr-4": { + "Symfony\\Component\\Clock\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Decouples applications from the system clock", + "homepage": "https://symfony.com", + "keywords": [ + "clock", + "psr20", + "time" + ], + "support": { + "source": "https://github.com/symfony/clock/tree/v8.0.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2025-11-12T15:46:48+00:00" + }, + { + "name": "symfony/console", + "version": "v8.0.7", + "source": { + "type": "git", + "url": "https://github.com/symfony/console.git", + "reference": "15ed9008a4ebe2d6a78e4937f74e0c13ef2e618a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/console/zipball/15ed9008a4ebe2d6a78e4937f74e0c13ef2e618a", + "reference": "15ed9008a4ebe2d6a78e4937f74e0c13ef2e618a", + "shasum": "" + }, + "require": { + "php": ">=8.4", + "symfony/polyfill-mbstring": "^1.0", + "symfony/service-contracts": "^2.5|^3", + "symfony/string": "^7.4|^8.0" + }, + "provide": { + "psr/log-implementation": "1.0|2.0|3.0" + }, + "require-dev": { + "psr/log": "^1|^2|^3", + "symfony/config": "^7.4|^8.0", + "symfony/dependency-injection": "^7.4|^8.0", + "symfony/event-dispatcher": "^7.4|^8.0", + "symfony/http-foundation": "^7.4|^8.0", + "symfony/http-kernel": "^7.4|^8.0", + "symfony/lock": "^7.4|^8.0", + "symfony/messenger": "^7.4|^8.0", + "symfony/process": "^7.4|^8.0", + "symfony/stopwatch": "^7.4|^8.0", + "symfony/var-dumper": "^7.4|^8.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Console\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Eases the creation of beautiful and testable command line interfaces", + "homepage": "https://symfony.com", + "keywords": [ + "cli", + "command-line", + "console", + "terminal" + ], + "support": { + "source": "https://github.com/symfony/console/tree/v8.0.7" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-03-06T14:06:22+00:00" + }, + { + "name": "symfony/css-selector", + "version": "v8.0.6", + "source": { + "type": "git", + "url": "https://github.com/symfony/css-selector.git", + "reference": "2a178bf80f05dbbe469a337730eba79d61315262" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/css-selector/zipball/2a178bf80f05dbbe469a337730eba79d61315262", + "reference": "2a178bf80f05dbbe469a337730eba79d61315262", + "shasum": "" + }, + "require": { + "php": ">=8.4" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\CssSelector\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Jean-François Simon", + "email": "jeanfrancois.simon@sensiolabs.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Converts CSS selectors to XPath expressions", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/css-selector/tree/v8.0.6" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-02-17T13:07:04+00:00" + }, + { + "name": "symfony/deprecation-contracts", + "version": "v3.6.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/deprecation-contracts.git", + "reference": "63afe740e99a13ba87ec199bb07bbdee937a5b62" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/63afe740e99a13ba87ec199bb07bbdee937a5b62", + "reference": "63afe740e99a13ba87ec199bb07bbdee937a5b62", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, + "branch-alias": { + "dev-main": "3.6-dev" + } + }, + "autoload": { + "files": [ + "function.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "A generic function and convention to trigger deprecation notices", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.6.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-09-25T14:21:43+00:00" + }, + { + "name": "symfony/error-handler", + "version": "v8.0.4", + "source": { + "type": "git", + "url": "https://github.com/symfony/error-handler.git", + "reference": "7620b97ec0ab1d2d6c7fb737aa55da411bea776a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/error-handler/zipball/7620b97ec0ab1d2d6c7fb737aa55da411bea776a", + "reference": "7620b97ec0ab1d2d6c7fb737aa55da411bea776a", + "shasum": "" + }, + "require": { + "php": ">=8.4", + "psr/log": "^1|^2|^3", + "symfony/polyfill-php85": "^1.32", + "symfony/var-dumper": "^7.4|^8.0" + }, + "conflict": { + "symfony/deprecation-contracts": "<2.5" + }, + "require-dev": { + "symfony/console": "^7.4|^8.0", + "symfony/deprecation-contracts": "^2.5|^3", + "symfony/http-kernel": "^7.4|^8.0", + "symfony/serializer": "^7.4|^8.0", + "symfony/webpack-encore-bundle": "^1.0|^2.0" + }, + "bin": [ + "Resources/bin/patch-type-declarations" + ], + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\ErrorHandler\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides tools to manage errors and ease debugging PHP code", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/error-handler/tree/v8.0.4" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-01-23T11:07:10+00:00" + }, + { + "name": "symfony/event-dispatcher", + "version": "v8.0.4", + "source": { + "type": "git", + "url": "https://github.com/symfony/event-dispatcher.git", + "reference": "99301401da182b6cfaa4700dbe9987bb75474b47" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/99301401da182b6cfaa4700dbe9987bb75474b47", + "reference": "99301401da182b6cfaa4700dbe9987bb75474b47", + "shasum": "" + }, + "require": { + "php": ">=8.4", + "symfony/event-dispatcher-contracts": "^2.5|^3" + }, + "conflict": { + "symfony/security-http": "<7.4", + "symfony/service-contracts": "<2.5" + }, + "provide": { + "psr/event-dispatcher-implementation": "1.0", + "symfony/event-dispatcher-implementation": "2.0|3.0" + }, + "require-dev": { + "psr/log": "^1|^2|^3", + "symfony/config": "^7.4|^8.0", + "symfony/dependency-injection": "^7.4|^8.0", + "symfony/error-handler": "^7.4|^8.0", + "symfony/expression-language": "^7.4|^8.0", + "symfony/framework-bundle": "^7.4|^8.0", + "symfony/http-foundation": "^7.4|^8.0", + "symfony/service-contracts": "^2.5|^3", + "symfony/stopwatch": "^7.4|^8.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\EventDispatcher\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/event-dispatcher/tree/v8.0.4" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-01-05T11:45:55+00:00" + }, + { + "name": "symfony/event-dispatcher-contracts", + "version": "v3.6.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/event-dispatcher-contracts.git", + "reference": "59eb412e93815df44f05f342958efa9f46b1e586" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/59eb412e93815df44f05f342958efa9f46b1e586", + "reference": "59eb412e93815df44f05f342958efa9f46b1e586", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "psr/event-dispatcher": "^1" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, + "branch-alias": { + "dev-main": "3.6-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\EventDispatcher\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to dispatching event", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "support": { + "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.6.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-09-25T14:21:43+00:00" + }, + { + "name": "symfony/finder", + "version": "v8.0.6", + "source": { + "type": "git", + "url": "https://github.com/symfony/finder.git", + "reference": "441404f09a54de6d1bd6ad219e088cdf4c91f97c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/finder/zipball/441404f09a54de6d1bd6ad219e088cdf4c91f97c", + "reference": "441404f09a54de6d1bd6ad219e088cdf4c91f97c", + "shasum": "" + }, + "require": { + "php": ">=8.4" + }, + "require-dev": { + "symfony/filesystem": "^7.4|^8.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Finder\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Finds files and directories via an intuitive fluent interface", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/finder/tree/v8.0.6" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-01-29T09:41:02+00:00" + }, + { + "name": "symfony/http-foundation", + "version": "v8.0.7", + "source": { + "type": "git", + "url": "https://github.com/symfony/http-foundation.git", + "reference": "c5ecf7b07408dbc4a87482634307654190954ae8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/c5ecf7b07408dbc4a87482634307654190954ae8", + "reference": "c5ecf7b07408dbc4a87482634307654190954ae8", + "shasum": "" + }, + "require": { + "php": ">=8.4", + "symfony/polyfill-mbstring": "^1.1" + }, + "conflict": { + "doctrine/dbal": "<4.3" + }, + "require-dev": { + "doctrine/dbal": "^4.3", + "predis/predis": "^1.1|^2.0", + "symfony/cache": "^7.4|^8.0", + "symfony/clock": "^7.4|^8.0", + "symfony/dependency-injection": "^7.4|^8.0", + "symfony/expression-language": "^7.4|^8.0", + "symfony/http-kernel": "^7.4|^8.0", + "symfony/mime": "^7.4|^8.0", + "symfony/rate-limiter": "^7.4|^8.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\HttpFoundation\\": "" + }, + "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": "Defines an object-oriented layer for the HTTP specification", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/http-foundation/tree/v8.0.7" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-03-06T13:17:40+00:00" + }, + { + "name": "symfony/http-kernel", + "version": "v8.0.7", + "source": { + "type": "git", + "url": "https://github.com/symfony/http-kernel.git", + "reference": "c04721f45723d8ce049fa3eee378b5a505272ac7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/c04721f45723d8ce049fa3eee378b5a505272ac7", + "reference": "c04721f45723d8ce049fa3eee378b5a505272ac7", + "shasum": "" + }, + "require": { + "php": ">=8.4", + "psr/log": "^1|^2|^3", + "symfony/error-handler": "^7.4|^8.0", + "symfony/event-dispatcher": "^7.4|^8.0", + "symfony/http-foundation": "^7.4|^8.0", + "symfony/polyfill-ctype": "^1.8" + }, + "conflict": { + "symfony/flex": "<2.10", + "symfony/http-client-contracts": "<2.5", + "symfony/translation-contracts": "<2.5", + "twig/twig": "<3.21" + }, + "provide": { + "psr/log-implementation": "1.0|2.0|3.0" + }, + "require-dev": { + "psr/cache": "^1.0|^2.0|^3.0", + "symfony/browser-kit": "^7.4|^8.0", + "symfony/clock": "^7.4|^8.0", + "symfony/config": "^7.4|^8.0", + "symfony/console": "^7.4|^8.0", + "symfony/css-selector": "^7.4|^8.0", + "symfony/dependency-injection": "^7.4|^8.0", + "symfony/dom-crawler": "^7.4|^8.0", + "symfony/expression-language": "^7.4|^8.0", + "symfony/finder": "^7.4|^8.0", + "symfony/http-client-contracts": "^2.5|^3", + "symfony/process": "^7.4|^8.0", + "symfony/property-access": "^7.4|^8.0", + "symfony/routing": "^7.4|^8.0", + "symfony/serializer": "^7.4|^8.0", + "symfony/stopwatch": "^7.4|^8.0", + "symfony/translation": "^7.4|^8.0", + "symfony/translation-contracts": "^2.5|^3", + "symfony/uid": "^7.4|^8.0", + "symfony/validator": "^7.4|^8.0", + "symfony/var-dumper": "^7.4|^8.0", + "symfony/var-exporter": "^7.4|^8.0", + "twig/twig": "^3.21" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\HttpKernel\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides a structured process for converting a Request into a Response", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/http-kernel/tree/v8.0.7" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-03-06T16:58:46+00:00" + }, + { + "name": "symfony/mailer", + "version": "v8.0.6", + "source": { + "type": "git", + "url": "https://github.com/symfony/mailer.git", + "reference": "a8971c86b25ff8557e844f08c1f6207d9b3e614c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/mailer/zipball/a8971c86b25ff8557e844f08c1f6207d9b3e614c", + "reference": "a8971c86b25ff8557e844f08c1f6207d9b3e614c", + "shasum": "" + }, + "require": { + "egulias/email-validator": "^2.1.10|^3|^4", + "php": ">=8.4", + "psr/event-dispatcher": "^1", + "psr/log": "^1|^2|^3", + "symfony/event-dispatcher": "^7.4|^8.0", + "symfony/mime": "^7.4|^8.0", + "symfony/service-contracts": "^2.5|^3" + }, + "conflict": { + "symfony/http-client-contracts": "<2.5" + }, + "require-dev": { + "symfony/console": "^7.4|^8.0", + "symfony/http-client": "^7.4|^8.0", + "symfony/messenger": "^7.4|^8.0", + "symfony/twig-bridge": "^7.4|^8.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Mailer\\": "" + }, + "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": "Helps sending emails", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/mailer/tree/v8.0.6" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-02-25T16:59:43+00:00" + }, + { + "name": "symfony/mime", + "version": "v8.0.7", + "source": { + "type": "git", + "url": "https://github.com/symfony/mime.git", + "reference": "5d26d1958aeeba2ace8cc64a3a93d4f5d8f8022b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/mime/zipball/5d26d1958aeeba2ace8cc64a3a93d4f5d8f8022b", + "reference": "5d26d1958aeeba2ace8cc64a3a93d4f5d8f8022b", + "shasum": "" + }, + "require": { + "php": ">=8.4", + "symfony/polyfill-intl-idn": "^1.10", + "symfony/polyfill-mbstring": "^1.0" + }, + "conflict": { + "egulias/email-validator": "~3.0.0", + "phpdocumentor/reflection-docblock": "<5.2|>=7", + "phpdocumentor/type-resolver": "<1.5.1" + }, + "require-dev": { + "egulias/email-validator": "^2.1.10|^3.1|^4", + "league/html-to-markdown": "^5.0", + "phpdocumentor/reflection-docblock": "^5.2|^6.0", + "symfony/dependency-injection": "^7.4|^8.0", + "symfony/process": "^7.4|^8.0", + "symfony/property-access": "^7.4|^8.0", + "symfony/property-info": "^7.4|^8.0", + "symfony/serializer": "^7.4|^8.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Mime\\": "" + }, + "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": "Allows manipulating MIME messages", + "homepage": "https://symfony.com", + "keywords": [ + "mime", + "mime-type" + ], + "support": { + "source": "https://github.com/symfony/mime/tree/v8.0.7" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-03-06T13:17:40+00:00" + }, + { + "name": "symfony/polyfill-ctype", + "version": "v1.33.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "a3cc8b044a6ea513310cbd48ef7333b384945638" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/a3cc8b044a6ea513310cbd48ef7333b384945638", + "reference": "a3cc8b044a6ea513310cbd48ef7333b384945638", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "provide": { + "ext-ctype": "*" + }, + "suggest": { + "ext-ctype": "For best performance" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], + "support": { + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.33.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-09-09T11:45:10+00:00" + }, + { + "name": "symfony/polyfill-intl-grapheme", + "version": "v1.33.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-grapheme.git", + "reference": "380872130d3a5dd3ace2f4010d95125fde5d5c70" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/380872130d3a5dd3ace2f4010d95125fde5d5c70", + "reference": "380872130d3a5dd3ace2f4010d95125fde5d5c70", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Intl\\Grapheme\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for intl's grapheme_* functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "grapheme", + "intl", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.33.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2025-06-27T09:58:17+00:00" + }, + { + "name": "symfony/polyfill-intl-idn", + "version": "v1.33.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-idn.git", + "reference": "9614ac4d8061dc257ecc64cba1b140873dce8ad3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/9614ac4d8061dc257ecc64cba1b140873dce8ad3", + "reference": "9614ac4d8061dc257ecc64cba1b140873dce8ad3", + "shasum": "" + }, + "require": { + "php": ">=7.2", + "symfony/polyfill-intl-normalizer": "^1.10" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Intl\\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.33.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-09-10T14:38:51+00:00" + }, + { + "name": "symfony/polyfill-intl-normalizer", + "version": "v1.33.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-normalizer.git", + "reference": "3833d7255cc303546435cb650316bff708a1c75c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/3833d7255cc303546435cb650316bff708a1c75c", + "reference": "3833d7255cc303546435cb650316bff708a1c75c", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Intl\\Normalizer\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for intl's Normalizer class and related functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "intl", + "normalizer", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.33.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-09-09T11:45:10+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.31.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/85181ba99b2345b0ef10ce42ecac37612d9fd341", + "reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "provide": { + "ext-mbstring": "*" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.31.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-09-09T11:45:10+00:00" + }, + { + "name": "symfony/polyfill-php80", + "version": "v1.33.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php80.git", + "reference": "0cc9dd0f17f61d8131e7df6b84bd344899fe2608" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/0cc9dd0f17f61d8131e7df6b84bd344899fe2608", + "reference": "0cc9dd0f17f61d8131e7df6b84bd344899fe2608", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php80\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ion Bazan", + "email": "ion.bazan@gmail.com" + }, + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php80/tree/v1.33.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2025-01-02T08:10:11+00:00" + }, + { + "name": "symfony/polyfill-php84", + "version": "v1.33.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php84.git", + "reference": "d8ced4d875142b6a7426000426b8abc631d6b191" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php84/zipball/d8ced4d875142b6a7426000426b8abc631d6b191", + "reference": "d8ced4d875142b6a7426000426b8abc631d6b191", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php84\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.4+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php84/tree/v1.33.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2025-06-24T13:30:11+00:00" + }, + { + "name": "symfony/polyfill-php85", + "version": "v1.33.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php85.git", + "reference": "d4e5fcd4ab3d998ab16c0db48e6cbb9a01993f91" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php85/zipball/d4e5fcd4ab3d998ab16c0db48e6cbb9a01993f91", + "reference": "d4e5fcd4ab3d998ab16c0db48e6cbb9a01993f91", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php85\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.5+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php85/tree/v1.33.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2025-06-23T16:12:55+00:00" + }, + { + "name": "symfony/polyfill-uuid", + "version": "v1.33.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-uuid.git", + "reference": "21533be36c24be3f4b1669c4725c7d1d2bab4ae2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-uuid/zipball/21533be36c24be3f4b1669c4725c7d1d2bab4ae2", + "reference": "21533be36c24be3f4b1669c4725c7d1d2bab4ae2", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "provide": { + "ext-uuid": "*" + }, + "suggest": { + "ext-uuid": "For best performance" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Uuid\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Grégoire Pineau", + "email": "lyrixx@lyrixx.info" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for uuid functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "uuid" + ], + "support": { + "source": "https://github.com/symfony/polyfill-uuid/tree/v1.33.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-09-09T11:45:10+00:00" + }, + { + "name": "symfony/process", + "version": "v8.0.5", + "source": { + "type": "git", + "url": "https://github.com/symfony/process.git", + "reference": "b5f3aa6762e33fd95efbaa2ec4f4bc9fdd16d674" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/process/zipball/b5f3aa6762e33fd95efbaa2ec4f4bc9fdd16d674", + "reference": "b5f3aa6762e33fd95efbaa2ec4f4bc9fdd16d674", + "shasum": "" + }, + "require": { + "php": ">=8.4" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Process\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Executes commands in sub-processes", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/process/tree/v8.0.5" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-01-26T15:08:38+00:00" + }, + { + "name": "symfony/routing", + "version": "v8.0.6", + "source": { + "type": "git", + "url": "https://github.com/symfony/routing.git", + "reference": "053c40fd46e1d19c5c5a94cada93ce6c3facdd55" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/routing/zipball/053c40fd46e1d19c5c5a94cada93ce6c3facdd55", + "reference": "053c40fd46e1d19c5c5a94cada93ce6c3facdd55", + "shasum": "" + }, + "require": { + "php": ">=8.4", + "symfony/deprecation-contracts": "^2.5|^3" + }, + "require-dev": { + "psr/log": "^1|^2|^3", + "symfony/config": "^7.4|^8.0", + "symfony/dependency-injection": "^7.4|^8.0", + "symfony/expression-language": "^7.4|^8.0", + "symfony/http-foundation": "^7.4|^8.0", + "symfony/yaml": "^7.4|^8.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Routing\\": "" + }, + "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": "Maps an HTTP request to a set of configuration variables", + "homepage": "https://symfony.com", + "keywords": [ + "router", + "routing", + "uri", + "url" + ], + "support": { + "source": "https://github.com/symfony/routing/tree/v8.0.6" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-02-25T16:59:43+00:00" + }, + { + "name": "symfony/service-contracts", + "version": "v3.6.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/service-contracts.git", + "reference": "45112560a3ba2d715666a509a0bc9521d10b6c43" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/45112560a3ba2d715666a509a0bc9521d10b6c43", + "reference": "45112560a3ba2d715666a509a0bc9521d10b6c43", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "psr/container": "^1.1|^2.0", + "symfony/deprecation-contracts": "^2.5|^3" + }, + "conflict": { + "ext-psr": "<1.1|>=2" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, + "branch-alias": { + "dev-main": "3.6-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\Service\\": "" + }, + "exclude-from-classmap": [ + "/Test/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to writing services", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "support": { + "source": "https://github.com/symfony/service-contracts/tree/v3.6.1" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2025-07-15T11:30:57+00:00" + }, + { + "name": "symfony/string", + "version": "v8.0.6", + "source": { + "type": "git", + "url": "https://github.com/symfony/string.git", + "reference": "6c9e1108041b5dce21a9a4984b531c4923aa9ec4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/string/zipball/6c9e1108041b5dce21a9a4984b531c4923aa9ec4", + "reference": "6c9e1108041b5dce21a9a4984b531c4923aa9ec4", + "shasum": "" + }, + "require": { + "php": ">=8.4", + "symfony/polyfill-ctype": "^1.8", + "symfony/polyfill-intl-grapheme": "^1.33", + "symfony/polyfill-intl-normalizer": "^1.0", + "symfony/polyfill-mbstring": "^1.0" + }, + "conflict": { + "symfony/translation-contracts": "<2.5" + }, + "require-dev": { + "symfony/emoji": "^7.4|^8.0", + "symfony/http-client": "^7.4|^8.0", + "symfony/intl": "^7.4|^8.0", + "symfony/translation-contracts": "^2.5|^3.0", + "symfony/var-exporter": "^7.4|^8.0" + }, + "type": "library", + "autoload": { + "files": [ + "Resources/functions.php" + ], + "psr-4": { + "Symfony\\Component\\String\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters in a unified way", + "homepage": "https://symfony.com", + "keywords": [ + "grapheme", + "i18n", + "string", + "unicode", + "utf-8", + "utf8" + ], + "support": { + "source": "https://github.com/symfony/string/tree/v8.0.6" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-02-09T10:14:57+00:00" + }, + { + "name": "symfony/translation", + "version": "v8.0.6", + "source": { + "type": "git", + "url": "https://github.com/symfony/translation.git", + "reference": "13ff19bcf2bea492d3c2fbeaa194dd6f4599ce1b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/translation/zipball/13ff19bcf2bea492d3c2fbeaa194dd6f4599ce1b", + "reference": "13ff19bcf2bea492d3c2fbeaa194dd6f4599ce1b", + "shasum": "" + }, + "require": { + "php": ">=8.4", + "symfony/polyfill-mbstring": "^1.0", + "symfony/translation-contracts": "^3.6.1" + }, + "conflict": { + "nikic/php-parser": "<5.0", + "symfony/http-client-contracts": "<2.5", + "symfony/service-contracts": "<2.5" + }, + "provide": { + "symfony/translation-implementation": "2.3|3.0" + }, + "require-dev": { + "nikic/php-parser": "^5.0", + "psr/log": "^1|^2|^3", + "symfony/config": "^7.4|^8.0", + "symfony/console": "^7.4|^8.0", + "symfony/dependency-injection": "^7.4|^8.0", + "symfony/finder": "^7.4|^8.0", + "symfony/http-client-contracts": "^2.5|^3.0", + "symfony/http-kernel": "^7.4|^8.0", + "symfony/intl": "^7.4|^8.0", + "symfony/polyfill-intl-icu": "^1.21", + "symfony/routing": "^7.4|^8.0", + "symfony/service-contracts": "^2.5|^3", + "symfony/yaml": "^7.4|^8.0" + }, + "type": "library", + "autoload": { + "files": [ + "Resources/functions.php" + ], + "psr-4": { + "Symfony\\Component\\Translation\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides tools to internationalize your application", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/translation/tree/v8.0.6" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-02-17T13:07:04+00:00" + }, + { + "name": "symfony/translation-contracts", + "version": "v3.6.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/translation-contracts.git", + "reference": "65a8bc82080447fae78373aa10f8d13b38338977" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/65a8bc82080447fae78373aa10f8d13b38338977", + "reference": "65a8bc82080447fae78373aa10f8d13b38338977", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, + "branch-alias": { + "dev-main": "3.6-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\Translation\\": "" + }, + "exclude-from-classmap": [ + "/Test/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to translation", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "support": { + "source": "https://github.com/symfony/translation-contracts/tree/v3.6.1" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2025-07-15T13:41:35+00:00" + }, + { + "name": "symfony/uid", + "version": "v8.0.4", + "source": { + "type": "git", + "url": "https://github.com/symfony/uid.git", + "reference": "8b81bd3700f5c1913c22a3266a647aa1bb974435" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/uid/zipball/8b81bd3700f5c1913c22a3266a647aa1bb974435", + "reference": "8b81bd3700f5c1913c22a3266a647aa1bb974435", + "shasum": "" + }, + "require": { + "php": ">=8.4", + "symfony/polyfill-uuid": "^1.15" + }, + "require-dev": { + "symfony/console": "^7.4|^8.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Uid\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Grégoire Pineau", + "email": "lyrixx@lyrixx.info" + }, + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides an object-oriented API to generate and represent UIDs", + "homepage": "https://symfony.com", + "keywords": [ + "UID", + "ulid", + "uuid" + ], + "support": { + "source": "https://github.com/symfony/uid/tree/v8.0.4" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-01-03T23:40:55+00:00" + }, + { + "name": "symfony/var-dumper", + "version": "v8.0.6", + "source": { + "type": "git", + "url": "https://github.com/symfony/var-dumper.git", + "reference": "2e14f7e0bf5ff02c6e63bd31cb8e4855a13d6209" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/2e14f7e0bf5ff02c6e63bd31cb8e4855a13d6209", + "reference": "2e14f7e0bf5ff02c6e63bd31cb8e4855a13d6209", + "shasum": "" + }, + "require": { + "php": ">=8.4", + "symfony/polyfill-mbstring": "^1.0" + }, + "conflict": { + "symfony/console": "<7.4", + "symfony/error-handler": "<7.4" + }, + "require-dev": { + "symfony/console": "^7.4|^8.0", + "symfony/http-kernel": "^7.4|^8.0", + "symfony/process": "^7.4|^8.0", + "symfony/uid": "^7.4|^8.0", + "twig/twig": "^3.12" + }, + "bin": [ + "Resources/bin/var-dump-server" + ], + "type": "library", + "autoload": { + "files": [ + "Resources/functions/dump.php" + ], + "psr-4": { + "Symfony\\Component\\VarDumper\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides mechanisms for walking through any arbitrary PHP variable", + "homepage": "https://symfony.com", + "keywords": [ + "debug", + "dump" + ], + "support": { + "source": "https://github.com/symfony/var-dumper/tree/v8.0.6" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-02-15T10:53:29+00:00" + }, + { + "name": "symfony/var-exporter", + "version": "v8.0.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/var-exporter.git", + "reference": "7345f46c251f2eb27c7b3ebdb5bb076b3ffcae04" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/var-exporter/zipball/7345f46c251f2eb27c7b3ebdb5bb076b3ffcae04", + "reference": "7345f46c251f2eb27c7b3ebdb5bb076b3ffcae04", + "shasum": "" + }, + "require": { + "php": ">=8.4" + }, + "require-dev": { + "symfony/property-access": "^7.4|^8.0", + "symfony/serializer": "^7.4|^8.0", + "symfony/var-dumper": "^7.4|^8.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\VarExporter\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Allows exporting any serializable PHP data structure to plain PHP code", + "homepage": "https://symfony.com", + "keywords": [ + "clone", + "construct", + "export", + "hydrate", + "instantiate", + "lazy-loading", + "proxy", + "serialize" + ], + "support": { + "source": "https://github.com/symfony/var-exporter/tree/v8.0.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2025-11-05T18:53:00+00:00" + }, + { + "name": "tijsverkoyen/css-to-inline-styles", + "version": "v2.4.0", + "source": { + "type": "git", + "url": "https://github.com/tijsverkoyen/CssToInlineStyles.git", + "reference": "f0292ccf0ec75843d65027214426b6b163b48b41" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/tijsverkoyen/CssToInlineStyles/zipball/f0292ccf0ec75843d65027214426b6b163b48b41", + "reference": "f0292ccf0ec75843d65027214426b6b163b48b41", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-libxml": "*", + "php": "^7.4 || ^8.0", + "symfony/css-selector": "^5.4 || ^6.0 || ^7.0 || ^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^2.0", + "phpstan/phpstan-phpunit": "^2.0", + "phpunit/phpunit": "^8.5.21 || ^9.5.10" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.x-dev" + } + }, + "autoload": { + "psr-4": { + "TijsVerkoyen\\CssToInlineStyles\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Tijs Verkoyen", + "email": "css_to_inline_styles@verkoyen.eu", + "role": "Developer" + } + ], + "description": "CssToInlineStyles is a class that enables you to convert HTML-pages/files into HTML-pages/files with inline styles. This is very useful when you're sending emails.", + "homepage": "https://github.com/tijsverkoyen/CssToInlineStyles", + "support": { + "issues": "https://github.com/tijsverkoyen/CssToInlineStyles/issues", + "source": "https://github.com/tijsverkoyen/CssToInlineStyles/tree/v2.4.0" + }, + "time": "2025-12-02T11:56:42+00:00" + }, + { + "name": "vlucas/phpdotenv", + "version": "v5.6.3", + "source": { + "type": "git", + "url": "https://github.com/vlucas/phpdotenv.git", + "reference": "955e7815d677a3eaa7075231212f2110983adecc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/955e7815d677a3eaa7075231212f2110983adecc", + "reference": "955e7815d677a3eaa7075231212f2110983adecc", + "shasum": "" + }, + "require": { + "ext-pcre": "*", + "graham-campbell/result-type": "^1.1.4", + "php": "^7.2.5 || ^8.0", + "phpoption/phpoption": "^1.9.5", + "symfony/polyfill-ctype": "^1.26", + "symfony/polyfill-mbstring": "^1.26", + "symfony/polyfill-php80": "^1.26" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.8.2", + "ext-filter": "*", + "phpunit/phpunit": "^8.5.34 || ^9.6.13 || ^10.4.2" + }, + "suggest": { + "ext-filter": "Required to use the boolean validator." + }, + "type": "library", + "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": false + }, + "branch-alias": { + "dev-master": "5.6-dev" + } + }, + "autoload": { + "psr-4": { + "Dotenv\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Vance Lucas", + "email": "vance@vancelucas.com", + "homepage": "https://github.com/vlucas" + } + ], + "description": "Loads environment variables from `.env` to `getenv()`, `$_ENV` and `$_SERVER` automagically.", + "keywords": [ + "dotenv", + "env", + "environment" + ], + "support": { + "issues": "https://github.com/vlucas/phpdotenv/issues", + "source": "https://github.com/vlucas/phpdotenv/tree/v5.6.3" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/vlucas/phpdotenv", + "type": "tidelift" + } + ], + "time": "2025-12-27T19:49:13+00:00" + }, + { + "name": "voku/portable-ascii", + "version": "2.0.3", + "source": { + "type": "git", + "url": "https://github.com/voku/portable-ascii.git", + "reference": "b1d923f88091c6bf09699efcd7c8a1b1bfd7351d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/voku/portable-ascii/zipball/b1d923f88091c6bf09699efcd7c8a1b1bfd7351d", + "reference": "b1d923f88091c6bf09699efcd7c8a1b1bfd7351d", + "shasum": "" + }, + "require": { + "php": ">=7.0.0" + }, + "require-dev": { + "phpunit/phpunit": "~6.0 || ~7.0 || ~9.0" + }, + "suggest": { + "ext-intl": "Use Intl for transliterator_transliterate() support" + }, + "type": "library", + "autoload": { + "psr-4": { + "voku\\": "src/voku/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Lars Moelleken", + "homepage": "https://www.moelleken.org/" + } + ], + "description": "Portable ASCII library - performance optimized (ascii) string functions for php.", + "homepage": "https://github.com/voku/portable-ascii", + "keywords": [ + "ascii", + "clean", + "php" + ], + "support": { + "issues": "https://github.com/voku/portable-ascii/issues", + "source": "https://github.com/voku/portable-ascii/tree/2.0.3" + }, + "funding": [ + { + "url": "https://www.paypal.me/moelleken", + "type": "custom" + }, + { + "url": "https://github.com/voku", + "type": "github" + }, + { + "url": "https://opencollective.com/portable-ascii", + "type": "open_collective" + }, + { + "url": "https://www.patreon.com/voku", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/voku/portable-ascii", + "type": "tidelift" + } + ], + "time": "2024-11-21T01:49:47+00:00" + } + ], + "packages-dev": [], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": {}, + "prefer-stable": true, + "prefer-lowest": false, + "platform": { + "php": "^8.2" + }, + "platform-dev": {}, + "plugin-api-version": "2.9.0" +} diff --git a/demo/laravel/config/app.php b/demo/laravel/config/app.php new file mode 100644 index 0000000..423eed5 --- /dev/null +++ b/demo/laravel/config/app.php @@ -0,0 +1,126 @@ + env('APP_NAME', 'Laravel'), + + /* + |-------------------------------------------------------------------------- + | Application Environment + |-------------------------------------------------------------------------- + | + | This value determines the "environment" your application is currently + | running in. This may determine how you prefer to configure various + | services the application utilizes. Set this in your ".env" file. + | + */ + + 'env' => env('APP_ENV', 'production'), + + /* + |-------------------------------------------------------------------------- + | Application Debug Mode + |-------------------------------------------------------------------------- + | + | When your application is in debug mode, detailed error messages with + | stack traces will be shown on every error that occurs within your + | application. If disabled, a simple generic error page is shown. + | + */ + + 'debug' => (bool) env('APP_DEBUG', false), + + /* + |-------------------------------------------------------------------------- + | Application URL + |-------------------------------------------------------------------------- + | + | This URL is used by the console to properly generate URLs when using + | the Artisan command line tool. You should set this to the root of + | the application so that it's available within Artisan commands. + | + */ + + 'url' => env('APP_URL', 'http://localhost'), + + /* + |-------------------------------------------------------------------------- + | Application Timezone + |-------------------------------------------------------------------------- + | + | Here you may specify the default timezone for your application, which + | will be used by the PHP date and date-time functions. The timezone + | is set to "UTC" by default as it is suitable for most use cases. + | + */ + + 'timezone' => 'UTC', + + /* + |-------------------------------------------------------------------------- + | Application Locale Configuration + |-------------------------------------------------------------------------- + | + | The application locale determines the default locale that will be used + | by Laravel's translation / localization methods. This option can be + | set to any locale for which you plan to have translation strings. + | + */ + + 'locale' => env('APP_LOCALE', 'en'), + + 'fallback_locale' => env('APP_FALLBACK_LOCALE', 'en'), + + 'faker_locale' => env('APP_FAKER_LOCALE', 'en_US'), + + /* + |-------------------------------------------------------------------------- + | Encryption Key + |-------------------------------------------------------------------------- + | + | This key is utilized by Laravel's encryption services and should be set + | to a random, 32 character string to ensure that all encrypted values + | are secure. You should do this prior to deploying the application. + | + */ + + 'cipher' => 'AES-256-CBC', + + 'key' => env('APP_KEY'), + + 'previous_keys' => [ + ...array_filter( + explode(',', (string) env('APP_PREVIOUS_KEYS', '')) + ), + ], + + /* + |-------------------------------------------------------------------------- + | Maintenance Mode Driver + |-------------------------------------------------------------------------- + | + | These configuration options determine the driver used to determine and + | manage Laravel's "maintenance mode" status. The "cache" driver will + | allow maintenance mode to be controlled across multiple machines. + | + | Supported drivers: "file", "cache" + | + */ + + 'maintenance' => [ + 'driver' => env('APP_MAINTENANCE_DRIVER', 'file'), + 'store' => env('APP_MAINTENANCE_STORE', 'database'), + ], + +]; diff --git a/demo/laravel/config/cache.php b/demo/laravel/config/cache.php new file mode 100644 index 0000000..c68acdf --- /dev/null +++ b/demo/laravel/config/cache.php @@ -0,0 +1,130 @@ + env('CACHE_STORE', 'database'), + + /* + |-------------------------------------------------------------------------- + | Cache Stores + |-------------------------------------------------------------------------- + | + | Here you may define all of the cache "stores" for your application as + | well as their drivers. You may even define multiple stores for the + | same cache driver to group types of items stored in your caches. + | + | Supported drivers: "array", "database", "file", "memcached", + | "redis", "dynamodb", "octane", + | "failover", "null" + | + */ + + 'stores' => [ + + 'array' => [ + 'driver' => 'array', + 'serialize' => false, + ], + + 'database' => [ + 'driver' => 'database', + 'connection' => env('DB_CACHE_CONNECTION'), + 'table' => env('DB_CACHE_TABLE', 'cache'), + 'lock_connection' => env('DB_CACHE_LOCK_CONNECTION'), + 'lock_table' => env('DB_CACHE_LOCK_TABLE'), + ], + + 'file' => [ + 'driver' => 'file', + 'path' => storage_path('framework/cache/data'), + 'lock_path' => storage_path('framework/cache/data'), + ], + + 'memcached' => [ + 'driver' => 'memcached', + 'persistent_id' => env('MEMCACHED_PERSISTENT_ID'), + 'sasl' => [ + env('MEMCACHED_USERNAME'), + env('MEMCACHED_PASSWORD'), + ], + 'options' => [ + // Memcached::OPT_CONNECT_TIMEOUT => 2000, + ], + 'servers' => [ + [ + 'host' => env('MEMCACHED_HOST', '127.0.0.1'), + 'port' => env('MEMCACHED_PORT', 11211), + 'weight' => 100, + ], + ], + ], + + 'redis' => [ + 'driver' => 'redis', + 'connection' => env('REDIS_CACHE_CONNECTION', 'cache'), + 'lock_connection' => env('REDIS_CACHE_LOCK_CONNECTION', 'default'), + ], + + 'dynamodb' => [ + 'driver' => 'dynamodb', + 'key' => env('AWS_ACCESS_KEY_ID'), + 'secret' => env('AWS_SECRET_ACCESS_KEY'), + 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), + 'table' => env('DYNAMODB_CACHE_TABLE', 'cache'), + 'endpoint' => env('DYNAMODB_ENDPOINT'), + ], + + 'octane' => [ + 'driver' => 'octane', + ], + + 'failover' => [ + 'driver' => 'failover', + 'stores' => [ + 'database', + 'array', + ], + ], + + ], + + /* + |-------------------------------------------------------------------------- + | Cache Key Prefix + |-------------------------------------------------------------------------- + | + | When utilizing the APC, database, memcached, Redis, and DynamoDB cache + | stores, there might be other applications using the same cache. For + | that reason, you may prefix every cache key to avoid collisions. + | + */ + + 'prefix' => env('CACHE_PREFIX', Str::slug((string) env('APP_NAME', 'laravel')).'-cache-'), + + /* + |-------------------------------------------------------------------------- + | Serializable Classes + |-------------------------------------------------------------------------- + | + | This value determines the classes that can be unserialized from cache + | storage. By default, no PHP classes will be unserialized from your + | cache to prevent gadget chain attacks if your APP_KEY is leaked. + | + */ + + 'serializable_classes' => false, + +]; diff --git a/demo/laravel/config/convert.php b/demo/laravel/config/convert.php new file mode 100644 index 0000000..2965e87 --- /dev/null +++ b/demo/laravel/config/convert.php @@ -0,0 +1,12 @@ + env('CONVERT_SDK_KEY', '10035569/10034190'), + 'environment' => env('CONVERT_ENVIRONMENT', 'staging'), + 'experience_key' => env('CONVERT_EXPERIENCE_KEY', 'test-experience-ab-fullstack-1'), + 'feature_rollout_key' => env('CONVERT_FEATURE_ROLLOUT_KEY', 'test-experience-ab-fullstack-4'), + 'feature_key_pricing' => env('CONVERT_FEATURE_KEY_PRICING', 'feature-5'), + 'feature_key_stats' => env('CONVERT_FEATURE_KEY_STATS', 'feature-4'), + 'goal_key' => env('CONVERT_GOAL_KEY', 'button-primary-click'), + 'segment_key' => env('CONVERT_SEGMENT_KEY', 'test-segment-1'), +]; diff --git a/demo/laravel/config/filesystems.php b/demo/laravel/config/filesystems.php new file mode 100644 index 0000000..37d8fca --- /dev/null +++ b/demo/laravel/config/filesystems.php @@ -0,0 +1,80 @@ + env('FILESYSTEM_DISK', 'local'), + + /* + |-------------------------------------------------------------------------- + | Filesystem Disks + |-------------------------------------------------------------------------- + | + | Below you may configure as many filesystem disks as necessary, and you + | may even configure multiple disks for the same driver. Examples for + | most supported storage drivers are configured here for reference. + | + | Supported drivers: "local", "ftp", "sftp", "s3" + | + */ + + 'disks' => [ + + 'local' => [ + 'driver' => 'local', + 'root' => storage_path('app/private'), + 'serve' => true, + 'throw' => false, + 'report' => false, + ], + + 'public' => [ + 'driver' => 'local', + 'root' => storage_path('app/public'), + 'url' => rtrim(env('APP_URL', 'http://localhost'), '/').'/storage', + 'visibility' => 'public', + 'throw' => false, + 'report' => false, + ], + + 's3' => [ + 'driver' => 's3', + 'key' => env('AWS_ACCESS_KEY_ID'), + 'secret' => env('AWS_SECRET_ACCESS_KEY'), + 'region' => env('AWS_DEFAULT_REGION'), + 'bucket' => env('AWS_BUCKET'), + 'url' => env('AWS_URL'), + 'endpoint' => env('AWS_ENDPOINT'), + 'use_path_style_endpoint' => env('AWS_USE_PATH_STYLE_ENDPOINT', false), + 'throw' => false, + 'report' => false, + ], + + ], + + /* + |-------------------------------------------------------------------------- + | Symbolic Links + |-------------------------------------------------------------------------- + | + | Here you may configure the symbolic links that will be created when the + | `storage:link` Artisan command is executed. The array keys should be + | the locations of the links and the values should be their targets. + | + */ + + 'links' => [ + public_path('storage') => storage_path('app/public'), + ], + +]; diff --git a/demo/laravel/config/logging.php b/demo/laravel/config/logging.php new file mode 100644 index 0000000..b09cb25 --- /dev/null +++ b/demo/laravel/config/logging.php @@ -0,0 +1,132 @@ + env('LOG_CHANNEL', 'stack'), + + /* + |-------------------------------------------------------------------------- + | Deprecations Log Channel + |-------------------------------------------------------------------------- + | + | This option controls the log channel that should be used to log warnings + | regarding deprecated PHP and library features. This allows you to get + | your application ready for upcoming major versions of dependencies. + | + */ + + 'deprecations' => [ + 'channel' => env('LOG_DEPRECATIONS_CHANNEL', 'null'), + 'trace' => env('LOG_DEPRECATIONS_TRACE', false), + ], + + /* + |-------------------------------------------------------------------------- + | Log Channels + |-------------------------------------------------------------------------- + | + | Here you may configure the log channels for your application. Laravel + | utilizes the Monolog PHP logging library, which includes a variety + | of powerful log handlers and formatters that you're free to use. + | + | Available drivers: "single", "daily", "slack", "syslog", + | "errorlog", "monolog", "custom", "stack" + | + */ + + 'channels' => [ + + 'stack' => [ + 'driver' => 'stack', + 'channels' => explode(',', (string) env('LOG_STACK', 'single')), + 'ignore_exceptions' => false, + ], + + 'single' => [ + 'driver' => 'single', + 'path' => storage_path('logs/laravel.log'), + 'level' => env('LOG_LEVEL', 'debug'), + 'replace_placeholders' => true, + ], + + 'daily' => [ + 'driver' => 'daily', + 'path' => storage_path('logs/laravel.log'), + 'level' => env('LOG_LEVEL', 'debug'), + 'days' => env('LOG_DAILY_DAYS', 14), + 'replace_placeholders' => true, + ], + + 'slack' => [ + 'driver' => 'slack', + 'url' => env('LOG_SLACK_WEBHOOK_URL'), + 'username' => env('LOG_SLACK_USERNAME', env('APP_NAME', 'Laravel')), + 'emoji' => env('LOG_SLACK_EMOJI', ':boom:'), + 'level' => env('LOG_LEVEL', 'critical'), + 'replace_placeholders' => true, + ], + + 'papertrail' => [ + 'driver' => 'monolog', + 'level' => env('LOG_LEVEL', 'debug'), + 'handler' => env('LOG_PAPERTRAIL_HANDLER', SyslogUdpHandler::class), + 'handler_with' => [ + 'host' => env('PAPERTRAIL_URL'), + 'port' => env('PAPERTRAIL_PORT'), + 'connectionString' => 'tls://'.env('PAPERTRAIL_URL').':'.env('PAPERTRAIL_PORT'), + ], + 'processors' => [PsrLogMessageProcessor::class], + ], + + 'stderr' => [ + 'driver' => 'monolog', + 'level' => env('LOG_LEVEL', 'debug'), + 'handler' => StreamHandler::class, + 'handler_with' => [ + 'stream' => 'php://stderr', + ], + 'formatter' => env('LOG_STDERR_FORMATTER'), + 'processors' => [PsrLogMessageProcessor::class], + ], + + 'syslog' => [ + 'driver' => 'syslog', + 'level' => env('LOG_LEVEL', 'debug'), + 'facility' => env('LOG_SYSLOG_FACILITY', LOG_USER), + 'replace_placeholders' => true, + ], + + 'errorlog' => [ + 'driver' => 'errorlog', + 'level' => env('LOG_LEVEL', 'debug'), + 'replace_placeholders' => true, + ], + + 'null' => [ + 'driver' => 'monolog', + 'handler' => NullHandler::class, + ], + + 'emergency' => [ + 'path' => storage_path('logs/laravel.log'), + ], + + ], + +]; diff --git a/demo/laravel/config/session.php b/demo/laravel/config/session.php new file mode 100644 index 0000000..f574482 --- /dev/null +++ b/demo/laravel/config/session.php @@ -0,0 +1,233 @@ + env('SESSION_DRIVER', 'database'), + + /* + |-------------------------------------------------------------------------- + | Session Lifetime + |-------------------------------------------------------------------------- + | + | Here you may specify the number of minutes that you wish the session + | to be allowed to remain idle before it expires. If you want them + | to expire immediately when the browser is closed then you may + | indicate that via the expire_on_close configuration option. + | + */ + + 'lifetime' => (int) env('SESSION_LIFETIME', 120), + + 'expire_on_close' => env('SESSION_EXPIRE_ON_CLOSE', false), + + /* + |-------------------------------------------------------------------------- + | Session Encryption + |-------------------------------------------------------------------------- + | + | This option allows you to easily specify that all of your session data + | should be encrypted before it's stored. All encryption is performed + | automatically by Laravel and you may use the session like normal. + | + */ + + 'encrypt' => env('SESSION_ENCRYPT', false), + + /* + |-------------------------------------------------------------------------- + | Session File Location + |-------------------------------------------------------------------------- + | + | When utilizing the "file" session driver, the session files are placed + | on disk. The default storage location is defined here; however, you + | are free to provide another location where they should be stored. + | + */ + + 'files' => storage_path('framework/sessions'), + + /* + |-------------------------------------------------------------------------- + | Session Database Connection + |-------------------------------------------------------------------------- + | + | When using the "database" or "redis" session drivers, you may specify a + | connection that should be used to manage these sessions. This should + | correspond to a connection in your database configuration options. + | + */ + + 'connection' => env('SESSION_CONNECTION'), + + /* + |-------------------------------------------------------------------------- + | Session Database Table + |-------------------------------------------------------------------------- + | + | When using the "database" session driver, you may specify the table to + | be used to store sessions. Of course, a sensible default is defined + | for you; however, you're welcome to change this to another table. + | + */ + + 'table' => env('SESSION_TABLE', 'sessions'), + + /* + |-------------------------------------------------------------------------- + | Session Cache Store + |-------------------------------------------------------------------------- + | + | When using one of the framework's cache driven session backends, you may + | define the cache store which should be used to store the session data + | between requests. This must match one of your defined cache stores. + | + | Affects: "dynamodb", "memcached", "redis" + | + */ + + 'store' => env('SESSION_STORE'), + + /* + |-------------------------------------------------------------------------- + | Session Sweeping Lottery + |-------------------------------------------------------------------------- + | + | Some session drivers must manually sweep their storage location to get + | rid of old sessions from storage. Here are the chances that it will + | happen on a given request. By default, the odds are 2 out of 100. + | + */ + + 'lottery' => [2, 100], + + /* + |-------------------------------------------------------------------------- + | Session Cookie Name + |-------------------------------------------------------------------------- + | + | Here you may change the name of the session cookie that is created by + | the framework. Typically, you should not need to change this value + | since doing so does not grant a meaningful security improvement. + | + */ + + 'cookie' => env( + 'SESSION_COOKIE', + Str::slug((string) env('APP_NAME', 'laravel')).'-session' + ), + + /* + |-------------------------------------------------------------------------- + | Session Cookie Path + |-------------------------------------------------------------------------- + | + | The session cookie path determines the path for which the cookie will + | be regarded as available. Typically, this will be the root path of + | your application, but you're free to change this when necessary. + | + */ + + 'path' => env('SESSION_PATH', '/'), + + /* + |-------------------------------------------------------------------------- + | Session Cookie Domain + |-------------------------------------------------------------------------- + | + | This value determines the domain and subdomains the session cookie is + | available to. By default, the cookie will be available to the root + | domain without subdomains. Typically, this shouldn't be changed. + | + */ + + 'domain' => env('SESSION_DOMAIN'), + + /* + |-------------------------------------------------------------------------- + | HTTPS Only Cookies + |-------------------------------------------------------------------------- + | + | By setting this option to true, session cookies will only be sent back + | to the server if the browser has a HTTPS connection. This will keep + | the cookie from being sent to you when it can't be done securely. + | + */ + + 'secure' => env('SESSION_SECURE_COOKIE'), + + /* + |-------------------------------------------------------------------------- + | HTTP Access Only + |-------------------------------------------------------------------------- + | + | Setting this value to true will prevent JavaScript from accessing the + | value of the cookie and the cookie will only be accessible through + | the HTTP protocol. It's unlikely you should disable this option. + | + */ + + 'http_only' => env('SESSION_HTTP_ONLY', true), + + /* + |-------------------------------------------------------------------------- + | Same-Site Cookies + |-------------------------------------------------------------------------- + | + | This option determines how your cookies behave when cross-site requests + | take place, and can be used to mitigate CSRF attacks. By default, we + | will set this value to "lax" to permit secure cross-site requests. + | + | See: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie#samesitesamesite-value + | + | Supported: "lax", "strict", "none", null + | + */ + + 'same_site' => env('SESSION_SAME_SITE', 'lax'), + + /* + |-------------------------------------------------------------------------- + | Partitioned Cookies + |-------------------------------------------------------------------------- + | + | Setting this value to true will tie the cookie to the top-level site for + | a cross-site context. Partitioned cookies are accepted by the browser + | when flagged "secure" and the Same-Site attribute is set to "none". + | + */ + + 'partitioned' => env('SESSION_PARTITIONED_COOKIE', false), + + /* + |-------------------------------------------------------------------------- + | Session Serialization + |-------------------------------------------------------------------------- + | + | This value controls the serialization strategy for session data, which + | is JSON by default. Setting this to "php" allows the storage of PHP + | objects in the session but can make an application vulnerable to + | "gadget chain" serialization attacks if the APP_KEY is leaked. + | + | Supported: "json", "php" + | + */ + + 'serialization' => 'json', + +]; diff --git a/demo/laravel/docker-compose.yml b/demo/laravel/docker-compose.yml new file mode 100644 index 0000000..a547a69 --- /dev/null +++ b/demo/laravel/docker-compose.yml @@ -0,0 +1,11 @@ +services: + app: + build: + context: ../.. + dockerfile: demo/laravel/Dockerfile + ports: + - "8080:8080" + environment: + - CONVERT_SDK_KEY=${CONVERT_SDK_KEY:-10035569/10034190} + volumes: + - ./storage:/app/storage diff --git a/demo/laravel/public/.htaccess b/demo/laravel/public/.htaccess new file mode 100644 index 0000000..b574a59 --- /dev/null +++ b/demo/laravel/public/.htaccess @@ -0,0 +1,25 @@ + + + Options -MultiViews -Indexes + + + RewriteEngine On + + # Handle Authorization Header + RewriteCond %{HTTP:Authorization} . + RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] + + # Handle X-XSRF-Token Header + RewriteCond %{HTTP:x-xsrf-token} . + RewriteRule .* - [E=HTTP_X_XSRF_TOKEN:%{HTTP:X-XSRF-Token}] + + # Redirect Trailing Slashes If Not A Folder... + RewriteCond %{REQUEST_FILENAME} !-d + RewriteCond %{REQUEST_URI} (.+)/$ + RewriteRule ^ %1 [L,R=301] + + # Send Requests To Front Controller... + RewriteCond %{REQUEST_FILENAME} !-d + RewriteCond %{REQUEST_FILENAME} !-f + RewriteRule ^ index.php [L] + diff --git a/demo/laravel/public/favicon.ico b/demo/laravel/public/favicon.ico new file mode 100644 index 0000000..e69de29 diff --git a/demo/laravel/public/index.php b/demo/laravel/public/index.php new file mode 100644 index 0000000..ee8f07e --- /dev/null +++ b/demo/laravel/public/index.php @@ -0,0 +1,20 @@ +handleRequest(Request::capture()); diff --git a/demo/laravel/public/robots.txt b/demo/laravel/public/robots.txt new file mode 100644 index 0000000..eb05362 --- /dev/null +++ b/demo/laravel/public/robots.txt @@ -0,0 +1,2 @@ +User-agent: * +Disallow: diff --git a/demo/laravel/resources/views/buy.blade.php b/demo/laravel/resources/views/buy.blade.php new file mode 100644 index 0000000..792ba46 --- /dev/null +++ b/demo/laravel/resources/views/buy.blade.php @@ -0,0 +1,11 @@ +@extends('layout') + +@section('content') +

{{ $title }}

+ +
+ Payment recorded! The conversion has been tracked via the Convert PHP SDK. +
+ + Back to Home +@endsection diff --git a/demo/laravel/resources/views/events.blade.php b/demo/laravel/resources/views/events.blade.php new file mode 100644 index 0000000..81117bd --- /dev/null +++ b/demo/laravel/resources/views/events.blade.php @@ -0,0 +1,40 @@ +@extends('layout') + +@section('content') +

{{ $title }}

+ +
+
+
+
Experience Bucketing
+
+ @if($variation) +

Bucketed variation: {{ $variation->variationKey }}

+ + Experience: {{ $variation->experienceKey }} · + Variation ID: {{ $variation->variationId }} + + @else +

Not bucketed into any variation.

+ @endif +
+
+
+ +
+
+
Feature Rollout
+
+ @if($feature) +

Feature rollout active: {{ $feature->variationKey }}

+ @if($callForActionLabel) + + @endif + @else +

No feature rollout active.

+ @endif +
+
+
+
+@endsection diff --git a/demo/laravel/resources/views/home.blade.php b/demo/laravel/resources/views/home.blade.php new file mode 100644 index 0000000..18ee9ac --- /dev/null +++ b/demo/laravel/resources/views/home.blade.php @@ -0,0 +1,21 @@ +@extends('layout') + +@section('content') +

{{ $title }}

+

by Convert Team

+ +
+
+
Tip
+

+ Visit the Events page to see experience bucketing and feature rollout in action. + The Pricing page demonstrates multiple experiments and conversion tracking. +

+

+ This demo uses the Convert PHP SDK with the same staging project + (10035569/10034190) as the Node.js demo, so both demos + produce comparable bucketing results for the same visitor. +

+
+
+@endsection diff --git a/demo/laravel/resources/views/layout.blade.php b/demo/laravel/resources/views/layout.blade.php new file mode 100644 index 0000000..9935eb9 --- /dev/null +++ b/demo/laravel/resources/views/layout.blade.php @@ -0,0 +1,51 @@ + + + + + + {{ $title ?? 'Convert PHP SDK Demo' }} + + + + + +
+ @yield('content') +
+ + + + + + diff --git a/demo/laravel/resources/views/pricing.blade.php b/demo/laravel/resources/views/pricing.blade.php new file mode 100644 index 0000000..e1e735c --- /dev/null +++ b/demo/laravel/resources/views/pricing.blade.php @@ -0,0 +1,43 @@ +@extends('layout') + +@section('content') +

{{ $title }}

+ + @if($feature) +
Feature Enabled!
+ @endif + +
+
+
List of variations
+ {{ count($variations) }} variation(s) bucketed +
+ @forelse($variations as $variation) +
+
{{ $variation->variationKey }}
+

+ Experience: {{ $variation->experienceKey }} +

+ + Variation ID: {{ $variation->variationId }} · + Experience ID: {{ $variation->experienceId }} + +
+ @empty +
+

No variations bucketed at this location.

+
+ @endforelse +
+ +
+
+
Track Conversion
+
+ @csrf + + +
+
+
+@endsection diff --git a/demo/laravel/resources/views/statistics.blade.php b/demo/laravel/resources/views/statistics.blade.php new file mode 100644 index 0000000..247fe98 --- /dev/null +++ b/demo/laravel/resources/views/statistics.blade.php @@ -0,0 +1,32 @@ +@extends('layout') + +@section('content') +

{{ $title }}

+ + @if($feature) +
Feature Enabled!
+ @endif + +
+
+
List of variations
+ {{ count($variations) }} variation(s) bucketed +
+ @forelse($variations as $variation) +
+
{{ $variation->variationKey }}
+

+ Experience: {{ $variation->experienceKey }} +

+ + Variation ID: {{ $variation->variationId }} · + Experience ID: {{ $variation->experienceId }} + +
+ @empty +
+

No variations bucketed at this location.

+
+ @endforelse +
+@endsection diff --git a/demo/laravel/routes/web.php b/demo/laravel/routes/web.php new file mode 100644 index 0000000..c6ada4d --- /dev/null +++ b/demo/laravel/routes/web.php @@ -0,0 +1,14 @@ +packageDirectories([__DIR__ . '/packages']); +}; diff --git a/package.json b/package.json new file mode 100644 index 0000000..109175e --- /dev/null +++ b/package.json @@ -0,0 +1,17 @@ +{ + "name": "convertcom-php-sdk-release-tooling", + "private": true, + "description": "Release automation tooling for the Convert PHP SDK monorepo", + "scripts": { + "release": "semantic-release" + }, + "devDependencies": { + "@semantic-release/changelog": "^6.0.0", + "@semantic-release/exec": "^7.0.0", + "@semantic-release/git": "^10.0.0", + "@semantic-release/release-notes-generator": "^14.0.0", + "conventional-changelog-conventionalcommits": "^8.0.0", + "conventional-commits-parser": "^6.0.0", + "semantic-release": "^24.0.0" + } +} diff --git a/packages/Api/composer.json b/packages/Api/composer.json new file mode 100644 index 0000000..7864e74 --- /dev/null +++ b/packages/Api/composer.json @@ -0,0 +1,62 @@ +{ + "name": "convertcom/php-sdk-api", + "description": "Convert PHP SDK API package", + "type": "library", + "license": "Apache-2.0", + "version": "1.0.0", + "authors": [ + { + "name": "Convert Insights, Inc" + } + ], + "autoload": { + "psr-4": { + "ConvertSdk\\": "src/", + "ConvertSdk\\Config\\": "../Php-sdk/src/Config/" + } + }, + "repositories": [ + { + "type": "path", + "url": "../Enums" + }, + { + "type": "path", + "url": "../Utils" + }, + { + "type": "path", + "url": "../Event" + }, + { + "type": "path", + "url": "../Logger" + }, + { + "type": "path", + "url": "../Types" + } + ], + "require": { + "php": "^8.2", + "psr/http-client": "^1.0", + "psr/http-factory": "^1.0", + "psr/http-message": "^1.1 || ^2.0", + "php-http/discovery": "^1.19", + "convertcom/php-sdk-enums": ">=1.0.0", + "convertcom/php-sdk-event": ">=1.0.0", + "convertcom/php-sdk-utils": ">=1.0.0", + "convertcom/php-sdk-logger": ">=1.0.0", + "convertcom/php-sdk-types": ">=1.0.0" + }, + "require-dev": { + "phpunit/phpunit": "^11.0", + "php-http/mock-client": "^1.6", + "nyholm/psr7": "^1.8", + "guzzlehttp/guzzle": "^7.3" + }, + "scripts": { + "test": "phpunit", + "build": "php build.php" + } +} diff --git a/packages/Api/phpunit.xml b/packages/Api/phpunit.xml new file mode 100644 index 0000000..4320e6a --- /dev/null +++ b/packages/Api/phpunit.xml @@ -0,0 +1,18 @@ + + + + + ./tests + + + + + src + + + diff --git a/packages/Api/src/ApiManager.php b/packages/Api/src/ApiManager.php new file mode 100644 index 0000000..4f31928 --- /dev/null +++ b/packages/Api/src/ApiManager.php @@ -0,0 +1,523 @@ + 'application/json', + ]; + + /** + * Default batch size for queue processing + */ + private const DEFAULT_BATCH_SIZE = 10; + + /** + * Default configuration endpoint + */ + private const DEFAULT_CONFIG_ENDPOINT = ''; + + /** + * Default tracking endpoint + */ + private const DEFAULT_TRACK_ENDPOINT = ''; + + /** @var VisitorsQueue Queue for tracking visitor requests */ + private VisitorsQueue $requestsQueue; + + /** @var string Configuration endpoint URL */ + private string $configEndpoint; + + /** @var string Tracking endpoint URL */ + private string $trackEndpoint; + + /** @var array Default HTTP headers */ + private array $defaultHeaders = self::DEFAULT_HEADERS; + + /** @var ?ConfigResponseData Configuration response data */ + private ?ConfigResponseData $data = null; + + /** @var bool Whether to enrich data */ + private bool $enrichData; + + /** @var ?string Environment setting */ + private ?string $environment = null; + + /** @var ?LogManagerInterface Logger manager instance */ + private ?LogManagerInterface $loggerManager = null; + + /** @var ?EventManagerInterface Event manager instance */ + private ?EventManagerInterface $eventManager = null; + + /** @var string SDK key */ + private string $sdkKey; + + /** @var string Account ID */ + private string $accountId; + + /** @var string Project ID */ + private string $projectId; + + /** @var array Tracking event data */ + private array $trackingEvent; + + /** @var bool Whether tracking is enabled */ + private bool $trackingEnabled = false; + + /** @var string Source of tracking */ + private string $trackingSource; + + /** @var string Cache level setting */ + private string $cacheLevel; + + /** @var callable Mapper function for data transformation */ + private mixed $mapper; + + /** @var int Batch size for queue processing */ + private int $batchSize; + + /** @var ClientInterface PSR-18 HTTP client */ + private ClientInterface $httpClient; + + /** @var RequestFactoryInterface PSR-17 request factory */ + private RequestFactoryInterface $requestFactory; + + /** @var StreamFactoryInterface PSR-17 stream factory */ + private StreamFactoryInterface $streamFactory; + + /** + * ApiManager constructor. + * + * @param ?Config $config Configuration object + * @param ?EventManagerInterface $eventManager Event manager dependency + * @param ?LogManagerInterface $loggerManager Logger manager dependency + * @param ?ClientInterface $httpClient PSR-18 HTTP client (auto-discovered if null) + * @param ?RequestFactoryInterface $requestFactory PSR-17 request factory (auto-discovered if null) + * @param ?StreamFactoryInterface $streamFactory PSR-17 stream factory (auto-discovered if null) + */ + public function __construct( + ?Config $config = null, + ?EventManagerInterface $eventManager = null, + ?LogManagerInterface $loggerManager = null, + ?ClientInterface $httpClient = null, + ?RequestFactoryInterface $requestFactory = null, + ?StreamFactoryInterface $streamFactory = null, + ) { + $this->loggerManager = $loggerManager; + $this->eventManager = $eventManager; + + $this->configEndpoint = $config && $config->getApi() && isset($config->getApi()['endpoint']['config']) + ? $config->getApi()['endpoint']['config'] + : self::DEFAULT_CONFIG_ENDPOINT; + $this->trackEndpoint = $config && $config->getApi() && isset($config->getApi()['endpoint']['track']) + ? $config->getApi()['endpoint']['track'] + : self::DEFAULT_TRACK_ENDPOINT; + + $this->data = $config ? $config->getData() : null; + $this->enrichData = $config ? ($config->getDataStore() === null) : true; + $this->environment = $config ? $config->getEnvironment() : null; + $this->mapper = function ($value) { return $value; }; + $mapperFromConfig = $config ? $config->getMapper() : null; + if (is_callable($mapperFromConfig)) { + $this->mapper = $mapperFromConfig; + } + $this->batchSize = $config && $config->getEvents() && isset($config->getEvents()['batch_size']) + ? (int)$config->getEvents()['batch_size'] + : self::DEFAULT_BATCH_SIZE; + + $this->accountId = $this->data ? $this->data->getAccountId() : ''; + $project = $this->data ? $this->data->getProject() : null; + $this->projectId = $project ? (is_array($project) ? ($project['id'] ?? '') : ($project->getId() ?? '')) : ''; + $this->sdkKey = $config && $config->getSdkKey() ? $config->getSdkKey() : "{$this->accountId}/{$this->projectId}"; + if ($config && $config->getSdkKeySecret()) { + $this->defaultHeaders['Authorization'] = "Bearer {$config->getSdkKeySecret()}"; + } + $this->trackingEvent = [ + 'enrichData' => $this->enrichData, + 'accountId' => $this->accountId, + 'projectId' => $this->projectId, + 'visitors' => [], + ]; + $this->trackingEnabled = $config && $config->getNetwork() && isset($config->getNetwork()['tracking']) + ? (bool) $config->getNetwork()['tracking'] + : false; + $this->trackingSource = $config && $config->getNetwork() && isset($config->getNetwork()['source']) + ? (string) $config->getNetwork()['source'] + : 'js-sdk'; + $this->cacheLevel = $config && $config->getNetwork() && isset($config->getNetwork()['cacheLevel']) + ? (string) $config->getNetwork()['cacheLevel'] + : ''; + + $this->httpClient = $httpClient ?? Psr18ClientDiscovery::find(); + $this->requestFactory = $requestFactory ?? Psr17FactoryDiscovery::findRequestFactory(); + $this->streamFactory = $streamFactory ?? Psr17FactoryDiscovery::findStreamFactory(); + $this->requestsQueue = new VisitorsQueue(); + } + + /** + * Send request to API server. + * + * @param string $method HTTP method (e.g., 'GET', 'POST') + * @param array $path Path with 'base' and 'route' keys + * @param array $data Request data + * @param array $headers Request headers + * @return array Response array with 'data', 'status', 'statusText', 'headers' keys + */ + public function request( + string $method, + array $path, + array $data = [], + array $headers = [] + ): array { + $url = rtrim($path['base'] ?? '', '/') . '/' . ltrim($path['route'] ?? '', '/'); + $request = $this->requestFactory->createRequest($method, $url); + + $requestHeaders = array_merge($this->defaultHeaders, $headers); + foreach ($requestHeaders as $name => $value) { + $request = $request->withHeader($name, $value); + } + + if (in_array(strtoupper($method), ['POST', 'PUT', 'PATCH'], true) && !empty($data)) { + $body = $this->streamFactory->createStream(json_encode($data, JSON_THROW_ON_ERROR)); + $request = $request->withBody($body); + } + + $response = $this->httpClient->sendRequest($request); + + $rawBody = $response->getBody()->getContents(); + $decoded = json_decode($rawBody, true); + + return [ + 'data' => $decoded, + 'status' => $response->getStatusCode(), + 'statusText' => $response->getReasonPhrase(), + 'headers' => $response->getHeaders(), + ]; + } + + /** + * Add request to queue for sending to server. + * + * @param string $visitorId Visitor ID + * @param VisitorTrackingEvents $eventRequest Event request data + * @param ?VisitorSegments $segments Visitor segments (optional) + * @return void + */ + public function enqueue( + string $visitorId, + VisitorTrackingEvents $eventRequest, + ?VisitorSegments $segments = null + ): void { + if ($this->loggerManager && method_exists($this->loggerManager, 'trace')) { + $this->loggerManager->trace( + 'ApiManager.enqueue()', + LogUtils::toLoggable(call_user_func($this->mapper, ['eventRequest' => $eventRequest])) + ); + } + /** @var array $eventArray */ + $eventArray = json_decode((string) json_encode($eventRequest), true) ?? []; + /** @var array $segmentsArray */ + $segmentsArray = $segments !== null + ? (json_decode((string) json_encode($segments), true) ?? []) + : []; + $this->requestsQueue->push($visitorId, $eventArray, $segmentsArray); + if ($this->trackingEnabled && $this->requestsQueue->length >= $this->getBatchSize()) { + $this->releaseQueue('size'); + } + } + + /** + * Maximum number of retries for tracking POST requests. + */ + private const MAX_RETRIES = 2; + + /** + * Retry delays in microseconds: 100ms after first failure, 300ms after second. + * @var array + */ + private const RETRY_DELAYS_US = [100_000, 300_000]; + + /** + * Send queue to server with retry logic. + * + * Retries up to MAX_RETRIES times on HTTP 5xx or network errors. + * Does NOT retry on HTTP 4xx (client errors). + * Backoff: 100ms after first failure, 300ms after second (formula: 100ms * attempt^2). + * + * @param ?string $reason Reason for releasing the queue (optional) + * @return void + */ + public function releaseQueue(?string $reason = null): void + { + if ($this->requestsQueue->length === 0) { + return; + } + + if ($this->loggerManager && method_exists($this->loggerManager, 'info')) { + $this->loggerManager->info('ApiManager.releaseQueue()', 'Releasing queue'); + } + if ($this->loggerManager && method_exists($this->loggerManager, 'trace')) { + $this->loggerManager->trace('ApiManager.releaseQueue()', ['reason' => $reason ?? '']); + } + + $payload = $this->trackingEvent; + $payload['visitors'] = $this->requestsQueue->getItems(); + $payload['source'] = $this->trackingSource; + + $lastError = null; + $lastStatusCode = null; + + for ($attempt = 0; $attempt <= self::MAX_RETRIES; $attempt++) { + try { + $result = $this->request( + 'POST', + [ + 'base' => str_replace('[project_id]', (string)$this->projectId, $this->trackEndpoint), + 'route' => "/track/{$this->sdkKey}", + ], + call_user_func($this->mapper, $payload) + ); + + $statusCode = $result['status'] ?? 0; + + if ($statusCode >= 200 && $statusCode < 300) { + // Success — clear queue and fire event + $this->requestsQueue->reset(); + if ($this->eventManager && method_exists($this->eventManager, 'fire')) { + $this->eventManager->fire(SystemEvents::ApiQueueReleased, [ + 'reason' => $reason, + 'result' => $result, + 'visitors' => $payload['visitors'], + ]); + } + return; + } + + if ($statusCode >= 400 && $statusCode < 500) { + // Client error — do NOT retry, discard batch + if ($this->loggerManager && method_exists($this->loggerManager, 'warn')) { + $this->loggerManager->warn('ApiManager.releaseQueue()', LogUtils::toLoggable([ + 'error' => "Tracking POST returned client error HTTP {$statusCode}", + 'statusCode' => $statusCode, + 'endpoint' => "/track/{$this->sdkKey}", + 'reason' => $reason, + ])); + } + $this->requestsQueue->reset(); + if ($this->eventManager && method_exists($this->eventManager, 'fire')) { + $this->eventManager->fire( + SystemEvents::ApiQueueReleased, + ['reason' => $reason, 'error' => "HTTP {$statusCode}"], + new \RuntimeException("Tracking POST returned client error HTTP {$statusCode}") + ); + } + return; + } + + // Server error (5xx) — retry if attempts remain + $lastStatusCode = $statusCode; + $lastError = null; + if ($attempt < self::MAX_RETRIES) { + usleep(self::RETRY_DELAYS_US[$attempt]); + } + } catch (ClientExceptionInterface $e) { + // Network error — retry if attempts remain + $lastError = $e; + $lastStatusCode = null; + if ($attempt < self::MAX_RETRIES) { + usleep(self::RETRY_DELAYS_US[$attempt]); + } + } + } + + // All retries exhausted — discard batch and log warning + $logContext = [ + 'endpoint' => "/track/{$this->sdkKey}", + 'reason' => $reason, + 'attempts' => self::MAX_RETRIES + 1, + ]; + if ($lastError !== null) { + $logContext['error'] = $lastError->getMessage(); + } + if ($lastStatusCode !== null) { + $logContext['statusCode'] = $lastStatusCode; + } + if ($this->loggerManager && method_exists($this->loggerManager, 'warn')) { + $this->loggerManager->warn('ApiManager.releaseQueue()', LogUtils::toLoggable($logContext)); + } + + $this->requestsQueue->reset(); + if ($this->eventManager && method_exists($this->eventManager, 'fire')) { + $this->eventManager->fire( + SystemEvents::ApiQueueReleased, + ['reason' => $reason, 'error' => $lastError ? $lastError->getMessage() : "HTTP {$lastStatusCode}"], + $lastError + ); + } + } + + /** + * Enable tracking + */ + public function enableTracking(): void + { + $this->trackingEnabled = true; + $this->releaseQueue('trackingEnabled'); + } + + /** + * Disable tracking + */ + public function disableTracking(): void + { + $this->trackingEnabled = false; + } + + /** + * Set configuration data + * + * @param ConfigResponseData $data Configuration data object + */ + public function setData(ConfigResponseData $data): void + { + $this->data = $data; + $this->accountId = $data->getAccountId() ?? ''; + $project = $data->getProject(); + $this->projectId = $project ? (is_array($project) ? ($project['id'] ?? '') : ($project->getId() ?? '')) : ''; + $this->trackingEvent['accountId'] = $this->accountId; + $this->trackingEvent['projectId'] = $this->projectId; + } + + /** + * Get the batch size for queue processing. + * + * @return int + */ + public function getBatchSize(): int + { + return $this->batchSize; + } + + /** + * Get configuration data + * + * @return ConfigResponseData + */ + public function getConfig(): ConfigResponseData + { + if ($this->loggerManager && method_exists($this->loggerManager, 'trace')) { + $this->loggerManager->trace('ApiManager.getConfig()'); + } + + $query = ''; + if ($this->cacheLevel === 'low' || $this->environment) { + $query = '?'; + } + if ($this->environment) { + $query .= 'environment=' . urlencode($this->environment); + } + if ($this->cacheLevel === 'low') { + if ($query !== '?') { + $query .= '&'; + } + $query .= '_conv_low_cache=1'; + } + + try { + $response = $this->request( + 'GET', + [ + 'base' => $this->configEndpoint, + 'route' => "/config/{$this->sdkKey}{$query}", + ] + ); + + $statusCode = $response['status'] ?? 0; + if ($statusCode < 200 || $statusCode >= 300) { + $url = $this->configEndpoint . "/config/{$this->sdkKey}"; + if ($this->loggerManager) { + $this->loggerManager->error('ApiManager.getConfig()', [ + 'endpoint' => $url . $query, + 'status' => 'error', + 'httpStatus' => $statusCode, + 'error' => "HTTP {$statusCode}", + ]); + } + throw new \RuntimeException( + "Config fetch failed: HTTP {$statusCode} from {$url}", + $statusCode + ); + } + + $data = $response['data'] ?? []; + $configData = new ConfigResponseData($data); + // Preserve error field if present — ConfigResponseData constructor drops unknown keys + if (isset($data['error'])) { + $configData['error'] = $data['error']; + } + + if ($this->loggerManager) { + $project = $configData->getProject(); + $this->loggerManager->debug('ApiManager.getConfig()', [ + 'endpoint' => $this->configEndpoint . "/config/{$this->sdkKey}" . $query, + 'status' => 'success', + 'httpStatus' => $statusCode, + 'accountId' => $configData->getAccountId() ?? 'unknown', + 'projectId' => $project ? (is_array($project) ? ($project['id'] ?? '') : $project->getId()) : 'unknown', + 'fetchedAt' => date('c'), + ]); + } + + return $configData; + } catch (ClientExceptionInterface $e) { + if ($this->loggerManager) { + $this->loggerManager->error('ApiManager.getConfig()', [ + 'endpoint' => $this->configEndpoint . "/config/{$this->sdkKey}" . $query, + 'status' => 'error', + 'error' => $e->getMessage(), + 'code' => method_exists($e, 'getCode') ? $e->getCode() : null, + ]); + } + + throw new \RuntimeException( + "Failed to fetch config from {$this->configEndpoint}/config/{$this->sdkKey}: HTTP error - {$e->getMessage()}", + (int)$e->getCode(), + $e + ); + } + } +} diff --git a/packages/Api/src/Interfaces/ApiManagerInterface.php b/packages/Api/src/Interfaces/ApiManagerInterface.php new file mode 100644 index 0000000..27dbe2f --- /dev/null +++ b/packages/Api/src/Interfaces/ApiManagerInterface.php @@ -0,0 +1,82 @@ +eventManagerMock = $this->createMock(EventManagerInterface::class); + $this->loggerManagerMock = $this->createMock(LogManagerInterface::class); + $this->mockHttpClient = new MockHttpClient(); + $this->psr17Factory = new Psr17Factory(); + + // Load and prepare test configuration + $testConfig = json_decode(file_get_contents(__DIR__ . '/test-config.json'), true); + $defaultConfig = DefaultConfig::getDefault(); + $mergedConfig = ObjectUtils::objectDeepMerge($testConfig, $defaultConfig); + $overrides = [ + 'api' => [ + 'endpoint' => [ + 'config' => self::HOST . ':' . self::PORT, + 'track' => self::HOST . ':' . self::PORT, + ], + ], + 'events' => [ + 'batch_size' => self::BATCH_SIZE, + ], + 'mapper' => null, // Ensure no invalid mapper value + ]; + $finalConfig = ObjectUtils::objectDeepMerge($mergedConfig, $overrides); + if (isset($finalConfig['sdkKey'])) { + unset($finalConfig['sdkKey']); + } + $finalConfig['data'] = new ConfigResponseData($finalConfig['data']); + $this->config = new Config($finalConfig); + + // Instantiate ApiManager with mock PSR-18 client + $this->apiManager = new ApiManager( + $this->config, + $this->eventManagerMock, + $this->loggerManagerMock, + $this->mockHttpClient, + $this->psr17Factory, + $this->psr17Factory + ); + } + + /** + * Test that ApiManager class is defined. + */ + public function testApiManagerIsDefined(): void + { + $this->assertTrue(class_exists(ApiManager::class)); + } + + /** + * Test that ApiManager can be instantiated with default config. + */ + public function testApiManagerInstantiationWithDefaultConfig(): void + { + $apiManager = new ApiManager( + null, + null, + null, + $this->mockHttpClient, + $this->psr17Factory, + $this->psr17Factory + ); + $this->assertInstanceOf(ApiManager::class, $apiManager); + } + + /** + * Test that ApiManager can be instantiated with provided config and EventManager. + */ + public function testApiManagerInstantiationWithConfigAndEventManager(): void + { + $this->assertInstanceOf(ApiManager::class, $this->apiManager); + } + + /** + * Test sending a JSON payload via ApiManager request method. + */ + public function testRequestSending(): void + { + $testPayload = [ + 'foo' => 'bar', + 'some' => ['test' => ['data' => 'value']], + ]; + + // Add mock response + $this->mockHttpClient->addResponse( + new Response(200, ['Content-Type' => 'application/json'], '{}') + ); + + $result = $this->apiManager->request( + 'POST', + ['base' => self::HOST . ':' . self::PORT, 'route' => '/test'], + $testPayload + ); + + $this->assertIsArray($result); + $this->assertEquals(200, $result['status']); + + // Verify the request that was sent + $sentRequest = $this->mockHttpClient->getLastRequest(); + $this->assertEquals('POST', $sentRequest->getMethod()); + $this->assertStringContainsString('/test', (string)$sentRequest->getUri()); + $this->assertEquals('application/json', $sentRequest->getHeaderLine('Content-Type')); + + $sentBody = json_decode($sentRequest->getBody()->getContents(), true); + $this->assertEquals($testPayload, $sentBody); + } + + /** + * Test that batch_size enqueued requests are released immediately due to size limit. + */ + public function testEnqueueAndReleaseOnBatchSize(): void + { + $requestData = new VisitorTrackingEvents([ + 'eventType' => 'bucketing', + 'data' => ['experienceId' => '11', 'variationId' => '12'], + ]); + + // Add mock response for the release request + $this->mockHttpClient->addResponse( + new Response(200, ['Content-Type' => 'application/json'], '{}') + ); + + for ($i = 1; $i <= self::BATCH_SIZE; $i++) { + $this->apiManager->enqueue("VID$i", $requestData); + } + + // Verify a request was sent (queue was released) + $sentRequest = $this->mockHttpClient->getLastRequest(); + $this->assertNotNull($sentRequest); + $this->assertEquals('POST', $sentRequest->getMethod()); + $this->assertStringContainsString('/track/', (string)$sentRequest->getUri()); + } + + /** + * Test that an event is fired when queue is released due to batch size. + */ + public function testEventFiringOnReleaseDueToSize(): void + { + + $requestData = new VisitorTrackingEvents([ + 'eventType' => 'bucketing', + 'data' => ['experienceId' => '11', 'variationId' => '12'], + ]); + + // Add mock response + $this->mockHttpClient->addResponse( + new Response(200, ['Content-Type' => 'application/json'], '{"data": "ok"}') + ); + + // Expect event to be fired + $this->eventManagerMock->expects($this->once()) + ->method('fire') + ->with( + SystemEvents::ApiQueueReleased, + $this->callback(function ($args) { + return $args['reason'] === 'size' && + isset($args['result']) && + is_array($args['result']) && + isset($args['visitors']) && + count($args['visitors']) === self::BATCH_SIZE; + }) + ); + + // Populate queue via reflection (bypasses enqueue auto-release) + $this->populateQueue(self::BATCH_SIZE); + + // Explicitly release the queue + $this->apiManager->releaseQueue('size'); + } + + /** + * Test that an event is fired when queue is released with network error after all retries. + */ + public function testEventFiringOnReleaseWithError(): void + { + + $requestData = new VisitorTrackingEvents([ + 'eventType' => 'bucketing', + 'data' => ['experienceId' => '11', 'variationId' => '12'], + ]); + + // Configure mock client to throw exceptions for all 3 attempts (initial + 2 retries) + for ($i = 0; $i < 3; $i++) { + $this->mockHttpClient->addException( + new \Http\Client\Exception\NetworkException('Server error', $this->psr17Factory->createRequest('POST', 'http://localhost')) + ); + } + + // Expect event to be fired with error after all retries exhausted + $this->eventManagerMock->expects($this->once()) + ->method('fire') + ->with( + SystemEvents::ApiQueueReleased, + $this->callback(function ($args) { + return $args['reason'] === 'size'; + }), + $this->callback(function ($err) { + return $err instanceof \Exception && $err->getMessage() === 'Server error'; + }) + ); + + // Populate queue via reflection (bypasses enqueue auto-release) + $this->populateQueue(self::BATCH_SIZE); + + // Explicitly release the queue + $this->apiManager->releaseQueue('size'); + } + + /** + * Populate the ApiManager's internal queue via reflection to isolate + * queue state from enqueue() side effects (auto-release, tracking). + */ + private function populateQueue(int $count = 1): void + { + $reflection = new \ReflectionClass($this->apiManager); + $queueProperty = $reflection->getProperty('requestsQueue'); + + $queue = $queueProperty->getValue($this->apiManager); + for ($i = 1; $i <= $count; $i++) { + $queue->push( + "VID$i", + ['eventType' => 'bucketing', 'data' => ['experienceId' => '11', 'variationId' => '12']], + [] + ); + } + } + + /** + * Test retry on HTTP 503: verify 2 retries then discard (AC #4). + */ + public function testRetryOnHttp503ThenDiscard(): void + { + $this->populateQueue(self::BATCH_SIZE); + + // Queue 3 x 503 responses (initial + 2 retries) + for ($i = 0; $i < 3; $i++) { + $this->mockHttpClient->addResponse( + new Response(503, ['Content-Type' => 'application/json'], '{"error": "service unavailable"}') + ); + } + + // Expect warning logged after retries exhausted + $this->loggerManagerMock->expects($this->atLeastOnce()) + ->method('warn') + ->with( + $this->equalTo('ApiManager.releaseQueue()'), + $this->callback(function (array $data): bool { + return isset($data['statusCode']) && $data['statusCode'] === 503 + && isset($data['attempts']) && $data['attempts'] === 3; + }) + ); + + // Expect event fired with error info + $this->eventManagerMock->expects($this->once()) + ->method('fire') + ->with( + SystemEvents::ApiQueueReleased, + $this->callback(function ($args) { + return isset($args['error']) && str_contains($args['error'], '503'); + }), + $this->anything() + ); + + $this->apiManager->releaseQueue('test'); + } + + /** + * Test no retry on HTTP 400: verify immediate discard and warning log (AC #5). + */ + public function testNoRetryOnHttp400(): void + { + $this->populateQueue(self::BATCH_SIZE); + + // Queue only 1 response — should NOT retry + $this->mockHttpClient->addResponse( + new Response(400, ['Content-Type' => 'application/json'], '{"error": "bad request"}') + ); + + // Expect warning logged immediately (no retry) + $this->loggerManagerMock->expects($this->atLeastOnce()) + ->method('warn') + ->with( + $this->equalTo('ApiManager.releaseQueue()'), + $this->callback(function (array $data): bool { + return isset($data['statusCode']) && $data['statusCode'] === 400; + }) + ); + + // Expect event fired with error + $this->eventManagerMock->expects($this->once()) + ->method('fire') + ->with( + SystemEvents::ApiQueueReleased, + $this->callback(function ($args) { + return isset($args['error']) && str_contains($args['error'], '400'); + }), + $this->callback(function ($err) { + return $err instanceof \RuntimeException; + }) + ); + + $this->apiManager->releaseQueue('test'); + + // Verify exactly 1 HTTP request was made (no retries) + $this->assertCount(1, $this->mockHttpClient->getRequests()); + } + + /** + * Test retry on network exception (ClientExceptionInterface) (AC #4). + */ + public function testRetryOnNetworkException(): void + { + $this->populateQueue(self::BATCH_SIZE); + + // Queue 3 network exceptions for all attempts + for ($i = 0; $i < 3; $i++) { + $this->mockHttpClient->addException( + new \Http\Client\Exception\NetworkException( + 'Connection refused', + $this->psr17Factory->createRequest('POST', 'http://localhost') + ) + ); + } + + // Expect warning after all retries + $this->loggerManagerMock->expects($this->atLeastOnce()) + ->method('warn') + ->with( + $this->equalTo('ApiManager.releaseQueue()'), + $this->callback(function (array $data): bool { + return isset($data['error']) && str_contains($data['error'], 'Connection refused') + && isset($data['attempts']) && $data['attempts'] === 3; + }) + ); + + $this->apiManager->releaseQueue('test'); + } + + /** + * Test successful POST after first retry (AC #4). + */ + public function testSuccessAfterFirstRetry(): void + { + $this->populateQueue(self::BATCH_SIZE); + + // First attempt: 503, second attempt: 200 + $this->mockHttpClient->addResponse( + new Response(503, ['Content-Type' => 'application/json'], '{"error": "unavailable"}') + ); + $this->mockHttpClient->addResponse( + new Response(200, ['Content-Type' => 'application/json'], '{"data": "ok"}') + ); + + // Expect success event (no error) + $this->eventManagerMock->expects($this->once()) + ->method('fire') + ->with( + SystemEvents::ApiQueueReleased, + $this->callback(function ($args) { + return $args['reason'] === 'test' + && isset($args['result']) + && isset($args['visitors']); + }) + ); + + $this->apiManager->releaseQueue('test'); + } + + /** + * Test payload structure matches expected JSON shape (AC #3, #9). + */ + public function testPayloadStructure(): void + { + $this->populateQueue(self::BATCH_SIZE); + + $this->mockHttpClient->addResponse( + new Response(200, ['Content-Type' => 'application/json'], '{}') + ); + + $this->apiManager->releaseQueue('test'); + + $sentRequest = $this->mockHttpClient->getLastRequest(); + $body = json_decode($sentRequest->getBody()->getContents(), true); + + $this->assertArrayHasKey('accountId', $body); + $this->assertArrayHasKey('projectId', $body); + $this->assertArrayHasKey('enrichData', $body); + $this->assertArrayHasKey('source', $body); + $this->assertArrayHasKey('visitors', $body); + $this->assertIsArray($body['visitors']); + } + + /** + * Test enrichData is true when no DataStoreManager configured (AC #9). + */ + public function testEnrichDataTrueWithoutDataStore(): void + { + $this->populateQueue(1); + + $this->mockHttpClient->addResponse( + new Response(200, ['Content-Type' => 'application/json'], '{}') + ); + + $this->apiManager->releaseQueue('test'); + + $sentRequest = $this->mockHttpClient->getLastRequest(); + $body = json_decode($sentRequest->getBody()->getContents(), true); + + $this->assertTrue($body['enrichData']); + } + + /** + * Test source is set correctly in payload (AC #9). + */ + public function testSourceInPayload(): void + { + $this->populateQueue(1); + + $this->mockHttpClient->addResponse( + new Response(200, ['Content-Type' => 'application/json'], '{}') + ); + + $this->apiManager->releaseQueue('test'); + + $sentRequest = $this->mockHttpClient->getLastRequest(); + $body = json_decode($sentRequest->getBody()->getContents(), true); + + // Source comes from config network.source; test config doesn't set it explicitly, + // so ApiManager constructor defaults to 'js-sdk'. In production, ConvertSDK::create() + // sets 'php-sdk'. This test validates the field exists and has a string value. + $this->assertIsString($body['source']); + $this->assertNotEmpty($body['source']); + } + + /** + * Test that getConfig() returns ConfigResponseData on success (AC #8). + */ + public function testGetConfigReturnsConfigResponseData(): void + { + $configPayload = [ + 'data' => [ + 'account_id' => '999', + 'project' => ['id' => '888', 'key' => 'test-project'], + 'experiences' => [], + 'features' => [], + 'segments' => [], + 'audiences' => [], + 'goals' => [], + 'locations' => [], + ], + ]; + + $this->mockHttpClient->addResponse( + new Response(200, ['Content-Type' => 'application/json'], json_encode($configPayload)) + ); + + $result = $this->apiManager->getConfig(); + + $this->assertInstanceOf(ConfigResponseData::class, $result); + } + + /** + * Test that getConfig() throws RuntimeException on HTTP error (AC #8). + */ + public function testGetConfigThrowsOnHttpError(): void + { + $this->expectException(\RuntimeException::class); + $this->expectExceptionMessageMatches('/Failed to fetch config/'); + + $this->mockHttpClient->addException( + new \Http\Client\Exception\NetworkException( + 'Connection refused', + $this->psr17Factory->createRequest('GET', 'http://localhost') + ) + ); + + $this->apiManager->getConfig(); + } + + /** + * Test that request() propagates PSR-18 exceptions to callers. + */ + public function testRequestPropagatesPsr18Exceptions(): void + { + $this->expectException(\Psr\Http\Client\ClientExceptionInterface::class); + + $this->mockHttpClient->addException( + new \Http\Client\Exception\NetworkException( + 'Connection timeout', + $this->psr17Factory->createRequest('GET', 'http://localhost') + ) + ); + + $this->apiManager->request('GET', ['base' => 'http://localhost', 'route' => '/test']); + } + + /** + * Test that request() returns synchronous array (not PromiseInterface) (AC #8). + */ + public function testRequestReturnsSynchronousArray(): void + { + $this->mockHttpClient->addResponse( + new Response(200, ['Content-Type' => 'application/json'], '{"key": "value"}') + ); + + $result = $this->apiManager->request('GET', ['base' => 'http://localhost', 'route' => '/test']); + + $this->assertIsArray($result); + $this->assertArrayHasKey('data', $result); + $this->assertArrayHasKey('status', $result); + $this->assertArrayHasKey('statusText', $result); + $this->assertArrayHasKey('headers', $result); + $this->assertEquals(200, $result['status']); + $this->assertEquals(['key' => 'value'], $result['data']); + } + + /** + * Test that getConfig() calls debug() on logger after successful fetch (AC #2). + */ + public function testGetConfigLogsDebugOnSuccess(): void + { + $configPayload = [ + 'data' => [ + 'account_id' => '999', + 'project' => ['id' => '888', 'key' => 'test-project'], + 'experiences' => [], + 'features' => [], + 'segments' => [], + 'audiences' => [], + 'goals' => [], + 'locations' => [], + ], + ]; + + $this->mockHttpClient->addResponse( + new Response(200, ['Content-Type' => 'application/json'], json_encode($configPayload)) + ); + + $this->loggerManagerMock->expects($this->atLeastOnce()) + ->method('debug') + ->with( + $this->equalTo('ApiManager.getConfig()'), + $this->callback(function (array $data): bool { + return isset($data['endpoint']) && + $data['status'] === 'success' && + array_key_exists('accountId', $data) && + array_key_exists('projectId', $data); + }) + ); + + $this->apiManager->getConfig(); + } + + /** + * Test that getConfig() calls error() on logger when fetch fails (AC #6). + */ + public function testGetConfigLogsErrorOnFailure(): void + { + $this->mockHttpClient->addException( + new \Http\Client\Exception\NetworkException( + 'Connection refused', + $this->psr17Factory->createRequest('GET', 'http://localhost') + ) + ); + + $this->loggerManagerMock->expects($this->atLeastOnce()) + ->method('error') + ->with( + $this->equalTo('ApiManager.getConfig()'), + $this->callback(function (array $data): bool { + return isset($data['endpoint']) && + $data['status'] === 'error' && + isset($data['error']); + }) + ); + + $this->expectException(\RuntimeException::class); + $this->apiManager->getConfig(); + } + + /** + * Test that getConfig() logs error on non-2xx HTTP status (AC #6). + */ + public function testGetConfigLogsErrorOnBadStatus(): void + { + $this->mockHttpClient->addResponse( + new Response(500, ['Content-Type' => 'application/json'], '{"error": "internal"}') + ); + + $this->loggerManagerMock->expects($this->atLeastOnce()) + ->method('error') + ->with( + $this->equalTo('ApiManager.getConfig()'), + $this->callback(function (array $data): bool { + return isset($data['endpoint']) && + $data['status'] === 'error' && + $data['httpStatus'] === 500; + }) + ); + + $this->expectException(\RuntimeException::class); + $this->apiManager->getConfig(); + } +} diff --git a/packages/Api/tests/test-config.json b/packages/Api/tests/test-config.json new file mode 100644 index 0000000..542987e --- /dev/null +++ b/packages/Api/tests/test-config.json @@ -0,0 +1,555 @@ +{ + "environment": "staging", + "data": { + "account_id": "10022898", + "audiences": [ + { + "id": "100299433", + "name": "Adv Audience", + "type": "transient", + "status": "active", + "key": "adv-audience", + "preset": false, + "rules": { + "OR": [ + { + "AND": [ + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "matches", + "negated": false + }, + "value": "value1", + "key": "varName1" + } + ] + }, + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "matches", + "negated": false + }, + "value": "value2", + "key": "varName2" + } + ] + } + ] + }, + { + "AND": [ + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "matches", + "negated": false + }, + "value": "something", + "key": "varName3" + } + ] + } + ] + } + ] + } + } + ], + "segments": [ + { + "id": "200299434", + "name": "Test Segments", + "status": "active", + "key": "test-segments-1", + "preset": false, + "rules": { + "OR": [ + { + "AND": [ + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "matches", + "negated": false + }, + "key": "enabled", + "value": true + } + ] + } + ] + } + ] + } + } + ], + "experiences": [ + { + "id": "100218245", + "name": "Test Experience AB Fullstack", + "key": "test-experience-ab-fullstack-2", + "type": "a/b_fullstack", + "version": 6, + "status": "active", + "global_js": "var s = 'test_experience'; console.log(s);", + "global_css": ".test-style { display: initial; }", + "url": "https://convert.com", + "integrations": [], + "environments": ["live", "staging"], + "site_area": { + "OR": [ + { + "AND": [ + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "matches", + "negated": false + }, + "key": "url", + "value": "https://convert.com/" + } + ] + } + ] + } + ] + }, + "audiences": ["100299433"], + "goals": ["100215959", "100215960", "100215961"], + "variations": [ + { + "id": "100299456", + "name": "Original Page", + "status": "running", + "is_baseline": true, + "changes": [ + { + "id": "100240519", + "type": "fullStackFeature", + "data": { + "feature_id": "10024", + "variables_data": { + "enabled": "true", + "caption": "Click that" + } + } + }, + { + "id": "100240521", + "type": "fullStackFeature", + "data": { + "feature_id": "10025", + "variables_data": { + "price": 100, + "button-height": 40, + "additionalData": "{\"foo\":\"bar\",\"v\":2}" + } + } + } + ], + "key": "100299456-original-page", + "traffic_allocation": 50.0 + }, + { + "id": "100299457", + "name": "Variation 1", + "status": "running", + "is_baseline": false, + "changes": [ + { + "id": "100240520", + "type": "fullStackFeature", + "data": { + "feature_id": "10024", + "variables_data": { + "enabled": "false", + "caption": "Not allowed" + } + } + } + ], + "key": "100299457-variation-1", + "traffic_allocation": 50.0 + } + ] + }, + { + "id": "100218246", + "name": "Test Experience AB Fullstack", + "key": "test-experience-ab-fullstack-3", + "type": "a/b_fullstack", + "version": 6, + "status": "active", + "global_js": "var s = 'test_experience'; console.log(s);", + "global_css": ".test-style { display: initial; }", + "url": "https://convert.com", + "integrations": [], + "environments": ["live", "staging"], + "site_area": { + "OR": [ + { + "AND": [ + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "matches", + "negated": false + }, + "key": "url", + "value": "https://convert.com/" + } + ] + } + ] + } + ] + }, + "audiences": ["100299433"], + "goals": ["100215959", "100215960", "100215961"], + "variations": [ + { + "id": "100299460", + "name": "Original Page", + "status": "running", + "is_baseline": true, + "changes": [ + { + "id": "100240529", + "type": "fullStackFeature", + "data": { + "feature_id": "10024", + "variables_data": { + "enabled": "true", + "caption": "Click that" + } + } + } + ], + "key": "100299460-original-page", + "traffic_allocation": 50.0 + }, + { + "id": "100299461", + "name": "Variation 1", + "status": "running", + "is_baseline": false, + "changes": [ + { + "id": "100240532", + "type": "fullStackFeature", + "data": { + "feature_id": "10024", + "variables_data": { + "enabled": "true", + "caption": "Allowed" + } + } + } + ], + "key": "100299461-variation-1", + "traffic_allocation": 50.0 + } + ] + }, + { + "id": "100218247", + "name": "Test Experience AB Fullstack", + "key": "test-experience-ab-fullstack-4", + "type": "a/b_fullstack", + "version": 6, + "status": "active", + "global_js": "var s = 'test_experience'; console.log(s);", + "global_css": ".test-style { display: initial; }", + "url": "https://convert.com", + "integrations": [], + "environments": ["live", "staging"], + "site_area": { + "OR": [ + { + "AND": [ + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "matches", + "negated": false + }, + "key": "url", + "value": "https://convert.com/" + } + ] + } + ] + } + ] + }, + "audiences": ["100299433"], + "goals": ["100215959", "100215960", "100215961"], + "variations": [{}] + } + ], + "features": [ + { + "id": "10024", + "name": "Feature 1", + "key": "feature-1", + "variables": [ + { + "key": "enabled", + "type": "boolean" + }, + { + "key": "caption", + "type": "string" + } + ] + }, + { + "id": "10025", + "name": "Feature 2", + "key": "feature-2", + "variables": [ + { + "key": "price", + "type": "float" + }, + { + "key": "button-height", + "type": "integer" + }, + { + "key": "additionalData", + "type": "json" + } + ] + }, + { + "id": "10026", + "name": "Not Attached Feature 3", + "key": "not-attached-feature-3", + "variables": [ + { + "key": "fee", + "type": "float" + }, + { + "key": "link", + "type": "string" + }, + { + "key": "additionalData", + "type": "json" + } + ] + } + ], + "goals": [ + { + "id": "100215960", + "name": "Increase Engagement", + "selected_default": true, + "status": "active", + "type": "dom_interaction", + "is_system": true, + "key": "increase-engagement", + "settings": { + "tracked_items": [ + { + "event": "click", + "selector": "a" + }, + { + "event": "submit", + "selector": "form" + } + ] + }, + "rules": { + "OR": [ + { + "AND": [ + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "matches", + "negated": false + }, + "key": "action", + "value": "buy" + }, + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "matches", + "negated": false + }, + "key": "action", + "value": "signup" + } + ] + } + ] + } + ] + } + }, + { + "id": "100215959", + "name": "Decrease BounceRate", + "selected_default": true, + "status": "active", + "type": "advanced", + "is_system": true, + "key": "decrease-bounce-rate", + "rules": { + "OR": [ + { + "AND": [ + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "lessEqual", + "negated": true + }, + "value": 1, + "key": "pages_visited_count" + }, + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "lessEqual", + "negated": true + }, + "value": 10, + "key": "visit_duration" + } + ] + } + ] + } + ] + } + }, + { + "id": "100215961", + "name": "adv goal country browser", + "selected_default": false, + "status": "active", + "type": "advanced", + "is_system": false, + "key": "adv-goal-country-browser", + "rules": { + "OR": [ + { + "AND": [ + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "equals", + "negated": false + }, + "value": "US", + "key": "country" + } + ] + }, + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "equals", + "negated": false + }, + "value": "chrome", + "key": "browser_name" + } + ] + } + ] + }, + { + "AND": [ + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "equals", + "negated": false + }, + "value": "GB", + "key": "country" + } + ] + }, + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "equals", + "negated": false + }, + "value": "safari", + "key": "browser_name" + } + ] + } + ] + } + ] + } + }, + { + "id": "100215962", + "key": "goal-without-rule" + } + ], + "project": { + "id": "10025986", + "name": "Test Project", + "type": "fullstack", + "utc_offset": 0, + "domains": [ + { + "id": "10029181", + "hosts": "https://convert.com/", + "tld": false + } + ], + "settings": { + "auto_link": false, + "data_anonymization": false, + "do_not_track": "OFF", + "include_jquery": false + }, + "environments": { + "live": "Live", + "staging": "Staging" + } + } + } +} diff --git a/packages/Bucketing/composer.json b/packages/Bucketing/composer.json new file mode 100644 index 0000000..f7ecae1 --- /dev/null +++ b/packages/Bucketing/composer.json @@ -0,0 +1,59 @@ +{ + "name": "convertcom/php-sdk-bucketing", + "description": "PHP SDK for Convert Bucketing", + "type": "library", + "license": "Apache-2.0", + "authors": [ + { + "name": "Convert Insights, Inc" + } + ], + "autoload": { + "psr-4": { + "ConvertSdk\\": "src/" + } + }, + "repositories": [ + { + "type": "path", + "url": "../Api" + }, + { + "type": "path", + "url": "../Enums" + }, + { + "type": "path", + "url": "../Logger" + }, + { + "type": "path", + "url": "../Utils" + }, + { + "type": "path", + "url": "../Event" + }, + { + "type": "path", + "url": "../Types" + } + ], + "require": { + "php": "^8.2", + "convertcom/php-sdk-api": ">=1.0.0", + "convertcom/php-sdk-enums": ">=1.0.0", + "convertcom/php-sdk-logger": ">=1.0.0", + "convertcom/php-sdk-utils": ">=1.0.0", + "convertcom/php-sdk-event": ">=1.0.0", + "convertcom/php-sdk-types": ">=1.0.0" + }, + "require-dev": { + "phpunit/phpunit": "^11.0" + }, + "scripts": { + "test": "phpunit", + "build": "php build.php" + }, + "version": "1.0.0" +} \ No newline at end of file diff --git a/packages/Bucketing/phpunit.xml b/packages/Bucketing/phpunit.xml new file mode 100644 index 0000000..e84beb0 --- /dev/null +++ b/packages/Bucketing/phpunit.xml @@ -0,0 +1,18 @@ + + + + + ./tests + + + + + src + + + diff --git a/packages/Bucketing/src/BucketingManager.php b/packages/Bucketing/src/BucketingManager.php new file mode 100644 index 0000000..caadfb9 --- /dev/null +++ b/packages/Bucketing/src/BucketingManager.php @@ -0,0 +1,140 @@ +logManager) { + $this->logManager->trace('BucketingManager()', Messages::BUCKETING_CONSTRUCTOR, $this); + } + } + + /** + * Select a variation based on cumulative percentage boundaries. + * + * Iterates through variation buckets, accumulating their percentage + * ranges (scaled by 100), and returns the first variation whose + * cumulative range exceeds the given value. + * + * @param array $buckets Variation IDs as keys, percentages as values + * @param float $value A normalized bucket value in [0, maxTraffic) + * @param float $redistribute Amount to redistribute per bucket (default: 0.0) + * @return string|null The selected variation ID, or null if no match + */ + public function selectBucket(array $buckets, float $value, float $redistribute = 0.0): ?string + { + $variation = null; + $prev = 0.0; + + foreach ($buckets as $id => $percentage) { + $prev += ($percentage * 100) + $redistribute; + if ($value < $prev) { + $variation = (string) $id; + break; + } + } + + if ($this->logManager) { + $this->logManager->debug('BucketingManager.selectBucket()', [ + 'buckets' => $buckets, + 'value' => $value, + 'redistribute' => $redistribute, + ], ['variation' => $variation]); + } + + return $variation; + } + + /** + * Compute a deterministic bucket value for a visitor. + * + * Formula (identical to JS SDK): + * hash = generateHash(experienceId + visitorId, seed) + * value = intval((hash / 4294967296) * maxTraffic) + * + * @param string $visitorId The visitor's unique identifier + * @param array{seed?: int, experienceId?: string}|null $options Optional overrides + * @return int Normalized bucket value in [0, maxTraffic) + */ + public function getValueVisitorBased(string $visitorId, ?array $options = null): int + { + $seed = $options['seed'] ?? $this->hashSeed; + $experienceId = $options['experienceId'] ?? ''; + $hash = StringUtils::generateHash($experienceId . strval($visitorId), $seed); + $val = ($hash / self::MAX_HASH) * $this->maxTraffic; + $result = intval($val); + + if ($this->logManager) { + $this->logManager->debug('BucketingManager.getValueVisitorBased()', [ + 'visitorId' => $visitorId, + 'seed' => $seed, + 'experienceId' => $experienceId, + 'val' => $val, + 'result' => $result, + ]); + } + + return $result; + } + + /** + * Get the bucket assignment for a visitor. + * + * Combines hash-based value computation with bucket selection to + * deterministically assign a visitor to a variation. + * + * @param array $buckets Variation IDs as keys, percentages as values + * @param string $visitorId The visitor's unique identifier + * @param array{redistribute?: float, seed?: int, experienceId?: string}|null $options Optional overrides + * @return array{variationId: string, bucketingAllocation: int}|null Assignment result or null + */ + public function getBucketForVisitor(array $buckets, string $visitorId, ?array $options = null): ?array + { + $value = $this->getValueVisitorBased($visitorId, $options); + $selectedBucket = $this->selectBucket($buckets, $value, $options['redistribute'] ?? 0); + + if ($this->logManager) { + $this->logManager->debug('BucketingManager.getBucketForVisitor()', [ + 'visitorId' => $visitorId, + 'experienceId' => $options['experienceId'] ?? '', + 'bucketValue' => $value, + 'selectedVariationId' => $selectedBucket, + ]); + } + + if (!$selectedBucket) { + return null; + } + + return [ + 'variationId' => $selectedBucket, + 'bucketingAllocation' => $value, + ]; + } +} diff --git a/packages/Bucketing/src/Interfaces/BucketingManagerInterface.php b/packages/Bucketing/src/Interfaces/BucketingManagerInterface.php new file mode 100644 index 0000000..0315194 --- /dev/null +++ b/packages/Bucketing/src/Interfaces/BucketingManagerInterface.php @@ -0,0 +1,43 @@ + $buckets Variation IDs as keys, percentages as values + * @param float $value A normalized bucket value in [0, maxTraffic) + * @param float $redistribute Amount to redistribute per bucket (default: 0.0) + * @return string|null The selected variation ID, or null if no match + */ + public function selectBucket(array $buckets, float $value, float $redistribute = 0.0): ?string; + + /** + * Compute a deterministic bucket value for a visitor. + * + * @param string $visitorId The visitor's unique identifier + * @param array{seed?: int, experienceId?: string}|null $options Optional overrides + * @return int Normalized bucket value in [0, maxTraffic) + */ + public function getValueVisitorBased(string $visitorId, ?array $options = null): int; + + /** + * Get the bucket assignment for a visitor. + * + * @param array $buckets Variation IDs as keys, percentages as values + * @param string $visitorId The visitor's unique identifier + * @param array{redistribute?: float, seed?: int, experienceId?: string}|null $options Optional overrides + * @return array{variationId: string, bucketingAllocation: int}|null Assignment result or null + */ + public function getBucketForVisitor(array $buckets, string $visitorId, ?array $options = null): ?array; +} diff --git a/packages/Bucketing/tests/BucketingManagerTest.php b/packages/Bucketing/tests/BucketingManagerTest.php new file mode 100644 index 0000000..7591315 --- /dev/null +++ b/packages/Bucketing/tests/BucketingManagerTest.php @@ -0,0 +1,275 @@ +bucketingManager = new BucketingManager(); + } + + public function testShouldExposeBucketingManager(): void + { + $this->assertTrue(class_exists(BucketingManager::class)); + } + + public function testImportedEntityShouldBeConstructorOfBucketingManagerInstance(): void + { + $this->assertInstanceOf(BucketingManager::class, new BucketingManager()); + } + + public function testShouldCreateNewBucketingManagerInstanceWithDefaultConfig(): void + { + $bucketingManager = new BucketingManager(); + $this->assertInstanceOf(BucketingManager::class, $bucketingManager); + } + + public function testShouldCreateNewBucketingManagerInstanceWithProvidedConfig(): void + { + $bucketingManager = new BucketingManager(maxTraffic: 5000, hashSeed: 1234); + $this->assertInstanceOf(BucketingManager::class, $bucketingManager); + } + + public function testSelectBucketReturnsCorrectVariation(): void + { + $buckets = [ + '100234567' => 30, + '100234568' => 30, + '100234569' => 30, + '100234570' => 10, + ]; + + // Value 100 should fall in first bucket (0-3000 range) + $this->assertSame('100234567', $this->bucketingManager->selectBucket($buckets, 100)); + + // Value 3500 should fall in second bucket (3000-6000 range) + $this->assertSame('100234568', $this->bucketingManager->selectBucket($buckets, 3500)); + + // Value 6500 should fall in third bucket (6000-9000 range) + $this->assertSame('100234569', $this->bucketingManager->selectBucket($buckets, 6500)); + + // Value 9500 should fall in fourth bucket (9000-10000 range) + $this->assertSame('100234570', $this->bucketingManager->selectBucket($buckets, 9500)); + } + + public function testSelectBucketReturnsStringVariationId(): void + { + // PHP coerces numeric string keys to integers internally. + // selectBucket must always return a string to match JS SDK behavior + // (Object.keys returns strings in JS). + $buckets = [ + '100234567' => 50, + '100234568' => 50, + ]; + + $result = $this->bucketingManager->selectBucket($buckets, 100); + $this->assertIsString($result); + $this->assertSame('100234567', $result); + } + + public function testShouldSelectABucket(): void + { + $testVariations = [ + '100234567' => 30, + '100234568' => 30, + '100234569' => 30, + '100234570' => 10, + ]; + $variationId1 = $this->bucketingManager->selectBucket($testVariations, 100); + $variationId2 = $this->bucketingManager->selectBucket($testVariations, 200); + $this->assertNotNull($variationId1); + $this->assertSame($variationId1, $variationId2); + } + + public function testShouldSelectAnotherBucket(): void + { + $testVariations = [ + '100234567' => 30, + '100234568' => 30, + '100234569' => 30, + '100234570' => 10, + ]; + $variationId1 = $this->bucketingManager->selectBucket($testVariations, 6000); + $variationId2 = $this->bucketingManager->selectBucket($testVariations, 6500); + $this->assertNotNull($variationId1); + $this->assertSame($variationId1, $variationId2); + } + + public function testSelectBucketBoundaryValues(): void + { + $buckets = [ + 'A' => 30, + 'B' => 70, + ]; + + // Just below boundary (2999.99) → first bucket + $this->assertSame('A', $this->bucketingManager->selectBucket($buckets, 2999.99)); + + // Exactly at boundary (3000.0) → falls to NEXT bucket (condition is $value < $prev) + $this->assertSame('B', $this->bucketingManager->selectBucket($buckets, 3000.0)); + + // Just above boundary (3000.01) → second bucket + $this->assertSame('B', $this->bucketingManager->selectBucket($buckets, 3000.01)); + + // Value 0 → first bucket + $this->assertSame('A', $this->bucketingManager->selectBucket($buckets, 0.0)); + } + + public function testSelectBucketReturnsNullForZeroPercentVariation(): void + { + $testVariations = [ + '100234567' => 0, + '100234568' => 0, + '100234569' => 0, + '100234570' => 0, + ]; + $variationId = $this->bucketingManager->selectBucket($testVariations, 6000); + $this->assertNull($variationId); + } + + public function testShouldNotSelectABucketAndReturnNull(): void + { + $testVariations = [ + '100234567' => 30, + '100234568' => 10, + '100234569' => 30, + '100234570' => 30, + ]; + $variationId = $this->bucketingManager->selectBucket($testVariations, self::DEFAULT_MAX_TRAFFIC + 1); + $this->assertNull($variationId); + } + + public function testShouldReturnAValueGeneratedWithHelpOfMurmurhashBasedOnVisitorId(): void + { + $value = $this->bucketingManager->getValueVisitorBased('100123456'); + $this->assertIsInt($value); + } + + public function testShouldReturnDifferentValuesGeneratedWithHelpOfMurmurhashBasedOnVisitorIdWithSeeds(): void + { + $value1 = $this->bucketingManager->getValueVisitorBased('100123456', ['seed' => 11223344]); + $value2 = $this->bucketingManager->getValueVisitorBased('100123456', ['seed' => 99887766]); + $this->assertNotEquals($value1, $value2); + } + + public function testGetValueVisitorBasedFormula(): void + { + $visitorId = 'visitor-456'; + $experienceId = '100234567'; + $seed = 9999; + + // Compute expected value manually using the formula + $hash = StringUtils::generateHash($experienceId . strval($visitorId), $seed); + $expectedValue = intval(($hash / self::MAX_HASH) * self::DEFAULT_MAX_TRAFFIC); + + $actualValue = $this->bucketingManager->getValueVisitorBased($visitorId, [ + 'experienceId' => $experienceId, + 'seed' => $seed, + ]); + + $this->assertSame($expectedValue, $actualValue); + } + + public function testDeterministicBucketing(): void + { + $testVariations = [ + '100234567' => 10, + '100234568' => 30, + '100234569' => 60, + '100234570' => 0, + ]; + $visitorId = '01ABCD'; + + // Run 1000 times — must produce same result every time + $firstResult = $this->bucketingManager->getBucketForVisitor($testVariations, $visitorId); + $this->assertNotNull($firstResult); + + for ($i = 0; $i < 999; $i++) { + $result = $this->bucketingManager->getBucketForVisitor($testVariations, $visitorId); + $this->assertSame($firstResult['variationId'], $result['variationId']); + $this->assertSame($firstResult['bucketingAllocation'], $result['bucketingAllocation']); + } + } + + public function testDifferentVisitorsDifferentBuckets(): void + { + $testVariations = [ + 'A' => 50, + 'B' => 50, + ]; + + $results = ['A' => 0, 'B' => 0]; + $visitorCount = 1000; + + for ($i = 0; $i < $visitorCount; $i++) { + $bucket = $this->bucketingManager->getBucketForVisitor( + $testVariations, + 'visitor-' . $i, + ['experienceId' => 'exp-test'] + ); + if ($bucket !== null) { + $results[$bucket['variationId']]++; + } + } + + // With 50/50 split and 1000 visitors, each bucket should get + // at least 30% (statistical tolerance for hash distribution) + $this->assertGreaterThan($visitorCount * 0.30, $results['A']); + $this->assertGreaterThan($visitorCount * 0.30, $results['B']); + } + + public function testGetBucketForVisitorCallsDebugOnLogger(): void + { + /** @var LogManagerInterface&MockObject $logManager */ + $logManager = $this->createMock(LogManagerInterface::class); + + $debugCalls = []; + $logManager->expects($this->atLeastOnce()) + ->method('debug') + ->willReturnCallback(function () use (&$debugCalls): void { + $debugCalls[] = func_get_args(); + }); + + $bucketingManager = new BucketingManager(logManager: $logManager); + + $buckets = ['A' => 50, 'B' => 50]; + $bucketingManager->getBucketForVisitor($buckets, 'visitor-456', ['experienceId' => 'exp-1']); + + // Verify getBucketForVisitor summary log was emitted + $summaryLogs = array_filter($debugCalls, fn ($call) => $call[0] === 'BucketingManager.getBucketForVisitor()'); + $this->assertNotEmpty($summaryLogs, 'Expected debug log from getBucketForVisitor()'); + + $summaryLog = reset($summaryLogs); + $this->assertArrayHasKey('visitorId', $summaryLog[1]); + $this->assertArrayHasKey('experienceId', $summaryLog[1]); + $this->assertArrayHasKey('bucketValue', $summaryLog[1]); + $this->assertArrayHasKey('selectedVariationId', $summaryLog[1]); + $this->assertSame('visitor-456', $summaryLog[1]['visitorId']); + $this->assertSame('exp-1', $summaryLog[1]['experienceId']); + } + + public function testNoExceptionWhenLogManagerIsNull(): void + { + $bucketingManager = new BucketingManager(logManager: null); + + $buckets = ['A' => 50, 'B' => 50]; + $result = $bucketingManager->getBucketForVisitor($buckets, 'visitor-123', ['experienceId' => 'exp-1']); + + $this->assertNotNull($result); + $this->assertIsArray($result); + } +} diff --git a/packages/Bucketing/tests/test-config.json b/packages/Bucketing/tests/test-config.json new file mode 100644 index 0000000..542987e --- /dev/null +++ b/packages/Bucketing/tests/test-config.json @@ -0,0 +1,555 @@ +{ + "environment": "staging", + "data": { + "account_id": "10022898", + "audiences": [ + { + "id": "100299433", + "name": "Adv Audience", + "type": "transient", + "status": "active", + "key": "adv-audience", + "preset": false, + "rules": { + "OR": [ + { + "AND": [ + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "matches", + "negated": false + }, + "value": "value1", + "key": "varName1" + } + ] + }, + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "matches", + "negated": false + }, + "value": "value2", + "key": "varName2" + } + ] + } + ] + }, + { + "AND": [ + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "matches", + "negated": false + }, + "value": "something", + "key": "varName3" + } + ] + } + ] + } + ] + } + } + ], + "segments": [ + { + "id": "200299434", + "name": "Test Segments", + "status": "active", + "key": "test-segments-1", + "preset": false, + "rules": { + "OR": [ + { + "AND": [ + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "matches", + "negated": false + }, + "key": "enabled", + "value": true + } + ] + } + ] + } + ] + } + } + ], + "experiences": [ + { + "id": "100218245", + "name": "Test Experience AB Fullstack", + "key": "test-experience-ab-fullstack-2", + "type": "a/b_fullstack", + "version": 6, + "status": "active", + "global_js": "var s = 'test_experience'; console.log(s);", + "global_css": ".test-style { display: initial; }", + "url": "https://convert.com", + "integrations": [], + "environments": ["live", "staging"], + "site_area": { + "OR": [ + { + "AND": [ + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "matches", + "negated": false + }, + "key": "url", + "value": "https://convert.com/" + } + ] + } + ] + } + ] + }, + "audiences": ["100299433"], + "goals": ["100215959", "100215960", "100215961"], + "variations": [ + { + "id": "100299456", + "name": "Original Page", + "status": "running", + "is_baseline": true, + "changes": [ + { + "id": "100240519", + "type": "fullStackFeature", + "data": { + "feature_id": "10024", + "variables_data": { + "enabled": "true", + "caption": "Click that" + } + } + }, + { + "id": "100240521", + "type": "fullStackFeature", + "data": { + "feature_id": "10025", + "variables_data": { + "price": 100, + "button-height": 40, + "additionalData": "{\"foo\":\"bar\",\"v\":2}" + } + } + } + ], + "key": "100299456-original-page", + "traffic_allocation": 50.0 + }, + { + "id": "100299457", + "name": "Variation 1", + "status": "running", + "is_baseline": false, + "changes": [ + { + "id": "100240520", + "type": "fullStackFeature", + "data": { + "feature_id": "10024", + "variables_data": { + "enabled": "false", + "caption": "Not allowed" + } + } + } + ], + "key": "100299457-variation-1", + "traffic_allocation": 50.0 + } + ] + }, + { + "id": "100218246", + "name": "Test Experience AB Fullstack", + "key": "test-experience-ab-fullstack-3", + "type": "a/b_fullstack", + "version": 6, + "status": "active", + "global_js": "var s = 'test_experience'; console.log(s);", + "global_css": ".test-style { display: initial; }", + "url": "https://convert.com", + "integrations": [], + "environments": ["live", "staging"], + "site_area": { + "OR": [ + { + "AND": [ + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "matches", + "negated": false + }, + "key": "url", + "value": "https://convert.com/" + } + ] + } + ] + } + ] + }, + "audiences": ["100299433"], + "goals": ["100215959", "100215960", "100215961"], + "variations": [ + { + "id": "100299460", + "name": "Original Page", + "status": "running", + "is_baseline": true, + "changes": [ + { + "id": "100240529", + "type": "fullStackFeature", + "data": { + "feature_id": "10024", + "variables_data": { + "enabled": "true", + "caption": "Click that" + } + } + } + ], + "key": "100299460-original-page", + "traffic_allocation": 50.0 + }, + { + "id": "100299461", + "name": "Variation 1", + "status": "running", + "is_baseline": false, + "changes": [ + { + "id": "100240532", + "type": "fullStackFeature", + "data": { + "feature_id": "10024", + "variables_data": { + "enabled": "true", + "caption": "Allowed" + } + } + } + ], + "key": "100299461-variation-1", + "traffic_allocation": 50.0 + } + ] + }, + { + "id": "100218247", + "name": "Test Experience AB Fullstack", + "key": "test-experience-ab-fullstack-4", + "type": "a/b_fullstack", + "version": 6, + "status": "active", + "global_js": "var s = 'test_experience'; console.log(s);", + "global_css": ".test-style { display: initial; }", + "url": "https://convert.com", + "integrations": [], + "environments": ["live", "staging"], + "site_area": { + "OR": [ + { + "AND": [ + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "matches", + "negated": false + }, + "key": "url", + "value": "https://convert.com/" + } + ] + } + ] + } + ] + }, + "audiences": ["100299433"], + "goals": ["100215959", "100215960", "100215961"], + "variations": [{}] + } + ], + "features": [ + { + "id": "10024", + "name": "Feature 1", + "key": "feature-1", + "variables": [ + { + "key": "enabled", + "type": "boolean" + }, + { + "key": "caption", + "type": "string" + } + ] + }, + { + "id": "10025", + "name": "Feature 2", + "key": "feature-2", + "variables": [ + { + "key": "price", + "type": "float" + }, + { + "key": "button-height", + "type": "integer" + }, + { + "key": "additionalData", + "type": "json" + } + ] + }, + { + "id": "10026", + "name": "Not Attached Feature 3", + "key": "not-attached-feature-3", + "variables": [ + { + "key": "fee", + "type": "float" + }, + { + "key": "link", + "type": "string" + }, + { + "key": "additionalData", + "type": "json" + } + ] + } + ], + "goals": [ + { + "id": "100215960", + "name": "Increase Engagement", + "selected_default": true, + "status": "active", + "type": "dom_interaction", + "is_system": true, + "key": "increase-engagement", + "settings": { + "tracked_items": [ + { + "event": "click", + "selector": "a" + }, + { + "event": "submit", + "selector": "form" + } + ] + }, + "rules": { + "OR": [ + { + "AND": [ + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "matches", + "negated": false + }, + "key": "action", + "value": "buy" + }, + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "matches", + "negated": false + }, + "key": "action", + "value": "signup" + } + ] + } + ] + } + ] + } + }, + { + "id": "100215959", + "name": "Decrease BounceRate", + "selected_default": true, + "status": "active", + "type": "advanced", + "is_system": true, + "key": "decrease-bounce-rate", + "rules": { + "OR": [ + { + "AND": [ + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "lessEqual", + "negated": true + }, + "value": 1, + "key": "pages_visited_count" + }, + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "lessEqual", + "negated": true + }, + "value": 10, + "key": "visit_duration" + } + ] + } + ] + } + ] + } + }, + { + "id": "100215961", + "name": "adv goal country browser", + "selected_default": false, + "status": "active", + "type": "advanced", + "is_system": false, + "key": "adv-goal-country-browser", + "rules": { + "OR": [ + { + "AND": [ + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "equals", + "negated": false + }, + "value": "US", + "key": "country" + } + ] + }, + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "equals", + "negated": false + }, + "value": "chrome", + "key": "browser_name" + } + ] + } + ] + }, + { + "AND": [ + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "equals", + "negated": false + }, + "value": "GB", + "key": "country" + } + ] + }, + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "equals", + "negated": false + }, + "value": "safari", + "key": "browser_name" + } + ] + } + ] + } + ] + } + }, + { + "id": "100215962", + "key": "goal-without-rule" + } + ], + "project": { + "id": "10025986", + "name": "Test Project", + "type": "fullstack", + "utc_offset": 0, + "domains": [ + { + "id": "10029181", + "hosts": "https://convert.com/", + "tld": false + } + ], + "settings": { + "auto_link": false, + "data_anonymization": false, + "do_not_track": "OFF", + "include_jquery": false + }, + "environments": { + "live": "Live", + "staging": "Staging" + } + } + } +} diff --git a/packages/Data/composer.json b/packages/Data/composer.json new file mode 100644 index 0000000..92a6e03 --- /dev/null +++ b/packages/Data/composer.json @@ -0,0 +1,77 @@ +{ + "name": "convertcom/php-sdk-data", + "description": "PHP SDK Data package for Convert Insights, Inc.", + "type": "library", + "license": "Apache-2.0", + "version": "1.0.0", + "authors": [ + { + "name": "Convert Insights, Inc" + } + ], + "autoload": { + "psr-4": { + "ConvertSdk\\": "src/", + "ConvertSdk\\Config\\": "../Php-sdk/src/Config/" + } + }, + "repositories": { + "Enums": { + "type": "path", + "url": "../Enums" + }, + "Api": { + "type": "path", + "url": "../Api" + }, + "Logger": { + "type": "path", + "url": "../Logger" + }, + "Utils": { + "type": "path", + "url": "../Utils" + }, + "Event": { + "type": "path", + "url": "../Event" + }, + "Bucketing": { + "type": "path", + "url": "../Bucketing" + }, + "Rules": { + "type": "path", + "url": "../Rules" + }, + "Types": { + "type": "path", + "url": "../Types" + } + }, + "require": { + "php": "^8.2", + "convertcom/php-sdk-api": ">=1.0.0", + "convertcom/php-sdk-bucketing": ">=1.0.0", + "convertcom/php-sdk-enums": ">=1.0.0", + "convertcom/php-sdk-event": ">=1.0.0", + "convertcom/php-sdk-logger": ">=1.0.0", + "convertcom/php-sdk-rules": ">=1.0.0", + "convertcom/php-sdk-types": ">=1.0.0", + "convertcom/php-sdk-utils": ">=1.0.0", + "psy/psysh": "@stable" + }, + "require-dev": { + "php-http/mock-client": "^1.6", + "nyholm/psr7": "^1.8", + "phpunit/phpunit": "^11.0" + }, + "scripts": { + "test": "phpunit", + "coverage": "vendor/bin/phpunit --coverage-text" + }, + "config": { + "optimize-autoloader": true, + "sort-packages": true + } + } diff --git a/packages/Data/phpunit.xml b/packages/Data/phpunit.xml new file mode 100644 index 0000000..1e5ea93 --- /dev/null +++ b/packages/Data/phpunit.xml @@ -0,0 +1,24 @@ + + + + + ./tests + + + + + + + + + + src + + + diff --git a/packages/Data/src/DataManager.php b/packages/Data/src/DataManager.php new file mode 100644 index 0000000..310396c --- /dev/null +++ b/packages/Data/src/DataManager.php @@ -0,0 +1,1593 @@ + data). + */ + private array $_bucketedVisitors = []; + + /** + * Flag indicating if storage is asynchronous. + */ + + /** + * Environment string. + */ + private string $_environment; + + /** + * Mapper function for transforming data. + */ + private \Closure $_mapper; + + /** + * DataManager constructor. + * + * @param Config $config + * @param BucketingManagerInterface $bucketingManager + * @param RuleManagerInterface $ruleManager + * @param EventManagerInterface $eventManager + * @param ApiManagerInterface $apiManager + * @param LogManagerInterface|null $loggerManager + */ + public function __construct( + Config $config, + BucketingManagerInterface $bucketingManager, + RuleManagerInterface $ruleManager, + EventManagerInterface $eventManager, + ApiManagerInterface $apiManager, + ?LogManagerInterface $loggerManager = null, + ) { + $this->_environment = $config->getEnvironment(); + $this->_apiManager = $apiManager; + $this->_bucketingManager = $bucketingManager; + $this->_ruleManager = $ruleManager; + $this->_loggerManager = $loggerManager; + $this->_eventManager = $eventManager; + $this->_config = $config; + $mapper = $config->getMapper(); + $this->_mapper = $mapper instanceof \Closure ? $mapper : ($mapper !== null ? \Closure::fromCallable($mapper) : fn ($value) => $value); + $this->_data = $config->getData() ?? new ConfigResponseData(); + $this->_accountId = $this->_data ? $this->_data->getAccountId() : ''; + $project = $this->_data ? $this->_data->getProject() : null; + $this->_projectId = $project ? (is_array($project) ? ($project['id'] ?? '') : ($project->getId() ?? '')) : ''; + $this->_dataStoreManager = null; + $rawDataStore = $config->getDataStore(); + if ($rawDataStore !== null) { + $this->setDataStore($rawDataStore); + } + $this->_dataEntities = DataEntities::DATA_ENTITIES; + $this->_loggerManager?->trace( + 'DataManager()', + Messages::DATA_CONSTRUCTOR, + null + ); + } + + /** + * Get the configuration data. + * + * @return ConfigResponseData + */ + public function getConfigData(): ConfigResponseData + { + return $this->_data; + } + + /** + * Set the configuration data. + * + * @param ConfigResponseData $data + * @return void + */ + public function setConfigData(ConfigResponseData $data): void + { + if ($this->isValidConfigData($data)) { + $this->_data = $data; + $this->_accountId = $data->account_id ?? null; + $this->_projectId = $data->project->id ?? null; + } else { + $this->_loggerManager?->error( + 'DataManager.setConfigData()', + ERROR_MESSAGES::CONFIG_DATA_NOT_VALID + ); + } + } + + /** + * Set the data store manager. + * + * @param mixed $dataStore Optional data store object + * @return void + */ + public function setDataStoreManager(mixed $dataStore): void + { + $this->_dataStoreManager = null; + if ($dataStore) { + $this->_dataStoreManager = new DataStoreManager( + $this->_config, + [ + 'dataStore' => $dataStore, + 'eventManager' => $this->_eventManager, + 'loggerManager' => $this->_loggerManager, + ] + ); + } + } + + /** + * Get the data store manager. + * + * @return DataStoreManagerInterface + */ + public function getDataStoreManager(): ?DataStoreManagerInterface + { + return $this->_dataStoreManager; + } + + /** + * Set dataStoreManager at run-time. + * + * @param mixed $dataStore Optional data store object + * @return void + */ + public function setDataStore(mixed $dataStore): void + { + $this->_dataStoreManager = null; + if ($dataStore) { + $this->_dataStoreManager = new DataStoreManager( + $this->_config, + [ + 'dataStore' => $dataStore, + 'eventManager' => $this->_eventManager, + 'loggerManager' => $this->_loggerManager, + ] + ); + } + } + + /** + * Validate locationProperties against locations rules and visitorProperties against audiences rules + * + * @param string $visitorId + * @param string $identity Value of the field which name is provided in identityField + * @param string $identityField Defaults to 'key' + * @param BucketingAttributes $attributes + * @return mixed ConfigExperience or RuleError or null + */ + public function matchRulesByField( + string $visitorId, + string $identity, + string $identityField, + BucketingAttributes $attributes + ): array|RuleError|null { + // Extract attributes properties + $visitorProperties = $attributes->visitorProperties ?? null; + $locationProperties = $attributes->locationProperties ?? null; + $ignoreLocationProperties = $attributes->ignoreLocationProperties ?? false; + $environment = $attributes->environment ?? $this->_environment; + + // Log trace information + $this->_loggerManager?->trace( + 'DataManager.matchRulesByField()', + json_encode(LogUtils::toLoggable(($this->_mapper)([ + 'visitorId' => $visitorId, + 'identity' => $identity, + 'identityField' => $identityField, + 'visitorProperties' => $visitorProperties, + 'locationProperties' => $locationProperties, + 'ignoreLocationProperties' => $ignoreLocationProperties, + 'environment' => $environment, + ]))) + ); + + // Retrieve the experience + $experience = $this->_getEntityByField($identity, 'experiences', $identityField); + if (!$experience) { + $this->_loggerManager?->debug( + 'DataManager.matchRulesByField()', + Messages::EXPERIENCE_NOT_FOUND, + LogUtils::toLoggable(($this->_mapper)([ + 'identity' => $identity, + 'identityField' => $identityField, + ])) + ); + return null; + } + + // Retrieve archived experiences + $archivedExperiences = $this->getEntitiesList('archived_experiences'); + // Check if the experience is archived + $isArchivedExperience = in_array((string)$experience['id'], array_map('strval', $archivedExperiences), true); + if ($isArchivedExperience) { + $this->_loggerManager?->debug( + 'DataManager.matchRulesByField()', + Messages::EXPERIENCE_ARCHIVED, + LogUtils::toLoggable(($this->_mapper)([ + 'identity' => $identity, + 'identityField' => $identityField, + ])) + ); + return null; + } + + // Check environment match + $isEnvironmentMatch = isset($experience['environment']) ? $experience['environment'] === $environment : true; + if (!$isEnvironmentMatch) { + $this->_loggerManager?->debug( + 'DataManager.matchRulesByField()', + Messages::EXPERIENCE_ENVIRONMENT_NOT_MATCH, + LogUtils::toLoggable(($this->_mapper)([ + 'identity' => $identity, + 'identityField' => $identityField, + ])) + ); + return null; + } + + // Check bucketing + $visitorData = $this->getData($visitorId) ?? []; + $bucketingData = $visitorData['bucketing'] ?? []; + $variationId = $bucketingData[$experience['id']] ?? null; + $isBucketed = $variationId && $this->retrieveVariation($experience['id'], (string)$variationId); + // Check location rules + $locationMatched = $ignoreLocationProperties === true; + if (!$locationMatched && $locationProperties) { + if (isset($experience['locations']) && is_array($experience['locations']) && count($experience['locations']) > 0) { + $locations = $this->getItemsByIds($experience['locations'], 'locations'); + if (count($locations) > 0) { + $matchedLocations = $this->selectLocations($visitorId, $locations, new LocationAttributes([ + 'locationProperties' => $locationProperties, + 'identityField' => $identityField, + ])); + $matchedErrors = array_filter($matchedLocations, fn ($match) => $match instanceof RuleError); + if (count($matchedErrors) > 0) { + return reset($matchedErrors); + } + $locationMatched = count($matchedLocations) > 0; + } + } elseif (isset($experience['site_area'])) { + $locationMatched = $this->_ruleManager->isRuleMatched( + $locationProperties, + new RuleObject($experience['site_area']), + 'SiteArea' + ); + if ($locationMatched instanceof RuleError) { + return $locationMatched; + } + } else { + $locationMatched = true; + $this->_loggerManager?->info( + 'DataManager.matchRulesByField()', + Messages::LOCATION_NOT_RESTRICTED + ); + } + } + if (!$locationMatched) { + $this->_loggerManager?->debug( + 'DataManager.matchRulesByField()', + Messages::LOCATION_NOT_MATCH, + json_encode(LogUtils::toLoggable(($this->_mapper)([ + 'locationProperties' => $locationProperties, + isset($experience['locations']) ? 'experiences[].variations[].locations' : 'experiences[].variations[].site_area' => $experience['locations'] ?? $experience['site_area'] ?? '', + ]))) + ); + return null; + } + + // Check audience rules + $audiences = []; + $segments = []; + $matchedAudiences = []; + $matchedSegments = []; + $audiencesToCheck = []; + $audiencesMatched = false; + $segmentsMatched = false; + + if (isset($experience['audiences']) && is_array($experience['audiences']) && count($experience['audiences']) > 0) { + // In PHP, an empty array [] is falsy (unlike JS where {} is truthy). + // This check correctly requires non-empty visitorProperties to evaluate audience rules. + if ($visitorProperties) { + $audiences = $this->getItemsByIds($experience['audiences'], 'audiences'); + $audiencesToCheck = array_filter( + $audiences, + fn ($audience) => !($isBucketed && $audience['type'] === ConfigAudienceTypes::PERMANENT) + ); + if (count($audiencesToCheck) > 0) { + $matchedAudiences = $this->filterMatchedRecordsWithRule( + $audiencesToCheck, + $visitorProperties, + 'audience', + $identityField + ); + $matchedErrors = array_filter($matchedAudiences, fn ($match) => $match instanceof RuleError); + if (count($matchedErrors) > 0) { + return reset($matchedErrors); + } + if (count($matchedAudiences) > 0) { + foreach ($matchedAudiences as $item) { + $this->_loggerManager?->info( + 'DataManager.matchRulesByField()', + str_replace('#', $item[$identityField] ?? '', Messages::AUDIENCE_MATCH) + ); + } + } + $audiencesMatched = $experience['settings']['matching_options']['audiences'] === GenericListMatchingOptions::ALL + ? count($matchedAudiences) === count($audiencesToCheck) + : count($matchedAudiences) > 0; + } else { + $audiencesMatched = true; + $this->_loggerManager?->info( + 'DataManager.matchRulesByField()', + Messages::NON_PERMANENT_AUDIENCE_NOT_RESTRICTED + ); + } + } + // If visitorProperties is null/empty and experience has audiences, + // audiencesMatched stays false — can't evaluate without properties + } else { + // No audiences on experience — all visitors qualify + $audiencesMatched = true; + $this->_loggerManager?->info( + 'DataManager.matchRulesByField()', + Messages::AUDIENCE_NOT_RESTRICTED + ); + } + + $segments = $this->getItemsByIds($experience['audiences'] ?? [], 'segments'); + if (count($segments) > 0) { + $matchedSegments = $this->filterMatchedCustomSegments($segments, $visitorId); + if (count($matchedSegments) > 0) { + foreach ($matchedSegments as $item) { + $this->_loggerManager?->info( + 'DataManager.matchRulesByField()', + str_replace('#', $item[$identityField] ?? '', Messages::SEGMENTATION_MATCH) + ); + } + } + $segmentsMatched = count($matchedSegments) > 0; + } else { + $segmentsMatched = true; + $this->_loggerManager?->info( + 'DataManager.matchRulesByField()', + Messages::SEGMENTATION_NOT_RESTRICTED + ); + } + + // Final check and return + if ($audiencesMatched && $segmentsMatched) { + if (isset($experience['variations']) && is_array($experience['variations']) && count($experience['variations']) > 0) { + $this->_loggerManager?->info( + 'DataManager.matchRulesByField()', + Messages::EXPERIENCE_RULES_MATCHED + ); + return $experience; + } else { + $this->_loggerManager?->debug( + 'DataManager.matchRulesByField()', + Messages::VARIATIONS_NOT_FOUND, + LogUtils::toLoggable(($this->_mapper)([ + 'visitorProperties' => $visitorProperties, + 'audiences' => $audiences, + ])) + ); + } + } else { + $this->_loggerManager?->debug( + 'DataManager.matchRulesByField()', + Messages::AUDIENCE_NOT_MATCH, + LogUtils::toLoggable(($this->_mapper)([ + 'visitorProperties' => $visitorProperties, + 'audiences' => $audiences, + ])) + ); + } + return null; + } + + + /** + * Retrieve variation for visitor + * + * @param string $visitorId + * @param string $identity Value of the field which name is provided in identityField + * @param string $identityField Defaults to IdentityField::KEY + * @param BucketingAttributes $attributes + * @return mixed BucketedVariation|RuleError|BucketingError|null + * @throws \InvalidArgumentException If identityField is invalid + * @private + */ + private function _getBucketingByField( + string $visitorId, + string $identity, + string $identityField, + BucketingAttributes $attributes + ): array|RuleError|BucketingError|null { + // Validate identityField + if (!IdentityField::isValid($identityField)) { + throw new \InvalidArgumentException("Invalid identityField: $identityField. Must be 'id' or 'key'."); + } + + // Extract attributes properties + $visitorProperties = $attributes->visitorProperties ?? null; + $locationProperties = $attributes->locationProperties ?? null; + $updateVisitorProperties = $attributes->updateVisitorProperties ?? null; + $forceVariationId = $attributes->forceVariationId ?? null; + $enableTracking = $attributes->enableTracking ?? true; + $ignoreLocationProperties = $attributes->ignoreLocationProperties ?? false; + $environment = $attributes->environment ?? $this->_environment; + // Log trace information + $this->_loggerManager?->trace( + 'DataManager._getBucketingByField()', + json_encode(LogUtils::toLoggable(($this->_mapper)([ + 'visitorId' => $visitorId, + 'identity' => $identity, + 'identityField' => $identityField, + 'visitorProperties' => $visitorProperties, + 'locationProperties' => $locationProperties, + 'forceVariationId' => $forceVariationId, + 'enableTracking' => $enableTracking, + 'ignoreLocationProperties' => $ignoreLocationProperties, + 'environment' => $environment, + ]))) + ); + + // Retrieve the experience + $experience = $this->matchRulesByField( + $visitorId, + $identity, + $identityField, + new BucketingAttributes([ + 'visitorProperties' => $visitorProperties, + 'locationProperties' => $locationProperties, + 'ignoreLocationProperties' => $ignoreLocationProperties, + 'environment' => $environment, + ]) + ); + if ($experience) { + if ($experience instanceof RuleError) { + return $experience; + } + return $this->_retrieveBucketing( + $visitorId, + $visitorProperties, + $updateVisitorProperties, + new ConfigExperience($experience), + $forceVariationId, + $enableTracking + ); + } + + return null; + } + + /** + * Retrieve variation for visitor + * + * @param string $visitorId + * @param ?array $visitorProperties + * @param bool $updateVisitorProperties + * @param ConfigExperience $experience + * @param ?string $forceVariationId + * @param bool $enableTracking Defaults to true + * @return mixed BucketedVariation array or BucketingError or null + * @private + */ + private function _retrieveBucketing( + string $visitorId, + ?array $visitorProperties, + ?bool $updateVisitorProperties, + ConfigExperience $experience, + ?string $forceVariationId = null, + bool $enableTracking = true + ): array|BucketingError|null { + // Initial validation + if (empty($visitorId) || $experience === null || empty($experience->getId())) { + return null; + } + + // Initialize variables + $variation = null; + $variationId = null; + $bucketedVariation = null; + $bucketingAllocation = null; + $storeKey = $this->getStoreKey($visitorId); + // Handle forced variation + if (!empty($forceVariationId) && ($variation = $this->retrieveVariation($experience->getId(), (string)$forceVariationId))) { + $variationId = $forceVariationId; + $this->_loggerManager?->info( + 'DataManager._retrieveBucketing()', + str_replace('#', '#' . $forceVariationId, Messages::BUCKETED_VISITOR_FORCED) + ); + $this->_loggerManager?->debug( + 'DataManager._retrieveBucketing()', + LogUtils::toLoggable(($this->_mapper)([ + 'storeKey' => $storeKey, + 'visitorId' => $visitorId, + 'variationId' => $forceVariationId, + ])) + ); + } + + // Check stored bucketing + $data = $this->getData($visitorId); + $bucketing = $data['bucketing'] ?? []; + $segments = $data['segments'] ?? []; + $storedVariationId = $bucketing[(string)$experience->getId()] ?? null; + + if ( + !empty($storedVariationId) && + (empty($variationId) || (string)$variationId === (string)$storedVariationId) && + ($variation = $this->retrieveVariation($experience->getId(), (string)$storedVariationId)) + ) { + $variationId = $storedVariationId; + $this->_loggerManager?->info( + 'DataManager._retrieveBucketing()', + str_replace('#', '#' . $variationId, Messages::BUCKETED_VISITOR_FOUND) + ); + $this->_loggerManager?->debug( + 'DataManager._retrieveBucketing()', + json_encode( + LogUtils::toLoggable(($this->_mapper)([ + 'storeKey' => $storeKey, + 'visitorId' => $visitorId, + 'variationId' => $variationId, + ])) + ) + ); + } else { + // Build buckets from variations + $buckets = array_reduce( + array_filter( + $experience->getVariations(), + fn ($variation) => + (isset($variation['status']) ? $variation['status'] === VariationStatuses::RUNNING : true) && + (array_key_exists('traffic_allocation', $variation) ? + ($variation['traffic_allocation'] > 0 || !is_numeric($variation['traffic_allocation'])) : + true) + ), + function ($carry, $variation) { + if (!empty($variation['id'])) { + $carry[$variation['id']] = $variation['traffic_allocation'] ?? 100.0; + } + return $carry; + }, + [] + ); + // Determine bucket for visitor + $bucketingParams = $this->_config->bucketing->excludeExperienceIdHash ?? false + ? null + : ['experienceId' => (string)$experience->getId()]; + $bucketing = $this->_bucketingManager->getBucketForVisitor( + $buckets, + $visitorId, + $bucketingParams + ); + + $variationId = $variationId ?? $bucketing['variationId'] ?? null; + $bucketingAllocation = $bucketing['bucketingAllocation'] ?? null; + + // Handle bucketing failure + if (empty($variationId)) { + $this->_loggerManager?->debug( + 'DataManager._retrieveBucketing()', + ErrorMessages::UNABLE_TO_SELECT_BUCKET_FOR_VISITOR, + json_encode(LogUtils::toLoggable(($this->_mapper)([ + 'visitorId' => $visitorId, + 'experience' => $experience, + 'buckets' => $buckets, + 'bucketing' => $bucketing, + ]))) + ); + return BucketingError::VariationNotDecided; + } + + $this->_loggerManager?->info( + 'DataManager._retrieveBucketing()', + str_replace('#', '#' . $variationId, Messages::BUCKETED_VISITOR) + ); + + $storeDataObj = [ + 'bucketing' => [(string)$experience->getId() => $variationId], + ]; + if ($updateVisitorProperties && !empty($visitorProperties)) { + $storeDataObj['segments'] = $visitorProperties; + } + $this->putData($visitorId, $storeDataObj); + // Track bucketing event if enabled + if ($enableTracking) { + $bucketingEvent = [ + 'experienceId' => (string)$experience->getId(), + 'variationId' => (string)$variationId, + ]; + $visitorEvent = [ + 'eventType' => VisitorTrackingEvents::EVENT_TYPE_BUCKETING, + 'data' => $bucketingEvent, + ]; + $this->_apiManager->enqueue($visitorId, new VisitorTrackingEvents($visitorEvent), new VisitorSegments($segments)); + $this->_loggerManager?->trace( + 'DataManager._retrieveBucketing()', + json_encode(LogUtils::toLoggable(($this->_mapper)(['visitorEvent' => $visitorEvent]))) + ); + } + + $variation = $this->retrieveVariation($experience->getId(), (string)$variationId); + } + + // Build and return the bucketed variation + if ($variation) { + $bucketedVariation = array_merge( + [ + 'experienceId' => $experience->getId(), + 'experienceName' => $experience->getName(), + 'experienceKey' => $experience->getKey(), + ], + ['bucketingAllocation' => $bucketingAllocation], + [ + 'id' => $variation->getId(), + 'name' => $variation->getName(), + 'key' => $variation->getKey(), + 'traffic_allocation' => $variation->getTrafficAllocation(), + 'status' => $variation->getStatus(), + 'changes' => $variation->getChanges(), + ] + ); + } + + return $bucketedVariation; + } + + /** + * Retrieve a variation for a given experience. + * + * @param string $experienceId + * @param string $variationId + * @return ExperienceVariationConfig + * @private + */ + private function retrieveVariation( + string $experienceId, + string $variationId + ): ?ExperienceVariationConfig { + $subItem = $this->getSubItem( + 'experiences', + $experienceId, + 'variations', + $variationId, + 'id', + 'id' + ); + return $subItem !== null ? new ExperienceVariationConfig($subItem) : null; + } + + /** + * Reset the bucketed visitors map. + * + * @return void + */ + public function reset(): void + { + $this->_bucketedVisitors = []; + } + + /** + * Store data for a visitor. + * + * @param string $visitorId + * @param ?StoreData $newData Defaults to null (empty StoreData) + * @return void + * @private + */ + public function putData(string $visitorId, ?array $newData): void + { + // Step 1: Get the store key + $storeKey = $this->getStoreKey($visitorId); + // Step 2: Retrieve existing data or use an empty array + $storeDataObj = $this->getData($visitorId); + + $storeData = $storeDataObj ? [ + 'bucketing' => $storeDataObj['bucketing'] ?? [], + 'locations' => $storeDataObj['locations'] ?? [], + 'segments' => $storeDataObj['segments'] ?? [], + 'goals' => $storeDataObj['goals'] ?? [], + ] : []; + // Step 3: Handle newData, defaulting to an empty StoreData object + $newDataObj = $newData ?? []; + $newDataArray = [ + 'bucketing' => $newDataObj['bucketing'] ?? [], + 'locations' => $newDataObj['locations'] ?? [], + 'segments' => $newDataObj['segments'] ?? [], + 'goals' => $newDataObj['goals'] ?? [], + ]; + // Step 4: Check if data has changed + $isChanged = !ObjectUtils::objectDeepEqual($storeData, $newDataArray); + if ($isChanged) { + + // Step 5: Merge data if changed + $updatedData = ObjectUtils::objectDeepMerge($storeData, $newDataArray); + $this->_bucketedVisitors[$storeKey] = $updatedData; + // Step 6: Enforce local store limit + if (count($this->_bucketedVisitors) > $this->_localStoreLimit) { + reset($this->_bucketedVisitors); + $oldestKey = key($this->_bucketedVisitors); + unset($this->_bucketedVisitors[$oldestKey]); + } + // Step 7: Handle data store manager + if ($this->_dataStoreManager) { + // Extract segments and remaining data + $storedSegments = $storeData['segments'] ?? []; + $dataWithoutSegments = $storeData; + unset($dataWithoutSegments['segments']); + + // Filter segments + $reportSegments = $this->filterReportSegments($storedSegments); + $newSegments = $this->filterReportSegments($newDataArray['segments'] ?? []); + if (!empty(array_filter($newSegments, fn ($value) => $value !== null))) { + // Merge data with filtered segments + $mergedData = ObjectUtils::objectDeepMerge($dataWithoutSegments, [ + 'segments' => array_merge($reportSegments, $newSegments), + ]); + $this->_dataStoreManager->set($storeKey, $mergedData); + } else { + $this->_dataStoreManager->set($storeKey, $updatedData); + } + } + } + } + + /** + * Retrieve stored data for a visitor. + * + * @param string $visitorId + * @return StoreData|null Stored data + * @private + */ + public function getData(string $visitorId): ?array + { + $storeKey = $this->getStoreKey($visitorId); + $memoryData = $this->_bucketedVisitors[$storeKey] ?? null; + + if ($this->_dataStoreManager) { + $dataStoreData = $this->_dataStoreManager->get($storeKey) ?? []; + + $mergedData = ObjectUtils::objectDeepMerge( + $memoryData ?? [], + $dataStoreData + ); + return $mergedData; + } + + if ($memoryData === null) { + return null; + } + return $memoryData; + } + + /** + * Generate a store key for a visitor. + * + * @param string $visitorId + * @return string Store key + * @private + */ + public function getStoreKey(string $visitorId): string + { + return "{$this->_accountId}-{$this->_projectId}-{$visitorId}"; + } + + /** + * Select locations for a visitor based on rules and attributes. + * + * @param string $visitorId + * @param array $items Array of location items (associative arrays) + * @param LocationAttributes $attributes Location attributes object + * @return array Array of matched items or RuleError instances + */ + public function selectLocations(string $visitorId, array $items, LocationAttributes $attributes): array + { + $locationProperties = $attributes->getLocationProperties(); + $identityField = $attributes->getIdentityField() ?? 'key'; + $forceEvent = $attributes->getForceEvent(); + + $this->_loggerManager?->trace( + 'DataManager.selectLocations()', + json_encode(LogUtils::toLoggable(($this->_mapper)([ + 'items' => $items, + 'locationProperties' => $locationProperties, + ]))) + ); + + // Get locations from DataStore + $data = $this->getData($visitorId); + $locations = $data['locations'] ?? []; + + $matchedRecords = []; + if (ArrayUtils::arrayNotEmpty($items)) { + foreach ($items as $item) { + if (empty($item['rules'])) { + continue; + } + + $match = $this->_ruleManager->isRuleMatched( + $locationProperties, + new RuleObject($item['rules']), + "ConfigLocation #{$item[$identityField]}" + ); + $identity = (string)($item[$identityField] ?? ''); + + if ($match === true) { + $this->_loggerManager?->info( + 'DataManager.selectLocations()', + str_replace('#', "#{$identity}", Messages::LOCATION_MATCH) + ); + + if (!in_array($identity, $locations, true) || $forceEvent) { + $this->_eventManager->fire( + SystemEvents::LocationActivated, + [ + 'visitorId' => $visitorId, + 'location' => [ + 'id' => $item['id'] ?? null, + 'key' => $item['key'] ?? null, + 'name' => $item['name'] ?? null, + ], + ], + null, + true + ); + $this->_loggerManager?->info( + 'DataManager.selectLocations()', + str_replace('#', "#{$identity}", Messages::LOCATION_ACTIVATED) + ); + } + + if (!in_array($identity, $locations, true)) { + $locations[] = $identity; + } + $matchedRecords[] = $item; + } elseif ($match !== false) { + // Catch rule errors + $matchedRecords[] = $match; + } elseif ($match === false && in_array($identity, $locations, true)) { + $this->_eventManager->fire( + SystemEvents::LocationDeactivated, + [ + 'visitorId' => $visitorId, + 'location' => [ + 'id' => $item['id'] ?? null, + 'key' => $item['key'] ?? null, + 'name' => $item['name'] ?? null, + ], + ], + null, + true + ); + $locationIndex = array_search($identity, $locations, true); + if ($locationIndex !== false) { + array_splice($locations, $locationIndex, 1); + } + $this->_loggerManager?->info( + 'DataManager.selectLocations()', + str_replace('#', "#{$identity}", Messages::LOCATION_DEACTIVATED) + ); + } + } + } + + // Store the data + $this->putData($visitorId, ['locations' => $locations]); + + $this->_loggerManager?->debug( + 'DataManager.selectLocations()', + json_encode(LogUtils::toLoggable(($this->_mapper)([ + 'matchedRecords' => $matchedRecords, + ]))) + ); + + return $matchedRecords; + } + + /** + * Retrieve variation for visitor by key. + * + * @param string $visitorId + * @param string $key + * @param BucketingAttributes $attributes + * @return mixed BucketedVariation array, RuleError, or BucketingError + */ + public function getBucketing(string $visitorId, string $key, BucketingAttributes $attributes): array|RuleError|BucketingError|null + { + return $this->_getBucketingByField($visitorId, $key, 'key', $attributes); + } + + /** + * Retrieve variation for visitor by ID. + * + * @param string $visitorId + * @param string $id + * @param BucketingAttributes $attributes + * @return mixed BucketedVariation array, RuleError, or BucketingError + */ + public function getBucketingById(string $visitorId, string $id, BucketingAttributes $attributes): array|RuleError|BucketingError|null + { + return $this->_getBucketingByField($visitorId, $id, 'id', $attributes); + } + + + /** + * Process conversion event. + * + * @param string $visitorId The unique identifier of the visitor + * @param string $goalId The identifier of the goal to process + * @param array|null $goalRule Optional associative array of key-value pairs for goal matching + * @param array|null $goalData Optional array of associative arrays containing goal data + * @param VisitorSegments|null $segments Optional visitor segments object + * @param array|null $conversionSetting Optional associative array of conversion settings + * @return bool|RuleError Returns true on success, or a RuleError instance on failure + */ + public function convert( + string $visitorId, + string $goalId, + ?array $goalRule = null, + ?array $goalData = null, + ?VisitorSegments $segments = null, + ?array $conversionSetting = null + ): bool|RuleError { + // Retrieve the goal based on goalId type + $goal = is_string($goalId) + ? $this->getEntity($goalId, 'goals') + : $this->getEntityById($goalId, 'goals'); + // Check if goal exists and has an ID + if ($goal === null || !isset($goal['id'])) { + $this->_loggerManager?->error( + 'DataManager.convert()', + Messages::GOAL_NOT_FOUND + ); + return false; + } + + // Handle goal rule matching if provided + if ($goalRule !== null) { + if (empty($goal['rules'])) { + return false; + } + $ruleMatched = $this->_ruleManager->isRuleMatched( + $goalRule, + new RuleObject($goal['rules']), + "ConfigGoal #{$goalId}" + ); + if ($ruleMatched instanceof RuleError) { + return $ruleMatched; + } + if ($ruleMatched === false) { + $this->_loggerManager?->error( + 'DataManager.convert()', + Messages::GOAL_RULE_NOT_MATCH + ); + return false; + } + } + + // Check for force multiple transactions setting + $forceMultipleTransactions = $conversionSetting[ConversionSettingKey::ForceMultipleTransactions->value] ?? null; + // Retrieve stored data for the visitor + $data = $this->getData($visitorId) ?? []; + $bucketingData = $data['bucketing'] ?? []; + $goals = $data['goals'] ?? []; + $goalTriggered = $goals[$goalId] ?? false; + // Log and skip if goal was already triggered and multiple transactions aren't forced + if ($goalTriggered) { + $this->_loggerManager?->debug( + 'DataManager.convert()', + str_replace('#', $goalId, Messages::GOAL_FOUND), + json_encode(LogUtils::toLoggable(($this->_mapper)([ + 'visitorId' => $visitorId, + 'goalId' => $goalId, + ]))) + ); + if (!$forceMultipleTransactions) { + return true; + } + } + + // Store the goal as triggered + $this->putData($visitorId, ['goals' => [$goalId => true]]); + + // Send conversion event if goal wasn't previously triggered + if (!$goalTriggered) { + $this->sendConversion($visitorId, $goal['id'], $bucketingData, $segments); + } + // Send transaction event if goalData exists and conditions are met + if ($goalData !== null && (!$goalTriggered || $forceMultipleTransactions)) { + $this->sendTransaction($visitorId, $goal['id'], $goalData, $bucketingData, $segments); + } + + return true; + } + + /** + * Send a conversion event to the API. + * + * @param string $visitorId The visitor's unique identifier + * @param string $goalId The goal identifier + * @param array $bucketingData Bucketing data for the visitor + * @param VisitorSegments|null $segments Visitor segments + * @return void + */ + private function sendConversion(string $visitorId, string $goalId, array $bucketingData, ?VisitorSegments $segments): void + { + $data = ['goalId' => $goalId]; + if (!empty($bucketingData)) { + $data['bucketingData'] = $bucketingData; + } + $event = [ + 'eventType' => SystemEvents::Conversion->value, + 'data' => $data, + ]; + $this->_apiManager->enqueue($visitorId, new VisitorTrackingEvents($event), $segments); + $this->_loggerManager?->trace( + 'DataManager.convert()', + LogUtils::toLoggable(($this->_mapper)(['event' => $event])) + ); + } + + /** + * Send a transaction event to the API. + * + * @param string $visitorId The visitor's unique identifier + * @param string $goalId The goal identifier + * @param array $goalData Array of goal data + * @param array $bucketingData Bucketing data for the visitor + * @param VisitorSegments|null $segments Visitor segments + * @return void + */ + private function sendTransaction(string $visitorId, string $goalId, array $goalData, array $bucketingData, ?VisitorSegments $segments): void + { + $data = [ + 'goalId' => $goalId, + 'goalData' => $goalData, + ]; + if (!empty($bucketingData)) { + $data['bucketingData'] = $bucketingData; + } + $event = [ + 'eventType' => SystemEvents::Conversion->value, + 'data' => $data, + ]; + $this->_apiManager->enqueue($visitorId, new VisitorTrackingEvents($event), $segments); + $this->_loggerManager?->trace( + 'DataManager.convert()', + LogUtils::toLoggable(($this->_mapper)(['event' => $event])) + ); + } + + + /** + * Get audiences that meet the visitor properties. + * + * @param array $items Array of associative arrays representing items with rules + * @param array $visitorProperties Associative array of visitor properties + * @param string $entityType Type of entity being filtered (e.g., 'audience') + * @param string $field Identity field to use, defaults to 'id' + * @return array Array of matched items or RuleError instances + */ + public function filterMatchedRecordsWithRule( + array $items, + array $visitorProperties, + string $entityType, + string $field = IdentityField::ID + ): array { + $this->_loggerManager?->trace( + 'DataManager.filterMatchedRecordsWithRule()', + json_encode( + LogUtils::toLoggable(($this->_mapper)([ + 'items' => $items, + 'visitorProperties' => $visitorProperties, + ])) + ) + ); + + $matchedRecords = []; + if (ArrayUtils::arrayNotEmpty($items)) { + foreach ($items as $item) { + if (empty($item['rules'])) { + continue; + } + + $match = $this->_ruleManager->isRuleMatched( + $visitorProperties, + new RuleObject($item['rules']), + StringUtils::camelCase($entityType) . " #{$item[$field]}" + ); + + if ($match === true) { + $matchedRecords[] = $item; + } elseif ($match !== false) { + // Catch rule errors + $matchedRecords[] = $match; + } + } + } + + $this->_loggerManager?->debug( + 'DataManager.filterMatchedRecordsWithRule()', + json_encode(LogUtils::toLoggable(($this->_mapper)([ + 'matchedRecords' => $matchedRecords, + ]))) + ); + + return $matchedRecords; + } + + /** + * Get audiences that meet the custom segments. + * + * @param array $items Array of associative arrays representing items with IDs + * @param string $visitorId The unique identifier of the visitor + * @return array Array of matched items + */ + public function filterMatchedCustomSegments(array $items, string $visitorId): array + { + $this->_loggerManager?->trace( + 'DataManager.filterMatchedCustomSegments()', + json_encode(LogUtils::toLoggable(($this->_mapper)([ + 'items' => $items, + 'visitorId' => $visitorId, + ]))) + ); + + // Get custom segments ID from DataStore + $data = $this->getData($visitorId) ?? []; + $customSegments = $data['segments']['custom_segments'] ?? []; + + $matchedRecords = []; + if (ArrayUtils::arrayNotEmpty($items)) { + foreach ($items as $item) { + if (empty($item['id'])) { + continue; + } + if (in_array($item['id'], $customSegments, true)) { + $matchedRecords[] = $item; + } + } + } + + $this->_loggerManager?->debug( + 'DataManager.filterMatchedCustomSegments()', + json_encode(LogUtils::toLoggable(($this->_mapper)([ + 'matchedRecords' => $matchedRecords, + ]))) + ); + + return $matchedRecords; + } + + /** + * Extract report segments from other attributes in visitor properties. + * + * @param array|null $visitorProperties Optional associative array of visitor properties + * @return array Associative array with 'properties' and 'segments' keys + */ + public function filterReportSegments(?array $visitorProperties = []): array + { + // Define segment keys based on VisitorSegments properties + $segmentsKeys = [ + 'browser', + 'devices', + 'source', + 'campaign', + 'visitor_type', + 'country', + 'custom_segments', + ]; + + $segments = []; + $properties = []; + // Split visitor properties into segments and other properties + foreach ($visitorProperties ?? [] as $key => $value) { + if (in_array($key, $segmentsKeys, true)) { + $segments[$key] = $value; + } else { + $properties[$key] = $value; + } + } + + return [ + 'properties' => !empty($properties) ? $properties : null, + 'segments' => !empty($segments) ? $segments : null, + ]; + } + + /** + * Get list of data entities. + * + * @param string $entityType The type of entity to retrieve + * @return array Array of entities or strings + */ + public function getEntitiesList(string $entityType): array + { + $list = []; + $mappedEntityType = DataEntities::DATA_ENTITIES_MAP[$entityType] ?? $entityType; + if (in_array($mappedEntityType, $this->_dataEntities, true)) { + switch ($mappedEntityType) { + case 'experiences': + $list = $this->_data->getExperiences() ?? []; + break; + case 'audiences': + $list = $this->_data->getAudiences() ?? []; + break; + case 'features': + $list = $this->_data->getFeatures() ?? []; + break; + case 'segments': + $list = $this->_data->getSegments() ?? []; + break; + case 'locations': + $list = $this->_data->getLocations() ?? []; + break; + case 'archived_experiences': + $list = $this->_data->getArchivedExperiences() ?? []; + break; + case 'goals': + $list = $this->_data->getGoals() ?? []; + break; + default: + $list = []; + } + } + + $this->_loggerManager?->trace( + 'DataManager.getEntitiesList()', + json_encode(LogUtils::toLoggable(($this->_mapper)([ + 'entityType' => $mappedEntityType, + 'list' => $list, + ]))) + ); + + return $list; + } + + /** + * Get list of data entities grouped by field. + * + * @param string $entityType The type of entity to retrieve + * @param string $field Identity field to group by, defaults to 'id' + * @return array Associative array with entities keyed by the specified field + */ + public function getEntitiesListObject(string $entityType, string $field = IdentityField::ID): array + { + $entities = $this->getEntitiesList($entityType); + $result = array_reduce($entities, function ($target, $entity) use ($field) { + $target[$entity[$field]] = $entity; + return $target; + }, []); + return $result; + } + + /** + * Retrieve an entity by a specific field value. + * + * @param string $identity Value of the field to match + * @param string $entityType The type of entity to search + * @param string $identityField Field to match against, defaults to 'key' + * @return array|null Entity as an associative array or null if not found + * @private + */ + private function _getEntityByField(string $identity, string $entityType, string $identityField = IdentityField::KEY): ?array + { + $mappedEntityType = DataEntities::DATA_ENTITIES_MAP[$entityType] ?? $entityType; + + $this->_loggerManager?->trace( + 'DataManager._getEntityByField()', + json_encode(LogUtils::toLoggable(($this->_mapper)([ + 'identity' => $identity, + 'entityType' => $mappedEntityType, + 'identityField' => $identityField, + ]))) + ); + $list = $this->getEntitiesList($mappedEntityType); + if (ArrayUtils::arrayNotEmpty($list)) { + foreach ($list as $entity) { + if (!empty($entity) && (string)$entity[$identityField] === (string)$identity) { + return $entity; + } + } + } + + if ($this->_loggerManager) { + $availableKeys = array_map( + fn ($e) => $e[$identityField] ?? 'unknown', + $list + ); + $this->_loggerManager->debug( + 'DataManager._getEntityByField()', + Messages::ENTITY_LOOKUP_FAILED, + LogUtils::toLoggable(($this->_mapper)([ + 'searchedFor' => $identity, + 'entityType' => $mappedEntityType, + 'identityField' => $identityField, + 'availableKeys' => $availableKeys, + ])) + ); + } + + return null; + } + + /** + * Find the entity in list by key. + * + * @param string $key The key value to match + * @param string $entityType The type of entity to search + * @return array|null Entity as an associative array or null if not found + */ + public function getEntity(string $key, string $entityType): ?array + { + return $this->_getEntityByField($key, $entityType, 'key'); + } + + /** + * Find entities in list by keys. + * + * @param string[] $keys Array of key values to match + * @param string $entityType The type of entity to search + * @return array Array of matched entities + */ + public function getEntities(array $keys, string $entityType): array + { + return $this->getItemsByKeys($keys, $entityType); + } + + /** + * Find the entity in list by ID. + * + * @param string $id The ID value to match + * @param string $entityType The type of entity to search + * @return array|null Entity as an associative array or null if not found + */ + public function getEntityById(string $id, string $entityType): ?array + { + return $this->_getEntityByField($id, $entityType, IdentityField::ID); + } + + /** + * Find entities in list by IDs. + * + * @param string[] $ids Array of ID values to match + * @param string $entityType The type of entity to search + * @return array Array of matched entities + */ + public function getEntitiesByIds(array $ids, string $entityType): array + { + return $this->getItemsByIds($ids, $entityType); + } + + /** + * Find items in list by keys. + * + * @param string[] $keys Array of key values to match + * @param string $path The entity type or path to search + * @return array Array of matched items + */ + public function getItemsByKeys(array $keys, string $path): array + { + $list = $this->getEntitiesList($path); + $items = []; + if (ArrayUtils::arrayNotEmpty($list)) { + foreach ($list as $entity) { + if (in_array($entity['key'] ?? '', $keys, true)) { + $items[] = $entity; + } + } + } + return $items; + } + + /** + * Find items in list by IDs. + * + * @param string[] $ids Array of ID values to match + * @param string $path The entity type or path to search + * @return array Array of matched items + */ + public function getItemsByIds(array $ids, string $path): array + { + $this->_loggerManager?->trace( + 'DataManager.getItemsByIds()', + json_encode(LogUtils::toLoggable(($this->_mapper)([ + 'ids' => $ids, + 'path' => $path, + ]))) + ); + + $items = []; + if (ArrayUtils::arrayNotEmpty($ids)) { + $list = $this->getEntitiesList($path); + if (ArrayUtils::arrayNotEmpty($list)) { + foreach ($list as $entity) { + if (in_array($entity['id'] ?? '', $ids, true)) { + $items[] = $entity; + } + } + } + } + + return $items; + } + + /** + * Find nested item. + * + * @param string $entityType The type of parent entity + * @param string $entityIdentity The identity value of the parent entity + * @param string $subEntityType The type of sub-entity to search within + * @param string $subEntityIdentity The identity value of the sub-entity + * @param string $identityField Field to identify the parent entity + * @param string $subIdentityField Field to identify the sub-entity + * @return array|null Sub-entity as an associative array or null if not found + */ + public function getSubItem( + string $entityType, + string $entityIdentity, + string $subEntityType, + string $subEntityIdentity, + string $identityField, + string $subIdentityField + ): ?array { + $entity = $this->_getEntityByField($entityIdentity, $entityType, $identityField); + if ($entity && isset($entity[$subEntityType]) && is_array($entity[$subEntityType])) { + foreach ($entity[$subEntityType] as $subEntity) { + if (($subEntity[$subIdentityField] ?? null) === $subEntityIdentity) { + return $subEntity; + } + } + } + + // Only log at getSubItem level when the parent was found but the sub-entity wasn't. + // When parent is not found, _getEntityByField() already logged the failure. + if ($this->_loggerManager && $entity !== null) { + $this->_loggerManager->debug( + 'DataManager.getSubItem()', + Messages::ENTITY_LOOKUP_FAILED, + LogUtils::toLoggable(($this->_mapper)([ + 'entityType' => $entityType, + 'entityIdentity' => $entityIdentity, + 'subEntityType' => $subEntityType, + 'subEntityIdentity' => $subEntityIdentity, + 'parentFound' => true, + ])) + ); + } + + return null; + } + + /** + * Validates data object. + * + * @param array|null $data Configuration data to validate + * @return bool True if data is valid, false otherwise + */ + public function isValidConfigData(ConfigResponseData $data): bool + { + return ( + (!empty($data->getAccountId()) && !empty($data->getProject()['id'])) || + !empty($data['error']) + ); + } +} diff --git a/packages/Data/src/DataStoreManager.php b/packages/Data/src/DataStoreManager.php new file mode 100644 index 0000000..a3efe15 --- /dev/null +++ b/packages/Data/src/DataStoreManager.php @@ -0,0 +1,117 @@ +loggerManager = $dependencies['loggerManager'] ?? null; + + // Use provided dataStore (invokes setDataStore()) + $this->setDataStore($dependencies['dataStore'] ?? $config->getDataStore()); + } + + /** + * Stores data in the dataStore. + * + * @param string $key + * @param mixed $data + */ + public function set(string $key, mixed $data): void + { + try { + if ($this->dataStore !== null && method_exists($this->dataStore, 'set')) { + $this->dataStore->set($key, $data); + } + } catch (\Exception $error) { + if ($this->loggerManager !== null && method_exists($this->loggerManager, 'error')) { + $this->loggerManager->error('DataStoreManager.set()', ['error' => $error->getMessage()]); + } + } + } + + /** + * Retrieves data from the dataStore. + * + * @param string $key + * @return mixed|null + */ + public function get(string $key): mixed + { + try { + if ($this->dataStore !== null && method_exists($this->dataStore, 'get')) { + return $this->dataStore->get($key); + } + } catch (\Exception $error) { + if ($this->loggerManager !== null && method_exists($this->loggerManager, 'error')) { + $this->loggerManager->error('DataStoreManager.get()', ['error' => $error->getMessage()]); + } + } + return null; + } + + /** + * Sets the dataStore. + * + * @param mixed $dataStore + */ + public function setDataStore(mixed $dataStore): void + { + if ($dataStore) { + if ($this->isValidDataStore($dataStore)) { + $this->dataStore = $dataStore; + } else { + if ($this->loggerManager !== null && method_exists($this->loggerManager, 'error')) { + $this->loggerManager->error( + 'DataStoreManager.dataStore.set()', + ErrorMessages::DATA_STORE_NOT_VALID + ); + } + } + } + } + + /** + * Gets the dataStore. + * + * @return mixed + */ + public function getDataStore(): mixed + { + return $this->dataStore; + } + + /** + * Validates that the provided dataStore has both get and set methods. + * + * @param mixed $dataStore + * @return bool + */ + public function isValidDataStore(mixed $dataStore): bool + { + return is_object($dataStore) && + method_exists($dataStore, 'get') && + method_exists($dataStore, 'set'); + } +} diff --git a/packages/Data/src/Interfaces/DataManagerInterface.php b/packages/Data/src/Interfaces/DataManagerInterface.php new file mode 100644 index 0000000..8d0dcc3 --- /dev/null +++ b/packages/Data/src/Interfaces/DataManagerInterface.php @@ -0,0 +1,246 @@ + [ + 'endpoint' => [ + 'config' => 'http://localhost:8090', + 'track' => 'http://localhost:8090', + ], + ], + 'events' => [ + 'batch_size' => 10, + 'release_interval' => 1000, + ], + ]; + $mergedConfig = ObjectUtils::objectDeepMerge($testConfig, $defaultConfig, $overrides); + $mergedConfig['data'] = new ConfigResponseData($mergedConfig['data']); + if (isset($mergedConfig['sdkKey'])) { + unset($mergedConfig['sdkKey']); + } + $this->config = new Config($mergedConfig); + + $bucketingConfig = $this->config->getBucketing(); + $bucketingManager = new BucketingManager( + maxTraffic: $bucketingConfig['max_traffic'] ?? 10000, + hashSeed: $bucketingConfig['hash_seed'] ?? 9999, + ); + $ruleManager = new RuleManager(); + $eventManager = new EventManager(); + $loggerManager = new LogManager(); + + // Mock ApiManager to avoid PHP 8.4 end() deprecation on objects + $this->apiManagerMock = $this->createMock(ApiManagerInterface::class); + + $this->accountId = $this->config->getData()->getAccountId(); + $project = $this->config->getData() ? $this->config->getData()->getProject() : null; + $this->projectId = $project ? (is_array($project) ? ($project['id'] ?? '') : ($project->getId() ?? '')) : ''; + + $this->dataManager = new DataManager( + $this->config, + $bucketingManager, + $ruleManager, + $eventManager, + $this->apiManagerMock, + $loggerManager, + true + ); + } + + protected function tearDown(): void + { + $this->dataManager->reset(); + } + + /** + * Test 6.1: First trackConversion sends conversion event + */ + public function testFirstConversionEnqueuesEvent(): void + { + $goalKey = 'goal-without-rule'; + + $this->apiManagerMock->expects($this->once()) + ->method('enqueue') + ->with( + $this->equalTo($this->visitorId), + $this->callback(function (VisitorTrackingEvents $event) { + return $event->getEventType() === SystemEvents::Conversion->value + && $event->getData() !== null; + }), + $this->anything() + ); + + $result = $this->dataManager->convert($this->visitorId, $goalKey); + $this->assertTrue($result); + } + + /** + * Test 6.2: Second trackConversion for same visitor+goal is deduplicated + */ + public function testSecondConversionIsDeduplicated(): void + { + $goalKey = 'goal-without-rule'; + + // First call — should enqueue + $this->apiManagerMock->expects($this->once()) + ->method('enqueue'); + + $result1 = $this->dataManager->convert($this->visitorId, $goalKey); + $this->assertTrue($result1); + + // Second call — should be deduplicated (enqueue not called again) + $result2 = $this->dataManager->convert($this->visitorId, $goalKey); + $this->assertTrue($result2); // Returns true (deduped, not an error) + } + + /** + * Test 6.3: trackConversion with non-existent goal returns false + */ + public function testNonExistentGoalReturnsFalse(): void + { + $this->apiManagerMock->expects($this->never()) + ->method('enqueue'); + + $result = $this->dataManager->convert($this->visitorId, 'nonexistent-goal-key'); + $this->assertFalse($result); + } + + /** + * Test 6.4: trackConversion with goalData sends BOTH conversion AND transaction events + */ + public function testConversionWithGoalDataSendsBothEvents(): void + { + $goalKey = 'goal-without-rule'; + $goalData = [['key' => 'amount', 'value' => 10.5]]; + + $this->apiManagerMock->expects($this->exactly(2)) + ->method('enqueue'); + + $result = $this->dataManager->convert( + $this->visitorId, + $goalKey, + null, + $goalData + ); + $this->assertTrue($result); + } + + /** + * Test 6.5: Conversion event includes bucketingData from visitor's active experiments + */ + public function testConversionIncludesBucketingData(): void + { + $goalKey = 'goal-without-rule'; + $bucketingData = ['exp1' => 'var1', 'exp2' => 'var2']; + + // Pre-populate bucketing data for the visitor + $this->dataManager->putData($this->visitorId, ['bucketing' => $bucketingData]); + + $capturedData = null; + $this->apiManagerMock->expects($this->once()) + ->method('enqueue') + ->with( + $this->equalTo($this->visitorId), + $this->callback(function (VisitorTrackingEvents $event) use (&$capturedData) { + $capturedData = $event->getData(); + return true; + }), + $this->anything() + ); + + $result = $this->dataManager->convert($this->visitorId, $goalKey); + $this->assertTrue($result); + $this->assertNotNull($capturedData); + $this->assertIsArray($capturedData); + $this->assertArrayHasKey('bucketingData', $capturedData); + $this->assertEquals($bucketingData, $capturedData['bucketingData']); + } + + /** + * Test 6.6: Dedup storage key uses {accountId}-{projectId}-{visitorId} format + */ + public function testDedupStorageKeyFormat(): void + { + $expectedKey = "{$this->accountId}-{$this->projectId}-{$this->visitorId}"; + $actualKey = $this->dataManager->getStoreKey($this->visitorId); + $this->assertEquals($expectedKey, $actualKey); + } + + /** + * Test 6.7: SystemEvents::Conversion event fires on successful tracking + * (Verified via the event type in the enqueued payload) + */ + public function testConversionEventType(): void + { + $goalKey = 'goal-without-rule'; + + $capturedEventType = null; + $this->apiManagerMock->expects($this->once()) + ->method('enqueue') + ->with( + $this->anything(), + $this->callback(function (VisitorTrackingEvents $event) use (&$capturedEventType) { + $capturedEventType = $event->getEventType(); + return true; + }), + $this->anything() + ); + + $this->dataManager->convert($this->visitorId, $goalKey); + $this->assertNotNull($capturedEventType); + $this->assertEquals(SystemEvents::Conversion->value, $capturedEventType); + } + + /** + * Test 6.8: Goal with rules validates ruleData via RuleManager + */ + public function testGoalWithRulesValidatesRuleData(): void + { + $goalKey = 'increase-engagement'; + + // Matching rule — should succeed + $this->apiManagerMock->expects($this->once()) + ->method('enqueue'); + + $result = $this->dataManager->convert( + $this->visitorId, + $goalKey, + ['action' => 'buy'] + ); + $this->assertTrue($result); + } + + /** + * Test: Goal with rules rejects mismatched ruleData + */ + public function testGoalWithRulesRejectsMismatchedData(): void + { + $goalKey = 'increase-engagement'; + + $this->apiManagerMock->expects($this->never()) + ->method('enqueue'); + + $result = $this->dataManager->convert( + $this->visitorId, + $goalKey, + ['action' => 'sell'] + ); + $this->assertFalse($result); + } + + /** + * Test: putData stores goals correctly and getData retrieves them + */ + public function testPutDataStoresGoals(): void + { + $this->dataManager->putData($this->visitorId, ['goals' => ['goal1' => true]]); + $data = $this->dataManager->getData($this->visitorId); + $this->assertNotNull($data); + $this->assertTrue($data['goals']['goal1']); + } + + /** + * Test: Different visitors have independent deduplication + */ + public function testDifferentVisitorsIndependentDedup(): void + { + $goalKey = 'goal-without-rule'; + $visitor2 = 'dedup-test-visitor-2'; + + // Both visitors should trigger conversion (2 enqueue calls) + $this->apiManagerMock->expects($this->exactly(2)) + ->method('enqueue'); + + $result1 = $this->dataManager->convert($this->visitorId, $goalKey); + $result2 = $this->dataManager->convert($visitor2, $goalKey); + $this->assertTrue($result1); + $this->assertTrue($result2); + } + + /** + * Test: forceMultipleTransactions allows repeat transaction events + */ + public function testForceMultipleTransactionsAllowsRepeat(): void + { + $goalKey = 'goal-without-rule'; + $goalData = [['key' => 'amount', 'value' => 20.0]]; + $conversionSetting = ['forceMultipleTransactions' => true]; + + // First call: 1 conversion + 1 transaction = 2 enqueue calls + // Second call with force: 1 transaction = 1 enqueue call + // Total: 3 enqueue calls + $this->apiManagerMock->expects($this->exactly(3)) + ->method('enqueue'); + + $result1 = $this->dataManager->convert( + $this->visitorId, + $goalKey, + null, + $goalData, + null, + $conversionSetting + ); + $this->assertTrue($result1); + + $result2 = $this->dataManager->convert( + $this->visitorId, + $goalKey, + null, + $goalData, + null, + $conversionSetting + ); + $this->assertTrue($result2); + } + + /** + * Test: Repeat trigger without force and no goalData sends nothing + */ + public function testRepeatTriggerWithoutForceSendsNothing(): void + { + $goalKey = 'goal-without-rule'; + + // First call triggers 1 enqueue + $this->apiManagerMock->expects($this->once()) + ->method('enqueue'); + + $this->dataManager->convert($this->visitorId, $goalKey); + + // Second call — deduplicated, no enqueue + $result = $this->dataManager->convert($this->visitorId, $goalKey); + $this->assertTrue($result); + } +} diff --git a/packages/Data/tests/DataManagerCoverageTest.php b/packages/Data/tests/DataManagerCoverageTest.php new file mode 100644 index 0000000..fb38d00 --- /dev/null +++ b/packages/Data/tests/DataManagerCoverageTest.php @@ -0,0 +1,346 @@ +data[$key] ?? null) : $this->data; + } + + public function set($key, $value): void + { + if (!$key) { + throw new \Exception('Invalid DataStore key!'); + } + $this->data[$key] = $value; + } + + public function enqueue($key, $value): void + { + $this->data[$key] = $value; + } +} + +/** + * Tests for DataManager methods with zero/low coverage: + * selectLocations, filterMatchedCustomSegments, setDataStoreManager, getDataStoreManager + */ +class DataManagerCoverageTest extends TestCase +{ + private Config $config; + private BucketingManager $bucketingManager; + private RuleManager $ruleManager; + private EventManager $eventManager; + private ApiManager $apiManager; + private LogManager $loggerManager; + private DataManager $dataManager; + private string $visitorId = 'test-visitor-coverage'; + + protected function setUp(): void + { + $testConfig = json_decode(file_get_contents(__DIR__ . '/test-config.json'), true); + $defaultConfig = DefaultConfig::getDefault(); + $overrides = [ + 'api' => [ + 'endpoint' => [ + 'config' => 'http://127.0.0.1:9501', + 'track' => 'http://127.0.0.1:9501', + ], + ], + 'events' => [ + 'batch_size' => 10, + 'release_interval' => 1000, + ], + ]; + $mergedConfig = ObjectUtils::objectDeepMerge($testConfig, $defaultConfig, $overrides); + $mergedConfig['data'] = new ConfigResponseData($mergedConfig['data']); + if (isset($mergedConfig['sdkKey'])) { + unset($mergedConfig['sdkKey']); + } + $this->config = new Config($mergedConfig); + + $mockHttpClient = new MockHttpClient(); + $psr17Factory = new Psr17Factory(); + + $bucketingConfig = $this->config->getBucketing(); + $this->bucketingManager = new BucketingManager( + maxTraffic: $bucketingConfig['max_traffic'] ?? 10000, + hashSeed: $bucketingConfig['hash_seed'] ?? 9999, + ); + $this->ruleManager = new RuleManager(); + $this->eventManager = new EventManager(); + $this->apiManager = new ApiManager( + $this->config, + $this->eventManager, + null, + $mockHttpClient, + $psr17Factory, + $psr17Factory + ); + $this->loggerManager = new LogManager(); + + $this->dataManager = new DataManager( + $this->config, + $this->bucketingManager, + $this->ruleManager, + $this->eventManager, + $this->apiManager, + $this->loggerManager, + true + ); + } + + protected function tearDown(): void + { + $this->dataManager->reset(); + } + + // ---- selectLocations tests ---- + + public function testSelectLocationsShouldMatchLocationByUrlRule(): void + { + $items = [ + [ + 'id' => 'loc-1', + 'key' => 'homepage', + 'name' => 'Homepage', + 'rules' => [ + 'OR' => [ + ['AND' => [ + ['OR_WHEN' => [ + [ + 'rule_type' => 'generic_key_value', + 'matching' => ['match_type' => 'matches', 'negated' => false], + 'key' => 'url', + 'value' => 'https://convert.com/', + ], + ]], + ]], + ], + ], + ], + ]; + + $attributes = new LocationAttributes([ + 'locationProperties' => ['url' => 'https://convert.com/'], + ]); + + $result = $this->dataManager->selectLocations($this->visitorId, $items, $attributes); + $this->assertIsArray($result); + $this->assertCount(1, $result); + $this->assertSame('homepage', $result[0]['key']); + } + + public function testSelectLocationsShouldDeactivateLocationOnMismatch(): void + { + // First, activate a location + $items = [ + [ + 'id' => 'loc-1', + 'key' => 'homepage', + 'name' => 'Homepage', + 'rules' => [ + 'OR' => [ + ['AND' => [ + ['OR_WHEN' => [ + [ + 'rule_type' => 'generic_key_value', + 'matching' => ['match_type' => 'matches', 'negated' => false], + 'key' => 'url', + 'value' => 'https://convert.com/', + ], + ]], + ]], + ], + ], + ], + ]; + + $attributes = new LocationAttributes([ + 'locationProperties' => ['url' => 'https://convert.com/'], + ]); + + // Activate the location first + $this->dataManager->selectLocations($this->visitorId, $items, $attributes); + + // Now with non-matching URL, it should deactivate + $deactivatedFired = false; + $this->eventManager->on(SystemEvents::LocationDeactivated, function () use (&$deactivatedFired) { + $deactivatedFired = true; + }); + + $attributes2 = new LocationAttributes([ + 'locationProperties' => ['url' => 'https://other.com/'], + ]); + + $result = $this->dataManager->selectLocations($this->visitorId, $items, $attributes2); + $this->assertIsArray($result); + $this->assertCount(0, $result); + $this->assertTrue($deactivatedFired); + } + + public function testSelectLocationsShouldReturnEmptyForEmptyItems(): void + { + $attributes = new LocationAttributes([ + 'locationProperties' => ['url' => 'https://convert.com/'], + ]); + + $result = $this->dataManager->selectLocations($this->visitorId, [], $attributes); + $this->assertIsArray($result); + $this->assertEmpty($result); + } + + public function testSelectLocationsShouldSkipItemsWithNoRules(): void + { + $items = [ + ['id' => 'loc-1', 'key' => 'no-rules', 'name' => 'No Rules'], + ]; + + $attributes = new LocationAttributes([ + 'locationProperties' => ['url' => 'https://convert.com/'], + ]); + + $result = $this->dataManager->selectLocations($this->visitorId, $items, $attributes); + $this->assertIsArray($result); + $this->assertEmpty($result); + } + + public function testSelectLocationsShouldFireActivatedOnForceEvent(): void + { + $activatedFired = false; + $this->eventManager->on(SystemEvents::LocationActivated, function () use (&$activatedFired) { + $activatedFired = true; + }); + + $items = [ + [ + 'id' => 'loc-1', + 'key' => 'homepage', + 'name' => 'Homepage', + 'rules' => [ + 'OR' => [ + ['AND' => [ + ['OR_WHEN' => [ + [ + 'rule_type' => 'generic_key_value', + 'matching' => ['match_type' => 'matches', 'negated' => false], + 'key' => 'url', + 'value' => 'https://convert.com/', + ], + ]], + ]], + ], + ], + ], + ]; + + $attributes = new LocationAttributes([ + 'locationProperties' => ['url' => 'https://convert.com/'], + 'forceEvent' => true, + ]); + + $this->dataManager->selectLocations($this->visitorId, $items, $attributes); + $this->assertTrue($activatedFired); + } + + // ---- filterMatchedCustomSegments tests ---- + + public function testFilterMatchedCustomSegmentsShouldReturnMatchingSegments(): void + { + // Store custom segments for the visitor + $this->dataManager->putData($this->visitorId, [ + 'segments' => [ + 'custom_segments' => ['seg-100', 'seg-200'], + ], + ]); + + $items = [ + ['id' => 'seg-100', 'name' => 'Segment A'], + ['id' => 'seg-300', 'name' => 'Segment C'], + ['id' => 'seg-200', 'name' => 'Segment B'], + ]; + + $result = $this->dataManager->filterMatchedCustomSegments($items, $this->visitorId); + $this->assertCount(2, $result); + $this->assertSame('seg-100', $result[0]['id']); + $this->assertSame('seg-200', $result[1]['id']); + } + + public function testFilterMatchedCustomSegmentsShouldReturnEmptyForNoSegments(): void + { + $items = [ + ['id' => 'seg-100', 'name' => 'Segment A'], + ]; + + $result = $this->dataManager->filterMatchedCustomSegments($items, $this->visitorId); + $this->assertEmpty($result); + } + + public function testFilterMatchedCustomSegmentsShouldSkipItemsWithNoId(): void + { + $this->dataManager->putData($this->visitorId, [ + 'segments' => ['custom_segments' => ['seg-100']], + ]); + + $items = [ + ['name' => 'No ID item'], + ['id' => 'seg-100', 'name' => 'With ID'], + ]; + + $result = $this->dataManager->filterMatchedCustomSegments($items, $this->visitorId); + $this->assertCount(1, $result); + } + + public function testFilterMatchedCustomSegmentsShouldReturnEmptyForEmptyItems(): void + { + $result = $this->dataManager->filterMatchedCustomSegments([], $this->visitorId); + $this->assertEmpty($result); + } + + // ---- setDataStoreManager / getDataStoreManager tests ---- + + public function testSetDataStoreManagerShouldCreateDataStoreManager(): void + { + $dataStore = new DataManagerCoverageDataStoreMock(); + $this->dataManager->setDataStoreManager($dataStore); + $this->assertNotNull($this->dataManager->getDataStoreManager()); + } + + public function testSetDataStoreManagerWithNullShouldClearManager(): void + { + $this->dataManager->setDataStoreManager(null); + $this->assertNull($this->dataManager->getDataStoreManager()); + } + + public function testGetDataStoreManagerShouldReturnNullByDefault(): void + { + // DataManager created without dataStore + $this->assertNull($this->dataManager->getDataStoreManager()); + } +} diff --git a/packages/Data/tests/DataManagerLoggingTest.php b/packages/Data/tests/DataManagerLoggingTest.php new file mode 100644 index 0000000..6aa5452 --- /dev/null +++ b/packages/Data/tests/DataManagerLoggingTest.php @@ -0,0 +1,191 @@ +> Captured debug() call arguments */ + private array $debugCalls = []; + + protected function setUp(): void + { + $this->debugCalls = []; + $this->logManager = $this->createMock(LogManagerInterface::class); + + // Capture all debug calls with their arguments + $this->logManager + ->method('debug') + ->willReturnCallback(function () { + $this->debugCalls[] = func_get_args(); + }); + + $configData = new ConfigResponseData([ + 'account_id' => 'test-account', + 'project' => ['id' => 'test-project'], + 'experiences' => [ + ['id' => '100', 'key' => 'exp-alpha', 'name' => 'Alpha Test', 'variations' => []], + ['id' => '200', 'key' => 'exp-beta', 'name' => 'Beta Test', 'variations' => []], + ], + 'features' => [ + ['id' => '300', 'key' => 'feat-dark-mode', 'name' => 'Dark Mode'], + ], + 'goals' => [], + 'audiences' => [], + 'locations' => [], + 'segments' => [], + 'archived_experiences' => [], + ]); + + $config = new Config([ + 'environment' => 'staging', + 'data' => $configData, + ]); + + $this->dataManager = new DataManager( + $config, + $this->createMock(BucketingManagerInterface::class), + $this->createMock(RuleManagerInterface::class), + $this->createMock(EventManagerInterface::class), + $this->createMock(ApiManagerInterface::class), + $this->logManager, + false + ); + } + + private function findDebugCallsForMethod(string $methodName, string $message): array + { + return array_values(array_filter($this->debugCalls, function (array $call) use ($methodName, $message) { + return ($call[0] ?? null) === $methodName && ($call[1] ?? null) === $message; + })); + } + + public function testGetEntityLogsDebugWhenEntityNotFound(): void + { + $result = $this->dataManager->getEntity('nonexistent-key', 'experiences'); + + $this->assertNull($result); + + $calls = $this->findDebugCallsForMethod('DataManager._getEntityByField()', Messages::ENTITY_LOOKUP_FAILED); + $this->assertNotEmpty($calls, 'Expected debug log for entity not found'); + + // Third argument is the mapper output (identity function returns array as-is) + $context = $calls[0][2]; + $this->assertIsArray($context); + $this->assertSame('nonexistent-key', $context['searchedFor']); + $this->assertSame('experiences', $context['entityType']); + $this->assertSame('key', $context['identityField']); + $this->assertIsArray($context['availableKeys']); + $this->assertCount(2, $context['availableKeys']); + $this->assertContains('exp-alpha', $context['availableKeys']); + $this->assertContains('exp-beta', $context['availableKeys']); + } + + public function testGetEntityByIdLogsDebugWhenEntityNotFound(): void + { + $result = $this->dataManager->getEntityById('999', 'experiences'); + + $this->assertNull($result); + + $calls = $this->findDebugCallsForMethod('DataManager._getEntityByField()', Messages::ENTITY_LOOKUP_FAILED); + $this->assertNotEmpty($calls, 'Expected debug log for entity not found by ID'); + + $context = $calls[0][2]; + $this->assertSame('999', $context['searchedFor']); + $this->assertSame('id', $context['identityField']); + // When searching by ID, availableKeys contains IDs + $this->assertContains('100', $context['availableKeys']); + $this->assertContains('200', $context['availableKeys']); + } + + public function testGetSubItemLogsDebugWhenSubEntityNotFound(): void + { + // Experience 'exp-alpha' exists but variation 'nonexistent-var' does not + $result = $this->dataManager->getSubItem( + 'experiences', + 'exp-alpha', + 'variations', + 'nonexistent-var', + 'key', + 'key' + ); + + $this->assertNull($result); + + $calls = $this->findDebugCallsForMethod('DataManager.getSubItem()', Messages::ENTITY_LOOKUP_FAILED); + $this->assertNotEmpty($calls, 'Expected debug log for sub-item not found'); + + $context = $calls[0][2]; + $this->assertIsArray($context); + $this->assertSame('experiences', $context['entityType']); + $this->assertSame('exp-alpha', $context['entityIdentity']); + $this->assertSame('variations', $context['subEntityType']); + $this->assertSame('nonexistent-var', $context['subEntityIdentity']); + $this->assertTrue($context['parentFound']); + } + + public function testGetSubItemDoesNotDoubleLogWhenParentMissing(): void + { + $result = $this->dataManager->getSubItem( + 'experiences', + 'nonexistent-exp', + 'variations', + 'var-1', + 'key', + 'key' + ); + + $this->assertNull($result); + + // getSubItem should NOT log when parent is missing — _getEntityByField already logged it + $subItemCalls = $this->findDebugCallsForMethod('DataManager.getSubItem()', Messages::ENTITY_LOOKUP_FAILED); + $this->assertEmpty($subItemCalls, 'getSubItem should NOT double-log when parent not found'); + + // But _getEntityByField SHOULD have logged + $entityCalls = $this->findDebugCallsForMethod('DataManager._getEntityByField()', Messages::ENTITY_LOOKUP_FAILED); + $this->assertNotEmpty($entityCalls, '_getEntityByField should log parent not found'); + } + + public function testGetEntityDoesNotLogEntityNotFoundWhenEntityExists(): void + { + $result = $this->dataManager->getEntity('exp-alpha', 'experiences'); + + $this->assertNotNull($result); + + $calls = $this->findDebugCallsForMethod('DataManager._getEntityByField()', Messages::ENTITY_LOOKUP_FAILED); + $this->assertEmpty($calls, 'Should NOT log entity not found when entity exists'); + } + + public function testEntityNotFoundLogIncludesCorrectEntityType(): void + { + $result = $this->dataManager->getEntity('nonexistent', 'features'); + + $this->assertNull($result); + + $calls = $this->findDebugCallsForMethod('DataManager._getEntityByField()', Messages::ENTITY_LOOKUP_FAILED); + $this->assertNotEmpty($calls); + + $context = $calls[0][2]; + $this->assertSame('features', $context['entityType']); + $this->assertContains('feat-dark-mode', $context['availableKeys']); + } +} diff --git a/packages/Data/tests/DataManagerTest.php b/packages/Data/tests/DataManagerTest.php new file mode 100644 index 0000000..98c894d --- /dev/null +++ b/packages/Data/tests/DataManagerTest.php @@ -0,0 +1,724 @@ +data[$key] ?? null) : $this->data; + } + + public function set($key, $value) + { + if (!$key) { + throw new \Exception('Invalid DataStore key!'); + } + $this->data[$key] = $value; + } + + public function enqueue($key, $value) + { + $this->data[$key] = $value; + } + + public function reset() + { + $this->data = []; + } +} + +class DataManagerTest extends TestCase +{ + private const HOST = 'http://localhost'; + private const PORT = 8090; + private const RELEASE_TIMEOUT = 1000; // milliseconds + private const TEST_TIMEOUT = self::RELEASE_TIMEOUT + 100; // Adjusted for PHPUnit + private const BATCH_SIZE = 10; + + private $config; + private $bucketingManager; + private $ruleManager; + private $eventManager; + private $apiManager; + private $loggerManager; + private $dataStoreMock; + private $dataManager; + private $accountId; + private $projectId; + private $storeKey; + private MockHttpClient $mockHttpClient; + private Psr17Factory $psr17Factory; + + private $visitorId = 'test-visitor-123'; + private $bucketing = ['exp1' => 'var1', 'exp2' => 'var2']; + private $goals = ['goal1' => true, 'goal2' => true]; + private $segments = [ + 'browser' => 'CH', + 'devices' => 'ALLPH', + 'source' => 'test', + 'campaign' => 'test', + 'visitor_type' => 'new', + 'country' => 'US', + 'custom_segments' => ['seg1', 'seg2'], + ]; + + protected function setUp(): void + { + $testConfig = json_decode(file_get_contents(__DIR__ . '/test-config.json'), true); + $defaultConfig = DefaultConfig::getDefault(); + $overrides = [ + 'api' => [ + 'endpoint' => [ + 'config' => self::HOST . ':' . self::PORT, + 'track' => self::HOST . ':' . self::PORT, + ], + ], + 'events' => [ + 'batch_size' => self::BATCH_SIZE, + 'release_interval' => self::RELEASE_TIMEOUT, + ], + ]; + $mergedConfig = ObjectUtils::objectDeepMerge($testConfig, $defaultConfig, $overrides); + $mergedConfig['data'] = new ConfigResponseData($mergedConfig['data']); + if (isset($mergedConfig['sdkKey'])) { + unset($mergedConfig['sdkKey']); + } + $this->config = new Config($mergedConfig); + + // Set up PSR-18 mock HTTP client + $this->mockHttpClient = new MockHttpClient(); + $this->psr17Factory = new Psr17Factory(); + + $bucketingConfig = $this->config->getBucketing(); + $this->bucketingManager = new BucketingManager( + maxTraffic: $bucketingConfig['max_traffic'] ?? 10000, + hashSeed: $bucketingConfig['hash_seed'] ?? 9999, + ); + $this->ruleManager = new RuleManager(); + $this->eventManager = new EventManager(); + $this->apiManager = new ApiManager( + $this->config, + $this->eventManager, + null, + $this->mockHttpClient, + $this->psr17Factory, + $this->psr17Factory + ); + + $this->loggerManager = new LogManager(); + $this->dataStoreMock = new DataStoreMock(); + + $this->accountId = $this->config->getData()->getAccountId(); + $project = $this->config->getData() ? $this->config->getData()->getProject() : null; + $this->projectId = $project ? (is_array($project) ? ($project['id'] ?? '') : ($project->getId() ?? '')) : ''; + $this->storeKey = "{$this->accountId}-{$this->projectId}-{$this->visitorId}"; + + $this->dataManager = new DataManager( + $this->config, + $this->bucketingManager, + $this->ruleManager, + $this->eventManager, + $this->apiManager, + $this->loggerManager, + true + ); + } + + protected function tearDown(): void + { + $this->dataManager->reset(); + $this->dataStoreMock->reset(); + } + + public function testDataManagerIsDefined(): void + { + $this->assertTrue(class_exists(DataManager::class)); + } + + public function testDataManagerIsConstructor(): void + { + $reflection = new \ReflectionClass(DataManager::class); + $this->assertTrue($reflection->isInstantiable()); + $this->assertEquals('DataManager', $reflection->getShortName()); + } + + public function testSuccessfullyCreateDataManager(): void + { + $this->assertInstanceOf(DataManager::class, $this->dataManager); + $reflection = new \ReflectionClass($this->dataManager); + $this->assertEquals('DataManager', $reflection->getShortName()); + } + + public function testValidateConfiguration(): void + { + $configData = $this->config->getData(); + $this->assertTrue($this->dataManager->isValidConfigData($configData)); // Pass object, not array + } + + public function testRetrieveVariationByKey(): void + { + $experienceKey = 'test-experience-ab-fullstack-2'; + // Add mock response for any potential API calls + $this->mockHttpClient->addResponse(new Response(200, [], json_encode(['data' => []]))); + + $variation = $this->dataManager->getBucketing( + $this->visitorId, + $experienceKey, + new BucketingAttributes([ + 'visitorProperties' => ['varName3' => 'something'], + 'locationProperties' => ['url' => 'https://convert.com/'], + ]) + ); + + $this->assertNotNull($variation); // Adjust based on actual behavior + if (is_array($variation)) { + $this->assertArrayHasKey('experienceKey', $variation); + $this->assertEquals($experienceKey, $variation['experienceKey']); + } else { + $this->assertEquals(BucketingError::VariationNotDecided, $variation); // Handle error case + } + } + + public function testRetrieveVariationById(): void + { + $experienceId = '100218245'; + $this->mockHttpClient->addResponse(new Response(200, [], json_encode(['data' => []]))); + $variation = $this->dataManager->getBucketingById( + $this->visitorId, + $experienceId, + new BucketingAttributes([ + 'visitorProperties' => ['varName3' => 'something'], + 'locationProperties' => ['url' => 'https://convert.com/'], + ]) + ); + + $this->assertNotNull($variation); + if (is_array($variation)) { + $this->assertArrayHasKey('experienceId', $variation); + $this->assertEquals($experienceId, $variation['experienceId']); + } else { + $this->assertEquals(BucketingError::VariationNotDecided, $variation); + } + } + + public function testGetEntitiesListObject(): void + { + $audiences = $this->dataManager->getEntitiesListObject('audiences'); + $configData = $this->config->getData(); + $audienceList = $configData->getAudiences(); + + $this->assertNotEmpty($audienceList, 'Audiences should not be empty'); + $expectedId = $audienceList[0]['id']; + + $this->assertIsArray($audiences); + $this->assertArrayHasKey($expectedId, $audiences); + $this->assertEquals($audienceList[0], $audiences[$expectedId]); + } + + public function testGetEntitiesByKeys(): void + { + $keys = ['feature-1', 'feature-2']; + $entities = $this->dataManager->getEntities($keys, 'features'); + $expected = array_filter($this->config->getData()['features'] ?? [], fn ($f) => in_array($f['key'], $keys, true)); + $this->assertEquals($expected, $entities); + } + + public function testGetEntitiesByIds(): void + { + $ids = ['10024', '10025']; + $entities = $this->dataManager->getEntitiesByIds($ids, 'features'); + $expected = array_filter($this->config->getData()['features'] ?? [], fn ($f) => in_array($f['id'], $ids, true)); + $this->assertEquals($expected, $entities); + } + + public function testProcessConversionEvent(): void + { + $goalKey = 'increase-engagement'; + $this->mockHttpClient->addResponse( + new Response(200, [], json_encode(['data' => []])) + ); + $this->mockHttpClient->addResponse( + new Response(200, [], json_encode(['data' => []])) + ); + $result = $this->dataManager->convert( + $this->visitorId, + $goalKey, + ['action' => 'buy'], + [['key' => 'amount', 'value' => 10.4], ['key' => 'productsCount', 'value' => 3]] + ); + $this->assertTrue($result); + } + + public function testFailInvalidGoal(): void + { + $result = $this->dataManager->convert($this->visitorId, 'invalid-goal'); + $this->assertFalse($result); + } + + public function testFailMismatchedRule(): void + { + $result = $this->dataManager->convert($this->visitorId, 'increase-engagement', ['action' => 'sell']); + $this->assertFalse($result); // Depends on real RuleManager behavior + } + + public function testFailNoRule(): void + { + $result = $this->dataManager->convert($this->visitorId, 'goal-without-rule', ['action' => 'buy']); + $this->assertFalse($result); // Depends on real RuleManager behavior + } + + public function testFailRetrieveVariationNotExists(): void + { + $variation = $this->dataManager->getBucketing( + $this->visitorId, + 'test-experience-ab-fullstack-4', + new BucketingAttributes([ + 'visitorProperties' => ['varName3' => 'something'], + 'locationProperties' => ['url' => 'https://convert.com/'], + ]) + ); + $this->assertEquals(BucketingError::VariationNotDecided, $variation); + } + + public function testLocalStoreSizeLimit(): void + { + for ($i = 0; $i < 10001; $i++) { + $this->dataManager->putData("a{$i}", ['test' => $i]); + } + $this->assertTrue(true); // Ensures no exception is thrown + } + + #[Group('persistent_enqueue')] + public function testDataStoreEnqueueBucketing(): void + { + $this->dataManager->setDataStore($this->dataStoreMock); + $this->dataManager->putData($this->visitorId, ['bucketing' => $this->bucketing]); + usleep((int) ((self::RELEASE_TIMEOUT + 1) * 1000)); + $check = $this->dataManager->getDataStoreManager()->get($this->storeKey); + $this->assertEquals($this->bucketing, $check['bucketing']); + } + + #[Group('persistent_enqueue')] + public function testDataStoreEnqueueGoals(): void + { + $this->dataManager->setDataStore($this->dataStoreMock); + $this->dataManager->putData($this->visitorId, ['bucketing' => $this->bucketing]); + $this->dataManager->putData($this->visitorId, ['goals' => $this->goals]); + usleep((int) ((self::RELEASE_TIMEOUT + 1) * 1000)); + $check = $this->dataStoreMock->get($this->storeKey); + $this->assertEquals($this->bucketing, $check['bucketing']); + $this->assertEquals($this->goals, $check['goals']); + } + + #[Group('persistent_enqueue')] + public function testDataStoreEnqueueSegments(): void + { + $this->dataManager->setDataStore($this->dataStoreMock); + $this->dataManager->putData($this->visitorId, ['bucketing' => $this->bucketing]); + $this->dataManager->putData($this->visitorId, ['goals' => $this->goals]); + $this->dataManager->putData($this->visitorId, ['segments' => $this->segments]); + usleep((int) ((self::RELEASE_TIMEOUT + 1) * 1000)); + $check = $this->dataStoreMock->get($this->storeKey); + $this->assertEquals($this->bucketing, $check['bucketing']); + $this->assertEquals($this->goals, $check['goals']); + } + + #[Group('persistent_enqueue')] + public function testDataStoreEnqueueShape(): void + { + $this->dataManager->setDataStore($this->dataStoreMock); + $this->dataManager->putData($this->visitorId, ['bucketing' => $this->bucketing]); + $this->dataManager->putData($this->visitorId, ['goals' => $this->goals]); + $this->dataManager->putData($this->visitorId, ['segments' => $this->segments]); + usleep((int) ((self::RELEASE_TIMEOUT + 1) * 1000)); + $check = $this->dataStoreMock->get($this->storeKey); + $this->assertIsArray($check); + $this->assertEquals($this->bucketing, $check['bucketing']); + $this->assertEquals($this->goals, $check['goals']); + } + + #[Group('persistent_set')] + public function testDataStoreSetImmediatelyBucketing(): void + { + $this->dataManager = new DataManager( + $this->config, + $this->bucketingManager, + $this->ruleManager, + $this->eventManager, + $this->apiManager, + $this->loggerManager, + false + ); + $this->dataManager->setDataStore($this->dataStoreMock); + $this->dataManager->putData($this->visitorId, ['bucketing' => $this->bucketing]); + $check = $this->dataStoreMock->get($this->storeKey); + $this->assertEquals($this->bucketing, $check['bucketing']); + } + + #[Group('persistent_set')] + public function testDataStoreSetImmediatelyGoals(): void + { + $this->dataManager = new DataManager( + $this->config, + $this->bucketingManager, + $this->ruleManager, + $this->eventManager, + $this->apiManager, + $this->loggerManager, + false + ); + $this->dataManager->setDataStore($this->dataStoreMock); + $this->dataManager->putData($this->visitorId, ['bucketing' => $this->bucketing]); + $this->dataManager->putData($this->visitorId, ['goals' => $this->goals]); + $check = $this->dataStoreMock->get($this->storeKey); + $this->assertEquals($this->bucketing, $check['bucketing']); + $this->assertEquals($this->goals, $check['goals']); + } + + #[Group('persistent_set')] + public function testDataStoreSetImmediatelySegments(): void + { + $this->dataManager = new DataManager( + $this->config, + $this->bucketingManager, + $this->ruleManager, + $this->eventManager, + $this->apiManager, + $this->loggerManager, + false + ); + $this->dataManager->setDataStore($this->dataStoreMock); + $this->dataManager->putData($this->visitorId, ['bucketing' => $this->bucketing]); + $this->dataManager->putData($this->visitorId, ['goals' => $this->goals]); + $this->dataManager->putData($this->visitorId, ['segments' => $this->segments]); + $check = $this->dataStoreMock->get($this->storeKey); + $this->assertEquals($this->bucketing, $check['bucketing']); + $this->assertEquals($this->goals, $check['goals']); + } + + #[Group('persistent_set')] + public function testDataStoreSetImmediatelyShape(): void + { + $this->dataManager = new DataManager( + $this->config, + $this->bucketingManager, + $this->ruleManager, + $this->eventManager, + $this->apiManager, + $this->loggerManager, + false + ); + $this->dataManager->setDataStore($this->dataStoreMock); + $this->dataManager->putData($this->visitorId, ['bucketing' => $this->bucketing]); + $this->dataManager->putData($this->visitorId, ['goals' => $this->goals]); + $this->dataManager->putData($this->visitorId, ['segments' => $this->segments]); + $check = $this->dataStoreMock->get($this->storeKey); + $this->assertIsArray($check); + $this->assertEquals($this->bucketing, $check['bucketing']); + $this->assertEquals($this->goals, $check['goals']); + } + + public function testDataManagerIsFinal(): void + { + $reflection = new \ReflectionClass(DataManager::class); + $this->assertTrue($reflection->isFinal()); + } + + public function testGetEntityReturnsNullForNonexistentKey(): void + { + $result = $this->dataManager->getEntity('nonexistent-key', 'experience'); + $this->assertNull($result); + } + + public function testGetEntityByIdReturnsNullForNonexistentId(): void + { + $result = $this->dataManager->getEntityById('999999999', 'experience'); + $this->assertNull($result); + } + + public function testGetEntityReturnsEntityForValidKey(): void + { + $result = $this->dataManager->getEntity('adv-audience', 'audience'); + $this->assertNotNull($result); + $this->assertIsArray($result); + $this->assertEquals('adv-audience', $result['key']); + } + + public function testSetConfigDataBuildsEntityIndices(): void + { + $configData = $this->config->getData(); + $this->dataManager->setConfigData($configData); + + // Verify entities are accessible after setConfigData + $audiences = $this->dataManager->getEntitiesList('audiences'); + $this->assertIsArray($audiences); + + $experiences = $this->dataManager->getEntitiesList('experiences'); + $this->assertIsArray($experiences); + + $features = $this->dataManager->getEntitiesList('features'); + $this->assertIsArray($features); + + $goals = $this->dataManager->getEntitiesList('goals'); + $this->assertIsArray($goals); + + $locations = $this->dataManager->getEntitiesList('locations'); + $this->assertIsArray($locations); + + $segments = $this->dataManager->getEntitiesList('segments'); + $this->assertIsArray($segments); + } + + public function testIsValidConfigDataWithInvalidData(): void + { + $emptyData = new ConfigResponseData([]); + $this->assertFalse($this->dataManager->isValidConfigData($emptyData)); + } + + public function testIsValidConfigDataWithValidData(): void + { + $configData = $this->config->getData(); + $this->assertTrue($this->dataManager->isValidConfigData($configData)); + } + + public function testGetEntitiesListReturnsEmptyArrayForUnknownType(): void + { + $result = $this->dataManager->getEntitiesList('nonexistent_type'); + $this->assertIsArray($result); + $this->assertEmpty($result); + } + + public function testGetSubItemReturnsNullForMissingEntity(): void + { + $result = $this->dataManager->getSubItem( + 'experiences', + 'nonexistent-id', + 'variations', + 'nonexistent-var', + 'id', + 'id' + ); + $this->assertNull($result); + } + + // ========================================================================= + // forceMultipleTransactions behavior matrix tests + // ========================================================================= + + /** + * Helper: create a DataManager with a mock ApiManager that tracks enqueue() calls. + * + * @return array{dataManager: DataManager, apiMock: ApiManagerInterface&\PHPUnit\Framework\MockObject\MockObject} + */ + private function createDataManagerWithMockApi(): array + { + $apiMock = $this->createMock(ApiManagerInterface::class); + + $dataManager = new DataManager( + $this->config, + $this->bucketingManager, + $this->ruleManager, + $this->eventManager, + $apiMock, + $this->loggerManager, + true + ); + + return ['dataManager' => $dataManager, 'apiMock' => $apiMock]; + } + + /** + * Scenario 1: First trigger, no goalData -> conversion sent, no transaction. + */ + #[Group('forceMultipleTransactions')] + public function testForceMultiple_FirstTriggerNoGoalData_SendsConversionOnly(): void + { + ['dataManager' => $dm, 'apiMock' => $apiMock] = $this->createDataManagerWithMockApi(); + + $apiMock->expects($this->once()) + ->method('enqueue') + ->with( + $this->visitorId, + $this->callback(function (VisitorTrackingEvents $event) { + $data = (array) $event->jsonSerialize(); + // Conversion event: has goalId, no goalData + return isset($data['data']['goalId']) && !isset($data['data']['goalData']); + }), + $this->anything() + ); + + $result = $dm->convert($this->visitorId, 'goal-without-rule'); + $this->assertTrue($result); + } + + /** + * Scenario 2: First trigger, with goalData -> conversion sent AND transaction sent. + */ + #[Group('forceMultipleTransactions')] + public function testForceMultiple_FirstTriggerWithGoalData_SendsConversionAndTransaction(): void + { + ['dataManager' => $dm, 'apiMock' => $apiMock] = $this->createDataManagerWithMockApi(); + + $capturedEvents = []; + $apiMock->expects($this->exactly(2)) + ->method('enqueue') + ->willReturnCallback(function (string $visitorId, VisitorTrackingEvents $event) use (&$capturedEvents) { + $capturedEvents[] = (array) $event->jsonSerialize(); + }); + + $goalData = [['key' => 'amount', 'value' => 49.99]]; + $result = $dm->convert($this->visitorId, 'goal-without-rule', null, $goalData); + $this->assertTrue($result); + + // First event: conversion (no goalData) + $this->assertEquals('conversion', $capturedEvents[0]['eventType']); + $this->assertArrayHasKey('goalId', $capturedEvents[0]['data']); + $this->assertArrayNotHasKey('goalData', $capturedEvents[0]['data']); + + // Second event: transaction (with goalData) + $this->assertEquals('conversion', $capturedEvents[1]['eventType']); + $this->assertArrayHasKey('goalId', $capturedEvents[1]['data']); + $this->assertArrayHasKey('goalData', $capturedEvents[1]['data']); + } + + /** + * Scenario 3: Repeat trigger, no force -> nothing sent (dedup blocks both). + */ + #[Group('forceMultipleTransactions')] + public function testForceMultiple_RepeatTriggerNoForce_SendsNothing(): void + { + ['dataManager' => $dm, 'apiMock' => $apiMock] = $this->createDataManagerWithMockApi(); + + // First call: triggers conversion + $apiMock->expects($this->once()) + ->method('enqueue'); + + $dm->convert($this->visitorId, 'goal-without-rule'); + + // Second call: dedup blocks everything + $result = $dm->convert($this->visitorId, 'goal-without-rule'); + $this->assertTrue($result); // Returns true (dedup recognized) + } + + /** + * Scenario 4: Repeat trigger, force=true, no goalData -> nothing sent. + */ + #[Group('forceMultipleTransactions')] + public function testForceMultiple_RepeatTriggerForceNoGoalData_SendsNothing(): void + { + ['dataManager' => $dm, 'apiMock' => $apiMock] = $this->createDataManagerWithMockApi(); + + // First call: triggers conversion (1 enqueue) + // Second call with force but no goalData: nothing to send (still 1 total) + $apiMock->expects($this->once()) + ->method('enqueue'); + + $dm->convert($this->visitorId, 'goal-without-rule'); + + $conversionSetting = [ConversionSettingKey::ForceMultipleTransactions->value => true]; + $result = $dm->convert($this->visitorId, 'goal-without-rule', null, null, null, $conversionSetting); + $this->assertTrue($result); + } + + /** + * Scenario 3b: Repeat trigger, explicit force=false -> nothing sent (dedup blocks). + * Validates that explicit false behaves identically to null/absent. + */ + #[Group('forceMultipleTransactions')] + public function testForceMultiple_RepeatTriggerExplicitFalse_SendsNothing(): void + { + ['dataManager' => $dm, 'apiMock' => $apiMock] = $this->createDataManagerWithMockApi(); + + // First call: triggers conversion (1 enqueue) + $apiMock->expects($this->once()) + ->method('enqueue'); + + $dm->convert($this->visitorId, 'goal-without-rule'); + + // Second call with explicit false: dedup blocks everything + $conversionSetting = [ConversionSettingKey::ForceMultipleTransactions->value => false]; + $result = $dm->convert($this->visitorId, 'goal-without-rule', null, [['key' => 'amount', 'value' => 9.99]], null, $conversionSetting); + $this->assertTrue($result); + } + + /** + * Scenario 5b: Repeat trigger, force=1 (truthy integer), with goalData -> transaction sent. + * Validates that non-boolean truthy values also bypass dedup. + */ + #[Group('forceMultipleTransactions')] + public function testForceMultiple_RepeatTriggerTruthyInteger_SendsTransaction(): void + { + ['dataManager' => $dm, 'apiMock' => $apiMock] = $this->createDataManagerWithMockApi(); + + $apiMock->expects($this->exactly(2)) + ->method('enqueue'); + + $dm->convert($this->visitorId, 'goal-without-rule'); + + // Integer 1 is truthy — should bypass dedup and send transaction + $conversionSetting = [ConversionSettingKey::ForceMultipleTransactions->value => 1]; + $result = $dm->convert($this->visitorId, 'goal-without-rule', null, [['key' => 'amount', 'value' => 5.00]], null, $conversionSetting); + $this->assertTrue($result); + } + + /** + * Scenario 5: Repeat trigger, force=true, with goalData -> transaction sent only. + */ + #[Group('forceMultipleTransactions')] + public function testForceMultiple_RepeatTriggerForceWithGoalData_SendsTransactionOnly(): void + { + ['dataManager' => $dm, 'apiMock' => $apiMock] = $this->createDataManagerWithMockApi(); + + $capturedEvents = []; + $apiMock->expects($this->exactly(2)) + ->method('enqueue') + ->willReturnCallback(function (string $visitorId, VisitorTrackingEvents $event) use (&$capturedEvents) { + $capturedEvents[] = (array) $event->jsonSerialize(); + }); + + // First call: triggers conversion (1 enqueue) + $dm->convert($this->visitorId, 'goal-without-rule'); + + // Second call with force + goalData: triggers transaction only (2nd enqueue) + $goalData = [['key' => 'amount', 'value' => 29.99]]; + $conversionSetting = [ConversionSettingKey::ForceMultipleTransactions->value => true]; + $result = $dm->convert($this->visitorId, 'goal-without-rule', null, $goalData, null, $conversionSetting); + $this->assertTrue($result); + + $this->assertCount(2, $capturedEvents); + + // First event: conversion (no goalData) + $this->assertEquals('conversion', $capturedEvents[0]['eventType']); + $this->assertArrayNotHasKey('goalData', $capturedEvents[0]['data']); + + // Second event: transaction (with goalData) + $this->assertEquals('conversion', $capturedEvents[1]['eventType']); + $this->assertArrayHasKey('goalData', $capturedEvents[1]['data']); + } +} diff --git a/packages/Data/tests/DataStoreManagerTest.php b/packages/Data/tests/DataStoreManagerTest.php new file mode 100644 index 0000000..c20d2af --- /dev/null +++ b/packages/Data/tests/DataStoreManagerTest.php @@ -0,0 +1,163 @@ +data; + } + return $this->data[$key] ?? null; + } + + /** + * Sets data for a given key. + * + * @param string $key + * @param mixed $value + * @throws \InvalidArgumentException + */ + public function set($key, $value) + { + if ($key === null) { + throw new \InvalidArgumentException('Invalid DataStore key!'); + } + $this->data[$key] = $value; + } +} + +/** + * Test class for DataStoreManager. + */ +class DataStoreManagerTest extends TestCase +{ + /** @var TestDataStore */ + private $dataStore; + + /** @var DataStoreManager */ + private $dataStoreManager; + + /** @var string */ + private $storeKey = 'test-key'; + + /** @var array */ + private $storeData = [ + 'bucketing' => [ + 'exp1' => 'var1', + 'exp2' => 'var2', + ], + 'goals' => [ + 'goal1' => true, + 'goal2' => true, + ], + 'segments' => [ + 'browser' => 'CH', + 'devices' => 'ALLPH', + 'source' => 'test', + 'campaign' => 'test', + 'visitorType' => 'new', + 'country' => 'US', + 'custom_segments' => ['seg1', 'seg2'], + ], + ]; + + /** + * Sets up the test environment before each test. + */ + protected function setUp(): void + { + // Load test configuration from JSON file + $testConfigPath = __DIR__ . '/test-config.json'; + $testConfig = file_exists($testConfigPath) + ? json_decode(file_get_contents($testConfigPath), true) + : []; + + // Get default configuration + $defaultConfig = DefaultConfig::getDefault(); + // Merge configurations with overrides + $configuration = ObjectUtils::objectDeepMerge( + $testConfig, + $defaultConfig + ); + + if (isset($configuration['sdkKey'])) { + unset($configuration['sdkKey']); + } + $configuration['data'] = new ConfigResponseData($configuration['data']); + // Instantiate Config object + $config = new Config($configuration); + + // Create dependencies + $this->dataStore = new TestDataStore(); + + // Instantiate DataStoreManager + $this->dataStoreManager = new DataStoreManager($config, [ + 'dataStore' => $this->dataStore, + ]); + } + + /** + * Tests that the DataStoreManager class is exposed. + */ + public function testShouldExposeDataStoreManager(): void + { + $this->assertTrue(class_exists(DataStoreManager::class)); + } + + /** + * Tests that the instantiated object is an instance of DataStoreManager. + */ + public function testImportedEntityShouldBeAConstructorOfDataStoreManagerInstance(): void + { + $this->assertInstanceOf(DataStoreManager::class, $this->dataStoreManager); + } + + /** + * Tests that visitor data can be set and retrieved immediately. + */ + public function testShouldSuccessfullySetVisitorDataImmediately(): void + { + $this->dataStoreManager->set($this->storeKey, $this->storeData); + $retrieved = $this->dataStoreManager->get($this->storeKey); + $this->assertEquals($this->storeData, $retrieved); + } + + /** + * Tests that the visitor data has the correct structure. + */ + public function testShouldHaveTheCorrectShapeForVisitorData(): void + { + $this->dataStoreManager->set($this->storeKey, $this->storeData); + $retrieved = $this->dataStoreManager->get($this->storeKey); + + $this->assertIsArray($retrieved); + $this->assertArrayHasKey('bucketing', $retrieved); + $this->assertEquals($this->storeData['bucketing'], $retrieved['bucketing']); + $this->assertArrayHasKey('goals', $retrieved); + $this->assertEquals($this->storeData['goals'], $retrieved['goals']); + $this->assertArrayHasKey('segments', $retrieved); + $this->assertEquals($this->storeData['segments'], $retrieved['segments']); + } +} diff --git a/packages/Data/tests/RevenueReportingTest.php b/packages/Data/tests/RevenueReportingTest.php new file mode 100644 index 0000000..81f512e --- /dev/null +++ b/packages/Data/tests/RevenueReportingTest.php @@ -0,0 +1,370 @@ + [ + 'endpoint' => [ + 'config' => 'http://localhost:8090', + 'track' => 'http://localhost:8090', + ], + ], + 'events' => [ + 'batch_size' => 10, + 'release_interval' => 1000, + ], + ]; + $mergedConfig = ObjectUtils::objectDeepMerge($testConfig, $defaultConfig, $overrides); + $mergedConfig['data'] = new ConfigResponseData($mergedConfig['data']); + if (isset($mergedConfig['sdkKey'])) { + unset($mergedConfig['sdkKey']); + } + $this->config = new Config($mergedConfig); + + $bucketingConfig = $this->config->getBucketing(); + $bucketingManager = new BucketingManager( + maxTraffic: $bucketingConfig['max_traffic'] ?? 10000, + hashSeed: $bucketingConfig['hash_seed'] ?? 9999, + ); + $ruleManager = new RuleManager(); + $eventManager = new EventManager(); + $loggerManager = new LogManager(); + + $this->apiManagerMock = $this->createMock(ApiManagerInterface::class); + + $this->dataManager = new DataManager( + $this->config, + $bucketingManager, + $ruleManager, + $eventManager, + $this->apiManagerMock, + $loggerManager, + true + ); + } + + protected function tearDown(): void + { + $this->dataManager->reset(); + } + + /** + * Test 7.1: trackConversion with GoalData sends TWO events (conversion + transaction) + */ + public function testConversionWithGoalDataSendsTwoEvents(): void + { + $goalKey = 'goal-without-rule'; + $goalData = [ + ['key' => GoalDataKey::Amount->value, 'value' => 99.99], + ['key' => GoalDataKey::TransactionId->value, 'value' => 'txn-abc'], + ]; + + $this->apiManagerMock->expects($this->exactly(2)) + ->method('enqueue'); + + $result = $this->dataManager->convert( + $this->visitorId, + $goalKey, + null, + $goalData + ); + $this->assertTrue($result); + } + + /** + * Test 7.2: Transaction event payload contains goalData array with correct key-value pairs + */ + public function testTransactionEventContainsGoalData(): void + { + $goalKey = 'goal-without-rule'; + $goalData = [ + ['key' => GoalDataKey::Amount->value, 'value' => 99.99], + ['key' => GoalDataKey::TransactionId->value, 'value' => 'txn-abc-123'], + ]; + + $capturedEvents = []; + $this->apiManagerMock->expects($this->exactly(2)) + ->method('enqueue') + ->willReturnCallback(function ($visitorId, VisitorTrackingEvents $event) use (&$capturedEvents) { + $capturedEvents[] = $event; + }); + + $this->dataManager->convert($this->visitorId, $goalKey, null, $goalData); + + // First event is conversion (no goalData), second is transaction (with goalData) + $this->assertCount(2, $capturedEvents); + + $conversionData = $capturedEvents[0]->getData(); + $this->assertArrayNotHasKey('goalData', $conversionData); + + $transactionData = $capturedEvents[1]->getData(); + $this->assertArrayHasKey('goalData', $transactionData); + $this->assertEquals($goalData, $transactionData['goalData']); + } + + /** + * Test 7.3: Transaction event payload contains bucketingData + */ + public function testTransactionEventContainsBucketingData(): void + { + $goalKey = 'goal-without-rule'; + $bucketingData = ['exp1' => 'var1']; + $goalData = [['key' => GoalDataKey::Amount->value, 'value' => 50.0]]; + + $this->dataManager->putData($this->visitorId, ['bucketing' => $bucketingData]); + + $capturedEvents = []; + $this->apiManagerMock->expects($this->exactly(2)) + ->method('enqueue') + ->willReturnCallback(function ($visitorId, VisitorTrackingEvents $event) use (&$capturedEvents) { + $capturedEvents[] = $event; + }); + + $this->dataManager->convert($this->visitorId, $goalKey, null, $goalData); + + // Transaction event (second) should have bucketingData + $transactionData = $capturedEvents[1]->getData(); + $this->assertArrayHasKey('bucketingData', $transactionData); + $this->assertEquals($bucketingData, $transactionData['bucketingData']); + } + + /** + * Test 7.5: GoalData with Amount (float), TransactionId (string), ProductsCount (int) all serialize correctly + */ + public function testGoalDataTypesSerializeCorrectly(): void + { + $goalKey = 'goal-without-rule'; + $goalData = [ + ['key' => GoalDataKey::Amount->value, 'value' => 99.99], + ['key' => GoalDataKey::TransactionId->value, 'value' => 'txn-abc'], + ['key' => GoalDataKey::ProductsCount->value, 'value' => 3], + ]; + + $capturedEvent = null; + $this->apiManagerMock->expects($this->exactly(2)) + ->method('enqueue') + ->willReturnCallback(function ($visitorId, VisitorTrackingEvents $event) use (&$capturedEvent) { + $data = $event->getData(); + if (isset($data['goalData'])) { + $capturedEvent = $event; + } + }); + + $this->dataManager->convert($this->visitorId, $goalKey, null, $goalData); + + $this->assertNotNull($capturedEvent); + $transactionData = $capturedEvent->getData(); + $actualGoalData = $transactionData['goalData']; + + $this->assertCount(3, $actualGoalData); + $this->assertEquals('amount', $actualGoalData[0]['key']); + $this->assertIsFloat($actualGoalData[0]['value']); + $this->assertEquals(99.99, $actualGoalData[0]['value']); + + $this->assertEquals('transactionId', $actualGoalData[1]['key']); + $this->assertIsString($actualGoalData[1]['value']); + $this->assertEquals('txn-abc', $actualGoalData[1]['value']); + + $this->assertEquals('productsCount', $actualGoalData[2]['key']); + $this->assertIsInt($actualGoalData[2]['value']); + $this->assertEquals(3, $actualGoalData[2]['value']); + } + + /** + * Test 7.6: GoalData with all 5 CustomDimension keys serialize correctly + */ + public function testCustomDimensionKeysSerializeCorrectly(): void + { + $goalKey = 'goal-without-rule'; + $goalData = [ + ['key' => GoalDataKey::CustomDimension1->value, 'value' => 'dim1-val'], + ['key' => GoalDataKey::CustomDimension2->value, 'value' => 'dim2-val'], + ['key' => GoalDataKey::CustomDimension3->value, 'value' => 'dim3-val'], + ['key' => GoalDataKey::CustomDimension4->value, 'value' => 'dim4-val'], + ['key' => GoalDataKey::CustomDimension5->value, 'value' => 'dim5-val'], + ]; + + $capturedEvent = null; + $this->apiManagerMock->expects($this->exactly(2)) + ->method('enqueue') + ->willReturnCallback(function ($visitorId, VisitorTrackingEvents $event) use (&$capturedEvent) { + $data = $event->getData(); + if (isset($data['goalData'])) { + $capturedEvent = $event; + } + }); + + $this->dataManager->convert($this->visitorId, $goalKey, null, $goalData); + + $this->assertNotNull($capturedEvent); + $transactionData = $capturedEvent->getData(); + $actualGoalData = $transactionData['goalData']; + + $this->assertCount(5, $actualGoalData); + $this->assertEquals('customDimension1', $actualGoalData[0]['key']); + $this->assertEquals('customDimension2', $actualGoalData[1]['key']); + $this->assertEquals('customDimension3', $actualGoalData[2]['key']); + $this->assertEquals('customDimension4', $actualGoalData[3]['key']); + $this->assertEquals('customDimension5', $actualGoalData[4]['key']); + } + + /** + * Test 7.7: trackConversion with ruleData — rules match -> events sent + */ + public function testConversionWithRuleMatchSendsEvents(): void + { + $goalKey = 'increase-engagement'; + $goalData = [['key' => GoalDataKey::Amount->value, 'value' => 25.0]]; + + $this->apiManagerMock->expects($this->exactly(2)) + ->method('enqueue'); + + $result = $this->dataManager->convert( + $this->visitorId, + $goalKey, + ['action' => 'buy'], + $goalData + ); + $this->assertTrue($result); + } + + /** + * Test 7.8: trackConversion with ruleData — rules don't match -> no events, returns false + */ + public function testConversionWithRuleMismatchReturnsFalse(): void + { + $goalKey = 'increase-engagement'; + $goalData = [['key' => GoalDataKey::Amount->value, 'value' => 25.0]]; + + $this->apiManagerMock->expects($this->never()) + ->method('enqueue'); + + $result = $this->dataManager->convert( + $this->visitorId, + $goalKey, + ['action' => 'sell'], + $goalData + ); + $this->assertFalse($result); + } + + /** + * Test 7.9: Conversion without goalData sends only conversion event (no transaction) + */ + public function testConversionWithoutGoalDataSendsOnlyConversionEvent(): void + { + $goalKey = 'goal-without-rule'; + + $capturedEvent = null; + $this->apiManagerMock->expects($this->once()) + ->method('enqueue') + ->willReturnCallback(function ($visitorId, VisitorTrackingEvents $event) use (&$capturedEvent) { + $capturedEvent = $event; + }); + + $result = $this->dataManager->convert($this->visitorId, $goalKey); + $this->assertTrue($result); + $this->assertNotNull($capturedEvent); + + $data = $capturedEvent->getData(); + $this->assertArrayNotHasKey('goalData', $data); + } + + /** + * Test: All 8 GoalDataKey values together in a single transaction event + */ + public function testAll8GoalDataKeysInSingleTransaction(): void + { + $goalKey = 'goal-without-rule'; + $goalData = [ + ['key' => GoalDataKey::Amount->value, 'value' => 149.99], + ['key' => GoalDataKey::ProductsCount->value, 'value' => 5], + ['key' => GoalDataKey::TransactionId->value, 'value' => 'txn-all-keys'], + ['key' => GoalDataKey::CustomDimension1->value, 'value' => 'premium'], + ['key' => GoalDataKey::CustomDimension2->value, 'value' => 'annual'], + ['key' => GoalDataKey::CustomDimension3->value, 'value' => 'usd'], + ['key' => GoalDataKey::CustomDimension4->value, 'value' => 'web'], + ['key' => GoalDataKey::CustomDimension5->value, 'value' => 'checkout-v2'], + ]; + + $capturedEvent = null; + $this->apiManagerMock->expects($this->exactly(2)) + ->method('enqueue') + ->willReturnCallback(function ($visitorId, VisitorTrackingEvents $event) use (&$capturedEvent) { + $data = $event->getData(); + if (isset($data['goalData'])) { + $capturedEvent = $event; + } + }); + + $this->dataManager->convert($this->visitorId, $goalKey, null, $goalData); + + $this->assertNotNull($capturedEvent); + $transactionData = $capturedEvent->getData(); + $this->assertCount(8, $transactionData['goalData']); + + // Verify all keys are present + $keys = array_map(fn ($item) => $item['key'], $transactionData['goalData']); + foreach (GoalDataKey::cases() as $case) { + $this->assertContains($case->value, $keys, "GoalDataKey::{$case->name} should be in payload"); + } + } + + /** + * Test 7.11: Repeat trigger with forceMultipleTransactions + goalData -> transaction only + */ + public function testRepeatTriggerWithForceOnlySendsTransaction(): void + { + $goalKey = 'goal-without-rule'; + $goalData = [['key' => GoalDataKey::Amount->value, 'value' => 30.0]]; + $conversionSetting = ['forceMultipleTransactions' => true]; + + $capturedEvents = []; + $this->apiManagerMock->expects($this->exactly(3)) + ->method('enqueue') + ->willReturnCallback(function ($visitorId, VisitorTrackingEvents $event) use (&$capturedEvents) { + $capturedEvents[] = $event; + }); + + // First call: conversion + transaction = 2 events + $this->dataManager->convert($this->visitorId, $goalKey, null, $goalData, null, $conversionSetting); + $this->assertCount(2, $capturedEvents); + + // Second call with force: transaction only = 1 event + $this->dataManager->convert($this->visitorId, $goalKey, null, $goalData, null, $conversionSetting); + $this->assertCount(3, $capturedEvents); + + // Third event (second call) should be transaction (has goalData) + $thirdEventData = $capturedEvents[2]->getData(); + $this->assertArrayHasKey('goalData', $thirdEventData); + } +} diff --git a/packages/Data/tests/test-config.json b/packages/Data/tests/test-config.json new file mode 100644 index 0000000..8fed8d7 --- /dev/null +++ b/packages/Data/tests/test-config.json @@ -0,0 +1,570 @@ +{ + "environment": "staging", + "data": { + "account_id": "10022898", + "audiences": [ + { + "id": "100299433", + "name": "Adv Audience", + "type": "transient", + "status": "active", + "key": "adv-audience", + "preset": false, + "rules": { + "OR": [ + { + "AND": [ + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "matches", + "negated": false + }, + "value": "value1", + "key": "varName1" + } + ] + }, + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "matches", + "negated": false + }, + "value": "value2", + "key": "varName2" + } + ] + } + ] + }, + { + "AND": [ + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "matches", + "negated": false + }, + "value": "something", + "key": "varName3" + } + ] + } + ] + } + ] + } + } + ], + "segments": [ + { + "id": "200299434", + "name": "Test Segments", + "status": "active", + "key": "test-segments-1", + "preset": false, + "rules": { + "OR": [ + { + "AND": [ + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "matches", + "negated": false + }, + "key": "enabled", + "value": true + } + ] + } + ] + } + ] + } + } + ], + "experiences": [ + { + "id": "100218245", + "name": "Test Experience AB Fullstack", + "key": "test-experience-ab-fullstack-2", + "type": "a/b", + "version": 6, + "status": "active", + "global_js": "var s = 'test_experience'; console.log(s);", + "global_css": ".test-style { display: initial; }", + "url": "https://convert.com", + "integrations": [], + "environments": ["live", "staging"], + "site_area": { + "OR": [ + { + "AND": [ + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "matches", + "negated": false + }, + "key": "url", + "value": "https://convert.com/" + } + ] + } + ] + } + ] + }, + "audiences": ["100299433"], + "goals": ["100215959", "100215960", "100215961"], + "settings": { + "matching_options": { + "audiences": "any" + } + }, + "variations": [ + { + "id": "100299456", + "name": "Original Page", + "status": "running", + "is_baseline": true, + "changes": [ + { + "id": "100240519", + "type": "fullStackFeature", + "data": { + "feature_id": "10024", + "variables_data": { + "enabled": "true", + "caption": "Click that" + } + } + }, + { + "id": "100240521", + "type": "fullStackFeature", + "data": { + "feature_id": "10025", + "variables_data": { + "price": 100, + "button-height": 40, + "additionalData": "{\"foo\":\"bar\",\"v\":2}" + } + } + } + ], + "key": "100299456-original-page", + "traffic_allocation": 50.0 + }, + { + "id": "100299457", + "name": "Variation 1", + "status": "running", + "is_baseline": false, + "changes": [ + { + "id": "100240520", + "type": "fullStackFeature", + "data": { + "feature_id": "10024", + "variables_data": { + "enabled": "false", + "caption": "Not allowed" + } + } + } + ], + "key": "100299457-variation-1", + "traffic_allocation": 50.0 + } + ] + }, + { + "id": "100218246", + "name": "Test Experience AB Fullstack", + "key": "test-experience-ab-fullstack-3", + "type": "a/b", + "version": 6, + "status": "active", + "global_js": "var s = 'test_experience'; console.log(s);", + "global_css": ".test-style { display: initial; }", + "url": "https://convert.com", + "integrations": [], + "environments": ["live", "staging"], + "site_area": { + "OR": [ + { + "AND": [ + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "matches", + "negated": false + }, + "key": "url", + "value": "https://convert.com/" + } + ] + } + ] + } + ] + }, + "audiences": ["100299433"], + "goals": ["100215959", "100215960", "100215961"], + "settings": { + "matching_options": { + "audiences": "any" + } + }, + "variations": [ + { + "id": "100299460", + "name": "Original Page", + "status": "running", + "is_baseline": true, + "changes": [ + { + "id": "100240529", + "type": "fullStackFeature", + "data": { + "feature_id": "10024", + "variables_data": { + "enabled": "true", + "caption": "Click that" + } + } + } + ], + "key": "100299460-original-page", + "traffic_allocation": 50.0 + }, + { + "id": "100299461", + "name": "Variation 1", + "status": "running", + "is_baseline": false, + "changes": [ + { + "id": "100240532", + "type": "fullStackFeature", + "data": { + "feature_id": "10024", + "variables_data": { + "enabled": "true", + "caption": "Allowed" + } + } + } + ], + "key": "100299461-variation-1", + "traffic_allocation": 50.0 + } + ] + }, + { + "id": "100218247", + "name": "Test Experience AB Fullstack", + "key": "test-experience-ab-fullstack-4", + "type": "a/b", + "version": 6, + "status": "active", + "global_js": "var s = 'test_experience'; console.log(s);", + "global_css": ".test-style { display: initial; }", + "url": "https://convert.com", + "integrations": [], + "environments": ["live", "staging"], + "site_area": { + "OR": [ + { + "AND": [ + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "matches", + "negated": false + }, + "key": "url", + "value": "https://convert.com/" + } + ] + } + ] + } + ] + }, + "audiences": ["100299433"], + "goals": ["100215959", "100215960", "100215961"], + "settings": { + "matching_options": { + "audiences": "any" + } + }, + "variations": [{}] + } + ], + "features": [ + { + "id": "10024", + "name": "Feature 1", + "key": "feature-1", + "variables": [ + { + "key": "enabled", + "type": "boolean" + }, + { + "key": "caption", + "type": "string" + } + ] + }, + { + "id": "10025", + "name": "Feature 2", + "key": "feature-2", + "variables": [ + { + "key": "price", + "type": "float" + }, + { + "key": "button-height", + "type": "integer" + }, + { + "key": "additionalData", + "type": "json" + } + ] + }, + { + "id": "10026", + "name": "Not Attached Feature 3", + "key": "not-attached-feature-3", + "variables": [ + { + "key": "fee", + "type": "float" + }, + { + "key": "link", + "type": "string" + }, + { + "key": "additionalData", + "type": "json" + } + ] + } + ], + "goals": [ + { + "id": "100215960", + "name": "Increase Engagement", + "selected_default": true, + "status": "active", + "type": "dom_interaction", + "is_system": true, + "key": "increase-engagement", + "settings": { + "tracked_items": [ + { + "event": "click", + "selector": "a" + }, + { + "event": "submit", + "selector": "form" + } + ] + }, + "rules": { + "OR": [ + { + "AND": [ + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "matches", + "negated": false + }, + "key": "action", + "value": "buy" + }, + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "matches", + "negated": false + }, + "key": "action", + "value": "signup" + } + ] + } + ] + } + ] + } + }, + { + "id": "100215959", + "name": "Decrease BounceRate", + "selected_default": true, + "status": "active", + "type": "advanced", + "is_system": true, + "key": "decrease-bounce-rate", + "rules": { + "OR": [ + { + "AND": [ + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "lessEqual", + "negated": true + }, + "value": 1, + "key": "pages_visited_count" + }, + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "lessEqual", + "negated": true + }, + "value": 10, + "key": "visit_duration" + } + ] + } + ] + } + ] + } + }, + { + "id": "100215961", + "name": "adv goal country browser", + "selected_default": false, + "status": "active", + "type": "advanced", + "is_system": false, + "key": "adv-goal-country-browser", + "rules": { + "OR": [ + { + "AND": [ + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "equals", + "negated": false + }, + "value": "US", + "key": "country" + } + ] + }, + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "equals", + "negated": false + }, + "value": "chrome", + "key": "browser_name" + } + ] + } + ] + }, + { + "AND": [ + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "equals", + "negated": false + }, + "value": "GB", + "key": "country" + } + ] + }, + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "equals", + "negated": false + }, + "value": "safari", + "key": "browser_name" + } + ] + } + ] + } + ] + } + }, + { + "id": "100215962", + "key": "goal-without-rule" + } + ], + "project": { + "id": "10025986", + "name": "Test Project", + "type": "fullstack", + "utc_offset": 0, + "domains": [ + { + "id": "10029181", + "hosts": "https://convert.com/", + "tld": false + } + ], + "settings": { + "auto_link": false, + "data_anonymization": false, + "do_not_track": "OFF", + "include_jquery": false + }, + "environments": { + "live": "Live", + "staging": "Staging" + } + } + } +} diff --git a/packages/Enums/composer.json b/packages/Enums/composer.json new file mode 100644 index 0000000..7613128 --- /dev/null +++ b/packages/Enums/composer.json @@ -0,0 +1,22 @@ +{ + "name": "convertcom/php-sdk-enums", + "description": "PHP implementation of Convert JS SDK enums", + "type": "library", + "license": "Apache-2.0", + "authors": [ + { + "name": "Convert Insights, Inc" + } + ], + "autoload": { + "psr-4": { + "ConvertSdk\\Enums\\": "src/" + } + }, + "require": { + "php": "^8.2" + }, + "minimum-stability": "stable", + "prefer-stable": true, + "version": "1.0.0" +} diff --git a/packages/Enums/src/BucketingError.php b/packages/Enums/src/BucketingError.php new file mode 100644 index 0000000..89f3cd7 --- /dev/null +++ b/packages/Enums/src/BucketingError.php @@ -0,0 +1,10 @@ + 'goals', + 'audience' => 'audiences', + 'location' => 'locations', + 'segment' => 'segments', + 'experience' => 'experiences', + 'variation' => 'experiences.variations', + 'feature' => 'features', + ]; +} diff --git a/packages/Enums/src/DoNotTrack.php b/packages/Enums/src/DoNotTrack.php new file mode 100644 index 0000000..c3bd2af --- /dev/null +++ b/packages/Enums/src/DoNotTrack.php @@ -0,0 +1,13 @@ +assertCount(8, $cases); + } + + public function testOriginalThreeCasesExist(): void + { + $this->assertEquals('amount', GoalDataKey::Amount->value); + $this->assertEquals('productsCount', GoalDataKey::ProductsCount->value); + $this->assertEquals('transactionId', GoalDataKey::TransactionId->value); + } + + public function testCustomDimensionCasesExist(): void + { + $this->assertEquals('customDimension1', GoalDataKey::CustomDimension1->value); + $this->assertEquals('customDimension2', GoalDataKey::CustomDimension2->value); + $this->assertEquals('customDimension3', GoalDataKey::CustomDimension3->value); + $this->assertEquals('customDimension4', GoalDataKey::CustomDimension4->value); + $this->assertEquals('customDimension5', GoalDataKey::CustomDimension5->value); + } + + public function testFromValueWorksForAllCases(): void + { + $expected = [ + 'amount' => GoalDataKey::Amount, + 'productsCount' => GoalDataKey::ProductsCount, + 'transactionId' => GoalDataKey::TransactionId, + 'customDimension1' => GoalDataKey::CustomDimension1, + 'customDimension2' => GoalDataKey::CustomDimension2, + 'customDimension3' => GoalDataKey::CustomDimension3, + 'customDimension4' => GoalDataKey::CustomDimension4, + 'customDimension5' => GoalDataKey::CustomDimension5, + ]; + + foreach ($expected as $value => $case) { + $this->assertEquals($case, GoalDataKey::from($value)); + } + } +} diff --git a/packages/Event/composer.json b/packages/Event/composer.json new file mode 100644 index 0000000..b51821e --- /dev/null +++ b/packages/Event/composer.json @@ -0,0 +1,42 @@ +{ + "name": "convertcom/php-sdk-event", + "description": "Convert PHP SDK Event Manager", + "type": "library", + "license": "Apache-2.0", + "version": "1.0.0", + "authors": [ + { + "name": "Convert Insights, Inc" + } + ], + "autoload": { + "psr-4": { + "ConvertSdk\\Event\\": "src/" + } + }, + "repositories": { + "Enums": { + "type": "path", + "url": "../Enums" + }, + "Logger": { + "type": "path", + "url": "../Logger" + } + }, + "require": { + "php": "^8.2", + "convertcom/php-sdk-enums": ">=1.0.0", + "convertcom/php-sdk-logger": ">=1.0.0" + }, + "require-dev": { + "phpunit/phpunit": "^11.0", + "vlucas/phpdotenv": "^5.5" + }, + "scripts": { + "test": "phpunit" + }, + "minimum-stability": "dev", + "prefer-stable": true + } + \ No newline at end of file diff --git a/packages/Event/phpunit.xml b/packages/Event/phpunit.xml new file mode 100644 index 0000000..7c298e9 --- /dev/null +++ b/packages/Event/phpunit.xml @@ -0,0 +1,18 @@ + + + + + ./tests + + + + + src + + + diff --git a/packages/Event/src/EventManager.php b/packages/Event/src/EventManager.php new file mode 100644 index 0000000..6cd1c35 --- /dev/null +++ b/packages/Event/src/EventManager.php @@ -0,0 +1,130 @@ +> Listeners indexed by event name. + */ + private array $listeners = []; + + /** + * @var array Deferred events indexed by event name. + */ + private array $deferred = []; + + /** + * @var \Closure Mapper function for data transformation. + */ + private \Closure $mapper; + + /** + * Constructor. + * + * @param LogManagerInterface|null $loggerManager Optional logger manager. + * @param callable|null $mapper Optional mapper function for data transformation. + */ + public function __construct( + private readonly ?LogManagerInterface $loggerManager = null, + ?callable $mapper = null, + ) { + $this->mapper = $mapper instanceof \Closure + ? $mapper + : ($mapper !== null + ? \Closure::fromCallable($mapper) + : static fn (mixed $value): mixed => $value); + } + + /** + * Registers a callback function for the given event. + * + * @param SystemEvents|string $event The event name or constant. + * @param callable $fn Callback function receiving ($args, $err). + * @return void + */ + public function on(SystemEvents|string $event, callable $fn): void + { + $key = $event instanceof \BackedEnum ? $event->value : $event; + if (!isset($this->listeners[$key])) { + $this->listeners[$key] = []; + } + $this->listeners[$key][] = $fn; + + // Log the registration if a logger is available. + $this->loggerManager?->trace('EventManager.on()', ['event' => $key]); + + // If there is a deferred event for this event, fire it now. + if (array_key_exists($key, $this->deferred)) { + $deferredData = $this->deferred[$key]; + $this->fire($key, $deferredData['args'], $deferredData['err']); + } + } + + /** + * Fires an event with optional arguments and error. + * + * @param SystemEvents|string $event The event name or constant. + * @param array|mixed $args Optional arguments. + * @param mixed $err Optional error. + * @param bool $deferred Whether to store the event for later listeners. + * @return void + */ + public function fire(SystemEvents|string $event, mixed $args = null, mixed $err = null, bool $deferred = false): void + { + $key = $event instanceof \BackedEnum ? $event->value : $event; + if ($this->loggerManager !== null) { + $mapped = ($this->mapper)([ + 'event' => $key, + 'args' => $args, + 'err' => $err, + 'deferred' => $deferred, + ]); + $this->loggerManager->debug('EventManager.fire()', $mapped); + } + + // Iterate through registered listeners for the event. + $listeners = $this->listeners[$key] ?? []; + foreach ($listeners as $fn) { + try { + $fn(($this->mapper)($args), $err); + } catch (\Throwable $ex) { + $this->loggerManager?->error('EventManager.fire()', $ex); + } + } + + // If deferred is true and no deferred record exists yet, store it. + if ($deferred && !array_key_exists($key, $this->deferred)) { + $this->deferred[$key] = ['args' => $args, 'err' => $err]; + } + } + + /** + * Removes all listeners (and deferred data) for the specified event. + * + * @param string $event The event name. + * @return void + */ + public function removeListeners(SystemEvents|string $event): void + { + $key = $event instanceof \BackedEnum ? $event->value : $event; + if (array_key_exists($key, $this->listeners)) { + unset($this->listeners[$key]); + } + if (array_key_exists($key, $this->deferred)) { + unset($this->deferred[$key]); + } + } +} diff --git a/packages/Event/src/Interfaces/EventManagerInterface.php b/packages/Event/src/Interfaces/EventManagerInterface.php new file mode 100644 index 0000000..36b18d8 --- /dev/null +++ b/packages/Event/src/Interfaces/EventManagerInterface.php @@ -0,0 +1,49 @@ +|mixed $args Optional arguments. + * @param mixed $err Optional error or exception. + * @param bool $deferred Optional flag indicating if the event should be deferred. + * @return void + */ + public function fire(SystemEvents|string $event, mixed $args = null, mixed $err = null, bool $deferred = false): void; + + /** + * Removes all listeners associated with the given event. + * + * @param string $event The event name. + * @return void + */ + public function removeListeners(SystemEvents|string $event): void; +} diff --git a/packages/Event/tests/EventManagerTest.php b/packages/Event/tests/EventManagerTest.php new file mode 100644 index 0000000..d067c67 --- /dev/null +++ b/packages/Event/tests/EventManagerTest.php @@ -0,0 +1,216 @@ +eventManager = new EventManager(); + } + + public function testClassIsFinal(): void + { + $reflection = new \ReflectionClass(EventManager::class); + $this->assertTrue($reflection->isFinal()); + } + + public function testImplementsEventManagerInterface(): void + { + $this->assertInstanceOf(EventManagerInterface::class, $this->eventManager); + } + + public function testConstructorWithDefaults(): void + { + $em = new EventManager(); + $this->assertInstanceOf(EventManager::class, $em); + $reflection = new \ReflectionClass($em); + $this->assertEquals('EventManager', $reflection->getShortName()); + } + + public function testConstructorWithMapper(): void + { + $mapper = static fn (mixed $value): mixed => $value; + $em = new EventManager(mapper: $mapper); + $this->assertInstanceOf(EventManager::class, $em); + } + + public function testMapperTransformsArgsBeforePassingToListener(): void + { + $mapper = static fn (mixed $value): mixed => is_array($value) ? array_merge($value, ['mapped' => true]) : $value; + $em = new EventManager(mapper: $mapper); + + $receivedArgs = null; + $em->on('TEST', function ($args, $err) use (&$receivedArgs) { + $receivedArgs = $args; + }); + $em->fire('TEST', ['original' => true]); + + $this->assertIsArray($receivedArgs); + $this->assertTrue($receivedArgs['original']); + $this->assertTrue($receivedArgs['mapped']); + } + + public function testShouldSubscribeToEventAndBeFiredWithProvidedDataAndNoErrors(): void + { + $args = [ + 'foo' => 'bar', + 'some' => [ + 'test' => [ + 'data' => 'value', + ], + ], + ]; + $called = 0; + $callback = function ($inputArgs, $err) use ($args, &$called) { + $this->assertEquals($args, $inputArgs); + $this->assertNull($err); + $called++; + }; + $this->eventManager->on('EVENT1', $callback); + $this->eventManager->fire('EVENT1', $args); + $this->assertEquals(1, $called); + } + + public function testShouldNotBeFiredBecauseEventListenersAreRemoved(): void + { + $called = 0; + $callback = function ($inputArgs, $err) use (&$called) { + $called++; + }; + $this->eventManager->on('EVENT2', $callback); + $this->eventManager->removeListeners('EVENT2'); + $this->eventManager->fire('EVENT2', []); + $this->assertEquals(0, $called); + } + + public function testDeferredEventListenerShouldBeFiredEvenIfSubscribedAfterTheEvent(): void + { + $called = 0; + $callback = function ($inputArgs, $err) use (&$called) { + $this->assertNull($err); + $called++; + }; + $this->eventManager->fire('EVENT2', ['deferred' => true], null, true); + $this->eventManager->on('EVENT2', $callback); + $this->assertEquals(1, $called); + } + + public function testDeferredReplayFiresAllRegisteredListeners(): void + { + $earlyCallCount = 0; + $lateCallCount = 0; + + // Register early listener before the deferred fire + $this->eventManager->on('DEFERRED', function ($args, $err) use (&$earlyCallCount) { + $earlyCallCount++; + }); + + // Fire deferred — early listener fires once here + $this->eventManager->fire('DEFERRED', ['data' => 1], null, true); + $this->assertEquals(1, $earlyCallCount, 'Early listener fires on original fire()'); + + // Register late listener — triggers deferred replay of ALL listeners + $this->eventManager->on('DEFERRED', function ($args, $err) use (&$lateCallCount) { + $lateCallCount++; + }); + + // Deferred replay fires ALL listeners (JS SDK parity behavior) + $this->assertEquals(2, $earlyCallCount, 'Early listener fires again on deferred replay'); + $this->assertEquals(1, $lateCallCount, 'Late listener fires on deferred replay'); + } + + public function testShouldSubscribeToEventAndBeFiredWithErrorProvided(): void + { + $called = 0; + $callback = function ($inputArgs, $err) use (&$called) { + $this->assertInstanceOf(\Error::class, $err); + $this->assertNull($inputArgs); + $called++; + }; + $this->eventManager->on('EVENT3', $callback); + $this->eventManager->fire('EVENT3', null, new \Error('Custom error message')); + $this->assertEquals(1, $called); + } + + public function testTenListenersOnSingleEventFireCorrectly(): void + { + $callCounts = array_fill(0, 10, 0); + for ($i = 0; $i < 10; $i++) { + $idx = $i; + $this->eventManager->on('MULTI_EVENT', function ($args, $err) use (&$callCounts, $idx) { + $callCounts[$idx]++; + }); + } + + $this->eventManager->fire('MULTI_EVENT', ['test' => 'data']); + + for ($i = 0; $i < 10; $i++) { + $this->assertEquals(1, $callCounts[$i], "Listener $i should have been called exactly once"); + } + } + + public function testSystemEventsEnumUsedForOnAndFire(): void + { + $called = 0; + $this->eventManager->on(SystemEvents::Ready, function ($args, $err) use (&$called) { + $called++; + }); + $this->eventManager->fire(SystemEvents::Ready, ['status' => 'ok']); + $this->assertEquals(1, $called); + } + + #[Group('performance')] + public function testPerformanceUnder1msFor10Listeners(): void + { + $em = new EventManager(); + for ($i = 0; $i < 10; $i++) { + $em->on('PERF_EVENT', function ($args, $err) { + // minimal no-op listener + }); + } + + // Warm up to avoid cold-start measurement skew + $em->fire('PERF_EVENT', ['warmup' => true]); + + // Measure over multiple iterations and take the median + $timings = []; + for ($run = 0; $run < 10; $run++) { + $start = hrtime(true); + $em->fire('PERF_EVENT', ['data' => 'value']); + $timings[] = (hrtime(true) - $start) / 1_000_000; + } + sort($timings); + $median = $timings[4]; // median of 10 + + $this->assertLessThan(1.0, $median, "Median event fire with 10 listeners should complete in <1ms, took {$median}ms"); + } + + public function testExceptionInListenerDoesNotBreakOtherListeners(): void + { + $secondCalled = false; + $this->eventManager->on('ERROR_EVENT', function () { + throw new \RuntimeException('listener error'); + }); + $this->eventManager->on('ERROR_EVENT', function () use (&$secondCalled) { + $secondCalled = true; + }); + + $this->eventManager->fire('ERROR_EVENT', []); + $this->assertTrue($secondCalled, 'Second listener should still fire after first throws'); + } +} diff --git a/packages/Event/tests/test-config.json b/packages/Event/tests/test-config.json new file mode 100644 index 0000000..542987e --- /dev/null +++ b/packages/Event/tests/test-config.json @@ -0,0 +1,555 @@ +{ + "environment": "staging", + "data": { + "account_id": "10022898", + "audiences": [ + { + "id": "100299433", + "name": "Adv Audience", + "type": "transient", + "status": "active", + "key": "adv-audience", + "preset": false, + "rules": { + "OR": [ + { + "AND": [ + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "matches", + "negated": false + }, + "value": "value1", + "key": "varName1" + } + ] + }, + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "matches", + "negated": false + }, + "value": "value2", + "key": "varName2" + } + ] + } + ] + }, + { + "AND": [ + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "matches", + "negated": false + }, + "value": "something", + "key": "varName3" + } + ] + } + ] + } + ] + } + } + ], + "segments": [ + { + "id": "200299434", + "name": "Test Segments", + "status": "active", + "key": "test-segments-1", + "preset": false, + "rules": { + "OR": [ + { + "AND": [ + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "matches", + "negated": false + }, + "key": "enabled", + "value": true + } + ] + } + ] + } + ] + } + } + ], + "experiences": [ + { + "id": "100218245", + "name": "Test Experience AB Fullstack", + "key": "test-experience-ab-fullstack-2", + "type": "a/b_fullstack", + "version": 6, + "status": "active", + "global_js": "var s = 'test_experience'; console.log(s);", + "global_css": ".test-style { display: initial; }", + "url": "https://convert.com", + "integrations": [], + "environments": ["live", "staging"], + "site_area": { + "OR": [ + { + "AND": [ + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "matches", + "negated": false + }, + "key": "url", + "value": "https://convert.com/" + } + ] + } + ] + } + ] + }, + "audiences": ["100299433"], + "goals": ["100215959", "100215960", "100215961"], + "variations": [ + { + "id": "100299456", + "name": "Original Page", + "status": "running", + "is_baseline": true, + "changes": [ + { + "id": "100240519", + "type": "fullStackFeature", + "data": { + "feature_id": "10024", + "variables_data": { + "enabled": "true", + "caption": "Click that" + } + } + }, + { + "id": "100240521", + "type": "fullStackFeature", + "data": { + "feature_id": "10025", + "variables_data": { + "price": 100, + "button-height": 40, + "additionalData": "{\"foo\":\"bar\",\"v\":2}" + } + } + } + ], + "key": "100299456-original-page", + "traffic_allocation": 50.0 + }, + { + "id": "100299457", + "name": "Variation 1", + "status": "running", + "is_baseline": false, + "changes": [ + { + "id": "100240520", + "type": "fullStackFeature", + "data": { + "feature_id": "10024", + "variables_data": { + "enabled": "false", + "caption": "Not allowed" + } + } + } + ], + "key": "100299457-variation-1", + "traffic_allocation": 50.0 + } + ] + }, + { + "id": "100218246", + "name": "Test Experience AB Fullstack", + "key": "test-experience-ab-fullstack-3", + "type": "a/b_fullstack", + "version": 6, + "status": "active", + "global_js": "var s = 'test_experience'; console.log(s);", + "global_css": ".test-style { display: initial; }", + "url": "https://convert.com", + "integrations": [], + "environments": ["live", "staging"], + "site_area": { + "OR": [ + { + "AND": [ + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "matches", + "negated": false + }, + "key": "url", + "value": "https://convert.com/" + } + ] + } + ] + } + ] + }, + "audiences": ["100299433"], + "goals": ["100215959", "100215960", "100215961"], + "variations": [ + { + "id": "100299460", + "name": "Original Page", + "status": "running", + "is_baseline": true, + "changes": [ + { + "id": "100240529", + "type": "fullStackFeature", + "data": { + "feature_id": "10024", + "variables_data": { + "enabled": "true", + "caption": "Click that" + } + } + } + ], + "key": "100299460-original-page", + "traffic_allocation": 50.0 + }, + { + "id": "100299461", + "name": "Variation 1", + "status": "running", + "is_baseline": false, + "changes": [ + { + "id": "100240532", + "type": "fullStackFeature", + "data": { + "feature_id": "10024", + "variables_data": { + "enabled": "true", + "caption": "Allowed" + } + } + } + ], + "key": "100299461-variation-1", + "traffic_allocation": 50.0 + } + ] + }, + { + "id": "100218247", + "name": "Test Experience AB Fullstack", + "key": "test-experience-ab-fullstack-4", + "type": "a/b_fullstack", + "version": 6, + "status": "active", + "global_js": "var s = 'test_experience'; console.log(s);", + "global_css": ".test-style { display: initial; }", + "url": "https://convert.com", + "integrations": [], + "environments": ["live", "staging"], + "site_area": { + "OR": [ + { + "AND": [ + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "matches", + "negated": false + }, + "key": "url", + "value": "https://convert.com/" + } + ] + } + ] + } + ] + }, + "audiences": ["100299433"], + "goals": ["100215959", "100215960", "100215961"], + "variations": [{}] + } + ], + "features": [ + { + "id": "10024", + "name": "Feature 1", + "key": "feature-1", + "variables": [ + { + "key": "enabled", + "type": "boolean" + }, + { + "key": "caption", + "type": "string" + } + ] + }, + { + "id": "10025", + "name": "Feature 2", + "key": "feature-2", + "variables": [ + { + "key": "price", + "type": "float" + }, + { + "key": "button-height", + "type": "integer" + }, + { + "key": "additionalData", + "type": "json" + } + ] + }, + { + "id": "10026", + "name": "Not Attached Feature 3", + "key": "not-attached-feature-3", + "variables": [ + { + "key": "fee", + "type": "float" + }, + { + "key": "link", + "type": "string" + }, + { + "key": "additionalData", + "type": "json" + } + ] + } + ], + "goals": [ + { + "id": "100215960", + "name": "Increase Engagement", + "selected_default": true, + "status": "active", + "type": "dom_interaction", + "is_system": true, + "key": "increase-engagement", + "settings": { + "tracked_items": [ + { + "event": "click", + "selector": "a" + }, + { + "event": "submit", + "selector": "form" + } + ] + }, + "rules": { + "OR": [ + { + "AND": [ + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "matches", + "negated": false + }, + "key": "action", + "value": "buy" + }, + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "matches", + "negated": false + }, + "key": "action", + "value": "signup" + } + ] + } + ] + } + ] + } + }, + { + "id": "100215959", + "name": "Decrease BounceRate", + "selected_default": true, + "status": "active", + "type": "advanced", + "is_system": true, + "key": "decrease-bounce-rate", + "rules": { + "OR": [ + { + "AND": [ + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "lessEqual", + "negated": true + }, + "value": 1, + "key": "pages_visited_count" + }, + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "lessEqual", + "negated": true + }, + "value": 10, + "key": "visit_duration" + } + ] + } + ] + } + ] + } + }, + { + "id": "100215961", + "name": "adv goal country browser", + "selected_default": false, + "status": "active", + "type": "advanced", + "is_system": false, + "key": "adv-goal-country-browser", + "rules": { + "OR": [ + { + "AND": [ + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "equals", + "negated": false + }, + "value": "US", + "key": "country" + } + ] + }, + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "equals", + "negated": false + }, + "value": "chrome", + "key": "browser_name" + } + ] + } + ] + }, + { + "AND": [ + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "equals", + "negated": false + }, + "value": "GB", + "key": "country" + } + ] + }, + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "equals", + "negated": false + }, + "value": "safari", + "key": "browser_name" + } + ] + } + ] + } + ] + } + }, + { + "id": "100215962", + "key": "goal-without-rule" + } + ], + "project": { + "id": "10025986", + "name": "Test Project", + "type": "fullstack", + "utc_offset": 0, + "domains": [ + { + "id": "10029181", + "hosts": "https://convert.com/", + "tld": false + } + ], + "settings": { + "auto_link": false, + "data_anonymization": false, + "do_not_track": "OFF", + "include_jquery": false + }, + "environments": { + "live": "Live", + "staging": "Staging" + } + } + } +} diff --git a/packages/Experience/composer.json b/packages/Experience/composer.json new file mode 100644 index 0000000..5f63f05 --- /dev/null +++ b/packages/Experience/composer.json @@ -0,0 +1,80 @@ +{ + "name": "convertcom/php-sdk-experience", + "description": "PHP SDK for Convert Experience Management", + "type": "library", + "license": "Apache-2.0", + "authors": [ + { + "name": "Convert Insights, Inc", + "email": "support@convert.com" + } + ], + "autoload": { + "psr-4": { + "ConvertSdk\\": "src/", + "ConvertSdk\\Config\\": "../Php-sdk/src/Config/" + + } + }, + "repositories": { + "Enums": { + "type": "path", + "url": "../Enums" + }, + "Api": { + "type": "path", + "url": "../Api" + }, + "Logger": { + "type": "path", + "url": "../Logger" + }, + "Event": { + "type": "path", + "url": "../Event" + }, + "Rules": { + "type": "path", + "url": "../Rules" + }, + "Types": { + "type": "path", + "url": "../Types" + }, + "Utils": { + "type": "path", + "url": "../Utils" + }, + "Data": { + "type": "path", + "url": "../Data" + }, + "Bucketing": { + "type": "path", + "url": "../Bucketing" + } + }, + "require": { + "php": "^8.2", + "convertcom/php-sdk-api": ">=1.0.0", + "convertcom/php-sdk-enums": ">=1.0.0", + "convertcom/php-sdk-event": ">=1.0.0", + "convertcom/php-sdk-logger": ">=1.0.0", + "convertcom/php-sdk-rules": ">=1.0.0", + "convertcom/php-sdk-data": ">=1.0.0", + "convertcom/php-sdk-bucketing": ">=1.0.0", + "convertcom/php-sdk-types": ">=1.0.0", + "convertcom/php-sdk-utils": ">=1.0.0" + }, + "require-dev": { + "phpunit/phpunit": "^11.0", + "mockery/mockery": "^1.4" + }, + "scripts": { + "test": "phpunit --config phpunit.xml", + "clean": "rm -rf vendor/ composer.lock" + }, + "version": "1.0.0", + "minimum-stability": "stable", + "prefer-stable": true +} diff --git a/packages/Experience/phpunit.xml b/packages/Experience/phpunit.xml new file mode 100644 index 0000000..1e5ea93 --- /dev/null +++ b/packages/Experience/phpunit.xml @@ -0,0 +1,24 @@ + + + + + ./tests + + + + + + + + + + src + + + diff --git a/packages/Experience/src/ExperienceManager.php b/packages/Experience/src/ExperienceManager.php new file mode 100644 index 0000000..1562169 --- /dev/null +++ b/packages/Experience/src/ExperienceManager.php @@ -0,0 +1,288 @@ +logManager?->trace('ExperienceManager()', Messages::EXPERIENCE_CONSTRUCTOR); + } + + /** + * Get a list of all experiences. + * + * @return ConfigExperience[] Array of experience configurations + */ + public function getList(): array + { + return $this->dataManager->getEntitiesList('experiences'); + } + + /** + * Get an experience by its key. + * + * @param string $key The experience key + * @return ConfigExperience|null The experience configuration, or null if not found + */ + public function getExperience(string $key): ?ConfigExperience + { + $entityData = $this->dataManager->getEntity($key, 'experiences'); + if ($entityData === null) { + return null; + } + return new ConfigExperience($entityData); + } + + /** + * Get an experience by its ID. + * + * @param string $id The experience ID + * @return ConfigExperience|null The experience configuration, or null if not found + */ + public function getExperienceById(string $id): ?ConfigExperience + { + $entityData = $this->dataManager->getEntityById($id, 'experiences'); + if ($entityData === null) { + return null; + } + return new ConfigExperience($entityData); + } + + /** + * Get multiple experiences by their keys. + * + * @param string[] $keys Array of experience keys + * @return ConfigExperience[] Array of experience configurations + */ + public function getExperiences(array $keys): array + { + return $this->dataManager->getItemsByKeys($keys, 'experiences'); + } + + /** + * Select a variation for a visitor based on experience key. + * + * @param string $visitorId The visitor's ID + * @param string $experienceKey The experience key + * @param BucketingAttributes $attributes Bucketing attributes for variation selection + * @return array|RuleError|BucketingError|null The selected variation array, or an error/null + */ + public function selectVariation(string $visitorId, string $experienceKey, BucketingAttributes $attributes): array|RuleError|BucketingError|null + { + $this->logManager?->debug('ExperienceManager.selectVariation()', [ + 'visitorId' => $visitorId, + 'experienceKey' => $experienceKey, + ]); + + $result = $this->dataManager->getBucketing($visitorId, $experienceKey, $attributes); + + if ($this->logManager) { + $logData = [ + 'visitorId' => $visitorId, + 'experienceKey' => $experienceKey, + ]; + + if (is_array($result)) { + $logData['resultType'] = 'bucketed'; + $logData['variationId'] = $result['id'] ?? $result['key'] ?? 'unknown'; + } elseif ($result instanceof RuleError) { + $logData['resultType'] = 'RuleError'; + $logData['ruleError'] = $result->value; + } elseif ($result instanceof BucketingError) { + $logData['resultType'] = 'BucketingError'; + $logData['bucketingError'] = $result->value; + $logData['reason'] = Messages::NULL_RETURN_TRAFFIC_ALLOCATION; + } elseif ($result === null) { + // Determine specific null-return reason for consumer-facing log + $logData['resultType'] = 'null'; + $experience = $this->dataManager->getEntity($experienceKey, 'experiences'); + if ($experience === null) { + $logData['reason'] = Messages::NULL_RETURN_EXPERIENCE_NOT_FOUND; + $logData['availableKeys'] = array_map( + fn ($e) => $e['key'] ?? 'unknown', + $this->dataManager->getEntitiesList('experiences') + ); + } else { + // Experience exists but visitor not qualified — DataManager already + // logged the specific reason (audience mismatch, location mismatch, + // experience archived, environment mismatch) + $logData['reason'] = Messages::NULL_RETURN_VISITOR_NOT_QUALIFIED; + } + } + + $this->logManager->debug('ExperienceManager.selectVariation()', LogUtils::toLoggable($logData)); + } + + return $result; + } + + /** + * Select a variation for a visitor based on experience ID. + * + * @param string $visitorId The visitor's ID + * @param string $experienceId The experience ID + * @param BucketingAttributes $attributes Bucketing attributes for variation selection + * @return array|RuleError|BucketingError|null The selected variation array, or an error/null + */ + public function selectVariationById(string $visitorId, string $experienceId, BucketingAttributes $attributes): array|RuleError|BucketingError|null + { + $this->logManager?->debug('ExperienceManager.selectVariationById()', [ + 'visitorId' => $visitorId, + 'experienceId' => $experienceId, + ]); + + $result = $this->dataManager->getBucketingById($visitorId, $experienceId, $attributes); + + if ($this->logManager) { + $logData = [ + 'visitorId' => $visitorId, + 'experienceId' => $experienceId, + ]; + + if (is_array($result)) { + $logData['resultType'] = 'bucketed'; + $logData['variationId'] = $result['id'] ?? $result['key'] ?? 'unknown'; + } elseif ($result instanceof RuleError) { + $logData['resultType'] = 'RuleError'; + $logData['ruleError'] = $result->value; + } elseif ($result instanceof BucketingError) { + $logData['resultType'] = 'BucketingError'; + $logData['bucketingError'] = $result->value; + $logData['reason'] = Messages::NULL_RETURN_TRAFFIC_ALLOCATION; + } elseif ($result === null) { + $logData['resultType'] = 'null'; + $experience = $this->dataManager->getEntityById($experienceId, 'experiences'); + if ($experience === null) { + $logData['reason'] = Messages::NULL_RETURN_EXPERIENCE_NOT_FOUND; + $logData['availableIds'] = array_map( + fn ($e) => $e['id'] ?? 'unknown', + $this->dataManager->getEntitiesList('experiences') + ); + } else { + $logData['reason'] = Messages::NULL_RETURN_VISITOR_NOT_QUALIFIED; + } + } + + $this->logManager->debug('ExperienceManager.selectVariationById()', LogUtils::toLoggable($logData)); + } + + return $result; + } + + /** + * Select variations for a visitor across all experiences. + * + * Filters out null, RuleError, and BucketingError results — only successful + * bucketed variation arrays are returned. + * + * @param string $visitorId The visitor's ID + * @param BucketingAttributes $attributes Bucketing attributes for variation selection + * @return array> Array of successful bucketed variation arrays + */ + public function selectVariations(string $visitorId, BucketingAttributes $attributes): array + { + $experiences = $this->getList(); + + $experienceCount = count($experiences); + + $this->logManager?->debug('ExperienceManager.selectVariations()', [ + 'visitorId' => $visitorId, + 'experienceCount' => $experienceCount, + ]); + + $variations = array_map(function ($experience) use ($visitorId, $attributes) { + return $this->selectVariation($visitorId, $experience['key'], $attributes); + }, $experiences); + $filteredVariations = array_filter($variations, function ($variation) { + return $variation !== null && + !($variation instanceof RuleError) && + $variation !== BucketingError::VariationNotDecided; + }); + $result = array_values($filteredVariations); // Re-index array after filtering + + $this->logManager?->debug('ExperienceManager.selectVariations()', [ + 'visitorId' => $visitorId, + 'experienceCount' => $experienceCount, + 'bucketedVariations' => count($result), + ]); + + return $result; + } + + /** + * Get a variation by experience key and variation key. + * + * @param string $experienceKey The experience key + * @param string $variationKey The variation key + * @return ExperienceVariationConfig The variation configuration + */ + public function getVariation(string $experienceKey, string $variationKey): ExperienceVariationConfig + { + $variationData = $this->dataManager->getSubItem( + 'experiences', + $experienceKey, + 'variations', + $variationKey, + 'key', + 'key' + ); + + return new ExperienceVariationConfig($variationData); + } + + /** + * Get a variation by experience ID and variation ID. + * + * @param string $experienceId The experience ID + * @param string $variationId The variation ID + * @return ExperienceVariationConfig The variation configuration + */ + public function getVariationById(string $experienceId, string $variationId): ExperienceVariationConfig + { + $variationData = $this->dataManager->getSubItem( + 'experiences', + $experienceId, + 'variations', + $variationId, + 'id', + 'id' + ); + + return new ExperienceVariationConfig($variationData); + } +} diff --git a/packages/Experience/src/Interfaces/ExperienceManagerInterface.php b/packages/Experience/src/Interfaces/ExperienceManagerInterface.php new file mode 100644 index 0000000..7d5ad40 --- /dev/null +++ b/packages/Experience/src/Interfaces/ExperienceManagerInterface.php @@ -0,0 +1,102 @@ +> Array of successful bucketed variation arrays + */ + public function selectVariations(string $visitorId, BucketingAttributes $attributes): array; + + /** + * Get a variation by experience key and variation key. + * + * @param string $experienceKey The experience key + * @param string $variationKey The variation key + * @return ExperienceVariationConfig The variation configuration + */ + public function getVariation(string $experienceKey, string $variationKey): ExperienceVariationConfig; + + /** + * Get a variation by experience ID and variation ID. + * + * @param string $experienceId The experience ID + * @param string $variationId The variation ID + * @return ExperienceVariationConfig The variation configuration + */ + public function getVariationById(string $experienceId, string $variationId): ExperienceVariationConfig; +} diff --git a/packages/Experience/tests/ExperienceManagerNullReturnLoggingTest.php b/packages/Experience/tests/ExperienceManagerNullReturnLoggingTest.php new file mode 100644 index 0000000..8fad53c --- /dev/null +++ b/packages/Experience/tests/ExperienceManagerNullReturnLoggingTest.php @@ -0,0 +1,245 @@ +dataManager = $this->createMock(DataManagerInterface::class); + $this->logManager = $this->createMock(LogManagerInterface::class); + $this->experienceManager = new ExperienceManager( + dataManager: $this->dataManager, + logManager: $this->logManager, + ); + } + + public function testSelectVariationLogsExperienceNotFoundWithAvailableKeys(): void + { + // getBucketing returns null (experience not found internally) + $this->dataManager + ->method('getBucketing') + ->willReturn(null); + + // Post-bucketing getEntity check confirms experience doesn't exist + $this->dataManager + ->method('getEntity') + ->with('nonexistent-key', 'experiences') + ->willReturn(null); + + $this->dataManager + ->method('getEntitiesList') + ->with('experiences') + ->willReturn([ + ['key' => 'exp-alpha', 'id' => '100'], + ['key' => 'exp-beta', 'id' => '200'], + ]); + + $debugCalls = []; + $this->logManager->expects($this->atLeastOnce()) + ->method('debug') + ->willReturnCallback(function (string $method, array $data) use (&$debugCalls): void { + $debugCalls[] = ['method' => $method, 'data' => $data]; + }); + + $result = $this->experienceManager->selectVariation( + 'visitor-123', + 'nonexistent-key', + new BucketingAttributes([]) + ); + + $this->assertNull($result); + + // Find the "not found" log call + $notFoundCalls = array_filter($debugCalls, function ($call) { + return $call['method'] === 'ExperienceManager.selectVariation()' + && isset($call['data']['reason']) + && $call['data']['reason'] === Messages::NULL_RETURN_EXPERIENCE_NOT_FOUND; + }); + + $this->assertNotEmpty($notFoundCalls, 'Expected debug log with experience not found reason'); + + $logCall = reset($notFoundCalls); + $this->assertSame('nonexistent-key', $logCall['data']['experienceKey']); + $this->assertSame('visitor-123', $logCall['data']['visitorId']); + $this->assertContains('exp-alpha', $logCall['data']['availableKeys']); + $this->assertContains('exp-beta', $logCall['data']['availableKeys']); + } + + public function testSelectVariationLogsVisitorNotQualifiedWhenBucketingReturnsNull(): void + { + $this->dataManager + ->method('getBucketing') + ->willReturn(null); + + // Post-bucketing getEntity check confirms experience exists (so reason is "not qualified") + $this->dataManager + ->method('getEntity') + ->with('geo-test', 'experiences') + ->willReturn(['id' => '100', 'key' => 'geo-test', 'name' => 'Geo Test']); + + $debugCalls = []; + $this->logManager->expects($this->atLeastOnce()) + ->method('debug') + ->willReturnCallback(function (string $method, array $data) use (&$debugCalls): void { + $debugCalls[] = ['method' => $method, 'data' => $data]; + }); + + $result = $this->experienceManager->selectVariation( + 'visitor-456', + 'geo-test', + new BucketingAttributes([]) + ); + + $this->assertNull($result); + + // Find the null-return reason log + $nullReturnCalls = array_filter($debugCalls, function ($call) { + return $call['method'] === 'ExperienceManager.selectVariation()' + && isset($call['data']['reason']) + && $call['data']['reason'] === Messages::NULL_RETURN_VISITOR_NOT_QUALIFIED; + }); + + $this->assertNotEmpty($nullReturnCalls, 'Expected debug log with visitor not qualified reason'); + + $logCall = reset($nullReturnCalls); + $this->assertSame('visitor-456', $logCall['data']['visitorId']); + $this->assertSame('geo-test', $logCall['data']['experienceKey']); + $this->assertSame('null', $logCall['data']['resultType']); + } + + public function testSelectVariationLogsTrafficAllocationReasonForBucketingError(): void + { + $this->dataManager + ->method('getBucketing') + ->willReturn(BucketingError::VariationNotDecided); + + $debugCalls = []; + $this->logManager->expects($this->atLeastOnce()) + ->method('debug') + ->willReturnCallback(function (string $method, array $data) use (&$debugCalls): void { + $debugCalls[] = ['method' => $method, 'data' => $data]; + }); + + $result = $this->experienceManager->selectVariation( + 'visitor-789', + 'limited-test', + new BucketingAttributes([]) + ); + + $this->assertSame(BucketingError::VariationNotDecided, $result); + + $trafficCalls = array_filter($debugCalls, function ($call) { + return $call['method'] === 'ExperienceManager.selectVariation()' + && isset($call['data']['reason']) + && $call['data']['reason'] === Messages::NULL_RETURN_TRAFFIC_ALLOCATION; + }); + + $this->assertNotEmpty($trafficCalls, 'Expected debug log with traffic allocation reason'); + } + + public function testSelectVariationByIdLogsExperienceNotFoundWithAvailableIds(): void + { + $this->dataManager + ->method('getBucketingById') + ->willReturn(null); + + $this->dataManager + ->method('getEntityById') + ->with('999', 'experiences') + ->willReturn(null); + + $this->dataManager + ->method('getEntitiesList') + ->with('experiences') + ->willReturn([ + ['id' => '100', 'key' => 'exp-alpha'], + ['id' => '200', 'key' => 'exp-beta'], + ]); + + $debugCalls = []; + $this->logManager->expects($this->atLeastOnce()) + ->method('debug') + ->willReturnCallback(function (string $method, array $data) use (&$debugCalls): void { + $debugCalls[] = ['method' => $method, 'data' => $data]; + }); + + $result = $this->experienceManager->selectVariationById( + 'visitor-123', + '999', + new BucketingAttributes([]) + ); + + $this->assertNull($result); + + $notFoundCalls = array_filter($debugCalls, function ($call) { + return $call['method'] === 'ExperienceManager.selectVariationById()' + && isset($call['data']['reason']) + && $call['data']['reason'] === Messages::NULL_RETURN_EXPERIENCE_NOT_FOUND; + }); + + $this->assertNotEmpty($notFoundCalls, 'Expected debug log with experience not found reason'); + + $logCall = reset($notFoundCalls); + $this->assertContains('100', $logCall['data']['availableIds']); + $this->assertContains('200', $logCall['data']['availableIds']); + } + + public function testSelectVariationWithNullLogManagerNoException(): void + { + $em = new ExperienceManager(dataManager: $this->dataManager); + + $this->dataManager + ->method('getBucketing') + ->willReturn(null); + + $result = $em->selectVariation('visitor-1', 'nonexistent', new BucketingAttributes([])); + $this->assertNull($result); + } + + public function testSelectVariationByIdWithNullLogManagerNoException(): void + { + $em = new ExperienceManager(dataManager: $this->dataManager); + + $this->dataManager + ->method('getBucketingById') + ->willReturn(null); + + $result = $em->selectVariationById('visitor-1', '999', new BucketingAttributes([])); + $this->assertNull($result); + } + + public function testSelectVariationReturnsNullNotExceptionForBusinessLogicMisses(): void + { + // AC #5: null-return path returns null, never an exception + $this->dataManager + ->method('getBucketing') + ->willReturn(null); + + $result = $this->experienceManager->selectVariation( + 'visitor-1', + 'nonexistent', + new BucketingAttributes([]) + ); + + $this->assertNull($result); + } +} diff --git a/packages/Experience/tests/ExperienceManagerUnitTest.php b/packages/Experience/tests/ExperienceManagerUnitTest.php new file mode 100644 index 0000000..85c0424 --- /dev/null +++ b/packages/Experience/tests/ExperienceManagerUnitTest.php @@ -0,0 +1,313 @@ +dataManager = $this->createMock(DataManagerInterface::class); + $this->logManager = $this->createMock(LogManagerInterface::class); + $this->experienceManager = new ExperienceManager( + dataManager: $this->dataManager, + logManager: $this->logManager, + ); + } + + public function testClassIsFinal(): void + { + $reflection = new \ReflectionClass(ExperienceManager::class); + $this->assertTrue($reflection->isFinal()); + } + + public function testConstructorUsesTypedParameters(): void + { + $reflection = new \ReflectionClass(ExperienceManager::class); + $constructor = $reflection->getConstructor(); + $this->assertNotNull($constructor); + + $params = $constructor->getParameters(); + $this->assertSame('dataManager', $params[0]->getName()); + $this->assertSame('logManager', $params[1]->getName()); + $this->assertTrue($params[1]->isOptional()); + } + + public function testSelectVariationReturnsResult(): void + { + $expectedResult = [ + 'experienceId' => '100218245', + 'experienceName' => 'Test Experience', + 'experienceKey' => 'pricing-test', + 'bucketingAllocation' => 5000, + 'id' => '100299456', + 'key' => '100299456-variation-1', + 'name' => 'Variation 1', + 'changes' => [], + 'traffic_allocation' => 50, + 'status' => 'active', + ]; + + $this->dataManager + ->expects($this->once()) + ->method('getBucketing') + ->with('visitor-456', 'pricing-test', $this->isInstanceOf(BucketingAttributes::class)) + ->willReturn($expectedResult); + + $result = $this->experienceManager->selectVariation( + 'visitor-456', + 'pricing-test', + new BucketingAttributes([]) + ); + + $this->assertIsArray($result); + $this->assertSame('pricing-test', $result['experienceKey']); + $this->assertSame('100299456', $result['id']); + } + + public function testSelectVariationDelegatesToDataManager(): void + { + $attributes = new BucketingAttributes([ + 'visitorProperties' => ['plan' => 'premium'], + ]); + + $this->dataManager + ->expects($this->once()) + ->method('getBucketing') + ->with('visitor-789', 'my-experiment', $attributes) + ->willReturn(null); + + $result = $this->experienceManager->selectVariation('visitor-789', 'my-experiment', $attributes); + $this->assertNull($result); + } + + public function testSelectVariationReturnsRuleErrorFromDataManager(): void + { + $this->dataManager + ->expects($this->once()) + ->method('getBucketing') + ->willReturn(RuleError::NoDataFound); + + $result = $this->experienceManager->selectVariation( + 'visitor-1', + 'test-exp', + new BucketingAttributes([]) + ); + + $this->assertSame(RuleError::NoDataFound, $result); + } + + public function testSelectVariationReturnsBucketingErrorFromDataManager(): void + { + $this->dataManager + ->expects($this->once()) + ->method('getBucketing') + ->willReturn(BucketingError::VariationNotDecided); + + $result = $this->experienceManager->selectVariation( + 'visitor-1', + 'test-exp', + new BucketingAttributes([]) + ); + + $this->assertSame(BucketingError::VariationNotDecided, $result); + } + + public function testSelectVariationsFiltersErrors(): void + { + $validVariation = [ + 'experienceId' => '100', + 'experienceKey' => 'exp-1', + 'id' => '200', + 'key' => 'var-1', + 'changes' => [], + ]; + + $dataManager = $this->createMock(DataManagerInterface::class); + $dataManager + ->method('getEntitiesList') + ->with('experiences') + ->willReturn([ + ['key' => 'exp-1'], + ['key' => 'exp-2'], + ['key' => 'exp-3'], + ]); + + $dataManager + ->method('getBucketing') + ->willReturnCallback(function (string $visitorId, string $key) use ($validVariation): array|RuleError|BucketingError|null { + return match ($key) { + 'exp-1' => $validVariation, + 'exp-2' => RuleError::NoDataFound, + 'exp-3' => BucketingError::VariationNotDecided, + default => null, + }; + }); + + $em = new ExperienceManager(dataManager: $dataManager); + $results = $em->selectVariations('visitor-1', new BucketingAttributes([])); + + $this->assertCount(1, $results); + $this->assertSame('exp-1', $results[0]['experienceKey']); + } + + public function testSelectVariationsReturnsEmptyArrayWhenNoExperiences(): void + { + $this->dataManager + ->method('getEntitiesList') + ->with('experiences') + ->willReturn([]); + + $results = $this->experienceManager->selectVariations('visitor-1', new BucketingAttributes([])); + + $this->assertIsArray($results); + $this->assertCount(0, $results); + } + + public function testGetExperienceDelegatesToDataManager(): void + { + $entityData = ['id' => '100', 'key' => 'my-exp', 'name' => 'My Experiment']; + + $this->dataManager + ->expects($this->once()) + ->method('getEntity') + ->with('my-exp', 'experiences') + ->willReturn($entityData); + + $result = $this->experienceManager->getExperience('my-exp'); + $this->assertNotNull($result); + $this->assertSame('100', $result['id']); + } + + public function testGetExperienceReturnsNullWhenNotFound(): void + { + $this->dataManager + ->expects($this->once()) + ->method('getEntity') + ->with('nonexistent', 'experiences') + ->willReturn(null); + + $result = $this->experienceManager->getExperience('nonexistent'); + $this->assertNull($result); + } + + public function testSelectVariationsReindexesArray(): void + { + $variation1 = [ + 'experienceId' => '100', + 'experienceKey' => 'exp-1', + 'id' => '200', + 'key' => 'var-1', + 'changes' => [], + ]; + $variation2 = [ + 'experienceId' => '101', + 'experienceKey' => 'exp-3', + 'id' => '201', + 'key' => 'var-2', + 'changes' => [], + ]; + + $this->dataManager = $this->createMock(DataManagerInterface::class); + $this->dataManager + ->method('getEntitiesList') + ->willReturn([ + ['key' => 'exp-1'], + ['key' => 'exp-2'], + ['key' => 'exp-3'], + ]); + + $this->dataManager + ->method('getBucketing') + ->willReturnCallback(fn (string $v, string $key) => match ($key) { + 'exp-1' => $variation1, + 'exp-2' => null, + 'exp-3' => $variation2, + default => null, + }); + + $this->experienceManager = new ExperienceManager(dataManager: $this->dataManager); + + $results = $this->experienceManager->selectVariations('visitor-1', new BucketingAttributes([])); + + $this->assertCount(2, $results); + // Verify array is 0-indexed (re-indexed after filtering) + $this->assertArrayHasKey(0, $results); + $this->assertArrayHasKey(1, $results); + $this->assertSame('exp-1', $results[0]['experienceKey']); + $this->assertSame('exp-3', $results[1]['experienceKey']); + } + + public function testCanBeConstructedWithoutLogManager(): void + { + $em = new ExperienceManager(dataManager: $this->dataManager); + $this->assertInstanceOf(ExperienceManager::class, $em); + } + + public function testSelectVariationLogsDebugEntryAndResult(): void + { + $this->dataManager + ->method('getBucketing') + ->willReturn(['id' => '200', 'key' => 'var-1', 'experienceKey' => 'exp-1', 'changes' => []]); + + $this->logManager->expects($this->atLeast(2)) + ->method('debug') + ->with( + $this->equalTo('ExperienceManager.selectVariation()'), + $this->isType('array') + ); + + $this->experienceManager->selectVariation('visitor-1', 'exp-1', new BucketingAttributes([])); + } + + public function testSelectVariationsLogsDebugWithCounts(): void + { + $this->dataManager + ->method('getEntitiesList') + ->with('experiences') + ->willReturn([['key' => 'exp-1']]); + + $this->dataManager + ->method('getBucketing') + ->willReturn(['id' => '200', 'key' => 'var-1', 'experienceKey' => 'exp-1', 'changes' => []]); + + $this->logManager->expects($this->atLeastOnce()) + ->method('debug'); + + $results = $this->experienceManager->selectVariations('visitor-1', new BucketingAttributes([])); + + $this->assertCount(1, $results); + } + + public function testSelectVariationWithNullLogManagerNoException(): void + { + $em = new ExperienceManager(dataManager: $this->dataManager); + + $this->dataManager + ->method('getBucketing') + ->willReturn(null); + + $result = $em->selectVariation('visitor-1', 'exp-1', new BucketingAttributes([])); + $this->assertNull($result); + } +} diff --git a/packages/Experience/tests/ExperienceTest.php b/packages/Experience/tests/ExperienceTest.php new file mode 100644 index 0000000..c23c32a --- /dev/null +++ b/packages/Experience/tests/ExperienceTest.php @@ -0,0 +1,264 @@ + [ + 'endpoint' => [ + 'config' => 'http://localhost:8090', + 'track' => 'http://localhost:8090', + ], + ], + 'events' => [ + 'batch_size' => $this->batchSize, + 'release_interval' => $this->releaseTimeout, + ], + ]); + $configuration['data'] = new ConfigResponseData($configuration['data']); + if (isset($configuration['sdkKey'])) { + unset($configuration['sdkKey']); + } + // Create Config object + $config = new Config($configuration); + + // Extract account and project IDs + $this->accountId = $configuration['data']['account_id']; + $this->projectId = $configuration['data']['project']['id']; + + // Instantiate managers with dependencies + $bucketingConfig = $config->getBucketing(); + $bucketingManager = new BucketingManager( + maxTraffic: $bucketingConfig['max_traffic'] ?? 10000, + hashSeed: $bucketingConfig['hash_seed'] ?? 9999, + ); + $ruleManager = new RuleManager(); + $eventManager = new EventManager(); + $loggerManager = new LogManager(null, LogLevel::Trace); + $apiManager = new ApiManager($config, $eventManager, $loggerManager); + $this->dataManager = new DataManager( + $config, + $bucketingManager, + $ruleManager, + $eventManager, + $apiManager, + $loggerManager + ); + + $this->experienceManager = new ExperienceManager(dataManager: $this->dataManager); + } + + /** + * Test that the ExperienceManager class is defined. + */ + public function testExperienceManagerIsDefined(): void + { + $this->assertTrue(class_exists(ExperienceManager::class)); + } + + /** + * Test that the ExperienceManager instance is correctly constructed. + */ + public function testExperienceManagerConstructor(): void + { + $this->assertInstanceOf(ExperienceManager::class, $this->experienceManager); + } + + /** + * Test getting the list of all experiences. + */ + public function testGetList(): void + { + $entities = $this->experienceManager->getList(); + $testConfig = json_decode(file_get_contents(__DIR__ . '/test-config.json'), true); + + $this->assertIsArray($entities); + $this->assertCount(3, $entities); + $this->assertEquals($testConfig['data']['experiences'], $entities); + } + + /** + * Test getting an experience by key. + */ + public function testGetExperience(): void + { + $experienceKey = 'test-experience-ab-fullstack-2'; + $experienceId = '100218245'; + $entity = $this->experienceManager->getExperience($experienceKey); + + $this->assertIsObject($entity); + $this->assertEquals($experienceId, $entity['id']); + } + + /** + * Test getting an experience by ID. + */ + public function testGetExperienceById(): void + { + $experienceKey = 'test-experience-ab-fullstack-2'; + $experienceId = '100218245'; + $entity = $this->experienceManager->getExperienceById($experienceId); + + $this->assertIsObject($entity); + $this->assertEquals($experienceKey, $entity['key']); + } + + /** + * Test getting multiple experiences by an array of keys. + */ + public function testGetExperiences(): void + { + $experienceKeys = [ + 'test-experience-ab-fullstack-2', + 'test-experience-ab-fullstack-3', + 'test-experience-ab-fullstack-4', + ]; + $entities = $this->experienceManager->getExperiences($experienceKeys); + $testConfig = json_decode(file_get_contents(__DIR__ . '/test-config.json'), true); + + $this->assertIsArray($entities); + $this->assertCount(3, $entities); + $this->assertEquals($testConfig['data']['experiences'], $entities); + } + + /** + * Test selecting a variation for a specific visitor by experience key. + */ + public function testSelectVariation(): void + { + $experienceKey = 'test-experience-ab-fullstack-2'; + $variation = $this->experienceManager->selectVariation( + $this->visitorId, + $experienceKey, + new BucketingAttributes([ + 'visitorProperties' => ['varName3' => 'something'], + 'locationProperties' => ['url' => 'https://convert.com/'], + ]) + ); + $this->assertIsArray($variation); + $this->assertEquals($experienceKey, $variation['experienceKey']); + } + + /** + * Test selecting a variation for a specific visitor by experience ID. + */ + public function testSelectVariationById(): void + { + $experienceId = '100218245'; + $variation = $this->experienceManager->selectVariationById( + $this->visitorId, + $experienceId, + new BucketingAttributes([ + 'visitorProperties' => ['varName3' => 'something'], + 'locationProperties' => ['url' => 'https://convert.com/'], + ]) + ); + + $this->assertIsArray($variation); + $this->assertEquals($experienceId, $variation['experienceId']); + } + + /** + * Test selecting all variations across all experiences for a specific visitor. + */ + public function testSelectVariations(): void + { + $variationIds = ['100299456', '100299457', '100299460', '100299461']; + $variations = $this->experienceManager->selectVariations( + $this->visitorId, + new BucketingAttributes([ + 'visitorProperties' => ['varName3' => 'something'], + 'locationProperties' => ['url' => 'https://convert.com/'], + ]) + ); + + $this->assertIsArray($variations); + $this->assertCount(2, $variations); + $selectedVariationIds = array_column($variations, 'id'); + foreach ($selectedVariationIds as $id) { + $this->assertContains($id, $variationIds); + } + } + + /** + * Test getting a variation by experience key and variation key. + */ + public function testGetVariation(): void + { + $experienceKey = 'test-experience-ab-fullstack-2'; + $variationKey = '100299457-variation-1'; + $variationId = '100299457'; + $variation = $this->experienceManager->getVariation($experienceKey, $variationKey); + + $this->assertIsObject($variation); + $this->assertEquals($variationId, $variation['id']); + } + + /** + * Test getting a variation by experience ID and variation ID. + */ + public function testGetVariationById(): void + { + $experienceId = '100218245'; + $variationKey = '100299457-variation-1'; + $variationId = '100299457'; + $variation = $this->experienceManager->getVariationById($experienceId, $variationId); + + $this->assertIsObject($variation); + $this->assertEquals($variationKey, $variation['key']); + } +} diff --git a/packages/Experience/tests/test-config.json b/packages/Experience/tests/test-config.json new file mode 100644 index 0000000..8fed8d7 --- /dev/null +++ b/packages/Experience/tests/test-config.json @@ -0,0 +1,570 @@ +{ + "environment": "staging", + "data": { + "account_id": "10022898", + "audiences": [ + { + "id": "100299433", + "name": "Adv Audience", + "type": "transient", + "status": "active", + "key": "adv-audience", + "preset": false, + "rules": { + "OR": [ + { + "AND": [ + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "matches", + "negated": false + }, + "value": "value1", + "key": "varName1" + } + ] + }, + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "matches", + "negated": false + }, + "value": "value2", + "key": "varName2" + } + ] + } + ] + }, + { + "AND": [ + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "matches", + "negated": false + }, + "value": "something", + "key": "varName3" + } + ] + } + ] + } + ] + } + } + ], + "segments": [ + { + "id": "200299434", + "name": "Test Segments", + "status": "active", + "key": "test-segments-1", + "preset": false, + "rules": { + "OR": [ + { + "AND": [ + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "matches", + "negated": false + }, + "key": "enabled", + "value": true + } + ] + } + ] + } + ] + } + } + ], + "experiences": [ + { + "id": "100218245", + "name": "Test Experience AB Fullstack", + "key": "test-experience-ab-fullstack-2", + "type": "a/b", + "version": 6, + "status": "active", + "global_js": "var s = 'test_experience'; console.log(s);", + "global_css": ".test-style { display: initial; }", + "url": "https://convert.com", + "integrations": [], + "environments": ["live", "staging"], + "site_area": { + "OR": [ + { + "AND": [ + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "matches", + "negated": false + }, + "key": "url", + "value": "https://convert.com/" + } + ] + } + ] + } + ] + }, + "audiences": ["100299433"], + "goals": ["100215959", "100215960", "100215961"], + "settings": { + "matching_options": { + "audiences": "any" + } + }, + "variations": [ + { + "id": "100299456", + "name": "Original Page", + "status": "running", + "is_baseline": true, + "changes": [ + { + "id": "100240519", + "type": "fullStackFeature", + "data": { + "feature_id": "10024", + "variables_data": { + "enabled": "true", + "caption": "Click that" + } + } + }, + { + "id": "100240521", + "type": "fullStackFeature", + "data": { + "feature_id": "10025", + "variables_data": { + "price": 100, + "button-height": 40, + "additionalData": "{\"foo\":\"bar\",\"v\":2}" + } + } + } + ], + "key": "100299456-original-page", + "traffic_allocation": 50.0 + }, + { + "id": "100299457", + "name": "Variation 1", + "status": "running", + "is_baseline": false, + "changes": [ + { + "id": "100240520", + "type": "fullStackFeature", + "data": { + "feature_id": "10024", + "variables_data": { + "enabled": "false", + "caption": "Not allowed" + } + } + } + ], + "key": "100299457-variation-1", + "traffic_allocation": 50.0 + } + ] + }, + { + "id": "100218246", + "name": "Test Experience AB Fullstack", + "key": "test-experience-ab-fullstack-3", + "type": "a/b", + "version": 6, + "status": "active", + "global_js": "var s = 'test_experience'; console.log(s);", + "global_css": ".test-style { display: initial; }", + "url": "https://convert.com", + "integrations": [], + "environments": ["live", "staging"], + "site_area": { + "OR": [ + { + "AND": [ + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "matches", + "negated": false + }, + "key": "url", + "value": "https://convert.com/" + } + ] + } + ] + } + ] + }, + "audiences": ["100299433"], + "goals": ["100215959", "100215960", "100215961"], + "settings": { + "matching_options": { + "audiences": "any" + } + }, + "variations": [ + { + "id": "100299460", + "name": "Original Page", + "status": "running", + "is_baseline": true, + "changes": [ + { + "id": "100240529", + "type": "fullStackFeature", + "data": { + "feature_id": "10024", + "variables_data": { + "enabled": "true", + "caption": "Click that" + } + } + } + ], + "key": "100299460-original-page", + "traffic_allocation": 50.0 + }, + { + "id": "100299461", + "name": "Variation 1", + "status": "running", + "is_baseline": false, + "changes": [ + { + "id": "100240532", + "type": "fullStackFeature", + "data": { + "feature_id": "10024", + "variables_data": { + "enabled": "true", + "caption": "Allowed" + } + } + } + ], + "key": "100299461-variation-1", + "traffic_allocation": 50.0 + } + ] + }, + { + "id": "100218247", + "name": "Test Experience AB Fullstack", + "key": "test-experience-ab-fullstack-4", + "type": "a/b", + "version": 6, + "status": "active", + "global_js": "var s = 'test_experience'; console.log(s);", + "global_css": ".test-style { display: initial; }", + "url": "https://convert.com", + "integrations": [], + "environments": ["live", "staging"], + "site_area": { + "OR": [ + { + "AND": [ + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "matches", + "negated": false + }, + "key": "url", + "value": "https://convert.com/" + } + ] + } + ] + } + ] + }, + "audiences": ["100299433"], + "goals": ["100215959", "100215960", "100215961"], + "settings": { + "matching_options": { + "audiences": "any" + } + }, + "variations": [{}] + } + ], + "features": [ + { + "id": "10024", + "name": "Feature 1", + "key": "feature-1", + "variables": [ + { + "key": "enabled", + "type": "boolean" + }, + { + "key": "caption", + "type": "string" + } + ] + }, + { + "id": "10025", + "name": "Feature 2", + "key": "feature-2", + "variables": [ + { + "key": "price", + "type": "float" + }, + { + "key": "button-height", + "type": "integer" + }, + { + "key": "additionalData", + "type": "json" + } + ] + }, + { + "id": "10026", + "name": "Not Attached Feature 3", + "key": "not-attached-feature-3", + "variables": [ + { + "key": "fee", + "type": "float" + }, + { + "key": "link", + "type": "string" + }, + { + "key": "additionalData", + "type": "json" + } + ] + } + ], + "goals": [ + { + "id": "100215960", + "name": "Increase Engagement", + "selected_default": true, + "status": "active", + "type": "dom_interaction", + "is_system": true, + "key": "increase-engagement", + "settings": { + "tracked_items": [ + { + "event": "click", + "selector": "a" + }, + { + "event": "submit", + "selector": "form" + } + ] + }, + "rules": { + "OR": [ + { + "AND": [ + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "matches", + "negated": false + }, + "key": "action", + "value": "buy" + }, + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "matches", + "negated": false + }, + "key": "action", + "value": "signup" + } + ] + } + ] + } + ] + } + }, + { + "id": "100215959", + "name": "Decrease BounceRate", + "selected_default": true, + "status": "active", + "type": "advanced", + "is_system": true, + "key": "decrease-bounce-rate", + "rules": { + "OR": [ + { + "AND": [ + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "lessEqual", + "negated": true + }, + "value": 1, + "key": "pages_visited_count" + }, + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "lessEqual", + "negated": true + }, + "value": 10, + "key": "visit_duration" + } + ] + } + ] + } + ] + } + }, + { + "id": "100215961", + "name": "adv goal country browser", + "selected_default": false, + "status": "active", + "type": "advanced", + "is_system": false, + "key": "adv-goal-country-browser", + "rules": { + "OR": [ + { + "AND": [ + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "equals", + "negated": false + }, + "value": "US", + "key": "country" + } + ] + }, + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "equals", + "negated": false + }, + "value": "chrome", + "key": "browser_name" + } + ] + } + ] + }, + { + "AND": [ + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "equals", + "negated": false + }, + "value": "GB", + "key": "country" + } + ] + }, + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "equals", + "negated": false + }, + "value": "safari", + "key": "browser_name" + } + ] + } + ] + } + ] + } + }, + { + "id": "100215962", + "key": "goal-without-rule" + } + ], + "project": { + "id": "10025986", + "name": "Test Project", + "type": "fullstack", + "utc_offset": 0, + "domains": [ + { + "id": "10029181", + "hosts": "https://convert.com/", + "tld": false + } + ], + "settings": { + "auto_link": false, + "data_anonymization": false, + "do_not_track": "OFF", + "include_jquery": false + }, + "environments": { + "live": "Live", + "staging": "Staging" + } + } + } +} diff --git a/packages/Logger/composer.json b/packages/Logger/composer.json new file mode 100644 index 0000000..e900fe7 --- /dev/null +++ b/packages/Logger/composer.json @@ -0,0 +1,37 @@ +{ + "name": "convertcom/php-sdk-logger", + "description": "PHP implementation of Convert SDK Logger package", + "type": "library", + "license": "Apache-2.0", + "version": "1.0.0", + "authors": [ + { + "name": "Convert Insights, Inc" + } + ], + "autoload": { + "psr-4": { + "ConvertSdk\\": "src/" + } + }, + "repositories": [ + { + "type": "path", + "url": "../Enums" + } + ], + "require": { + "php": "^8.2", + "convertcom/php-sdk-enums": ">=1.0.0", + "psr/log": "^3.0" + }, + "require-dev": { + "phpunit/phpunit": "^11.0", + "monolog/monolog": "^3.8" + }, + "scripts": { + "test": "phpunit" + }, + "minimum-stability": "stable", + "prefer-stable": true +} diff --git a/packages/Logger/phpunit.xml b/packages/Logger/phpunit.xml new file mode 100644 index 0000000..3cff70b --- /dev/null +++ b/packages/Logger/phpunit.xml @@ -0,0 +1,18 @@ + + + + + ./tests + + + + + src + + + diff --git a/packages/Logger/src/Interfaces/LogClientInterface.php b/packages/Logger/src/Interfaces/LogClientInterface.php new file mode 100644 index 0000000..ed312f0 --- /dev/null +++ b/packages/Logger/src/Interfaces/LogClientInterface.php @@ -0,0 +1,61 @@ +}> Array of log clients. + */ + protected array $_clients = []; + + /** + * @var array Default mapping for log methods. + */ + protected array $_defaultMapper = [ + 'log' => 'log', + 'debug' => 'debug', + 'info' => 'info', + 'warn' => 'warn', + 'error' => 'error', + 'trace' => 'trace', + ]; + + /** + * Default mapping for PSR-3 loggers (e.g. Monolog). + * + * @var array + */ + protected array $_monologMapping = [ + 'log' => 'info', + 'debug' => 'debug', + 'info' => 'info', + 'warn' => 'warning', + 'error' => 'error', + 'trace' => 'debug', + ]; + + /** + * Default log level. + */ + protected const DEFAULT_LOG_LEVEL = LogLevel::Trace; + + /** + * Constructor. + * + * @param mixed $client A logging client (for example, an object with logging methods or a PSR-3 logger). + * @param LogLevel $level The log level. + * @param LogMethodMapInterface|null $mapper An optional custom method mapping. + */ + public function __construct(mixed $client = null, LogLevel $level = self::DEFAULT_LOG_LEVEL, ?LogMethodMapInterface $mapper = null) + { + $this->_clients = []; + if ($client === null) { + $client = new NullLogger(); + } + $this->addClient($client, $level, $mapper); + } + + /** + * Clears all registered log clients. + * + * @return void + */ + public function clearClients(): void + { + $this->_clients = []; + } + + /** + * Checks if the provided method is valid. + * + * @param string $method + * @return bool + */ + private function _isValidMethod(string $method): bool + { + return LogMethod::tryFrom($method) !== null; + } + + /** + * Internal logging function. + * + * @param LogMethod $method The log method key. + * @param LogLevel $level The log level. + * @param mixed ...$args The log message arguments. + * @return void + */ + private function _log(LogMethod $method, LogLevel $level, mixed ...$args): void + { + foreach ($this->_clients as $client) { + if ($level->value >= $client['level']->value && $level !== LogLevel::Silent) { + $mappedMethod = $client['mapper'][$method->value] ?? null; + if ($mappedMethod && method_exists($client['sdk'], $mappedMethod)) { + if ($client['sdk'] instanceof \Psr\Log\LoggerInterface) { + // Concatenate all arguments into one message + try { + $message = implode(' ', array_map( + fn ($arg) => is_array($arg) ? (json_encode($arg) ?: '[unserializable]') : (is_object($arg) ? get_class($arg) : strval($arg)), + $args + )); + } catch (\Throwable $e) { + $message = '[log serialization error: ' . $e->getMessage() . ']'; + } + // Call the PSR-3 method with an empty context array + $client['sdk']->$mappedMethod($message, []); + } else { + call_user_func_array([$client['sdk'], $mappedMethod], $args); + } + } else { + error_log("Info: Unable to find method \"{$method->value}()\" in client sdk: " . + (is_object($client['sdk']) ? $this->classBasename($client['sdk']) : gettype($client['sdk'])) . "\n"); + $formattedArgs = array_map(function ($arg) { + return is_array($arg) ? json_encode($arg) : strval($arg); + }, $args); + error_log(implode(' ', $formattedArgs) . "\n"); + } + } + } + } + + /** + * Logs a message with a specified level. + * + * @param LogLevel $level + * @param mixed ...$args + * @return void + */ + public function log(LogLevel $level, mixed ...$args): void + { + $this->_log(LogMethod::Log, $level, ...$args); + } + + /** + * Logs a trace message. + * + * @param mixed ...$args + * @return void + */ + public function trace(mixed ...$args): void + { + $this->_log(LogMethod::Trace, LogLevel::Trace, ...$args); + } + + /** + * Logs a debug message. + * + * @param mixed ...$args + * @return void + */ + public function debug(mixed ...$args): void + { + $this->_log(LogMethod::Debug, LogLevel::Debug, ...$args); + } + + /** + * Logs an info message. + * + * @param mixed ...$args + * @return void + */ + public function info(mixed ...$args): void + { + $this->_log(LogMethod::Info, LogLevel::Info, ...$args); + } + + /** + * Logs a warning message. + * + * @param mixed ...$args + * @return void + */ + public function warn(mixed ...$args): void + { + $this->_log(LogMethod::Warn, LogLevel::Warn, ...$args); + } + + /** + * Logs an error message. + * + * @param mixed ...$args + * @return void + */ + public function error(mixed ...$args): void + { + $this->_log(LogMethod::Error, LogLevel::Error, ...$args); + } + + /** + * Helper method to get only the base name of a class. + * + * @param object|string $objectOrClass + * @return string + */ + protected function classBasename(object|string $objectOrClass): string + { + $class = is_object($objectOrClass) ? get_class($objectOrClass) : $objectOrClass; + return substr(strrchr($class, '\\'), 1) ?: $class; + } + + /** + * Adds a client to the logger. + * + * @param mixed $client A logging client. + * @param LogLevel|null $level The log level. + * @param LogMethodMapInterface|null $methodMap Optional custom method mapping. + * @return void + */ + public function addClient(mixed $client = null, ?LogLevel $level = null, ?LogMethodMapInterface $methodMap = null): void + { + if (!$client) { + error_log('Invalid Client SDK' . "\n"); + return; + } + $level = $level ?? self::DEFAULT_LOG_LEVEL; + if ($client instanceof LoggerInterface) { + $mapper = $this->_monologMapping; + } else { + $mapper = $this->_defaultMapper; + } + if ($methodMap) { + foreach ($methodMap as $key => $value) { + if ($this->_isValidMethod($key)) { + $mapper[$key] = $value; + } + } + } + $this->_clients[] = [ + 'sdk' => $client, + 'level' => $level, + 'mapper' => $mapper, + ]; + } + + /** + * Sets the log level for a given client, or for all clients if none is specified. + * + * @param LogLevel $level The new log level. + * @param mixed|null $client The specific client to update. + * @return void + */ + public function setClientLevel(LogLevel $level, mixed $client = null): void + { + if ($client !== null) { + $found = false; + foreach ($this->_clients as $index => $c) { + if ($c['sdk'] === $client) { + $this->_clients[$index]['level'] = $level; + $found = true; + break; + } + } + if (!$found) { + error_log('Client SDK not found' . "\n"); + return; + } + } else { + foreach ($this->_clients as $index => $c) { + $this->_clients[$index]['level'] = $level; + } + } + } +} diff --git a/packages/Logger/tests/LogManagerTest.php b/packages/Logger/tests/LogManagerTest.php new file mode 100644 index 0000000..358cdcf --- /dev/null +++ b/packages/Logger/tests/LogManagerTest.php @@ -0,0 +1,400 @@ +map[$offset]); + } + public function offsetGet(mixed $offset): mixed + { + return $this->map[$offset] ?? null; + } + public function offsetSet(mixed $offset, mixed $value): void + { + $this->map[$offset] = $value; + } + public function offsetUnset(mixed $offset): void + { + unset($this->map[$offset]); + } + public function __construct() + { + // For custom mapping, map the TRACE log method to the 'send' method. + $this->map[LogMethod::Trace->value] = 'send'; + } +} + +class LogManagerTest extends TestCase +{ + /** + * @var LogManager + */ + protected $logger; + + /** + * @var TestHandler + */ + protected $testHandler; + + /** + * @var MonologLogger + */ + protected $monolog; + + protected function setUp(): void + { + // Create a Monolog instance with a TestHandler. + $this->testHandler = new TestHandler(); + $this->monolog = new MonologLogger('test'); + $this->monolog->pushHandler($this->testHandler); + + // Initialize LogManager with the Monolog instance. + $this->logger = new LogManager($this->monolog, LogLevel::Trace); + } + + protected function tearDown(): void + { + $this->logger = null; + $this->monolog = null; + $this->testHandler = null; + } + + public function testShouldExposeLogManager() + { + $this->assertTrue(class_exists(LogManager::class)); + } + + public function testImportedEntityShouldBeConstructorOfLogManagerInstance() + { + $logger = new LogManager($this->monolog, LogLevel::Trace); + $this->assertInstanceOf(LogManager::class, $logger); + $this->assertEquals('ConvertSdk\\LogManager', get_class($logger)); + } + + public function testShouldLogToConsoleByDefault() + { + $output = 'testing trace message'; + $this->logger->log(LogLevel::Trace, $output); + // Monolog mapping for LOG is set in LogManager as 'info' + $this->assertTrue($this->testHandler->hasRecord($output, MonologLoggerLevel::Info)); + } + + public function testShouldSupportLogMethodWithMultipleArguments() + { + $output = 'testing log method'; + $argument = 'with multiple arguments'; + $this->logger->log(LogLevel::Trace, $output, $argument); + $expectedMessage = $output . ' ' . $argument; + $this->assertTrue($this->testHandler->hasRecord($expectedMessage, MonologLoggerLevel::Info)); + } + + public function testShouldSupportTraceMethodWithMultipleArguments() + { + $output = 'testing trace method'; + $argument = 'with multiple arguments'; + $this->logger->trace($output, $argument); + // LogManager maps TRACE to Monolog's debug level + $expectedMessage = $output . ' ' . $argument; + $this->assertTrue($this->testHandler->hasRecord($expectedMessage, MonologLoggerLevel::Debug)); + } + + public function testShouldSupportDebugMethodWithMultipleArguments() + { + $output = 'testing debug method'; + $argument = 'with multiple arguments'; + $this->logger->debug($output, $argument); + $expectedMessage = $output . ' ' . $argument; + $this->assertTrue($this->testHandler->hasRecord($expectedMessage, MonologLoggerLevel::Debug)); + } + + public function testShouldSupportInfoMethodWithMultipleArguments() + { + $output = 'testing info method'; + $argument = 'with multiple arguments'; + $this->logger->info($output, $argument); + $expectedMessage = $output . ' ' . $argument; + $this->assertTrue($this->testHandler->hasRecord($expectedMessage, MonologLoggerLevel::Info)); + } + + public function testShouldSupportWarnMethodWithMultipleArguments() + { + $output = 'testing warn method'; + $argument = 'with multiple arguments'; + $this->logger->warn($output, $argument); + $expectedMessage = $output . ' ' . $argument; + $this->assertTrue($this->testHandler->hasRecord($expectedMessage, MonologLoggerLevel::Warning)); + } + + public function testShouldSupportErrorMethodWithMultipleArguments() + { + $output = 'testing error method'; + $argument = 'with multiple arguments'; + $this->logger->error($output, $argument); + $expectedMessage = $output . ' ' . $argument; + $this->assertTrue($this->testHandler->hasRecord($expectedMessage, MonologLoggerLevel::Error)); + } + + public function testShouldNotLogAnythingWhenUsingSilentLogLevel() + { + $output = 'testing silent log level'; + $this->logger->log(LogLevel::Silent, $output); + $records = $this->testHandler->getRecords(); + $this->assertEmpty($records); + } + + public function testShouldRejectInvalidLogLevelViaNativeEnum() + { + // With native enums, invalid log levels are rejected by the type system. + // LogLevel::tryFrom(6) returns null since 6 is not a valid backing value. + $this->assertNull(LogLevel::tryFrom(6)); + } + + public function testShouldReturnErrorWhenAddingNewClientWithInvalidSDK() + { + // We add an invalid client (null) and then verify that the client list doesn't grow. + $initialClients = $this->getPrivateProperty($this->logger, '_clients'); + $this->logger->addClient(null); + $afterClients = $this->getPrivateProperty($this->logger, '_clients'); + $this->assertCount(count($initialClients), $afterClients); + } + + public function testShouldRejectInvalidLogLevelForClientViaNativeEnum() + { + // With native enums, invalid log levels are rejected by the type system. + // LogLevel::tryFrom(6) returns null since 6 is not a valid backing value. + $this->assertNull(LogLevel::tryFrom(6)); + } + + public function testShouldLogToConsoleAndToThirdPartyWhenAddingNewClient() + { + // Create a second Monolog logger with its own TestHandler. + $testHandler2 = new TestHandler(); + $monolog2 = new MonologLogger('test2'); + $monolog2->pushHandler($testHandler2); + $this->logger->addClient($monolog2); + $output = 'testing third-party logger'; + $this->logger->trace($output); + $this->assertTrue($this->testHandler->hasRecord($output, MonologLoggerLevel::Debug)); + $this->assertTrue($testHandler2->hasRecord($output, MonologLoggerLevel::Debug)); + } + + public function testShouldMapCustomLogMethodWhenAddingNewClient() + { + // Clear default clients so only the custom mapping client is used. + $this->logger->clearClients(); + // Add a client with custom mapping (using CustomMappingClient and mapping TRACE to 'send'). + $this->logger->addClient(new CustomMappingClient(), LogLevel::Trace, new CustomLogMethodMap()); + $output = 'testing third-party method mapping'; + $this->logger->trace($output); + // Since CustomMappingClient is not PSR-3, its output is not captured by the TestHandler. + // Therefore, we expect that the TestHandler does NOT have a record with $output. + $this->assertFalse($this->testHandler->hasRecord($output, MonologLoggerLevel::Debug)); + } + + public function testShouldFallbackToConsoleUsingMissingMethodByNewClient() + { + // Clear default clients so only the missing method client is used. + $this->logger->clearClients(); + // Add a client that only implements "log" to force fallback. + $this->logger->addClient(new MissingMethodClient(), LogLevel::Info); + $output = 'testing third-party missing info method'; + $this->logger->info($output); + // Since MissingMethodClient does not have an "info" method, fallback will trigger. + // Fallback output (from error_log or echo) is not captured by the Monolog TestHandler. + // So we expect that TestHandler does NOT have a record with $output. + $this->assertFalse($this->testHandler->hasRecord($output, MonologLoggerLevel::Info)); + } + + public function testShouldLogOnlyMatchingLevelsWhenUsingNewClient() + { + // Create a second Monolog logger with its own TestHandler and log level ERROR. + $testHandler2 = new TestHandler(); + $monolog2 = new MonologLogger('test2'); + $monolog2->pushHandler($testHandler2); + $this->logger->addClient($monolog2, LogLevel::Error); + $output = 'testing third-party matching log level'; + $this->logger->warn($output); + $this->assertTrue($this->testHandler->hasRecord($output, MonologLoggerLevel::Warning)); + $this->assertFalse($testHandler2->hasRecord($output, MonologLoggerLevel::Warning)); + } + + public function testShouldLogEmptyMessage() + { + $this->logger->log(LogLevel::Info, ''); + $records = $this->testHandler->getRecords(); + $foundEmpty = false; + foreach ($records as $record) { + if ($record['message'] === '') { + $foundEmpty = true; + break; + } + } + $this->assertTrue($foundEmpty); + } + + public function testShouldHandleLargeNumberOfArguments() + { + $output = 'testing with many arguments'; + $args = array_fill(0, 1000, 'arg'); + $this->logger->log(LogLevel::Info, $output, ...$args); + $records = $this->testHandler->getRecords(); + $this->assertStringContainsString($output, $records[0]['message']); + } + + public function testNullLoggerDefault() + { + // Create LogManager with no client — should default to NullLogger + $logger = new LogManager(); + $this->assertInstanceOf(LogManager::class, $logger); + + $clients = $this->getPrivateProperty($logger, '_clients'); + $this->assertCount(1, $clients); + $this->assertInstanceOf(\Psr\Log\NullLogger::class, $clients[0]['sdk']); + + // Verify logging does not error + $logger->info('test message with NullLogger'); + $logger->debug('another test'); + $logger->error('error test'); + // NullLogger produces no output — just verify no exceptions + $this->assertTrue(true); + } + + public function testPsr3LoggerIntegration() + { + $mockLogger = $this->createMock(\Psr\Log\LoggerInterface::class); + + // Expect info to be called (LogManager maps 'log' → 'info' for PSR-3) + $mockLogger->expects($this->once()) + ->method('info') + ->with('test PSR-3 message', []); + + $logger = new LogManager($mockLogger, LogLevel::Trace); + $logger->log(LogLevel::Info, 'test PSR-3 message'); + } + + public function testPsr3LoggerDebugMethod() + { + $mockLogger = $this->createMock(\Psr\Log\LoggerInterface::class); + + $mockLogger->expects($this->once()) + ->method('debug') + ->with('debug via PSR-3', []); + + $logger = new LogManager($mockLogger, LogLevel::Trace); + $logger->debug('debug via PSR-3'); + } + + public function testPsr3LoggerWarningMethod() + { + $mockLogger = $this->createMock(\Psr\Log\LoggerInterface::class); + + // LogManager maps 'warn' → 'warning' for PSR-3 + $mockLogger->expects($this->once()) + ->method('warning') + ->with('warning via PSR-3', []); + + $logger = new LogManager($mockLogger, LogLevel::Trace); + $logger->warn('warning via PSR-3'); + } + + public function testPsr3LoggerErrorMethod() + { + $mockLogger = $this->createMock(\Psr\Log\LoggerInterface::class); + + $mockLogger->expects($this->once()) + ->method('error') + ->with('error via PSR-3', []); + + $logger = new LogManager($mockLogger, LogLevel::Trace); + $logger->error('error via PSR-3'); + } + + public function testSetClientLevelShouldUpdateSpecificClient(): void + { + // Logger was initialized with Monolog at Trace level + $clients = $this->getPrivateProperty($this->logger, '_clients'); + $this->assertSame(LogLevel::Trace, $clients[0]['level']); + + // Set level to Error for the specific Monolog client + $this->logger->setClientLevel(LogLevel::Error, $this->monolog); + + $clients = $this->getPrivateProperty($this->logger, '_clients'); + $this->assertSame(LogLevel::Error, $clients[0]['level']); + } + + public function testSetClientLevelShouldUpdateAllClientsWhenNoClientSpecified(): void + { + // Add a second client + $testHandler2 = new TestHandler(); + $monolog2 = new MonologLogger('test2'); + $monolog2->pushHandler($testHandler2); + $this->logger->addClient($monolog2, LogLevel::Trace); + + // Set all clients to Error level + $this->logger->setClientLevel(LogLevel::Error); + + $clients = $this->getPrivateProperty($this->logger, '_clients'); + foreach ($clients as $client) { + $this->assertSame(LogLevel::Error, $client['level']); + } + } + + public function testSetClientLevelShouldLogErrorWhenClientNotFound(): void + { + $unknownClient = new \stdClass(); + // This should trigger error_log 'Client SDK not found' — no exception expected + $this->logger->setClientLevel(LogLevel::Error, $unknownClient); + + // Verify existing client level was NOT changed + $clients = $this->getPrivateProperty($this->logger, '_clients'); + $this->assertSame(LogLevel::Trace, $clients[0]['level']); + } + + /** + * Helper method to access protected properties for testing. + */ + protected function getPrivateProperty($object, $property) + { + $reflection = new \ReflectionClass(get_class($object)); + $prop = $reflection->getProperty($property); + return $prop->getValue($object); + } +} diff --git a/packages/Php-sdk/composer.json b/packages/Php-sdk/composer.json new file mode 100644 index 0000000..51ed68b --- /dev/null +++ b/packages/Php-sdk/composer.json @@ -0,0 +1,88 @@ +{ + "name": "convertcom/php-sdk", + "description": "Convert PHP SDK – a PHP version of the Convert Insights SDK", + "type": "library", + "license": "Apache-2.0", + "authors": [ + { + "name": "Convert Insights, Inc" + } + ], + "autoload": { + "psr-4": { + "ConvertSdk\\": "src/" + } + }, + "repositories": { + "Data": { + "type": "path", + "url": "../Data" + }, + "Enums": { + "type": "path", + "url": "../Enums" + }, + "Api": { + "type": "path", + "url": "../Api" + }, + "Logger": { + "type": "path", + "url": "../Logger" + }, + "Utils": { + "type": "path", + "url": "../Utils" + }, + "Event": { + "type": "path", + "url": "../Event" + }, + "Bucketing": { + "type": "path", + "url": "../Bucketing" + }, + "Rules": { + "type": "path", + "url": "../Rules" + }, + "Experience": { + "type": "path", + "url": "../Experience" + }, + "Types": { + "type": "path", + "url": "../Types" + }, + "Segments": { + "type": "path", + "url": "../Segments" + } + }, + "require": { + "php": "^8.2", + "php-http/discovery": "^1.19", + "psr/log": "^3.0", + "psr/simple-cache": "^3.0", + "convertcom/php-sdk-api": ">=1.0.0", + "convertcom/php-sdk-data": ">=1.0.0", + "convertcom/php-sdk-enums": ">=1.0.0", + "convertcom/php-sdk-event": ">=1.0.0", + "convertcom/php-sdk-logger": ">=1.0.0", + "convertcom/php-sdk-utils": ">=1.0.0", + "convertcom/php-sdk-bucketing": ">=1.0.0", + "convertcom/php-sdk-rules": ">=1.0.0", + "convertcom/php-sdk-experience": ">=1.0.0", + "convertcom/php-sdk-types": ">=1.0.0", + "convertcom/php-sdk-segments": ">=1.0.0" + }, + "require-dev": { + "phpunit/phpunit": "^11.0" + }, + "scripts": { + "test": "phpunit" + }, + "minimum-stability": "stable", + "prefer-stable": true, + "version": "1.0.0" + } diff --git a/packages/Php-sdk/phpunit.xml b/packages/Php-sdk/phpunit.xml new file mode 100644 index 0000000..66aabff --- /dev/null +++ b/packages/Php-sdk/phpunit.xml @@ -0,0 +1,23 @@ + + + + + tests + + + + + + + + + + src + + + diff --git a/packages/Php-sdk/src/Cache/ArrayCache.php b/packages/Php-sdk/src/Cache/ArrayCache.php new file mode 100644 index 0000000..0dc4919 --- /dev/null +++ b/packages/Php-sdk/src/Cache/ArrayCache.php @@ -0,0 +1,98 @@ + */ + private array $store = []; + + public function get(string $key, mixed $default = null): mixed + { + if (!$this->has($key)) { + return $default; + } + + return $this->store[$key]['value']; + } + + public function set(string $key, mixed $value, null|int|\DateInterval $ttl = null): bool + { + $expiry = null; + + if ($ttl instanceof \DateInterval) { + $expiry = time() + (new \DateTime())->setTimestamp(0)->add($ttl)->getTimestamp(); + } elseif (is_int($ttl)) { + if ($ttl <= 0) { + $this->delete($key); + return true; + } + $expiry = time() + $ttl; + } + + $this->store[$key] = ['value' => $value, 'expiry' => $expiry]; + + return true; + } + + public function delete(string $key): bool + { + unset($this->store[$key]); + + return true; + } + + public function clear(): bool + { + $this->store = []; + + return true; + } + + public function has(string $key): bool + { + if (!array_key_exists($key, $this->store)) { + return false; + } + + if ($this->store[$key]['expiry'] !== null && $this->store[$key]['expiry'] < time()) { + unset($this->store[$key]); + return false; + } + + return true; + } + + public function getMultiple(iterable $keys, mixed $default = null): iterable + { + $result = []; + + foreach ($keys as $key) { + $result[$key] = $this->get($key, $default); + } + + return $result; + } + + public function setMultiple(iterable $values, null|int|\DateInterval $ttl = null): bool + { + foreach ($values as $key => $value) { + $this->set($key, $value, $ttl); + } + + return true; + } + + public function deleteMultiple(iterable $keys): bool + { + foreach ($keys as $key) { + $this->delete($key); + } + + return true; + } +} diff --git a/packages/Php-sdk/src/Config/Config.php b/packages/Php-sdk/src/Config/Config.php new file mode 100644 index 0000000..f578776 --- /dev/null +++ b/packages/Php-sdk/src/Config/Config.php @@ -0,0 +1,45 @@ + [ + 'logLevel' => LogLevel::Warn, + 'customLoggers' => [], + ], + ]; + + $defaultEnvironmentSettings = [ + 'environment' => 'production', + ]; + + // Retrieve the default configuration. + $defaultConfig = DefaultConfig::getDefault(); + + // Merge all configuration arrays deeply. + $configuration = ObjectUtils::objectDeepMerge( + $defaultLoggerSettings, + $defaultEnvironmentSettings, + $defaultConfig, + $config + ); + + return $configuration; + } +} diff --git a/packages/Php-sdk/src/Config/ConfigValidator.php b/packages/Php-sdk/src/Config/ConfigValidator.php new file mode 100644 index 0000000..e86a097 --- /dev/null +++ b/packages/Php-sdk/src/Config/ConfigValidator.php @@ -0,0 +1,36 @@ +getAccountId() === null || $config->getAccountId() === '') { + throw new ConfigValidationException( + "Config validation failed: missing 'account_id' field" + ); + } + + $project = $config->getProject(); + + if ($project === null) { + throw new ConfigValidationException( + "Config validation failed: missing 'project' field" + ); + } + + $projectId = is_array($project) ? ($project['id'] ?? null) : ($project->getId() ?? null); + + if ($projectId === null || $projectId === '') { + throw new ConfigValidationException( + "Config validation failed: 'project' must contain an 'id' field" + ); + } + } +} diff --git a/packages/Php-sdk/src/Config/DefaultConfig.php b/packages/Php-sdk/src/Config/DefaultConfig.php new file mode 100644 index 0000000..b51e5bd --- /dev/null +++ b/packages/Php-sdk/src/Config/DefaultConfig.php @@ -0,0 +1,55 @@ + [ + 'endpoint' => [ + 'config' => getenv('CONFIG_ENDPOINT') ?: 'https://cdn-4.convertexperiments.com/api/v1', + 'track' => getenv('TRACK_ENDPOINT') ?: 'https://[project_id].metrics.convertexperiments.com/v1', + ], + ], + 'environment' => 'production', + 'bucketing' => [ + 'max_traffic' => 10000, + 'hash_seed' => 9999, + 'excludeExperienceIdHash' => false, + ], + 'data' => [], + 'dataStore' => null, // Allows 3rd party data store to be passed. + 'dataRefreshInterval' => 300000, // in milliseconds (5 minutes) + 'events' => [ + 'batch_size' => 10, + ], + 'logger' => [ + 'logLevel' => LogLevel::Debug, + 'customLoggers' => [], // Allows 3rd party loggers to be passed. + ], + 'rules' => [ + 'keys_case_sensitive' => true, + 'comparisonProcessor' => null, // Allows 3rd party comparison processor. + 'negation' => '!', + ], + 'network' => [ + 'tracking' => true, + 'cacheLevel' => 'default', // Can be set to 'low' for short-lived cache. + 'source' => 'php-sdk', + ], + 'sdkKey' => '', + 'sdkKeySecret' => '', + ]; + } +} diff --git a/packages/Php-sdk/src/Context.php b/packages/Php-sdk/src/Context.php new file mode 100644 index 0000000..f43e17c --- /dev/null +++ b/packages/Php-sdk/src/Context.php @@ -0,0 +1,638 @@ + */ + private ?array $visitorProperties = null; + + /** + * @param Config $config SDK configuration + * @param string $visitorId Unique visitor identifier + * @param EventManagerInterface $eventManager Event manager instance + * @param ExperienceManagerInterface $experienceManager Experience manager instance + * @param FeatureManagerInterface $featureManager Feature manager instance + * @param DataManagerInterface $dataManager Data manager instance + * @param SegmentsManagerInterface $segmentsManager Segments manager instance + * @param ApiManagerInterface $apiManager API manager instance + * @param LogManagerInterface|null $loggerManager Optional logger manager instance + * @param array|null $visitorAttributes Initial visitor attributes for targeting + * + * @throws InvalidArgumentException If visitorId is empty + */ + public function __construct( + private readonly Config $config, + private readonly string $visitorId, + private readonly EventManagerInterface $eventManager, + private readonly ExperienceManagerInterface $experienceManager, + private readonly FeatureManagerInterface $featureManager, + private readonly DataManagerInterface $dataManager, + private readonly SegmentsManagerInterface $segmentsManager, + private readonly ApiManagerInterface $apiManager, + private readonly ?LogManagerInterface $loggerManager = null, + ?array $visitorAttributes = null, + ) { + if ($visitorId === '') { + throw new InvalidArgumentException('Visitor ID must not be empty'); + } + + $this->environment = $config->getEnvironment() ?? null; + + if (!empty($visitorAttributes)) { + $filtered = $this->dataManager->filterReportSegments($visitorAttributes); + if (isset($filtered['properties'])) { + $this->visitorProperties = $filtered['properties']; + } + $this->segmentsManager->putSegments($visitorId, $visitorAttributes); + } + } + + /** + * Get variation from specific experience. + * + * @param string $experienceKey An experience's key that should be activated + * @param BucketingAttributes|null $attributes Attributes for the visitor + * @return BucketedVariation|null The bucketed variation DTO, or null for all non-success paths + */ + public function runExperience(string $experienceKey, ?BucketingAttributes $attributes = null): ?BucketedVariation + { + if (empty($this->visitorId)) { + $this->loggerManager?->error( + 'Context.runExperience()', + ErrorMessages::VISITOR_ID_REQUIRED + ); + return null; + } + + $visitorProperties = $this->getVisitorProperties($attributes?->getVisitorProperties()); + $result = $this->experienceManager->selectVariation( + $this->visitorId, + $experienceKey, + new BucketingAttributes([ + 'visitorProperties' => $visitorProperties, + 'locationProperties' => $attributes?->getLocationProperties(), + 'updateVisitorProperties' => $attributes?->getUpdateVisitorProperties(), + 'environment' => $attributes?->getEnvironment() ?? $this->environment, + ]) + ); + + if ($result === null + || $result instanceof RuleError + || $result === BucketingError::VariationNotDecided + ) { + return null; + } + + $this->eventManager->fire( + SystemEvents::Bucketing, + [ + 'visitorId' => $this->visitorId, + 'experienceKey' => $experienceKey, + 'variationKey' => $result['key'] ?? null, + ], + null, + true + ); + + return $this->mapToBucketedVariationDto($result); + } + + /** + * Get variations across all experiences. + * + * @param BucketingAttributes|null $attributes Attributes for the visitor + * @return BucketedVariation[] Array of bucketed variation DTOs + */ + public function runExperiences(?BucketingAttributes $attributes = null): array + { + if (empty($this->visitorId)) { + $this->loggerManager?->error( + 'Context.runExperiences()', + ErrorMessages::VISITOR_ID_REQUIRED + ); + return []; + } + + $visitorProperties = $this->getVisitorProperties($attributes?->getVisitorProperties()); + + $bucketedVariations = $this->experienceManager->selectVariations( + $this->visitorId, + new BucketingAttributes([ + 'visitorProperties' => $visitorProperties, + 'locationProperties' => $attributes?->getLocationProperties(), + 'updateVisitorProperties' => $attributes?->getUpdateVisitorProperties(), + 'environment' => $attributes?->getEnvironment() ?? $this->environment, + ]) + ); + + $dtos = []; + foreach ($bucketedVariations as $variation) { + if (!is_array($variation)) { + continue; + } + $this->eventManager->fire( + SystemEvents::Bucketing, + [ + 'visitorId' => $this->visitorId, + 'experienceKey' => $variation['experienceKey'] ?? null, + 'variationKey' => $variation['key'] ?? null, + ], + null, + true + ); + $dtos[] = $this->mapToBucketedVariationDto($variation); + } + + return $dtos; + } + + /** + * Get feature and its status. + * + * @param string $key A feature key + * @param BucketingAttributes|null $attributes Attributes for the visitor + * @return BucketedFeature|null The bucketed feature DTO, or null for not-found/error paths + */ + public function runFeature(string $key, ?BucketingAttributes $attributes = null): ?BucketedFeature + { + if (empty($this->visitorId)) { + $this->loggerManager?->error( + 'Context.runFeature()', + ErrorMessages::VISITOR_ID_REQUIRED + ); + return null; + } + + $visitorProperties = $this->getVisitorProperties($attributes?->getVisitorProperties()); + + $result = $this->featureManager->runFeature( + $this->visitorId, + $key, + new BucketingAttributes([ + 'visitorProperties' => $visitorProperties, + 'locationProperties' => $attributes?->getLocationProperties(), + 'updateVisitorProperties' => $attributes?->getUpdateVisitorProperties(), + 'typeCasting' => $attributes !== null && method_exists($attributes, 'getTypeCasting') + ? $attributes->getTypeCasting() + : true, + 'environment' => $attributes?->getEnvironment() ?? $this->environment, + ]), + $attributes?->getExperienceKeys() + ); + + // Determine if result is a single feature array or array of feature arrays + // Single feature: has 'status' key directly; multi: indexed array of feature arrays + if (isset($result['status'])) { + // Feature not declared (no 'id') → return null per consumer contract + if (!isset($result['id'])) { + return null; + } + + $dto = $this->mapToBucketedFeatureDto($result); + + // Fire event only for enabled features + if ($dto->status === FeatureStatus::Enabled) { + $this->eventManager->fire( + SystemEvents::Bucketing, + [ + 'visitorId' => $this->visitorId, + 'experienceKey' => $result['experienceKey'] ?? null, + 'featureKey' => $key, + 'status' => $result['status'] ?? null, + ], + null, + true + ); + } + + return $dto; + } + + // Array of feature arrays (multi-experience) — return first enabled one + foreach ($result as $feature) { + if (!is_array($feature)) { + continue; + } + $dto = $this->mapToBucketedFeatureDto($feature); + if ($dto->status === FeatureStatus::Enabled) { + $this->eventManager->fire( + SystemEvents::Bucketing, + [ + 'visitorId' => $this->visitorId, + 'experienceKey' => $feature['experienceKey'] ?? null, + 'featureKey' => $key, + 'status' => $feature['status'] ?? null, + ], + null, + true + ); + return $dto; + } + } + + // No enabled features found — return first feature as disabled DTO + $firstFeature = $result[0] ?? null; + if (is_array($firstFeature)) { + return $this->mapToBucketedFeatureDto($firstFeature); + } + + return null; + } + + /** + * Get features and their statuses. + * + * @param BucketingAttributes|null $attributes Attributes for the visitor + * @return BucketedFeature[] Array of bucketed feature DTOs + */ + public function runFeatures(?BucketingAttributes $attributes = null): array + { + if (empty($this->visitorId)) { + $this->loggerManager?->error( + 'Context.runFeatures()', + ErrorMessages::VISITOR_ID_REQUIRED + ); + return []; + } + + $visitorProperties = $this->getVisitorProperties($attributes?->getVisitorProperties()); + + $bucketedFeatures = $this->featureManager->runFeatures($this->visitorId, new BucketingAttributes([ + 'visitorProperties' => $visitorProperties, + 'locationProperties' => $attributes?->getLocationProperties(), + 'updateVisitorProperties' => $attributes?->getUpdateVisitorProperties(), + 'typeCasting' => $attributes !== null && method_exists($attributes, 'getTypeCasting') + ? $attributes->getTypeCasting() + : true, + 'environment' => $attributes?->getEnvironment() ?? $this->environment, + ])); + + // Filter out RuleError results + $matchedErrors = array_filter($bucketedFeatures, function ($match) { + return $match instanceof RuleError; + }); + if (!empty($matchedErrors)) { + return []; + } + + $dtos = []; + foreach ($bucketedFeatures as $feature) { + if (!is_array($feature)) { + continue; + } + + $dto = $this->mapToBucketedFeatureDto($feature); + + // Fire event only for enabled features + if ($dto->status === FeatureStatus::Enabled) { + $this->eventManager->fire( + SystemEvents::Bucketing, + [ + 'visitorId' => $this->visitorId, + 'experienceKey' => $feature['experienceKey'] ?? null, + 'featureKey' => $feature['key'] ?? null, + 'status' => $feature['status'] ?? null, + ], + null, + true + ); + } + + $dtos[] = $dto; + } + + return $dtos; + } + + /** + * Trigger conversion tracking. + * + * @param string $goalKey A goal key + * @param ConversionAttributes|null $attributes Conversion attributes + * @return RuleError|bool|null RuleError on rule mismatch, false if goal not found or rule failed, null on success + */ + public function trackConversion(string $goalKey, ?ConversionAttributes $attributes = null): RuleError|bool|null + { + if (empty($this->visitorId)) { + $this->loggerManager?->error( + 'Context.trackConversion()', + ErrorMessages::VISITOR_ID_REQUIRED + ); + return false; + } + + // Map DTO GoalData objects to plain arrays for DataManager serialization + $conversionData = $attributes?->conversionData; + if ($conversionData !== null) { + $conversionData = array_map( + fn ($item) => $item instanceof GoalData + ? ['key' => $item->key->value, 'value' => $item->value] + : $item, + $conversionData + ); + } + + $segments = $this->segmentsManager->getSegments($this->visitorId); + $triggered = $this->dataManager->convert( + $this->visitorId, + $goalKey, + $attributes?->ruleData, + $conversionData, + $segments, + $attributes?->conversionSetting + ); + + if ($triggered instanceof RuleError) { + return $triggered; + } + if ($triggered === false) { + return false; + } + if ($triggered) { + $this->eventManager->fire( + SystemEvents::Conversion, + [ + 'visitorId' => $this->visitorId, + 'goalKey' => $goalKey, + ], + null, + true + ); + } + + return null; + } + + /** + * Set default segments for reports. + * + * @param array $segments Segment data + * @return void + */ + public function setDefaultSegments(array $segments): void + { + $this->segmentsManager->putSegments($this->visitorId, $segments); + } + + /** + * To be deprecated. + * + * @param array $segmentKeys A list of segment keys + * @param array|null $attributes Segment attributes + * @return array|null + */ + public function setCustomSegments(array $segmentKeys, ?array $attributes = null): ?array + { + return $this->runCustomSegments($segmentKeys, $attributes); + } + + /** + * Match custom segments. + * + * @param array $segmentKeys A list of segment keys + * @param array|null $attributes Segment attributes + * @return array|null + */ + public function runCustomSegments(array $segmentKeys, ?array $attributes = null): ?array + { + if (empty($this->visitorId)) { + $this->loggerManager?->error( + 'Context.runCustomSegments()', + ErrorMessages::VISITOR_ID_REQUIRED + ); + return null; + } + $segmentsRule = $this->getVisitorProperties($attributes['ruleData'] ?? null); + $result = $this->segmentsManager->selectCustomSegments( + $this->visitorId, + $segmentKeys, + $segmentsRule + ); + if ($result === null || $result instanceof RuleError) { + return null; + } + return $result->getCustomSegments() ?: null; + } + + /** + * Update visitor properties in memory. + * + * @param string $visitorId The visitor ID + * @param array $visitorProperties Key-value pairs of visitor properties + * @return void + */ + public function updateVisitorProperties(string $visitorId, array $visitorProperties): void + { + $this->dataManager->putData($visitorId, ['segments' => $visitorProperties]); + } + + /** + * Set a single visitor attribute. + * + * @param string $key The attribute key + * @param mixed $value The attribute value + * @return void + */ + public function setAttribute(string $key, mixed $value): void + { + $this->visitorProperties = $this->visitorProperties ?? []; + $this->visitorProperties[$key] = $value; + } + + /** + * Set multiple visitor attributes at once (merges with existing). + * + * @param array $attributes Key-value pairs of attributes + * @return void + */ + public function setAttributes(array $attributes): void + { + $this->visitorProperties = array_merge($this->visitorProperties ?? [], $attributes); + } + + /** + * Get all current visitor attributes. + * + * @return array The current visitor attributes + */ + public function getAttributes(): array + { + return $this->visitorProperties ?? []; + } + + /** + * Get the visitor ID for this context. + * + * @return string The visitor ID + */ + public function getVisitorId(): string + { + return $this->visitorId; + } + + /** + * Get config entity by key. + * + * @param string $key Entity key + * @param string $entityType Entity type (EntityType value) + * @return array The entity data + */ + public function getConfigEntity(string $key, string $entityType): array + { + if ($entityType === EntityType::Variation->value) { + $experiences = $this->dataManager->getEntitiesList(EntityType::Experience->value); + foreach ($experiences as $experience) { + $variation = $this->dataManager->getSubItem( + 'experiences', + $experience['key'], + 'variations', + $key, + 'key', + 'key' + ); + if ($variation) { + return $variation; + } + } + } + return $this->dataManager->getEntity($key, $entityType); + } + + /** + * Get config entity by ID. + * + * @param string $id Entity ID + * @param string $entityType Entity type (EntityType value) + * @return array The entity data + */ + public function getConfigEntityById(string $id, string $entityType): array + { + if ($entityType === EntityType::Variation->value) { + $experiences = $this->dataManager->getEntitiesList(EntityType::Experience->value); + foreach ($experiences as $experience) { + $variation = $this->dataManager->getSubItem( + 'experiences', + $experience['id'], + 'variations', + $id, + 'id', + 'id' + ); + if ($variation) { + return $variation; + } + } + } + return $this->dataManager->getEntityById($id, $entityType); + } + + /** + * Get visitor data. + * + * @return array The visitor's stored data + */ + public function getVisitorData(): array + { + return $this->dataManager->getData($this->visitorId) ?? []; + } + + /** + * Send pending API queue to server. + * + * @param string|null $reason Optional reason for releasing queues + * @return void + */ + public function releaseQueues(?string $reason = null): void + { + $this->apiManager->releaseQueue($reason); + } + + /** + * Get visitor properties merged with stored segments. + * + * @param array|null $attributes Visitor attributes to merge + * @return array Merged visitor properties + */ + private function getVisitorProperties(?array $attributes = null): array + { + $data = $this->dataManager->getData($this->visitorId); + $segments = $data && $data['segments'] ? $data['segments'] : []; + $segments = $segments ? $segments : []; + $visitorProperties = $attributes + ? ObjectUtils::objectDeepMerge($this->visitorProperties ?? [], $attributes) + : $this->visitorProperties; + return ObjectUtils::objectDeepMerge($segments, $visitorProperties ?? []); + } + + /** + * Map internal bucketed feature array to consumer-facing readonly DTO. + * + * @param array $feature The internal bucketed feature array from FeatureManager + * @return BucketedFeature The readonly consumer DTO + */ + private function mapToBucketedFeatureDto(array $feature): BucketedFeature + { + return new BucketedFeature( + featureId: (string) ($feature['id'] ?? ''), + featureKey: (string) ($feature['key'] ?? ''), + status: FeatureStatus::tryFrom($feature['status'] ?? 'disabled') ?? FeatureStatus::Disabled, + variables: (array) ($feature['variables'] ?? []), + ); + } + + /** + * Map internal bucketed variation array to consumer-facing readonly DTO. + * + * @param array $variation The internal bucketed variation array from DataManager + * @return BucketedVariation The readonly consumer DTO + */ + private function mapToBucketedVariationDto(array $variation): BucketedVariation + { + return new BucketedVariation( + experienceId: (string) ($variation['experienceId'] ?? ''), + experienceKey: (string) ($variation['experienceKey'] ?? ''), + variationId: (string) ($variation['id'] ?? ''), + variationKey: (string) ($variation['key'] ?? ''), + changes: (array) ($variation['changes'] ?? []), + ); + } +} diff --git a/packages/Php-sdk/src/ConvertSDK.php b/packages/Php-sdk/src/ConvertSDK.php new file mode 100644 index 0000000..fa90d5e --- /dev/null +++ b/packages/Php-sdk/src/ConvertSDK.php @@ -0,0 +1,189 @@ + 'your-sdk-key']); + * $context = $sdk->createContext('visitor-123', ['country' => 'US']); + */ +final class ConvertSDK +{ + /** + * Prevent direct instantiation — use {@see create()} instead. + */ + private function __construct() + { + } + + /** + * Create and initialize the SDK. + * + * Resolves all dependencies, creates managers in the correct order, + * and returns a fully initialized Core instance. + * + * @param array{ + * sdkKey?: string, + * data?: array|ConfigResponseData, + * logger?: array{logLevel?: LogLevel, customLoggers?: array}, + * cache?: CacheInterface, + * dataStore?: object, + * dataRefreshInterval?: int, + * environment?: string, + * network?: array, + * api?: array, + * } $config SDK configuration options + * + * @return Core A fully initialized Core instance + * + * @throws InvalidArgumentException If both sdkKey and data are missing + */ + public static function create(array $config = []): Core + { + // 1. Validate: at least one of sdkKey or data must be provided + if (empty($config['sdkKey']) && empty($config['data'])) { + throw new InvalidArgumentException('Either sdkKey or data must be provided'); + } + + // 2. Merge defaults + $configuration = Config::create($config); + // Allow VERSION env var to override network.source (for CI/release builds) + $version = getenv('VERSION'); + if ($version !== false && $version !== '') { + $configuration['network']['source'] = $version; + } + + // Remove empty sdkKey so OpenAPI\Client\Config processes 'data' correctly + // (its constructor uses isset() and elseif, so an empty sdkKey blocks data) + if (isset($configuration['sdkKey']) && $configuration['sdkKey'] === '') { + unset($configuration['sdkKey']); + } + + // 3. Resolve logger (mirrors JS SDK: logger.logLevel + logger.customLoggers[]) + $loggerConfig = is_array($configuration['logger'] ?? null) ? $configuration['logger'] : []; + $logLevel = $loggerConfig['logLevel'] ?? LogLevel::Warn; + $logManager = new LogManager(new NullLogger(), $logLevel); + + // Add custom loggers — each entry is either a PSR-3 LoggerInterface + // or an array {logger: LoggerInterface, logLevel?: LogLevel} + $customLoggers = $loggerConfig['customLoggers'] ?? []; + foreach ($customLoggers as $entry) { + if ($entry instanceof LoggerInterface) { + $logManager->addClient($entry, $logLevel); + } elseif (is_array($entry) && isset($entry['logger']) && $entry['logger'] instanceof LoggerInterface) { + $logManager->addClient($entry['logger'], $entry['logLevel'] ?? $logLevel); + } + } + + // 4. Resolve PSR-16 cache + $cache = (isset($configuration['cache']) && $configuration['cache'] instanceof CacheInterface) + ? $configuration['cache'] + : new ArrayCache(); + + // Resolve dataRefreshInterval: DefaultConfig stores milliseconds, PSR-16 cache uses seconds + $dataRefreshIntervalMs = (int) ($configuration['dataRefreshInterval'] ?? 300000); + $dataRefreshInterval = max(1, (int) ($dataRefreshIntervalMs / 1000)); + + // 5. Wrap data in ConfigResponseData if raw array provided + if (!empty($configuration['data']) && is_array($configuration['data'])) { + $configuration['data'] = new ConfigResponseData($configuration['data']); + } + + // 6. Create OpenApiConfig wrapper + $openApiConfig = new OpenApiConfig($configuration); + + // 7. Instantiate managers in dependency order + $mapper = $openApiConfig->getMapper(); + $eventManager = new EventManager( + loggerManager: $logManager, + mapper: is_callable($mapper) ? $mapper : null, + ); + + try { + $apiManager = new ApiManager($openApiConfig, $eventManager, $logManager); + } catch (\Http\Discovery\Exception\NotFoundException $e) { + throw new \RuntimeException( + 'No PSR-18 HTTP client found. Install one (e.g., guzzlehttp/guzzle ^7) or pass an explicit httpClient.', + 0, + $e + ); + } + + $bucketingConfig = $openApiConfig->getBucketing(); + $bucketingManager = new BucketingManager( + maxTraffic: $bucketingConfig['max_traffic'] ?? 10000, + hashSeed: $bucketingConfig['hash_seed'] ?? 9999, + logManager: $logManager, + ); + $rulesConfig = $openApiConfig->getRules() ?? []; + $ruleManager = new RuleManager( + comparisonProcessor: $rulesConfig['comparisonProcessor'] ?? Comparisons::class, + negation: isset($rulesConfig['negation']) ? (string) $rulesConfig['negation'] : '!', + keysCaseSensitive: $rulesConfig['keys_case_sensitive'] ?? true, + logManager: $logManager, + mapper: is_callable($mapper) ? \Closure::fromCallable($mapper) : null, + ); + + $dataManager = new DataManager( + $openApiConfig, + $bucketingManager, + $ruleManager, + $eventManager, + $apiManager, + $logManager + ); + + // 7b. Wire PSR-16 cache as the visitor data store (enables cross-request persistence) + $dataStore = $configuration['dataStore'] ?? $cache; + $dataManager->setDataStore($dataStore); + + $experienceManager = new ExperienceManager( + dataManager: $dataManager, + logManager: $logManager, + ); + + $featureManager = new FeatureManager(dataManager: $dataManager, logManager: $logManager); + $segmentsManager = new SegmentsManager($openApiConfig, $dataManager, $ruleManager, $logManager); + + // 8. Register shutdown function for FPM auto-flush + register_shutdown_function(static function () use ($apiManager): void { + if (function_exists('fastcgi_finish_request')) { + fastcgi_finish_request(); + } + $apiManager->releaseQueue('shutdown'); + }); + + // 9. Construct and return Core + return new Core( + $openApiConfig, + $dataManager, + $eventManager, + $experienceManager, + $featureManager, + $segmentsManager, + $apiManager, + $cache, + $dataRefreshInterval, + $logManager + ); + } +} diff --git a/packages/Php-sdk/src/Core.php b/packages/Php-sdk/src/Core.php new file mode 100644 index 0000000..4849371 --- /dev/null +++ b/packages/Php-sdk/src/Core.php @@ -0,0 +1,297 @@ +environment = $config->getEnvironment() ?? null; + $this->configValidator = new ConfigValidator(); + $this->initialize(); + } + + /** + * Build a PSR-16 compliant cache key for the given SDK key. + * + * @param string $sdkKey The SDK key to hash + * @return string A cache-safe key + */ + private function buildCacheKey(string $sdkKey): string + { + if (preg_match('/^[A-Za-z0-9_.]+$/', $sdkKey) && strlen($sdkKey) <= 48) { + return 'convert_sdk.config.' . $sdkKey; + } + + return 'convert_sdk.config.' . substr(hash('sha256', $sdkKey), 0, 16); + } + + /** + * Initialize credentials, configData etc. + * + * @return void + */ + private function initialize(): void + { + if ($this->config->getSdkKey() && strlen($this->config->getSdkKey()) > 0) { + try { + $this->fetchConfig(); + $this->eventManager->fire(SystemEvents::Ready, [], null, true); + $this->loggerManager?->trace('Core.initialize()', Messages::CORE_INITIALIZED); + $this->initialized = true; + } catch (\Exception $e) { + $this->loggerManager?->error('Core.initialize()', ['error' => $e->getMessage()]); + $this->eventManager->fire( + SystemEvents::Ready, + [], + $e, + true + ); + } + } elseif ($this->config->getData()) { + try { + $this->configValidator->validate($this->config->getData()); + } catch (ConfigValidationException $e) { + $this->loggerManager?->error('Core.initialize()', ['error' => $e->getMessage()]); + $this->eventManager->fire( + SystemEvents::Ready, + [], + $e, + true + ); + return; + } + + $this->dataManager->setConfigData($this->config->getData()); + $this->eventManager->fire(SystemEvents::Ready, [], null, true); + $this->loggerManager?->trace('Core.initialize()', Messages::CORE_INITIALIZED); + $this->initialized = true; + } else { + $this->loggerManager?->error('Core.initialize()', ErrorMessages::SDK_OR_DATA_OBJECT_REQUIRED); + $this->eventManager->fire( + SystemEvents::Ready, + [], + new \Exception(ErrorMessages::SDK_OR_DATA_OBJECT_REQUIRED), + true + ); + } + } + + /** + * Create a visitor context. + * + * @param string $visitorId A unique visitor identifier + * @param array|null $visitorAttributes Key-value pairs for audience/segments targeting + * @return ContextInterface|null The visitor context, or null if SDK is not initialized + * @throws InvalidArgumentException If visitorId is empty + */ + public function createContext(string $visitorId, ?array $visitorAttributes = null): ?ContextInterface + { + if ($visitorId === '') { + throw new InvalidArgumentException('Visitor ID must not be empty'); + } + if (!$this->initialized) { + return null; + } + return new Context( + $this->config, + $visitorId, + $this->eventManager, + $this->experienceManager, + $this->featureManager, + $this->dataManager, + $this->segmentsManager, + $this->apiManager, + $this->loggerManager, + $visitorAttributes + ); + } + + /** + * Attach an event handler to a system event. + * + * @param string $event Event name (SystemEvents) + * @param callable $fn A callback function which will be fired + * @return void + */ + public function on(string $event, callable $fn): void + { + $this->eventManager->on($event, $fn); + } + + /** + * Check if the SDK is fully initialized and ready to use. + * + * @return bool True if the SDK is initialized with valid config data + */ + public function isReady(): bool + { + try { + $configData = $this->dataManager->getConfigData(); + if ($this->initialized && $configData->getAccountId() && $configData->getProject()) { + return true; + } + return false; + } catch (\Exception $e) { + return false; + } + } + + /** + * Check if the system is ready. + * + * @deprecated Use isReady() instead + * @return bool + */ + public function onReady(): bool + { + return $this->isReady(); + } + + /** + * Flush all queued tracking events immediately. + * + * @return void + */ + public function flush(): void + { + $this->apiManager->releaseQueue('flush'); + } + + /** + * Fetch remote config data, using cache when available. + * + * @return void + * @throws ConfigFetchException If the remote config fetch fails + * @throws ConfigValidationException If the fetched config is invalid + */ + private function fetchConfig(): void + { + $sdkKey = $this->config->getSdkKey(); + $cacheKey = $this->buildCacheKey($sdkKey); + + $configEndpoint = $this->config->getApi() && isset($this->config->getApi()['endpoint']['config']) + ? $this->config->getApi()['endpoint']['config'] + : ''; + + // Check cache first + $cachedData = $this->cache->get($cacheKey); + + if ($cachedData instanceof ConfigResponseData) { + $this->loggerManager?->trace('Core.fetchConfig()', 'Using cached config'); + + try { + $this->configValidator->validate($cachedData); + } catch (ConfigValidationException $e) { + $this->loggerManager?->error('Core.fetchConfig()', ['error' => 'Cached config invalid, fetching fresh: ' . $e->getMessage()]); + $this->cache->delete($cacheKey); + $cachedData = null; + } + } else { + $cachedData = null; + } + + if ($cachedData !== null) { + $data = $cachedData; + } else { + // Cache miss — fetch via HTTP + try { + $data = $this->apiManager->getConfig(); + } catch (\RuntimeException $error) { + $this->loggerManager?->error('Core.fetchConfig()', ['error' => $error->getMessage()]); + throw new ConfigFetchException( + $error->getMessage(), + (int) $error->getCode(), + $configEndpoint, + $error + ); + } + + // Validate fresh config + $this->configValidator->validate($data); + + // Store in cache + $this->cache->set($cacheKey, $data, $this->dataRefreshInterval); + $this->loggerManager?->trace('Core.fetchConfig()', 'Config cached with TTL ' . $this->dataRefreshInterval . 's'); + } + + $this->dataManager->setConfigData($data); + $this->loggerManager?->trace('Core.fetchConfig()', ['data' => $data]); + + // Only fire ConfigUpdated on subsequent refreshes, not initial load + if ($this->initialized) { + $this->eventManager->fire(SystemEvents::ConfigUpdated, [], null, true); + } + + $this->apiManager->setData($data); + $this->loggerManager?->trace('Core.fetchConfig()', Messages::CONFIG_DATA_UPDATED); + } +} diff --git a/packages/Php-sdk/src/DTO/BucketedFeature.php b/packages/Php-sdk/src/DTO/BucketedFeature.php new file mode 100644 index 0000000..afc60d1 --- /dev/null +++ b/packages/Php-sdk/src/DTO/BucketedFeature.php @@ -0,0 +1,29 @@ + $variables The feature variables with their resolved values + */ + public function __construct( + public string $featureId, + public string $featureKey, + public FeatureStatus $status, + public array $variables, + ) { + } +} diff --git a/packages/Php-sdk/src/DTO/BucketedVariation.php b/packages/Php-sdk/src/DTO/BucketedVariation.php new file mode 100644 index 0000000..006e931 --- /dev/null +++ b/packages/Php-sdk/src/DTO/BucketedVariation.php @@ -0,0 +1,29 @@ +> $changes The variation changes + */ + public function __construct( + public string $experienceId, + public string $experienceKey, + public string $variationId, + public string $variationKey, + public array $changes, + ) { + } +} diff --git a/packages/Php-sdk/src/DTO/ConversionAttributes.php b/packages/Php-sdk/src/DTO/ConversionAttributes.php new file mode 100644 index 0000000..d2a2805 --- /dev/null +++ b/packages/Php-sdk/src/DTO/ConversionAttributes.php @@ -0,0 +1,23 @@ +|null $ruleData Key-value pairs for goal rule matching + * @param array|null $conversionData Goal data entries (amount, transactionId, etc.) + * @param array|null $conversionSetting Tracking behavior overrides (e.g., forceMultipleTransactions) + */ + public function __construct( + public ?array $ruleData = null, + public ?array $conversionData = null, + public ?array $conversionSetting = null, + ) { + } +} diff --git a/packages/Php-sdk/src/DTO/GoalData.php b/packages/Php-sdk/src/DTO/GoalData.php new file mode 100644 index 0000000..89f5284 --- /dev/null +++ b/packages/Php-sdk/src/DTO/GoalData.php @@ -0,0 +1,26 @@ +statusCode; + } + + public function getUrl(): string + { + return $this->url; + } +} diff --git a/packages/Php-sdk/src/Exception/ConfigValidationException.php b/packages/Php-sdk/src/Exception/ConfigValidationException.php new file mode 100644 index 0000000..45d2e22 --- /dev/null +++ b/packages/Php-sdk/src/Exception/ConfigValidationException.php @@ -0,0 +1,9 @@ + List of features + */ + public function getList(): array + { + return $this->dataManager->getEntitiesList('features'); + } + + /** + * Get a list of all features as object grouped by identity field. + * + * @param string $field A field to group entities, defaults to 'id' + * @return array Features grouped by field + */ + public function getListAsObject(string $field): array + { + return $this->dataManager->getEntitiesListObject('features', $field); + } + + /** + * Get a feature entity by key. + * + * @param string $key Feature key + * @return ConfigFeature The feature + */ + public function getFeature(string $key): ConfigFeature + { + return new ConfigFeature($this->dataManager->getEntity($key, 'features')); + } + + /** + * Get a feature entity by ID. + * + * @param string $id Feature ID + * @return ConfigFeature The feature + */ + public function getFeatureById(string $id): ConfigFeature + { + return new ConfigFeature($this->dataManager->getEntityById($id, 'features')); + } + + /** + * Get specific features by array of keys. + * + * @param array $keys Feature keys + * @return array Matching features + */ + public function getFeatures(array $keys): array + { + return $this->dataManager->getItemsByKeys($keys, 'features'); + } + + /** + * Get a specific variable type defined in a specific feature. + * + * @param string $key A feature's key + * @param string $variableName Variable name + * @return string|null The variable type or null + */ + public function getFeatureVariableType(string $key, string $variableName): ?string + { + $feature = $this->getFeature($key); + if (isset($feature['variables'])) { + foreach ($feature['variables'] as $variable) { + if ($variable['key'] === $variableName) { + return $variable['type'] ?? null; + } + } + } + return null; + } + + /** + * Get a specific variable type defined in a specific feature by ID. + * + * @param string $id A feature's ID + * @param string $variableName Variable name + * @return string|null The variable type or null + */ + public function getFeatureVariableTypeById(string $id, string $variableName): ?string + { + $feature = $this->getFeatureById($id); + if (isset($feature['variables'])) { + foreach ($feature['variables'] as $variable) { + if ($variable['key'] === $variableName) { + return $variable['type'] ?? null; + } + } + } + return null; + } + + /** + * Check that feature is declared. + * + * @param string $key Feature key + * @return bool True if feature exists + */ + public function isFeatureDeclared(string $key): bool + { + $declaredFeature = $this->dataManager->getEntity($key, 'features'); + return $declaredFeature !== null; + } + + /** + * Get feature and its status. + * + * @param string $visitorId Visitor identifier + * @param string $featureKey Feature key + * @param BucketingAttributes $attributes Bucketing attributes + * @param array|null $experienceKeys Optional array of experience keys + * @return array Returns a single bucketed feature array or array of feature arrays + */ + public function runFeature( + string $visitorId, + string $featureKey, + BucketingAttributes $attributes, + ?array $experienceKeys = null + ): array { + $this->logManager?->debug('FeatureManager.runFeature()', [ + 'visitorId' => $visitorId, + 'featureKey' => $featureKey, + ]); + + $declaredFeature = $this->dataManager->getEntity($featureKey, 'features'); + if ($declaredFeature) { + $features = $this->runFeatures($visitorId, $attributes, [ + 'features' => [$featureKey], + 'experiences' => $experienceKeys, + ]); + + // Filter out RuleError items (runFeatures may return them) + $validFeatures = array_filter($features, fn ($f) => is_array($f)); + + if (!empty($validFeatures)) { + $result = count($validFeatures) === 1 + ? reset($validFeatures) + : array_values($validFeatures); + + $this->logManager?->debug('FeatureManager.runFeature()', [ + 'featureKey' => $featureKey, + 'status' => FeatureStatus::Enabled->value, + ]); + + return $result; + } + + $this->logManager?->debug('FeatureManager.runFeature()', [ + 'featureKey' => $featureKey, + 'status' => FeatureStatus::Disabled->value, + ]); + + return [ + 'id' => $declaredFeature['id'], + 'name' => $declaredFeature['name'], + 'key' => $featureKey, + 'status' => FeatureStatus::Disabled->value, + ]; + } else { + if ($this->logManager) { + $availableKeys = array_map( + fn ($f) => $f['key'] ?? 'unknown', + $this->dataManager->getEntitiesList('features') + ); + $this->logManager->debug('FeatureManager.runFeature()', [ + 'featureKey' => $featureKey, + 'reason' => Messages::NULL_RETURN_FEATURE_NOT_FOUND, + 'availableKeys' => $availableKeys, + ]); + } + + return [ + 'key' => $featureKey, + 'status' => FeatureStatus::Disabled->value, + ]; + } + } + + /** + * Check if feature is enabled. + * + * @param string $visitorId Visitor identifier + * @param string $featureKey Feature key + * @param BucketingAttributes $attributes Bucketing attributes + * @param array|null $experienceKeys Optional array of experience keys + * @return bool True if feature is enabled + */ + public function isFeatureEnabled( + string $visitorId, + string $featureKey, + BucketingAttributes $attributes, + ?array $experienceKeys = null + ): bool { + $this->logManager?->debug('FeatureManager.isFeatureEnabled()', [ + 'visitorId' => $visitorId, + 'featureKey' => $featureKey, + ]); + + $declaredFeature = $this->dataManager->getEntity($featureKey, 'features'); + + if ($declaredFeature) { + $features = $this->runFeatures($visitorId, $attributes, [ + 'features' => [$featureKey], + 'experiences' => $experienceKeys, + ]); + $validFeatures = array_filter($features, fn ($f) => is_array($f)); + $enabled = !empty($validFeatures); + + $this->logManager?->debug('FeatureManager.isFeatureEnabled()', [ + 'featureKey' => $featureKey, + 'enabled' => $enabled, + ]); + + return $enabled; + } + + if ($this->logManager) { + $availableKeys = array_map( + fn ($f) => $f['key'] ?? 'unknown', + $this->dataManager->getEntitiesList('features') + ); + $this->logManager->debug('FeatureManager.isFeatureEnabled()', [ + 'featureKey' => $featureKey, + 'enabled' => false, + 'reason' => Messages::NULL_RETURN_FEATURE_NOT_FOUND, + 'availableKeys' => $availableKeys, + ]); + } + + return false; + } + + /** + * Get feature and its status by ID. + * + * @param string $visitorId Visitor identifier + * @param string $featureId Feature ID + * @param BucketingAttributes $attributes Bucketing attributes + * @param array|null $experienceIds Optional array of experience IDs + * @return array Returns a single bucketed feature array or array of feature arrays + */ + public function runFeatureById( + string $visitorId, + string $featureId, + BucketingAttributes $attributes, + ?array $experienceIds = null + ): array { + $this->logManager?->debug('FeatureManager.runFeatureById()', [ + 'visitorId' => $visitorId, + 'featureId' => $featureId, + ]); + + $declaredFeature = $this->dataManager->getEntityById($featureId, 'features'); + + if ($declaredFeature) { + $experienceKeys = $experienceIds ? array_map(function ($exp) { + return $exp['key']; + }, $this->dataManager->getEntitiesByIds($experienceIds, 'experiences')) : null; + + $features = $this->runFeatures($visitorId, $attributes, [ + 'features' => [$declaredFeature['key']], + 'experiences' => $experienceKeys, + ]); + + // Filter out RuleError items + $validFeatures = array_filter($features, fn ($f) => is_array($f)); + + if (!empty($validFeatures)) { + $this->logManager?->debug('FeatureManager.runFeatureById()', [ + 'featureId' => $featureId, + 'status' => FeatureStatus::Enabled->value, + ]); + + if (count($validFeatures) === 1) { + return reset($validFeatures); + } else { + return array_values($validFeatures); + } + } + + $this->logManager?->debug('FeatureManager.runFeatureById()', [ + 'featureId' => $featureId, + 'status' => FeatureStatus::Disabled->value, + ]); + + return [ + 'id' => $featureId, + 'name' => $declaredFeature['name'], + 'key' => $declaredFeature['key'], + 'status' => FeatureStatus::Disabled->value, + ]; + } else { + if ($this->logManager) { + $availableIds = array_map( + fn ($f) => $f['id'] ?? 'unknown', + $this->dataManager->getEntitiesList('features') + ); + $this->logManager->debug('FeatureManager.runFeatureById()', [ + 'featureId' => $featureId, + 'reason' => Messages::NULL_RETURN_FEATURE_NOT_FOUND, + 'availableIds' => $availableIds, + ]); + } + + return [ + 'id' => $featureId, + 'status' => FeatureStatus::Disabled->value, + ]; + } + } + + /** + * Get features and their statuses. + * + * @param string $visitorId The unique identifier for the visitor + * @param BucketingAttributes $attributes The bucketing attributes object + * @param array|null $filter Filter records by experiences and/or features keys + * @return array Array of bucketed features or rule errors + */ + public function runFeatures(string $visitorId, BucketingAttributes $attributes, ?array $filter = null): array + { + if ($this->logManager) { + $this->logManager->debug('FeatureManager.runFeatures()', [ + 'visitorId' => $visitorId, + 'filter' => $filter, + ]); + } + + $typeCasting = $attributes->getTypeCasting() ?? true; + + $declaredFeatures = $this->getListAsObject('id'); + + $bucketedFeatures = []; + $experiences = (!empty($filter['experiences'])) + ? $this->dataManager->getEntities($filter['experiences'], 'experiences') + : $this->dataManager->getEntitiesList('experiences'); + + $bucketedVariations = array_filter(array_map(function ($experience) use ($visitorId, $attributes) { + $variation = $this->dataManager->getBucketing( + $visitorId, + $experience['key'] ?? null, + $attributes + ); + if ($variation instanceof RuleError) { + return $variation; + } + return $variation; + }, $experiences)); + + $matchedErrors = array_filter($bucketedVariations, function ($match) { + return $match instanceof RuleError; + }); + if (!empty($matchedErrors)) { + return $matchedErrors; + } + + foreach ($bucketedVariations as $bucketedVariation) { + $changes = []; + if (is_array($bucketedVariation)) { + $changes = $bucketedVariation['changes'] ?? []; + } + foreach ($changes as $change) { + if (($change['type'] ?? null) !== VariationChangeType::FullstackFeature->value) { + $this->logManager?->warn( + 'FeatureManager.runFeatures()', + Messages::VARIATION_CHANGE_NOT_SUPPORTED + ); + continue; + } + $featureId = $change['data']['feature_id'] ?? null; + if (!$featureId) { + $this->logManager?->warn( + 'FeatureManager.runFeatures()', + Messages::FEATURE_NOT_FOUND + ); + continue; + } + + if ( + !isset($filter['features']) || + (isset($filter['features']) && in_array($declaredFeatures[$featureId]['key'] ?? null, $filter['features'], true)) + ) { + $variables = $change['data']['variables_data'] ?? null; + + if ($variables === null) { + $this->logManager?->warn( + 'FeatureManager.runFeatures()', + Messages::FEATURE_VARIABLES_NOT_FOUND + ); + } + + if ($typeCasting && !empty($variables)) { + foreach ($variables as $variableName => $value) { + $variableDefinition = null; + foreach ($declaredFeatures[$featureId]['variables'] ?? [] as $obj) { + if ($obj['key'] === $variableName) { + $variableDefinition = $obj; + break; + } + } + if ($variableDefinition && isset($variableDefinition['type'])) { + $variables[$variableName] = $this->castType($value, $variableDefinition['type']); + } else { + $this->logManager?->warn( + 'FeatureManager.runFeatures()', + Messages::FEATURE_VARIABLES_TYPE_NOT_FOUND + ); + } + } + } + + $bucketedFeature = array_merge( + [ + 'experienceId' => $bucketedVariation['experienceId'] ?? null, + 'experienceName' => $bucketedVariation['experienceName'] ?? null, + 'experienceKey' => $bucketedVariation['experienceKey'] ?? null, + ], + [ + 'key' => $declaredFeatures[$featureId]['key'] ?? null, + 'name' => $declaredFeatures[$featureId]['name'] ?? null, + 'id' => $featureId, + 'status' => FeatureStatus::Enabled->value, + 'variables' => $variables, + ] + ); + $bucketedFeatures[] = $bucketedFeature; + } + } + } + + if (!isset($filter['features'])) { + $bucketedFeaturesIds = array_column($bucketedFeatures, 'id'); + foreach ($declaredFeatures as $declaredFeature) { + if (!in_array($declaredFeature['id'], $bucketedFeaturesIds, true)) { + $bucketedFeatures[] = [ + 'id' => $declaredFeature['id'], + 'name' => $declaredFeature['name'] ?? null, + 'key' => $declaredFeature['key'] ?? null, + 'status' => FeatureStatus::Disabled->value, + ]; + } + } + } + + if ($this->logManager) { + $enabledCount = count(array_filter($bucketedFeatures, fn ($f) => ($f['status'] ?? '') === FeatureStatus::Enabled->value)); + $disabledCount = count($bucketedFeatures) - $enabledCount; + $this->logManager->debug('FeatureManager.runFeatures()', [ + 'visitorId' => $visitorId, + 'totalFeatures' => count($bucketedFeatures), + 'enabled' => $enabledCount, + 'disabled' => $disabledCount, + ]); + } + + return $bucketedFeatures; + } + + /** + * Convert value's type. + * + * @param mixed $value The value to cast + * @param string $type The target type + * @return mixed The casted value + */ + public function castType(mixed $value, string $type): mixed + { + return TypeUtils::castType($value, $type); + } +} diff --git a/packages/Php-sdk/src/Interfaces/ContextInterface.php b/packages/Php-sdk/src/Interfaces/ContextInterface.php new file mode 100644 index 0000000..fc48990 --- /dev/null +++ b/packages/Php-sdk/src/Interfaces/ContextInterface.php @@ -0,0 +1,167 @@ + $segments The segments to set + * @return void + */ + public function setDefaultSegments(array $segments): void; + + /** + * Run custom segments for given segment keys. + * + * @param array $segmentKeys Array of segment keys + * @param array|null $attributes Optional segment attributes + * @return array|null Custom segments or null + */ + public function runCustomSegments(array $segmentKeys, ?array $attributes = null): ?array; + + /** + * Set custom segments (deprecated alias for runCustomSegments). + * + * @deprecated Use runCustomSegments() instead + * @param array $segmentKeys Array of segment keys + * @param array|null $attributes Optional segment attributes + * @return array|null Custom segments or null + */ + public function setCustomSegments(array $segmentKeys, ?array $attributes = null): ?array; + + /** + * Update properties for a specific visitor. + * + * @param string $visitorId The ID of the visitor + * @param array $visitorProperties Key-value pairs of visitor properties + * @return void + */ + public function updateVisitorProperties(string $visitorId, array $visitorProperties): void; + + /** + * Retrieve a configuration entity by key and type. + * + * @param string $key The key of the entity + * @param string $entityType The type of the entity (EntityType value) + * @return array The entity data + */ + public function getConfigEntity(string $key, string $entityType): array; + + /** + * Retrieve a configuration entity by ID and type. + * + * @param string $id The ID of the entity + * @param string $entityType The type of the entity (EntityType value) + * @return array The entity data + */ + public function getConfigEntityById(string $id, string $entityType): array; + + /** + * Retrieve the visitor's stored data. + * + * @return array The visitor's data + */ + public function getVisitorData(): array; + + /** + * Release any queued operations. + * + * @param string|null $reason Optional reason for releasing queues + * @return void + */ + public function releaseQueues(?string $reason = null): void; + + /** + * Set a single visitor attribute. + * + * @param string $key The attribute key + * @param mixed $value The attribute value + * @return void + */ + public function setAttribute(string $key, mixed $value): void; + + /** + * Set multiple visitor attributes at once (merges with existing). + * + * @param array $attributes Key-value pairs of attributes + * @return void + */ + public function setAttributes(array $attributes): void; + + /** + * Get all current visitor attributes. + * + * @return array The current visitor attributes + */ + public function getAttributes(): array; + + /** + * Get the visitor ID for this context. + * + * @return string The visitor ID + */ + public function getVisitorId(): string; +} diff --git a/packages/Php-sdk/src/Interfaces/CoreInterface.php b/packages/Php-sdk/src/Interfaces/CoreInterface.php new file mode 100644 index 0000000..4d0df60 --- /dev/null +++ b/packages/Php-sdk/src/Interfaces/CoreInterface.php @@ -0,0 +1,52 @@ +|null $visitorAttributes Optional associative array for audience/segments targeting + * @return ContextInterface|null The visitor context, or null if SDK is not initialized + * @throws \ConvertSdk\Exception\InvalidArgumentException If visitorId is empty + */ + public function createContext(string $visitorId, ?array $visitorAttributes = null): ?ContextInterface; + + /** + * Attach an event handler to a system event. + * + * @param string $event Event name (SystemEvents value) + * @param callable $fn Callback function which will be fired + * @return void + */ + public function on(string $event, callable $fn): void; + + /** + * Check if the SDK is fully initialized and ready to use. + * + * @return bool True if the SDK is initialized with valid config data + */ + public function isReady(): bool; + + /** + * Check if the system is ready. + * + * @deprecated Use isReady() instead + * @return bool + */ + public function onReady(): bool; + + /** + * Flush all queued tracking events immediately. + * + * @return void + */ + public function flush(): void; +} diff --git a/packages/Php-sdk/src/Interfaces/FeatureManagerInterface.php b/packages/Php-sdk/src/Interfaces/FeatureManagerInterface.php new file mode 100644 index 0000000..75bfd7d --- /dev/null +++ b/packages/Php-sdk/src/Interfaces/FeatureManagerInterface.php @@ -0,0 +1,152 @@ + Associative array of features + */ + public function getListAsObject(string $field): array; + + /** + * Check if a feature is declared by its key. + * + * @param string $key Feature key + * @return bool True if the feature is declared, false otherwise + */ + public function isFeatureDeclared(string $key): bool; + + /** + * Get the type of a feature variable by feature key. + * + * @param string $key Feature key + * @param string $variableName Variable name + * @return string Variable type (e.g., 'string', 'number') + */ + public function getFeatureVariableType(string $key, string $variableName): ?string; + + /** + * Get the type of a feature variable by feature ID. + * + * @param string $id Feature ID + * @param string $variableName Variable name + * @return string Variable type (e.g., 'string', 'number') + */ + public function getFeatureVariableTypeById(string $id, string $variableName): ?string; + + /** + * Run a feature for a visitor, returning its bucketed state. + * + * @param string $visitorId Visitor ID + * @param string $featureKey Feature key + * @param BucketingAttributes $attributes Bucketing attributes + * @param string[]|null $experienceKeys Optional array of experience keys + * @return array Bucketed feature array or array of feature arrays + */ + public function runFeature( + string $visitorId, + string $featureKey, + BucketingAttributes $attributes, + ?array $experienceKeys = null + ): array; + + /** + * Check if a feature is enabled for a visitor. + * + * @param string $visitorId Visitor ID + * @param string $featureKey Feature key + * @param BucketingAttributes $attributes Bucketing attributes + * @param string[]|null $experienceKeys Optional array of experience keys + * @return bool True if the feature is enabled, false otherwise + */ + public function isFeatureEnabled( + string $visitorId, + string $featureKey, + BucketingAttributes $attributes, + ?array $experienceKeys = null + ): bool; + + /** + * Run a feature by its ID for a visitor, returning its bucketed state. + * + * @param string $visitorId Visitor ID + * @param string $featureId Feature ID + * @param BucketingAttributes $attributes Bucketing attributes + * @param string[]|null $experienceIds Optional array of experience IDs + * @return array Bucketed feature array or array of feature arrays + */ + public function runFeatureById( + string $visitorId, + string $featureId, + BucketingAttributes $attributes, + ?array $experienceIds = null + ): array; + + /** + * Run multiple features for a visitor with optional filtering. + * + * @param string $visitorId Visitor ID + * @param BucketingAttributes $attributes Bucketing attributes + * @param array|null $filter Optional filter (e.g., ['experienceKeys' => ['exp1']]) + * @return array> Array of bucketed feature arrays + */ + public function runFeatures( + string $visitorId, + BucketingAttributes $attributes, + ?array $filter = null + ): array; +} diff --git a/packages/Php-sdk/tests/Cache/ArrayCacheTest.php b/packages/Php-sdk/tests/Cache/ArrayCacheTest.php new file mode 100644 index 0000000..3b51108 --- /dev/null +++ b/packages/Php-sdk/tests/Cache/ArrayCacheTest.php @@ -0,0 +1,170 @@ +cache = new ArrayCache(); + } + + #[Test] + public function implementsCacheInterface(): void + { + $this->assertInstanceOf(CacheInterface::class, $this->cache); + } + + #[Test] + public function setAndGetRoundTrip(): void + { + $this->cache->set('key1', 'value1'); + $this->assertSame('value1', $this->cache->get('key1')); + } + + #[Test] + public function getReturnsDefaultWhenKeyMissing(): void + { + $this->assertNull($this->cache->get('nonexistent')); + $this->assertSame('fallback', $this->cache->get('nonexistent', 'fallback')); + } + + #[Test] + public function ttlExpiryRemovesValue(): void + { + $this->cache->set('expiring', 'data', 1); + $this->assertSame('data', $this->cache->get('expiring')); + + sleep(2); + + $this->assertNull($this->cache->get('expiring')); + } + + #[Test] + public function hasReturnsFalseForExpiredKeys(): void + { + $this->cache->set('temp', 'val', 1); + $this->assertTrue($this->cache->has('temp')); + + sleep(2); + + $this->assertFalse($this->cache->has('temp')); + } + + #[Test] + public function deleteRemovesKey(): void + { + $this->cache->set('toDelete', 'val'); + $this->assertTrue($this->cache->has('toDelete')); + + $this->cache->delete('toDelete'); + $this->assertFalse($this->cache->has('toDelete')); + } + + #[Test] + public function clearRemovesAllKeys(): void + { + $this->cache->set('a', 1); + $this->cache->set('b', 2); + + $this->cache->clear(); + + $this->assertFalse($this->cache->has('a')); + $this->assertFalse($this->cache->has('b')); + } + + #[Test] + public function getMultipleReturnsMultipleValues(): void + { + $this->cache->set('x', 10); + $this->cache->set('y', 20); + + $result = $this->cache->getMultiple(['x', 'y', 'z'], 'default'); + + $this->assertSame(10, $result['x']); + $this->assertSame(20, $result['y']); + $this->assertSame('default', $result['z']); + } + + #[Test] + public function setMultipleSetsMultipleValues(): void + { + $this->cache->setMultiple(['a' => 1, 'b' => 2]); + + $this->assertSame(1, $this->cache->get('a')); + $this->assertSame(2, $this->cache->get('b')); + } + + #[Test] + public function deleteMultipleRemovesMultipleKeys(): void + { + $this->cache->set('a', 1); + $this->cache->set('b', 2); + $this->cache->set('c', 3); + + $this->cache->deleteMultiple(['a', 'b']); + + $this->assertFalse($this->cache->has('a')); + $this->assertFalse($this->cache->has('b')); + $this->assertTrue($this->cache->has('c')); + } + + #[Test] + public function nullTtlStoresWithoutExpiry(): void + { + $this->cache->set('forever', 'value', null); + $this->assertSame('value', $this->cache->get('forever')); + + // Should still be there (no expiry) + $this->assertTrue($this->cache->has('forever')); + } + + #[Test] + public function zeroOrNegativeTtlDeletesImmediately(): void + { + $this->cache->set('existing', 'data'); + $this->cache->set('existing', 'newdata', 0); + $this->assertFalse($this->cache->has('existing')); + + $this->cache->set('existing2', 'data'); + $this->cache->set('existing2', 'newdata', -1); + $this->assertFalse($this->cache->has('existing2')); + } + + #[Test] + public function dateIntervalTtlWorks(): void + { + $interval = new \DateInterval('PT10S'); // 10 seconds + $this->cache->set('interval_key', 'interval_value', $interval); + $this->assertSame('interval_value', $this->cache->get('interval_key')); + } + + #[Test] + public function storesVariousTypes(): void + { + $this->cache->set('int', 42); + $this->cache->set('float', 3.14); + $this->cache->set('bool', true); + $this->cache->set('array', ['a' => 1]); + $this->cache->set('null_val', null); + $object = new \stdClass(); + $object->foo = 'bar'; + $this->cache->set('object', $object); + + $this->assertSame(42, $this->cache->get('int')); + $this->assertSame(3.14, $this->cache->get('float')); + $this->assertSame(true, $this->cache->get('bool')); + $this->assertSame(['a' => 1], $this->cache->get('array')); + $this->assertNull($this->cache->get('null_val')); + $this->assertSame($object, $this->cache->get('object')); + } +} diff --git a/packages/Php-sdk/tests/Config/ConfigValidatorTest.php b/packages/Php-sdk/tests/Config/ConfigValidatorTest.php new file mode 100644 index 0000000..647c7b8 --- /dev/null +++ b/packages/Php-sdk/tests/Config/ConfigValidatorTest.php @@ -0,0 +1,102 @@ +validator = new ConfigValidator(); + } + + #[Test] + public function validConfigPassesWithoutException(): void + { + $config = new ConfigResponseData([ + 'account_id' => '12345', + 'project' => ['id' => '67890'], + ]); + + $this->validator->validate($config); + $this->assertTrue(true); // No exception thrown + } + + #[Test] + public function missingAccountIdThrowsConfigValidationException(): void + { + $config = new ConfigResponseData([ + 'project' => ['id' => '67890'], + ]); + + $this->expectException(ConfigValidationException::class); + $this->expectExceptionMessage('account_id'); + + $this->validator->validate($config); + } + + #[Test] + public function emptyAccountIdThrowsConfigValidationException(): void + { + $config = new ConfigResponseData([ + 'account_id' => '', + 'project' => ['id' => '67890'], + ]); + + $this->expectException(ConfigValidationException::class); + $this->expectExceptionMessage('account_id'); + + $this->validator->validate($config); + } + + #[Test] + public function missingProjectThrowsConfigValidationException(): void + { + $config = new ConfigResponseData([ + 'account_id' => '12345', + ]); + + $this->expectException(ConfigValidationException::class); + $this->expectExceptionMessage('project'); + + $this->validator->validate($config); + } + + #[Test] + public function projectWithoutIdThrowsConfigValidationException(): void + { + $config = new ConfigResponseData([ + 'account_id' => '12345', + 'project' => ['name' => 'no-id-here'], + ]); + + $this->expectException(ConfigValidationException::class); + $this->expectExceptionMessage('id'); + + $this->validator->validate($config); + } + + #[Test] + public function exceptionMessageContainsFieldName(): void + { + $config = new ConfigResponseData([ + 'project' => ['id' => '67890'], + ]); + + try { + $this->validator->validate($config); + $this->fail('Expected ConfigValidationException'); + } catch (ConfigValidationException $e) { + $this->assertStringContainsString('account_id', $e->getMessage()); + } + } +} diff --git a/packages/Php-sdk/tests/Config/CoreConfigFlowTest.php b/packages/Php-sdk/tests/Config/CoreConfigFlowTest.php new file mode 100644 index 0000000..5ea134d --- /dev/null +++ b/packages/Php-sdk/tests/Config/CoreConfigFlowTest.php @@ -0,0 +1,452 @@ + '10022898', + 'project' => ['id' => '10025986', 'name' => 'Test Project'], + ]); + } + + private function makeConfig(array $overrides = []): Config + { + $defaults = [ + 'data' => new ConfigResponseData([]), + 'api' => [ + 'endpoint' => [ + 'config' => 'http://cdn.example.com', + 'track' => 'http://track.example.com', + ], + ], + 'environment' => 'staging', + ]; + + return new Config(array_merge($defaults, $overrides)); + } + + private function makeDependencies( + ?ApiManagerInterface $apiManager = null, + ?DataManagerInterface $dataManager = null, + ?EventManagerInterface $eventManager = null, + ): array { + return [ + 'dataManager' => $dataManager ?? $this->createMock(DataManagerInterface::class), + 'eventManager' => $eventManager ?? $this->createMock(EventManagerInterface::class), + 'experienceManager' => $this->createMock(ExperienceManagerInterface::class), + 'featureManager' => $this->createMock(FeatureManagerInterface::class), + 'segmentsManager' => $this->createMock(SegmentsManagerInterface::class), + 'apiManager' => $apiManager ?? $this->createMock(ApiManagerInterface::class), + 'loggerManager' => $this->createMock(LogManagerInterface::class), + ]; + } + + #[Test] + public function directDataInitializationBypassesHttp(): void + { + $configData = $this->validConfigData(); + + $apiManager = $this->createMock(ApiManagerInterface::class); + $apiManager->expects($this->never())->method('getConfig'); + + $dataManager = $this->createMock(DataManagerInterface::class); + $dataManager->expects($this->once()) + ->method('setConfigData') + ->with($configData); + + $config = $this->makeConfig(['data' => $configData]); + $deps = $this->makeDependencies($apiManager, $dataManager); + $cache = new ArrayCache(); + + $core = new Core( + $config, + $deps['dataManager'], + $deps['eventManager'], + $deps['experienceManager'], + $deps['featureManager'], + $deps['segmentsManager'], + $deps['apiManager'], + $cache, + Core::DEFAULT_DATA_REFRESH_INTERVAL, + $deps['loggerManager'], + ); + $this->assertInstanceOf(Core::class, $core); + } + + #[Test] + public function sdkKeyInitializationCallsApiManagerWhenCacheEmpty(): void + { + $configData = $this->validConfigData(); + + $apiManager = $this->createMock(ApiManagerInterface::class); + $apiManager->expects($this->once()) + ->method('getConfig') + ->willReturn($configData); + + $dataManager = $this->createMock(DataManagerInterface::class); + $dataManager->expects($this->once()) + ->method('setConfigData') + ->with($configData); + + $config = $this->makeConfig([ + 'sdkKey' => 'test_sdk_key', + 'data' => new ConfigResponseData([]), + ]); + + $deps = $this->makeDependencies($apiManager, $dataManager); + $cache = new ArrayCache(); + + $core = new Core( + $config, + $deps['dataManager'], + $deps['eventManager'], + $deps['experienceManager'], + $deps['featureManager'], + $deps['segmentsManager'], + $deps['apiManager'], + $cache, + Core::DEFAULT_DATA_REFRESH_INTERVAL, + $deps['loggerManager'], + ); + $this->assertInstanceOf(Core::class, $core); + } + + #[Test] + public function cacheHitReturnsCachedConfigWithoutHttpCall(): void + { + $configData = $this->validConfigData(); + $sdkKey = 'cached_sdk_key'; + + $cache = new ArrayCache(); + $cacheKey = 'convert_sdk.config.' . $sdkKey; + $cache->set($cacheKey, $configData, 300); + + $apiManager = $this->createMock(ApiManagerInterface::class); + $apiManager->expects($this->never())->method('getConfig'); + + $dataManager = $this->createMock(DataManagerInterface::class); + $dataManager->expects($this->once()) + ->method('setConfigData') + ->with($configData); + + $config = $this->makeConfig([ + 'sdkKey' => $sdkKey, + 'data' => new ConfigResponseData([]), + ]); + + $deps = $this->makeDependencies($apiManager, $dataManager); + + $core = new Core( + $config, + $deps['dataManager'], + $deps['eventManager'], + $deps['experienceManager'], + $deps['featureManager'], + $deps['segmentsManager'], + $deps['apiManager'], + $cache, + Core::DEFAULT_DATA_REFRESH_INTERVAL, + $deps['loggerManager'], + ); + $this->assertInstanceOf(Core::class, $core); + } + + #[Test] + public function cacheMissFetchesViaHttpAndStoresInCache(): void + { + $configData = $this->validConfigData(); + $sdkKey = 'fetchable_key'; + + $cache = new ArrayCache(); + $cacheKey = 'convert_sdk.config.' . $sdkKey; + + $apiManager = $this->createMock(ApiManagerInterface::class); + $apiManager->expects($this->once()) + ->method('getConfig') + ->willReturn($configData); + + $config = $this->makeConfig([ + 'sdkKey' => $sdkKey, + 'data' => new ConfigResponseData([]), + ]); + + $deps = $this->makeDependencies($apiManager); + + $core = new Core( + $config, + $deps['dataManager'], + $deps['eventManager'], + $deps['experienceManager'], + $deps['featureManager'], + $deps['segmentsManager'], + $deps['apiManager'], + $cache, + 600, + $deps['loggerManager'], + ); + + // Verify cache was populated + $cached = $cache->get($cacheKey); + $this->assertInstanceOf(ConfigResponseData::class, $cached); + $this->assertSame('10022898', $cached->getAccountId()); + } + + #[Test] + public function apiManagerRuntimeExceptionIsWrappedInConfigFetchException(): void + { + $apiManager = $this->createMock(ApiManagerInterface::class); + $apiManager->expects($this->once()) + ->method('getConfig') + ->willThrowException(new \RuntimeException('HTTP 500 from server', 500)); + + $capturedError = null; + $eventManager = $this->createMock(EventManagerInterface::class); + $eventManager->expects($this->once()) + ->method('fire') + ->willReturnCallback(function ($event, $args, $err) use (&$capturedError) { + $capturedError = $err; + }); + + $config = $this->makeConfig([ + 'sdkKey' => 'failing_key', + 'data' => new ConfigResponseData([]), + ]); + + $deps = $this->makeDependencies($apiManager, null, $eventManager); + $cache = new ArrayCache(); + + $core = new Core( + $config, + $deps['dataManager'], + $deps['eventManager'], + $deps['experienceManager'], + $deps['featureManager'], + $deps['segmentsManager'], + $deps['apiManager'], + $cache, + Core::DEFAULT_DATA_REFRESH_INTERVAL, + $deps['loggerManager'], + ); + $this->assertInstanceOf(Core::class, $core); + + // Verify the RuntimeException was wrapped in ConfigFetchException + $this->assertInstanceOf(ConfigFetchException::class, $capturedError); + $this->assertStringContainsString('HTTP 500', $capturedError->getMessage()); + $this->assertSame(500, $capturedError->getStatusCode()); + } + + #[Test] + public function malformedConfigTriggersValidationError(): void + { + $badConfig = new ConfigResponseData([ + // Missing account_id and project + ]); + + $apiManager = $this->createMock(ApiManagerInterface::class); + $apiManager->expects($this->once()) + ->method('getConfig') + ->willReturn($badConfig); + + $eventManager = $this->createMock(EventManagerInterface::class); + // Fires Ready event with validation error + $eventManager->expects($this->once()) + ->method('fire'); + + $config = $this->makeConfig([ + 'sdkKey' => 'bad_config_key', + 'data' => new ConfigResponseData([]), + ]); + + $deps = $this->makeDependencies($apiManager, null, $eventManager); + $cache = new ArrayCache(); + + // The ConfigValidationException is caught by initialize() + $core = new Core( + $config, + $deps['dataManager'], + $deps['eventManager'], + $deps['experienceManager'], + $deps['featureManager'], + $deps['segmentsManager'], + $deps['apiManager'], + $cache, + Core::DEFAULT_DATA_REFRESH_INTERVAL, + $deps['loggerManager'], + ); + $this->assertInstanceOf(Core::class, $core); + } + + #[Test] + public function directDataWithInvalidConfigFiresErrorEvent(): void + { + $badConfig = new ConfigResponseData([ + // Missing account_id + 'project' => ['id' => '123'], + ]); + + $eventManager = $this->createMock(EventManagerInterface::class); + $eventManager->expects($this->once()) + ->method('fire'); + + $config = $this->makeConfig(['data' => $badConfig]); + $deps = $this->makeDependencies(null, null, $eventManager); + $cache = new ArrayCache(); + + $core = new Core( + $config, + $deps['dataManager'], + $deps['eventManager'], + $deps['experienceManager'], + $deps['featureManager'], + $deps['segmentsManager'], + $deps['apiManager'], + $cache, + Core::DEFAULT_DATA_REFRESH_INTERVAL, + $deps['loggerManager'], + ); + $this->assertInstanceOf(Core::class, $core); + } + + #[Test] + public function customDataRefreshIntervalIsUsed(): void + { + $configData = $this->validConfigData(); + $sdkKey = 'custom_ttl_key'; + + $cache = new ArrayCache(); + + $apiManager = $this->createMock(ApiManagerInterface::class); + $apiManager->expects($this->once()) + ->method('getConfig') + ->willReturn($configData); + + $config = $this->makeConfig([ + 'sdkKey' => $sdkKey, + 'data' => new ConfigResponseData([]), + ]); + + $deps = $this->makeDependencies($apiManager); + + // Use custom TTL of 600 seconds + $core = new Core( + $config, + $deps['dataManager'], + $deps['eventManager'], + $deps['experienceManager'], + $deps['featureManager'], + $deps['segmentsManager'], + $deps['apiManager'], + $cache, + 600, + $deps['loggerManager'], + ); + + // The config should be cached + $cacheKey = 'convert_sdk.config.' . $sdkKey; + $this->assertTrue($cache->has($cacheKey)); + } + + #[Test] + public function expiredCacheTriggersFreshHttpFetch(): void + { + $configData = $this->validConfigData(); + $sdkKey = 'expiry_test_key'; + $cacheKey = 'convert_sdk.config.' . $sdkKey; + + // Pre-populate cache with TTL=1 second + $cache = new ArrayCache(); + $cache->set($cacheKey, $configData, 1); + + // Wait for cache to expire + sleep(2); + + // ApiManager should be called since cache expired + $apiManager = $this->createMock(ApiManagerInterface::class); + $apiManager->expects($this->once()) + ->method('getConfig') + ->willReturn($configData); + + $config = $this->makeConfig([ + 'sdkKey' => $sdkKey, + 'data' => new ConfigResponseData([]), + ]); + + $deps = $this->makeDependencies($apiManager); + + $core = new Core( + $config, + $deps['dataManager'], + $deps['eventManager'], + $deps['experienceManager'], + $deps['featureManager'], + $deps['segmentsManager'], + $deps['apiManager'], + $cache, + 300, + $deps['loggerManager'], + ); + + // Cache should be re-populated with fresh data + $this->assertTrue($cache->has($cacheKey)); + $this->assertInstanceOf(ConfigResponseData::class, $cache->get($cacheKey)); + } + + #[Test] + public function sdkKeyWithSpecialCharsProducesHashedCacheKey(): void + { + $configData = $this->validConfigData(); + $sdkKey = '10022898/10025986'; // Contains slash — not PSR-16 safe + + $cache = new ArrayCache(); + + $apiManager = $this->createMock(ApiManagerInterface::class); + $apiManager->expects($this->once()) + ->method('getConfig') + ->willReturn($configData); + + $config = $this->makeConfig([ + 'sdkKey' => $sdkKey, + 'data' => new ConfigResponseData([]), + ]); + + $deps = $this->makeDependencies($apiManager); + + $core = new Core( + $config, + $deps['dataManager'], + $deps['eventManager'], + $deps['experienceManager'], + $deps['featureManager'], + $deps['segmentsManager'], + $deps['apiManager'], + $cache, + Core::DEFAULT_DATA_REFRESH_INTERVAL, + $deps['loggerManager'], + ); + + // The key should be hashed since it contains '/' + $expectedKey = 'convert_sdk.config.' . substr(hash('sha256', $sdkKey), 0, 16); + $this->assertTrue($cache->has($expectedKey)); + } +} diff --git a/packages/Php-sdk/tests/ContextConversionTest.php b/packages/Php-sdk/tests/ContextConversionTest.php new file mode 100644 index 0000000..8b112a7 --- /dev/null +++ b/packages/Php-sdk/tests/ContextConversionTest.php @@ -0,0 +1,206 @@ + [ + 'endpoint' => [ + 'config' => 'http://127.0.0.1:9501', + 'track' => 'http://127.0.0.1:9501', + ], + ], + 'events' => [ + 'batch_size' => 5, + 'release_interval' => 1000, + ], + ]); + $configuration['data'] = new ConfigResponseData($configuration['data']); + if (isset($configuration['sdkKey'])) { + unset($configuration['sdkKey']); + } + + $this->config = new Config($configuration); + $loggerManager = new LogManager(); + $bucketingConfig = $this->config->getBucketing(); + $bucketingManager = new BucketingManager( + maxTraffic: $bucketingConfig['max_traffic'] ?? 10000, + hashSeed: $bucketingConfig['hash_seed'] ?? 9999, + ); + $ruleManager = new RuleManager(); + $this->eventManager = new EventManager(); + + // Mock ApiManager to avoid PHP 8.4 end() deprecation + $this->apiManagerMock = $this->createMock(ApiManagerInterface::class); + + $this->dataManager = new DataManager( + $this->config, + $bucketingManager, + $ruleManager, + $this->eventManager, + $this->apiManagerMock, + $loggerManager + ); + $experienceManager = new ExperienceManager(dataManager: $this->dataManager); + $featureManager = new FeatureManager(dataManager: $this->dataManager); + $segmentsManager = new SegmentsManager($this->config, $this->dataManager, $ruleManager); + + $this->context = new Context( + $this->config, + $this->visitorId, + $this->eventManager, + $experienceManager, + $featureManager, + $this->dataManager, + $segmentsManager, + $this->apiManagerMock, + ); + } + + protected function tearDown(): void + { + $this->dataManager->reset(); + } + + public function testTrackConversionWithDto(): void + { + $this->apiManagerMock->expects($this->atLeastOnce()) + ->method('enqueue'); + + $result = $this->context->trackConversion('increase-engagement', new ConversionAttributes( + ruleData: ['action' => 'buy'], + conversionData: [ + ['key' => 'amount', 'value' => 10.3], + ['key' => 'productsCount', 'value' => 2], + ] + )); + + $this->assertNull($result); + } + + public function testTrackConversionWithNullAttributes(): void + { + $this->apiManagerMock->expects($this->once()) + ->method('enqueue'); + + $result = $this->context->trackConversion('goal-without-rule'); + $this->assertNull($result); + } + + public function testTrackConversionNonExistentGoalReturnsFalse(): void + { + $this->apiManagerMock->expects($this->never()) + ->method('enqueue'); + + $result = $this->context->trackConversion('nonexistent-goal'); + $this->assertFalse($result, 'Non-existent goal should return false, not null'); + } + + public function testTrackConversionFiresSystemEvent(): void + { + $eventFired = false; + $this->eventManager->on(SystemEvents::Conversion, function ($data) use (&$eventFired) { + $eventFired = true; + $this->assertEquals('ctx-conv-visitor', $data['visitorId']); + $this->assertEquals('goal-without-rule', $data['goalKey']); + }); + + $this->context->trackConversion('goal-without-rule'); + $this->assertTrue($eventFired, 'SystemEvents::Conversion should fire on successful tracking'); + } + + public function testTrackConversionWithConversionSetting(): void + { + $goalKey = 'goal-without-rule'; + $goalData = [['key' => 'amount', 'value' => 50.0]]; + + // First call: conversion + transaction = 2 + // Second call with force: transaction = 1 + // Total = 3 + $this->apiManagerMock->expects($this->exactly(3)) + ->method('enqueue'); + + $this->context->trackConversion($goalKey, new ConversionAttributes( + conversionData: $goalData, + conversionSetting: ['forceMultipleTransactions' => true], + )); + + // Second call — forceMultipleTransactions should allow transaction + $this->context->trackConversion($goalKey, new ConversionAttributes( + conversionData: $goalData, + conversionSetting: ['forceMultipleTransactions' => true], + )); + } + + public function testTrackConversionFiresSystemEventWithRuleBasedGoal(): void + { + $eventFired = false; + $this->eventManager->on(SystemEvents::Conversion, function ($data) use (&$eventFired) { + $eventFired = true; + $this->assertEquals('ctx-conv-visitor', $data['visitorId']); + $this->assertEquals('increase-engagement', $data['goalKey']); + }); + + $result = $this->context->trackConversion('increase-engagement', new ConversionAttributes( + ruleData: ['action' => 'buy'], + )); + $this->assertNull($result); + $this->assertTrue($eventFired, 'SystemEvents::Conversion should fire for rule-based goal on success'); + } + + public function testTrackConversionDoesNotFireEventOnFailure(): void + { + $eventFired = false; + $this->eventManager->on(SystemEvents::Conversion, function () use (&$eventFired) { + $eventFired = true; + }); + + $result = $this->context->trackConversion('nonexistent-goal'); + $this->assertFalse($result); + $this->assertFalse($eventFired, 'SystemEvents::Conversion should NOT fire when goal not found'); + } + + public function testTrackConversionDeduplication(): void + { + // Only one enqueue call expected — second is deduplicated + $this->apiManagerMock->expects($this->once()) + ->method('enqueue'); + + $this->context->trackConversion('goal-without-rule'); + $this->context->trackConversion('goal-without-rule'); + } +} diff --git a/packages/Php-sdk/tests/ContextCoverageTest.php b/packages/Php-sdk/tests/ContextCoverageTest.php new file mode 100644 index 0000000..4d0f11b --- /dev/null +++ b/packages/Php-sdk/tests/ContextCoverageTest.php @@ -0,0 +1,145 @@ + [ + 'endpoint' => [ + 'config' => 'http://127.0.0.1:9501', + 'track' => 'http://127.0.0.1:9501', + ], + ], + 'events' => [ + 'batch_size' => 5, + 'release_interval' => 1000, + ], + ]); + $configuration['data'] = new ConfigResponseData($configuration['data']); + if (isset($configuration['sdkKey'])) { + unset($configuration['sdkKey']); + } + + $this->config = new Config($configuration); + $this->loggerManager = new LogManager(); + $bucketingConfig = $this->config->getBucketing(); + $bucketingManager = new BucketingManager( + maxTraffic: $bucketingConfig['max_traffic'] ?? 10000, + hashSeed: $bucketingConfig['hash_seed'] ?? 9999, + ); + $ruleManager = new RuleManager(); + $this->eventManager = new EventManager(); + $this->apiManager = new ApiManager($this->config, $this->eventManager, $this->loggerManager); + $this->dataManager = new DataManager( + $this->config, + $bucketingManager, + $ruleManager, + $this->eventManager, + $this->apiManager, + $this->loggerManager + ); + $this->experienceManager = new ExperienceManager(dataManager: $this->dataManager); + $this->featureManager = new FeatureManager(dataManager: $this->dataManager); + $this->segmentsManager = new SegmentsManager($this->config, $this->dataManager, $ruleManager); + + $this->context = new Context( + $this->config, + 'test-visitor-coverage', + $this->eventManager, + $this->experienceManager, + $this->featureManager, + $this->dataManager, + $this->segmentsManager, + $this->apiManager, + ); + } + + protected function tearDown(): void + { + $this->dataManager->reset(); + } + + // All entity keys/IDs below are sourced from packages/Php-sdk/tests/test-config.json. + // If test-config.json changes, these must be updated to match. + + public function testGetConfigEntityShouldReturnExperienceByKey(): void + { + $result = $this->context->getConfigEntity('test-experience-ab-fullstack-2', EntityType::Experience->value); + $this->assertIsArray($result); + $this->assertNotEmpty($result); + $this->assertSame('test-experience-ab-fullstack-2', $result['key']); + } + + public function testGetConfigEntityShouldReturnVariationByKey(): void + { + $result = $this->context->getConfigEntity('100299456-original-page', EntityType::Variation->value); + $this->assertIsArray($result); + $this->assertSame('100299456-original-page', $result['key']); + } + + public function testGetConfigEntityByIdShouldReturnExperienceById(): void + { + $result = $this->context->getConfigEntityById('100218245', EntityType::Experience->value); + $this->assertIsArray($result); + $this->assertNotEmpty($result); + $this->assertSame('100218245', $result['id']); + } + + public function testGetConfigEntityByIdShouldReturnVariationById(): void + { + $result = $this->context->getConfigEntityById('100299456', EntityType::Variation->value); + $this->assertIsArray($result); + $this->assertSame('100299456', $result['id']); + } + + public function testGetVisitorDataShouldReturnArray(): void + { + $result = $this->context->getVisitorData(); + $this->assertIsArray($result); + } + + public function testReleaseQueuesShouldNotThrow(): void + { + $this->expectNotToPerformAssertions(); + // releaseQueues should work without error even when no data store is set + $this->context->releaseQueues('test'); + } +} diff --git a/packages/Php-sdk/tests/ContextNullReturnTest.php b/packages/Php-sdk/tests/ContextNullReturnTest.php new file mode 100644 index 0000000..769fedb --- /dev/null +++ b/packages/Php-sdk/tests/ContextNullReturnTest.php @@ -0,0 +1,206 @@ +config = new Config($configuration); + $this->eventManager = $this->createMock(EventManagerInterface::class); + $this->experienceManager = $this->createMock(ExperienceManagerInterface::class); + $this->featureManager = $this->createMock(FeatureManagerInterface::class); + $this->dataManager = $this->createMock(DataManagerInterface::class); + $this->segmentsManager = $this->createMock(SegmentsManagerInterface::class); + $this->apiManager = $this->createMock(ApiManagerInterface::class); + + // DataManager::getData() returns null by default (no stored visitor data) + $this->dataManager->method('getData')->willReturn(null); + } + + private function createContext(string $visitorId = 'visitor-123'): Context + { + return new Context( + $this->config, + $visitorId, + $this->eventManager, + $this->experienceManager, + $this->featureManager, + $this->dataManager, + $this->segmentsManager, + $this->apiManager, + ); + } + + public function testRunExperienceReturnsNullForRuleError(): void + { + $this->experienceManager + ->method('selectVariation') + ->willReturn(RuleError::NoDataFound); + + $this->eventManager + ->expects($this->never()) + ->method('fire'); + + $context = $this->createContext(); + $result = $context->runExperience('some-experience'); + + $this->assertNull($result, 'Context must return null when ExperienceManager returns RuleError'); + } + + public function testRunExperienceReturnsNullForNeedMoreDataRuleError(): void + { + $this->experienceManager + ->method('selectVariation') + ->willReturn(RuleError::NeedMoreData); + + $this->eventManager + ->expects($this->never()) + ->method('fire'); + + $context = $this->createContext(); + $result = $context->runExperience('some-experience'); + + $this->assertNull($result, 'Context must return null for RuleError::NeedMoreData'); + } + + public function testRunExperienceReturnsNullForBucketingError(): void + { + $this->experienceManager + ->method('selectVariation') + ->willReturn(BucketingError::VariationNotDecided); + + $this->eventManager + ->expects($this->never()) + ->method('fire'); + + $context = $this->createContext(); + $result = $context->runExperience('some-experience'); + + $this->assertNull($result, 'Context must return null when ExperienceManager returns BucketingError'); + } + + public function testRunExperienceReturnsNullWhenExperienceManagerReturnsNull(): void + { + $this->experienceManager + ->method('selectVariation') + ->willReturn(null); + + $this->eventManager + ->expects($this->never()) + ->method('fire'); + + $context = $this->createContext(); + $result = $context->runExperience('nonexistent-key'); + + $this->assertNull($result); + } + + public function testRunExperienceReturnsDtoForSuccessfulBucketing(): void + { + $this->experienceManager + ->method('selectVariation') + ->willReturn([ + 'experienceId' => '100', + 'experienceKey' => 'test-exp', + 'experienceName' => 'Test', + 'bucketingAllocation' => 5000, + 'id' => '200', + 'key' => 'var-1', + 'name' => 'Variation 1', + 'changes' => [], + 'traffic_allocation' => 50, + 'status' => 'active', + ]); + + $this->eventManager + ->expects($this->once()) + ->method('fire'); + + $context = $this->createContext(); + $result = $context->runExperience('test-exp'); + + $this->assertInstanceOf(BucketedVariation::class, $result); + $this->assertSame('100', $result->experienceId); + $this->assertSame('test-exp', $result->experienceKey); + $this->assertSame('200', $result->variationId); + $this->assertSame('var-1', $result->variationKey); + $this->assertIsArray($result->changes); + } + + public function testRunExperienceDoesNotFireEventOnRuleError(): void + { + $this->experienceManager + ->method('selectVariation') + ->willReturn(RuleError::NoDataFound); + + $this->eventManager + ->expects($this->never()) + ->method('fire'); + + $context = $this->createContext(); + $context->runExperience('test-exp'); + } + + public function testRunExperienceFiresEventOnSuccess(): void + { + $this->experienceManager + ->method('selectVariation') + ->willReturn([ + 'experienceId' => '100', + 'experienceKey' => 'test-exp', + 'id' => '200', + 'key' => 'var-1', + 'changes' => [], + ]); + + $this->eventManager + ->expects($this->once()) + ->method('fire'); + + $context = $this->createContext(); + $context->runExperience('test-exp'); + } +} diff --git a/packages/Php-sdk/tests/ContextRevenueTest.php b/packages/Php-sdk/tests/ContextRevenueTest.php new file mode 100644 index 0000000..7f190f2 --- /dev/null +++ b/packages/Php-sdk/tests/ContextRevenueTest.php @@ -0,0 +1,278 @@ + [ + 'endpoint' => [ + 'config' => 'http://127.0.0.1:9501', + 'track' => 'http://127.0.0.1:9501', + ], + ], + 'events' => [ + 'batch_size' => 5, + 'release_interval' => 1000, + ], + ]); + $configuration['data'] = new ConfigResponseData($configuration['data']); + if (isset($configuration['sdkKey'])) { + unset($configuration['sdkKey']); + } + + $config = new Config($configuration); + $loggerManager = new LogManager(); + $bucketingConfig = $config->getBucketing(); + $bucketingManager = new BucketingManager( + maxTraffic: $bucketingConfig['max_traffic'] ?? 10000, + hashSeed: $bucketingConfig['hash_seed'] ?? 9999, + ); + $ruleManager = new RuleManager(); + $eventManager = new EventManager(); + + $this->apiManagerMock = $this->createMock(ApiManagerInterface::class); + + $this->dataManager = new DataManager( + $config, + $bucketingManager, + $ruleManager, + $eventManager, + $this->apiManagerMock, + $loggerManager + ); + $experienceManager = new ExperienceManager(dataManager: $this->dataManager); + $featureManager = new FeatureManager(dataManager: $this->dataManager); + $segmentsManager = new SegmentsManager($config, $this->dataManager, $ruleManager); + + $this->context = new Context( + $config, + $this->visitorId, + $eventManager, + $experienceManager, + $featureManager, + $this->dataManager, + $segmentsManager, + $this->apiManagerMock, + ); + } + + protected function tearDown(): void + { + $this->dataManager->reset(); + } + + /** + * Test: trackConversion with DTO GoalData sends TWO events (conversion + transaction) + * This tests the full consumer API flow: DTO GoalData -> Context mapping -> DataManager + */ + public function testTrackConversionWithDtoGoalDataSendsTwoEvents(): void + { + $this->apiManagerMock->expects($this->exactly(2)) + ->method('enqueue'); + + $result = $this->context->trackConversion('goal-without-rule', new ConversionAttributes( + conversionData: [ + new GoalData(GoalDataKey::Amount, 99.99), + new GoalData(GoalDataKey::TransactionId, 'txn-abc'), + ] + )); + + $this->assertNull($result); + } + + /** + * Test: Transaction event from DTO GoalData contains correct key-value pairs + */ + public function testDtoGoalDataSerializesCorrectlyInPayload(): void + { + $capturedEvents = []; + $this->apiManagerMock->expects($this->exactly(2)) + ->method('enqueue') + ->willReturnCallback(function ($visitorId, VisitorTrackingEvents $event) use (&$capturedEvents) { + $capturedEvents[] = $event; + }); + + $this->context->trackConversion('goal-without-rule', new ConversionAttributes( + conversionData: [ + new GoalData(GoalDataKey::Amount, 99.99), + new GoalData(GoalDataKey::TransactionId, 'txn-abc-123'), + new GoalData(GoalDataKey::ProductsCount, 3), + ] + )); + + $this->assertCount(2, $capturedEvents); + + // Transaction event (second) should have goalData + $transactionData = $capturedEvents[1]->getData(); + $this->assertArrayHasKey('goalData', $transactionData); + + $goalData = $transactionData['goalData']; + $this->assertCount(3, $goalData); + $this->assertEquals(['key' => 'amount', 'value' => 99.99], $goalData[0]); + $this->assertEquals(['key' => 'transactionId', 'value' => 'txn-abc-123'], $goalData[1]); + $this->assertEquals(['key' => 'productsCount', 'value' => 3], $goalData[2]); + } + + /** + * Test: ConversionAttributes with only conversionData (no ruleData, no conversionSetting) + */ + public function testConversionAttributesWithOnlyConversionData(): void + { + $this->apiManagerMock->expects($this->exactly(2)) + ->method('enqueue'); + + $attrs = new ConversionAttributes( + conversionData: [new GoalData(GoalDataKey::Amount, 50.0)] + ); + + $this->assertNull($attrs->ruleData); + $this->assertNull($attrs->conversionSetting); + $this->assertNotNull($attrs->conversionData); + + $result = $this->context->trackConversion('goal-without-rule', $attrs); + $this->assertNull($result); + } + + /** + * Test: ConversionAttributes with all three fields populated + */ + public function testConversionAttributesWithAllFieldsPopulated(): void + { + $this->apiManagerMock->expects($this->exactly(2)) + ->method('enqueue'); + + $result = $this->context->trackConversion('increase-engagement', new ConversionAttributes( + ruleData: ['action' => 'buy'], + conversionData: [ + new GoalData(GoalDataKey::Amount, 149.99), + new GoalData(GoalDataKey::CustomDimension1, 'premium-plan'), + ], + conversionSetting: ['forceMultipleTransactions' => true], + )); + + $this->assertNull($result); + } + + /** + * Test: trackConversion with ruleData mismatch and goalData -> no events + */ + public function testRuleMismatchWithGoalDataSendsNothing(): void + { + $this->apiManagerMock->expects($this->never()) + ->method('enqueue'); + + $result = $this->context->trackConversion('increase-engagement', new ConversionAttributes( + ruleData: ['action' => 'sell'], + conversionData: [new GoalData(GoalDataKey::Amount, 25.0)], + )); + + $this->assertFalse($result); + } + + /** + * Test: DTO GoalData with all 5 CustomDimension keys via Context + */ + public function testAllCustomDimensionsViaContext(): void + { + $capturedEvent = null; + $this->apiManagerMock->expects($this->exactly(2)) + ->method('enqueue') + ->willReturnCallback(function ($visitorId, VisitorTrackingEvents $event) use (&$capturedEvent) { + $data = $event->getData(); + if (isset($data['goalData'])) { + $capturedEvent = $event; + } + }); + + $this->context->trackConversion('goal-without-rule', new ConversionAttributes( + conversionData: [ + new GoalData(GoalDataKey::CustomDimension1, 'val1'), + new GoalData(GoalDataKey::CustomDimension2, 'val2'), + new GoalData(GoalDataKey::CustomDimension3, 'val3'), + new GoalData(GoalDataKey::CustomDimension4, 'val4'), + new GoalData(GoalDataKey::CustomDimension5, 'val5'), + ] + )); + + $this->assertNotNull($capturedEvent); + $goalData = $capturedEvent->getData()['goalData']; + $this->assertCount(5, $goalData); + $this->assertEquals('customDimension1', $goalData[0]['key']); + $this->assertEquals('customDimension2', $goalData[1]['key']); + $this->assertEquals('customDimension3', $goalData[2]['key']); + $this->assertEquals('customDimension4', $goalData[3]['key']); + $this->assertEquals('customDimension5', $goalData[4]['key']); + } + + /** + * Test: Backward compatibility — plain array conversionData still works + */ + public function testPlainArrayConversionDataStillWorks(): void + { + $this->apiManagerMock->expects($this->exactly(2)) + ->method('enqueue'); + + $result = $this->context->trackConversion('goal-without-rule', new ConversionAttributes( + conversionData: [ + ['key' => 'amount', 'value' => 10.3], + ['key' => 'productsCount', 'value' => 2], + ] + )); + + $this->assertNull($result); + } + + /** + * Test: Repeat trigger with forceMultipleTransactions + DTO GoalData -> transaction only + */ + public function testRepeatTriggerWithForceAndDtoGoalData(): void + { + // First call: conversion + transaction = 2 + // Second call with force: transaction = 1 + // Total = 3 + $this->apiManagerMock->expects($this->exactly(3)) + ->method('enqueue'); + + $attrs = new ConversionAttributes( + conversionData: [new GoalData(GoalDataKey::Amount, 50.0)], + conversionSetting: ['forceMultipleTransactions' => true], + ); + + $this->context->trackConversion('goal-without-rule', $attrs); + $this->context->trackConversion('goal-without-rule', $attrs); + } +} diff --git a/packages/Php-sdk/tests/ContextTest.php b/packages/Php-sdk/tests/ContextTest.php new file mode 100644 index 0000000..8f555cf --- /dev/null +++ b/packages/Php-sdk/tests/ContextTest.php @@ -0,0 +1,663 @@ + [ + 'endpoint' => [ + 'config' => 'http://127.0.0.1:9501', + 'track' => 'http://127.0.0.1:9501', + ], + ], + 'events' => [ + 'batch_size' => 5, + 'release_interval' => 1000, + ], + ]); + $configuration['data'] = new ConfigResponseData($configuration['data']); + if (isset($configuration['sdkKey'])) { + unset($configuration['sdkKey']); + } + + $this->config = new Config($configuration); + $this->loggerManager = new LogManager(); + $bucketingConfig = $this->config->getBucketing(); + $this->bucketingManager = new BucketingManager( + maxTraffic: $bucketingConfig['max_traffic'] ?? 10000, + hashSeed: $bucketingConfig['hash_seed'] ?? 9999, + ); + $this->ruleManager = new RuleManager(); + $this->eventManager = new EventManager(); + $this->apiManager = new ApiManager($this->config, $this->eventManager, $this->loggerManager); + $this->dataManager = new DataManager( + $this->config, + $this->bucketingManager, + $this->ruleManager, + $this->eventManager, + $this->apiManager, + $this->loggerManager + ); + $this->experienceManager = new ExperienceManager(dataManager: $this->dataManager); + $this->featureManager = new FeatureManager(dataManager: $this->dataManager); + $this->segmentsManager = new SegmentsManager($this->config, $this->dataManager, $this->ruleManager); + + $this->context = new Context( + $this->config, + $this->visitorId, + $this->eventManager, + $this->experienceManager, + $this->featureManager, + $this->dataManager, + $this->segmentsManager, + $this->apiManager, + ); + + $this->accountId = $this->config->getData() ? $this->config->getData()->getAccountId() : ''; + $project = $this->config->getData() ? $this->config->getData()->getProject() : null; + $this->projectId = $project ? (is_array($project) ? ($project['id'] ?? '') : ($project->getId() ?? '')) : ''; + } + + protected function tearDown(): void + { + $this->dataManager->reset(); + } + + public function testGetVariationsAcrossAllExperiences(): void + { + $variationIds = ['100299456', '100299457', '100299460', '100299461']; + $variations = $this->context->runExperiences(new BucketingAttributes([ + 'locationProperties' => ['url' => 'https://convert.com/'], + 'visitorProperties' => ['varName3' => 'something'], + ])); + + $this->assertIsArray($variations); + $this->assertCount(2, $variations); + foreach ($variations as $variation) { + $this->assertInstanceOf(\ConvertSdk\DTO\BucketedVariation::class, $variation); + $this->assertNotEmpty($variation->experienceId); + $this->assertNotEmpty($variation->experienceKey); + $this->assertNotEmpty($variation->variationId); + $this->assertNotEmpty($variation->variationKey); + $this->assertIsArray($variation->changes); + } + $selectedVariationIds = array_map(fn ($v) => $v->variationId, $variations); + foreach ($selectedVariationIds as $id) { + $this->assertContains($id, $variationIds); + } + } + + public function testGetSingleFeatureWithStatus(): void + { + $featureKey = 'feature-2'; + $feature = $this->context->runFeature($featureKey, new BucketingAttributes([ + 'locationProperties' => ['url' => 'https://convert.com/'], + 'visitorProperties' => ['varName3' => 'something'], + ])); + + $this->assertInstanceOf(\ConvertSdk\DTO\BucketedFeature::class, $feature); + $this->assertNotEmpty($feature->featureId); + $this->assertEquals($featureKey, $feature->featureKey); + $this->assertInstanceOf(\ConvertSdk\Enums\FeatureStatus::class, $feature->status); + $this->assertEquals(\ConvertSdk\Enums\FeatureStatus::Enabled, $feature->status); + $this->assertIsArray($feature->variables); + $this->assertEquals($this->featureId, $feature->featureId); + } + + public function testGetMultipleFeatureWithStatus(): void + { + $featureKey = 'feature-1'; + // feature-1 is in multiple experiences — runFeature returns first enabled + $feature = $this->context->runFeature($featureKey, new BucketingAttributes([ + 'locationProperties' => ['url' => 'https://convert.com/'], + 'visitorProperties' => ['varName3' => 'something'], + ])); + + $this->assertInstanceOf(\ConvertSdk\DTO\BucketedFeature::class, $feature); + $this->assertEquals($featureKey, $feature->featureKey); + $this->assertEquals(\ConvertSdk\Enums\FeatureStatus::Enabled, $feature->status); + $this->assertNotEmpty($feature->featureId); + } + + public function testGetFeaturesWithStatuses(): void + { + $featureIds = ['10024', '10025', '10026']; + $features = $this->context->runFeatures(new BucketingAttributes([ + 'locationProperties' => ['url' => 'https://convert.com/'], + 'visitorProperties' => ['varName3' => 'something'], + ])); + + $this->assertIsArray($features); + $this->assertCount(4, $features); + foreach ($features as $feature) { + $this->assertInstanceOf(\ConvertSdk\DTO\BucketedFeature::class, $feature); + $this->assertInstanceOf(\ConvertSdk\Enums\FeatureStatus::class, $feature->status); + $this->assertNotEmpty($feature->featureKey); + } + $enabledFeatures = array_filter($features, fn ($f) => $f->status === \ConvertSdk\Enums\FeatureStatus::Enabled); + foreach ($enabledFeatures as $feature) { + $this->assertNotEmpty($feature->featureId); + $this->assertIsArray($feature->variables); + } + $disabledFeatures = array_filter($features, fn ($f) => $f->status === \ConvertSdk\Enums\FeatureStatus::Disabled); + foreach ($disabledFeatures as $feature) { + $this->assertNotEmpty($feature->featureId); + } + $selectedFeatures = array_map(fn ($f) => $f->featureId, $features); + $this->assertContainsAll($featureIds, $selectedFeatures); + } + + private function assertContainsAll(array $haystack, array $needles): void + { + foreach ($needles as $needle) { + $this->assertContains($needle, $haystack); + } + } + + public function testContextClassIsDefined(): void + { + $this->assertTrue(class_exists(Context::class)); + } + + public function testContextIsConstructable(): void + { + $this->assertInstanceOf(Context::class, $this->context); + } + + public function testContextIsFinalClass(): void + { + $reflection = new \ReflectionClass(Context::class); + $this->assertTrue($reflection->isFinal()); + } + + public function testRunExperience(): void + { + $experienceKey = 'test-experience-ab-fullstack-2'; + $variation = $this->context->runExperience($experienceKey, new BucketingAttributes([ + 'locationProperties' => ['url' => 'https://convert.com/'], + 'visitorProperties' => ['varName3' => 'something'], + ])); + + $this->assertInstanceOf(\ConvertSdk\DTO\BucketedVariation::class, $variation); + $this->assertNotEmpty($variation->experienceId); + $this->assertEquals($experienceKey, $variation->experienceKey); + $this->assertNotEmpty($variation->variationId); + $this->assertNotEmpty($variation->variationKey); + $this->assertIsArray($variation->changes); + } + + public function testRunExperiences(): void + { + $this->testGetVariationsAcrossAllExperiences(); + } + + public function testRunSingleFeature(): void + { + $this->testGetSingleFeatureWithStatus(); + } + + public function testRunMultipleFeatures(): void + { + $this->testGetMultipleFeatureWithStatus(); + } + + public function testRunFeatures(): void + { + $this->testGetFeaturesWithStatuses(); + } + + public function testSetDefaultSegments(): void + { + $segments = ['country' => 'UK']; + $this->context->setDefaultSegments($segments); + $localSegments = $this->dataManager->getData($this->visitorId); + $this->assertEquals($segments['country'], $localSegments['segments']['country']); + } + + public function testRunCustomSegments(): void + { + $segmentKey = 'test-segments-1'; + $segmentId = '200299434'; + $this->context->runCustomSegments([$segmentKey], ['ruleData' => ['enabled' => true]]); + $data = $this->dataManager->getData($this->visitorId); + $this->assertEquals([$segmentId], $data['segments']['custom_segments']); + } + + public function testUpdateVisitorProperties(): void + { + $properties = ['weather' => 'rainy']; + $this->context->updateVisitorProperties($this->visitorId, $properties); + $localSegments = $this->dataManager->getData($this->visitorId); + $this->assertEquals($properties, $localSegments['segments']); + } + + public function testEmptyVisitorIdThrowsException(): void + { + $this->expectException(InvalidArgumentException::class); + $this->expectExceptionMessage('Visitor ID must not be empty'); + + new Context( + $this->config, + '', + $this->eventManager, + $this->experienceManager, + $this->featureManager, + $this->dataManager, + $this->segmentsManager, + $this->apiManager, + ); + } + + public function testGetVisitorId(): void + { + $this->assertEquals($this->visitorId, $this->context->getVisitorId()); + } + + public function testGetAttributesReturnsEmptyArrayWhenNoAttributesSet(): void + { + $this->assertIsArray($this->context->getAttributes()); + } + + public function testCreateContextWithAttributes(): void + { + // Note: filterReportSegments() splits attributes: + // - Segment keys (browser, devices, source, campaign, visitor_type, country, custom_segments) → stored via putSegments() + // - Other keys → stored as visitorProperties (accessible via getAttributes()) + $attributes = ['plan' => 'premium', 'country' => 'DE']; + $context = new Context( + $this->config, + 'visitor-with-attrs', + $this->eventManager, + $this->experienceManager, + $this->featureManager, + $this->dataManager, + $this->segmentsManager, + $this->apiManager, + null, + $attributes, + ); + + $this->assertEquals('visitor-with-attrs', $context->getVisitorId()); + + // 'plan' is a non-segment property → accessible via getAttributes() + $result = $context->getAttributes(); + $this->assertIsArray($result); + $this->assertArrayHasKey('plan', $result, 'Non-segment attributes should be accessible via getAttributes()'); + $this->assertEquals('premium', $result['plan']); + + // 'country' is a segment key → stored via putSegments(), not in getAttributes() + $this->assertArrayNotHasKey('country', $result, 'Segment keys are stored via putSegments, not in visitorProperties'); + } + + public function testSetAttribute(): void + { + $this->context->setAttribute('country', 'US'); + $attrs = $this->context->getAttributes(); + $this->assertArrayHasKey('country', $attrs); + $this->assertEquals('US', $attrs['country']); + } + + public function testSetAttributeOverwritesExisting(): void + { + $this->context->setAttribute('country', 'US'); + $this->context->setAttribute('country', 'CA'); + $attrs = $this->context->getAttributes(); + $this->assertEquals('CA', $attrs['country']); + } + + public function testSetAttributesMultiple(): void + { + $this->context->setAttributes(['plan' => 'enterprise', 'locale' => 'en']); + $attrs = $this->context->getAttributes(); + $this->assertArrayHasKey('plan', $attrs); + $this->assertArrayHasKey('locale', $attrs); + $this->assertEquals('enterprise', $attrs['plan']); + $this->assertEquals('en', $attrs['locale']); + } + + public function testSetAttributesMergesWithExisting(): void + { + $this->context->setAttribute('plan', 'free'); + $this->context->setAttributes(['country' => 'US']); + $attrs = $this->context->getAttributes(); + $this->assertArrayHasKey('plan', $attrs); + $this->assertArrayHasKey('country', $attrs); + $this->assertEquals('free', $attrs['plan']); + $this->assertEquals('US', $attrs['country']); + } + + public function testSetAttributeAddsNewKeyToExisting(): void + { + $context = new Context( + $this->config, + 'visitor-initial-attrs', + $this->eventManager, + $this->experienceManager, + $this->featureManager, + $this->dataManager, + $this->segmentsManager, + $this->apiManager, + null, + ['plan' => 'free'], + ); + + $context->setAttribute('country', 'US'); + $attrs = $context->getAttributes(); + $this->assertArrayHasKey('plan', $attrs); + $this->assertArrayHasKey('country', $attrs); + $this->assertEquals('US', $attrs['country']); + } + + public function testRunExperienceReturnsDto(): void + { + $experienceKey = 'test-experience-ab-fullstack-2'; + $result = $this->context->runExperience($experienceKey, new BucketingAttributes([ + 'locationProperties' => ['url' => 'https://convert.com/'], + 'visitorProperties' => ['varName3' => 'something'], + ])); + + $this->assertInstanceOf(\ConvertSdk\DTO\BucketedVariation::class, $result); + $this->assertNotEmpty($result->experienceId); + $this->assertEquals($experienceKey, $result->experienceKey); + $this->assertNotEmpty($result->variationId); + $this->assertNotEmpty($result->variationKey); + $this->assertIsArray($result->changes); + } + + public function testRunExperienceReturnsNullForMissingKey(): void + { + $result = $this->context->runExperience('nonexistent-experience', new BucketingAttributes([ + 'locationProperties' => ['url' => 'https://convert.com/'], + 'visitorProperties' => ['varName3' => 'something'], + ])); + + $this->assertNull($result); + } + + public function testRunExperiencesReturnsDtoArray(): void + { + $variations = $this->context->runExperiences(new BucketingAttributes([ + 'locationProperties' => ['url' => 'https://convert.com/'], + 'visitorProperties' => ['varName3' => 'something'], + ])); + + $this->assertIsArray($variations); + $this->assertGreaterThan(0, count($variations)); + foreach ($variations as $variation) { + $this->assertInstanceOf(\ConvertSdk\DTO\BucketedVariation::class, $variation); + $this->assertNotEmpty($variation->experienceId); + $this->assertNotEmpty($variation->experienceKey); + $this->assertNotEmpty($variation->variationId); + $this->assertNotEmpty($variation->variationKey); + $this->assertIsArray($variation->changes); + } + } + + public function testRunExperienceDoesNotFireEventOnNull(): void + { + // A nonexistent experience should return null and not fire any event + $result = $this->context->runExperience('definitely-nonexistent', new BucketingAttributes([ + 'locationProperties' => ['url' => 'https://convert.com/'], + ])); + + $this->assertNull($result); + } + + public function testRunFeatureReturnsDto(): void + { + $featureKey = 'feature-2'; + $result = $this->context->runFeature($featureKey, new BucketingAttributes([ + 'locationProperties' => ['url' => 'https://convert.com/'], + 'visitorProperties' => ['varName3' => 'something'], + ])); + + $this->assertInstanceOf(\ConvertSdk\DTO\BucketedFeature::class, $result); + $this->assertNotEmpty($result->featureId); + $this->assertEquals($featureKey, $result->featureKey); + $this->assertIsArray($result->variables); + } + + public function testRunFeatureReturnsNullForMissingKey(): void + { + $result = $this->context->runFeature('nonexistent-feature', new BucketingAttributes([ + 'locationProperties' => ['url' => 'https://convert.com/'], + 'visitorProperties' => ['varName3' => 'something'], + ])); + + $this->assertNull($result); + } + + public function testRunFeaturesReturnsDtoArray(): void + { + $features = $this->context->runFeatures(new BucketingAttributes([ + 'locationProperties' => ['url' => 'https://convert.com/'], + 'visitorProperties' => ['varName3' => 'something'], + ])); + + $this->assertIsArray($features); + $this->assertGreaterThan(0, count($features)); + foreach ($features as $feature) { + $this->assertInstanceOf(\ConvertSdk\DTO\BucketedFeature::class, $feature); + $this->assertNotEmpty($feature->featureKey); + $this->assertInstanceOf(\ConvertSdk\Enums\FeatureStatus::class, $feature->status); + } + } + + public function testRunFeatureReturnsDtoWithDisabledStatus(): void + { + // 'not-attached-feature-3' exists in config but visitor shouldn't be bucketed for it + $featureKey = 'not-attached-feature-3'; + $result = $this->context->runFeature($featureKey, new BucketingAttributes([ + 'locationProperties' => ['url' => 'https://convert.com/'], + 'visitorProperties' => ['varName3' => 'something'], + ])); + + // Feature exists but visitor is not bucketed → disabled DTO + $this->assertInstanceOf(\ConvertSdk\DTO\BucketedFeature::class, $result); + $this->assertEquals(\ConvertSdk\Enums\FeatureStatus::Disabled, $result->status); + $this->assertEquals($featureKey, $result->featureKey); + } + + public function testRunFeatureDoesNotFireEventOnNull(): void + { + // A nonexistent feature should return null and not fire any event + $result = $this->context->runFeature('definitely-nonexistent-feature', new BucketingAttributes([ + 'locationProperties' => ['url' => 'https://convert.com/'], + ])); + + $this->assertNull($result); + } + + public function testRunFeatureTypeCastingApplied(): void + { + $featureKey = 'feature-1'; + $result = $this->context->runFeature($featureKey, new BucketingAttributes([ + 'locationProperties' => ['url' => 'https://convert.com/'], + 'visitorProperties' => ['varName3' => 'something'], + 'typeCasting' => true, + ])); + + $this->assertInstanceOf(\ConvertSdk\DTO\BucketedFeature::class, $result); + $this->assertEquals(\ConvertSdk\Enums\FeatureStatus::Enabled, $result->status); + $this->assertNotEmpty($result->variables, 'Enabled feature should have variables'); + + // Verify actual type casting: 'enabled' variable is defined as boolean in test-config + if (isset($result->variables['enabled'])) { + $this->assertIsBool($result->variables['enabled'], 'Boolean variable should be cast to bool, not remain string'); + } + + // Verify variables are not all strings (type casting must have happened) + $hasNonString = false; + foreach ($result->variables as $value) { + if (!is_string($value)) { + $hasNonString = true; + break; + } + } + $this->assertTrue($hasNonString, 'At least one variable should be type-cast to a non-string type'); + } + + // ========================================================================= + // forceMultipleTransactions integration tests + // ========================================================================= + + /** + * Helper: create a Context with a mock ApiManager for tracking enqueue() calls. + * + * @return array{context: Context, apiMock: ApiManagerInterface&\PHPUnit\Framework\MockObject\MockObject, dataManager: DataManager} + */ + private function createContextWithMockApi(): array + { + $apiMock = $this->createMock(ApiManagerInterface::class); + + $dataManager = new DataManager( + $this->config, + $this->bucketingManager, + $this->ruleManager, + $this->eventManager, + $apiMock, + $this->loggerManager + ); + + $experienceManager = new ExperienceManager(dataManager: $dataManager); + $featureManager = new FeatureManager(dataManager: $dataManager); + $segmentsManager = new SegmentsManager($this->config, $dataManager, $this->ruleManager); + + $context = new Context( + $this->config, + $this->visitorId, + $this->eventManager, + $experienceManager, + $featureManager, + $dataManager, + $segmentsManager, + $apiMock, + ); + + return ['context' => $context, 'apiMock' => $apiMock, 'dataManager' => $dataManager]; + } + + /** + * Verifies that the forceMultipleTransactions setting actually reaches DataManager + * by proving a repeat call with force=true sends a transaction (impossible without the flag). + */ + #[Group('forceMultipleTransactions')] + public function testTrackConversionWithForceMultipleTransactionsPassesSettingThrough(): void + { + ['context' => $ctx, 'apiMock' => $apiMock] = $this->createContextWithMockApi(); + + $capturedEvents = []; + $apiMock->method('enqueue') + ->willReturnCallback(function (string $visitorId, VisitorTrackingEvents $event) use (&$capturedEvents) { + $capturedEvents[] = (array) $event->jsonSerialize(); + }); + + // First call WITHOUT force: triggers conversion only (1 event) + $ctx->trackConversion('goal-without-rule'); + $this->assertCount(1, $capturedEvents, 'First trigger without goalData should send conversion only'); + + // Second call WITH force + goalData: proves the flag passes through to DataManager + // Without the flag reaching DataManager, dedup would block this entirely (0 new events) + $ctx->trackConversion('goal-without-rule', new ConversionAttributes( + conversionData: [['key' => 'amount', 'value' => 19.99]], + conversionSetting: [ConversionSettingKey::ForceMultipleTransactions->value => true] + )); + $this->assertCount(2, $capturedEvents, 'Repeat with force+goalData must send transaction — proves flag passed through'); + } + + #[Group('forceMultipleTransactions')] + public function testRepeatedTrackConversionWithForceAndGoalDataSendsTransaction(): void + { + ['context' => $ctx, 'apiMock' => $apiMock] = $this->createContextWithMockApi(); + + $capturedEvents = []; + $apiMock->method('enqueue') + ->willReturnCallback(function (string $visitorId, VisitorTrackingEvents $event) use (&$capturedEvents) { + $capturedEvents[] = (array) $event->jsonSerialize(); + }); + + // First call: conversion + transaction = 2 events + $goalData = [['key' => 'amount', 'value' => 19.99]]; + $ctx->trackConversion('goal-without-rule', new ConversionAttributes( + conversionData: $goalData, + conversionSetting: [ConversionSettingKey::ForceMultipleTransactions->value => true] + )); + $this->assertCount(2, $capturedEvents); + + // Second call with force + goalData: transaction only = 3 total events + $ctx->trackConversion('goal-without-rule', new ConversionAttributes( + conversionData: [['key' => 'amount', 'value' => 29.99]], + conversionSetting: [ConversionSettingKey::ForceMultipleTransactions->value => true] + )); + $this->assertCount(3, $capturedEvents, 'Repeat with force+goalData should send transaction only'); + + // The 3rd event should be a transaction (has goalData) + $this->assertArrayHasKey('goalData', $capturedEvents[2]['data']); + } + + #[Group('forceMultipleTransactions')] + public function testRepeatedTrackConversionWithoutForceSendsNothing(): void + { + ['context' => $ctx, 'apiMock' => $apiMock] = $this->createContextWithMockApi(); + + $capturedEvents = []; + $apiMock->method('enqueue') + ->willReturnCallback(function (string $visitorId, VisitorTrackingEvents $event) use (&$capturedEvents) { + $capturedEvents[] = (array) $event->jsonSerialize(); + }); + + // First call: conversion = 1 event + $ctx->trackConversion('goal-without-rule'); + $this->assertCount(1, $capturedEvents); + + // Second call without force: nothing sent (dedup) + $ctx->trackConversion('goal-without-rule'); + $this->assertCount(1, $capturedEvents, 'Repeat without force should send nothing'); + } +} diff --git a/packages/Php-sdk/tests/ConversionAttributesTest.php b/packages/Php-sdk/tests/ConversionAttributesTest.php new file mode 100644 index 0000000..840dd41 --- /dev/null +++ b/packages/Php-sdk/tests/ConversionAttributesTest.php @@ -0,0 +1,69 @@ +assertTrue($reflection->isReadOnly()); + } + + public function testAllPropertiesAreNullable(): void + { + $dto = new ConversionAttributes(); + $this->assertNull($dto->ruleData); + $this->assertNull($dto->conversionData); + $this->assertNull($dto->conversionSetting); + } + + public function testConstructorWithAllParameters(): void + { + $ruleData = ['action' => 'buy']; + $conversionData = [['key' => 'amount', 'value' => 10.5]]; + $conversionSetting = ['forceMultipleTransactions' => true]; + + $dto = new ConversionAttributes( + ruleData: $ruleData, + conversionData: $conversionData, + conversionSetting: $conversionSetting, + ); + + $this->assertEquals($ruleData, $dto->ruleData); + $this->assertEquals($conversionData, $dto->conversionData); + $this->assertEquals($conversionSetting, $dto->conversionSetting); + } + + public function testConstructorWithPartialParameters(): void + { + $dto = new ConversionAttributes( + ruleData: ['action' => 'signup'], + ); + + $this->assertEquals(['action' => 'signup'], $dto->ruleData); + $this->assertNull($dto->conversionData); + $this->assertNull($dto->conversionSetting); + } + + public function testHasCorrectNamespace(): void + { + $reflection = new \ReflectionClass(ConversionAttributes::class); + $this->assertEquals('ConvertSdk\DTO', $reflection->getNamespaceName()); + } + + public function testPropertyCount(): void + { + $reflection = new \ReflectionClass(ConversionAttributes::class); + $properties = $reflection->getProperties(\ReflectionProperty::IS_PUBLIC); + $this->assertCount(3, $properties); + } +} diff --git a/packages/Php-sdk/tests/ConvertSDKTest.php b/packages/Php-sdk/tests/ConvertSDKTest.php new file mode 100644 index 0000000..f59fe04 --- /dev/null +++ b/packages/Php-sdk/tests/ConvertSDKTest.php @@ -0,0 +1,304 @@ + + */ + private function getTestData(): array + { + return json_decode(file_get_contents(__DIR__ . '/test-config.json'), true)['data']; + } + + #[Test] + public function createThrowsInvalidArgumentExceptionWhenBothSdkKeyAndDataAreMissing(): void + { + $this->expectException(InvalidArgumentException::class); + $this->expectExceptionMessage('Either sdkKey or data must be provided'); + + ConvertSDK::create([]); + } + + #[Test] + public function createThrowsInvalidArgumentExceptionWithEmptyConfig(): void + { + $this->expectException(InvalidArgumentException::class); + + ConvertSDK::create(['sdkKey' => '', 'data' => []]); + } + + #[Test] + public function createWithDataKeyReturnsCoreInstance(): void + { + $sdk = ConvertSDK::create(['data' => $this->getTestData()]); + + $this->assertInstanceOf(Core::class, $sdk); + } + + #[Test] + public function createContextReturnsContextInstance(): void + { + $sdk = ConvertSDK::create(['data' => $this->getTestData()]); + $context = $sdk->createContext('visitor-id-456', ['country' => 'US']); + + $this->assertInstanceOf(Context::class, $context); + } + + #[Test] + public function contextThrowsInvalidArgumentExceptionForEmptyVisitorId(): void + { + $sdk = ConvertSDK::create(['data' => $this->getTestData()]); + + $this->expectException(InvalidArgumentException::class); + $this->expectExceptionMessage('Visitor ID must not be empty'); + + $sdk->createContext(''); + } + + #[Test] + public function bucketedVariationDtoIsReadonlyWithExpectedProperties(): void + { + $dto = new BucketedVariation( + experienceId: 'exp-1', + experienceKey: 'my-experiment', + variationId: 'var-1', + variationKey: 'variation-a', + changes: [['type' => 'custom', 'data' => []]], + ); + + $this->assertEquals('exp-1', $dto->experienceId); + $this->assertEquals('my-experiment', $dto->experienceKey); + $this->assertEquals('var-1', $dto->variationId); + $this->assertEquals('variation-a', $dto->variationKey); + $this->assertIsArray($dto->changes); + $this->assertCount(1, $dto->changes); + + // Verify class is readonly + $reflection = new \ReflectionClass(BucketedVariation::class); + $this->assertTrue($reflection->isReadOnly()); + } + + #[Test] + public function bucketedFeatureDtoIsReadonlyWithExpectedProperties(): void + { + $dto = new BucketedFeature( + featureId: 'feat-1', + featureKey: 'my-feature', + status: FeatureStatus::Enabled, + variables: ['enabled' => true, 'caption' => 'Click'], + ); + + $this->assertEquals('feat-1', $dto->featureId); + $this->assertEquals('my-feature', $dto->featureKey); + $this->assertEquals(FeatureStatus::Enabled, $dto->status); + $this->assertIsArray($dto->variables); + $this->assertTrue($dto->variables['enabled']); + + // Verify class is readonly + $reflection = new \ReflectionClass(BucketedFeature::class); + $this->assertTrue($reflection->isReadOnly()); + } + + #[Test] + public function isReadyReturnsTrueAfterSuccessfulInitializationWithData(): void + { + $sdk = ConvertSDK::create(['data' => $this->getTestData()]); + + $this->assertTrue($sdk->isReady()); + } + + #[Test] + public function convertSdkIsNotDirectlyInstantiable(): void + { + $reflection = new \ReflectionClass(ConvertSDK::class); + $constructor = $reflection->getConstructor(); + + $this->assertNotNull($constructor); + $this->assertTrue($constructor->isPrivate()); + } + + #[Test] + public function createIsStaticMethod(): void + { + $reflection = new \ReflectionClass(ConvertSDK::class); + $method = $reflection->getMethod('create'); + + $this->assertTrue($method->isStatic()); + $this->assertTrue($method->isPublic()); + } + + #[Test] + public function convertSdkIsFinalClass(): void + { + $reflection = new \ReflectionClass(ConvertSDK::class); + $this->assertTrue($reflection->isFinal()); + } + + #[Test] + public function createWithCustomLoggerWorks(): void + { + $logger = new \Psr\Log\NullLogger(); + $sdk = ConvertSDK::create([ + 'data' => $this->getTestData(), + 'logger' => [ + 'logLevel' => \ConvertSdk\Enums\LogLevel::Debug, + 'customLoggers' => [$logger], + ], + ]); + + $this->assertInstanceOf(Core::class, $sdk); + $this->assertTrue($sdk->isReady()); + } + + #[Test] + public function createWithCustomLoggerAndPerLoggerLevelWorks(): void + { + $logger = new \Psr\Log\NullLogger(); + $sdk = ConvertSDK::create([ + 'data' => $this->getTestData(), + 'logger' => [ + 'logLevel' => \ConvertSdk\Enums\LogLevel::Warn, + 'customLoggers' => [ + ['logger' => $logger, 'logLevel' => \ConvertSdk\Enums\LogLevel::Trace], + ], + ], + ]); + + $this->assertInstanceOf(Core::class, $sdk); + $this->assertTrue($sdk->isReady()); + } + + #[Test] + public function coreHasFlushMethodAndShutdownHookIsRegistered(): void + { + // Verifies AC #6 (shutdown hook) and AC #7 (Core::flush). + // Note: register_shutdown_function cannot be directly asserted in PHPUnit. + // We verify: (1) flush() exists and is callable, (2) it delegates to + // ApiManager::releaseQueue('flush'), and (3) ConvertSDK::create() completes + // without error (which includes the shutdown function registration). + $sdk = ConvertSDK::create(['data' => $this->getTestData()]); + + $this->assertTrue(method_exists($sdk, 'flush')); + // flush() should not throw when queue is empty + $sdk->flush(); + $this->assertTrue(true); + } + + #[Test] + public function createSetsPhpSdkAsDefaultSource(): void + { + // ConvertSDK::create() should set network.source to 'php-sdk' by default + // (unless VERSION env var overrides it) + $sdk = ConvertSDK::create(['data' => $this->getTestData()]); + + // Verify via reflection that the ApiManager received 'php-sdk' as trackingSource + $coreRef = new \ReflectionClass($sdk); + $apiManagerProp = $coreRef->getProperty('apiManager'); + $apiManager = $apiManagerProp->getValue($sdk); + + $apiRef = new \ReflectionClass($apiManager); + $sourceProp = $apiRef->getProperty('trackingSource'); + $source = $sourceProp->getValue($apiManager); + + $this->assertEquals('php-sdk', $source); + } + + /** + * Helper: extract DataStoreManager from Core via reflection. + */ + private function getDataStoreManager(Core $sdk): ?DataStoreManager + { + $coreRef = new \ReflectionClass($sdk); + $dataManagerProp = $coreRef->getProperty('dataManager'); + $dataManager = $dataManagerProp->getValue($sdk); + + return $dataManager->getDataStoreManager(); + } + + /** + * Helper: extract the underlying dataStore object from DataStoreManager via reflection. + */ + private function getUnderlyingDataStore(DataStoreManager $dsm): mixed + { + $ref = new \ReflectionClass($dsm); + $prop = $ref->getProperty('dataStore'); + return $prop->getValue($dsm); + } + + #[Test] + public function createWiresPsr16CacheAsDataStoreByDefault(): void + { + $sdk = ConvertSDK::create(['data' => $this->getTestData()]); + + $dsm = $this->getDataStoreManager($sdk); + $this->assertInstanceOf(DataStoreManager::class, $dsm); + + // Default cache is ArrayCache — verify it was wired as the underlying dataStore + $underlying = $this->getUnderlyingDataStore($dsm); + $this->assertInstanceOf(ArrayCache::class, $underlying); + } + + #[Test] + public function createUsesProvidedPsr16CacheAsDataStore(): void + { + $cache = new ArrayCache(); + + $sdk = ConvertSDK::create([ + 'data' => $this->getTestData(), + 'cache' => $cache, + ]); + + $dsm = $this->getDataStoreManager($sdk); + $this->assertInstanceOf(DataStoreManager::class, $dsm); + + $underlying = $this->getUnderlyingDataStore($dsm); + $this->assertSame($cache, $underlying); + } + + #[Test] + public function createUsesExplicitDataStoreOverCache(): void + { + $cache = new ArrayCache(); + $customStore = new class () { + private array $data = []; + public function get(string $key): mixed + { + return $this->data[$key] ?? null; + } + public function set(string $key, mixed $value): void + { + $this->data[$key] = $value; + } + }; + + $sdk = ConvertSDK::create([ + 'data' => $this->getTestData(), + 'cache' => $cache, + 'dataStore' => $customStore, + ]); + + $dsm = $this->getDataStoreManager($sdk); + $this->assertInstanceOf(DataStoreManager::class, $dsm); + + $underlying = $this->getUnderlyingDataStore($dsm); + $this->assertSame($customStore, $underlying); + } +} diff --git a/packages/Php-sdk/tests/CoreTest.php b/packages/Php-sdk/tests/CoreTest.php new file mode 100644 index 0000000..1c4401e --- /dev/null +++ b/packages/Php-sdk/tests/CoreTest.php @@ -0,0 +1,241 @@ +configuration = ObjectUtils::objectDeepMerge($testConfig, $defaultConfig, [ + 'api' => [ + 'endpoint' => [ + 'config' => 'http://127.0.0.1:9501', + 'track' => 'http://127.0.0.1:9501', + ], + ], + 'events' => [ + 'batch_size' => 5, + 'release_interval' => 1000, + ], + ]); + $this->configuration['data'] = new ConfigResponseData($this->configuration['data']); + if (isset($this->configuration['sdkKey'])) { + unset($this->configuration['sdkKey']); + } + $this->config = new Config($this->configuration); + + $this->loggerManager = new LogManager(); + $bucketingConfig = $this->config->getBucketing(); + $this->bucketingManager = new BucketingManager( + maxTraffic: $bucketingConfig['max_traffic'] ?? 10000, + hashSeed: $bucketingConfig['hash_seed'] ?? 9999, + ); + $this->ruleManager = new RuleManager(); + $this->eventManager = new EventManager(); + $this->apiManager = new ApiManager($this->config, $this->eventManager, $this->loggerManager); + $this->dataManager = new DataManager( + $this->config, + $this->bucketingManager, + $this->ruleManager, + $this->eventManager, + $this->apiManager, + $this->loggerManager + ); + $this->experienceManager = new ExperienceManager(dataManager: $this->dataManager); + $this->featureManager = new FeatureManager(dataManager: $this->dataManager, logManager: $this->loggerManager); + $this->segmentsManager = new SegmentsManager($this->config, $this->dataManager, $this->ruleManager); + + $this->core = new Core( + $this->config, + $this->dataManager, + $this->eventManager, + $this->experienceManager, + $this->featureManager, + $this->segmentsManager, + $this->apiManager, + new ArrayCache(), + Core::DEFAULT_DATA_REFRESH_INTERVAL, + $this->loggerManager, + ); + + $this->accountId = $this->config->getData() ? $this->config->getData()->getAccountId() : ''; + $project = $this->config->getData() ? $this->config->getData()->getProject() : null; + $this->projectId = $project ? (is_array($project) ? ($project['id'] ?? '') : ($project->getId() ?? '')) : ''; + } + + #[Test] + public function importedEntityShouldBeAConstructorOfCoreInstance() + { + $this->assertTrue(class_exists(Core::class)); + } + + #[Test] + public function shouldSuccessfullyCreateNewCoreInstance() + { + $this->assertInstanceOf(Core::class, $this->core); + } + + #[Test] + public function shouldExposeCore() + { + $this->assertTrue(class_exists(Core::class)); + } + + #[Test] + public function shouldSuccessfullyCreateVisitorContext() + { + $visitorId = 'XXX'; + $visitorContext = $this->core->createContext($visitorId, ['browser' => 'chrome']); + $this->assertInstanceOf(Context::class, $visitorContext); + } + + #[Test] + public function shouldSuccessfullyTriggerReadyEvent() + { + $triggered = false; + $this->eventManager->on(SystemEvents::Ready, function ($args, $err) use (&$triggered) { + $this->assertNull($err); + $triggered = true; + }); + $this->core->onReady(); + $this->assertTrue($triggered); + } + + #[Test] + public function shouldSuccessfullyResolveOnReady() + { + try { + $this->core->onReady(); + $this->assertTrue(true); + } catch (Exception $e) { + $this->fail('onReady threw an exception: ' . $e->getMessage()); + } + } + + #[Test] + public function shouldReturnTrueFromIsReady() + { + $this->assertTrue($this->core->isReady()); + } + + #[Test] + public function isReadyAndOnReadyShouldReturnSameValue() + { + $this->assertEquals($this->core->isReady(), $this->core->onReady()); + } + + #[Test] + public function coreShouldBeFinalClass() + { + $reflection = new \ReflectionClass(Core::class); + $this->assertTrue($reflection->isFinal()); + } + + #[Test] + public function flushMethodExistsAndIsPublic(): void + { + $reflection = new \ReflectionClass(Core::class); + $this->assertTrue($reflection->hasMethod('flush')); + $this->assertTrue($reflection->getMethod('flush')->isPublic()); + } + + #[Test] + public function flushIsNoOpWhenQueueIsEmpty(): void + { + // flush() should not throw when there are no queued events + $this->core->flush(); + $this->assertTrue(true); // No exception means success + } + + #[Test] + public function flushDelegatesToApiManagerReleaseQueue(): void + { + $apiManagerMock = $this->createMock(\ConvertSdk\Interfaces\ApiManagerInterface::class); + $apiManagerMock->expects($this->once()) + ->method('releaseQueue') + ->with('flush'); + + $core = new Core( + $this->config, + $this->dataManager, + $this->eventManager, + $this->experienceManager, + $this->featureManager, + $this->segmentsManager, + $apiManagerMock, + new ArrayCache(), + Core::DEFAULT_DATA_REFRESH_INTERVAL, + $this->loggerManager, + ); + + $core->flush(); + } + + #[Test] + public function isReadyShouldReturnFalseWhenConfigDataThrows(): void + { + $dataManagerMock = $this->createMock(\ConvertSdk\Interfaces\DataManagerInterface::class); + $dataManagerMock->method('getConfigData') + ->willThrowException(new \RuntimeException('No config')); + + $core = new Core( + $this->config, + $dataManagerMock, + $this->eventManager, + $this->experienceManager, + $this->featureManager, + $this->segmentsManager, + $this->apiManager, + new ArrayCache(), + Core::DEFAULT_DATA_REFRESH_INTERVAL, + $this->loggerManager, + ); + + $this->assertFalse($core->isReady()); + } + + #[Test] + public function createContextShouldThrowWhenVisitorIdEmpty(): void + { + $this->expectException(\ConvertSdk\Exception\InvalidArgumentException::class); + $this->core->createContext(''); + } + +} diff --git a/packages/Php-sdk/tests/Exception/ConvertExceptionTest.php b/packages/Php-sdk/tests/Exception/ConvertExceptionTest.php new file mode 100644 index 0000000..bbe2807 --- /dev/null +++ b/packages/Php-sdk/tests/Exception/ConvertExceptionTest.php @@ -0,0 +1,100 @@ +assertInstanceOf(\RuntimeException::class, $exception); + } + + public function testConfigFetchExceptionExtendsConvertException(): void + { + $exception = new ConfigFetchException('fetch failed', 403, 'https://api.example.com/config'); + $this->assertInstanceOf(ConvertException::class, $exception); + $this->assertInstanceOf(\RuntimeException::class, $exception); + } + + public function testConfigFetchExceptionStoresStatusCodeAndUrl(): void + { + $exception = new ConfigFetchException('HTTP 403', 403, 'https://api.example.com/config/key'); + + $this->assertSame(403, $exception->getStatusCode()); + $this->assertSame('https://api.example.com/config/key', $exception->getUrl()); + $this->assertSame('HTTP 403', $exception->getMessage()); + $this->assertSame(403, $exception->getCode()); + } + + public function testConfigFetchExceptionPreservesPreviousException(): void + { + $previous = new \RuntimeException('original error'); + $exception = new ConfigFetchException('wrapped', 500, 'https://api.example.com', $previous); + + $this->assertSame($previous, $exception->getPrevious()); + } + + public function testConfigValidationExceptionExtendsConvertException(): void + { + $exception = new ConfigValidationException('invalid config'); + $this->assertInstanceOf(ConvertException::class, $exception); + $this->assertInstanceOf(\RuntimeException::class, $exception); + } + + public function testInvalidArgumentExceptionExtendsPhpInvalidArgumentException(): void + { + $exception = new InvalidArgumentException('bad argument'); + $this->assertInstanceOf(\InvalidArgumentException::class, $exception); + // Should NOT extend ConvertException + $this->assertNotInstanceOf(ConvertException::class, $exception); + } + + public function testBucketingExceptionExtendsConvertException(): void + { + $exception = new BucketingException('hash failed'); + $this->assertInstanceOf(ConvertException::class, $exception); + $this->assertInstanceOf(\RuntimeException::class, $exception); + } + + public function testAllConvertExceptionSubclassesAreCatchableViaConvertException(): void + { + $exceptions = [ + new ConfigFetchException('test', 500, 'https://example.com'), + new ConfigValidationException('test'), + new BucketingException('test'), + ]; + + foreach ($exceptions as $exception) { + $caught = false; + try { + throw $exception; + } catch (ConvertException $e) { + $caught = true; + } + $this->assertTrue($caught, get_class($exception) . ' should be catchable via ConvertException'); + } + } + + public function testInvalidArgumentExceptionIsNotCatchableViaConvertException(): void + { + $caught = false; + try { + throw new InvalidArgumentException('test'); + } catch (ConvertException $e) { + $caught = true; + } catch (\InvalidArgumentException $e) { + // Expected path + } + $this->assertFalse($caught, 'InvalidArgumentException should NOT be catchable via ConvertException'); + } +} diff --git a/packages/Php-sdk/tests/FeatureManagerLoggingTest.php b/packages/Php-sdk/tests/FeatureManagerLoggingTest.php new file mode 100644 index 0000000..08f30bf --- /dev/null +++ b/packages/Php-sdk/tests/FeatureManagerLoggingTest.php @@ -0,0 +1,121 @@ +dataManager = $this->createMock(DataManagerInterface::class); + $this->logManager = $this->createMock(LogManagerInterface::class); + $this->featureManager = new FeatureManager( + dataManager: $this->dataManager, + logManager: $this->logManager, + ); + } + + public function testRunFeatureLogsDebugWithFeatureKeyAndStatus(): void + { + $this->dataManager + ->method('getEntity') + ->with('dark-mode', 'features') + ->willReturn(['id' => '100', 'name' => 'Dark Mode', 'key' => 'dark-mode']); + + $this->dataManager + ->method('getEntitiesListObject') + ->willReturn([]); + + $this->dataManager + ->method('getEntitiesList') + ->willReturn([]); + + $debugCalls = []; + $this->logManager->expects($this->atLeastOnce()) + ->method('debug') + ->willReturnCallback(function (string $method, array $data) use (&$debugCalls): void { + $debugCalls[] = ['method' => $method, 'data' => $data]; + }); + + $this->featureManager->runFeature( + 'visitor-456', + 'dark-mode', + new BucketingAttributes([]) + ); + + $runFeatureCalls = array_filter($debugCalls, fn ($c) => $c['method'] === 'FeatureManager.runFeature()'); + $this->assertNotEmpty($runFeatureCalls, 'Expected at least one debug call with FeatureManager.runFeature()'); + + // Verify entry log has visitorId and featureKey + $entryCall = reset($runFeatureCalls); + $this->assertArrayHasKey('visitorId', $entryCall['data']); + $this->assertArrayHasKey('featureKey', $entryCall['data']); + } + + public function testRunFeaturesLogsDebugWithSummaryCounts(): void + { + $this->dataManager + ->method('getEntitiesListObject') + ->willReturn([]); + + $this->dataManager + ->method('getEntitiesList') + ->willReturn([]); + + $debugCalls = []; + $this->logManager->expects($this->atLeastOnce()) + ->method('debug') + ->willReturnCallback(function (string $method, array $data) use (&$debugCalls): void { + $debugCalls[] = ['method' => $method, 'data' => $data]; + }); + + $this->featureManager->runFeatures( + 'visitor-456', + new BucketingAttributes([]) + ); + + $runFeaturesCalls = array_filter($debugCalls, fn ($c) => $c['method'] === 'FeatureManager.runFeatures()'); + $this->assertNotEmpty($runFeaturesCalls, 'Expected at least one debug call with FeatureManager.runFeatures()'); + + // Verify summary log has counts + $summaryCalls = array_filter($runFeaturesCalls, fn ($c) => array_key_exists('totalFeatures', $c['data'])); + $this->assertNotEmpty($summaryCalls, 'Expected summary log with totalFeatures count'); + } + + public function testNoExceptionWhenLogManagerIsNull(): void + { + $featureManager = new FeatureManager( + dataManager: $this->dataManager, + logManager: null, + ); + + $this->dataManager + ->method('getEntity') + ->willReturn(null); + + $result = $featureManager->runFeature( + 'visitor-123', + 'nonexistent-feature', + new BucketingAttributes([]) + ); + + $this->assertIsArray($result); + $this->assertEquals(FeatureStatus::Disabled->value, $result['status']); + } +} diff --git a/packages/Php-sdk/tests/FeatureManagerNullReturnLoggingTest.php b/packages/Php-sdk/tests/FeatureManagerNullReturnLoggingTest.php new file mode 100644 index 0000000..05e2996 --- /dev/null +++ b/packages/Php-sdk/tests/FeatureManagerNullReturnLoggingTest.php @@ -0,0 +1,230 @@ +dataManager = $this->createMock(DataManagerInterface::class); + $this->logManager = $this->createMock(LogManagerInterface::class); + $this->featureManager = new FeatureManager( + dataManager: $this->dataManager, + logManager: $this->logManager, + ); + } + + public function testRunFeatureLogsFeatureNotFoundWithAvailableKeys(): void + { + $this->dataManager + ->method('getEntity') + ->with('nonexistent-feature', 'features') + ->willReturn(null); + + $this->dataManager + ->method('getEntitiesList') + ->with('features') + ->willReturn([ + ['key' => 'dark-mode', 'id' => '100'], + ['key' => 'beta-ui', 'id' => '200'], + ]); + + $debugCalls = []; + $this->logManager->expects($this->atLeastOnce()) + ->method('debug') + ->willReturnCallback(function (string $method, array $data) use (&$debugCalls): void { + $debugCalls[] = ['method' => $method, 'data' => $data]; + }); + + $result = $this->featureManager->runFeature( + 'visitor-123', + 'nonexistent-feature', + new BucketingAttributes([]) + ); + + $this->assertSame(FeatureStatus::Disabled->value, $result['status']); + + // Find the "not found" log call + $notFoundCalls = array_filter($debugCalls, function ($call) { + return $call['method'] === 'FeatureManager.runFeature()' + && isset($call['data']['reason']) + && $call['data']['reason'] === Messages::NULL_RETURN_FEATURE_NOT_FOUND; + }); + + $this->assertNotEmpty($notFoundCalls, 'Expected debug log with feature not found reason'); + + $logCall = reset($notFoundCalls); + $this->assertSame('nonexistent-feature', $logCall['data']['featureKey']); + $this->assertContains('dark-mode', $logCall['data']['availableKeys']); + $this->assertContains('beta-ui', $logCall['data']['availableKeys']); + } + + public function testRunFeatureByIdLogsFeatureNotFoundWithAvailableIds(): void + { + $this->dataManager + ->method('getEntityById') + ->with('999', 'features') + ->willReturn(null); + + $this->dataManager + ->method('getEntitiesList') + ->with('features') + ->willReturn([ + ['id' => '100', 'key' => 'dark-mode'], + ['id' => '200', 'key' => 'beta-ui'], + ]); + + $debugCalls = []; + $this->logManager->expects($this->atLeastOnce()) + ->method('debug') + ->willReturnCallback(function (string $method, array $data) use (&$debugCalls): void { + $debugCalls[] = ['method' => $method, 'data' => $data]; + }); + + $result = $this->featureManager->runFeatureById( + 'visitor-123', + '999', + new BucketingAttributes([]) + ); + + $this->assertSame(FeatureStatus::Disabled->value, $result['status']); + + $notFoundCalls = array_filter($debugCalls, function ($call) { + return $call['method'] === 'FeatureManager.runFeatureById()' + && isset($call['data']['reason']) + && $call['data']['reason'] === Messages::NULL_RETURN_FEATURE_NOT_FOUND; + }); + + $this->assertNotEmpty($notFoundCalls, 'Expected debug log with feature not found reason'); + + $logCall = reset($notFoundCalls); + $this->assertContains('100', $logCall['data']['availableIds']); + $this->assertContains('200', $logCall['data']['availableIds']); + } + + public function testIsFeatureEnabledLogsFeatureNotFoundWithAvailableKeys(): void + { + $this->dataManager + ->method('getEntity') + ->with('nonexistent-feature', 'features') + ->willReturn(null); + + $this->dataManager + ->method('getEntitiesList') + ->with('features') + ->willReturn([ + ['key' => 'dark-mode', 'id' => '100'], + ]); + + $debugCalls = []; + $this->logManager->expects($this->atLeastOnce()) + ->method('debug') + ->willReturnCallback(function (string $method, array $data) use (&$debugCalls): void { + $debugCalls[] = ['method' => $method, 'data' => $data]; + }); + + $result = $this->featureManager->isFeatureEnabled( + 'visitor-123', + 'nonexistent-feature', + new BucketingAttributes([]) + ); + + $this->assertFalse($result); + + $notFoundCalls = array_filter($debugCalls, function ($call) { + return $call['method'] === 'FeatureManager.isFeatureEnabled()' + && isset($call['data']['reason']) + && $call['data']['reason'] === Messages::NULL_RETURN_FEATURE_NOT_FOUND; + }); + + $this->assertNotEmpty($notFoundCalls, 'Expected debug log with feature not found reason'); + } + + public function testNoExceptionWhenLogManagerIsNullRunFeature(): void + { + $fm = new FeatureManager( + dataManager: $this->dataManager, + logManager: null, + ); + + $this->dataManager + ->method('getEntity') + ->willReturn(null); + + $this->dataManager + ->method('getEntitiesList') + ->willReturn([]); + + $result = $fm->runFeature( + 'visitor-123', + 'nonexistent', + new BucketingAttributes([]) + ); + + $this->assertIsArray($result); + $this->assertSame(FeatureStatus::Disabled->value, $result['status']); + } + + public function testNoExceptionWhenLogManagerIsNullIsFeatureEnabled(): void + { + $fm = new FeatureManager( + dataManager: $this->dataManager, + logManager: null, + ); + + $this->dataManager + ->method('getEntity') + ->willReturn(null); + + $this->dataManager + ->method('getEntitiesList') + ->willReturn([]); + + $result = $fm->isFeatureEnabled( + 'visitor-123', + 'nonexistent', + new BucketingAttributes([]) + ); + + $this->assertFalse($result); + } + + public function testRunFeatureReturnsArrayNotExceptionForBusinessLogicMisses(): void + { + // AC #5: runFeature never throws for business logic misses + $this->dataManager + ->method('getEntity') + ->willReturn(null); + + $this->dataManager + ->method('getEntitiesList') + ->willReturn([]); + + $result = $this->featureManager->runFeature( + 'visitor-1', + 'nonexistent', + new BucketingAttributes([]) + ); + + $this->assertIsArray($result); + $this->assertSame(FeatureStatus::Disabled->value, $result['status']); + } +} diff --git a/packages/Php-sdk/tests/FeatureManagerTest.php b/packages/Php-sdk/tests/FeatureManagerTest.php new file mode 100644 index 0000000..b4c3012 --- /dev/null +++ b/packages/Php-sdk/tests/FeatureManagerTest.php @@ -0,0 +1,261 @@ + [ + 'endpoint' => [ + 'config' => 'http://' . self::HOST . ':' . self::PORT, + 'track' => 'http://' . self::HOST . ':' . self::PORT, + ], + ], + 'events' => [ + 'batch_size' => self::BATCH_SIZE, + 'release_interval' => self::RELEASE_TIMEOUT, + ], + ]); + + $configuration['data'] = new ConfigResponseData($configuration['data']); + if (isset($configuration['sdkKey'])) { + unset($configuration['sdkKey']); + } + // Create Config object + $this->config = new Config($configuration); + + $bucketingConfig = $this->config->getBucketing(); + $bucketingManager = new BucketingManager( + maxTraffic: $bucketingConfig['max_traffic'] ?? 10000, + hashSeed: $bucketingConfig['hash_seed'] ?? 9999, + ); + $ruleManager = new RuleManager(); + $loggerManager = new LogManager(); + $this->eventManager = new EventManager(); + $this->apiManager = new ApiManager($this->config, $this->eventManager); + $this->dataManager = new DataManager( + $this->config, + $bucketingManager, + $ruleManager, + $this->eventManager, + $this->apiManager, + $loggerManager + ); + $this->featureManager = new FeatureManager(dataManager: $this->dataManager); + + $this->accountId = $this->config->getData() ? $this->config->getData()->getAccountId() : ''; + $project = $this->config->getData() ? $this->config->getData()->getProject() : null; + $this->projectId = $project ? (is_array($project) ? ($project['id'] ?? '') : ($project->getId() ?? '')) : ''; + } + + protected function tearDown(): void + { + $this->dataManager->reset(); + } + + public function testExposeFeatureManager(): void + { + $this->assertTrue(class_exists(FeatureManager::class)); + } + + public function testImportedEntityIsConstructor(): void + { + $reflection = new \ReflectionClass(FeatureManager::class); + $this->assertTrue($reflection->isInstantiable()); + $this->assertEquals('ConvertSdk\FeatureManager', $reflection->getName()); + } + + public function testCreateFeatureManagerInstance(): void + { + $this->assertIsObject($this->featureManager); + $reflection = new \ReflectionClass($this->featureManager); + $this->assertEquals('ConvertSdk\FeatureManager', $reflection->getName()); + } + + public function testGetListOfEntities(): void + { + $entities = $this->featureManager->getList(); + $this->assertIsArray($entities); + $this->assertCount(3, $entities); + $this->assertEquals($this->config->getData()->getFeatures(), $entities); + } + + public function testGetListAsObject(): void + { + $field = 'id'; + $entities = $this->featureManager->getListAsObject($field); + $featuresList = array_column($this->config->getData()->getFeatures(), null, $field); + $this->assertEquals($featuresList, $entities); + } + + public function testGetFeatureByKey(): void + { + $featureKey = 'feature-1'; + $featureId = '10024'; + $entity = $this->featureManager->getFeature($featureKey); + $this->assertIsObject($entity); + $this->assertEquals($featureId, $entity->getId()); + } + + public function testGetFeatureById(): void + { + $featureKey = 'feature-1'; + $featureId = '10024'; + $entity = $this->featureManager->getFeatureById($featureId); + $this->assertIsObject($entity); + $this->assertEquals($featureKey, $entity->getKey()); + } + + public function testGetFeaturesByKeys(): void + { + $featureKeys = ['feature-1', 'feature-2', 'not-attached-feature-3']; + $entities = $this->featureManager->getFeatures($featureKeys); + $this->assertIsArray($entities); + $this->assertEquals($this->config->getData()->getFeatures(), $entities); + } + + public function testGetFeatureVariableType(): void + { + $featureKey = 'feature-1'; + $variableName = 'enabled'; + $variableType = 'boolean'; + $type = $this->featureManager->getFeatureVariableType($featureKey, $variableName); + $this->assertEquals($variableType, $type); + } + + public function testGetFeatureVariableTypeById(): void + { + $featureId = '10024'; + $variableName = 'enabled'; + $variableType = 'boolean'; + $type = $this->featureManager->getFeatureVariableTypeById($featureId, $variableName); + $this->assertEquals($variableType, $type); + } + + public function testIsFeatureDeclared(): void + { + $featureKey = 'feature-1'; + $check = $this->featureManager->isFeatureDeclared($featureKey); + $this->assertTrue($check); + } + + public function testRunFeature(): void + { + $featureKey = 'feature-1'; + $featureIds = ['10024', '10025']; + $features = $this->featureManager->runFeature(self::VISITOR_ID, $featureKey, new BucketingAttributes([ + 'visitorProperties' => ['varName3' => 'something'], + 'locationProperties' => ['url' => 'https://convert.com/'], + ])); + $this->assertIsArray($features); + $this->assertCount(2, $features); + $selectedFeatures = array_column($features, 'id'); + + $this->assertContains($selectedFeatures[0], $featureIds); + $this->assertContains($selectedFeatures[1], $featureIds); + } + + public function testIsFeatureEnabled(): void + { + $featureKey = 'feature-1'; + $enabled = $this->featureManager->isFeatureEnabled(self::VISITOR_ID, $featureKey, new BucketingAttributes([ + 'visitorProperties' => ['varName3' => 'something'], + 'locationProperties' => ['url' => 'https://convert.com/'], + ])); + + $this->assertTrue($enabled); + } + + public function testRunFeatureById(): void + { + $featureId = '10024'; + $featureIds = ['10024', '10025']; + $features = $this->featureManager->runFeatureById(self::VISITOR_ID, $featureId, new BucketingAttributes([ + 'visitorProperties' => ['varName3' => 'something'], + 'locationProperties' => ['url' => 'https://convert.com/'], + ])); + + $this->assertIsArray($features); + $this->assertCount(2, $features); + $selectedFeatures = array_column($features, 'id'); + $this->assertContains($selectedFeatures[0], $featureIds); + $this->assertContains($selectedFeatures[1], $featureIds); + } + + public function testRunFeatures(): void + { + $filterByFeatures = ['feature-1', 'feature-2', 'not-attached-feature-3']; + $filterByExperiences = ['test-experience-ab-fullstack-2', 'test-experience-ab-fullstack-3']; + $featureIds = ['10024', '10025', '10026']; + $features = $this->featureManager->runFeatures(self::VISITOR_ID, new BucketingAttributes([ + 'visitorProperties' => ['varName3' => 'something'], + 'locationProperties' => ['url' => 'https://convert.com/'], + 'updateVisitorProperties' => false, + 'typeCasting' => true, + ]), [ + 'features' => $filterByFeatures, + 'experiences' => $filterByExperiences, + ]); + $this->assertIsArray($features); + $this->assertCount(3, $features); + $selectedFeatures = array_column($features, 'id'); + $this->assertContains($selectedFeatures[0], $featureIds); + $this->assertContains($selectedFeatures[1], $featureIds); + $this->assertContains($selectedFeatures[2], $featureIds); + } + + public function testCastType(): void + { + $value = $this->featureManager->castType('123', 'integer'); + $this->assertIsInt($value); + $this->assertEquals(123, $value); + + $value = $this->featureManager->castType(123, 'string'); + $this->assertIsString($value); + $this->assertEquals('123', $value); + + $value = $this->featureManager->castType('1.23', 'float'); + $this->assertIsFloat($value); + $this->assertEquals(1.23, $value); + + $value = $this->featureManager->castType('false', 'boolean'); + $this->assertIsBool($value); + $this->assertFalse($value); + } +} diff --git a/packages/Php-sdk/tests/GoalDataTest.php b/packages/Php-sdk/tests/GoalDataTest.php new file mode 100644 index 0000000..be9bf5f --- /dev/null +++ b/packages/Php-sdk/tests/GoalDataTest.php @@ -0,0 +1,65 @@ +assertTrue($reflection->isReadonly()); + } + + public function testGoalDataWithFloatValue(): void + { + $goalData = new GoalData(GoalDataKey::Amount, 99.99); + $this->assertSame(GoalDataKey::Amount, $goalData->key); + $this->assertSame(99.99, $goalData->value); + } + + public function testGoalDataWithStringValue(): void + { + $goalData = new GoalData(GoalDataKey::TransactionId, 'txn-abc-123'); + $this->assertSame(GoalDataKey::TransactionId, $goalData->key); + $this->assertSame('txn-abc-123', $goalData->value); + } + + public function testGoalDataWithIntValue(): void + { + $goalData = new GoalData(GoalDataKey::ProductsCount, 5); + $this->assertSame(GoalDataKey::ProductsCount, $goalData->key); + $this->assertSame(5, $goalData->value); + } + + public function testGoalDataWithAllCustomDimensions(): void + { + $dimensions = [ + GoalDataKey::CustomDimension1, + GoalDataKey::CustomDimension2, + GoalDataKey::CustomDimension3, + GoalDataKey::CustomDimension4, + GoalDataKey::CustomDimension5, + ]; + + foreach ($dimensions as $i => $key) { + $goalData = new GoalData($key, "dim-value-{$i}"); + $this->assertSame($key, $goalData->key); + $this->assertSame("dim-value-{$i}", $goalData->value); + } + } + + public function testGoalDataNamespace(): void + { + $reflection = new \ReflectionClass(GoalData::class); + $this->assertEquals('ConvertSdk\DTO', $reflection->getNamespaceName()); + } +} diff --git a/packages/Php-sdk/tests/test-config.json b/packages/Php-sdk/tests/test-config.json new file mode 100644 index 0000000..9bf572c --- /dev/null +++ b/packages/Php-sdk/tests/test-config.json @@ -0,0 +1,570 @@ +{ + "environment": "staging", + "data": { + "account_id": "10022898", + "audiences": [ + { + "id": "100299433", + "name": "Adv Audience", + "type": "transient", + "status": "active", + "key": "adv-audience", + "preset": false, + "rules": { + "OR": [ + { + "AND": [ + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "matches", + "negated": false + }, + "value": "value1", + "key": "varName1" + } + ] + }, + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "matches", + "negated": false + }, + "value": "value2", + "key": "varName2" + } + ] + } + ] + }, + { + "AND": [ + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "matches", + "negated": false + }, + "value": "something", + "key": "varName3" + } + ] + } + ] + } + ] + } + } + ], + "segments": [ + { + "id": "200299434", + "name": "Test Segments", + "status": "active", + "key": "test-segments-1", + "preset": false, + "rules": { + "OR": [ + { + "AND": [ + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "matches", + "negated": false + }, + "key": "enabled", + "value": true + } + ] + } + ] + } + ] + } + } + ], + "experiences": [ + { + "id": "100218245", + "name": "Test Experience AB Fullstack", + "key": "test-experience-ab-fullstack-2", + "type": "a/b_fullstack", + "version": 6, + "status": "active", + "global_js": "var s = 'test_experience'; console.log(s);", + "global_css": ".test-style { display: initial; }", + "url": "https://convert.com", + "integrations": [], + "environments": ["live", "staging"], + "site_area": { + "OR": [ + { + "AND": [ + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "matches", + "negated": false + }, + "key": "url", + "value": "https://convert.com/" + } + ] + } + ] + } + ] + }, + "audiences": ["100299433"], + "goals": ["100215959", "100215960", "100215961"], + "settings": { + "matching_options": { + "audiences": "any" + } + }, + "variations": [ + { + "id": "100299456", + "name": "Original Page", + "status": "running", + "is_baseline": true, + "changes": [ + { + "id": "100240519", + "type": "fullStackFeature", + "data": { + "feature_id": "10024", + "variables_data": { + "enabled": "true", + "caption": "Click that" + } + } + }, + { + "id": "100240521", + "type": "fullStackFeature", + "data": { + "feature_id": "10025", + "variables_data": { + "price": 100, + "button-height": 40, + "additionalData": "{\"foo\":\"bar\",\"v\":2}" + } + } + } + ], + "key": "100299456-original-page", + "traffic_allocation": 50.0 + }, + { + "id": "100299457", + "name": "Variation 1", + "status": "running", + "is_baseline": false, + "changes": [ + { + "id": "100240520", + "type": "fullStackFeature", + "data": { + "feature_id": "10024", + "variables_data": { + "enabled": "false", + "caption": "Not allowed" + } + } + } + ], + "key": "100299457-variation-1", + "traffic_allocation": 50.0 + } + ] + }, + { + "id": "100218246", + "name": "Test Experience AB Fullstack", + "key": "test-experience-ab-fullstack-3", + "type": "a/b_fullstack", + "version": 6, + "status": "active", + "global_js": "var s = 'test_experience'; console.log(s);", + "global_css": ".test-style { display: initial; }", + "url": "https://convert.com", + "integrations": [], + "environments": ["live", "staging"], + "site_area": { + "OR": [ + { + "AND": [ + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "matches", + "negated": false + }, + "key": "url", + "value": "https://convert.com/" + } + ] + } + ] + } + ] + }, + "audiences": ["100299433"], + "goals": ["100215959", "100215960", "100215961"], + "settings": { + "matching_options": { + "audiences": "any" + } + }, + "variations": [ + { + "id": "100299460", + "name": "Original Page", + "status": "running", + "is_baseline": true, + "changes": [ + { + "id": "100240529", + "type": "fullStackFeature", + "data": { + "feature_id": "10024", + "variables_data": { + "enabled": "true", + "caption": "Click that" + } + } + } + ], + "key": "100299460-original-page", + "traffic_allocation": 50.0 + }, + { + "id": "100299461", + "name": "Variation 1", + "status": "running", + "is_baseline": false, + "changes": [ + { + "id": "100240532", + "type": "fullStackFeature", + "data": { + "feature_id": "10024", + "variables_data": { + "enabled": "true", + "caption": "Allowed" + } + } + } + ], + "key": "100299461-variation-1", + "traffic_allocation": 50.0 + } + ] + }, + { + "id": "100218247", + "name": "Test Experience AB Fullstack", + "key": "test-experience-ab-fullstack-4", + "type": "a/b_fullstack", + "version": 6, + "status": "active", + "global_js": "var s = 'test_experience'; console.log(s);", + "global_css": ".test-style { display: initial; }", + "url": "https://convert.com", + "integrations": [], + "environments": ["live", "staging"], + "site_area": { + "OR": [ + { + "AND": [ + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "matches", + "negated": false + }, + "key": "url", + "value": "https://convert.com/" + } + ] + } + ] + } + ] + }, + "audiences": ["100299433"], + "goals": ["100215959", "100215960", "100215961"], + "settings": { + "matching_options": { + "audiences": "any" + } + }, + "variations": [{}] + } + ], + "features": [ + { + "id": "10024", + "name": "Feature 1", + "key": "feature-1", + "variables": [ + { + "key": "enabled", + "type": "boolean" + }, + { + "key": "caption", + "type": "string" + } + ] + }, + { + "id": "10025", + "name": "Feature 2", + "key": "feature-2", + "variables": [ + { + "key": "price", + "type": "float" + }, + { + "key": "button-height", + "type": "integer" + }, + { + "key": "additionalData", + "type": "json" + } + ] + }, + { + "id": "10026", + "name": "Not Attached Feature 3", + "key": "not-attached-feature-3", + "variables": [ + { + "key": "fee", + "type": "float" + }, + { + "key": "link", + "type": "string" + }, + { + "key": "additionalData", + "type": "json" + } + ] + } + ], + "goals": [ + { + "id": "100215960", + "name": "Increase Engagement", + "selected_default": true, + "status": "active", + "type": "dom_interaction", + "is_system": true, + "key": "increase-engagement", + "settings": { + "tracked_items": [ + { + "event": "click", + "selector": "a" + }, + { + "event": "submit", + "selector": "form" + } + ] + }, + "rules": { + "OR": [ + { + "AND": [ + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "matches", + "negated": false + }, + "key": "action", + "value": "buy" + }, + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "matches", + "negated": false + }, + "key": "action", + "value": "signup" + } + ] + } + ] + } + ] + } + }, + { + "id": "100215959", + "name": "Decrease BounceRate", + "selected_default": true, + "status": "active", + "type": "advanced", + "is_system": true, + "key": "decrease-bounce-rate", + "rules": { + "OR": [ + { + "AND": [ + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "lessEqual", + "negated": true + }, + "value": 1, + "key": "pages_visited_count" + }, + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "lessEqual", + "negated": true + }, + "value": 10, + "key": "visit_duration" + } + ] + } + ] + } + ] + } + }, + { + "id": "100215961", + "name": "adv goal country browser", + "selected_default": false, + "status": "active", + "type": "advanced", + "is_system": false, + "key": "adv-goal-country-browser", + "rules": { + "OR": [ + { + "AND": [ + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "equals", + "negated": false + }, + "value": "US", + "key": "country" + } + ] + }, + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "equals", + "negated": false + }, + "value": "chrome", + "key": "browser_name" + } + ] + } + ] + }, + { + "AND": [ + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "equals", + "negated": false + }, + "value": "GB", + "key": "country" + } + ] + }, + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "equals", + "negated": false + }, + "value": "safari", + "key": "browser_name" + } + ] + } + ] + } + ] + } + }, + { + "id": "100215962", + "key": "goal-without-rule" + } + ], + "project": { + "id": "10025986", + "name": "Test Project", + "type": "fullstack", + "utc_offset": 0, + "domains": [ + { + "id": "10029181", + "hosts": "https://convert.com/", + "tld": false + } + ], + "settings": { + "auto_link": false, + "data_anonymization": false, + "do_not_track": "OFF", + "include_jquery": false + }, + "environments": { + "live": "Live", + "staging": "Staging" + } + } + } +} diff --git a/packages/Rules/composer.json b/packages/Rules/composer.json new file mode 100644 index 0000000..878efb7 --- /dev/null +++ b/packages/Rules/composer.json @@ -0,0 +1,50 @@ +{ + "name": "convertcom/php-sdk-rules", + "description": "PHP SDK for Convert Rules", + "type": "library", + "license": "Apache-2.0", + "authors": [ + { + "name": "Convert Insights, Inc" + } + ], + "autoload": { + "psr-4": { + "ConvertSdk\\": "src/", + "ConvertSdk\\Config\\": "../Php-sdk/src/Config/" + } + }, + "repositories": [ + { + "type": "path", + "url": "../Enums" + }, + { + "type": "path", + "url": "../Logger" + }, + { + "type": "path", + "url": "../Utils" + }, + { + "type": "path", + "url": "../Types" + } + ], + "require": { + "php": "^8.2", + "convertcom/php-sdk-enums": ">=1.0.0", + "convertcom/php-sdk-logger": ">=1.0.0", + "convertcom/php-sdk-utils": ">=1.0.0", + "convertcom/php-sdk-types": ">=1.0.0" + }, + "require-dev": { + "phpunit/phpunit": "^11.0" + }, + "scripts": { + "test": "phpunit", + "build": "php build.php" + }, + "version": "1.0.0" +} diff --git a/packages/Rules/phpunit.xml b/packages/Rules/phpunit.xml new file mode 100644 index 0000000..28c2c18 --- /dev/null +++ b/packages/Rules/phpunit.xml @@ -0,0 +1,18 @@ + + + + + ./tests + + + + + src + + + diff --git a/packages/Rules/src/Interfaces/RuleManagerInterface.php b/packages/Rules/src/Interfaces/RuleManagerInterface.php new file mode 100644 index 0000000..a72e128 --- /dev/null +++ b/packages/Rules/src/Interfaces/RuleManagerInterface.php @@ -0,0 +1,49 @@ + List of comparison method names + */ + public function getComparisonProcessorMethods(): array; + + /** + * Check if data matches a rule set. + * + * @param array $data The data set to be compared + * @param RuleObject $ruleSet The hierarchical rule set (OR → AND → OR_WHEN → RuleElement) + * @param string|null $logEntry Optional label for log messages + * @return bool|RuleError True if rules match, false if not, or RuleError on data issues + */ + public function isRuleMatched(array $data, RuleObject $ruleSet, ?string $logEntry = null): bool|RuleError; + + /** + * Check if a rule element has valid structure. + * + * @param RuleElement $rule The rule to validate + * @return bool True if the rule has valid matching structure and value + */ + public function isValidRule(RuleElement $rule): bool; +} diff --git a/packages/Rules/src/RuleManager.php b/packages/Rules/src/RuleManager.php new file mode 100644 index 0000000..da70f47 --- /dev/null +++ b/packages/Rules/src/RuleManager.php @@ -0,0 +1,361 @@ +|string $comparisonProcessor Comparison processor class name or array of callable methods + * @param string $negation Negation prefix character (default: '!') + * @param bool $keysCaseSensitive Whether rule key matching is case-sensitive (default: true) + * @param LogManagerInterface|null $logManager Optional logger for debug output + * @param \Closure|null $mapper Optional data mapper for logging transformations + */ + public function __construct( + private array|string $comparisonProcessor = self::DEFAULT_COMPARISON_PROCESSOR, + private readonly string $negation = self::DEFAULT_NEGATION, + private readonly bool $keysCaseSensitive = self::DEFAULT_KEYS_CASE_SENSITIVE, + private readonly ?LogManagerInterface $logManager = null, + private readonly ?\Closure $mapper = null, + ) { + $this->logManager?->trace('RuleManager()', Messages::RULE_CONSTRUCTOR, $this); + } + + /** + * Set the comparison processor. + * + * @param array $comparisonProcessor Array of callable comparison methods + * @return void + */ + public function setComparisonProcessor(array $comparisonProcessor): void + { + $this->comparisonProcessor = $comparisonProcessor; + } + + /** + * Get the comparison processor. + * + * @return array Method names (if class) or callable array + */ + public function getComparisonProcessor(): array + { + if (is_string($this->comparisonProcessor)) { + return get_class_methods($this->comparisonProcessor); + } + return $this->comparisonProcessor; + } + + /** + * Retrieve comparison method names from the comparison processor. + * + * @return array List of available comparison method names + */ + public function getComparisonProcessorMethods(): array + { + if (is_string($this->comparisonProcessor)) { + return get_class_methods($this->comparisonProcessor); + } elseif (is_array($this->comparisonProcessor)) { + return array_filter(array_keys($this->comparisonProcessor), function ($name) { + return is_callable($this->comparisonProcessor[$name]); + }); + } + return []; + } + + /** + * Check input data matching to rule set. + * + * Evaluates a data set against a hierarchical rule set (OR → AND → OR_WHEN → RuleElement). + * Returns true on first OR-level match, false if none match, or RuleError on data issues. + * + * @param array $data Key-value data set to compare against rules + * @param RuleObject $ruleSet Hierarchical rule object with OR/AND/OR_WHEN structure + * @param string|null $logEntry Optional label for log messages + * @return bool|RuleError True if rules match, false if not, or RuleError on data issues + */ + public function isRuleMatched(array $data, RuleObject $ruleSet, ?string $logEntry = null): bool|RuleError + { + $mapperFn = $this->mapper ?? static fn (mixed $value): mixed => $value; + $this->logManager?->trace('RuleManager.isRuleMatched()', LogUtils::toLoggable($mapperFn([ + 'data' => $data, + 'ruleSet' => $ruleSet, + ]))); + if ($logEntry) { + $this->logManager?->info('RuleManager.isRuleMatched()', str_replace('#', $logEntry, Messages::PROCESSING_ENTITY)); + } + + // Top OR level + $match = false; + if (isset($ruleSet['OR']) && ArrayUtils::arrayNotEmpty($ruleSet['OR'])) { + foreach ($ruleSet['OR'] as $i => $rule) { + $match = $this->processAND($data, new RuleAnd($rule)); + if ($match === true) { + $this->logManager?->info( + 'RuleManager.isRuleMatched()', + $logEntry ?? '', + str_replace('#', (string)$i, Messages::RULE_MATCH) + ); + return $match; + } + if ($match instanceof RuleError) { + $this->logManager?->info('RuleManager.isRuleMatched()', $logEntry ?? '', ErrorMessages::RULE_ERROR); + } else { + $this->logManager?->info( + 'RuleManager.isRuleMatched()', + $logEntry ?? '', + Messages::RULE_NOT_MATCH + ); + } + } + // If last match was a RuleError, propagate it (JS SDK parity) + if ($match !== false) { + return $match; + } + } else { + $this->logManager?->warn('RuleManager.isRuleMatched()', $logEntry ?? '', ErrorMessages::RULE_NOT_VALID); + } + return false; + } + + /** + * Check if rule object is valid. + * + * Validates that a rule element has the required matching structure + * (match_type string, negated boolean) and a value field. + * + * @param RuleElement $rule The rule element to validate + * @return bool True if the rule has valid structure + */ + public function isValidRule(RuleElement $rule): bool + { + $mapperFn = $this->mapper ?? static fn (mixed $value): mixed => $value; + $this->logManager?->trace('RuleManager.isValidRule()', LogUtils::toLoggable($mapperFn(['rule' => $rule]))); + return isset($rule['matching']) && is_array($rule['matching']) && + isset($rule['matching']['match_type']) && is_string($rule['matching']['match_type']) && + isset($rule['matching']['negated']) && is_bool($rule['matching']['negated']) && + isset($rule['value']); + } + + /** + * Process AND block of rule set. + * + * Requires ALL rules in the AND block to match (return true). + * Returns the first non-true result (false or RuleError) for short-circuit evaluation. + * + * @param array $data Key-value data set to compare + * @param RuleAnd $rulesSubset AND rule group containing OR_WHEN sub-rules + * @return bool|RuleError True if all AND conditions match, false or RuleError otherwise + */ + private function processAND(array $data, RuleAnd $rulesSubset): bool|RuleError + { + // Second AND level + $match = false; + if ($rulesSubset instanceof RuleAnd) { + // Extract the AND items array (getAnd() returns ['AND' => [items...]]) + $rawAnd = $rulesSubset->getAnd(); + $andRules = $rawAnd['AND'] ?? $rawAnd; + if (ArrayUtils::arrayNotEmpty($andRules)) { + foreach ($andRules as $orWhenGroup) { + $match = $this->processORWHEN($data, new RuleOrWhen($orWhenGroup)); + // AND requires ALL to return true — return first non-true (JS SDK parity) + if ($match !== true) { + return $match; + } + } + $this->logManager?->info('RuleManager.processAND()', Messages::RULE_MATCH_AND); + return true; + } + } else { + $this->logManager?->warn('RuleManager.processAND()', ErrorMessages::RULE_NOT_VALID); + } + return false; + } + + /** + * Process OR_WHEN block of rule set. + * + * Returns the first true match found. If no true match is found but a RuleError + * was encountered, propagates the RuleError. Returns false only if all items are false. + * + * @param array $data Key-value data set to compare + * @param RuleOrWhen $rulesSubset OR_WHEN rule group containing individual rule elements + * @return bool|RuleError True on first match, false if none match, or RuleError on data issues + */ + private function processORWHEN(array $data, RuleOrWhen $rulesSubset): bool|RuleError + { + // Third OR level. Called OR_WHEN. + $match = false; + if ($rulesSubset instanceof RuleOrWhen) { + // Extract the OR_WHEN items array (getOrWhen() returns ['OR_WHEN' => [items...]]) + $rawOrWhen = $rulesSubset->getOrWhen(); + $orWhenRules = $rawOrWhen['OR_WHEN'] ?? $rawOrWhen; + + if (ArrayUtils::arrayNotEmpty($orWhenRules)) { + foreach ($orWhenRules as $ruleItem) { + if (!is_array($ruleItem)) { + continue; + } + $match = $this->processRuleItem($data, new RuleElement($ruleItem)); + if ($match === true) { + return $match; + } + } + // Propagate RuleError if last match was not false (JS SDK parity) + if ($match !== false) { + return $match; + } + } + } else { + $this->logManager?->warn('RuleManager.processORWHEN()', ErrorMessages::RULE_NOT_VALID); + } + return false; + } + + /** + * Process a single rule item. + * + * Extracts the data value for the rule's key, then applies the specified + * comparison method. Supports both key-value data and custom RuleData interfaces. + * + * @param array $data Key-value data set to compare + * @param RuleElement $rule A single rule element to evaluate + * @return bool|RuleError Comparison result, or RuleError from custom interface + */ + private function processRuleItem(array $data, RuleElement $rule): bool|RuleError + { + if ($this->isValidRule($rule)) { + try { + $negation = $rule['matching']['negated'] ?? false; + $matching = $rule['matching']['match_type']; + if (in_array($matching, $this->getComparisonProcessorMethods(), true)) { + if ($this->isUsingCustomInterface($data)) { + if (isset($rule['rule_type'])) { + $this->logManager?->info( + 'RuleManager.processRuleItem()', + str_replace('#', $rule['rule_type'], Messages::RULE_MATCH_START) + ); + foreach (get_class_methods($data) as $method) { + if ($method === '__construct') { + continue; + } + $ruleMethod = StringUtils::camelCase('get ' . str_replace('_', ' ', $rule['rule_type'])); + if ($method === $ruleMethod || ($data['mapper'] ?? null) === $ruleMethod) { + $dataValue = $data[$method]($rule); + $ruleErrorEnum = RuleError::tryFrom($dataValue); + if ($ruleErrorEnum !== null) { + return $ruleErrorEnum; + } + if ($rule['rule_type'] === 'js_condition') { + return $dataValue; + } + if (is_string($this->comparisonProcessor)) { + return call_user_func( + [$this->comparisonProcessor, $matching], + $dataValue, + $rule['value'], + $negation + ); + } else { + return $this->comparisonProcessor[$matching]( + $dataValue, + $rule['value'], + $negation + ); + } + } + } + } + } elseif (ObjectUtils::objectNotEmpty($data)) { + foreach ($data as $key => $value) { + $k = $this->keysCaseSensitive ? $key : strtolower($key); + $ruleK = $this->keysCaseSensitive ? $rule['key'] : strtolower($rule['key']); + if ($k === $ruleK) { + if (is_string($this->comparisonProcessor)) { + return call_user_func( + [$this->comparisonProcessor, $matching], + $value, + $rule['value'], + $negation + ); + } else { + return $this->comparisonProcessor[$matching]( + $value, + $rule['value'], + $negation + ); + } + } + } + } else { + $this->logManager?->trace('RuleManager.processRuleItem()', LogUtils::toLoggable([ + 'warn' => ErrorMessages::RULE_DATA_NOT_VALID, + 'data' => $data, + ])); + } + } else { + $this->logManager?->warn( + 'RuleManager.processRuleItem()', + str_replace('#', $matching, ErrorMessages::RULE_MATCH_TYPE_NOT_SUPPORTED) + ); + } + } catch (\Throwable $error) { + $this->logManager?->error('RuleManager.processRuleItem()', [ + 'error' => $error->getMessage(), + ]); + } + } else { + $this->logManager?->warn('RuleManager.processRuleItem()', ErrorMessages::RULE_NOT_VALID); + } + return false; + } + + /** + * Check if rule data object uses the custom RuleData interface. + * + * @param array $data Data set to check + * @return bool True if data implements the custom RuleData interface pattern + */ + private function isUsingCustomInterface(array $data): bool + { + return ObjectUtils::objectNotEmpty($data) && + isset($data['name']) && + $data['name'] === 'RuleData'; + } +} diff --git a/packages/Rules/tests/RuleManagerLogSerializationTest.php b/packages/Rules/tests/RuleManagerLogSerializationTest.php new file mode 100644 index 0000000..0e1ae63 --- /dev/null +++ b/packages/Rules/tests/RuleManagerLogSerializationTest.php @@ -0,0 +1,149 @@ +makeCapturingLogger(); + $logManager = new LogManager($captured['logger'], LogLevel::Trace); + + $ruleManager = new RuleManager(logManager: $logManager); + + $ruleSet = new RuleObject([ + 'OR' => [[ + 'AND' => [[ + 'OR_WHEN' => [[ + 'rule_type' => 'generic_text_key_value', + 'matching' => ['match_type' => 'matches', 'negated' => false], + 'value' => 'events', + 'key' => 'location', + ]], + ]], + ]], + ]); + + $ruleManager->isRuleMatched(['location' => 'events'], $ruleSet, 'events-location'); + + $allMessages = array_column($captured['messages'], 'message'); + $joined = implode("\n", $allMessages); + + $this->assertStringNotContainsString( + 'log serialization error', + $joined, + 'Expected no "log serialization error" in captured logs. Full capture: ' . $joined, + ); + + $traceMessages = array_filter($allMessages, fn ($m) => str_contains($m, 'RuleManager.isRuleMatched()')); + $this->assertNotEmpty($traceMessages, 'Expected at least one trace log from RuleManager.isRuleMatched()'); + + $traceBlob = implode("\n", $traceMessages); + $this->assertStringContainsString( + 'generic_text_key_value', + $traceBlob, + 'Expected the captured trace to contain the real rule_type payload. Blob: ' . $traceBlob, + ); + + // Pin LogManager's current behaviour: it concatenates all args into the message + // and passes an empty PSR-3 context. If this ever changes to structured context, + // this assertion will flag it so the data-presence assertion above can be moved + // to the right place. + foreach ($captured['messages'] as $entry) { + $this->assertSame( + [], + $entry['context'], + 'LogManager currently passes [] as PSR-3 context; if this changes, rework the assertions on $traceBlob.', + ); + } + } + + /** + * @return array{logger: LoggerInterface, messages: array}>} + */ + private function makeCapturingLogger(): array + { + $messages = []; + $logger = new class ($messages) implements LoggerInterface { + /** + * @param array}> $messages + */ + public function __construct(private array &$messages) + { + } + + public function emergency(string|Stringable $message, array $context = []): void + { + $this->capture('emergency', $message, $context); + } + + public function alert(string|Stringable $message, array $context = []): void + { + $this->capture('alert', $message, $context); + } + + public function critical(string|Stringable $message, array $context = []): void + { + $this->capture('critical', $message, $context); + } + + public function error(string|Stringable $message, array $context = []): void + { + $this->capture('error', $message, $context); + } + + public function warning(string|Stringable $message, array $context = []): void + { + $this->capture('warning', $message, $context); + } + + public function notice(string|Stringable $message, array $context = []): void + { + $this->capture('notice', $message, $context); + } + + public function info(string|Stringable $message, array $context = []): void + { + $this->capture('info', $message, $context); + } + + public function debug(string|Stringable $message, array $context = []): void + { + $this->capture('debug', $message, $context); + } + + public function log($level, string|Stringable $message, array $context = []): void + { + $this->capture((string)$level, $message, $context); + } + + /** + * @param array $context + */ + private function capture(string $level, string|Stringable $message, array $context): void + { + $this->messages[] = ['level' => $level, 'message' => (string)$message, 'context' => $context]; + } + }; + + return ['logger' => $logger, 'messages' => &$messages]; + } +} diff --git a/packages/Rules/tests/RuleManagerTest.php b/packages/Rules/tests/RuleManagerTest.php new file mode 100644 index 0000000..7f6d748 --- /dev/null +++ b/packages/Rules/tests/RuleManagerTest.php @@ -0,0 +1,615 @@ +ruleManager = new RuleManager(); + } + + // ----- Class structure tests ----- + + public function testShouldExposeRuleManager(): void + { + $this->assertTrue(class_exists(RuleManager::class)); + } + + public function testImportedEntityShouldBeConstructorOfRuleManagerInstance(): void + { + $rm = new RuleManager(); + $reflection = new \ReflectionClass($rm); + $this->assertEquals('RuleManager', $reflection->getShortName()); + } + + public function testRuleManagerIsFinal(): void + { + $reflection = new \ReflectionClass(RuleManager::class); + $this->assertTrue($reflection->isFinal(), 'RuleManager must be a final class'); + } + + // ----- Tests for RuleManager with custom comparison processor ----- + + public function testRuleManagerWithCustomComparisonProcessor_InstanceCreation(): void + { + $customComparisonProcessor = [ + 'isTypeOf' => function ($value, $testAgainst, $negation = false) { + $actualType = gettype($value); + if ($actualType === 'integer' || $actualType === 'double') { + $actualType = 'number'; + } + if ($negation) { + return $actualType !== $testAgainst; + } + return $actualType === $testAgainst; + }, + ]; + + $rm = new RuleManager( + comparisonProcessor: $customComparisonProcessor, + keysCaseSensitive: false, + ); + $reflection = new \ReflectionClass($rm); + $this->assertEquals('RuleManager', $reflection->getShortName()); + } + + public function testCustomComparisonProcessorIsUsed(): void + { + $this->assertIsArray($this->ruleManager->getComparisonProcessor()); + } + + public function testGetComparisonProcessorMethodsWithCustomProcessor(): void + { + $customComparisonProcessor = [ + 'isTypeOf' => function ($value, $testAgainst, $negation = false) { + $actualType = gettype($value); + if ($actualType === 'integer' || $actualType === 'double') { + $actualType = 'number'; + } + if ($negation) { + return $actualType !== $testAgainst; + } + return $actualType === $testAgainst; + }, + ]; + + $rm = new RuleManager( + comparisonProcessor: $customComparisonProcessor, + keysCaseSensitive: false, + ); + + $methods = $rm->getComparisonProcessorMethods(); + $expected = array_filter(array_keys($customComparisonProcessor), function ($name) use ($customComparisonProcessor) { + return is_callable($customComparisonProcessor[$name]); + }); + sort($methods); + sort($expected); + $this->assertEquals($expected, $methods); + } + + public function testIsRuleMatchedWithCustomComparisonProcessor(): void + { + $customComparisonProcessor = [ + 'isTypeOf' => function ($value, $testAgainst, $negation = false) { + $actualType = gettype($value); + if ($actualType === 'integer' || $actualType === 'double') { + $actualType = 'number'; + } + if ($negation) { + return $actualType !== $testAgainst; + } + return $actualType === $testAgainst; + }, + ]; + + $rm = new RuleManager( + comparisonProcessor: $customComparisonProcessor, + keysCaseSensitive: false, + ); + + $testRuleSet1 = [ + 'OR' => [ + [ + 'AND' => [ + [ + 'OR_WHEN' => [ + [ + 'key' => 'sum', + 'matching' => [ + 'match_type' => 'isTypeOf', + 'negated' => false, + ], + 'value' => 'number', + ], + ], + ], + ], + ], + ], + ]; + $testRuleSet2 = [ + 'OR' => [ + [ + 'AND' => [ + [ + 'OR_WHEN' => [ + [ + 'key' => 'sum', + 'matching' => [ + 'match_type' => 'isTypeOf', + 'negated' => true, + ], + 'value' => 'number', + ], + ], + ], + ], + ], + ], + ]; + $testRuleSet3 = [ + 'OR' => [ + [ + 'AND' => [ + [ + 'OR_WHEN' => [ + [ + 'key' => 'SUM', + 'matching' => [ + 'match_type' => 'isTypeOf', + 'negated' => false, + ], + 'value' => 'number', + ], + ], + ], + ], + ], + ], + ]; + $data1 = ['sum' => 'not a number']; + $data2 = ['sum' => 44]; + + $this->assertFalse($rm->isRuleMatched($data1, new RuleObject($testRuleSet1)), 'Expected false for data1 against testRuleSet1'); + $this->assertTrue($rm->isRuleMatched($data2, new RuleObject($testRuleSet1)), 'Expected true for data2 against testRuleSet1'); + $this->assertTrue($rm->isRuleMatched($data1, new RuleObject($testRuleSet2)), 'Expected true for data1 against testRuleSet2 with negation'); + $this->assertFalse($rm->isRuleMatched($data2, new RuleObject($testRuleSet2)), 'Expected false for data2 against testRuleSet2 with negation'); + $this->assertTrue($rm->isRuleMatched($data2, new RuleObject($testRuleSet3)), 'Expected true for data2 against testRuleSet3 with case-insensitive keys'); + } + + // ----- Tests for RuleManager with default comparison processor ----- + + public function testRuleManagerWithDefaultComparisonProcessor(): void + { + $rm = new RuleManager(); + $reflection = new \ReflectionClass($rm); + $this->assertEquals('RuleManager', $reflection->getShortName()); + } + + public function testIsValidRule(): void + { + $validRule = [ + 'key' => 'device', + 'matching' => [ + 'match_type' => 'contains', + 'negated' => false, + ], + 'value' => 'phone', + ]; + $this->assertTrue($this->ruleManager->isValidRule(new RuleElement($validRule))); + + $badStructure = [ + 'matching' => 'contains', + 'data' => 'phone', + ]; + $this->assertFalse($this->ruleManager->isValidRule(new RuleElement($badStructure))); + + $missingMatching = [ + 'key' => 'device', + 'value' => 'phone', + ]; + $this->assertFalse($this->ruleManager->isValidRule(new RuleElement($missingMatching))); + + $missingValue = [ + 'key' => 'device', + 'matching' => [ + 'match_type' => 'contains', + 'negated' => false, + ], + ]; + $this->assertFalse($this->ruleManager->isValidRule(new RuleElement($missingValue))); + } + + public function testRuleManagerWithDefaultComparisonProcessorIsRuleMatched(): void + { + $rm = new RuleManager(); + + $testRuleSet1 = [ + 'OR' => [ + [ + 'AND' => [ + [ + 'OR_WHEN' => [ + [ + 'key' => 'device', + 'matching' => [ + 'match_type' => 'equals', + 'negated' => false, + ], + 'value' => 'pc', + ], + [ + 'key' => 'price', + 'matching' => [ + 'match_type' => 'less', + 'negated' => false, + ], + 'value' => 100, + ], + ], + ], + ], + ], + ], + ]; + + $testRuleSet2 = [ + 'OR' => [ + [ + 'AND' => [ + [ + 'OR_WHEN' => [ + [ + 'key' => 'device', + 'matching' => [ + 'match_type' => 'equals', + 'negated' => true, + ], + 'value' => 'pc', + ], + [ + 'key' => 'device', + 'matching' => [ + 'match_type' => 'isIn', + 'negated' => false, + ], + 'value' => 'phone|tablet', + ], + ], + ], + ], + ], + ], + ]; + + $testRuleSet3 = [ + 'OR' => [ + [ + 'AND' => [ + [ + 'OR_WHEN' => [ + [ + 'key' => 'device', + 'matching' => [ + 'match_type' => 'isIn', + 'negated' => false, + ], + 'value' => 'phone|tablet', + ], + ], + ], + ], + ], + [ + 'AND' => [ + [ + 'OR_WHEN' => [ + [ + 'key' => 'age', + 'matching' => [ + 'match_type' => 'less', + 'negated' => true, + ], + 'value' => 30, + ], + ], + ], + ], + ], + ], + ]; + + $data1 = ['device' => 'pc', 'browser' => 'Mozilla', 'price' => 3]; + $data12 = ['device' => 'tablet', 'browser' => 'Mozilla', 'price' => 3]; + $data13 = ['DEVICE' => 'tablet', 'BROWSER' => 'Mozilla', 'PRICE' => 3]; + $data2 = ['browser' => 'Chrome']; + $data21 = 'phone'; + $data22 = ['device' => 'phone']; + $data31 = ['device' => 'tablet', 'browser' => 'Mozilla', 'age' => 10]; + $data32 = ['device' => 'pc', 'browser' => 'Chrome', 'age' => 31]; + $this->assertTrue($rm->isRuleMatched($data1, new RuleObject($testRuleSet1))); + $this->assertFalse($rm->isRuleMatched($data13, new RuleObject($testRuleSet1))); // case sensitive + $this->assertFalse($rm->isRuleMatched($data1, new RuleObject($testRuleSet2))); + $this->assertTrue($rm->isRuleMatched($data22, new RuleObject($testRuleSet2))); + $this->assertFalse($rm->isRuleMatched($data2, new RuleObject([['device' => 'pc']]))); + $this->assertFalse($rm->isRuleMatched($data2, new RuleObject([[['device' => 'pc']]]))); + $this->assertFalse($rm->isRuleMatched($data2, new RuleObject(['OR' => [[['device' => 'pc']]]]))); + $this->assertFalse($rm->isRuleMatched([], new RuleObject([]))); + $this->assertTrue($rm->isRuleMatched($data31, new RuleObject($testRuleSet3))); + $this->assertTrue($rm->isRuleMatched($data32, new RuleObject($testRuleSet3))); + } + + public function testAllowChangeComparisonProcessorOnFly(): void + { + $customComparisonProcessor = [ + 'isTypeOf' => function ($value, $testAgainst, $negation = false) { + if ($negation) { + return gettype($value) !== $testAgainst; + } + return gettype($value) === $testAgainst; + }, + ]; + $this->ruleManager->setComparisonProcessor($customComparisonProcessor); + $methods = $this->ruleManager->getComparisonProcessorMethods(); + $expected = array_filter(array_keys($customComparisonProcessor), function ($name) use ($customComparisonProcessor) { + return is_callable($customComparisonProcessor[$name]); + }); + sort($methods); + sort($expected); + $this->assertEquals($expected, $methods); + } + + // ----- New operator-specific tests (Task 5) ----- + + public function testEqualsOperator(): void + { + $rm = new RuleManager(); + $ruleSet = $this->buildSimpleRuleSet('country', 'equals', false, 'US'); + + // String match + $this->assertTrue($rm->isRuleMatched(['country' => 'US'], new RuleObject($ruleSet))); + // Case-insensitive + $this->assertTrue($rm->isRuleMatched(['country' => 'us'], new RuleObject($ruleSet))); + // No match + $this->assertFalse($rm->isRuleMatched(['country' => 'GB'], new RuleObject($ruleSet))); + } + + public function testRegexMatchesOperator(): void + { + $rm = new RuleManager(); + $ruleSet = $this->buildSimpleRuleSet('username', 'regexMatches', false, '^user-[0-9]+$'); + + $this->assertTrue($rm->isRuleMatched(['username' => 'user-42'], new RuleObject($ruleSet))); + $this->assertTrue($rm->isRuleMatched(['username' => 'USER-42'], new RuleObject($ruleSet))); // case-insensitive + $this->assertFalse($rm->isRuleMatched(['username' => 'admin-42'], new RuleObject($ruleSet))); + } + + public function testAndGroupRequiresAll(): void + { + $rm = new RuleManager(); + + // 3 AND conditions: country=US AND browser=chrome AND device=desktop + $ruleSet = [ + 'OR' => [ + [ + 'AND' => [ + [ + 'OR_WHEN' => [['key' => 'country', 'matching' => ['match_type' => 'equals', 'negated' => false], 'value' => 'US']], + ], + [ + 'OR_WHEN' => [['key' => 'browser', 'matching' => ['match_type' => 'equals', 'negated' => false], 'value' => 'chrome']], + ], + [ + 'OR_WHEN' => [['key' => 'device', 'matching' => ['match_type' => 'equals', 'negated' => false], 'value' => 'desktop']], + ], + ], + ], + ], + ]; + + // Only 2 of 3 match + $this->assertFalse($rm->isRuleMatched( + ['country' => 'US', 'browser' => 'chrome', 'device' => 'mobile'], + new RuleObject($ruleSet) + )); + + // All 3 match + $this->assertTrue($rm->isRuleMatched( + ['country' => 'US', 'browser' => 'chrome', 'device' => 'desktop'], + new RuleObject($ruleSet) + )); + } + + public function testOrGroupRequiresAny(): void + { + $rm = new RuleManager(); + + // 3 OR blocks at top level + $ruleSet = [ + 'OR' => [ + ['AND' => [['OR_WHEN' => [['key' => 'country', 'matching' => ['match_type' => 'equals', 'negated' => false], 'value' => 'GB']]]]], + ['AND' => [['OR_WHEN' => [['key' => 'country', 'matching' => ['match_type' => 'equals', 'negated' => false], 'value' => 'US']]]]], + ['AND' => [['OR_WHEN' => [['key' => 'country', 'matching' => ['match_type' => 'equals', 'negated' => false], 'value' => 'DE']]]]], + ], + ]; + + // Only second matches + $this->assertTrue($rm->isRuleMatched(['country' => 'US'], new RuleObject($ruleSet))); + + // None match + $this->assertFalse($rm->isRuleMatched(['country' => 'FR'], new RuleObject($ruleSet))); + } + + public function testOrWhenGroupReturnsFirstMatch(): void + { + $rm = new RuleManager(); + + // OR_WHEN with 3 items: phone, tablet, desktop + $ruleSet = [ + 'OR' => [ + [ + 'AND' => [ + [ + 'OR_WHEN' => [ + ['key' => 'device', 'matching' => ['match_type' => 'equals', 'negated' => false], 'value' => 'phone'], + ['key' => 'device', 'matching' => ['match_type' => 'equals', 'negated' => false], 'value' => 'tablet'], + ['key' => 'device', 'matching' => ['match_type' => 'equals', 'negated' => false], 'value' => 'desktop'], + ], + ], + ], + ], + ], + ]; + + // First item matches + $this->assertTrue($rm->isRuleMatched(['device' => 'phone'], new RuleObject($ruleSet))); + // Second item matches + $this->assertTrue($rm->isRuleMatched(['device' => 'tablet'], new RuleObject($ruleSet))); + // Third item matches + $this->assertTrue($rm->isRuleMatched(['device' => 'desktop'], new RuleObject($ruleSet))); + // None match + $this->assertFalse($rm->isRuleMatched(['device' => 'watch'], new RuleObject($ruleSet))); + } + + public function testNegationInvertsAllOperators(): void + { + $rm = new RuleManager(); + + // Negated equals + $ruleSet = $this->buildSimpleRuleSet('country', 'equals', true, 'US'); + $this->assertTrue($rm->isRuleMatched(['country' => 'GB'], new RuleObject($ruleSet))); + $this->assertFalse($rm->isRuleMatched(['country' => 'US'], new RuleObject($ruleSet))); + + // Negated contains + $ruleSet = $this->buildSimpleRuleSet('url', 'contains', true, 'test'); + $this->assertTrue($rm->isRuleMatched(['url' => 'production.com'], new RuleObject($ruleSet))); + $this->assertFalse($rm->isRuleMatched(['url' => 'test.com'], new RuleObject($ruleSet))); + + // Negated regexMatches + $ruleSet = $this->buildSimpleRuleSet('code', 'regexMatches', true, '\\d+'); + $this->assertTrue($rm->isRuleMatched(['code' => 'abc'], new RuleObject($ruleSet))); + $this->assertFalse($rm->isRuleMatched(['code' => '123'], new RuleObject($ruleSet))); + + // Negated isIn + $ruleSet = $this->buildSimpleRuleSet('device', 'isIn', true, 'phone|tablet'); + $this->assertTrue($rm->isRuleMatched(['device' => 'desktop'], new RuleObject($ruleSet))); + $this->assertFalse($rm->isRuleMatched(['device' => 'phone'], new RuleObject($ruleSet))); + } + + public function testMissingKeyReturnsFalse(): void + { + $rm = new RuleManager(); + $ruleSet = $this->buildSimpleRuleSet('country', 'equals', false, 'US'); + + // Key 'country' not in data — should return false (no match found) + $result = $rm->isRuleMatched(['browser' => 'chrome'], new RuleObject($ruleSet)); + $this->assertFalse($result); + } + + public function testStartsWithOperator(): void + { + $rm = new RuleManager(); + $ruleSet = $this->buildSimpleRuleSet('url', 'startsWith', false, 'https://'); + + $this->assertTrue($rm->isRuleMatched(['url' => 'https://convert.com'], new RuleObject($ruleSet))); + $this->assertFalse($rm->isRuleMatched(['url' => 'http://convert.com'], new RuleObject($ruleSet))); + // Case-insensitive + $this->assertTrue($rm->isRuleMatched(['url' => 'HTTPS://convert.com'], new RuleObject($ruleSet))); + } + + public function testEndsWithOperator(): void + { + $rm = new RuleManager(); + $ruleSet = $this->buildSimpleRuleSet('email', 'endsWith', false, '@convert.com'); + + $this->assertTrue($rm->isRuleMatched(['email' => 'user@convert.com'], new RuleObject($ruleSet))); + $this->assertFalse($rm->isRuleMatched(['email' => 'user@other.com'], new RuleObject($ruleSet))); + // Case-insensitive + $this->assertTrue($rm->isRuleMatched(['email' => 'user@CONVERT.COM'], new RuleObject($ruleSet))); + } + + public function testLessAndLessEqualWithTypeMismatch(): void + { + $rm = new RuleManager(); + + // less with type mismatch (string vs int) — returns false + $ruleSet = $this->buildSimpleRuleSet('age', 'less', false, 30); + $this->assertFalse($rm->isRuleMatched(['age' => 'young'], new RuleObject($ruleSet))); + + // lessEqual with type mismatch + $ruleSet = $this->buildSimpleRuleSet('age', 'lessEqual', false, 30); + $this->assertFalse($rm->isRuleMatched(['age' => 'young'], new RuleObject($ruleSet))); + + // Same types work + $ruleSet = $this->buildSimpleRuleSet('age', 'less', false, 30); + $this->assertTrue($rm->isRuleMatched(['age' => 25], new RuleObject($ruleSet))); + $this->assertFalse($rm->isRuleMatched(['age' => 30], new RuleObject($ruleSet))); + + $ruleSet = $this->buildSimpleRuleSet('age', 'lessEqual', false, 30); + $this->assertTrue($rm->isRuleMatched(['age' => 30], new RuleObject($ruleSet))); + $this->assertFalse($rm->isRuleMatched(['age' => 31], new RuleObject($ruleSet))); + } + + public function testContainsWithEmptyString(): void + { + $rm = new RuleManager(); + + // Empty testAgainst always matches (JS parity) + $ruleSet = $this->buildSimpleRuleSet('url', 'contains', false, ''); + $this->assertTrue($rm->isRuleMatched(['url' => 'anything'], new RuleObject($ruleSet))); + $this->assertTrue($rm->isRuleMatched(['url' => ''], new RuleObject($ruleSet))); + } + + public function testIsInWithPipeDelimitedValues(): void + { + $rm = new RuleManager(); + + // Single value in pipe-delimited set + $ruleSet = $this->buildSimpleRuleSet('device', 'isIn', false, 'phone|tablet'); + $this->assertTrue($rm->isRuleMatched(['device' => 'phone'], new RuleObject($ruleSet))); + $this->assertTrue($rm->isRuleMatched(['device' => 'tablet'], new RuleObject($ruleSet))); + $this->assertFalse($rm->isRuleMatched(['device' => 'desktop'], new RuleObject($ruleSet))); + + // Case-insensitive + $this->assertTrue($rm->isRuleMatched(['device' => 'PHONE'], new RuleObject($ruleSet))); + } + + // ----- Helper methods ----- + + /** + * Build a simple rule set with a single OR → AND → OR_WHEN → RuleElement structure. + */ + private function buildSimpleRuleSet(string $key, string $matchType, bool $negated, mixed $value): array + { + return [ + 'OR' => [ + [ + 'AND' => [ + [ + 'OR_WHEN' => [ + [ + 'key' => $key, + 'matching' => [ + 'match_type' => $matchType, + 'negated' => $negated, + ], + 'value' => $value, + ], + ], + ], + ], + ], + ], + ]; + } +} diff --git a/packages/Rules/tests/test-config.json b/packages/Rules/tests/test-config.json new file mode 100644 index 0000000..542987e --- /dev/null +++ b/packages/Rules/tests/test-config.json @@ -0,0 +1,555 @@ +{ + "environment": "staging", + "data": { + "account_id": "10022898", + "audiences": [ + { + "id": "100299433", + "name": "Adv Audience", + "type": "transient", + "status": "active", + "key": "adv-audience", + "preset": false, + "rules": { + "OR": [ + { + "AND": [ + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "matches", + "negated": false + }, + "value": "value1", + "key": "varName1" + } + ] + }, + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "matches", + "negated": false + }, + "value": "value2", + "key": "varName2" + } + ] + } + ] + }, + { + "AND": [ + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "matches", + "negated": false + }, + "value": "something", + "key": "varName3" + } + ] + } + ] + } + ] + } + } + ], + "segments": [ + { + "id": "200299434", + "name": "Test Segments", + "status": "active", + "key": "test-segments-1", + "preset": false, + "rules": { + "OR": [ + { + "AND": [ + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "matches", + "negated": false + }, + "key": "enabled", + "value": true + } + ] + } + ] + } + ] + } + } + ], + "experiences": [ + { + "id": "100218245", + "name": "Test Experience AB Fullstack", + "key": "test-experience-ab-fullstack-2", + "type": "a/b_fullstack", + "version": 6, + "status": "active", + "global_js": "var s = 'test_experience'; console.log(s);", + "global_css": ".test-style { display: initial; }", + "url": "https://convert.com", + "integrations": [], + "environments": ["live", "staging"], + "site_area": { + "OR": [ + { + "AND": [ + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "matches", + "negated": false + }, + "key": "url", + "value": "https://convert.com/" + } + ] + } + ] + } + ] + }, + "audiences": ["100299433"], + "goals": ["100215959", "100215960", "100215961"], + "variations": [ + { + "id": "100299456", + "name": "Original Page", + "status": "running", + "is_baseline": true, + "changes": [ + { + "id": "100240519", + "type": "fullStackFeature", + "data": { + "feature_id": "10024", + "variables_data": { + "enabled": "true", + "caption": "Click that" + } + } + }, + { + "id": "100240521", + "type": "fullStackFeature", + "data": { + "feature_id": "10025", + "variables_data": { + "price": 100, + "button-height": 40, + "additionalData": "{\"foo\":\"bar\",\"v\":2}" + } + } + } + ], + "key": "100299456-original-page", + "traffic_allocation": 50.0 + }, + { + "id": "100299457", + "name": "Variation 1", + "status": "running", + "is_baseline": false, + "changes": [ + { + "id": "100240520", + "type": "fullStackFeature", + "data": { + "feature_id": "10024", + "variables_data": { + "enabled": "false", + "caption": "Not allowed" + } + } + } + ], + "key": "100299457-variation-1", + "traffic_allocation": 50.0 + } + ] + }, + { + "id": "100218246", + "name": "Test Experience AB Fullstack", + "key": "test-experience-ab-fullstack-3", + "type": "a/b_fullstack", + "version": 6, + "status": "active", + "global_js": "var s = 'test_experience'; console.log(s);", + "global_css": ".test-style { display: initial; }", + "url": "https://convert.com", + "integrations": [], + "environments": ["live", "staging"], + "site_area": { + "OR": [ + { + "AND": [ + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "matches", + "negated": false + }, + "key": "url", + "value": "https://convert.com/" + } + ] + } + ] + } + ] + }, + "audiences": ["100299433"], + "goals": ["100215959", "100215960", "100215961"], + "variations": [ + { + "id": "100299460", + "name": "Original Page", + "status": "running", + "is_baseline": true, + "changes": [ + { + "id": "100240529", + "type": "fullStackFeature", + "data": { + "feature_id": "10024", + "variables_data": { + "enabled": "true", + "caption": "Click that" + } + } + } + ], + "key": "100299460-original-page", + "traffic_allocation": 50.0 + }, + { + "id": "100299461", + "name": "Variation 1", + "status": "running", + "is_baseline": false, + "changes": [ + { + "id": "100240532", + "type": "fullStackFeature", + "data": { + "feature_id": "10024", + "variables_data": { + "enabled": "true", + "caption": "Allowed" + } + } + } + ], + "key": "100299461-variation-1", + "traffic_allocation": 50.0 + } + ] + }, + { + "id": "100218247", + "name": "Test Experience AB Fullstack", + "key": "test-experience-ab-fullstack-4", + "type": "a/b_fullstack", + "version": 6, + "status": "active", + "global_js": "var s = 'test_experience'; console.log(s);", + "global_css": ".test-style { display: initial; }", + "url": "https://convert.com", + "integrations": [], + "environments": ["live", "staging"], + "site_area": { + "OR": [ + { + "AND": [ + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "matches", + "negated": false + }, + "key": "url", + "value": "https://convert.com/" + } + ] + } + ] + } + ] + }, + "audiences": ["100299433"], + "goals": ["100215959", "100215960", "100215961"], + "variations": [{}] + } + ], + "features": [ + { + "id": "10024", + "name": "Feature 1", + "key": "feature-1", + "variables": [ + { + "key": "enabled", + "type": "boolean" + }, + { + "key": "caption", + "type": "string" + } + ] + }, + { + "id": "10025", + "name": "Feature 2", + "key": "feature-2", + "variables": [ + { + "key": "price", + "type": "float" + }, + { + "key": "button-height", + "type": "integer" + }, + { + "key": "additionalData", + "type": "json" + } + ] + }, + { + "id": "10026", + "name": "Not Attached Feature 3", + "key": "not-attached-feature-3", + "variables": [ + { + "key": "fee", + "type": "float" + }, + { + "key": "link", + "type": "string" + }, + { + "key": "additionalData", + "type": "json" + } + ] + } + ], + "goals": [ + { + "id": "100215960", + "name": "Increase Engagement", + "selected_default": true, + "status": "active", + "type": "dom_interaction", + "is_system": true, + "key": "increase-engagement", + "settings": { + "tracked_items": [ + { + "event": "click", + "selector": "a" + }, + { + "event": "submit", + "selector": "form" + } + ] + }, + "rules": { + "OR": [ + { + "AND": [ + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "matches", + "negated": false + }, + "key": "action", + "value": "buy" + }, + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "matches", + "negated": false + }, + "key": "action", + "value": "signup" + } + ] + } + ] + } + ] + } + }, + { + "id": "100215959", + "name": "Decrease BounceRate", + "selected_default": true, + "status": "active", + "type": "advanced", + "is_system": true, + "key": "decrease-bounce-rate", + "rules": { + "OR": [ + { + "AND": [ + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "lessEqual", + "negated": true + }, + "value": 1, + "key": "pages_visited_count" + }, + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "lessEqual", + "negated": true + }, + "value": 10, + "key": "visit_duration" + } + ] + } + ] + } + ] + } + }, + { + "id": "100215961", + "name": "adv goal country browser", + "selected_default": false, + "status": "active", + "type": "advanced", + "is_system": false, + "key": "adv-goal-country-browser", + "rules": { + "OR": [ + { + "AND": [ + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "equals", + "negated": false + }, + "value": "US", + "key": "country" + } + ] + }, + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "equals", + "negated": false + }, + "value": "chrome", + "key": "browser_name" + } + ] + } + ] + }, + { + "AND": [ + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "equals", + "negated": false + }, + "value": "GB", + "key": "country" + } + ] + }, + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "equals", + "negated": false + }, + "value": "safari", + "key": "browser_name" + } + ] + } + ] + } + ] + } + }, + { + "id": "100215962", + "key": "goal-without-rule" + } + ], + "project": { + "id": "10025986", + "name": "Test Project", + "type": "fullstack", + "utc_offset": 0, + "domains": [ + { + "id": "10029181", + "hosts": "https://convert.com/", + "tld": false + } + ], + "settings": { + "auto_link": false, + "data_anonymization": false, + "do_not_track": "OFF", + "include_jquery": false + }, + "environments": { + "live": "Live", + "staging": "Staging" + } + } + } +} diff --git a/packages/Segments/composer.json b/packages/Segments/composer.json new file mode 100644 index 0000000..c72e925 --- /dev/null +++ b/packages/Segments/composer.json @@ -0,0 +1,83 @@ +{ + "name": "convertcom/php-sdk-segments", + "description": "Segments management module for the Convert PHP SDK", + "type": "library", + "license": "Apache-2.0", + "authors": [ + { + "name": "Convert Insights, Inc", + "email": "support@convert.com" + } + ], + "repositories": { + "Logger": { + "type": "path", + "url": "../Logger" + }, + "Rules": { + "type": "path", + "url": "../Rules" + }, + "Types": { + "type": "path", + "url": "../Types" + }, + "Data": { + "type": "path", + "url": "../Data" + }, + "Enums": { + "type": "path", + "url": "../Enums" + }, + "Utils": { + "type": "path", + "url": "../Utils" + }, + "Api": { + "type": "path", + "url": "../Api" + }, + "Event": { + "type": "path", + "url": "../Event" + }, + "Bucketing": { + "type": "path", + "url": "../Bucketing" + } + }, + "require": { + "php": "^8.2", + "convertcom/php-sdk-data": ">=1.0.0", + "convertcom/php-sdk-enums": ">=1.0.0", + "convertcom/php-sdk-bucketing": ">=1.0.0", + "convertcom/php-sdk-event": ">=1.0.0", + "convertcom/php-sdk-logger": ">=1.0.0", + "convertcom/php-sdk-rules": ">=1.0.0", + "convertcom/php-sdk-types": ">=1.0.0", + "convertcom/php-sdk-api": ">=1.0.0", + "convertcom/php-sdk-utils": ">=1.0.0" + }, + "require-dev": { + "phpunit/phpunit": "^11.0" + }, + "autoload": { + "psr-4": { + "ConvertSdk\\": "src/", + "ConvertSdk\\Config\\": "../Php-sdk/src/Config/" + } + }, + "autoload-dev": { + "psr-4": { + "ConvertSdk\\Tests\\": "tests/" + } + }, + "scripts": { + "test": "phpunit --configuration phpunit.xml", + "test-coverage": "phpunit --configuration phpunit.xml --coverage-text --coverage-html coverage" + }, + "version": "1.0.0", + "minimum-stability": "stable", + "prefer-stable": true +} diff --git a/packages/Segments/phpunit.xml b/packages/Segments/phpunit.xml new file mode 100644 index 0000000..1e5ea93 --- /dev/null +++ b/packages/Segments/phpunit.xml @@ -0,0 +1,24 @@ + + + + + ./tests + + + + + + + + + + src + + + diff --git a/packages/Segments/src/Interfaces/SegmentsManagerInterface.php b/packages/Segments/src/Interfaces/SegmentsManagerInterface.php new file mode 100644 index 0000000..c5e8433 --- /dev/null +++ b/packages/Segments/src/Interfaces/SegmentsManagerInterface.php @@ -0,0 +1,60 @@ + $segmentKeys A list of segment keys + * @param array|null $segmentRule An object of key-value pairs for segments matching + * @return mixed VisitorSegments or RuleError + */ + public function selectCustomSegments( + string $visitorId, + array $segmentKeys, + ?array $segmentRule = null + ): VisitorSegments|RuleError|null; + + /** + * Update custom segments for specific visitor by segment IDs + * + * @param string $visitorId + * @param array $segmentIds A list of segment IDs + * @param array|null $segmentRule An object of key-value pairs for segments matching + * @return VisitorSegments|RuleError|null + */ + public function selectCustomSegmentsByIds( + string $visitorId, + array $segmentIds, + ?array $segmentRule = null + ): VisitorSegments|RuleError|null; +} diff --git a/packages/Segments/src/SegmentsManager.php b/packages/Segments/src/SegmentsManager.php new file mode 100644 index 0000000..edf21a3 --- /dev/null +++ b/packages/Segments/src/SegmentsManager.php @@ -0,0 +1,178 @@ +dataManager = $dataManager; + $this->ruleManager = $ruleManager; + $this->loggerManager = $loggerManager; + $this->data = $config ? $config->getData() : null; + } + + /** + * Get segments in DataStore + * + * @param string $visitorId + * @return VisitorSegments + */ + public function getSegments(string $visitorId): VisitorSegments + { + $storeData = $this->dataManager->getData($visitorId) ?? []; + $storeData = (array)$storeData; + $segments = $this->dataManager->filterReportSegments($storeData['segments'] ?? []); + return new VisitorSegments($segments['segments'] ?? []); + } + + /** + * Update segments in DataStore + * + * @param string $visitorId + * @param VisitorSegments $segments + * @return void + */ + public function putSegments(string $visitorId, ?array $segments): void + { + $reportSegments = $this->dataManager->filterReportSegments($segments); + if ($reportSegments['segments'] ?? false) { + $this->dataManager->putData($visitorId, ['segments' => $reportSegments['segments']]); + } + } + + /** + * Set custom segments for a visitor + * + * @param string $visitorId + * @param array $segments + * @param array|null $segmentRule + * @return mixed VisitorSegments or RuleError + */ + private function setCustomSegments( + string $visitorId, + array $segments, + ?array $segmentRule = null + ): VisitorSegments|RuleError|null { + $storeData = $this->dataManager->getData($visitorId) ?? []; + $visitorSegments = $storeData['segments'] ?? []; + $customSegments = $visitorSegments['custom_segments'] ?? []; + $segmentIds = []; + $segmentsMatched = false; + + foreach ($segments as $segment) { + if ($segmentRule && !$segmentsMatched) { + $segmentsMatched = $this->ruleManager->isRuleMatched( + $segmentRule, + new RuleObject($segment['rules'] ?? []), + "ConfigSegment #{$segment['id']}" + ); + if ($segmentsMatched instanceof RuleError) { + return $segmentsMatched; + } + } + + if (!$segmentRule || $segmentsMatched) { + $segmentId = (string)$segment['id']; + if (in_array($segmentId, $customSegments, true)) { + if ($this->loggerManager !== null) { + $this->loggerManager->warn( + 'SegmentsManager.setCustomSegments()', + Messages::CUSTOM_SEGMENTS_KEY_FOUND + ); + } + } else { + $segmentIds[] = $segmentId; + } + } + } + + if (!empty($segmentIds)) { + $segmentsData = array_merge( + json_decode(json_encode($visitorSegments), true), + [SegmentsKeys::CustomSegments->value => array_merge($customSegments, $segmentIds)] + ); + $this->putSegments($visitorId, $segmentsData); + return new VisitorSegments($segmentsData); + } + + return null; + } + + /** + * Update custom segments for specific visitor by segment keys + * + * @param string $visitorId + * @param array $segmentKeys A list of segment keys + * @param array|null $segmentRule An object of key-value pairs for segments matching + * @return mixed VisitorSegments or RuleError + */ + public function selectCustomSegments( + string $visitorId, + array $segmentKeys, + ?array $segmentRule = null + ): VisitorSegments|RuleError|null { + $segments = $this->dataManager->getEntities($segmentKeys, 'segments'); + return $this->setCustomSegments($visitorId, $segments, $segmentRule); + } + + /** + * Update custom segments for specific visitor by segment IDs + * + * @param string $visitorId + * @param array $segmentIds A list of segment IDs + * @param array|null $segmentRule An object of key-value pairs for segments matching + * @return mixed VisitorSegments or RuleError + */ + public function selectCustomSegmentsByIds( + string $visitorId, + array $segmentIds, + ?array $segmentRule = null + ): VisitorSegments|RuleError|null { + $segments = $this->dataManager->getEntitiesByIds($segmentIds, 'segments'); + return $this->setCustomSegments($visitorId, $segments, $segmentRule); + } +} diff --git a/packages/Segments/tests/SegmentsManagerTest.php b/packages/Segments/tests/SegmentsManagerTest.php new file mode 100644 index 0000000..6b695b4 --- /dev/null +++ b/packages/Segments/tests/SegmentsManagerTest.php @@ -0,0 +1,184 @@ + [ + 'endpoint' => [ + 'config' => 'http://localhost:8090', + 'track' => 'http://localhost:8090', + ], + ], + 'events' => [ + 'batch_size' => 10, // Adjust as needed + 'release_interval' => 1000, // Adjust as needed + ], + ]); + self::$configuration['data'] = new ConfigResponseData(self::$configuration['data']); + if (isset(self::$configuration['sdkKey'])) { + unset(self::$configuration['sdkKey']); + } + + // Create Config object + $config = new Config(self::$configuration); + + // Initialize all manager instances with dependencies + $bucketingConfig = $config->getBucketing(); + $bucketingManager = new BucketingManager( + maxTraffic: $bucketingConfig['max_traffic'] ?? 10000, + hashSeed: $bucketingConfig['hash_seed'] ?? 9999, + ); + $ruleManager = new RuleManager(); + $eventManager = new EventManager(); + $apiManager = new ApiManager($config, $eventManager); + $loggerManager = new LogManager(); + self::$dataManager = new DataManager( + $config, + $bucketingManager, + $ruleManager, + $eventManager, + $apiManager, + $loggerManager + ); + self::$segmentsManager = new SegmentsManager($config, self::$dataManager, $ruleManager); + } + + protected function setUp(): void + { + } + + /** + * Test that the SegmentsManager class is defined. + */ + public function testClassExists(): void + { + $this->assertTrue(class_exists(SegmentsManager::class)); + } + + /** + * Test that the segmentsManager instance is of the correct class. + */ + public function testInstanceIsCorrect(): void + { + $this->assertInstanceOf(SegmentsManager::class, self::$segmentsManager); + } + + /** + * Test that a new SegmentsManager instance is successfully created. + */ + public function testCreateNewSegmentsManagerInstance(): void + { + $this->assertInstanceOf(SegmentsManager::class, self::$segmentsManager); + } + + /** + * Test that segments are successfully updated in the DataStore. + */ + public function testUpdateSegmentsInDataStore(): void + { + $segments = ['country' => 'US']; + self::$segmentsManager->putSegments($this->visitorId, $segments); + $localSegments = self::$dataManager->getData($this->visitorId); + $this->assertEquals($segments['country'], $localSegments['segments']['country'] ?? null); + } + + public function testUpdateCustomSegments(): void + { + $segments = ['country' => 'US']; + self::$segmentsManager->putSegments($this->visitorId, $segments); + + $segmentKey = 'test-segments-1'; + $segmentId = '200299434'; + $updatedSegments = self::$segmentsManager->selectCustomSegments( + $this->visitorId, + [$segmentKey], + ['enabled' => true] + ); + $this->assertInstanceOf(VisitorSegments::class, $updatedSegments); + $this->assertEquals([$segmentId], $updatedSegments->getCustomSegments()); + } + + public function testKeepCustomSegmentsIntactIfAlreadySet(): void + { + $segmentKey = 'test-segments-1'; + // First call to set the segment + self::$segmentsManager->selectCustomSegments( + $this->visitorId, + [$segmentKey], + ['enabled' => true] + ); + // Second call should return null since segment is already set + $updatedSegments = self::$segmentsManager->selectCustomSegments( + $this->visitorId, + [$segmentKey], + ['enabled' => true] + ); + $this->assertNull($updatedSegments); + } + + /** + * Test that custom segments remain intact if the segment key is not found. + */ + public function testKeepCustomSegmentsIntactIfKeyNotFound(): void + { + $segmentKey = 'test-segments-2'; + $updatedSegments = self::$segmentsManager->selectCustomSegments( + $this->visitorId, + [$segmentKey] + ); + $this->assertNull($updatedSegments); + } +} diff --git a/packages/Segments/tests/test-config.json b/packages/Segments/tests/test-config.json new file mode 100644 index 0000000..542987e --- /dev/null +++ b/packages/Segments/tests/test-config.json @@ -0,0 +1,555 @@ +{ + "environment": "staging", + "data": { + "account_id": "10022898", + "audiences": [ + { + "id": "100299433", + "name": "Adv Audience", + "type": "transient", + "status": "active", + "key": "adv-audience", + "preset": false, + "rules": { + "OR": [ + { + "AND": [ + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "matches", + "negated": false + }, + "value": "value1", + "key": "varName1" + } + ] + }, + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "matches", + "negated": false + }, + "value": "value2", + "key": "varName2" + } + ] + } + ] + }, + { + "AND": [ + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "matches", + "negated": false + }, + "value": "something", + "key": "varName3" + } + ] + } + ] + } + ] + } + } + ], + "segments": [ + { + "id": "200299434", + "name": "Test Segments", + "status": "active", + "key": "test-segments-1", + "preset": false, + "rules": { + "OR": [ + { + "AND": [ + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "matches", + "negated": false + }, + "key": "enabled", + "value": true + } + ] + } + ] + } + ] + } + } + ], + "experiences": [ + { + "id": "100218245", + "name": "Test Experience AB Fullstack", + "key": "test-experience-ab-fullstack-2", + "type": "a/b_fullstack", + "version": 6, + "status": "active", + "global_js": "var s = 'test_experience'; console.log(s);", + "global_css": ".test-style { display: initial; }", + "url": "https://convert.com", + "integrations": [], + "environments": ["live", "staging"], + "site_area": { + "OR": [ + { + "AND": [ + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "matches", + "negated": false + }, + "key": "url", + "value": "https://convert.com/" + } + ] + } + ] + } + ] + }, + "audiences": ["100299433"], + "goals": ["100215959", "100215960", "100215961"], + "variations": [ + { + "id": "100299456", + "name": "Original Page", + "status": "running", + "is_baseline": true, + "changes": [ + { + "id": "100240519", + "type": "fullStackFeature", + "data": { + "feature_id": "10024", + "variables_data": { + "enabled": "true", + "caption": "Click that" + } + } + }, + { + "id": "100240521", + "type": "fullStackFeature", + "data": { + "feature_id": "10025", + "variables_data": { + "price": 100, + "button-height": 40, + "additionalData": "{\"foo\":\"bar\",\"v\":2}" + } + } + } + ], + "key": "100299456-original-page", + "traffic_allocation": 50.0 + }, + { + "id": "100299457", + "name": "Variation 1", + "status": "running", + "is_baseline": false, + "changes": [ + { + "id": "100240520", + "type": "fullStackFeature", + "data": { + "feature_id": "10024", + "variables_data": { + "enabled": "false", + "caption": "Not allowed" + } + } + } + ], + "key": "100299457-variation-1", + "traffic_allocation": 50.0 + } + ] + }, + { + "id": "100218246", + "name": "Test Experience AB Fullstack", + "key": "test-experience-ab-fullstack-3", + "type": "a/b_fullstack", + "version": 6, + "status": "active", + "global_js": "var s = 'test_experience'; console.log(s);", + "global_css": ".test-style { display: initial; }", + "url": "https://convert.com", + "integrations": [], + "environments": ["live", "staging"], + "site_area": { + "OR": [ + { + "AND": [ + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "matches", + "negated": false + }, + "key": "url", + "value": "https://convert.com/" + } + ] + } + ] + } + ] + }, + "audiences": ["100299433"], + "goals": ["100215959", "100215960", "100215961"], + "variations": [ + { + "id": "100299460", + "name": "Original Page", + "status": "running", + "is_baseline": true, + "changes": [ + { + "id": "100240529", + "type": "fullStackFeature", + "data": { + "feature_id": "10024", + "variables_data": { + "enabled": "true", + "caption": "Click that" + } + } + } + ], + "key": "100299460-original-page", + "traffic_allocation": 50.0 + }, + { + "id": "100299461", + "name": "Variation 1", + "status": "running", + "is_baseline": false, + "changes": [ + { + "id": "100240532", + "type": "fullStackFeature", + "data": { + "feature_id": "10024", + "variables_data": { + "enabled": "true", + "caption": "Allowed" + } + } + } + ], + "key": "100299461-variation-1", + "traffic_allocation": 50.0 + } + ] + }, + { + "id": "100218247", + "name": "Test Experience AB Fullstack", + "key": "test-experience-ab-fullstack-4", + "type": "a/b_fullstack", + "version": 6, + "status": "active", + "global_js": "var s = 'test_experience'; console.log(s);", + "global_css": ".test-style { display: initial; }", + "url": "https://convert.com", + "integrations": [], + "environments": ["live", "staging"], + "site_area": { + "OR": [ + { + "AND": [ + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "matches", + "negated": false + }, + "key": "url", + "value": "https://convert.com/" + } + ] + } + ] + } + ] + }, + "audiences": ["100299433"], + "goals": ["100215959", "100215960", "100215961"], + "variations": [{}] + } + ], + "features": [ + { + "id": "10024", + "name": "Feature 1", + "key": "feature-1", + "variables": [ + { + "key": "enabled", + "type": "boolean" + }, + { + "key": "caption", + "type": "string" + } + ] + }, + { + "id": "10025", + "name": "Feature 2", + "key": "feature-2", + "variables": [ + { + "key": "price", + "type": "float" + }, + { + "key": "button-height", + "type": "integer" + }, + { + "key": "additionalData", + "type": "json" + } + ] + }, + { + "id": "10026", + "name": "Not Attached Feature 3", + "key": "not-attached-feature-3", + "variables": [ + { + "key": "fee", + "type": "float" + }, + { + "key": "link", + "type": "string" + }, + { + "key": "additionalData", + "type": "json" + } + ] + } + ], + "goals": [ + { + "id": "100215960", + "name": "Increase Engagement", + "selected_default": true, + "status": "active", + "type": "dom_interaction", + "is_system": true, + "key": "increase-engagement", + "settings": { + "tracked_items": [ + { + "event": "click", + "selector": "a" + }, + { + "event": "submit", + "selector": "form" + } + ] + }, + "rules": { + "OR": [ + { + "AND": [ + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "matches", + "negated": false + }, + "key": "action", + "value": "buy" + }, + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "matches", + "negated": false + }, + "key": "action", + "value": "signup" + } + ] + } + ] + } + ] + } + }, + { + "id": "100215959", + "name": "Decrease BounceRate", + "selected_default": true, + "status": "active", + "type": "advanced", + "is_system": true, + "key": "decrease-bounce-rate", + "rules": { + "OR": [ + { + "AND": [ + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "lessEqual", + "negated": true + }, + "value": 1, + "key": "pages_visited_count" + }, + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "lessEqual", + "negated": true + }, + "value": 10, + "key": "visit_duration" + } + ] + } + ] + } + ] + } + }, + { + "id": "100215961", + "name": "adv goal country browser", + "selected_default": false, + "status": "active", + "type": "advanced", + "is_system": false, + "key": "adv-goal-country-browser", + "rules": { + "OR": [ + { + "AND": [ + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "equals", + "negated": false + }, + "value": "US", + "key": "country" + } + ] + }, + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "equals", + "negated": false + }, + "value": "chrome", + "key": "browser_name" + } + ] + } + ] + }, + { + "AND": [ + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "equals", + "negated": false + }, + "value": "GB", + "key": "country" + } + ] + }, + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { + "match_type": "equals", + "negated": false + }, + "value": "safari", + "key": "browser_name" + } + ] + } + ] + } + ] + } + }, + { + "id": "100215962", + "key": "goal-without-rule" + } + ], + "project": { + "id": "10025986", + "name": "Test Project", + "type": "fullstack", + "utc_offset": 0, + "domains": [ + { + "id": "10029181", + "hosts": "https://convert.com/", + "tld": false + } + ], + "settings": { + "auto_link": false, + "data_anonymization": false, + "do_not_track": "OFF", + "include_jquery": false + }, + "environments": { + "live": "Live", + "staging": "Staging" + } + } + } +} diff --git a/packages/Types/.gitignore b/packages/Types/.gitignore new file mode 100644 index 0000000..9f1681c --- /dev/null +++ b/packages/Types/.gitignore @@ -0,0 +1,15 @@ +# ref: https://github.com/github/gitignore/blob/master/Composer.gitignore + +composer.phar +/vendor/ + +# Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control +# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file +# composer.lock + +# php-cs-fixer cache +.php_cs.cache +.php-cs-fixer.cache + +# PHPUnit cache +.phpunit.result.cache diff --git a/packages/Types/.travis.yml b/packages/Types/.travis.yml new file mode 100644 index 0000000..667b815 --- /dev/null +++ b/packages/Types/.travis.yml @@ -0,0 +1,8 @@ +language: php +# Bionic environment has preinstalled PHP from 7.1 to 7.4 +# https://docs.travis-ci.com/user/reference/bionic/#php-support +dist: bionic +php: + - 7.4 +before_install: "composer install" +script: "vendor/bin/phpunit" diff --git a/packages/Types/README.md b/packages/Types/README.md new file mode 100644 index 0000000..319c1a5 --- /dev/null +++ b/packages/Types/README.md @@ -0,0 +1,383 @@ +# OpenAPIClient-php + +Serve and track experiences to your users using Convert APIs and tools + + + +## Installation & Usage + +### Requirements + +PHP 7.4 and later. +Should also work with PHP 8.0. + +### Composer + +To install the bindings via [Composer](https://getcomposer.org/), add the following to `composer.json`: + +```json +{ + "repositories": [ + { + "type": "vcs", + "url": "https://github.com/GIT_USER_ID/GIT_REPO_ID.git" + } + ], + "require": { + "GIT_USER_ID/GIT_REPO_ID": "*@dev" + } +} +``` + +Then run `composer install` + +### Manual Installation + +Download the files and include `autoload.php`: + +```php +sendTrackingEvents($account_id, $project_id, $send_tracking_events_request_data); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ExperiencesTrackingApi->sendTrackingEvents: ', $e->getMessage(), PHP_EOL; +} + +``` + +## API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*ExperiencesTrackingApi* | [**sendTrackingEvents**](docs/Api/ExperiencesTrackingApi.md#sendtrackingevents) | **POST** /track/{account_id}/{project_id} | Send Tracking +*ExperiencesTrackingApi* | [**sendTrackingEventsSdkKey**](docs/Api/ExperiencesTrackingApi.md#sendtrackingeventssdkkey) | **POST** /track/{sdk_key} | Sdk-Key Send Tracking +*ProjectConfigApi* | [**getProjectConfig**](docs/Api/ProjectConfigApi.md#getprojectconfig) | **GET** /config/{account_id}/{project_id} | Default Get Project Config +*ProjectConfigApi* | [**getProjectConfigBySdkKey**](docs/Api/ProjectConfigApi.md#getprojectconfigbysdkkey) | **GET** /config/{sdk_key} | Sdk-Key Get Project Config +*ProjectConfigApi* | [**getProjectSettings**](docs/Api/ProjectConfigApi.md#getprojectsettings) | **GET** /project-settings/{account_id}/{project_id} | Minimal Project Settings + +## Models + +- [Base64Image](docs/Model/Base64Image.md) +- [BaseMatch](docs/Model/BaseMatch.md) +- [BaseRule](docs/Model/BaseRule.md) +- [BaseRuleWithBooleanValue](docs/Model/BaseRuleWithBooleanValue.md) +- [BaseRuleWithBrowserNameValue](docs/Model/BaseRuleWithBrowserNameValue.md) +- [BaseRuleWithCountryCodeValue](docs/Model/BaseRuleWithCountryCodeValue.md) +- [BaseRuleWithDayOfWeekValue](docs/Model/BaseRuleWithDayOfWeekValue.md) +- [BaseRuleWithExperienceBucketedValue](docs/Model/BaseRuleWithExperienceBucketedValue.md) +- [BaseRuleWithGoalTriggeredValue](docs/Model/BaseRuleWithGoalTriggeredValue.md) +- [BaseRuleWithHourOfDayValue](docs/Model/BaseRuleWithHourOfDayValue.md) +- [BaseRuleWithJsCodeValue](docs/Model/BaseRuleWithJsCodeValue.md) +- [BaseRuleWithLanguageCodeValue](docs/Model/BaseRuleWithLanguageCodeValue.md) +- [BaseRuleWithMinuteOfHourValue](docs/Model/BaseRuleWithMinuteOfHourValue.md) +- [BaseRuleWithNumericValue](docs/Model/BaseRuleWithNumericValue.md) +- [BaseRuleWithOsValue](docs/Model/BaseRuleWithOsValue.md) +- [BaseRuleWithSegmentBucketedValue](docs/Model/BaseRuleWithSegmentBucketedValue.md) +- [BaseRuleWithStringValue](docs/Model/BaseRuleWithStringValue.md) +- [BaseRuleWithVisitorTypeValue](docs/Model/BaseRuleWithVisitorTypeValue.md) +- [BaseRuleWithWeatherConditionValue](docs/Model/BaseRuleWithWeatherConditionValue.md) +- [BoolMatchRulesTypes](docs/Model/BoolMatchRulesTypes.md) +- [BrowserNameMatchRule](docs/Model/BrowserNameMatchRule.md) +- [BrowserNameMatchRuleAllOfMatching](docs/Model/BrowserNameMatchRuleAllOfMatching.md) +- [BrowserNameMatchRulesTypes](docs/Model/BrowserNameMatchRulesTypes.md) +- [BucketingEvent](docs/Model/BucketingEvent.md) +- [BulkEntityError](docs/Model/BulkEntityError.md) +- [BulkSuccessData](docs/Model/BulkSuccessData.md) +- [ChoiceContainsOptions](docs/Model/ChoiceContainsOptions.md) +- [ChoiceMatchingOptions](docs/Model/ChoiceMatchingOptions.md) +- [ClicksElementGoal](docs/Model/ClicksElementGoal.md) +- [ClicksElementGoalSettings](docs/Model/ClicksElementGoalSettings.md) +- [ClicksLinkGoal](docs/Model/ClicksLinkGoal.md) +- [ClicksLinkGoalSettings](docs/Model/ClicksLinkGoalSettings.md) +- [ConfigAudience](docs/Model/ConfigAudience.md) +- [ConfigAudienceTypes](docs/Model/ConfigAudienceTypes.md) +- [ConfigExperience](docs/Model/ConfigExperience.md) +- [ConfigExperienceIntegrationsInner](docs/Model/ConfigExperienceIntegrationsInner.md) +- [ConfigExperienceSettings](docs/Model/ConfigExperienceSettings.md) +- [ConfigExperienceSettingsMatchingOptions](docs/Model/ConfigExperienceSettingsMatchingOptions.md) +- [ConfigExperienceSettingsOutliers](docs/Model/ConfigExperienceSettingsOutliers.md) +- [ConfigFeature](docs/Model/ConfigFeature.md) +- [ConfigGoal](docs/Model/ConfigGoal.md) +- [ConfigGoalBase](docs/Model/ConfigGoalBase.md) +- [ConfigLocation](docs/Model/ConfigLocation.md) +- [ConfigMinimalResponseData](docs/Model/ConfigMinimalResponseData.md) +- [ConfigProject](docs/Model/ConfigProject.md) +- [ConfigProjectCustomDomain](docs/Model/ConfigProjectCustomDomain.md) +- [ConfigProjectDomainsInner](docs/Model/ConfigProjectDomainsInner.md) +- [ConfigProjectEnvironmentsValue](docs/Model/ConfigProjectEnvironmentsValue.md) +- [ConfigProjectMinimalSettings](docs/Model/ConfigProjectMinimalSettings.md) +- [ConfigProjectSettings](docs/Model/ConfigProjectSettings.md) +- [ConfigProjectSettingsAllOfIntegrations](docs/Model/ConfigProjectSettingsAllOfIntegrations.md) +- [ConfigProjectSettingsAllOfIntegrationsKissmetrics](docs/Model/ConfigProjectSettingsAllOfIntegrationsKissmetrics.md) +- [ConfigResponseData](docs/Model/ConfigResponseData.md) +- [ConfigSegment](docs/Model/ConfigSegment.md) +- [ConversionEvent](docs/Model/ConversionEvent.md) +- [ConversionEventGoalDataInner](docs/Model/ConversionEventGoalDataInner.md) +- [ConversionEventGoalDataInnerValue](docs/Model/ConversionEventGoalDataInnerValue.md) +- [CookieMatchRule](docs/Model/CookieMatchRule.md) +- [CookieMatchRuleAllOfMatching](docs/Model/CookieMatchRuleAllOfMatching.md) +- [CookieMatchRulesTypes](docs/Model/CookieMatchRulesTypes.md) +- [CountryMatchRule](docs/Model/CountryMatchRule.md) +- [CountryMatchRuleAllOfMatching](docs/Model/CountryMatchRuleAllOfMatching.md) +- [CountryMatchRulesTypes](docs/Model/CountryMatchRulesTypes.md) +- [DateRange](docs/Model/DateRange.md) +- [DayOfWeekMatchRule](docs/Model/DayOfWeekMatchRule.md) +- [DayOfWeekMatchRuleAllOfMatching](docs/Model/DayOfWeekMatchRuleAllOfMatching.md) +- [DayOfWeekMatchRulesTypes](docs/Model/DayOfWeekMatchRulesTypes.md) +- [DomInteractionGoal](docs/Model/DomInteractionGoal.md) +- [DomInteractionGoalSettings](docs/Model/DomInteractionGoalSettings.md) +- [DomInteractionGoalSettingsTrackedItemsInner](docs/Model/DomInteractionGoalSettingsTrackedItemsInner.md) +- [ErrorData](docs/Model/ErrorData.md) +- [ExperienceBucketedMatchRule](docs/Model/ExperienceBucketedMatchRule.md) +- [ExperienceBucketedMatchRuleAllOfMatching](docs/Model/ExperienceBucketedMatchRuleAllOfMatching.md) +- [ExperienceChange](docs/Model/ExperienceChange.md) +- [ExperienceChangeAdd](docs/Model/ExperienceChangeAdd.md) +- [ExperienceChangeBase](docs/Model/ExperienceChangeBase.md) +- [ExperienceChangeCustomCodeData](docs/Model/ExperienceChangeCustomCodeData.md) +- [ExperienceChangeCustomCodeDataAdd](docs/Model/ExperienceChangeCustomCodeDataAdd.md) +- [ExperienceChangeCustomCodeDataBase](docs/Model/ExperienceChangeCustomCodeDataBase.md) +- [ExperienceChangeCustomCodeDataBaseAllOfData](docs/Model/ExperienceChangeCustomCodeDataBaseAllOfData.md) +- [ExperienceChangeCustomCodeDataUpdate](docs/Model/ExperienceChangeCustomCodeDataUpdate.md) +- [ExperienceChangeCustomCodeDataUpdateNoId](docs/Model/ExperienceChangeCustomCodeDataUpdateNoId.md) +- [ExperienceChangeDefaultCodeData](docs/Model/ExperienceChangeDefaultCodeData.md) +- [ExperienceChangeDefaultCodeDataAdd](docs/Model/ExperienceChangeDefaultCodeDataAdd.md) +- [ExperienceChangeDefaultCodeDataBase](docs/Model/ExperienceChangeDefaultCodeDataBase.md) +- [ExperienceChangeDefaultCodeDataBaseAllOfData](docs/Model/ExperienceChangeDefaultCodeDataBaseAllOfData.md) +- [ExperienceChangeDefaultCodeDataUpdate](docs/Model/ExperienceChangeDefaultCodeDataUpdate.md) +- [ExperienceChangeDefaultCodeDataUpdateNoId](docs/Model/ExperienceChangeDefaultCodeDataUpdateNoId.md) +- [ExperienceChangeDefaultCodeMultipageData](docs/Model/ExperienceChangeDefaultCodeMultipageData.md) +- [ExperienceChangeDefaultCodeMultipageDataAdd](docs/Model/ExperienceChangeDefaultCodeMultipageDataAdd.md) +- [ExperienceChangeDefaultCodeMultipageDataBase](docs/Model/ExperienceChangeDefaultCodeMultipageDataBase.md) +- [ExperienceChangeDefaultCodeMultipageDataBaseAllOfData](docs/Model/ExperienceChangeDefaultCodeMultipageDataBaseAllOfData.md) +- [ExperienceChangeDefaultCodeMultipageDataUpdate](docs/Model/ExperienceChangeDefaultCodeMultipageDataUpdate.md) +- [ExperienceChangeDefaultCodeMultipageDataUpdateNoId](docs/Model/ExperienceChangeDefaultCodeMultipageDataUpdateNoId.md) +- [ExperienceChangeDefaultRedirectData](docs/Model/ExperienceChangeDefaultRedirectData.md) +- [ExperienceChangeDefaultRedirectDataAdd](docs/Model/ExperienceChangeDefaultRedirectDataAdd.md) +- [ExperienceChangeDefaultRedirectDataBase](docs/Model/ExperienceChangeDefaultRedirectDataBase.md) +- [ExperienceChangeDefaultRedirectDataBaseAllOfData](docs/Model/ExperienceChangeDefaultRedirectDataBaseAllOfData.md) +- [ExperienceChangeDefaultRedirectDataUpdate](docs/Model/ExperienceChangeDefaultRedirectDataUpdate.md) +- [ExperienceChangeDefaultRedirectDataUpdateNoId](docs/Model/ExperienceChangeDefaultRedirectDataUpdateNoId.md) +- [ExperienceChangeFullStackFeature](docs/Model/ExperienceChangeFullStackFeature.md) +- [ExperienceChangeFullStackFeatureAdd](docs/Model/ExperienceChangeFullStackFeatureAdd.md) +- [ExperienceChangeFullStackFeatureBase](docs/Model/ExperienceChangeFullStackFeatureBase.md) +- [ExperienceChangeFullStackFeatureBaseAllOfData](docs/Model/ExperienceChangeFullStackFeatureBaseAllOfData.md) +- [ExperienceChangeFullStackFeatureUpdate](docs/Model/ExperienceChangeFullStackFeatureUpdate.md) +- [ExperienceChangeFullStackFeatureUpdateNoId](docs/Model/ExperienceChangeFullStackFeatureUpdateNoId.md) +- [ExperienceChangeId](docs/Model/ExperienceChangeId.md) +- [ExperienceChangeIdReadOnly](docs/Model/ExperienceChangeIdReadOnly.md) +- [ExperienceChangeRichStructureData](docs/Model/ExperienceChangeRichStructureData.md) +- [ExperienceChangeRichStructureDataAdd](docs/Model/ExperienceChangeRichStructureDataAdd.md) +- [ExperienceChangeRichStructureDataBase](docs/Model/ExperienceChangeRichStructureDataBase.md) +- [ExperienceChangeRichStructureDataBaseAllOfData](docs/Model/ExperienceChangeRichStructureDataBaseAllOfData.md) +- [ExperienceChangeRichStructureDataUpdate](docs/Model/ExperienceChangeRichStructureDataUpdate.md) +- [ExperienceChangeRichStructureDataUpdateNoId](docs/Model/ExperienceChangeRichStructureDataUpdateNoId.md) +- [ExperienceChangeUpdate](docs/Model/ExperienceChangeUpdate.md) +- [ExperienceChangeUpdateNoId](docs/Model/ExperienceChangeUpdateNoId.md) +- [ExperienceIntegrationBaidu](docs/Model/ExperienceIntegrationBaidu.md) +- [ExperienceIntegrationBase](docs/Model/ExperienceIntegrationBase.md) +- [ExperienceIntegrationClicktale](docs/Model/ExperienceIntegrationClicktale.md) +- [ExperienceIntegrationClicky](docs/Model/ExperienceIntegrationClicky.md) +- [ExperienceIntegrationCnzz](docs/Model/ExperienceIntegrationCnzz.md) +- [ExperienceIntegrationCrazyegg](docs/Model/ExperienceIntegrationCrazyegg.md) +- [ExperienceIntegrationEconda](docs/Model/ExperienceIntegrationEconda.md) +- [ExperienceIntegrationEulerian](docs/Model/ExperienceIntegrationEulerian.md) +- [ExperienceIntegrationGA3](docs/Model/ExperienceIntegrationGA3.md) +- [ExperienceIntegrationGA4](docs/Model/ExperienceIntegrationGA4.md) +- [ExperienceIntegrationGA4Base](docs/Model/ExperienceIntegrationGA4Base.md) +- [ExperienceIntegrationGAServing](docs/Model/ExperienceIntegrationGAServing.md) +- [ExperienceIntegrationGoogleAnalytics](docs/Model/ExperienceIntegrationGoogleAnalytics.md) +- [ExperienceIntegrationGosquared](docs/Model/ExperienceIntegrationGosquared.md) +- [ExperienceIntegrationHeapanalytics](docs/Model/ExperienceIntegrationHeapanalytics.md) +- [ExperienceIntegrationHotjar](docs/Model/ExperienceIntegrationHotjar.md) +- [ExperienceIntegrationMixpanel](docs/Model/ExperienceIntegrationMixpanel.md) +- [ExperienceIntegrationMouseflow](docs/Model/ExperienceIntegrationMouseflow.md) +- [ExperienceIntegrationPiwik](docs/Model/ExperienceIntegrationPiwik.md) +- [ExperienceIntegrationSegmentio](docs/Model/ExperienceIntegrationSegmentio.md) +- [ExperienceIntegrationSitecatalyst](docs/Model/ExperienceIntegrationSitecatalyst.md) +- [ExperienceIntegrationWoopra](docs/Model/ExperienceIntegrationWoopra.md) +- [ExperienceIntegrationYsance](docs/Model/ExperienceIntegrationYsance.md) +- [ExperienceStatuses](docs/Model/ExperienceStatuses.md) +- [ExperienceTypes](docs/Model/ExperienceTypes.md) +- [ExperienceVariationConfig](docs/Model/ExperienceVariationConfig.md) +- [Extra](docs/Model/Extra.md) +- [FeatureVariableItemData](docs/Model/FeatureVariableItemData.md) +- [GASettings](docs/Model/GASettings.md) +- [GASettingsBase](docs/Model/GASettingsBase.md) +- [GaGoal](docs/Model/GaGoal.md) +- [GaGoalSettings](docs/Model/GaGoalSettings.md) +- [GenericBoolKeyValueMatchRule](docs/Model/GenericBoolKeyValueMatchRule.md) +- [GenericBoolKeyValueMatchRuleAllOfMatching](docs/Model/GenericBoolKeyValueMatchRuleAllOfMatching.md) +- [GenericBoolKeyValueMatchRulesTypes](docs/Model/GenericBoolKeyValueMatchRulesTypes.md) +- [GenericBoolMatchRule](docs/Model/GenericBoolMatchRule.md) +- [GenericBoolMatchRuleAllOfMatching](docs/Model/GenericBoolMatchRuleAllOfMatching.md) +- [GenericKey](docs/Model/GenericKey.md) +- [GenericListMatchingOptions](docs/Model/GenericListMatchingOptions.md) +- [GenericNumericKeyValueMatchRule](docs/Model/GenericNumericKeyValueMatchRule.md) +- [GenericNumericKeyValueMatchRuleAllOfMatching](docs/Model/GenericNumericKeyValueMatchRuleAllOfMatching.md) +- [GenericNumericKeyValueMatchRulesTypes](docs/Model/GenericNumericKeyValueMatchRulesTypes.md) +- [GenericNumericMatchRule](docs/Model/GenericNumericMatchRule.md) +- [GenericNumericMatchRuleAllOfMatching](docs/Model/GenericNumericMatchRuleAllOfMatching.md) +- [GenericSetMatchRule](docs/Model/GenericSetMatchRule.md) +- [GenericSetMatchRuleAllOfMatching](docs/Model/GenericSetMatchRuleAllOfMatching.md) +- [GenericTextKeyValueMatchRule](docs/Model/GenericTextKeyValueMatchRule.md) +- [GenericTextKeyValueMatchRuleAllOfMatching](docs/Model/GenericTextKeyValueMatchRuleAllOfMatching.md) +- [GenericTextKeyValueMatchRulesTypes](docs/Model/GenericTextKeyValueMatchRulesTypes.md) +- [GenericTextMatchRule](docs/Model/GenericTextMatchRule.md) +- [GenericTextMatchRuleAllOfMatching](docs/Model/GenericTextMatchRuleAllOfMatching.md) +- [GoalTriggeredMatchRule](docs/Model/GoalTriggeredMatchRule.md) +- [GoalTriggeredMatchRuleAllOfMatching](docs/Model/GoalTriggeredMatchRuleAllOfMatching.md) +- [GoalTriggeredMatchRulesTypes](docs/Model/GoalTriggeredMatchRulesTypes.md) +- [GoalTypes](docs/Model/GoalTypes.md) +- [HourOfDayMatchRule](docs/Model/HourOfDayMatchRule.md) +- [HourOfDayMatchRuleAllOfMatching](docs/Model/HourOfDayMatchRuleAllOfMatching.md) +- [HourOfDayMatchRulesTypes](docs/Model/HourOfDayMatchRulesTypes.md) +- [ImportProjectDataSuccess](docs/Model/ImportProjectDataSuccess.md) +- [ImportProjectDataSuccessAllOfImported](docs/Model/ImportProjectDataSuccessAllOfImported.md) +- [IntegrationGA3](docs/Model/IntegrationGA3.md) +- [IntegrationGA4](docs/Model/IntegrationGA4.md) +- [IntegrationGA4Base](docs/Model/IntegrationGA4Base.md) +- [IntegrationProvider](docs/Model/IntegrationProvider.md) +- [JsConditionMatchRule](docs/Model/JsConditionMatchRule.md) +- [JsConditionMatchRuleAllOfMatching](docs/Model/JsConditionMatchRuleAllOfMatching.md) +- [JsConditionMatchRulesTypes](docs/Model/JsConditionMatchRulesTypes.md) +- [KeyValueMatchRulesTypes](docs/Model/KeyValueMatchRulesTypes.md) +- [LanguageMatchRule](docs/Model/LanguageMatchRule.md) +- [LanguageMatchRuleAllOfMatching](docs/Model/LanguageMatchRuleAllOfMatching.md) +- [LanguageMatchRulesTypes](docs/Model/LanguageMatchRulesTypes.md) +- [LocationDomTriggerEvents](docs/Model/LocationDomTriggerEvents.md) +- [LocationTrigger](docs/Model/LocationTrigger.md) +- [LocationTriggerBase](docs/Model/LocationTriggerBase.md) +- [LocationTriggerCallback](docs/Model/LocationTriggerCallback.md) +- [LocationTriggerDomElement](docs/Model/LocationTriggerDomElement.md) +- [LocationTriggerManual](docs/Model/LocationTriggerManual.md) +- [LocationTriggerTypes](docs/Model/LocationTriggerTypes.md) +- [LocationTriggerUponRun](docs/Model/LocationTriggerUponRun.md) +- [MinuteOfHourMatchRule](docs/Model/MinuteOfHourMatchRule.md) +- [MinuteOfHourMatchRuleAllOfMatching](docs/Model/MinuteOfHourMatchRuleAllOfMatching.md) +- [MinuteOfHourMatchRulesTypes](docs/Model/MinuteOfHourMatchRulesTypes.md) +- [MultipageExperiencePage](docs/Model/MultipageExperiencePage.md) +- [NoSettingsGoal](docs/Model/NoSettingsGoal.md) +- [NumericMatchRulesTypes](docs/Model/NumericMatchRulesTypes.md) +- [NumericMatchingOptions](docs/Model/NumericMatchingOptions.md) +- [NumericOutlier](docs/Model/NumericOutlier.md) +- [NumericOutlierBase](docs/Model/NumericOutlierBase.md) +- [NumericOutlierMinMax](docs/Model/NumericOutlierMinMax.md) +- [NumericOutlierNone](docs/Model/NumericOutlierNone.md) +- [NumericOutlierPercentile](docs/Model/NumericOutlierPercentile.md) +- [NumericOutlierPercentileAllOfMax](docs/Model/NumericOutlierPercentileAllOfMax.md) +- [NumericOutlierPercentileAllOfMin](docs/Model/NumericOutlierPercentileAllOfMin.md) +- [NumericOutlierTypes](docs/Model/NumericOutlierTypes.md) +- [OnlyCount](docs/Model/OnlyCount.md) +- [OsMatchRule](docs/Model/OsMatchRule.md) +- [OsMatchRuleAllOfMatching](docs/Model/OsMatchRuleAllOfMatching.md) +- [OsMatchRulesTypes](docs/Model/OsMatchRulesTypes.md) +- [PageNumber](docs/Model/PageNumber.md) +- [Pagination](docs/Model/Pagination.md) +- [Percentiles](docs/Model/Percentiles.md) +- [ProjectGASettingsBase](docs/Model/ProjectGASettingsBase.md) +- [ProjectIntegrationGA3](docs/Model/ProjectIntegrationGA3.md) +- [ProjectIntegrationGA4](docs/Model/ProjectIntegrationGA4.md) +- [ResultsPerPage](docs/Model/ResultsPerPage.md) +- [RevenueGoal](docs/Model/RevenueGoal.md) +- [RevenueGoalSettings](docs/Model/RevenueGoalSettings.md) +- [RuleElement](docs/Model/RuleElement.md) +- [RuleElementNoUrl](docs/Model/RuleElementNoUrl.md) +- [RuleObject](docs/Model/RuleObject.md) +- [RuleObjectNoUrl](docs/Model/RuleObjectNoUrl.md) +- [RuleObjectNoUrlORInner](docs/Model/RuleObjectNoUrlORInner.md) +- [RuleObjectNoUrlORInnerANDInner](docs/Model/RuleObjectNoUrlORInnerANDInner.md) +- [RuleObjectORInner](docs/Model/RuleObjectORInner.md) +- [RuleObjectORInnerANDInner](docs/Model/RuleObjectORInnerANDInner.md) +- [RulesTypes](docs/Model/RulesTypes.md) +- [ScrollPercentageGoal](docs/Model/ScrollPercentageGoal.md) +- [ScrollPercentageGoalSettings](docs/Model/ScrollPercentageGoalSettings.md) +- [SegmentBucketedMatchRule](docs/Model/SegmentBucketedMatchRule.md) +- [SegmentBucketedMatchRuleAllOfMatching](docs/Model/SegmentBucketedMatchRuleAllOfMatching.md) +- [SegmentBucketedMatchRulesTypes](docs/Model/SegmentBucketedMatchRulesTypes.md) +- [SendTrackingEventsRequestData](docs/Model/SendTrackingEventsRequestData.md) +- [SendTrackingEventsRequestDataVisitorsInner](docs/Model/SendTrackingEventsRequestDataVisitorsInner.md) +- [SetMatchingOptions](docs/Model/SetMatchingOptions.md) +- [SortDirection](docs/Model/SortDirection.md) +- [SubmitsFormGoal](docs/Model/SubmitsFormGoal.md) +- [SubmitsFormGoalSettings](docs/Model/SubmitsFormGoalSettings.md) +- [SuccessData](docs/Model/SuccessData.md) +- [TextMatchRulesTypes](docs/Model/TextMatchRulesTypes.md) +- [TextMatchingOptions](docs/Model/TextMatchingOptions.md) +- [TrackingScriptReleaseBase](docs/Model/TrackingScriptReleaseBase.md) +- [UpdateExperienceChangeRequestData](docs/Model/UpdateExperienceChangeRequestData.md) +- [VariationStatuses](docs/Model/VariationStatuses.md) +- [VisitorInsightsData](docs/Model/VisitorInsightsData.md) +- [VisitorSegments](docs/Model/VisitorSegments.md) +- [VisitorTrackingEvents](docs/Model/VisitorTrackingEvents.md) +- [VisitorTrackingEventsData](docs/Model/VisitorTrackingEventsData.md) +- [VisitorTypeMatchRule](docs/Model/VisitorTypeMatchRule.md) +- [VisitorTypeMatchRuleAllOfMatching](docs/Model/VisitorTypeMatchRuleAllOfMatching.md) +- [VisitorTypeMatchRulesTypes](docs/Model/VisitorTypeMatchRulesTypes.md) +- [WeatherConditionMatchRule](docs/Model/WeatherConditionMatchRule.md) +- [WeatherConditionMatchRuleAllOfMatching](docs/Model/WeatherConditionMatchRuleAllOfMatching.md) +- [WeatherConditionMatchRulesTypes](docs/Model/WeatherConditionMatchRulesTypes.md) +- [WeatherConditions](docs/Model/WeatherConditions.md) + +## Authorization + +Authentication schemes defined for the API: +### sdkKeyAuth + +- **Type**: API key +- **API key parameter name**: Authorization +- **Location**: HTTP header + + +### debuggingTokenAuth + +- **Type**: API key +- **API key parameter name**: convert-debug-token +- **Location**: HTTP header + + +## Tests + +To run the tests, use: + +```bash +composer install +vendor/bin/phpunit +``` + +## Author + + + +## About this package + +This PHP package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: + +- API version: `1.1.0` + - Generator version: `7.13.0-SNAPSHOT` +- Build package: `org.openapitools.codegen.languages.PhpClientCodegen` diff --git a/packages/Types/composer.json b/packages/Types/composer.json new file mode 100644 index 0000000..cafaaa9 --- /dev/null +++ b/packages/Types/composer.json @@ -0,0 +1,39 @@ +{ + "name": "convertcom/php-sdk-types", + "description": "Serve and track experiences to your users using Convert APIs and tools", + "keywords": [ + "openapitools", + "openapi-generator", + "openapi", + "php", + "sdk", + "rest", + "api" + ], + "homepage": "https://openapi-generator.tech", + "license": "unlicense", + "version": "1.0.0", + "authors": [ + { + "name": "OpenAPI", + "homepage": "https://openapi-generator.tech" + } + ], + "require": { + "php": "^8.2", + "ext-curl": "*", + "ext-json": "*", + "ext-mbstring": "*", + "guzzlehttp/guzzle": "^7.3", + "guzzlehttp/psr7": "^1.7 || ^2.0" + }, + "require-dev": { + "phpunit/phpunit": "^11.0" + }, + "autoload": { + "psr-4": { "OpenAPI\\Client\\" : ["lib/", "lib/Generated/"] } + }, + "autoload-dev": { + "psr-4": { "OpenAPI\\Client\\Test\\" : "test/" } + } +} diff --git a/packages/Types/lib/BucketedVariation.php b/packages/Types/lib/BucketedVariation.php new file mode 100644 index 0000000..0c041f9 --- /dev/null +++ b/packages/Types/lib/BucketedVariation.php @@ -0,0 +1,143 @@ +experienceId = $data['experienceId'] ?? null; + $this->experienceKey = $data['experienceKey'] ?? null; + $this->experienceName = $data['experienceName'] ?? null; + $this->bucketingAllocation = $data['bucketingAllocation'] ?? null; + } + + /** + * Get the experience ID. + * + * @return string|null + */ + public function getExperienceId(): ?string + { + return $this->experienceId; + } + + /** + * Set the experience ID. + * + * @param string|null $experienceId + * @return self + */ + public function setExperienceId(?string $experienceId): self + { + $this->experienceId = $experienceId; + return $this; + } + + /** + * Get the experience key. + * + * @return string|null + */ + public function getExperienceKey(): ?string + { + return $this->experienceKey; + } + + /** + * Set the experience key. + * + * @param string|null $experienceKey + * @return self + */ + public function setExperienceKey(?string $experienceKey): self + { + $this->experienceKey = $experienceKey; + return $this; + } + + /** + * Get the experience name. + * + * @return string|null + */ + public function getExperienceName(): ?string + { + return $this->experienceName; + } + + /** + * Set the experience name. + * + * @param string|null $experienceName + * @return self + */ + public function setExperienceName(?string $experienceName): self + { + $this->experienceName = $experienceName; + return $this; + } + + /** + * Get the bucketing allocation. + * + * @return int|null + */ + public function getBucketingAllocation(): ?int + { + return $this->bucketingAllocation; + } + + /** + * Set the bucketing allocation. + * + * @param int|null $bucketingAllocation + * @return self + */ + public function setBucketingAllocation(?int $bucketingAllocation): self + { + $this->bucketingAllocation = $bucketingAllocation; + return $this; + } +} \ No newline at end of file diff --git a/packages/Types/lib/BucketingAllocation.php b/packages/Types/lib/BucketingAllocation.php new file mode 100644 index 0000000..01c8609 --- /dev/null +++ b/packages/Types/lib/BucketingAllocation.php @@ -0,0 +1,54 @@ +variationId = isset($options['variationId']) && is_string($options['variationId']) + ? $options['variationId'] + : null; + $this->bucketingAllocation = isset($options['bucketingAllocation']) && is_numeric($options['bucketingAllocation']) + ? (float)$options['bucketingAllocation'] + : null; + } + + // Getters + public function getVariationId(): ?string + { + return $this->variationId; + } + + public function getBucketingAllocation(): ?float + { + return $this->bucketingAllocation; + } + + // Setters (optional, for flexibility) + public function setVariationId(?string $variationId): void + { + $this->variationId = $variationId; + } + + public function setBucketingAllocation(?float $bucketingAllocation): void + { + $this->bucketingAllocation = $bucketingAllocation; + } +} \ No newline at end of file diff --git a/packages/Types/lib/BucketingAttributes.php b/packages/Types/lib/BucketingAttributes.php new file mode 100644 index 0000000..35f47f4 --- /dev/null +++ b/packages/Types/lib/BucketingAttributes.php @@ -0,0 +1,276 @@ +environment = $data['environment'] ?? null; + $this->locationProperties = $data['locationProperties'] ?? null; + $this->visitorProperties = $data['visitorProperties'] ?? null; + $this->typeCasting = $data['typeCasting'] ?? null; + $this->experienceKeys = $data['experienceKeys'] ?? null; + $this->updateVisitorProperties = $data['updateVisitorProperties'] ?? null; + $this->forceVariationId = $data['forceVariationId'] ?? null; + $this->enableTracking = $data['enableTracking'] ?? null; + $this->ignoreLocationProperties = $data['ignoreLocationProperties'] ?? null; + } + + /** + * Get the environment. + * + * @return string|null + */ + public function getEnvironment(): ?string + { + return $this->environment; + } + + /** + * Set the environment. + * + * @param string|null $environment + * @return self + */ + public function setEnvironment(?string $environment): self + { + $this->environment = $environment; + return $this; + } + + /** + * Get the location properties. + * + * @return array|null + */ + public function getLocationProperties(): ?array + { + return $this->locationProperties; + } + + /** + * Set the location properties. + * + * @param array|null $locationProperties + * @return self + */ + public function setLocationProperties(?array $locationProperties): self + { + $this->locationProperties = $locationProperties; + return $this; + } + + /** + * Get the visitor properties. + * + * @return array|null + */ + public function getVisitorProperties(): ?array + { + return $this->visitorProperties; + } + + /** + * Set the visitor properties. + * + * @param array|null $visitorProperties + * @return self + */ + public function setVisitorProperties(?array $visitorProperties): self + { + $this->visitorProperties = $visitorProperties; + return $this; + } + + /** + * Get whether type casting is enabled. + * + * @return bool|null + */ + public function getTypeCasting(): ?bool + { + return $this->typeCasting; + } + + /** + * Set whether type casting is enabled. + * + * @param bool|null $typeCasting + * @return self + */ + public function setTypeCasting(?bool $typeCasting): self + { + $this->typeCasting = $typeCasting; + return $this; + } + + /** + * Get the experience keys. + * + * @return string[]|null + */ + public function getExperienceKeys(): ?array + { + return $this->experienceKeys; + } + + /** + * Set the experience keys. + * + * @param string[]|null $experienceKeys + * @return self + */ + public function setExperienceKeys(?array $experienceKeys): self + { + $this->experienceKeys = $experienceKeys; + return $this; + } + + /** + * Get whether to update visitor properties. + * + * @return bool|null + */ + public function getUpdateVisitorProperties(): ?bool + { + return $this->updateVisitorProperties; + } + + /** + * Set whether to update visitor properties. + * + * @param bool|null $updateVisitorProperties + * @return self + */ + public function setUpdateVisitorProperties(?bool $updateVisitorProperties): self + { + $this->updateVisitorProperties = $updateVisitorProperties; + return $this; + } + + /** + * Get the forced variation ID. + * + * @return string|null + */ + public function getForceVariationId(): ?string + { + return $this->forceVariationId; + } + + /** + * Set the forced variation ID. + * + * @param string|null $forceVariationId + * @return self + */ + public function setForceVariationId(?string $forceVariationId): self + { + $this->forceVariationId = $forceVariationId; + return $this; + } + + /** + * Get whether tracking is enabled. + * + * @return bool|null + */ + public function getEnableTracking(): ?bool + { + return $this->enableTracking; + } + + /** + * Set whether tracking is enabled. + * + * @param bool|null $enableTracking + * @return self + */ + public function setEnableTracking(?bool $enableTracking): self + { + $this->enableTracking = $enableTracking; + return $this; + } + + /** + * Get whether to ignore location properties. + * + * @return bool|null + */ + public function getIgnoreLocationProperties(): ?bool + { + return $this->ignoreLocationProperties; + } + + /** + * Set whether to ignore location properties. + * + * @param bool|null $ignoreLocationProperties + * @return self + */ + public function setIgnoreLocationProperties(?bool $ignoreLocationProperties): self + { + $this->ignoreLocationProperties = $ignoreLocationProperties; + return $this; + } +} \ No newline at end of file diff --git a/packages/Types/lib/BucketingHash.php b/packages/Types/lib/BucketingHash.php new file mode 100644 index 0000000..427c34e --- /dev/null +++ b/packages/Types/lib/BucketingHash.php @@ -0,0 +1,70 @@ +redistribute = isset($options['redistribute']) && is_numeric($options['redistribute']) + ? (int)$options['redistribute'] + : null; + $this->seed = isset($options['seed']) && is_numeric($options['seed']) + ? (int)$options['seed'] + : null; + $this->experienceId = isset($options['experienceId']) && is_string($options['experienceId']) + ? $options['experienceId'] + : null; + } + + // Getters + public function getRedistribute(): ?int + { + return $this->redistribute; + } + + public function getSeed(): ?int + { + return $this->seed; + } + + public function getExperienceId(): ?string + { + return $this->experienceId; + } + + // Setters (optional, for flexibility) + public function setRedistribute(?int $redistribute): void + { + $this->redistribute = $redistribute; + } + + public function setSeed(?int $seed): void + { + $this->seed = $seed; + } + + public function setExperienceId(?string $experienceId): void + { + $this->experienceId = $experienceId; + } +} \ No newline at end of file diff --git a/packages/Types/lib/Config.php b/packages/Types/lib/Config.php new file mode 100644 index 0000000..3f15287 --- /dev/null +++ b/packages/Types/lib/Config.php @@ -0,0 +1,177 @@ +environment = $options['environment']; + + // Validate sdkKey vs data exclusivity + $hasSdkKey = isset($options['sdkKey']); + $hasData = isset($options['data']); + + // if ($hasSdkKey && $hasData) { + // throw new InvalidArgumentException("Cannot provide both sdkKey and data"); + // } + + if (!$hasSdkKey && !$hasData) { + throw new InvalidArgumentException("Must provide either sdkKey or data"); + } + + if ($hasSdkKey) { + if (!is_string($options['sdkKey'])) { + throw new InvalidArgumentException("sdkKey must be a string"); + } + $this->sdkKey = $options['sdkKey']; + $this->sdkKeySecret = isset($options['sdkKeySecret']) && is_string($options['sdkKeySecret']) + ? $options['sdkKeySecret'] + : null; + } elseif ($hasData) { + if (!$options['data'] instanceof ConfigResponseData) { + throw new InvalidArgumentException("data must be an instance of ConfigResponseData"); + } + $this->data = $options['data']; + } + + // Set optional properties from ConfigBase + $this->api = isset($options['api']) && is_array($options['api']) ? $options['api'] : null; + $this->bucketing = isset($options['bucketing']) && is_array($options['bucketing']) ? $options['bucketing'] : null; + $this->dataStore = isset($options['dataStore']) && is_object($options['dataStore']) ? $options['dataStore'] : null; + $this->dataRefreshInterval = isset($options['dataRefreshInterval']) && is_int($options['dataRefreshInterval']) + ? $options['dataRefreshInterval'] + : null; + $this->events = isset($options['events']) && is_array($options['events']) ? $options['events'] : null; + $this->rules = isset($options['rules']) && is_array($options['rules']) ? $options['rules'] : null; + $this->logger = isset($options['logger']) && is_array($options['logger']) ? $options['logger'] : null; + $this->network = isset($options['network']) && is_array($options['network']) ? $options['network'] : null; + $this->mapper = isset($options['mapper']) && is_callable($options['mapper']) ? $options['mapper'] : null; + } + + // Getters + public function getEnvironment(): string + { + return $this->environment; + } + + public function getApi(): ?array + { + return $this->api; + } + + public function getBucketing(): ?array + { + return $this->bucketing; + } + + public function getDataStore(): ?object + { + return $this->dataStore; + } + + public function getDataRefreshInterval(): ?int + { + return $this->dataRefreshInterval; + } + + public function getEvents(): ?array + { + return $this->events; + } + + public function getRules(): ?array + { + return $this->rules; + } + + public function getLogger(): ?array + { + return $this->logger; + } + + public function getNetwork(): ?array + { + return $this->network; + } + + public function getMapper() // No return type hint due to PHP 7.4 limitation + { + return isset($this->data['mapper']) && is_callable($this->data['mapper']) + ? $this->data['mapper'] + : null; + } + + public function getSdkKey(): ?string + { + return $this->sdkKey; + } + + public function getSdkKeySecret(): ?string + { + return $this->sdkKeySecret; + } + + public function getData(): ?ConfigResponseData + { + return $this->data; + } +} \ No newline at end of file diff --git a/packages/Types/lib/Entity.php b/packages/Types/lib/Entity.php new file mode 100644 index 0000000..714bc1f --- /dev/null +++ b/packages/Types/lib/Entity.php @@ -0,0 +1,52 @@ +entity = $entity; + } else { + throw new \InvalidArgumentException('Invalid entity type provided'); + } + } + + /** + * Get the entity. + * + * @return mixed The entity associated with this DTO. + */ + public function getEntity() + { + return $this->entity; + } +} diff --git a/packages/Types/lib/Generated/Api/ExperiencesTrackingApi.php b/packages/Types/lib/Generated/Api/ExperiencesTrackingApi.php new file mode 100644 index 0000000..d37e59c --- /dev/null +++ b/packages/Types/lib/Generated/Api/ExperiencesTrackingApi.php @@ -0,0 +1,1028 @@ + [ + 'application/json', + ], + 'sendTrackingEventsSdkKey' => [ + 'application/json', + ], + ]; + + /** + * @param ClientInterface $client + * @param Configuration $config + * @param HeaderSelector $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ?ClientInterface $client = null, + ?Configuration $config = null, + ?HeaderSelector $selector = null, + int $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: Configuration::getDefaultConfiguration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex($hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex() + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation sendTrackingEvents + * + * Send Tracking + * + * This operation contains host(s) defined in the OpenAPI spec. Use 'hostIndex' to select the host. + * if needed, use the 'variables' parameter to pass variables to the host. + * URL: https://metrics.convertexperiments.com/v1 + * URL: http://trackdev.convert.com:1515/v1 + * + * @param int $account_id ID of the account that owns the given project (required) + * @param int $project_id ID of the project to which the events belong to (required) + * @param \OpenAPI\Client\Model\SendTrackingEventsRequestData $send_tracking_events_request_data A JSON object containing the tracking events sent to the Convert tracking servers. (required) + * @param null|int $hostIndex Host index. Defaults to null. If null, then the library will use $this->hostIndex instead + * @param array $variables Associative array of variables to pass to the host. Defaults to empty array. + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendTrackingEvents'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\SuccessData|\OpenAPI\Client\Model\ErrorData + */ + public function sendTrackingEvents($account_id, $project_id, $send_tracking_events_request_data, ?int $hostIndex = null, array $variables = [], string $contentType = self::contentTypes['sendTrackingEvents'][0]) + { + list($response) = $this->sendTrackingEventsWithHttpInfo($account_id, $project_id, $send_tracking_events_request_data, $hostIndex, $variables, $contentType); + return $response; + } + + /** + * Operation sendTrackingEventsWithHttpInfo + * + * Send Tracking + * + * This operation contains host(s) defined in the OpenAPI spec. Use 'hostIndex' to select the host. + * if needed, use the 'variables' parameter to pass variables to the host. + * URL: https://metrics.convertexperiments.com/v1 + * URL: http://trackdev.convert.com:1515/v1 + * + * @param int $account_id ID of the account that owns the given project (required) + * @param int $project_id ID of the project to which the events belong to (required) + * @param \OpenAPI\Client\Model\SendTrackingEventsRequestData $send_tracking_events_request_data A JSON object containing the tracking events sent to the Convert tracking servers. (required) + * @param null|int $hostIndex Host index. Defaults to null. If null, then the library will use $this->hostIndex instead + * @param array $variables Associative array of variables to pass to the host. Defaults to empty array. + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendTrackingEvents'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\SuccessData|\OpenAPI\Client\Model\ErrorData, HTTP status code, HTTP response headers (array of strings) + */ + public function sendTrackingEventsWithHttpInfo($account_id, $project_id, $send_tracking_events_request_data, ?int $hostIndex = null, array $variables = [], string $contentType = self::contentTypes['sendTrackingEvents'][0]) + { + $request = $this->sendTrackingEventsRequest($account_id, $project_id, $send_tracking_events_request_data, $hostIndex, $variables, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if ('\OpenAPI\Client\Model\SuccessData' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\SuccessData' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\SuccessData', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\OpenAPI\Client\Model\ErrorData' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\ErrorData' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ErrorData', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\OpenAPI\Client\Model\SuccessData'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\SuccessData', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ErrorData', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation sendTrackingEventsAsync + * + * Send Tracking + * + * This operation contains host(s) defined in the OpenAPI spec. Use 'hostIndex' to select the host. + * if needed, use the 'variables' parameter to pass variables to the host. + * URL: https://metrics.convertexperiments.com/v1 + * URL: http://trackdev.convert.com:1515/v1 + * + * @param int $account_id ID of the account that owns the given project (required) + * @param int $project_id ID of the project to which the events belong to (required) + * @param \OpenAPI\Client\Model\SendTrackingEventsRequestData $send_tracking_events_request_data A JSON object containing the tracking events sent to the Convert tracking servers. (required) + * @param null|int $hostIndex Host index. Defaults to null. If null, then the library will use $this->hostIndex instead + * @param array $variables Associative array of variables to pass to the host. Defaults to empty array. + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendTrackingEvents'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function sendTrackingEventsAsync($account_id, $project_id, $send_tracking_events_request_data, ?int $hostIndex = null, array $variables = [], string $contentType = self::contentTypes['sendTrackingEvents'][0]) + { + return $this->sendTrackingEventsAsyncWithHttpInfo($account_id, $project_id, $send_tracking_events_request_data, $hostIndex, $variables, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation sendTrackingEventsAsyncWithHttpInfo + * + * Send Tracking + * + * This operation contains host(s) defined in the OpenAPI spec. Use 'hostIndex' to select the host. + * if needed, use the 'variables' parameter to pass variables to the host. + * URL: https://metrics.convertexperiments.com/v1 + * URL: http://trackdev.convert.com:1515/v1 + * + * @param int $account_id ID of the account that owns the given project (required) + * @param int $project_id ID of the project to which the events belong to (required) + * @param \OpenAPI\Client\Model\SendTrackingEventsRequestData $send_tracking_events_request_data A JSON object containing the tracking events sent to the Convert tracking servers. (required) + * @param null|int $hostIndex Host index. Defaults to null. If null, then the library will use $this->hostIndex instead + * @param array $variables Associative array of variables to pass to the host. Defaults to empty array. + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendTrackingEvents'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function sendTrackingEventsAsyncWithHttpInfo($account_id, $project_id, $send_tracking_events_request_data, ?int $hostIndex = null, array $variables = [], string $contentType = self::contentTypes['sendTrackingEvents'][0]) + { + $returnType = '\OpenAPI\Client\Model\SuccessData'; + $request = $this->sendTrackingEventsRequest($account_id, $project_id, $send_tracking_events_request_data, $hostIndex, $variables, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'sendTrackingEvents' + * + * This operation contains host(s) defined in the OpenAPI spec. Use 'hostIndex' to select the host. + * if needed, use the 'variables' parameter to pass variables to the host. + * URL: https://metrics.convertexperiments.com/v1 + * URL: http://trackdev.convert.com:1515/v1 + * + * @param int $account_id ID of the account that owns the given project (required) + * @param int $project_id ID of the project to which the events belong to (required) + * @param \OpenAPI\Client\Model\SendTrackingEventsRequestData $send_tracking_events_request_data A JSON object containing the tracking events sent to the Convert tracking servers. (required) + * @param null|int $hostIndex Host index. Defaults to null. If null, then the library will use $this->hostIndex instead + * @param array $variables Associative array of variables to pass to the host. Defaults to empty array. + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendTrackingEvents'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function sendTrackingEventsRequest($account_id, $project_id, $send_tracking_events_request_data, ?int $hostIndex = null, array $variables = [], string $contentType = self::contentTypes['sendTrackingEvents'][0]) + { + + // verify the required parameter 'account_id' is set + if ($account_id === null || (is_array($account_id) && count($account_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $account_id when calling sendTrackingEvents' + ); + } + + // verify the required parameter 'project_id' is set + if ($project_id === null || (is_array($project_id) && count($project_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $project_id when calling sendTrackingEvents' + ); + } + + // verify the required parameter 'send_tracking_events_request_data' is set + if ($send_tracking_events_request_data === null || (is_array($send_tracking_events_request_data) && count($send_tracking_events_request_data) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $send_tracking_events_request_data when calling sendTrackingEvents' + ); + } + + + $resourcePath = '/track/{account_id}/{project_id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($account_id !== null) { + $resourcePath = str_replace( + '{' . 'account_id' . '}', + ObjectSerializer::toPathValue($account_id), + $resourcePath + ); + } + // path params + if ($project_id !== null) { + $resourcePath = str_replace( + '{' . 'project_id' . '}', + ObjectSerializer::toPathValue($project_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($send_tracking_events_request_data)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($send_tracking_events_request_data)); + } else { + $httpBody = $send_tracking_events_request_data; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + # Preserve the original behavior of server indexing. + if ($hostIndex === null) { + $hostIndex = $this->hostIndex; + } + + $hostSettings = $this->getHostSettingsForsendTrackingEvents(); + + if ($hostIndex < 0 || $hostIndex >= count($hostSettings)) { + throw new \InvalidArgumentException("Invalid index {$hostIndex} when selecting the host. Must be less than ".count($hostSettings)); + } + $operationHost = Configuration::getHostString($hostSettings, $hostIndex, $variables); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Returns an array of host settings for Operation sendTrackingEvents + * + * @return array an array of host settings + */ + protected function getHostSettingsForsendTrackingEvents(): array + { + return [ + [ + "url" => "https://metrics.convertexperiments.com/v1", + "description" => "Live API server for **Tracking** endpoints", + ], + [ + "url" => "http://trackdev.convert.com:1515/v1", + "description" => "Dev API server for **Tracking** endpoints", + ] + ]; + } + + /** + * Operation sendTrackingEventsSdkKey + * + * Sdk-Key Send Tracking + * + * This operation contains host(s) defined in the OpenAPI spec. Use 'hostIndex' to select the host. + * if needed, use the 'variables' parameter to pass variables to the host. + * URL: https://metrics.convertexperiments.com/v1 + * URL: http://trackdev.convert.com:1515/v1 + * + * @param string $sdk_key The SDK key used to identify the project where that the data belongs to (required) + * @param \OpenAPI\Client\Model\SendTrackingEventsRequestData $send_tracking_events_request_data A JSON object containing the tracking events sent to the Convert tracking servers. (required) + * @param null|int $hostIndex Host index. Defaults to null. If null, then the library will use $this->hostIndex instead + * @param array $variables Associative array of variables to pass to the host. Defaults to empty array. + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendTrackingEventsSdkKey'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\SuccessData|\OpenAPI\Client\Model\ErrorData + */ + public function sendTrackingEventsSdkKey($sdk_key, $send_tracking_events_request_data, ?int $hostIndex = null, array $variables = [], string $contentType = self::contentTypes['sendTrackingEventsSdkKey'][0]) + { + list($response) = $this->sendTrackingEventsSdkKeyWithHttpInfo($sdk_key, $send_tracking_events_request_data, $hostIndex, $variables, $contentType); + return $response; + } + + /** + * Operation sendTrackingEventsSdkKeyWithHttpInfo + * + * Sdk-Key Send Tracking + * + * This operation contains host(s) defined in the OpenAPI spec. Use 'hostIndex' to select the host. + * if needed, use the 'variables' parameter to pass variables to the host. + * URL: https://metrics.convertexperiments.com/v1 + * URL: http://trackdev.convert.com:1515/v1 + * + * @param string $sdk_key The SDK key used to identify the project where that the data belongs to (required) + * @param \OpenAPI\Client\Model\SendTrackingEventsRequestData $send_tracking_events_request_data A JSON object containing the tracking events sent to the Convert tracking servers. (required) + * @param null|int $hostIndex Host index. Defaults to null. If null, then the library will use $this->hostIndex instead + * @param array $variables Associative array of variables to pass to the host. Defaults to empty array. + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendTrackingEventsSdkKey'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\SuccessData|\OpenAPI\Client\Model\ErrorData, HTTP status code, HTTP response headers (array of strings) + */ + public function sendTrackingEventsSdkKeyWithHttpInfo($sdk_key, $send_tracking_events_request_data, ?int $hostIndex = null, array $variables = [], string $contentType = self::contentTypes['sendTrackingEventsSdkKey'][0]) + { + $request = $this->sendTrackingEventsSdkKeyRequest($sdk_key, $send_tracking_events_request_data, $hostIndex, $variables, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if ('\OpenAPI\Client\Model\SuccessData' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\SuccessData' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\SuccessData', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\OpenAPI\Client\Model\ErrorData' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\ErrorData' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ErrorData', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\OpenAPI\Client\Model\SuccessData'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\SuccessData', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ErrorData', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation sendTrackingEventsSdkKeyAsync + * + * Sdk-Key Send Tracking + * + * This operation contains host(s) defined in the OpenAPI spec. Use 'hostIndex' to select the host. + * if needed, use the 'variables' parameter to pass variables to the host. + * URL: https://metrics.convertexperiments.com/v1 + * URL: http://trackdev.convert.com:1515/v1 + * + * @param string $sdk_key The SDK key used to identify the project where that the data belongs to (required) + * @param \OpenAPI\Client\Model\SendTrackingEventsRequestData $send_tracking_events_request_data A JSON object containing the tracking events sent to the Convert tracking servers. (required) + * @param null|int $hostIndex Host index. Defaults to null. If null, then the library will use $this->hostIndex instead + * @param array $variables Associative array of variables to pass to the host. Defaults to empty array. + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendTrackingEventsSdkKey'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function sendTrackingEventsSdkKeyAsync($sdk_key, $send_tracking_events_request_data, ?int $hostIndex = null, array $variables = [], string $contentType = self::contentTypes['sendTrackingEventsSdkKey'][0]) + { + return $this->sendTrackingEventsSdkKeyAsyncWithHttpInfo($sdk_key, $send_tracking_events_request_data, $hostIndex, $variables, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation sendTrackingEventsSdkKeyAsyncWithHttpInfo + * + * Sdk-Key Send Tracking + * + * This operation contains host(s) defined in the OpenAPI spec. Use 'hostIndex' to select the host. + * if needed, use the 'variables' parameter to pass variables to the host. + * URL: https://metrics.convertexperiments.com/v1 + * URL: http://trackdev.convert.com:1515/v1 + * + * @param string $sdk_key The SDK key used to identify the project where that the data belongs to (required) + * @param \OpenAPI\Client\Model\SendTrackingEventsRequestData $send_tracking_events_request_data A JSON object containing the tracking events sent to the Convert tracking servers. (required) + * @param null|int $hostIndex Host index. Defaults to null. If null, then the library will use $this->hostIndex instead + * @param array $variables Associative array of variables to pass to the host. Defaults to empty array. + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendTrackingEventsSdkKey'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function sendTrackingEventsSdkKeyAsyncWithHttpInfo($sdk_key, $send_tracking_events_request_data, ?int $hostIndex = null, array $variables = [], string $contentType = self::contentTypes['sendTrackingEventsSdkKey'][0]) + { + $returnType = '\OpenAPI\Client\Model\SuccessData'; + $request = $this->sendTrackingEventsSdkKeyRequest($sdk_key, $send_tracking_events_request_data, $hostIndex, $variables, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'sendTrackingEventsSdkKey' + * + * This operation contains host(s) defined in the OpenAPI spec. Use 'hostIndex' to select the host. + * if needed, use the 'variables' parameter to pass variables to the host. + * URL: https://metrics.convertexperiments.com/v1 + * URL: http://trackdev.convert.com:1515/v1 + * + * @param string $sdk_key The SDK key used to identify the project where that the data belongs to (required) + * @param \OpenAPI\Client\Model\SendTrackingEventsRequestData $send_tracking_events_request_data A JSON object containing the tracking events sent to the Convert tracking servers. (required) + * @param null|int $hostIndex Host index. Defaults to null. If null, then the library will use $this->hostIndex instead + * @param array $variables Associative array of variables to pass to the host. Defaults to empty array. + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendTrackingEventsSdkKey'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function sendTrackingEventsSdkKeyRequest($sdk_key, $send_tracking_events_request_data, ?int $hostIndex = null, array $variables = [], string $contentType = self::contentTypes['sendTrackingEventsSdkKey'][0]) + { + + // verify the required parameter 'sdk_key' is set + if ($sdk_key === null || (is_array($sdk_key) && count($sdk_key) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $sdk_key when calling sendTrackingEventsSdkKey' + ); + } + + // verify the required parameter 'send_tracking_events_request_data' is set + if ($send_tracking_events_request_data === null || (is_array($send_tracking_events_request_data) && count($send_tracking_events_request_data) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $send_tracking_events_request_data when calling sendTrackingEventsSdkKey' + ); + } + + + $resourcePath = '/track/{sdk_key}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($sdk_key !== null) { + $resourcePath = str_replace( + '{' . 'sdk_key' . '}', + ObjectSerializer::toPathValue($sdk_key), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($send_tracking_events_request_data)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($send_tracking_events_request_data)); + } else { + $httpBody = $send_tracking_events_request_data; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); + if ($apiKey !== null) { + $headers['Authorization'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('convert-debug-token'); + if ($apiKey !== null) { + $headers['convert-debug-token'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + # Preserve the original behavior of server indexing. + if ($hostIndex === null) { + $hostIndex = $this->hostIndex; + } + + $hostSettings = $this->getHostSettingsForsendTrackingEventsSdkKey(); + + if ($hostIndex < 0 || $hostIndex >= count($hostSettings)) { + throw new \InvalidArgumentException("Invalid index {$hostIndex} when selecting the host. Must be less than ".count($hostSettings)); + } + $operationHost = Configuration::getHostString($hostSettings, $hostIndex, $variables); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Returns an array of host settings for Operation sendTrackingEventsSdkKey + * + * @return array an array of host settings + */ + protected function getHostSettingsForsendTrackingEventsSdkKey(): array + { + return [ + [ + "url" => "https://metrics.convertexperiments.com/v1", + "description" => "Live API server for **Tracking** endpoints", + ], + [ + "url" => "http://trackdev.convert.com:1515/v1", + "description" => "Dev API server for **Tracking** endpoints", + ] + ]; + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/packages/Types/lib/Generated/Api/ProjectConfigApi.php b/packages/Types/lib/Generated/Api/ProjectConfigApi.php new file mode 100644 index 0000000..bccd12a --- /dev/null +++ b/packages/Types/lib/Generated/Api/ProjectConfigApi.php @@ -0,0 +1,1450 @@ + [ + 'application/json', + ], + 'getProjectConfigBySdkKey' => [ + 'application/json', + ], + 'getProjectSettings' => [ + 'application/json', + ], + ]; + + /** + * @param ClientInterface $client + * @param Configuration $config + * @param HeaderSelector $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ?ClientInterface $client = null, + ?Configuration $config = null, + ?HeaderSelector $selector = null, + int $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: Configuration::getDefaultConfiguration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex($hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex() + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation getProjectConfig + * + * Default Get Project Config + * + * This operation contains host(s) defined in the OpenAPI spec. Use 'hostIndex' to select the host. + * if needed, use the 'variables' parameter to pass variables to the host. + * URL: https://cdn-4.convertexperiments.com/api/v1 + * URL: https://cdn-provider-dev.convertexperiments.com/api/v1 + * + * @param int $account_id ID of the account that owns the retrieved/saved data (required) + * @param int $project_id ID of the project to be retrieved (required) + * @param string|null $environment Filter experiences based on environment. (optional) + * @param null|int $hostIndex Host index. Defaults to null. If null, then the library will use $this->hostIndex instead + * @param array $variables Associative array of variables to pass to the host. Defaults to empty array. + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getProjectConfig'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\ConfigResponseData|\OpenAPI\Client\Model\ErrorData + */ + public function getProjectConfig($account_id, $project_id, $environment = null, ?int $hostIndex = null, array $variables = [], string $contentType = self::contentTypes['getProjectConfig'][0]) + { + list($response) = $this->getProjectConfigWithHttpInfo($account_id, $project_id, $environment, $hostIndex, $variables, $contentType); + return $response; + } + + /** + * Operation getProjectConfigWithHttpInfo + * + * Default Get Project Config + * + * This operation contains host(s) defined in the OpenAPI spec. Use 'hostIndex' to select the host. + * if needed, use the 'variables' parameter to pass variables to the host. + * URL: https://cdn-4.convertexperiments.com/api/v1 + * URL: https://cdn-provider-dev.convertexperiments.com/api/v1 + * + * @param int $account_id ID of the account that owns the retrieved/saved data (required) + * @param int $project_id ID of the project to be retrieved (required) + * @param string|null $environment Filter experiences based on environment. (optional) + * @param null|int $hostIndex Host index. Defaults to null. If null, then the library will use $this->hostIndex instead + * @param array $variables Associative array of variables to pass to the host. Defaults to empty array. + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getProjectConfig'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\ConfigResponseData|\OpenAPI\Client\Model\ErrorData, HTTP status code, HTTP response headers (array of strings) + */ + public function getProjectConfigWithHttpInfo($account_id, $project_id, $environment = null, ?int $hostIndex = null, array $variables = [], string $contentType = self::contentTypes['getProjectConfig'][0]) + { + $request = $this->getProjectConfigRequest($account_id, $project_id, $environment, $hostIndex, $variables, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if ('\OpenAPI\Client\Model\ConfigResponseData' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\ConfigResponseData' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ConfigResponseData', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\OpenAPI\Client\Model\ErrorData' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\ErrorData' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ErrorData', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\OpenAPI\Client\Model\ConfigResponseData'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ConfigResponseData', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ErrorData', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getProjectConfigAsync + * + * Default Get Project Config + * + * This operation contains host(s) defined in the OpenAPI spec. Use 'hostIndex' to select the host. + * if needed, use the 'variables' parameter to pass variables to the host. + * URL: https://cdn-4.convertexperiments.com/api/v1 + * URL: https://cdn-provider-dev.convertexperiments.com/api/v1 + * + * @param int $account_id ID of the account that owns the retrieved/saved data (required) + * @param int $project_id ID of the project to be retrieved (required) + * @param string|null $environment Filter experiences based on environment. (optional) + * @param null|int $hostIndex Host index. Defaults to null. If null, then the library will use $this->hostIndex instead + * @param array $variables Associative array of variables to pass to the host. Defaults to empty array. + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getProjectConfig'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getProjectConfigAsync($account_id, $project_id, $environment = null, ?int $hostIndex = null, array $variables = [], string $contentType = self::contentTypes['getProjectConfig'][0]) + { + return $this->getProjectConfigAsyncWithHttpInfo($account_id, $project_id, $environment, $hostIndex, $variables, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getProjectConfigAsyncWithHttpInfo + * + * Default Get Project Config + * + * This operation contains host(s) defined in the OpenAPI spec. Use 'hostIndex' to select the host. + * if needed, use the 'variables' parameter to pass variables to the host. + * URL: https://cdn-4.convertexperiments.com/api/v1 + * URL: https://cdn-provider-dev.convertexperiments.com/api/v1 + * + * @param int $account_id ID of the account that owns the retrieved/saved data (required) + * @param int $project_id ID of the project to be retrieved (required) + * @param string|null $environment Filter experiences based on environment. (optional) + * @param null|int $hostIndex Host index. Defaults to null. If null, then the library will use $this->hostIndex instead + * @param array $variables Associative array of variables to pass to the host. Defaults to empty array. + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getProjectConfig'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getProjectConfigAsyncWithHttpInfo($account_id, $project_id, $environment = null, ?int $hostIndex = null, array $variables = [], string $contentType = self::contentTypes['getProjectConfig'][0]) + { + $returnType = '\OpenAPI\Client\Model\ConfigResponseData'; + $request = $this->getProjectConfigRequest($account_id, $project_id, $environment, $hostIndex, $variables, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getProjectConfig' + * + * This operation contains host(s) defined in the OpenAPI spec. Use 'hostIndex' to select the host. + * if needed, use the 'variables' parameter to pass variables to the host. + * URL: https://cdn-4.convertexperiments.com/api/v1 + * URL: https://cdn-provider-dev.convertexperiments.com/api/v1 + * + * @param int $account_id ID of the account that owns the retrieved/saved data (required) + * @param int $project_id ID of the project to be retrieved (required) + * @param string|null $environment Filter experiences based on environment. (optional) + * @param null|int $hostIndex Host index. Defaults to null. If null, then the library will use $this->hostIndex instead + * @param array $variables Associative array of variables to pass to the host. Defaults to empty array. + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getProjectConfig'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getProjectConfigRequest($account_id, $project_id, $environment = null, ?int $hostIndex = null, array $variables = [], string $contentType = self::contentTypes['getProjectConfig'][0]) + { + + // verify the required parameter 'account_id' is set + if ($account_id === null || (is_array($account_id) && count($account_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $account_id when calling getProjectConfig' + ); + } + + // verify the required parameter 'project_id' is set + if ($project_id === null || (is_array($project_id) && count($project_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $project_id when calling getProjectConfig' + ); + } + + + + $resourcePath = '/config/{account_id}/{project_id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $environment, + 'environment', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($account_id !== null) { + $resourcePath = str_replace( + '{' . 'account_id' . '}', + ObjectSerializer::toPathValue($account_id), + $resourcePath + ); + } + // path params + if ($project_id !== null) { + $resourcePath = str_replace( + '{' . 'project_id' . '}', + ObjectSerializer::toPathValue($project_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + # Preserve the original behavior of server indexing. + if ($hostIndex === null) { + $hostIndex = $this->hostIndex; + } + + $hostSettings = $this->getHostSettingsForgetProjectConfig(); + + if ($hostIndex < 0 || $hostIndex >= count($hostSettings)) { + throw new \InvalidArgumentException("Invalid index {$hostIndex} when selecting the host. Must be less than ".count($hostSettings)); + } + $operationHost = Configuration::getHostString($hostSettings, $hostIndex, $variables); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Returns an array of host settings for Operation getProjectConfig + * + * @return array an array of host settings + */ + protected function getHostSettingsForgetProjectConfig(): array + { + return [ + [ + "url" => "https://cdn-4.convertexperiments.com/api/v1", + "description" => "Live API server for **Configs** endpoints", + ], + [ + "url" => "https://cdn-provider-dev.convertexperiments.com/api/v1", + "description" => "Live API server for **Configs** endpoints", + ] + ]; + } + + /** + * Operation getProjectConfigBySdkKey + * + * Sdk-Key Get Project Config + * + * This operation contains host(s) defined in the OpenAPI spec. Use 'hostIndex' to select the host. + * if needed, use the 'variables' parameter to pass variables to the host. + * URL: https://cdn-4.convertexperiments.com/api/v1 + * URL: https://cdn-provider-dev.convertexperiments.com/api/v1 + * + * @param string $sdk_key The SDK key used to retrieve the project's config (required) + * @param string|null $environment Filter experiences based on environment. (optional) + * @param null|int $hostIndex Host index. Defaults to null. If null, then the library will use $this->hostIndex instead + * @param array $variables Associative array of variables to pass to the host. Defaults to empty array. + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getProjectConfigBySdkKey'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\ConfigResponseData|\OpenAPI\Client\Model\ErrorData + */ + public function getProjectConfigBySdkKey($sdk_key, $environment = null, ?int $hostIndex = null, array $variables = [], string $contentType = self::contentTypes['getProjectConfigBySdkKey'][0]) + { + list($response) = $this->getProjectConfigBySdkKeyWithHttpInfo($sdk_key, $environment, $hostIndex, $variables, $contentType); + return $response; + } + + /** + * Operation getProjectConfigBySdkKeyWithHttpInfo + * + * Sdk-Key Get Project Config + * + * This operation contains host(s) defined in the OpenAPI spec. Use 'hostIndex' to select the host. + * if needed, use the 'variables' parameter to pass variables to the host. + * URL: https://cdn-4.convertexperiments.com/api/v1 + * URL: https://cdn-provider-dev.convertexperiments.com/api/v1 + * + * @param string $sdk_key The SDK key used to retrieve the project's config (required) + * @param string|null $environment Filter experiences based on environment. (optional) + * @param null|int $hostIndex Host index. Defaults to null. If null, then the library will use $this->hostIndex instead + * @param array $variables Associative array of variables to pass to the host. Defaults to empty array. + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getProjectConfigBySdkKey'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\ConfigResponseData|\OpenAPI\Client\Model\ErrorData, HTTP status code, HTTP response headers (array of strings) + */ + public function getProjectConfigBySdkKeyWithHttpInfo($sdk_key, $environment = null, ?int $hostIndex = null, array $variables = [], string $contentType = self::contentTypes['getProjectConfigBySdkKey'][0]) + { + $request = $this->getProjectConfigBySdkKeyRequest($sdk_key, $environment, $hostIndex, $variables, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if ('\OpenAPI\Client\Model\ConfigResponseData' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\ConfigResponseData' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ConfigResponseData', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\OpenAPI\Client\Model\ErrorData' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\ErrorData' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ErrorData', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\OpenAPI\Client\Model\ConfigResponseData'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ConfigResponseData', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ErrorData', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getProjectConfigBySdkKeyAsync + * + * Sdk-Key Get Project Config + * + * This operation contains host(s) defined in the OpenAPI spec. Use 'hostIndex' to select the host. + * if needed, use the 'variables' parameter to pass variables to the host. + * URL: https://cdn-4.convertexperiments.com/api/v1 + * URL: https://cdn-provider-dev.convertexperiments.com/api/v1 + * + * @param string $sdk_key The SDK key used to retrieve the project's config (required) + * @param string|null $environment Filter experiences based on environment. (optional) + * @param null|int $hostIndex Host index. Defaults to null. If null, then the library will use $this->hostIndex instead + * @param array $variables Associative array of variables to pass to the host. Defaults to empty array. + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getProjectConfigBySdkKey'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getProjectConfigBySdkKeyAsync($sdk_key, $environment = null, ?int $hostIndex = null, array $variables = [], string $contentType = self::contentTypes['getProjectConfigBySdkKey'][0]) + { + return $this->getProjectConfigBySdkKeyAsyncWithHttpInfo($sdk_key, $environment, $hostIndex, $variables, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getProjectConfigBySdkKeyAsyncWithHttpInfo + * + * Sdk-Key Get Project Config + * + * This operation contains host(s) defined in the OpenAPI spec. Use 'hostIndex' to select the host. + * if needed, use the 'variables' parameter to pass variables to the host. + * URL: https://cdn-4.convertexperiments.com/api/v1 + * URL: https://cdn-provider-dev.convertexperiments.com/api/v1 + * + * @param string $sdk_key The SDK key used to retrieve the project's config (required) + * @param string|null $environment Filter experiences based on environment. (optional) + * @param null|int $hostIndex Host index. Defaults to null. If null, then the library will use $this->hostIndex instead + * @param array $variables Associative array of variables to pass to the host. Defaults to empty array. + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getProjectConfigBySdkKey'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getProjectConfigBySdkKeyAsyncWithHttpInfo($sdk_key, $environment = null, ?int $hostIndex = null, array $variables = [], string $contentType = self::contentTypes['getProjectConfigBySdkKey'][0]) + { + $returnType = '\OpenAPI\Client\Model\ConfigResponseData'; + $request = $this->getProjectConfigBySdkKeyRequest($sdk_key, $environment, $hostIndex, $variables, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getProjectConfigBySdkKey' + * + * This operation contains host(s) defined in the OpenAPI spec. Use 'hostIndex' to select the host. + * if needed, use the 'variables' parameter to pass variables to the host. + * URL: https://cdn-4.convertexperiments.com/api/v1 + * URL: https://cdn-provider-dev.convertexperiments.com/api/v1 + * + * @param string $sdk_key The SDK key used to retrieve the project's config (required) + * @param string|null $environment Filter experiences based on environment. (optional) + * @param null|int $hostIndex Host index. Defaults to null. If null, then the library will use $this->hostIndex instead + * @param array $variables Associative array of variables to pass to the host. Defaults to empty array. + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getProjectConfigBySdkKey'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getProjectConfigBySdkKeyRequest($sdk_key, $environment = null, ?int $hostIndex = null, array $variables = [], string $contentType = self::contentTypes['getProjectConfigBySdkKey'][0]) + { + + // verify the required parameter 'sdk_key' is set + if ($sdk_key === null || (is_array($sdk_key) && count($sdk_key) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $sdk_key when calling getProjectConfigBySdkKey' + ); + } + + + + $resourcePath = '/config/{sdk_key}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $environment, + 'environment', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($sdk_key !== null) { + $resourcePath = str_replace( + '{' . 'sdk_key' . '}', + ObjectSerializer::toPathValue($sdk_key), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); + if ($apiKey !== null) { + $headers['Authorization'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('convert-debug-token'); + if ($apiKey !== null) { + $headers['convert-debug-token'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + # Preserve the original behavior of server indexing. + if ($hostIndex === null) { + $hostIndex = $this->hostIndex; + } + + $hostSettings = $this->getHostSettingsForgetProjectConfigBySdkKey(); + + if ($hostIndex < 0 || $hostIndex >= count($hostSettings)) { + throw new \InvalidArgumentException("Invalid index {$hostIndex} when selecting the host. Must be less than ".count($hostSettings)); + } + $operationHost = Configuration::getHostString($hostSettings, $hostIndex, $variables); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Returns an array of host settings for Operation getProjectConfigBySdkKey + * + * @return array an array of host settings + */ + protected function getHostSettingsForgetProjectConfigBySdkKey(): array + { + return [ + [ + "url" => "https://cdn-4.convertexperiments.com/api/v1", + "description" => "Live API server for **Configs** endpoints", + ], + [ + "url" => "https://cdn-provider-dev.convertexperiments.com/api/v1", + "description" => "Live API server for **Configs** endpoints", + ] + ]; + } + + /** + * Operation getProjectSettings + * + * Minimal Project Settings + * + * This operation contains host(s) defined in the OpenAPI spec. Use 'hostIndex' to select the host. + * if needed, use the 'variables' parameter to pass variables to the host. + * URL: https://cdn-4.convertexperiments.com/api/v1 + * URL: https://cdn-provider-dev.convertexperiments.com/api/v1 + * + * @param int $account_id ID of the account that owns the retrieved/saved data (required) + * @param int $project_id ID of the project to be retrieved (required) + * @param null|int $hostIndex Host index. Defaults to null. If null, then the library will use $this->hostIndex instead + * @param array $variables Associative array of variables to pass to the host. Defaults to empty array. + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getProjectSettings'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\ConfigMinimalResponseData|\OpenAPI\Client\Model\ErrorData + */ + public function getProjectSettings($account_id, $project_id, ?int $hostIndex = null, array $variables = [], string $contentType = self::contentTypes['getProjectSettings'][0]) + { + list($response) = $this->getProjectSettingsWithHttpInfo($account_id, $project_id, $hostIndex, $variables, $contentType); + return $response; + } + + /** + * Operation getProjectSettingsWithHttpInfo + * + * Minimal Project Settings + * + * This operation contains host(s) defined in the OpenAPI spec. Use 'hostIndex' to select the host. + * if needed, use the 'variables' parameter to pass variables to the host. + * URL: https://cdn-4.convertexperiments.com/api/v1 + * URL: https://cdn-provider-dev.convertexperiments.com/api/v1 + * + * @param int $account_id ID of the account that owns the retrieved/saved data (required) + * @param int $project_id ID of the project to be retrieved (required) + * @param null|int $hostIndex Host index. Defaults to null. If null, then the library will use $this->hostIndex instead + * @param array $variables Associative array of variables to pass to the host. Defaults to empty array. + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getProjectSettings'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\ConfigMinimalResponseData|\OpenAPI\Client\Model\ErrorData, HTTP status code, HTTP response headers (array of strings) + */ + public function getProjectSettingsWithHttpInfo($account_id, $project_id, ?int $hostIndex = null, array $variables = [], string $contentType = self::contentTypes['getProjectSettings'][0]) + { + $request = $this->getProjectSettingsRequest($account_id, $project_id, $hostIndex, $variables, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if ('\OpenAPI\Client\Model\ConfigMinimalResponseData' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\ConfigMinimalResponseData' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ConfigMinimalResponseData', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + default: + if ('\OpenAPI\Client\Model\ErrorData' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\ErrorData' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ErrorData', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\OpenAPI\Client\Model\ConfigMinimalResponseData'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ConfigMinimalResponseData', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\ErrorData', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getProjectSettingsAsync + * + * Minimal Project Settings + * + * This operation contains host(s) defined in the OpenAPI spec. Use 'hostIndex' to select the host. + * if needed, use the 'variables' parameter to pass variables to the host. + * URL: https://cdn-4.convertexperiments.com/api/v1 + * URL: https://cdn-provider-dev.convertexperiments.com/api/v1 + * + * @param int $account_id ID of the account that owns the retrieved/saved data (required) + * @param int $project_id ID of the project to be retrieved (required) + * @param null|int $hostIndex Host index. Defaults to null. If null, then the library will use $this->hostIndex instead + * @param array $variables Associative array of variables to pass to the host. Defaults to empty array. + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getProjectSettings'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getProjectSettingsAsync($account_id, $project_id, ?int $hostIndex = null, array $variables = [], string $contentType = self::contentTypes['getProjectSettings'][0]) + { + return $this->getProjectSettingsAsyncWithHttpInfo($account_id, $project_id, $hostIndex, $variables, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getProjectSettingsAsyncWithHttpInfo + * + * Minimal Project Settings + * + * This operation contains host(s) defined in the OpenAPI spec. Use 'hostIndex' to select the host. + * if needed, use the 'variables' parameter to pass variables to the host. + * URL: https://cdn-4.convertexperiments.com/api/v1 + * URL: https://cdn-provider-dev.convertexperiments.com/api/v1 + * + * @param int $account_id ID of the account that owns the retrieved/saved data (required) + * @param int $project_id ID of the project to be retrieved (required) + * @param null|int $hostIndex Host index. Defaults to null. If null, then the library will use $this->hostIndex instead + * @param array $variables Associative array of variables to pass to the host. Defaults to empty array. + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getProjectSettings'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getProjectSettingsAsyncWithHttpInfo($account_id, $project_id, ?int $hostIndex = null, array $variables = [], string $contentType = self::contentTypes['getProjectSettings'][0]) + { + $returnType = '\OpenAPI\Client\Model\ConfigMinimalResponseData'; + $request = $this->getProjectSettingsRequest($account_id, $project_id, $hostIndex, $variables, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getProjectSettings' + * + * This operation contains host(s) defined in the OpenAPI spec. Use 'hostIndex' to select the host. + * if needed, use the 'variables' parameter to pass variables to the host. + * URL: https://cdn-4.convertexperiments.com/api/v1 + * URL: https://cdn-provider-dev.convertexperiments.com/api/v1 + * + * @param int $account_id ID of the account that owns the retrieved/saved data (required) + * @param int $project_id ID of the project to be retrieved (required) + * @param null|int $hostIndex Host index. Defaults to null. If null, then the library will use $this->hostIndex instead + * @param array $variables Associative array of variables to pass to the host. Defaults to empty array. + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getProjectSettings'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getProjectSettingsRequest($account_id, $project_id, ?int $hostIndex = null, array $variables = [], string $contentType = self::contentTypes['getProjectSettings'][0]) + { + + // verify the required parameter 'account_id' is set + if ($account_id === null || (is_array($account_id) && count($account_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $account_id when calling getProjectSettings' + ); + } + + // verify the required parameter 'project_id' is set + if ($project_id === null || (is_array($project_id) && count($project_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $project_id when calling getProjectSettings' + ); + } + + + $resourcePath = '/project-settings/{account_id}/{project_id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($account_id !== null) { + $resourcePath = str_replace( + '{' . 'account_id' . '}', + ObjectSerializer::toPathValue($account_id), + $resourcePath + ); + } + // path params + if ($project_id !== null) { + $resourcePath = str_replace( + '{' . 'project_id' . '}', + ObjectSerializer::toPathValue($project_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + # Preserve the original behavior of server indexing. + if ($hostIndex === null) { + $hostIndex = $this->hostIndex; + } + + $hostSettings = $this->getHostSettingsForgetProjectSettings(); + + if ($hostIndex < 0 || $hostIndex >= count($hostSettings)) { + throw new \InvalidArgumentException("Invalid index {$hostIndex} when selecting the host. Must be less than ".count($hostSettings)); + } + $operationHost = Configuration::getHostString($hostSettings, $hostIndex, $variables); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Returns an array of host settings for Operation getProjectSettings + * + * @return array an array of host settings + */ + protected function getHostSettingsForgetProjectSettings(): array + { + return [ + [ + "url" => "https://cdn-4.convertexperiments.com/api/v1", + "description" => "Live API server for **Configs** endpoints", + ], + [ + "url" => "https://cdn-provider-dev.convertexperiments.com/api/v1", + "description" => "Live API server for **Configs** endpoints", + ] + ]; + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/packages/Types/lib/Generated/ApiException.php b/packages/Types/lib/Generated/ApiException.php new file mode 100644 index 0000000..ee006bf --- /dev/null +++ b/packages/Types/lib/Generated/ApiException.php @@ -0,0 +1,119 @@ +responseHeaders = $responseHeaders; + $this->responseBody = $responseBody; + } + + /** + * Gets the HTTP response header + * + * @return string[][]|null HTTP response header + */ + public function getResponseHeaders() + { + return $this->responseHeaders; + } + + /** + * Gets the HTTP body of the server response either as Json or string + * + * @return \stdClass|string|null HTTP body of the server response either as \stdClass or string + */ + public function getResponseBody() + { + return $this->responseBody; + } + + /** + * Sets the deserialized response object (during deserialization) + * + * @param mixed $obj Deserialized response object + * + * @return void + */ + public function setResponseObject($obj) + { + $this->responseObject = $obj; + } + + /** + * Gets the deserialized response object (during deserialization) + * + * @return mixed the deserialized response object + */ + public function getResponseObject() + { + return $this->responseObject; + } +} diff --git a/packages/Types/lib/Generated/Configuration.php b/packages/Types/lib/Generated/Configuration.php new file mode 100644 index 0000000..23319f3 --- /dev/null +++ b/packages/Types/lib/Generated/Configuration.php @@ -0,0 +1,531 @@ +tempFolderPath = sys_get_temp_dir(); + } + + /** + * Sets API key + * + * @param string $apiKeyIdentifier API key identifier (authentication scheme) + * @param string $key API key or token + * + * @return $this + */ + public function setApiKey($apiKeyIdentifier, $key) + { + $this->apiKeys[$apiKeyIdentifier] = $key; + return $this; + } + + /** + * Gets API key + * + * @param string $apiKeyIdentifier API key identifier (authentication scheme) + * + * @return null|string API key or token + */ + public function getApiKey($apiKeyIdentifier) + { + return isset($this->apiKeys[$apiKeyIdentifier]) ? $this->apiKeys[$apiKeyIdentifier] : null; + } + + /** + * Sets the prefix for API key (e.g. Bearer) + * + * @param string $apiKeyIdentifier API key identifier (authentication scheme) + * @param string $prefix API key prefix, e.g. Bearer + * + * @return $this + */ + public function setApiKeyPrefix($apiKeyIdentifier, $prefix) + { + $this->apiKeyPrefixes[$apiKeyIdentifier] = $prefix; + return $this; + } + + /** + * Gets API key prefix + * + * @param string $apiKeyIdentifier API key identifier (authentication scheme) + * + * @return null|string + */ + public function getApiKeyPrefix($apiKeyIdentifier) + { + return isset($this->apiKeyPrefixes[$apiKeyIdentifier]) ? $this->apiKeyPrefixes[$apiKeyIdentifier] : null; + } + + /** + * Sets the access token for OAuth + * + * @param string $accessToken Token for OAuth + * + * @return $this + */ + public function setAccessToken($accessToken) + { + $this->accessToken = $accessToken; + return $this; + } + + /** + * Gets the access token for OAuth + * + * @return string Access token for OAuth + */ + public function getAccessToken() + { + return $this->accessToken; + } + + /** + * Sets boolean format for query string. + * + * @param string $booleanFormat Boolean format for query string + * + * @return $this + */ + public function setBooleanFormatForQueryString(string $booleanFormat) + { + $this->booleanFormatForQueryString = $booleanFormat; + + return $this; + } + + /** + * Gets boolean format for query string. + * + * @return string Boolean format for query string + */ + public function getBooleanFormatForQueryString(): string + { + return $this->booleanFormatForQueryString; + } + + /** + * Sets the username for HTTP basic authentication + * + * @param string $username Username for HTTP basic authentication + * + * @return $this + */ + public function setUsername($username) + { + $this->username = $username; + return $this; + } + + /** + * Gets the username for HTTP basic authentication + * + * @return string Username for HTTP basic authentication + */ + public function getUsername() + { + return $this->username; + } + + /** + * Sets the password for HTTP basic authentication + * + * @param string $password Password for HTTP basic authentication + * + * @return $this + */ + public function setPassword($password) + { + $this->password = $password; + return $this; + } + + /** + * Gets the password for HTTP basic authentication + * + * @return string Password for HTTP basic authentication + */ + public function getPassword() + { + return $this->password; + } + + /** + * Sets the host + * + * @param string $host Host + * + * @return $this + */ + public function setHost($host) + { + $this->host = $host; + return $this; + } + + /** + * Gets the host + * + * @return string Host + */ + public function getHost() + { + return $this->host; + } + + /** + * Sets the user agent of the api client + * + * @param string $userAgent the user agent of the api client + * + * @throws \InvalidArgumentException + * @return $this + */ + public function setUserAgent($userAgent) + { + if (!is_string($userAgent)) { + throw new \InvalidArgumentException('User-agent must be a string.'); + } + + $this->userAgent = $userAgent; + return $this; + } + + /** + * Gets the user agent of the api client + * + * @return string user agent + */ + public function getUserAgent() + { + return $this->userAgent; + } + + /** + * Sets debug flag + * + * @param bool $debug Debug flag + * + * @return $this + */ + public function setDebug($debug) + { + $this->debug = $debug; + return $this; + } + + /** + * Gets the debug flag + * + * @return bool + */ + public function getDebug() + { + return $this->debug; + } + + /** + * Sets the debug file + * + * @param string $debugFile Debug file + * + * @return $this + */ + public function setDebugFile($debugFile) + { + $this->debugFile = $debugFile; + return $this; + } + + /** + * Gets the debug file + * + * @return string + */ + public function getDebugFile() + { + return $this->debugFile; + } + + /** + * Sets the temp folder path + * + * @param string $tempFolderPath Temp folder path + * + * @return $this + */ + public function setTempFolderPath($tempFolderPath) + { + $this->tempFolderPath = $tempFolderPath; + return $this; + } + + /** + * Gets the temp folder path + * + * @return string Temp folder path + */ + public function getTempFolderPath() + { + return $this->tempFolderPath; + } + + /** + * Gets the default configuration instance + * + * @return Configuration + */ + public static function getDefaultConfiguration() + { + if (self::$defaultConfiguration === null) { + self::$defaultConfiguration = new Configuration(); + } + + return self::$defaultConfiguration; + } + + /** + * Sets the default configuration instance + * + * @param Configuration $config An instance of the Configuration Object + * + * @return void + */ + public static function setDefaultConfiguration(Configuration $config) + { + self::$defaultConfiguration = $config; + } + + /** + * Gets the essential information for debugging + * + * @return string The report for debugging + */ + public static function toDebugReport() + { + $report = 'PHP SDK (OpenAPI\Client) Debug Report:' . PHP_EOL; + $report .= ' OS: ' . php_uname() . PHP_EOL; + $report .= ' PHP Version: ' . PHP_VERSION . PHP_EOL; + $report .= ' The version of the OpenAPI document: 1.1.0' . PHP_EOL; + $report .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL; + + return $report; + } + + /** + * Get API key (with prefix if set) + * + * @param string $apiKeyIdentifier name of apikey + * + * @return null|string API key with the prefix + */ + public function getApiKeyWithPrefix($apiKeyIdentifier) + { + $prefix = $this->getApiKeyPrefix($apiKeyIdentifier); + $apiKey = $this->getApiKey($apiKeyIdentifier); + + if ($apiKey === null) { + return null; + } + + if ($prefix === null) { + $keyWithPrefix = $apiKey; + } else { + $keyWithPrefix = $prefix . ' ' . $apiKey; + } + + return $keyWithPrefix; + } + + /** + * Returns an array of host settings + * + * @return array an array of host settings + */ + public function getHostSettings() + { + return [ + [ + "url" => "", + "description" => "No description provided", + ] + ]; + } + + /** + * Returns URL based on host settings, index and variables + * + * @param array $hostSettings array of host settings, generated from getHostSettings() or equivalent from the API clients + * @param int $hostIndex index of the host settings + * @param array|null $variables hash of variable and the corresponding value (optional) + * @return string URL based on host settings + */ + public static function getHostString(array $hostSettings, $hostIndex, ?array $variables = null) + { + if (null === $variables) { + $variables = []; + } + + // check array index out of bound + if ($hostIndex < 0 || $hostIndex >= count($hostSettings)) { + throw new \InvalidArgumentException("Invalid index $hostIndex when selecting the host. Must be less than ".count($hostSettings)); + } + + $host = $hostSettings[$hostIndex]; + $url = $host["url"]; + + // go through variable and assign a value + foreach ($host["variables"] ?? [] as $name => $variable) { + if (array_key_exists($name, $variables)) { // check to see if it's in the variables provided by the user + if (!isset($variable['enum_values']) || in_array($variables[$name], $variable["enum_values"], true)) { // check to see if the value is in the enum + $url = str_replace("{".$name."}", $variables[$name], $url); + } else { + throw new \InvalidArgumentException("The variable `$name` in the host URL has invalid value ".$variables[$name].". Must be ".join(',', $variable["enum_values"])."."); + } + } else { + // use default value + $url = str_replace("{".$name."}", $variable["default_value"], $url); + } + } + + return $url; + } + + /** + * Returns URL based on the index and variables + * + * @param int $index index of the host settings + * @param array|null $variables hash of variable and the corresponding value (optional) + * @return string URL based on host settings + */ + public function getHostFromSettings($index, $variables = null) + { + return self::getHostString($this->getHostSettings(), $index, $variables); + } +} diff --git a/packages/Types/lib/Generated/HeaderSelector.php b/packages/Types/lib/Generated/HeaderSelector.php new file mode 100644 index 0000000..355ad02 --- /dev/null +++ b/packages/Types/lib/Generated/HeaderSelector.php @@ -0,0 +1,273 @@ +selectAcceptHeader($accept); + if ($accept !== null) { + $headers['Accept'] = $accept; + } + + if (!$isMultipart) { + if($contentType === '') { + $contentType = 'application/json'; + } + + $headers['Content-Type'] = $contentType; + } + + return $headers; + } + + /** + * Return the header 'Accept' based on an array of Accept provided. + * + * @param string[] $accept Array of header + * + * @return null|string Accept (e.g. application/json) + */ + private function selectAcceptHeader(array $accept): ?string + { + # filter out empty entries + $accept = array_filter($accept); + + if (count($accept) === 0) { + return null; + } + + # If there's only one Accept header, just use it + if (count($accept) === 1) { + return reset($accept); + } + + # If none of the available Accept headers is of type "json", then just use all them + $headersWithJson = $this->selectJsonMimeList($accept); + if (count($headersWithJson) === 0) { + return implode(',', $accept); + } + + # If we got here, then we need add quality values (weight), as described in IETF RFC 9110, Items 12.4.2/12.5.1, + # to give the highest priority to json-like headers - recalculating the existing ones, if needed + return $this->getAcceptHeaderWithAdjustedWeight($accept, $headersWithJson); + } + + /** + * Detects whether a string contains a valid JSON mime type + * + * @param string $searchString + * @return bool + */ + public function isJsonMime(string $searchString): bool + { + return preg_match('~^application/(json|[\w!#$&.+-^_]+\+json)\s*(;|$)~', $searchString) === 1; + } + + /** + * Select all items from a list containing a JSON mime type + * + * @param array $mimeList + * @return array + */ + private function selectJsonMimeList(array $mimeList): array { + $jsonMimeList = []; + foreach ($mimeList as $mime) { + if($this->isJsonMime($mime)) { + $jsonMimeList[] = $mime; + } + } + return $jsonMimeList; + } + + + /** + * Create an Accept header string from the given "Accept" headers array, recalculating all weights + * + * @param string[] $accept Array of Accept Headers + * @param string[] $headersWithJson Array of Accept Headers of type "json" + * + * @return string "Accept" Header (e.g. "application/json, text/html; q=0.9") + */ + private function getAcceptHeaderWithAdjustedWeight(array $accept, array $headersWithJson): string + { + $processedHeaders = [ + 'withApplicationJson' => [], + 'withJson' => [], + 'withoutJson' => [], + ]; + + foreach ($accept as $header) { + + $headerData = $this->getHeaderAndWeight($header); + + if (stripos($headerData['header'], 'application/json') === 0) { + $processedHeaders['withApplicationJson'][] = $headerData; + } elseif (in_array($header, $headersWithJson, true)) { + $processedHeaders['withJson'][] = $headerData; + } else { + $processedHeaders['withoutJson'][] = $headerData; + } + } + + $acceptHeaders = []; + $currentWeight = 1000; + + $hasMoreThan28Headers = count($accept) > 28; + + foreach($processedHeaders as $headers) { + if (count($headers) > 0) { + $acceptHeaders[] = $this->adjustWeight($headers, $currentWeight, $hasMoreThan28Headers); + } + } + + $acceptHeaders = array_merge(...$acceptHeaders); + + return implode(',', $acceptHeaders); + } + + /** + * Given an Accept header, returns an associative array splitting the header and its weight + * + * @param string $header "Accept" Header + * + * @return array with the header and its weight + */ + private function getHeaderAndWeight(string $header): array + { + # matches headers with weight, splitting the header and the weight in $outputArray + if (preg_match('/(.*);\s*q=(1(?:\.0+)?|0\.\d+)$/', $header, $outputArray) === 1) { + $headerData = [ + 'header' => $outputArray[1], + 'weight' => (int)($outputArray[2] * 1000), + ]; + } else { + $headerData = [ + 'header' => trim($header), + 'weight' => 1000, + ]; + } + + return $headerData; + } + + /** + * @param array[] $headers + * @param float $currentWeight + * @param bool $hasMoreThan28Headers + * @return string[] array of adjusted "Accept" headers + */ + private function adjustWeight(array $headers, float &$currentWeight, bool $hasMoreThan28Headers): array + { + usort($headers, function (array $a, array $b) { + return $b['weight'] - $a['weight']; + }); + + $acceptHeaders = []; + foreach ($headers as $index => $header) { + if($index > 0 && $headers[$index - 1]['weight'] > $header['weight']) + { + $currentWeight = $this->getNextWeight($currentWeight, $hasMoreThan28Headers); + } + + $weight = $currentWeight; + + $acceptHeaders[] = $this->buildAcceptHeader($header['header'], $weight); + } + + $currentWeight = $this->getNextWeight($currentWeight, $hasMoreThan28Headers); + + return $acceptHeaders; + } + + /** + * @param string $header + * @param int $weight + * @return string + */ + private function buildAcceptHeader(string $header, int $weight): string + { + if($weight === 1000) { + return $header; + } + + return trim($header, '; ') . ';q=' . rtrim(sprintf('%0.3f', $weight / 1000), '0'); + } + + /** + * Calculate the next weight, based on the current one. + * + * If there are less than 28 "Accept" headers, the weights will be decreased by 1 on its highest significant digit, using the + * following formula: + * + * next weight = current weight - 10 ^ (floor(log(current weight - 1))) + * + * ( current weight minus ( 10 raised to the power of ( floor of (log to the base 10 of ( current weight minus 1 ) ) ) ) ) + * + * Starting from 1000, this generates the following series: + * + * 1000, 900, 800, 700, 600, 500, 400, 300, 200, 100, 90, 80, 70, 60, 50, 40, 30, 20, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1 + * + * The resulting quality codes are closer to the average "normal" usage of them (like "q=0.9", "q=0.8" and so on), but it only works + * if there is a maximum of 28 "Accept" headers. If we have more than that (which is extremely unlikely), then we fall back to a 1-by-1 + * decrement rule, which will result in quality codes like "q=0.999", "q=0.998" etc. + * + * @param int $currentWeight varying from 1 to 1000 (will be divided by 1000 to build the quality value) + * @param bool $hasMoreThan28Headers + * @return int + */ + public function getNextWeight(int $currentWeight, bool $hasMoreThan28Headers): int + { + if ($currentWeight <= 1) { + return 1; + } + + if ($hasMoreThan28Headers) { + return $currentWeight - 1; + } + + return $currentWeight - 10 ** floor( log10($currentWeight - 1) ); + } +} diff --git a/packages/Types/lib/Generated/Model/Base64Image.php b/packages/Types/lib/Generated/Model/Base64Image.php new file mode 100644 index 0000000..eb3a792 --- /dev/null +++ b/packages/Types/lib/Generated/Model/Base64Image.php @@ -0,0 +1,409 @@ + + */ +class Base64Image implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Base64Image'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'data' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'data' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('data', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return string|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param string|null $data Image's content, base64 encoded + * + * @return self + */ + public function setData($data) + { + if (is_null($data)) { + throw new \InvalidArgumentException('non-nullable data cannot be null'); + } + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/BaseMatch.php b/packages/Types/lib/Generated/Model/BaseMatch.php new file mode 100644 index 0000000..48b1a10 --- /dev/null +++ b/packages/Types/lib/Generated/Model/BaseMatch.php @@ -0,0 +1,409 @@ + + */ +class BaseMatch implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BaseMatch'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'negated' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'negated' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'negated' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'negated' => 'negated' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'negated' => 'setNegated' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'negated' => 'getNegated' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('negated', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets negated + * + * @return bool|null + */ + public function getNegated() + { + return $this->container['negated']; + } + + /** + * Sets negated + * + * @param bool|null $negated When true, the rule result is gonna be negated. example: `url contains \"test\"` with *negated* = true becomes `url does not contain \"test\"` + * + * @return self + */ + public function setNegated($negated) + { + if (is_null($negated)) { + throw new \InvalidArgumentException('non-nullable negated cannot be null'); + } + $this->container['negated'] = $negated; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/BaseRule.php b/packages/Types/lib/Generated/Model/BaseRule.php new file mode 100644 index 0000000..d281733 --- /dev/null +++ b/packages/Types/lib/Generated/Model/BaseRule.php @@ -0,0 +1,412 @@ + + */ +class BaseRule implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BaseRule'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'rule_type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'rule_type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'rule_type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'rule_type' => 'rule_type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'rule_type' => 'setRuleType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'rule_type' => 'getRuleType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('rule_type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['rule_type'] === null) { + $invalidProperties[] = "'rule_type' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets rule_type + * + * @return string + */ + public function getRuleType() + { + return $this->container['rule_type']; + } + + /** + * Sets rule_type + * + * @param string $rule_type It defines the type of the rule + * + * @return self + */ + public function setRuleType($rule_type) + { + if (is_null($rule_type)) { + throw new \InvalidArgumentException('non-nullable rule_type cannot be null'); + } + $this->container['rule_type'] = $rule_type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/BaseRuleWithBooleanValue.php b/packages/Types/lib/Generated/Model/BaseRuleWithBooleanValue.php new file mode 100644 index 0000000..32f36cb --- /dev/null +++ b/packages/Types/lib/Generated/Model/BaseRuleWithBooleanValue.php @@ -0,0 +1,446 @@ + + */ +class BaseRuleWithBooleanValue implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BaseRuleWithBooleanValue'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'rule_type' => 'string', + 'value' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'rule_type' => null, + 'value' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'rule_type' => false, + 'value' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'rule_type' => 'rule_type', + 'value' => 'value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'rule_type' => 'setRuleType', + 'value' => 'setValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'rule_type' => 'getRuleType', + 'value' => 'getValue' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('rule_type', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['rule_type'] === null) { + $invalidProperties[] = "'rule_type' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets rule_type + * + * @return string + */ + public function getRuleType() + { + return $this->container['rule_type']; + } + + /** + * Sets rule_type + * + * @param string $rule_type It defines the type of the rule + * + * @return self + */ + public function setRuleType($rule_type) + { + if (is_null($rule_type)) { + throw new \InvalidArgumentException('non-nullable rule_type cannot be null'); + } + $this->container['rule_type'] = $rule_type; + + return $this; + } + + /** + * Gets value + * + * @return bool|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param bool|null $value The value used to match against 'rule_type' using 'matching' + * + * @return self + */ + public function setValue($value) + { + if (is_null($value)) { + throw new \InvalidArgumentException('non-nullable value cannot be null'); + } + $this->container['value'] = $value; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/BaseRuleWithBrowserNameValue.php b/packages/Types/lib/Generated/Model/BaseRuleWithBrowserNameValue.php new file mode 100644 index 0000000..89e7182 --- /dev/null +++ b/packages/Types/lib/Generated/Model/BaseRuleWithBrowserNameValue.php @@ -0,0 +1,490 @@ + + */ +class BaseRuleWithBrowserNameValue implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BaseRuleWithBrowserNameValue'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'rule_type' => 'string', + 'value' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'rule_type' => null, + 'value' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'rule_type' => false, + 'value' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'rule_type' => 'rule_type', + 'value' => 'value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'rule_type' => 'setRuleType', + 'value' => 'setValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'rule_type' => 'getRuleType', + 'value' => 'getValue' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const VALUE_CHROME = 'chrome'; + public const VALUE_MICROSOFT_IE = 'microsoft_ie'; + public const VALUE_FIREFOX = 'firefox'; + public const VALUE_MICROSOFT_EDGE = 'microsoft_edge'; + public const VALUE_MOZILLA = 'mozilla'; + public const VALUE_OPERA = 'opera'; + public const VALUE_SAFARI = 'safari'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getValueAllowableValues() + { + return [ + self::VALUE_CHROME, + self::VALUE_MICROSOFT_IE, + self::VALUE_FIREFOX, + self::VALUE_MICROSOFT_EDGE, + self::VALUE_MOZILLA, + self::VALUE_OPERA, + self::VALUE_SAFARI, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('rule_type', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['rule_type'] === null) { + $invalidProperties[] = "'rule_type' can't be null"; + } + $allowedValues = $this->getValueAllowableValues(); + if (!is_null($this->container['value']) && !in_array($this->container['value'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'value', must be one of '%s'", + $this->container['value'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets rule_type + * + * @return string + */ + public function getRuleType() + { + return $this->container['rule_type']; + } + + /** + * Sets rule_type + * + * @param string $rule_type It defines the type of the rule + * + * @return self + */ + public function setRuleType($rule_type) + { + if (is_null($rule_type)) { + throw new \InvalidArgumentException('non-nullable rule_type cannot be null'); + } + $this->container['rule_type'] = $rule_type; + + return $this; + } + + /** + * Gets value + * + * @return string|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param string|null $value Browser name used for matching + * + * @return self + */ + public function setValue($value) + { + if (is_null($value)) { + throw new \InvalidArgumentException('non-nullable value cannot be null'); + } + $allowedValues = $this->getValueAllowableValues(); + if (!in_array($value, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'value', must be one of '%s'", + $value, + implode("', '", $allowedValues) + ) + ); + } + $this->container['value'] = $value; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/BaseRuleWithCountryCodeValue.php b/packages/Types/lib/Generated/Model/BaseRuleWithCountryCodeValue.php new file mode 100644 index 0000000..f4d1416 --- /dev/null +++ b/packages/Types/lib/Generated/Model/BaseRuleWithCountryCodeValue.php @@ -0,0 +1,461 @@ + + */ +class BaseRuleWithCountryCodeValue implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BaseRuleWithCountryCodeValue'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'rule_type' => 'string', + 'value' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'rule_type' => null, + 'value' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'rule_type' => false, + 'value' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'rule_type' => 'rule_type', + 'value' => 'value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'rule_type' => 'setRuleType', + 'value' => 'setValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'rule_type' => 'getRuleType', + 'value' => 'getValue' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('rule_type', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['rule_type'] === null) { + $invalidProperties[] = "'rule_type' can't be null"; + } + if (!is_null($this->container['value']) && (mb_strlen($this->container['value']) > 2)) { + $invalidProperties[] = "invalid value for 'value', the character length must be smaller than or equal to 2."; + } + + if (!is_null($this->container['value']) && (mb_strlen($this->container['value']) < 2)) { + $invalidProperties[] = "invalid value for 'value', the character length must be bigger than or equal to 2."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets rule_type + * + * @return string + */ + public function getRuleType() + { + return $this->container['rule_type']; + } + + /** + * Sets rule_type + * + * @param string $rule_type It defines the type of the rule + * + * @return self + */ + public function setRuleType($rule_type) + { + if (is_null($rule_type)) { + throw new \InvalidArgumentException('non-nullable rule_type cannot be null'); + } + $this->container['rule_type'] = $rule_type; + + return $this; + } + + /** + * Gets value + * + * @return string|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param string|null $value The 2 letter ISO country code used for matching + * + * @return self + */ + public function setValue($value) + { + if (is_null($value)) { + throw new \InvalidArgumentException('non-nullable value cannot be null'); + } + if ((mb_strlen($value) > 2)) { + throw new \InvalidArgumentException('invalid length for $value when calling BaseRuleWithCountryCodeValue., must be smaller than or equal to 2.'); + } + if ((mb_strlen($value) < 2)) { + throw new \InvalidArgumentException('invalid length for $value when calling BaseRuleWithCountryCodeValue., must be bigger than or equal to 2.'); + } + + $this->container['value'] = $value; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/BaseRuleWithDayOfWeekValue.php b/packages/Types/lib/Generated/Model/BaseRuleWithDayOfWeekValue.php new file mode 100644 index 0000000..49ff8fd --- /dev/null +++ b/packages/Types/lib/Generated/Model/BaseRuleWithDayOfWeekValue.php @@ -0,0 +1,462 @@ + + */ +class BaseRuleWithDayOfWeekValue implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BaseRuleWithDayOfWeekValue'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'rule_type' => 'string', + 'value' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'rule_type' => null, + 'value' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'rule_type' => false, + 'value' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'rule_type' => 'rule_type', + 'value' => 'value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'rule_type' => 'setRuleType', + 'value' => 'setValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'rule_type' => 'getRuleType', + 'value' => 'getValue' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('rule_type', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['rule_type'] === null) { + $invalidProperties[] = "'rule_type' can't be null"; + } + if (!is_null($this->container['value']) && ($this->container['value'] > 7)) { + $invalidProperties[] = "invalid value for 'value', must be smaller than or equal to 7."; + } + + if (!is_null($this->container['value']) && ($this->container['value'] < 1)) { + $invalidProperties[] = "invalid value for 'value', must be bigger than or equal to 1."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets rule_type + * + * @return string + */ + public function getRuleType() + { + return $this->container['rule_type']; + } + + /** + * Sets rule_type + * + * @param string $rule_type It defines the type of the rule + * + * @return self + */ + public function setRuleType($rule_type) + { + if (is_null($rule_type)) { + throw new \InvalidArgumentException('non-nullable rule_type cannot be null'); + } + $this->container['rule_type'] = $rule_type; + + return $this; + } + + /** + * Gets value + * + * @return float|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param float|null $value Day of week used for matching + * + * @return self + */ + public function setValue($value) + { + if (is_null($value)) { + throw new \InvalidArgumentException('non-nullable value cannot be null'); + } + + if (($value > 7)) { + throw new \InvalidArgumentException('invalid value for $value when calling BaseRuleWithDayOfWeekValue., must be smaller than or equal to 7.'); + } + if (($value < 1)) { + throw new \InvalidArgumentException('invalid value for $value when calling BaseRuleWithDayOfWeekValue., must be bigger than or equal to 1.'); + } + + $this->container['value'] = $value; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/BaseRuleWithExperienceBucketedValue.php b/packages/Types/lib/Generated/Model/BaseRuleWithExperienceBucketedValue.php new file mode 100644 index 0000000..c244117 --- /dev/null +++ b/packages/Types/lib/Generated/Model/BaseRuleWithExperienceBucketedValue.php @@ -0,0 +1,446 @@ + + */ +class BaseRuleWithExperienceBucketedValue implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BaseRuleWithExperienceBucketedValue'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'rule_type' => 'string', + 'value' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'rule_type' => null, + 'value' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'rule_type' => false, + 'value' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'rule_type' => 'rule_type', + 'value' => 'value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'rule_type' => 'setRuleType', + 'value' => 'setValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'rule_type' => 'getRuleType', + 'value' => 'getValue' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('rule_type', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['rule_type'] === null) { + $invalidProperties[] = "'rule_type' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets rule_type + * + * @return string + */ + public function getRuleType() + { + return $this->container['rule_type']; + } + + /** + * Sets rule_type + * + * @param string $rule_type It defines the type of the rule + * + * @return self + */ + public function setRuleType($rule_type) + { + if (is_null($rule_type)) { + throw new \InvalidArgumentException('non-nullable rule_type cannot be null'); + } + $this->container['rule_type'] = $rule_type; + + return $this; + } + + /** + * Gets value + * + * @return float|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param float|null $value ID of the experience used for matching + * + * @return self + */ + public function setValue($value) + { + if (is_null($value)) { + throw new \InvalidArgumentException('non-nullable value cannot be null'); + } + $this->container['value'] = $value; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/BaseRuleWithGoalTriggeredValue.php b/packages/Types/lib/Generated/Model/BaseRuleWithGoalTriggeredValue.php new file mode 100644 index 0000000..65e88e6 --- /dev/null +++ b/packages/Types/lib/Generated/Model/BaseRuleWithGoalTriggeredValue.php @@ -0,0 +1,446 @@ + + */ +class BaseRuleWithGoalTriggeredValue implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BaseRuleWithGoalTriggeredValue'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'rule_type' => 'string', + 'value' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'rule_type' => null, + 'value' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'rule_type' => false, + 'value' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'rule_type' => 'rule_type', + 'value' => 'value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'rule_type' => 'setRuleType', + 'value' => 'setValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'rule_type' => 'getRuleType', + 'value' => 'getValue' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('rule_type', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['rule_type'] === null) { + $invalidProperties[] = "'rule_type' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets rule_type + * + * @return string + */ + public function getRuleType() + { + return $this->container['rule_type']; + } + + /** + * Sets rule_type + * + * @param string $rule_type It defines the type of the rule + * + * @return self + */ + public function setRuleType($rule_type) + { + if (is_null($rule_type)) { + throw new \InvalidArgumentException('non-nullable rule_type cannot be null'); + } + $this->container['rule_type'] = $rule_type; + + return $this; + } + + /** + * Gets value + * + * @return float|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param float|null $value ID of the goal used for matching + * + * @return self + */ + public function setValue($value) + { + if (is_null($value)) { + throw new \InvalidArgumentException('non-nullable value cannot be null'); + } + $this->container['value'] = $value; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/BaseRuleWithHourOfDayValue.php b/packages/Types/lib/Generated/Model/BaseRuleWithHourOfDayValue.php new file mode 100644 index 0000000..1cd102e --- /dev/null +++ b/packages/Types/lib/Generated/Model/BaseRuleWithHourOfDayValue.php @@ -0,0 +1,462 @@ + + */ +class BaseRuleWithHourOfDayValue implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BaseRuleWithHourOfDayValue'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'rule_type' => 'string', + 'value' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'rule_type' => null, + 'value' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'rule_type' => false, + 'value' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'rule_type' => 'rule_type', + 'value' => 'value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'rule_type' => 'setRuleType', + 'value' => 'setValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'rule_type' => 'getRuleType', + 'value' => 'getValue' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('rule_type', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['rule_type'] === null) { + $invalidProperties[] = "'rule_type' can't be null"; + } + if (!is_null($this->container['value']) && ($this->container['value'] > 24)) { + $invalidProperties[] = "invalid value for 'value', must be smaller than or equal to 24."; + } + + if (!is_null($this->container['value']) && ($this->container['value'] < 0)) { + $invalidProperties[] = "invalid value for 'value', must be bigger than or equal to 0."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets rule_type + * + * @return string + */ + public function getRuleType() + { + return $this->container['rule_type']; + } + + /** + * Sets rule_type + * + * @param string $rule_type It defines the type of the rule + * + * @return self + */ + public function setRuleType($rule_type) + { + if (is_null($rule_type)) { + throw new \InvalidArgumentException('non-nullable rule_type cannot be null'); + } + $this->container['rule_type'] = $rule_type; + + return $this; + } + + /** + * Gets value + * + * @return float|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param float|null $value Hour of day used for matching + * + * @return self + */ + public function setValue($value) + { + if (is_null($value)) { + throw new \InvalidArgumentException('non-nullable value cannot be null'); + } + + if (($value > 24)) { + throw new \InvalidArgumentException('invalid value for $value when calling BaseRuleWithHourOfDayValue., must be smaller than or equal to 24.'); + } + if (($value < 0)) { + throw new \InvalidArgumentException('invalid value for $value when calling BaseRuleWithHourOfDayValue., must be bigger than or equal to 0.'); + } + + $this->container['value'] = $value; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/BaseRuleWithJsCodeValue.php b/packages/Types/lib/Generated/Model/BaseRuleWithJsCodeValue.php new file mode 100644 index 0000000..8e3f321 --- /dev/null +++ b/packages/Types/lib/Generated/Model/BaseRuleWithJsCodeValue.php @@ -0,0 +1,446 @@ + + */ +class BaseRuleWithJsCodeValue implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BaseRuleWithJsCodeValue'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'rule_type' => 'string', + 'value' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'rule_type' => null, + 'value' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'rule_type' => false, + 'value' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'rule_type' => 'rule_type', + 'value' => 'value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'rule_type' => 'setRuleType', + 'value' => 'setValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'rule_type' => 'getRuleType', + 'value' => 'getValue' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('rule_type', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['rule_type'] === null) { + $invalidProperties[] = "'rule_type' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets rule_type + * + * @return string + */ + public function getRuleType() + { + return $this->container['rule_type']; + } + + /** + * Sets rule_type + * + * @param string $rule_type It defines the type of the rule + * + * @return self + */ + public function setRuleType($rule_type) + { + if (is_null($rule_type)) { + throw new \InvalidArgumentException('non-nullable rule_type cannot be null'); + } + $this->container['rule_type'] = $rule_type; + + return $this; + } + + /** + * Gets value + * + * @return string|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param string|null $value The JS code that would be executed when rule is checked. The return value of this JS code is what is gonna be matched against **true**(or **false** if **matching.negated = true** is provided) + * + * @return self + */ + public function setValue($value) + { + if (is_null($value)) { + throw new \InvalidArgumentException('non-nullable value cannot be null'); + } + $this->container['value'] = $value; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/BaseRuleWithLanguageCodeValue.php b/packages/Types/lib/Generated/Model/BaseRuleWithLanguageCodeValue.php new file mode 100644 index 0000000..dc5964f --- /dev/null +++ b/packages/Types/lib/Generated/Model/BaseRuleWithLanguageCodeValue.php @@ -0,0 +1,461 @@ + + */ +class BaseRuleWithLanguageCodeValue implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BaseRuleWithLanguageCodeValue'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'rule_type' => 'string', + 'value' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'rule_type' => null, + 'value' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'rule_type' => false, + 'value' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'rule_type' => 'rule_type', + 'value' => 'value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'rule_type' => 'setRuleType', + 'value' => 'setValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'rule_type' => 'getRuleType', + 'value' => 'getValue' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('rule_type', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['rule_type'] === null) { + $invalidProperties[] = "'rule_type' can't be null"; + } + if (!is_null($this->container['value']) && (mb_strlen($this->container['value']) > 2)) { + $invalidProperties[] = "invalid value for 'value', the character length must be smaller than or equal to 2."; + } + + if (!is_null($this->container['value']) && (mb_strlen($this->container['value']) < 2)) { + $invalidProperties[] = "invalid value for 'value', the character length must be bigger than or equal to 2."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets rule_type + * + * @return string + */ + public function getRuleType() + { + return $this->container['rule_type']; + } + + /** + * Sets rule_type + * + * @param string $rule_type It defines the type of the rule + * + * @return self + */ + public function setRuleType($rule_type) + { + if (is_null($rule_type)) { + throw new \InvalidArgumentException('non-nullable rule_type cannot be null'); + } + $this->container['rule_type'] = $rule_type; + + return $this; + } + + /** + * Gets value + * + * @return string|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param string|null $value The 2 letter ISO language code used for matching + * + * @return self + */ + public function setValue($value) + { + if (is_null($value)) { + throw new \InvalidArgumentException('non-nullable value cannot be null'); + } + if ((mb_strlen($value) > 2)) { + throw new \InvalidArgumentException('invalid length for $value when calling BaseRuleWithLanguageCodeValue., must be smaller than or equal to 2.'); + } + if ((mb_strlen($value) < 2)) { + throw new \InvalidArgumentException('invalid length for $value when calling BaseRuleWithLanguageCodeValue., must be bigger than or equal to 2.'); + } + + $this->container['value'] = $value; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/BaseRuleWithMinuteOfHourValue.php b/packages/Types/lib/Generated/Model/BaseRuleWithMinuteOfHourValue.php new file mode 100644 index 0000000..8328f7c --- /dev/null +++ b/packages/Types/lib/Generated/Model/BaseRuleWithMinuteOfHourValue.php @@ -0,0 +1,462 @@ + + */ +class BaseRuleWithMinuteOfHourValue implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BaseRuleWithMinuteOfHourValue'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'rule_type' => 'string', + 'value' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'rule_type' => null, + 'value' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'rule_type' => false, + 'value' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'rule_type' => 'rule_type', + 'value' => 'value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'rule_type' => 'setRuleType', + 'value' => 'setValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'rule_type' => 'getRuleType', + 'value' => 'getValue' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('rule_type', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['rule_type'] === null) { + $invalidProperties[] = "'rule_type' can't be null"; + } + if (!is_null($this->container['value']) && ($this->container['value'] > 60)) { + $invalidProperties[] = "invalid value for 'value', must be smaller than or equal to 60."; + } + + if (!is_null($this->container['value']) && ($this->container['value'] < 1)) { + $invalidProperties[] = "invalid value for 'value', must be bigger than or equal to 1."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets rule_type + * + * @return string + */ + public function getRuleType() + { + return $this->container['rule_type']; + } + + /** + * Sets rule_type + * + * @param string $rule_type It defines the type of the rule + * + * @return self + */ + public function setRuleType($rule_type) + { + if (is_null($rule_type)) { + throw new \InvalidArgumentException('non-nullable rule_type cannot be null'); + } + $this->container['rule_type'] = $rule_type; + + return $this; + } + + /** + * Gets value + * + * @return float|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param float|null $value Minute of hour used for matching + * + * @return self + */ + public function setValue($value) + { + if (is_null($value)) { + throw new \InvalidArgumentException('non-nullable value cannot be null'); + } + + if (($value > 60)) { + throw new \InvalidArgumentException('invalid value for $value when calling BaseRuleWithMinuteOfHourValue., must be smaller than or equal to 60.'); + } + if (($value < 1)) { + throw new \InvalidArgumentException('invalid value for $value when calling BaseRuleWithMinuteOfHourValue., must be bigger than or equal to 1.'); + } + + $this->container['value'] = $value; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/BaseRuleWithNumericValue.php b/packages/Types/lib/Generated/Model/BaseRuleWithNumericValue.php new file mode 100644 index 0000000..20078d6 --- /dev/null +++ b/packages/Types/lib/Generated/Model/BaseRuleWithNumericValue.php @@ -0,0 +1,446 @@ + + */ +class BaseRuleWithNumericValue implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BaseRuleWithNumericValue'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'rule_type' => 'string', + 'value' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'rule_type' => null, + 'value' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'rule_type' => false, + 'value' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'rule_type' => 'rule_type', + 'value' => 'value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'rule_type' => 'setRuleType', + 'value' => 'setValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'rule_type' => 'getRuleType', + 'value' => 'getValue' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('rule_type', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['rule_type'] === null) { + $invalidProperties[] = "'rule_type' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets rule_type + * + * @return string + */ + public function getRuleType() + { + return $this->container['rule_type']; + } + + /** + * Sets rule_type + * + * @param string $rule_type It defines the type of the rule + * + * @return self + */ + public function setRuleType($rule_type) + { + if (is_null($rule_type)) { + throw new \InvalidArgumentException('non-nullable rule_type cannot be null'); + } + $this->container['rule_type'] = $rule_type; + + return $this; + } + + /** + * Gets value + * + * @return float|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param float|null $value The value used to match against 'rule_type' using 'matching' + * + * @return self + */ + public function setValue($value) + { + if (is_null($value)) { + throw new \InvalidArgumentException('non-nullable value cannot be null'); + } + $this->container['value'] = $value; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/BaseRuleWithOsValue.php b/packages/Types/lib/Generated/Model/BaseRuleWithOsValue.php new file mode 100644 index 0000000..a5faa31 --- /dev/null +++ b/packages/Types/lib/Generated/Model/BaseRuleWithOsValue.php @@ -0,0 +1,490 @@ + + */ +class BaseRuleWithOsValue implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BaseRuleWithOsValue'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'rule_type' => 'string', + 'value' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'rule_type' => null, + 'value' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'rule_type' => false, + 'value' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'rule_type' => 'rule_type', + 'value' => 'value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'rule_type' => 'setRuleType', + 'value' => 'setValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'rule_type' => 'getRuleType', + 'value' => 'getValue' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const VALUE_ANDROID = 'android'; + public const VALUE_IPHONE = 'iphone'; + public const VALUE_IPOD = 'ipod'; + public const VALUE_IPAD = 'ipad'; + public const VALUE_WINDOWS = 'windows'; + public const VALUE_MACOS = 'macos'; + public const VALUE_LINUX = 'linux'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getValueAllowableValues() + { + return [ + self::VALUE_ANDROID, + self::VALUE_IPHONE, + self::VALUE_IPOD, + self::VALUE_IPAD, + self::VALUE_WINDOWS, + self::VALUE_MACOS, + self::VALUE_LINUX, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('rule_type', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['rule_type'] === null) { + $invalidProperties[] = "'rule_type' can't be null"; + } + $allowedValues = $this->getValueAllowableValues(); + if (!is_null($this->container['value']) && !in_array($this->container['value'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'value', must be one of '%s'", + $this->container['value'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets rule_type + * + * @return string + */ + public function getRuleType() + { + return $this->container['rule_type']; + } + + /** + * Sets rule_type + * + * @param string $rule_type It defines the type of the rule + * + * @return self + */ + public function setRuleType($rule_type) + { + if (is_null($rule_type)) { + throw new \InvalidArgumentException('non-nullable rule_type cannot be null'); + } + $this->container['rule_type'] = $rule_type; + + return $this; + } + + /** + * Gets value + * + * @return string|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param string|null $value Operating System name used for matching + * + * @return self + */ + public function setValue($value) + { + if (is_null($value)) { + throw new \InvalidArgumentException('non-nullable value cannot be null'); + } + $allowedValues = $this->getValueAllowableValues(); + if (!in_array($value, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'value', must be one of '%s'", + $value, + implode("', '", $allowedValues) + ) + ); + } + $this->container['value'] = $value; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/BaseRuleWithSegmentBucketedValue.php b/packages/Types/lib/Generated/Model/BaseRuleWithSegmentBucketedValue.php new file mode 100644 index 0000000..ad93d1b --- /dev/null +++ b/packages/Types/lib/Generated/Model/BaseRuleWithSegmentBucketedValue.php @@ -0,0 +1,446 @@ + + */ +class BaseRuleWithSegmentBucketedValue implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BaseRuleWithSegmentBucketedValue'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'rule_type' => 'string', + 'value' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'rule_type' => null, + 'value' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'rule_type' => false, + 'value' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'rule_type' => 'rule_type', + 'value' => 'value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'rule_type' => 'setRuleType', + 'value' => 'setValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'rule_type' => 'getRuleType', + 'value' => 'getValue' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('rule_type', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['rule_type'] === null) { + $invalidProperties[] = "'rule_type' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets rule_type + * + * @return string + */ + public function getRuleType() + { + return $this->container['rule_type']; + } + + /** + * Sets rule_type + * + * @param string $rule_type It defines the type of the rule + * + * @return self + */ + public function setRuleType($rule_type) + { + if (is_null($rule_type)) { + throw new \InvalidArgumentException('non-nullable rule_type cannot be null'); + } + $this->container['rule_type'] = $rule_type; + + return $this; + } + + /** + * Gets value + * + * @return float|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param float|null $value ID of the segment used for matching + * + * @return self + */ + public function setValue($value) + { + if (is_null($value)) { + throw new \InvalidArgumentException('non-nullable value cannot be null'); + } + $this->container['value'] = $value; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/BaseRuleWithStringValue.php b/packages/Types/lib/Generated/Model/BaseRuleWithStringValue.php new file mode 100644 index 0000000..e473f69 --- /dev/null +++ b/packages/Types/lib/Generated/Model/BaseRuleWithStringValue.php @@ -0,0 +1,446 @@ + + */ +class BaseRuleWithStringValue implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BaseRuleWithStringValue'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'rule_type' => 'string', + 'value' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'rule_type' => null, + 'value' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'rule_type' => false, + 'value' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'rule_type' => 'rule_type', + 'value' => 'value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'rule_type' => 'setRuleType', + 'value' => 'setValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'rule_type' => 'getRuleType', + 'value' => 'getValue' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('rule_type', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['rule_type'] === null) { + $invalidProperties[] = "'rule_type' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets rule_type + * + * @return string + */ + public function getRuleType() + { + return $this->container['rule_type']; + } + + /** + * Sets rule_type + * + * @param string $rule_type It defines the type of the rule + * + * @return self + */ + public function setRuleType($rule_type) + { + if (is_null($rule_type)) { + throw new \InvalidArgumentException('non-nullable rule_type cannot be null'); + } + $this->container['rule_type'] = $rule_type; + + return $this; + } + + /** + * Gets value + * + * @return string|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param string|null $value The value used to match against 'rule_type' using 'matching' + * + * @return self + */ + public function setValue($value) + { + if (is_null($value)) { + throw new \InvalidArgumentException('non-nullable value cannot be null'); + } + $this->container['value'] = $value; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/BaseRuleWithVisitorTypeValue.php b/packages/Types/lib/Generated/Model/BaseRuleWithVisitorTypeValue.php new file mode 100644 index 0000000..c566a76 --- /dev/null +++ b/packages/Types/lib/Generated/Model/BaseRuleWithVisitorTypeValue.php @@ -0,0 +1,480 @@ + + */ +class BaseRuleWithVisitorTypeValue implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BaseRuleWithVisitorTypeValue'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'rule_type' => 'string', + 'value' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'rule_type' => null, + 'value' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'rule_type' => false, + 'value' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'rule_type' => 'rule_type', + 'value' => 'value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'rule_type' => 'setRuleType', + 'value' => 'setValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'rule_type' => 'getRuleType', + 'value' => 'getValue' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const VALUE__NEW = 'new'; + public const VALUE_RETURNING = 'returning'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getValueAllowableValues() + { + return [ + self::VALUE__NEW, + self::VALUE_RETURNING, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('rule_type', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['rule_type'] === null) { + $invalidProperties[] = "'rule_type' can't be null"; + } + $allowedValues = $this->getValueAllowableValues(); + if (!is_null($this->container['value']) && !in_array($this->container['value'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'value', must be one of '%s'", + $this->container['value'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets rule_type + * + * @return string + */ + public function getRuleType() + { + return $this->container['rule_type']; + } + + /** + * Sets rule_type + * + * @param string $rule_type It defines the type of the rule + * + * @return self + */ + public function setRuleType($rule_type) + { + if (is_null($rule_type)) { + throw new \InvalidArgumentException('non-nullable rule_type cannot be null'); + } + $this->container['rule_type'] = $rule_type; + + return $this; + } + + /** + * Gets value + * + * @return string|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param string|null $value Type of the visitors + * + * @return self + */ + public function setValue($value) + { + if (is_null($value)) { + throw new \InvalidArgumentException('non-nullable value cannot be null'); + } + $allowedValues = $this->getValueAllowableValues(); + if (!in_array($value, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'value', must be one of '%s'", + $value, + implode("', '", $allowedValues) + ) + ); + } + $this->container['value'] = $value; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/BaseRuleWithWeatherConditionValue.php b/packages/Types/lib/Generated/Model/BaseRuleWithWeatherConditionValue.php new file mode 100644 index 0000000..baed73c --- /dev/null +++ b/packages/Types/lib/Generated/Model/BaseRuleWithWeatherConditionValue.php @@ -0,0 +1,446 @@ + + */ +class BaseRuleWithWeatherConditionValue implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BaseRuleWithWeatherConditionValue'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'rule_type' => 'string', + 'value' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'rule_type' => null, + 'value' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'rule_type' => false, + 'value' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'rule_type' => 'rule_type', + 'value' => 'value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'rule_type' => 'setRuleType', + 'value' => 'setValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'rule_type' => 'getRuleType', + 'value' => 'getValue' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('rule_type', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['rule_type'] === null) { + $invalidProperties[] = "'rule_type' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets rule_type + * + * @return string + */ + public function getRuleType() + { + return $this->container['rule_type']; + } + + /** + * Sets rule_type + * + * @param string $rule_type It defines the type of the rule + * + * @return self + */ + public function setRuleType($rule_type) + { + if (is_null($rule_type)) { + throw new \InvalidArgumentException('non-nullable rule_type cannot be null'); + } + $this->container['rule_type'] = $rule_type; + + return $this; + } + + /** + * Gets value + * + * @return string|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param string|null $value Weather Condition name used for matching. Full or partial condition. The weather provider used by Convert detects the following conditions: - Blizzard - Blowing snow - Cloudy - Fog - Freezing drizzle - Freezing fog - Heavy freezing drizzle - Heavy rain - Heavy rain at times - Light drizzle - Light freezing rain - Light rain - Mist - Moderate rain - Moderate rain at times - Overcast - Partly cloudy - Patchy freezing drizzle possible - Patchy light drizzle - Patchy light rain - Patchy rain possible - Patchy sleet possible - Patchy snow possible - Sunny - Thundery outbreaks possible + * + * @return self + */ + public function setValue($value) + { + if (is_null($value)) { + throw new \InvalidArgumentException('non-nullable value cannot be null'); + } + $this->container['value'] = $value; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/BoolMatchRulesTypes.php b/packages/Types/lib/Generated/Model/BoolMatchRulesTypes.php new file mode 100644 index 0000000..87c12d6 --- /dev/null +++ b/packages/Types/lib/Generated/Model/BoolMatchRulesTypes.php @@ -0,0 +1,68 @@ + + */ +class BrowserNameMatchRule implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BrowserNameMatchRule'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'rule_type' => '\OpenAPI\Client\Model\BrowserNameMatchRulesTypes', + 'value' => 'string', + 'matching' => '\OpenAPI\Client\Model\BrowserNameMatchRuleAllOfMatching' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'rule_type' => null, + 'value' => null, + 'matching' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'rule_type' => false, + 'value' => false, + 'matching' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'rule_type' => 'rule_type', + 'value' => 'value', + 'matching' => 'matching' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'rule_type' => 'setRuleType', + 'value' => 'setValue', + 'matching' => 'setMatching' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'rule_type' => 'getRuleType', + 'value' => 'getValue', + 'matching' => 'getMatching' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const VALUE_CHROME = 'chrome'; + public const VALUE_MICROSOFT_IE = 'microsoft_ie'; + public const VALUE_FIREFOX = 'firefox'; + public const VALUE_MICROSOFT_EDGE = 'microsoft_edge'; + public const VALUE_MOZILLA = 'mozilla'; + public const VALUE_OPERA = 'opera'; + public const VALUE_SAFARI = 'safari'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getValueAllowableValues() + { + return [ + self::VALUE_CHROME, + self::VALUE_MICROSOFT_IE, + self::VALUE_FIREFOX, + self::VALUE_MICROSOFT_EDGE, + self::VALUE_MOZILLA, + self::VALUE_OPERA, + self::VALUE_SAFARI, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('rule_type', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); + $this->setIfExists('matching', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['rule_type'] === null) { + $invalidProperties[] = "'rule_type' can't be null"; + } + $allowedValues = $this->getValueAllowableValues(); + if (!is_null($this->container['value']) && !in_array($this->container['value'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'value', must be one of '%s'", + $this->container['value'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets rule_type + * + * @return \OpenAPI\Client\Model\BrowserNameMatchRulesTypes + */ + public function getRuleType() + { + return $this->container['rule_type']; + } + + /** + * Sets rule_type + * + * @param \OpenAPI\Client\Model\BrowserNameMatchRulesTypes $rule_type rule_type + * + * @return self + */ + public function setRuleType($rule_type) + { + if (is_null($rule_type)) { + throw new \InvalidArgumentException('non-nullable rule_type cannot be null'); + } + $this->container['rule_type'] = $rule_type; + + return $this; + } + + /** + * Gets value + * + * @return string|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param string|null $value Browser name used for matching + * + * @return self + */ + public function setValue($value) + { + if (is_null($value)) { + throw new \InvalidArgumentException('non-nullable value cannot be null'); + } + $allowedValues = $this->getValueAllowableValues(); + if (!in_array($value, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'value', must be one of '%s'", + $value, + implode("', '", $allowedValues) + ) + ); + } + $this->container['value'] = $value; + + return $this; + } + + /** + * Gets matching + * + * @return \OpenAPI\Client\Model\BrowserNameMatchRuleAllOfMatching|null + */ + public function getMatching() + { + return $this->container['matching']; + } + + /** + * Sets matching + * + * @param \OpenAPI\Client\Model\BrowserNameMatchRuleAllOfMatching|null $matching matching + * + * @return self + */ + public function setMatching($matching) + { + if (is_null($matching)) { + throw new \InvalidArgumentException('non-nullable matching cannot be null'); + } + $this->container['matching'] = $matching; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/BrowserNameMatchRuleAllOfMatching.php b/packages/Types/lib/Generated/Model/BrowserNameMatchRuleAllOfMatching.php new file mode 100644 index 0000000..93684c9 --- /dev/null +++ b/packages/Types/lib/Generated/Model/BrowserNameMatchRuleAllOfMatching.php @@ -0,0 +1,443 @@ + + */ +class BrowserNameMatchRuleAllOfMatching implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BrowserNameMatchRule_allOf_matching'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'negated' => 'bool', + 'match_type' => '\OpenAPI\Client\Model\ChoiceMatchingOptions' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'negated' => null, + 'match_type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'negated' => false, + 'match_type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'negated' => 'negated', + 'match_type' => 'match_type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'negated' => 'setNegated', + 'match_type' => 'setMatchType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'negated' => 'getNegated', + 'match_type' => 'getMatchType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('negated', $data ?? [], null); + $this->setIfExists('match_type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets negated + * + * @return bool|null + */ + public function getNegated() + { + return $this->container['negated']; + } + + /** + * Sets negated + * + * @param bool|null $negated When true, the rule result is gonna be negated. example: `url contains \"test\"` with *negated* = true becomes `url does not contain \"test\"` + * + * @return self + */ + public function setNegated($negated) + { + if (is_null($negated)) { + throw new \InvalidArgumentException('non-nullable negated cannot be null'); + } + $this->container['negated'] = $negated; + + return $this; + } + + /** + * Gets match_type + * + * @return \OpenAPI\Client\Model\ChoiceMatchingOptions|null + */ + public function getMatchType() + { + return $this->container['match_type']; + } + + /** + * Sets match_type + * + * @param \OpenAPI\Client\Model\ChoiceMatchingOptions|null $match_type match_type + * + * @return self + */ + public function setMatchType($match_type) + { + if (is_null($match_type)) { + throw new \InvalidArgumentException('non-nullable match_type cannot be null'); + } + $this->container['match_type'] = $match_type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/BrowserNameMatchRulesTypes.php b/packages/Types/lib/Generated/Model/BrowserNameMatchRulesTypes.php new file mode 100644 index 0000000..b62ca9d --- /dev/null +++ b/packages/Types/lib/Generated/Model/BrowserNameMatchRulesTypes.php @@ -0,0 +1,59 @@ + + */ +class BucketingEvent implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BucketingEvent'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'experience_id' => 'string', + 'variation_id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'experience_id' => null, + 'variation_id' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'experience_id' => false, + 'variation_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'experience_id' => 'experienceId', + 'variation_id' => 'variationId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'experience_id' => 'setExperienceId', + 'variation_id' => 'setVariationId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'experience_id' => 'getExperienceId', + 'variation_id' => 'getVariationId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('experience_id', $data ?? [], null); + $this->setIfExists('variation_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['experience_id'] === null) { + $invalidProperties[] = "'experience_id' can't be null"; + } + if ($this->container['variation_id'] === null) { + $invalidProperties[] = "'variation_id' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets experience_id + * + * @return string + */ + public function getExperienceId() + { + return $this->container['experience_id']; + } + + /** + * Sets experience_id + * + * @param string $experience_id Experience ID to which the visitor is bucketed. In case that **enrichData=true** flag is being sent, only unique events are gonna be recorded. Otherwise, it's up to the client to ensure that duplicates of the same event for the same visitor do not get sent to the tracking endpoint. + * + * @return self + */ + public function setExperienceId($experience_id) + { + if (is_null($experience_id)) { + throw new \InvalidArgumentException('non-nullable experience_id cannot be null'); + } + $this->container['experience_id'] = $experience_id; + + return $this; + } + + /** + * Gets variation_id + * + * @return string + */ + public function getVariationId() + { + return $this->container['variation_id']; + } + + /** + * Sets variation_id + * + * @param string $variation_id Variation ID corresponding to the experience identified by experienceID, that is assigned to the visitor. + * + * @return self + */ + public function setVariationId($variation_id) + { + if (is_null($variation_id)) { + throw new \InvalidArgumentException('non-nullable variation_id cannot be null'); + } + $this->container['variation_id'] = $variation_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/BulkEntityError.php b/packages/Types/lib/Generated/Model/BulkEntityError.php new file mode 100644 index 0000000..0561d8e --- /dev/null +++ b/packages/Types/lib/Generated/Model/BulkEntityError.php @@ -0,0 +1,443 @@ + + */ +class BulkEntityError implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BulkEntityError'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'int', + 'message' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'message' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'message' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'message' => 'message' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'message' => 'setMessage' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'message' => 'getMessage' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('message', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return int|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id ID of entity which has not been processed + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets message + * + * @return string|null + */ + public function getMessage() + { + return $this->container['message']; + } + + /** + * Sets message + * + * @param string|null $message A reason explaining why entity has not been processed + * + * @return self + */ + public function setMessage($message) + { + if (is_null($message)) { + throw new \InvalidArgumentException('non-nullable message cannot be null'); + } + $this->container['message'] = $message; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/BulkSuccessData.php b/packages/Types/lib/Generated/Model/BulkSuccessData.php new file mode 100644 index 0000000..cb446b1 --- /dev/null +++ b/packages/Types/lib/Generated/Model/BulkSuccessData.php @@ -0,0 +1,477 @@ + + */ +class BulkSuccessData implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BulkSuccessData'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'code' => 'int', + 'message' => 'string', + 'errors' => '\OpenAPI\Client\Model\BulkEntityError[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'code' => 'int32', + 'message' => null, + 'errors' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'code' => false, + 'message' => false, + 'errors' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'code' => 'code', + 'message' => 'message', + 'errors' => 'errors' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'code' => 'setCode', + 'message' => 'setMessage', + 'errors' => 'setErrors' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'code' => 'getCode', + 'message' => 'getMessage', + 'errors' => 'getErrors' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('code', $data ?? [], null); + $this->setIfExists('message', $data ?? [], null); + $this->setIfExists('errors', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets code + * + * @return int|null + */ + public function getCode() + { + return $this->container['code']; + } + + /** + * Sets code + * + * @param int|null $code code + * + * @return self + */ + public function setCode($code) + { + if (is_null($code)) { + throw new \InvalidArgumentException('non-nullable code cannot be null'); + } + $this->container['code'] = $code; + + return $this; + } + + /** + * Gets message + * + * @return string|null + */ + public function getMessage() + { + return $this->container['message']; + } + + /** + * Sets message + * + * @param string|null $message message + * + * @return self + */ + public function setMessage($message) + { + if (is_null($message)) { + throw new \InvalidArgumentException('non-nullable message cannot be null'); + } + $this->container['message'] = $message; + + return $this; + } + + /** + * Gets errors + * + * @return \OpenAPI\Client\Model\BulkEntityError[]|null + */ + public function getErrors() + { + return $this->container['errors']; + } + + /** + * Sets errors + * + * @param \OpenAPI\Client\Model\BulkEntityError[]|null $errors List of unprocessed entities. Would be empty, if all passed entities processed + * + * @return self + */ + public function setErrors($errors) + { + if (is_null($errors)) { + throw new \InvalidArgumentException('non-nullable errors cannot be null'); + } + $this->container['errors'] = $errors; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/ChoiceContainsOptions.php b/packages/Types/lib/Generated/Model/ChoiceContainsOptions.php new file mode 100644 index 0000000..d54c601 --- /dev/null +++ b/packages/Types/lib/Generated/Model/ChoiceContainsOptions.php @@ -0,0 +1,59 @@ + + */ +class ClicksElementGoal implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ClicksElementGoal'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'string', + 'name' => 'string', + 'key' => 'string', + 'type' => 'string', + 'rules' => '\OpenAPI\Client\Model\RuleObject', + 'settings' => '\OpenAPI\Client\Model\ClicksElementGoalSettings' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'name' => null, + 'key' => null, + 'type' => null, + 'rules' => null, + 'settings' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'name' => false, + 'key' => false, + 'type' => false, + 'rules' => true, + 'settings' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'name' => 'name', + 'key' => 'key', + 'type' => 'type', + 'rules' => 'rules', + 'settings' => 'settings' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'name' => 'setName', + 'key' => 'setKey', + 'type' => 'setType', + 'rules' => 'setRules', + 'settings' => 'setSettings' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'name' => 'getName', + 'key' => 'getKey', + 'type' => 'getType', + 'rules' => 'getRules', + 'settings' => 'getSettings' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_CLICKS_ELEMENT = 'clicks_element'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_CLICKS_ELEMENT, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('key', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('rules', $data ?? [], null); + $this->setIfExists('settings', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id Goal ID + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name Goal Name. + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets key + * + * @return string|null + */ + public function getKey() + { + return $this->container['key']; + } + + /** + * Sets key + * + * @param string|null $key Goal Key + * + * @return self + */ + public function setKey($key) + { + if (is_null($key)) { + throw new \InvalidArgumentException('non-nullable key cannot be null'); + } + $this->container['key'] = $key; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type type + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets rules + * + * @return \OpenAPI\Client\Model\RuleObject|null + */ + public function getRules() + { + return $this->container['rules']; + } + + /** + * Sets rules + * + * @param \OpenAPI\Client\Model\RuleObject|null $rules rules + * + * @return self + */ + public function setRules($rules) + { + if (is_null($rules)) { + array_push($this->openAPINullablesSetToNull, 'rules'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('rules', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['rules'] = $rules; + + return $this; + } + + /** + * Gets settings + * + * @return \OpenAPI\Client\Model\ClicksElementGoalSettings|null + */ + public function getSettings() + { + return $this->container['settings']; + } + + /** + * Sets settings + * + * @param \OpenAPI\Client\Model\ClicksElementGoalSettings|null $settings settings + * + * @return self + */ + public function setSettings($settings) + { + if (is_null($settings)) { + throw new \InvalidArgumentException('non-nullable settings cannot be null'); + } + $this->container['settings'] = $settings; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/ClicksElementGoalSettings.php b/packages/Types/lib/Generated/Model/ClicksElementGoalSettings.php new file mode 100644 index 0000000..1ef76a4 --- /dev/null +++ b/packages/Types/lib/Generated/Model/ClicksElementGoalSettings.php @@ -0,0 +1,412 @@ + + */ +class ClicksElementGoalSettings implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ClicksElementGoalSettings'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'selector' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'selector' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'selector' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'selector' => 'selector' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'selector' => 'setSelector' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'selector' => 'getSelector' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('selector', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['selector'] === null) { + $invalidProperties[] = "'selector' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets selector + * + * @return string + */ + public function getSelector() + { + return $this->container['selector']; + } + + /** + * Sets selector + * + * @param string $selector Css selector that identifies the DOM element(s) on which will track clicks in order to fire the goal. + * + * @return self + */ + public function setSelector($selector) + { + if (is_null($selector)) { + throw new \InvalidArgumentException('non-nullable selector cannot be null'); + } + $this->container['selector'] = $selector; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/ClicksLinkGoal.php b/packages/Types/lib/Generated/Model/ClicksLinkGoal.php new file mode 100644 index 0000000..42293ca --- /dev/null +++ b/packages/Types/lib/Generated/Model/ClicksLinkGoal.php @@ -0,0 +1,618 @@ + + */ +class ClicksLinkGoal implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ClicksLinkGoal'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'string', + 'name' => 'string', + 'key' => 'string', + 'type' => 'string', + 'rules' => '\OpenAPI\Client\Model\RuleObject', + 'settings' => '\OpenAPI\Client\Model\ClicksLinkGoalSettings' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'name' => null, + 'key' => null, + 'type' => null, + 'rules' => null, + 'settings' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'name' => false, + 'key' => false, + 'type' => false, + 'rules' => true, + 'settings' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'name' => 'name', + 'key' => 'key', + 'type' => 'type', + 'rules' => 'rules', + 'settings' => 'settings' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'name' => 'setName', + 'key' => 'setKey', + 'type' => 'setType', + 'rules' => 'setRules', + 'settings' => 'setSettings' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'name' => 'getName', + 'key' => 'getKey', + 'type' => 'getType', + 'rules' => 'getRules', + 'settings' => 'getSettings' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_CLICKS_LINK = 'clicks_link'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_CLICKS_LINK, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('key', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('rules', $data ?? [], null); + $this->setIfExists('settings', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id Goal ID + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name Goal Name. + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets key + * + * @return string|null + */ + public function getKey() + { + return $this->container['key']; + } + + /** + * Sets key + * + * @param string|null $key Goal Key + * + * @return self + */ + public function setKey($key) + { + if (is_null($key)) { + throw new \InvalidArgumentException('non-nullable key cannot be null'); + } + $this->container['key'] = $key; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type type + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets rules + * + * @return \OpenAPI\Client\Model\RuleObject|null + */ + public function getRules() + { + return $this->container['rules']; + } + + /** + * Sets rules + * + * @param \OpenAPI\Client\Model\RuleObject|null $rules rules + * + * @return self + */ + public function setRules($rules) + { + if (is_null($rules)) { + array_push($this->openAPINullablesSetToNull, 'rules'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('rules', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['rules'] = $rules; + + return $this; + } + + /** + * Gets settings + * + * @return \OpenAPI\Client\Model\ClicksLinkGoalSettings|null + */ + public function getSettings() + { + return $this->container['settings']; + } + + /** + * Sets settings + * + * @param \OpenAPI\Client\Model\ClicksLinkGoalSettings|null $settings settings + * + * @return self + */ + public function setSettings($settings) + { + if (is_null($settings)) { + throw new \InvalidArgumentException('non-nullable settings cannot be null'); + } + $this->container['settings'] = $settings; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/ClicksLinkGoalSettings.php b/packages/Types/lib/Generated/Model/ClicksLinkGoalSettings.php new file mode 100644 index 0000000..fc4335d --- /dev/null +++ b/packages/Types/lib/Generated/Model/ClicksLinkGoalSettings.php @@ -0,0 +1,412 @@ + + */ +class ClicksLinkGoalSettings implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ClicksLinkGoalSettings'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'href' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'href' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'href' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'href' => 'href' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'href' => 'setHref' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'href' => 'getHref' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('href', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['href'] === null) { + $invalidProperties[] = "'href' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets href + * + * @return string + */ + public function getHref() + { + return $this->container['href']; + } + + /** + * Sets href + * + * @param string $href Url representing link's href attribute used to identify links which will be tracked for click event + * + * @return self + */ + public function setHref($href) + { + if (is_null($href)) { + throw new \InvalidArgumentException('non-nullable href cannot be null'); + } + $this->container['href'] = $href; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/ConfigAudience.php b/packages/Types/lib/Generated/Model/ConfigAudience.php new file mode 100644 index 0000000..d36f43b --- /dev/null +++ b/packages/Types/lib/Generated/Model/ConfigAudience.php @@ -0,0 +1,553 @@ + + */ +class ConfigAudience implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ConfigAudience'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'string', + 'key' => 'string', + 'name' => 'string', + 'type' => '\OpenAPI\Client\Model\ConfigAudienceTypes', + 'rules' => '\OpenAPI\Client\Model\RuleObject' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'key' => null, + 'name' => null, + 'type' => null, + 'rules' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'key' => false, + 'name' => false, + 'type' => false, + 'rules' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'key' => 'key', + 'name' => 'name', + 'type' => 'type', + 'rules' => 'rules' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'key' => 'setKey', + 'name' => 'setName', + 'type' => 'setType', + 'rules' => 'setRules' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'key' => 'getKey', + 'name' => 'getName', + 'type' => 'getType', + 'rules' => 'getRules' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('key', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('rules', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id Audience ID + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets key + * + * @return string|null + */ + public function getKey() + { + return $this->container['key']; + } + + /** + * Sets key + * + * @param string|null $key Audience unique key + * + * @return self + */ + public function setKey($key) + { + if (is_null($key)) { + throw new \InvalidArgumentException('non-nullable key cannot be null'); + } + $this->container['key'] = $key; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name Audience Name + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets type + * + * @return \OpenAPI\Client\Model\ConfigAudienceTypes|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param \OpenAPI\Client\Model\ConfigAudienceTypes|null $type type + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets rules + * + * @return \OpenAPI\Client\Model\RuleObject|null + */ + public function getRules() + { + return $this->container['rules']; + } + + /** + * Sets rules + * + * @param \OpenAPI\Client\Model\RuleObject|null $rules rules + * + * @return self + */ + public function setRules($rules) + { + if (is_null($rules)) { + array_push($this->openAPINullablesSetToNull, 'rules'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('rules', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['rules'] = $rules; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/ConfigAudienceTypes.php b/packages/Types/lib/Generated/Model/ConfigAudienceTypes.php new file mode 100644 index 0000000..30bac6f --- /dev/null +++ b/packages/Types/lib/Generated/Model/ConfigAudienceTypes.php @@ -0,0 +1,63 @@ + + */ +class ConfigExperience implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ConfigExperience'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'string', + 'name' => 'string', + 'key' => 'string', + 'locations' => 'string[]', + 'site_area' => '\OpenAPI\Client\Model\RuleObject', + 'audiences' => 'string[]', + 'goals' => 'string[]', + 'multipage_pages' => '\OpenAPI\Client\Model\MultipageExperiencePage[]', + 'status' => '\OpenAPI\Client\Model\ExperienceStatuses', + 'global_js' => 'string', + 'global_css' => 'string', + 'type' => '\OpenAPI\Client\Model\ExperienceTypes', + 'version' => 'float', + 'variations' => '\OpenAPI\Client\Model\ExperienceVariationConfig[]', + 'integrations' => '\OpenAPI\Client\Model\ConfigExperienceIntegrationsInner[]', + 'environments' => 'string[]', + 'environment' => 'string', + 'settings' => '\OpenAPI\Client\Model\ConfigExperienceSettings' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'name' => null, + 'key' => null, + 'locations' => null, + 'site_area' => null, + 'audiences' => null, + 'goals' => null, + 'multipage_pages' => null, + 'status' => null, + 'global_js' => null, + 'global_css' => null, + 'type' => null, + 'version' => null, + 'variations' => null, + 'integrations' => null, + 'environments' => null, + 'environment' => null, + 'settings' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'name' => false, + 'key' => false, + 'locations' => true, + 'site_area' => true, + 'audiences' => true, + 'goals' => false, + 'multipage_pages' => false, + 'status' => false, + 'global_js' => false, + 'global_css' => false, + 'type' => false, + 'version' => false, + 'variations' => false, + 'integrations' => false, + 'environments' => false, + 'environment' => false, + 'settings' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'name' => 'name', + 'key' => 'key', + 'locations' => 'locations', + 'site_area' => 'site_area', + 'audiences' => 'audiences', + 'goals' => 'goals', + 'multipage_pages' => 'multipage_pages', + 'status' => 'status', + 'global_js' => 'global_js', + 'global_css' => 'global_css', + 'type' => 'type', + 'version' => 'version', + 'variations' => 'variations', + 'integrations' => 'integrations', + 'environments' => 'environments', + 'environment' => 'environment', + 'settings' => 'settings' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'name' => 'setName', + 'key' => 'setKey', + 'locations' => 'setLocations', + 'site_area' => 'setSiteArea', + 'audiences' => 'setAudiences', + 'goals' => 'setGoals', + 'multipage_pages' => 'setMultipagePages', + 'status' => 'setStatus', + 'global_js' => 'setGlobalJs', + 'global_css' => 'setGlobalCss', + 'type' => 'setType', + 'version' => 'setVersion', + 'variations' => 'setVariations', + 'integrations' => 'setIntegrations', + 'environments' => 'setEnvironments', + 'environment' => 'setEnvironment', + 'settings' => 'setSettings' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'name' => 'getName', + 'key' => 'getKey', + 'locations' => 'getLocations', + 'site_area' => 'getSiteArea', + 'audiences' => 'getAudiences', + 'goals' => 'getGoals', + 'multipage_pages' => 'getMultipagePages', + 'status' => 'getStatus', + 'global_js' => 'getGlobalJs', + 'global_css' => 'getGlobalCss', + 'type' => 'getType', + 'version' => 'getVersion', + 'variations' => 'getVariations', + 'integrations' => 'getIntegrations', + 'environments' => 'getEnvironments', + 'environment' => 'getEnvironment', + 'settings' => 'getSettings' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('key', $data ?? [], null); + $this->setIfExists('locations', $data ?? [], null); + $this->setIfExists('site_area', $data ?? [], null); + $this->setIfExists('audiences', $data ?? [], null); + $this->setIfExists('goals', $data ?? [], null); + $this->setIfExists('multipage_pages', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('global_js', $data ?? [], null); + $this->setIfExists('global_css', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('version', $data ?? [], null); + $this->setIfExists('variations', $data ?? [], null); + $this->setIfExists('integrations', $data ?? [], null); + $this->setIfExists('environments', $data ?? [], null); + $this->setIfExists('environment', $data ?? [], null); + $this->setIfExists('settings', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id Experience ID + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name Experience Name + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets key + * + * @return string|null + */ + public function getKey() + { + return $this->container['key']; + } + + /** + * Sets key + * + * @param string|null $key Experience readable key that uniquely identifies this experience + * + * @return self + */ + public function setKey($key) + { + if (is_null($key)) { + throw new \InvalidArgumentException('non-nullable key cannot be null'); + } + $this->container['key'] = $key; + + return $this; + } + + /** + * Gets locations + * + * @return string[]|null + */ + public function getLocations() + { + return $this->container['locations']; + } + + /** + * Sets locations + * + * @param string[]|null $locations List of locations IDs on which this experience is presented. Either this or **site_area** is given but should not be both. + * + * @return self + */ + public function setLocations($locations) + { + if (is_null($locations)) { + array_push($this->openAPINullablesSetToNull, 'locations'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('locations', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['locations'] = $locations; + + return $this; + } + + /** + * Gets site_area + * + * @return \OpenAPI\Client\Model\RuleObject|null + */ + public function getSiteArea() + { + return $this->container['site_area']; + } + + /** + * Sets site_area + * + * @param \OpenAPI\Client\Model\RuleObject|null $site_area Rules that define where the experience is gonna run. Either this or **locations** is given but should not be both. + * + * @return self + */ + public function setSiteArea($site_area) + { + if (is_null($site_area)) { + array_push($this->openAPINullablesSetToNull, 'site_area'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('site_area', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['site_area'] = $site_area; + + return $this; + } + + /** + * Gets audiences + * + * @return string[]|null + */ + public function getAudiences() + { + return $this->container['audiences']; + } + + /** + * Sets audiences + * + * @param string[]|null $audiences List of audiences IDs to which this experience is presented to + * + * @return self + */ + public function setAudiences($audiences) + { + if (is_null($audiences)) { + array_push($this->openAPINullablesSetToNull, 'audiences'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('audiences', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['audiences'] = $audiences; + + return $this; + } + + /** + * Gets goals + * + * @return string[]|null + */ + public function getGoals() + { + return $this->container['goals']; + } + + /** + * Sets goals + * + * @param string[]|null $goals List of goals IDs to which will be tracked for this experience + * + * @return self + */ + public function setGoals($goals) + { + if (is_null($goals)) { + throw new \InvalidArgumentException('non-nullable goals cannot be null'); + } + $this->container['goals'] = $goals; + + return $this; + } + + /** + * Gets multipage_pages + * + * @return \OpenAPI\Client\Model\MultipageExperiencePage[]|null + */ + public function getMultipagePages() + { + return $this->container['multipage_pages']; + } + + /** + * Sets multipage_pages + * + * @param \OpenAPI\Client\Model\MultipageExperiencePage[]|null $multipage_pages Only for multipage experience type + * + * @return self + */ + public function setMultipagePages($multipage_pages) + { + if (is_null($multipage_pages)) { + throw new \InvalidArgumentException('non-nullable multipage_pages cannot be null'); + } + $this->container['multipage_pages'] = $multipage_pages; + + return $this; + } + + /** + * Gets status + * + * @return \OpenAPI\Client\Model\ExperienceStatuses|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param \OpenAPI\Client\Model\ExperienceStatuses|null $status status + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets global_js + * + * @return string|null + */ + public function getGlobalJs() + { + return $this->container['global_js']; + } + + /** + * Sets global_js + * + * @param string|null $global_js Global Experience's JavaScript that will run for this experience before its changes are applied + * + * @return self + */ + public function setGlobalJs($global_js) + { + if (is_null($global_js)) { + throw new \InvalidArgumentException('non-nullable global_js cannot be null'); + } + $this->container['global_js'] = $global_js; + + return $this; + } + + /** + * Gets global_css + * + * @return string|null + */ + public function getGlobalCss() + { + return $this->container['global_css']; + } + + /** + * Sets global_css + * + * @param string|null $global_css Global Experience's StyleSheet that will run for this experience before its changes are applied + * + * @return self + */ + public function setGlobalCss($global_css) + { + if (is_null($global_css)) { + throw new \InvalidArgumentException('non-nullable global_css cannot be null'); + } + $this->container['global_css'] = $global_css; + + return $this; + } + + /** + * Gets type + * + * @return \OpenAPI\Client\Model\ExperienceTypes|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param \OpenAPI\Client\Model\ExperienceTypes|null $type type + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets version + * + * @return float|null + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param float|null $version Experience's version number + * + * @return self + */ + public function setVersion($version) + { + if (is_null($version)) { + throw new \InvalidArgumentException('non-nullable version cannot be null'); + } + $this->container['version'] = $version; + + return $this; + } + + /** + * Gets variations + * + * @return \OpenAPI\Client\Model\ExperienceVariationConfig[]|null + */ + public function getVariations() + { + return $this->container['variations']; + } + + /** + * Sets variations + * + * @param \OpenAPI\Client\Model\ExperienceVariationConfig[]|null $variations Experience's variations list + * + * @return self + */ + public function setVariations($variations) + { + if (is_null($variations)) { + throw new \InvalidArgumentException('non-nullable variations cannot be null'); + } + $this->container['variations'] = $variations; + + return $this; + } + + /** + * Gets integrations + * + * @return \OpenAPI\Client\Model\ConfigExperienceIntegrationsInner[]|null + */ + public function getIntegrations() + { + return $this->container['integrations']; + } + + /** + * Sets integrations + * + * @param \OpenAPI\Client\Model\ConfigExperienceIntegrationsInner[]|null $integrations List of integrations that this experience's data is sent to + * + * @return self + */ + public function setIntegrations($integrations) + { + if (is_null($integrations)) { + throw new \InvalidArgumentException('non-nullable integrations cannot be null'); + } + $this->container['integrations'] = $integrations; + + return $this; + } + + /** + * Gets environments + * + * @return string[]|null + * @deprecated + */ + public function getEnvironments() + { + return $this->container['environments']; + } + + /** + * Sets environments + * + * @param string[]|null $environments List of environments that this experience is supposed to run on. The full list of available environments is defined at project level. If this list is empty, the experience will run on all environments. + * + * @return self + * @deprecated + */ + public function setEnvironments($environments) + { + if (is_null($environments)) { + throw new \InvalidArgumentException('non-nullable environments cannot be null'); + } + $this->container['environments'] = $environments; + + return $this; + } + + /** + * Gets environment + * + * @return string|null + */ + public function getEnvironment() + { + return $this->container['environment']; + } + + /** + * Sets environment + * + * @param string|null $environment The environment where this experience will run. It has to be one of the environments defined at the project level + * + * @return self + */ + public function setEnvironment($environment) + { + if (is_null($environment)) { + throw new \InvalidArgumentException('non-nullable environment cannot be null'); + } + $this->container['environment'] = $environment; + + return $this; + } + + /** + * Gets settings + * + * @return \OpenAPI\Client\Model\ConfigExperienceSettings|null + */ + public function getSettings() + { + return $this->container['settings']; + } + + /** + * Sets settings + * + * @param \OpenAPI\Client\Model\ConfigExperienceSettings|null $settings settings + * + * @return self + */ + public function setSettings($settings) + { + if (is_null($settings)) { + throw new \InvalidArgumentException('non-nullable settings cannot be null'); + } + $this->container['settings'] = $settings; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/ConfigExperienceIntegrationsInner.php b/packages/Types/lib/Generated/Model/ConfigExperienceIntegrationsInner.php new file mode 100644 index 0000000..b6ae638 --- /dev/null +++ b/packages/Types/lib/Generated/Model/ConfigExperienceIntegrationsInner.php @@ -0,0 +1,527 @@ + + */ +class ConfigExperienceIntegrationsInner implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ConfigExperience_integrations_inner'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'provider' => '\OpenAPI\Client\Model\IntegrationProvider', + 'enabled' => 'bool', + 'custom_dimension' => 'string', + 'evar' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'provider' => null, + 'enabled' => null, + 'custom_dimension' => null, + 'evar' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'provider' => false, + 'enabled' => true, + 'custom_dimension' => false, + 'evar' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'provider' => 'provider', + 'enabled' => 'enabled', + 'custom_dimension' => 'custom_dimension', + 'evar' => 'evar' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'provider' => 'setProvider', + 'enabled' => 'setEnabled', + 'custom_dimension' => 'setCustomDimension', + 'evar' => 'setEvar' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'provider' => 'getProvider', + 'enabled' => 'getEnabled', + 'custom_dimension' => 'getCustomDimension', + 'evar' => 'getEvar' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('provider', $data ?? [], null); + $this->setIfExists('enabled', $data ?? [], null); + $this->setIfExists('custom_dimension', $data ?? [], null); + $this->setIfExists('evar', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['provider'] === null) { + $invalidProperties[] = "'provider' can't be null"; + } + if ($this->container['custom_dimension'] === null) { + $invalidProperties[] = "'custom_dimension' can't be null"; + } + if ($this->container['evar'] === null) { + $invalidProperties[] = "'evar' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets provider + * + * @return \OpenAPI\Client\Model\IntegrationProvider + */ + public function getProvider() + { + return $this->container['provider']; + } + + /** + * Sets provider + * + * @param \OpenAPI\Client\Model\IntegrationProvider $provider provider + * + * @return self + */ + public function setProvider($provider) + { + if (is_null($provider)) { + throw new \InvalidArgumentException('non-nullable provider cannot be null'); + } + $this->container['provider'] = $provider; + + return $this; + } + + /** + * Gets enabled + * + * @return bool|null + */ + public function getEnabled() + { + return $this->container['enabled']; + } + + /** + * Sets enabled + * + * @param bool|null $enabled Boolean flag indicating whether the integration is enabled or not. When updating experience's integrations, to disable an integration, this flag needs to be passed as **false**. If not passed, integration is assumed to be **enabled=true** + * + * @return self + */ + public function setEnabled($enabled) + { + if (is_null($enabled)) { + array_push($this->openAPINullablesSetToNull, 'enabled'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('enabled', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['enabled'] = $enabled; + + return $this; + } + + /** + * Gets custom_dimension + * + * @return string + */ + public function getCustomDimension() + { + return $this->container['custom_dimension']; + } + + /** + * Sets custom_dimension + * + * @param string $custom_dimension Custom dimension where experience data should be sent to. + * + * @return self + */ + public function setCustomDimension($custom_dimension) + { + if (is_null($custom_dimension)) { + throw new \InvalidArgumentException('non-nullable custom_dimension cannot be null'); + } + $this->container['custom_dimension'] = $custom_dimension; + + return $this; + } + + /** + * Gets evar + * + * @return string + */ + public function getEvar() + { + return $this->container['evar']; + } + + /** + * Sets evar + * + * @param string $evar Custom dimension where experience data should be sent to. + * + * @return self + */ + public function setEvar($evar) + { + if (is_null($evar)) { + throw new \InvalidArgumentException('non-nullable evar cannot be null'); + } + $this->container['evar'] = $evar; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/ConfigExperienceSettings.php b/packages/Types/lib/Generated/Model/ConfigExperienceSettings.php new file mode 100644 index 0000000..f4969a1 --- /dev/null +++ b/packages/Types/lib/Generated/Model/ConfigExperienceSettings.php @@ -0,0 +1,534 @@ + + */ +class ConfigExperienceSettings implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ConfigExperience_settings'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'min_order_value' => 'float', + 'max_order_value' => 'float', + 'outliers' => '\OpenAPI\Client\Model\ConfigExperienceSettingsOutliers', + 'matching_options' => '\OpenAPI\Client\Model\ConfigExperienceSettingsMatchingOptions' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'min_order_value' => null, + 'max_order_value' => null, + 'outliers' => null, + 'matching_options' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'min_order_value' => false, + 'max_order_value' => false, + 'outliers' => false, + 'matching_options' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'min_order_value' => 'min_order_value', + 'max_order_value' => 'max_order_value', + 'outliers' => 'outliers', + 'matching_options' => 'matching_options' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'min_order_value' => 'setMinOrderValue', + 'max_order_value' => 'setMaxOrderValue', + 'outliers' => 'setOutliers', + 'matching_options' => 'setMatchingOptions' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'min_order_value' => 'getMinOrderValue', + 'max_order_value' => 'getMaxOrderValue', + 'outliers' => 'getOutliers', + 'matching_options' => 'getMatchingOptions' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('min_order_value', $data ?? [], null); + $this->setIfExists('max_order_value', $data ?? [], null); + $this->setIfExists('outliers', $data ?? [], null); + $this->setIfExists('matching_options', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!is_null($this->container['min_order_value']) && ($this->container['min_order_value'] < 0)) { + $invalidProperties[] = "invalid value for 'min_order_value', must be bigger than or equal to 0."; + } + + if (!is_null($this->container['max_order_value']) && ($this->container['max_order_value'] < 0)) { + $invalidProperties[] = "invalid value for 'max_order_value', must be bigger than or equal to 0."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets min_order_value + * + * @return float|null + * @deprecated + */ + public function getMinOrderValue() + { + return $this->container['min_order_value']; + } + + /** + * Sets min_order_value + * + * @param float|null $min_order_value Minimum order value for transactions outliers + * + * @return self + * @deprecated + */ + public function setMinOrderValue($min_order_value) + { + if (is_null($min_order_value)) { + throw new \InvalidArgumentException('non-nullable min_order_value cannot be null'); + } + + if (($min_order_value < 0)) { + throw new \InvalidArgumentException('invalid value for $min_order_value when calling ConfigExperienceSettings., must be bigger than or equal to 0.'); + } + + $this->container['min_order_value'] = $min_order_value; + + return $this; + } + + /** + * Gets max_order_value + * + * @return float|null + * @deprecated + */ + public function getMaxOrderValue() + { + return $this->container['max_order_value']; + } + + /** + * Sets max_order_value + * + * @param float|null $max_order_value Maximum order value for transactions outliers + * + * @return self + * @deprecated + */ + public function setMaxOrderValue($max_order_value) + { + if (is_null($max_order_value)) { + throw new \InvalidArgumentException('non-nullable max_order_value cannot be null'); + } + + if (($max_order_value < 0)) { + throw new \InvalidArgumentException('invalid value for $max_order_value when calling ConfigExperienceSettings., must be bigger than or equal to 0.'); + } + + $this->container['max_order_value'] = $max_order_value; + + return $this; + } + + /** + * Gets outliers + * + * @return \OpenAPI\Client\Model\ConfigExperienceSettingsOutliers|null + */ + public function getOutliers() + { + return $this->container['outliers']; + } + + /** + * Sets outliers + * + * @param \OpenAPI\Client\Model\ConfigExperienceSettingsOutliers|null $outliers outliers + * + * @return self + */ + public function setOutliers($outliers) + { + if (is_null($outliers)) { + throw new \InvalidArgumentException('non-nullable outliers cannot be null'); + } + $this->container['outliers'] = $outliers; + + return $this; + } + + /** + * Gets matching_options + * + * @return \OpenAPI\Client\Model\ConfigExperienceSettingsMatchingOptions|null + */ + public function getMatchingOptions() + { + return $this->container['matching_options']; + } + + /** + * Sets matching_options + * + * @param \OpenAPI\Client\Model\ConfigExperienceSettingsMatchingOptions|null $matching_options matching_options + * + * @return self + */ + public function setMatchingOptions($matching_options) + { + if (is_null($matching_options)) { + throw new \InvalidArgumentException('non-nullable matching_options cannot be null'); + } + $this->container['matching_options'] = $matching_options; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/ConfigExperienceSettingsMatchingOptions.php b/packages/Types/lib/Generated/Model/ConfigExperienceSettingsMatchingOptions.php new file mode 100644 index 0000000..28da23c --- /dev/null +++ b/packages/Types/lib/Generated/Model/ConfigExperienceSettingsMatchingOptions.php @@ -0,0 +1,444 @@ + + */ +class ConfigExperienceSettingsMatchingOptions implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ConfigExperience_settings_matching_options'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'audiences' => '\OpenAPI\Client\Model\GenericListMatchingOptions', + 'locations' => '\OpenAPI\Client\Model\GenericListMatchingOptions' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'audiences' => null, + 'locations' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'audiences' => false, + 'locations' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'audiences' => 'audiences', + 'locations' => 'locations' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'audiences' => 'setAudiences', + 'locations' => 'setLocations' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'audiences' => 'getAudiences', + 'locations' => 'getLocations' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('audiences', $data ?? [], null); + $this->setIfExists('locations', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets audiences + * + * @return \OpenAPI\Client\Model\GenericListMatchingOptions|null + */ + public function getAudiences() + { + return $this->container['audiences']; + } + + /** + * Sets audiences + * + * @param \OpenAPI\Client\Model\GenericListMatchingOptions|null $audiences audiences + * + * @return self + */ + public function setAudiences($audiences) + { + if (is_null($audiences)) { + throw new \InvalidArgumentException('non-nullable audiences cannot be null'); + } + $this->container['audiences'] = $audiences; + + return $this; + } + + /** + * Gets locations + * + * @return \OpenAPI\Client\Model\GenericListMatchingOptions|null + */ + public function getLocations() + { + return $this->container['locations']; + } + + /** + * Sets locations + * + * @param \OpenAPI\Client\Model\GenericListMatchingOptions|null $locations locations + * + * @return self + */ + public function setLocations($locations) + { + if (is_null($locations)) { + throw new \InvalidArgumentException('non-nullable locations cannot be null'); + } + $this->container['locations'] = $locations; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/ConfigExperienceSettingsOutliers.php b/packages/Types/lib/Generated/Model/ConfigExperienceSettingsOutliers.php new file mode 100644 index 0000000..be422c3 --- /dev/null +++ b/packages/Types/lib/Generated/Model/ConfigExperienceSettingsOutliers.php @@ -0,0 +1,444 @@ + + */ +class ConfigExperienceSettingsOutliers implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ConfigExperience_settings_outliers'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'order_value' => '\OpenAPI\Client\Model\NumericOutlier', + 'products_ordered_count' => '\OpenAPI\Client\Model\NumericOutlier' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'order_value' => null, + 'products_ordered_count' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'order_value' => false, + 'products_ordered_count' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'order_value' => 'order_value', + 'products_ordered_count' => 'products_ordered_count' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'order_value' => 'setOrderValue', + 'products_ordered_count' => 'setProductsOrderedCount' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'order_value' => 'getOrderValue', + 'products_ordered_count' => 'getProductsOrderedCount' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('order_value', $data ?? [], null); + $this->setIfExists('products_ordered_count', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets order_value + * + * @return \OpenAPI\Client\Model\NumericOutlier|null + */ + public function getOrderValue() + { + return $this->container['order_value']; + } + + /** + * Sets order_value + * + * @param \OpenAPI\Client\Model\NumericOutlier|null $order_value Order value outlier settings + * + * @return self + */ + public function setOrderValue($order_value) + { + if (is_null($order_value)) { + throw new \InvalidArgumentException('non-nullable order_value cannot be null'); + } + $this->container['order_value'] = $order_value; + + return $this; + } + + /** + * Gets products_ordered_count + * + * @return \OpenAPI\Client\Model\NumericOutlier|null + */ + public function getProductsOrderedCount() + { + return $this->container['products_ordered_count']; + } + + /** + * Sets products_ordered_count + * + * @param \OpenAPI\Client\Model\NumericOutlier|null $products_ordered_count Products Ordered count outlier settings + * + * @return self + */ + public function setProductsOrderedCount($products_ordered_count) + { + if (is_null($products_ordered_count)) { + throw new \InvalidArgumentException('non-nullable products_ordered_count cannot be null'); + } + $this->container['products_ordered_count'] = $products_ordered_count; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/ConfigFeature.php b/packages/Types/lib/Generated/Model/ConfigFeature.php new file mode 100644 index 0000000..6087685 --- /dev/null +++ b/packages/Types/lib/Generated/Model/ConfigFeature.php @@ -0,0 +1,512 @@ + + */ +class ConfigFeature implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ConfigFeature'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'string', + 'name' => 'string', + 'key' => 'string', + 'variables' => '\OpenAPI\Client\Model\FeatureVariableItemData[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'name' => null, + 'key' => null, + 'variables' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'name' => false, + 'key' => false, + 'variables' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'name' => 'name', + 'key' => 'key', + 'variables' => 'variables' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'name' => 'setName', + 'key' => 'setKey', + 'variables' => 'setVariables' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'name' => 'getName', + 'key' => 'getKey', + 'variables' => 'getVariables' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('key', $data ?? [], null); + $this->setIfExists('variables', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id Feature ID + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name A name given to the feature to identify it easily + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets key + * + * @return string|null + */ + public function getKey() + { + return $this->container['key']; + } + + /** + * Sets key + * + * @param string|null $key A unique per project level identifier + * + * @return self + */ + public function setKey($key) + { + if (is_null($key)) { + throw new \InvalidArgumentException('non-nullable key cannot be null'); + } + $this->container['key'] = $key; + + return $this; + } + + /** + * Gets variables + * + * @return \OpenAPI\Client\Model\FeatureVariableItemData[]|null + */ + public function getVariables() + { + return $this->container['variables']; + } + + /** + * Sets variables + * + * @param \OpenAPI\Client\Model\FeatureVariableItemData[]|null $variables An array of user-defined variables of a feature. + * + * @return self + */ + public function setVariables($variables) + { + if (is_null($variables)) { + throw new \InvalidArgumentException('non-nullable variables cannot be null'); + } + $this->container['variables'] = $variables; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/ConfigGoal.php b/packages/Types/lib/Generated/Model/ConfigGoal.php new file mode 100644 index 0000000..93da4fd --- /dev/null +++ b/packages/Types/lib/Generated/Model/ConfigGoal.php @@ -0,0 +1,639 @@ + + */ +class ConfigGoal implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = 'type'; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ConfigGoal'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'string', + 'name' => 'string', + 'key' => 'string', + 'type' => 'string', + 'rules' => '\OpenAPI\Client\Model\RuleObject', + 'settings' => '\OpenAPI\Client\Model\ClicksElementGoalSettings' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'name' => null, + 'key' => null, + 'type' => null, + 'rules' => null, + 'settings' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'name' => false, + 'key' => false, + 'type' => false, + 'rules' => true, + 'settings' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'name' => 'name', + 'key' => 'key', + 'type' => 'type', + 'rules' => 'rules', + 'settings' => 'settings' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'name' => 'setName', + 'key' => 'setKey', + 'type' => 'setType', + 'rules' => 'setRules', + 'settings' => 'setSettings' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'name' => 'getName', + 'key' => 'getKey', + 'type' => 'getType', + 'rules' => 'getRules', + 'settings' => 'getSettings' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_DOM_INTERACTION = 'dom_interaction'; + public const TYPE_SCROLL_PERCENTAGE = 'scroll_percentage'; + public const TYPE_REVENUE = 'revenue'; + public const TYPE_ADVANCED = 'advanced'; + public const TYPE_VISITS_PAGE = 'visits_page'; + public const TYPE_CODE_TRIGGER = 'code_trigger'; + public const TYPE_GA_IMPORT = 'ga_import'; + public const TYPE_SUBMITS_FORM = 'submits_form'; + public const TYPE_CLICKS_LINK = 'clicks_link'; + public const TYPE_CLICKS_ELEMENT = 'clicks_element'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_DOM_INTERACTION, + self::TYPE_SCROLL_PERCENTAGE, + self::TYPE_REVENUE, + self::TYPE_ADVANCED, + self::TYPE_VISITS_PAGE, + self::TYPE_CODE_TRIGGER, + self::TYPE_GA_IMPORT, + self::TYPE_SUBMITS_FORM, + self::TYPE_CLICKS_LINK, + self::TYPE_CLICKS_ELEMENT, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('key', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('rules', $data ?? [], null); + $this->setIfExists('settings', $data ?? [], null); + + // Initialize discriminator property with the model name. + $this->container['type'] = static::$openAPIModelName; + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id Goal ID + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name Goal Name. + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets key + * + * @return string|null + */ + public function getKey() + { + return $this->container['key']; + } + + /** + * Sets key + * + * @param string|null $key Goal Key + * + * @return self + */ + public function setKey($key) + { + if (is_null($key)) { + throw new \InvalidArgumentException('non-nullable key cannot be null'); + } + $this->container['key'] = $key; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type type + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets rules + * + * @return \OpenAPI\Client\Model\RuleObject|null + */ + public function getRules() + { + return $this->container['rules']; + } + + /** + * Sets rules + * + * @param \OpenAPI\Client\Model\RuleObject|null $rules rules + * + * @return self + */ + public function setRules($rules) + { + if (is_null($rules)) { + array_push($this->openAPINullablesSetToNull, 'rules'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('rules', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['rules'] = $rules; + + return $this; + } + + /** + * Gets settings + * + * @return \OpenAPI\Client\Model\ClicksElementGoalSettings|null + */ + public function getSettings() + { + return $this->container['settings']; + } + + /** + * Sets settings + * + * @param \OpenAPI\Client\Model\ClicksElementGoalSettings|null $settings settings + * + * @return self + */ + public function setSettings($settings) + { + if (is_null($settings)) { + throw new \InvalidArgumentException('non-nullable settings cannot be null'); + } + $this->container['settings'] = $settings; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/ConfigGoalBase.php b/packages/Types/lib/Generated/Model/ConfigGoalBase.php new file mode 100644 index 0000000..9269592 --- /dev/null +++ b/packages/Types/lib/Generated/Model/ConfigGoalBase.php @@ -0,0 +1,553 @@ + + */ +class ConfigGoalBase implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ConfigGoalBase'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'string', + 'name' => 'string', + 'key' => 'string', + 'type' => '\OpenAPI\Client\Model\GoalTypes[]', + 'rules' => '\OpenAPI\Client\Model\RuleObject' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'name' => null, + 'key' => null, + 'type' => null, + 'rules' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'name' => false, + 'key' => false, + 'type' => false, + 'rules' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'name' => 'name', + 'key' => 'key', + 'type' => 'type', + 'rules' => 'rules' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'name' => 'setName', + 'key' => 'setKey', + 'type' => 'setType', + 'rules' => 'setRules' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'name' => 'getName', + 'key' => 'getKey', + 'type' => 'getType', + 'rules' => 'getRules' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('key', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('rules', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id Goal ID + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name Goal Name. + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets key + * + * @return string|null + */ + public function getKey() + { + return $this->container['key']; + } + + /** + * Sets key + * + * @param string|null $key Goal Key + * + * @return self + */ + public function setKey($key) + { + if (is_null($key)) { + throw new \InvalidArgumentException('non-nullable key cannot be null'); + } + $this->container['key'] = $key; + + return $this; + } + + /** + * Gets type + * + * @return \OpenAPI\Client\Model\GoalTypes[]|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param \OpenAPI\Client\Model\GoalTypes[]|null $type List of goal types to be returned + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets rules + * + * @return \OpenAPI\Client\Model\RuleObject|null + */ + public function getRules() + { + return $this->container['rules']; + } + + /** + * Sets rules + * + * @param \OpenAPI\Client\Model\RuleObject|null $rules rules + * + * @return self + */ + public function setRules($rules) + { + if (is_null($rules)) { + array_push($this->openAPINullablesSetToNull, 'rules'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('rules', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['rules'] = $rules; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/ConfigLocation.php b/packages/Types/lib/Generated/Model/ConfigLocation.php new file mode 100644 index 0000000..3131e6c --- /dev/null +++ b/packages/Types/lib/Generated/Model/ConfigLocation.php @@ -0,0 +1,553 @@ + + */ +class ConfigLocation implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ConfigLocation'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'string', + 'key' => 'string', + 'name' => 'string', + 'trigger' => '\OpenAPI\Client\Model\LocationTrigger', + 'rules' => '\OpenAPI\Client\Model\RuleObject' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'key' => null, + 'name' => null, + 'trigger' => null, + 'rules' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'key' => false, + 'name' => false, + 'trigger' => false, + 'rules' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'key' => 'key', + 'name' => 'name', + 'trigger' => 'trigger', + 'rules' => 'rules' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'key' => 'setKey', + 'name' => 'setName', + 'trigger' => 'setTrigger', + 'rules' => 'setRules' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'key' => 'getKey', + 'name' => 'getName', + 'trigger' => 'getTrigger', + 'rules' => 'getRules' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('key', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('trigger', $data ?? [], null); + $this->setIfExists('rules', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id Location ID + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets key + * + * @return string|null + */ + public function getKey() + { + return $this->container['key']; + } + + /** + * Sets key + * + * @param string|null $key Location unique key + * + * @return self + */ + public function setKey($key) + { + if (is_null($key)) { + throw new \InvalidArgumentException('non-nullable key cannot be null'); + } + $this->container['key'] = $key; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name Location Name + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets trigger + * + * @return \OpenAPI\Client\Model\LocationTrigger|null + */ + public function getTrigger() + { + return $this->container['trigger']; + } + + /** + * Sets trigger + * + * @param \OpenAPI\Client\Model\LocationTrigger|null $trigger trigger + * + * @return self + */ + public function setTrigger($trigger) + { + if (is_null($trigger)) { + throw new \InvalidArgumentException('non-nullable trigger cannot be null'); + } + $this->container['trigger'] = $trigger; + + return $this; + } + + /** + * Gets rules + * + * @return \OpenAPI\Client\Model\RuleObject|null + */ + public function getRules() + { + return $this->container['rules']; + } + + /** + * Sets rules + * + * @param \OpenAPI\Client\Model\RuleObject|null $rules rules + * + * @return self + */ + public function setRules($rules) + { + if (is_null($rules)) { + array_push($this->openAPINullablesSetToNull, 'rules'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('rules', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['rules'] = $rules; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/ConfigMinimalResponseData.php b/packages/Types/lib/Generated/Model/ConfigMinimalResponseData.php new file mode 100644 index 0000000..cd065da --- /dev/null +++ b/packages/Types/lib/Generated/Model/ConfigMinimalResponseData.php @@ -0,0 +1,635 @@ + + */ +class ConfigMinimalResponseData implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ConfigMinimalResponseData'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'include_jquery' => 'bool', + 'include_jquery_v1' => 'bool', + 'disable_spa_functionality' => 'bool', + 'version' => 'string', + 'tracking_script' => '\OpenAPI\Client\Model\TrackingScriptReleaseBase', + 'account_id' => 'string', + 'project_id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'include_jquery' => null, + 'include_jquery_v1' => null, + 'disable_spa_functionality' => null, + 'version' => null, + 'tracking_script' => null, + 'account_id' => null, + 'project_id' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'include_jquery' => false, + 'include_jquery_v1' => false, + 'disable_spa_functionality' => false, + 'version' => true, + 'tracking_script' => true, + 'account_id' => false, + 'project_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'include_jquery' => 'include_jquery', + 'include_jquery_v1' => 'include_jquery_v1', + 'disable_spa_functionality' => 'disable_spa_functionality', + 'version' => 'version', + 'tracking_script' => 'tracking_script', + 'account_id' => 'account_id', + 'project_id' => 'project_id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'include_jquery' => 'setIncludeJquery', + 'include_jquery_v1' => 'setIncludeJqueryV1', + 'disable_spa_functionality' => 'setDisableSpaFunctionality', + 'version' => 'setVersion', + 'tracking_script' => 'setTrackingScript', + 'account_id' => 'setAccountId', + 'project_id' => 'setProjectId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'include_jquery' => 'getIncludeJquery', + 'include_jquery_v1' => 'getIncludeJqueryV1', + 'disable_spa_functionality' => 'getDisableSpaFunctionality', + 'version' => 'getVersion', + 'tracking_script' => 'getTrackingScript', + 'account_id' => 'getAccountId', + 'project_id' => 'getProjectId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('include_jquery', $data ?? [], null); + $this->setIfExists('include_jquery_v1', $data ?? [], false); + $this->setIfExists('disable_spa_functionality', $data ?? [], false); + $this->setIfExists('version', $data ?? [], null); + $this->setIfExists('tracking_script', $data ?? [], null); + $this->setIfExists('account_id', $data ?? [], null); + $this->setIfExists('project_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!is_null($this->container['version']) && (mb_strlen($this->container['version']) > 50)) { + $invalidProperties[] = "invalid value for 'version', the character length must be smaller than or equal to 50."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets include_jquery + * + * @return bool|null + */ + public function getIncludeJquery() + { + return $this->container['include_jquery']; + } + + /** + * Sets include_jquery + * + * @param bool|null $include_jquery Whether to include jQuery library or not into the javascript tracking file served by Convert and loaded via the tracking snippet. If jQuery is not included, it has to be loaded on page, before Convert's tracking code + * + * @return self + */ + public function setIncludeJquery($include_jquery) + { + if (is_null($include_jquery)) { + throw new \InvalidArgumentException('non-nullable include_jquery cannot be null'); + } + $this->container['include_jquery'] = $include_jquery; + + return $this; + } + + /** + * Gets include_jquery_v1 + * + * @return bool|null + */ + public function getIncludeJqueryV1() + { + return $this->container['include_jquery_v1']; + } + + /** + * Sets include_jquery_v1 + * + * @param bool|null $include_jquery_v1 Whether to include jQuery library or not into the v1 javascript tracking file served by Convert and loaded via the tracking snippet. + * + * @return self + */ + public function setIncludeJqueryV1($include_jquery_v1) + { + if (is_null($include_jquery_v1)) { + throw new \InvalidArgumentException('non-nullable include_jquery_v1 cannot be null'); + } + $this->container['include_jquery_v1'] = $include_jquery_v1; + + return $this; + } + + /** + * Gets disable_spa_functionality + * + * @return bool|null + */ + public function getDisableSpaFunctionality() + { + return $this->container['disable_spa_functionality']; + } + + /** + * Sets disable_spa_functionality + * + * @param bool|null $disable_spa_functionality Whether to disable the SPA (Single Page Application) related functionalities from the tracking scripts V1. Most websites work fine without disabling SPA functionality regardless of the fact they are Single Page Apps or not. In edge situation, this setting might prove handy + * + * @return self + */ + public function setDisableSpaFunctionality($disable_spa_functionality) + { + if (is_null($disable_spa_functionality)) { + throw new \InvalidArgumentException('non-nullable disable_spa_functionality cannot be null'); + } + $this->container['disable_spa_functionality'] = $disable_spa_functionality; + + return $this; + } + + /** + * Gets version + * + * @return string|null + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param string|null $version Tracks the project's version, updated with each change done inside the project, which would affect the config of that project. The format is [ISO_datetime]-[incremental_number]. + * + * @return self + */ + public function setVersion($version) + { + if (is_null($version)) { + array_push($this->openAPINullablesSetToNull, 'version'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('version', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($version) && (mb_strlen($version) > 50)) { + throw new \InvalidArgumentException('invalid length for $version when calling ConfigMinimalResponseData., must be smaller than or equal to 50.'); + } + + $this->container['version'] = $version; + + return $this; + } + + /** + * Gets tracking_script + * + * @return \OpenAPI\Client\Model\TrackingScriptReleaseBase|null + */ + public function getTrackingScript() + { + return $this->container['tracking_script']; + } + + /** + * Sets tracking_script + * + * @param \OpenAPI\Client\Model\TrackingScriptReleaseBase|null $tracking_script tracking_script + * + * @return self + */ + public function setTrackingScript($tracking_script) + { + if (is_null($tracking_script)) { + array_push($this->openAPINullablesSetToNull, 'tracking_script'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('tracking_script', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['tracking_script'] = $tracking_script; + + return $this; + } + + /** + * Gets account_id + * + * @return string|null + */ + public function getAccountId() + { + return $this->container['account_id']; + } + + /** + * Sets account_id + * + * @param string|null $account_id Account ID + * + * @return self + */ + public function setAccountId($account_id) + { + if (is_null($account_id)) { + throw new \InvalidArgumentException('non-nullable account_id cannot be null'); + } + $this->container['account_id'] = $account_id; + + return $this; + } + + /** + * Gets project_id + * + * @return string|null + */ + public function getProjectId() + { + return $this->container['project_id']; + } + + /** + * Sets project_id + * + * @param string|null $project_id Project ID + * + * @return self + */ + public function setProjectId($project_id) + { + if (is_null($project_id)) { + throw new \InvalidArgumentException('non-nullable project_id cannot be null'); + } + $this->container['project_id'] = $project_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/ConfigProject.php b/packages/Types/lib/Generated/Model/ConfigProject.php new file mode 100644 index 0000000..e17d9f5 --- /dev/null +++ b/packages/Types/lib/Generated/Model/ConfigProject.php @@ -0,0 +1,746 @@ + + */ +class ConfigProject implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ConfigProject'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'string', + 'name' => 'string', + 'type' => 'string', + 'utc_offset' => 'int', + 'custom_domain' => '\OpenAPI\Client\Model\ConfigProjectCustomDomain', + 'domains' => '\OpenAPI\Client\Model\ConfigProjectDomainsInner[]', + 'global_javascript' => 'string', + 'settings' => '\OpenAPI\Client\Model\ConfigProjectSettings', + 'environments' => 'array' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'name' => null, + 'type' => null, + 'utc_offset' => null, + 'custom_domain' => null, + 'domains' => null, + 'global_javascript' => null, + 'settings' => null, + 'environments' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'name' => false, + 'type' => false, + 'utc_offset' => false, + 'custom_domain' => true, + 'domains' => false, + 'global_javascript' => true, + 'settings' => false, + 'environments' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'name' => 'name', + 'type' => 'type', + 'utc_offset' => 'utc_offset', + 'custom_domain' => 'custom_domain', + 'domains' => 'domains', + 'global_javascript' => 'global_javascript', + 'settings' => 'settings', + 'environments' => 'environments' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'name' => 'setName', + 'type' => 'setType', + 'utc_offset' => 'setUtcOffset', + 'custom_domain' => 'setCustomDomain', + 'domains' => 'setDomains', + 'global_javascript' => 'setGlobalJavascript', + 'settings' => 'setSettings', + 'environments' => 'setEnvironments' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'name' => 'getName', + 'type' => 'getType', + 'utc_offset' => 'getUtcOffset', + 'custom_domain' => 'getCustomDomain', + 'domains' => 'getDomains', + 'global_javascript' => 'getGlobalJavascript', + 'settings' => 'getSettings', + 'environments' => 'getEnvironments' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_FULLSTACK = 'fullstack'; + public const TYPE_WEB = 'web'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_FULLSTACK, + self::TYPE_WEB, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('utc_offset', $data ?? [], 0); + $this->setIfExists('custom_domain', $data ?? [], null); + $this->setIfExists('domains', $data ?? [], null); + $this->setIfExists('global_javascript', $data ?? [], null); + $this->setIfExists('settings', $data ?? [], null); + $this->setIfExists('environments', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + if (!is_null($this->container['utc_offset']) && ($this->container['utc_offset'] > 50400)) { + $invalidProperties[] = "invalid value for 'utc_offset', must be smaller than or equal to 50400."; + } + + if (!is_null($this->container['utc_offset']) && ($this->container['utc_offset'] < -43200)) { + $invalidProperties[] = "invalid value for 'utc_offset', must be bigger than or equal to -43200."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id Project ID + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name Project Name. If **settings.data_anonymization** is turned on, the name will be generated from **id** field + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type Value which describes project product type + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets utc_offset + * + * @return int|null + */ + public function getUtcOffset() + { + return $this->container['utc_offset']; + } + + /** + * Sets utc_offset + * + * @param int|null $utc_offset Offset in seconds, from UTC time, for the give timezone + * + * @return self + */ + public function setUtcOffset($utc_offset) + { + if (is_null($utc_offset)) { + throw new \InvalidArgumentException('non-nullable utc_offset cannot be null'); + } + + if (($utc_offset > 50400)) { + throw new \InvalidArgumentException('invalid value for $utc_offset when calling ConfigProject., must be smaller than or equal to 50400.'); + } + if (($utc_offset < -43200)) { + throw new \InvalidArgumentException('invalid value for $utc_offset when calling ConfigProject., must be bigger than or equal to -43200.'); + } + + $this->container['utc_offset'] = $utc_offset; + + return $this; + } + + /** + * Gets custom_domain + * + * @return \OpenAPI\Client\Model\ConfigProjectCustomDomain|null + */ + public function getCustomDomain() + { + return $this->container['custom_domain']; + } + + /** + * Sets custom_domain + * + * @param \OpenAPI\Client\Model\ConfigProjectCustomDomain|null $custom_domain custom_domain + * + * @return self + */ + public function setCustomDomain($custom_domain) + { + if (is_null($custom_domain)) { + array_push($this->openAPINullablesSetToNull, 'custom_domain'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('custom_domain', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['custom_domain'] = $custom_domain; + + return $this; + } + + /** + * Gets domains + * + * @return \OpenAPI\Client\Model\ConfigProjectDomainsInner[]|null + */ + public function getDomains() + { + return $this->container['domains']; + } + + /** + * Sets domains + * + * @param \OpenAPI\Client\Model\ConfigProjectDomainsInner[]|null $domains List of domains allowed to be tracked under this project + * + * @return self + */ + public function setDomains($domains) + { + if (is_null($domains)) { + throw new \InvalidArgumentException('non-nullable domains cannot be null'); + } + $this->container['domains'] = $domains; + + return $this; + } + + /** + * Gets global_javascript + * + * @return string|null + */ + public function getGlobalJavascript() + { + return $this->container['global_javascript']; + } + + /** + * Sets global_javascript + * + * @param string|null $global_javascript The global javascript code that will be loaded on all pages where the tracking script is installed, prior do processing any of experiences, goals, audiences etc. + * + * @return self + */ + public function setGlobalJavascript($global_javascript) + { + if (is_null($global_javascript)) { + array_push($this->openAPINullablesSetToNull, 'global_javascript'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('global_javascript', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['global_javascript'] = $global_javascript; + + return $this; + } + + /** + * Gets settings + * + * @return \OpenAPI\Client\Model\ConfigProjectSettings|null + */ + public function getSettings() + { + return $this->container['settings']; + } + + /** + * Sets settings + * + * @param \OpenAPI\Client\Model\ConfigProjectSettings|null $settings settings + * + * @return self + */ + public function setSettings($settings) + { + if (is_null($settings)) { + throw new \InvalidArgumentException('non-nullable settings cannot be null'); + } + $this->container['settings'] = $settings; + + return $this; + } + + /** + * Gets environments + * + * @return array|null + */ + public function getEnvironments() + { + return $this->container['environments']; + } + + /** + * Sets environments + * + * @param array|null $environments A user-defined key-value object which describes environments available for the project. The number of environments a user can add depends on their plan, by default only one environment is allowed. + * + * @return self + */ + public function setEnvironments($environments) + { + if (is_null($environments)) { + throw new \InvalidArgumentException('non-nullable environments cannot be null'); + } + $this->container['environments'] = $environments; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/ConfigProjectCustomDomain.php b/packages/Types/lib/Generated/Model/ConfigProjectCustomDomain.php new file mode 100644 index 0000000..0559bcd --- /dev/null +++ b/packages/Types/lib/Generated/Model/ConfigProjectCustomDomain.php @@ -0,0 +1,425 @@ + + */ +class ConfigProjectCustomDomain implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ConfigProject_custom_domain'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'domain' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'domain' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'domain' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'domain' => 'domain' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'domain' => 'setDomain' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'domain' => 'getDomain' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('domain', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!is_null($this->container['domain']) && (mb_strlen($this->container['domain']) > 150)) { + $invalidProperties[] = "invalid value for 'domain', the character length must be smaller than or equal to 150."; + } + + if (!is_null($this->container['domain']) && !preg_match("/^.+\\..+/", $this->container['domain'])) { + $invalidProperties[] = "invalid value for 'domain', must be conform to the pattern /^.+\\..+/."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets domain + * + * @return string|null + */ + public function getDomain() + { + return $this->container['domain']; + } + + /** + * Sets domain + * + * @param string|null $domain Custom domain to be used instead of standard Convert's one + * + * @return self + */ + public function setDomain($domain) + { + if (is_null($domain)) { + throw new \InvalidArgumentException('non-nullable domain cannot be null'); + } + if ((mb_strlen($domain) > 150)) { + throw new \InvalidArgumentException('invalid length for $domain when calling ConfigProjectCustomDomain., must be smaller than or equal to 150.'); + } + if ((!preg_match("/^.+\\..+/", ObjectSerializer::toString($domain)))) { + throw new \InvalidArgumentException("invalid value for \$domain when calling ConfigProjectCustomDomain., must conform to the pattern /^.+\\..+/."); + } + + $this->container['domain'] = $domain; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/ConfigProjectDomainsInner.php b/packages/Types/lib/Generated/Model/ConfigProjectDomainsInner.php new file mode 100644 index 0000000..1dd8a46 --- /dev/null +++ b/packages/Types/lib/Generated/Model/ConfigProjectDomainsInner.php @@ -0,0 +1,450 @@ + + */ +class ConfigProjectDomainsInner implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ConfigProject_domains_inner'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'tld' => 'string', + 'hosts' => 'mixed' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'tld' => null, + 'hosts' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'tld' => false, + 'hosts' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'tld' => 'tld', + 'hosts' => 'hosts' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'tld' => 'setTld', + 'hosts' => 'setHosts' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'tld' => 'getTld', + 'hosts' => 'getHosts' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('tld', $data ?? [], null); + $this->setIfExists('hosts', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets tld + * + * @return string|null + */ + public function getTld() + { + return $this->container['tld']; + } + + /** + * Sets tld + * + * @param string|null $tld Top level domain, used for setting cookies where applicable + * + * @return self + */ + public function setTld($tld) + { + if (is_null($tld)) { + throw new \InvalidArgumentException('non-nullable tld cannot be null'); + } + $this->container['tld'] = $tld; + + return $this; + } + + /** + * Gets hosts + * + * @return mixed|null + */ + public function getHosts() + { + return $this->container['hosts']; + } + + /** + * Sets hosts + * + * @param mixed|null $hosts List of host names under **tld** which are allowed to be tracked under this project + * + * @return self + */ + public function setHosts($hosts) + { + if (is_null($hosts)) { + array_push($this->openAPINullablesSetToNull, 'hosts'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('hosts', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['hosts'] = $hosts; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/ConfigProjectEnvironmentsValue.php b/packages/Types/lib/Generated/Model/ConfigProjectEnvironmentsValue.php new file mode 100644 index 0000000..ed30cf0 --- /dev/null +++ b/packages/Types/lib/Generated/Model/ConfigProjectEnvironmentsValue.php @@ -0,0 +1,450 @@ + + */ +class ConfigProjectEnvironmentsValue implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ConfigProject_environments_value'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'label' => 'string', + 'is_default' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'label' => null, + 'is_default' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'label' => false, + 'is_default' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'label' => 'label', + 'is_default' => 'is_default' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'label' => 'setLabel', + 'is_default' => 'setIsDefault' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'label' => 'getLabel', + 'is_default' => 'getIsDefault' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('label', $data ?? [], null); + $this->setIfExists('is_default', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['label'] === null) { + $invalidProperties[] = "'label' can't be null"; + } + if ($this->container['is_default'] === null) { + $invalidProperties[] = "'is_default' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets label + * + * @return string + */ + public function getLabel() + { + return $this->container['label']; + } + + /** + * Sets label + * + * @param string $label The display name of the environment. + * + * @return self + */ + public function setLabel($label) + { + if (is_null($label)) { + throw new \InvalidArgumentException('non-nullable label cannot be null'); + } + $this->container['label'] = $label; + + return $this; + } + + /** + * Gets is_default + * + * @return bool + */ + public function getIsDefault() + { + return $this->container['is_default']; + } + + /** + * Sets is_default + * + * @param bool $is_default Specifies whether this environment is set as the default environment for the project. + * + * @return self + */ + public function setIsDefault($is_default) + { + if (is_null($is_default)) { + throw new \InvalidArgumentException('non-nullable is_default cannot be null'); + } + $this->container['is_default'] = $is_default; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/ConfigProjectMinimalSettings.php b/packages/Types/lib/Generated/Model/ConfigProjectMinimalSettings.php new file mode 100644 index 0000000..fe837dd --- /dev/null +++ b/packages/Types/lib/Generated/Model/ConfigProjectMinimalSettings.php @@ -0,0 +1,567 @@ + + */ +class ConfigProjectMinimalSettings implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ConfigProjectMinimalSettings'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'include_jquery' => 'bool', + 'include_jquery_v1' => 'bool', + 'disable_spa_functionality' => 'bool', + 'version' => 'string', + 'tracking_script' => '\OpenAPI\Client\Model\TrackingScriptReleaseBase' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'include_jquery' => null, + 'include_jquery_v1' => null, + 'disable_spa_functionality' => null, + 'version' => null, + 'tracking_script' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'include_jquery' => false, + 'include_jquery_v1' => false, + 'disable_spa_functionality' => false, + 'version' => true, + 'tracking_script' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'include_jquery' => 'include_jquery', + 'include_jquery_v1' => 'include_jquery_v1', + 'disable_spa_functionality' => 'disable_spa_functionality', + 'version' => 'version', + 'tracking_script' => 'tracking_script' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'include_jquery' => 'setIncludeJquery', + 'include_jquery_v1' => 'setIncludeJqueryV1', + 'disable_spa_functionality' => 'setDisableSpaFunctionality', + 'version' => 'setVersion', + 'tracking_script' => 'setTrackingScript' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'include_jquery' => 'getIncludeJquery', + 'include_jquery_v1' => 'getIncludeJqueryV1', + 'disable_spa_functionality' => 'getDisableSpaFunctionality', + 'version' => 'getVersion', + 'tracking_script' => 'getTrackingScript' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('include_jquery', $data ?? [], null); + $this->setIfExists('include_jquery_v1', $data ?? [], false); + $this->setIfExists('disable_spa_functionality', $data ?? [], false); + $this->setIfExists('version', $data ?? [], null); + $this->setIfExists('tracking_script', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!is_null($this->container['version']) && (mb_strlen($this->container['version']) > 50)) { + $invalidProperties[] = "invalid value for 'version', the character length must be smaller than or equal to 50."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets include_jquery + * + * @return bool|null + */ + public function getIncludeJquery() + { + return $this->container['include_jquery']; + } + + /** + * Sets include_jquery + * + * @param bool|null $include_jquery Whether to include jQuery library or not into the javascript tracking file served by Convert and loaded via the tracking snippet. If jQuery is not included, it has to be loaded on page, before Convert's tracking code + * + * @return self + */ + public function setIncludeJquery($include_jquery) + { + if (is_null($include_jquery)) { + throw new \InvalidArgumentException('non-nullable include_jquery cannot be null'); + } + $this->container['include_jquery'] = $include_jquery; + + return $this; + } + + /** + * Gets include_jquery_v1 + * + * @return bool|null + */ + public function getIncludeJqueryV1() + { + return $this->container['include_jquery_v1']; + } + + /** + * Sets include_jquery_v1 + * + * @param bool|null $include_jquery_v1 Whether to include jQuery library or not into the v1 javascript tracking file served by Convert and loaded via the tracking snippet. + * + * @return self + */ + public function setIncludeJqueryV1($include_jquery_v1) + { + if (is_null($include_jquery_v1)) { + throw new \InvalidArgumentException('non-nullable include_jquery_v1 cannot be null'); + } + $this->container['include_jquery_v1'] = $include_jquery_v1; + + return $this; + } + + /** + * Gets disable_spa_functionality + * + * @return bool|null + */ + public function getDisableSpaFunctionality() + { + return $this->container['disable_spa_functionality']; + } + + /** + * Sets disable_spa_functionality + * + * @param bool|null $disable_spa_functionality Whether to disable the SPA (Single Page Application) related functionalities from the tracking scripts V1. Most websites work fine without disabling SPA functionality regardless of the fact they are Single Page Apps or not. In edge situation, this setting might prove handy + * + * @return self + */ + public function setDisableSpaFunctionality($disable_spa_functionality) + { + if (is_null($disable_spa_functionality)) { + throw new \InvalidArgumentException('non-nullable disable_spa_functionality cannot be null'); + } + $this->container['disable_spa_functionality'] = $disable_spa_functionality; + + return $this; + } + + /** + * Gets version + * + * @return string|null + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param string|null $version Tracks the project's version, updated with each change done inside the project, which would affect the config of that project. The format is [ISO_datetime]-[incremental_number]. + * + * @return self + */ + public function setVersion($version) + { + if (is_null($version)) { + array_push($this->openAPINullablesSetToNull, 'version'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('version', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($version) && (mb_strlen($version) > 50)) { + throw new \InvalidArgumentException('invalid length for $version when calling ConfigProjectMinimalSettings., must be smaller than or equal to 50.'); + } + + $this->container['version'] = $version; + + return $this; + } + + /** + * Gets tracking_script + * + * @return \OpenAPI\Client\Model\TrackingScriptReleaseBase|null + */ + public function getTrackingScript() + { + return $this->container['tracking_script']; + } + + /** + * Sets tracking_script + * + * @param \OpenAPI\Client\Model\TrackingScriptReleaseBase|null $tracking_script tracking_script + * + * @return self + */ + public function setTrackingScript($tracking_script) + { + if (is_null($tracking_script)) { + array_push($this->openAPINullablesSetToNull, 'tracking_script'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('tracking_script', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['tracking_script'] = $tracking_script; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/ConfigProjectSettings.php b/packages/Types/lib/Generated/Model/ConfigProjectSettings.php new file mode 100644 index 0000000..df74c68 --- /dev/null +++ b/packages/Types/lib/Generated/Model/ConfigProjectSettings.php @@ -0,0 +1,971 @@ + + */ +class ConfigProjectSettings implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ConfigProject_settings'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'include_jquery' => 'bool', + 'include_jquery_v1' => 'bool', + 'disable_spa_functionality' => 'bool', + 'version' => 'string', + 'tracking_script' => '\OpenAPI\Client\Model\TrackingScriptReleaseBase', + 'allow_crossdomain_tracking' => 'bool', + 'data_anonymization' => 'bool', + 'do_not_track' => 'string', + 'global_privacy_control' => 'string', + 'do_not_track_referral' => 'bool', + 'integrations' => '\OpenAPI\Client\Model\ConfigProjectSettingsAllOfIntegrations', + 'min_order_value' => 'float', + 'max_order_value' => 'float', + 'outliers' => '\OpenAPI\Client\Model\ConfigExperienceSettingsOutliers' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'include_jquery' => null, + 'include_jquery_v1' => null, + 'disable_spa_functionality' => null, + 'version' => null, + 'tracking_script' => null, + 'allow_crossdomain_tracking' => null, + 'data_anonymization' => null, + 'do_not_track' => null, + 'global_privacy_control' => null, + 'do_not_track_referral' => null, + 'integrations' => null, + 'min_order_value' => null, + 'max_order_value' => null, + 'outliers' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'include_jquery' => false, + 'include_jquery_v1' => false, + 'disable_spa_functionality' => false, + 'version' => true, + 'tracking_script' => true, + 'allow_crossdomain_tracking' => false, + 'data_anonymization' => false, + 'do_not_track' => false, + 'global_privacy_control' => false, + 'do_not_track_referral' => false, + 'integrations' => false, + 'min_order_value' => false, + 'max_order_value' => false, + 'outliers' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'include_jquery' => 'include_jquery', + 'include_jquery_v1' => 'include_jquery_v1', + 'disable_spa_functionality' => 'disable_spa_functionality', + 'version' => 'version', + 'tracking_script' => 'tracking_script', + 'allow_crossdomain_tracking' => 'allow_crossdomain_tracking', + 'data_anonymization' => 'data_anonymization', + 'do_not_track' => 'do_not_track', + 'global_privacy_control' => 'global_privacy_control', + 'do_not_track_referral' => 'do_not_track_referral', + 'integrations' => 'integrations', + 'min_order_value' => 'min_order_value', + 'max_order_value' => 'max_order_value', + 'outliers' => 'outliers' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'include_jquery' => 'setIncludeJquery', + 'include_jquery_v1' => 'setIncludeJqueryV1', + 'disable_spa_functionality' => 'setDisableSpaFunctionality', + 'version' => 'setVersion', + 'tracking_script' => 'setTrackingScript', + 'allow_crossdomain_tracking' => 'setAllowCrossdomainTracking', + 'data_anonymization' => 'setDataAnonymization', + 'do_not_track' => 'setDoNotTrack', + 'global_privacy_control' => 'setGlobalPrivacyControl', + 'do_not_track_referral' => 'setDoNotTrackReferral', + 'integrations' => 'setIntegrations', + 'min_order_value' => 'setMinOrderValue', + 'max_order_value' => 'setMaxOrderValue', + 'outliers' => 'setOutliers' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'include_jquery' => 'getIncludeJquery', + 'include_jquery_v1' => 'getIncludeJqueryV1', + 'disable_spa_functionality' => 'getDisableSpaFunctionality', + 'version' => 'getVersion', + 'tracking_script' => 'getTrackingScript', + 'allow_crossdomain_tracking' => 'getAllowCrossdomainTracking', + 'data_anonymization' => 'getDataAnonymization', + 'do_not_track' => 'getDoNotTrack', + 'global_privacy_control' => 'getGlobalPrivacyControl', + 'do_not_track_referral' => 'getDoNotTrackReferral', + 'integrations' => 'getIntegrations', + 'min_order_value' => 'getMinOrderValue', + 'max_order_value' => 'getMaxOrderValue', + 'outliers' => 'getOutliers' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const DO_NOT_TRACK_OFF = 'OFF'; + public const DO_NOT_TRACK_EU_ONLY = 'EU ONLY'; + public const DO_NOT_TRACK_EEA_ONLY = 'EEA ONLY'; + public const DO_NOT_TRACK_WORLDWIDE = 'Worldwide'; + public const GLOBAL_PRIVACY_CONTROL_OFF = 'OFF'; + public const GLOBAL_PRIVACY_CONTROL_EU_ONLY = 'EU ONLY'; + public const GLOBAL_PRIVACY_CONTROL_EEA_ONLY = 'EEA ONLY'; + public const GLOBAL_PRIVACY_CONTROL_WORLDWIDE = 'Worldwide'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getDoNotTrackAllowableValues() + { + return [ + self::DO_NOT_TRACK_OFF, + self::DO_NOT_TRACK_EU_ONLY, + self::DO_NOT_TRACK_EEA_ONLY, + self::DO_NOT_TRACK_WORLDWIDE, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getGlobalPrivacyControlAllowableValues() + { + return [ + self::GLOBAL_PRIVACY_CONTROL_OFF, + self::GLOBAL_PRIVACY_CONTROL_EU_ONLY, + self::GLOBAL_PRIVACY_CONTROL_EEA_ONLY, + self::GLOBAL_PRIVACY_CONTROL_WORLDWIDE, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('include_jquery', $data ?? [], null); + $this->setIfExists('include_jquery_v1', $data ?? [], false); + $this->setIfExists('disable_spa_functionality', $data ?? [], false); + $this->setIfExists('version', $data ?? [], null); + $this->setIfExists('tracking_script', $data ?? [], null); + $this->setIfExists('allow_crossdomain_tracking', $data ?? [], null); + $this->setIfExists('data_anonymization', $data ?? [], null); + $this->setIfExists('do_not_track', $data ?? [], null); + $this->setIfExists('global_privacy_control', $data ?? [], null); + $this->setIfExists('do_not_track_referral', $data ?? [], false); + $this->setIfExists('integrations', $data ?? [], null); + $this->setIfExists('min_order_value', $data ?? [], null); + $this->setIfExists('max_order_value', $data ?? [], null); + $this->setIfExists('outliers', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!is_null($this->container['version']) && (mb_strlen($this->container['version']) > 50)) { + $invalidProperties[] = "invalid value for 'version', the character length must be smaller than or equal to 50."; + } + + $allowedValues = $this->getDoNotTrackAllowableValues(); + if (!is_null($this->container['do_not_track']) && !in_array($this->container['do_not_track'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'do_not_track', must be one of '%s'", + $this->container['do_not_track'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getGlobalPrivacyControlAllowableValues(); + if (!is_null($this->container['global_privacy_control']) && !in_array($this->container['global_privacy_control'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'global_privacy_control', must be one of '%s'", + $this->container['global_privacy_control'], + implode("', '", $allowedValues) + ); + } + + if (!is_null($this->container['min_order_value']) && ($this->container['min_order_value'] < 0)) { + $invalidProperties[] = "invalid value for 'min_order_value', must be bigger than or equal to 0."; + } + + if (!is_null($this->container['max_order_value']) && ($this->container['max_order_value'] < 0)) { + $invalidProperties[] = "invalid value for 'max_order_value', must be bigger than or equal to 0."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets include_jquery + * + * @return bool|null + */ + public function getIncludeJquery() + { + return $this->container['include_jquery']; + } + + /** + * Sets include_jquery + * + * @param bool|null $include_jquery Whether to include jQuery library or not into the javascript tracking file served by Convert and loaded via the tracking snippet. If jQuery is not included, it has to be loaded on page, before Convert's tracking code + * + * @return self + */ + public function setIncludeJquery($include_jquery) + { + if (is_null($include_jquery)) { + throw new \InvalidArgumentException('non-nullable include_jquery cannot be null'); + } + $this->container['include_jquery'] = $include_jquery; + + return $this; + } + + /** + * Gets include_jquery_v1 + * + * @return bool|null + */ + public function getIncludeJqueryV1() + { + return $this->container['include_jquery_v1']; + } + + /** + * Sets include_jquery_v1 + * + * @param bool|null $include_jquery_v1 Whether to include jQuery library or not into the v1 javascript tracking file served by Convert and loaded via the tracking snippet. + * + * @return self + */ + public function setIncludeJqueryV1($include_jquery_v1) + { + if (is_null($include_jquery_v1)) { + throw new \InvalidArgumentException('non-nullable include_jquery_v1 cannot be null'); + } + $this->container['include_jquery_v1'] = $include_jquery_v1; + + return $this; + } + + /** + * Gets disable_spa_functionality + * + * @return bool|null + */ + public function getDisableSpaFunctionality() + { + return $this->container['disable_spa_functionality']; + } + + /** + * Sets disable_spa_functionality + * + * @param bool|null $disable_spa_functionality Whether to disable the SPA (Single Page Application) related functionalities from the tracking scripts V1. Most websites work fine without disabling SPA functionality regardless of the fact they are Single Page Apps or not. In edge situation, this setting might prove handy + * + * @return self + */ + public function setDisableSpaFunctionality($disable_spa_functionality) + { + if (is_null($disable_spa_functionality)) { + throw new \InvalidArgumentException('non-nullable disable_spa_functionality cannot be null'); + } + $this->container['disable_spa_functionality'] = $disable_spa_functionality; + + return $this; + } + + /** + * Gets version + * + * @return string|null + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param string|null $version Tracks the project's version, updated with each change done inside the project, which would affect the config of that project. The format is [ISO_datetime]-[incremental_number]. + * + * @return self + */ + public function setVersion($version) + { + if (is_null($version)) { + array_push($this->openAPINullablesSetToNull, 'version'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('version', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($version) && (mb_strlen($version) > 50)) { + throw new \InvalidArgumentException('invalid length for $version when calling ConfigProjectSettings., must be smaller than or equal to 50.'); + } + + $this->container['version'] = $version; + + return $this; + } + + /** + * Gets tracking_script + * + * @return \OpenAPI\Client\Model\TrackingScriptReleaseBase|null + */ + public function getTrackingScript() + { + return $this->container['tracking_script']; + } + + /** + * Sets tracking_script + * + * @param \OpenAPI\Client\Model\TrackingScriptReleaseBase|null $tracking_script tracking_script + * + * @return self + */ + public function setTrackingScript($tracking_script) + { + if (is_null($tracking_script)) { + array_push($this->openAPINullablesSetToNull, 'tracking_script'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('tracking_script', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['tracking_script'] = $tracking_script; + + return $this; + } + + /** + * Gets allow_crossdomain_tracking + * + * @return bool|null + */ + public function getAllowCrossdomainTracking() + { + return $this->container['allow_crossdomain_tracking']; + } + + /** + * Sets allow_crossdomain_tracking + * + * @param bool|null $allow_crossdomain_tracking Flag indicating whether decoration of outgoing links (appending tracking cookies inside the link URL in order to make cross domain tracking possible) is done automatically on page + * + * @return self + */ + public function setAllowCrossdomainTracking($allow_crossdomain_tracking) + { + if (is_null($allow_crossdomain_tracking)) { + throw new \InvalidArgumentException('non-nullable allow_crossdomain_tracking cannot be null'); + } + $this->container['allow_crossdomain_tracking'] = $allow_crossdomain_tracking; + + return $this; + } + + /** + * Gets data_anonymization + * + * @return bool|null + */ + public function getDataAnonymization() + { + return $this->container['data_anonymization']; + } + + /** + * Sets data_anonymization + * + * @param bool|null $data_anonymization Whether or not data is [anonymized](https://convert.zendesk.com/hc/en-us/articles/204506339-Prevent-Experiment-Details-Data-Leak-with-Data-Anonymization). + * + * @return self + */ + public function setDataAnonymization($data_anonymization) + { + if (is_null($data_anonymization)) { + throw new \InvalidArgumentException('non-nullable data_anonymization cannot be null'); + } + $this->container['data_anonymization'] = $data_anonymization; + + return $this; + } + + /** + * Gets do_not_track + * + * @return string|null + */ + public function getDoNotTrack() + { + return $this->container['do_not_track']; + } + + /** + * Sets do_not_track + * + * @param string|null $do_not_track Follow the 'Do not track' browser settings for users in the mentioned area of the world. + * + * @return self + */ + public function setDoNotTrack($do_not_track) + { + if (is_null($do_not_track)) { + throw new \InvalidArgumentException('non-nullable do_not_track cannot be null'); + } + $allowedValues = $this->getDoNotTrackAllowableValues(); + if (!in_array($do_not_track, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'do_not_track', must be one of '%s'", + $do_not_track, + implode("', '", $allowedValues) + ) + ); + } + $this->container['do_not_track'] = $do_not_track; + + return $this; + } + + /** + * Gets global_privacy_control + * + * @return string|null + */ + public function getGlobalPrivacyControl() + { + return $this->container['global_privacy_control']; + } + + /** + * Sets global_privacy_control + * + * @param string|null $global_privacy_control Follow Global Privacy Control (GPC) signals for users in the mentioned area of the world. - OFF: Do not follow GPC signals. - EU ONLY: Follow GPC signals for users in the European Union only. - EEA ONLY: Follow GPC signals for users in the European Economic Area only. - Worldwide: Follow GPC signals for users worldwide. + * + * @return self + */ + public function setGlobalPrivacyControl($global_privacy_control) + { + if (is_null($global_privacy_control)) { + throw new \InvalidArgumentException('non-nullable global_privacy_control cannot be null'); + } + $allowedValues = $this->getGlobalPrivacyControlAllowableValues(); + if (!in_array($global_privacy_control, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'global_privacy_control', must be one of '%s'", + $global_privacy_control, + implode("', '", $allowedValues) + ) + ); + } + $this->container['global_privacy_control'] = $global_privacy_control; + + return $this; + } + + /** + * Gets do_not_track_referral + * + * @return bool|null + */ + public function getDoNotTrackReferral() + { + return $this->container['do_not_track_referral']; + } + + /** + * Sets do_not_track_referral + * + * @param bool|null $do_not_track_referral When this is turned to true, Convert won't track any referral data like http referral, utm query strings etc. Those will be used on the current page if available but won't be stored in cookies in order to be used on subsequent pages. + * + * @return self + */ + public function setDoNotTrackReferral($do_not_track_referral) + { + if (is_null($do_not_track_referral)) { + throw new \InvalidArgumentException('non-nullable do_not_track_referral cannot be null'); + } + $this->container['do_not_track_referral'] = $do_not_track_referral; + + return $this; + } + + /** + * Gets integrations + * + * @return \OpenAPI\Client\Model\ConfigProjectSettingsAllOfIntegrations|null + */ + public function getIntegrations() + { + return $this->container['integrations']; + } + + /** + * Sets integrations + * + * @param \OpenAPI\Client\Model\ConfigProjectSettingsAllOfIntegrations|null $integrations integrations + * + * @return self + */ + public function setIntegrations($integrations) + { + if (is_null($integrations)) { + throw new \InvalidArgumentException('non-nullable integrations cannot be null'); + } + $this->container['integrations'] = $integrations; + + return $this; + } + + /** + * Gets min_order_value + * + * @return float|null + * @deprecated + */ + public function getMinOrderValue() + { + return $this->container['min_order_value']; + } + + /** + * Sets min_order_value + * + * @param float|null $min_order_value Minimum order value for transactions outliers + * + * @return self + * @deprecated + */ + public function setMinOrderValue($min_order_value) + { + if (is_null($min_order_value)) { + throw new \InvalidArgumentException('non-nullable min_order_value cannot be null'); + } + + if (($min_order_value < 0)) { + throw new \InvalidArgumentException('invalid value for $min_order_value when calling ConfigProjectSettings., must be bigger than or equal to 0.'); + } + + $this->container['min_order_value'] = $min_order_value; + + return $this; + } + + /** + * Gets max_order_value + * + * @return float|null + * @deprecated + */ + public function getMaxOrderValue() + { + return $this->container['max_order_value']; + } + + /** + * Sets max_order_value + * + * @param float|null $max_order_value Maximum order value for transactions outliers + * + * @return self + * @deprecated + */ + public function setMaxOrderValue($max_order_value) + { + if (is_null($max_order_value)) { + throw new \InvalidArgumentException('non-nullable max_order_value cannot be null'); + } + + if (($max_order_value < 0)) { + throw new \InvalidArgumentException('invalid value for $max_order_value when calling ConfigProjectSettings., must be bigger than or equal to 0.'); + } + + $this->container['max_order_value'] = $max_order_value; + + return $this; + } + + /** + * Gets outliers + * + * @return \OpenAPI\Client\Model\ConfigExperienceSettingsOutliers|null + */ + public function getOutliers() + { + return $this->container['outliers']; + } + + /** + * Sets outliers + * + * @param \OpenAPI\Client\Model\ConfigExperienceSettingsOutliers|null $outliers outliers + * + * @return self + */ + public function setOutliers($outliers) + { + if (is_null($outliers)) { + throw new \InvalidArgumentException('non-nullable outliers cannot be null'); + } + $this->container['outliers'] = $outliers; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/ConfigProjectSettingsAllOfIntegrations.php b/packages/Types/lib/Generated/Model/ConfigProjectSettingsAllOfIntegrations.php new file mode 100644 index 0000000..d3073b3 --- /dev/null +++ b/packages/Types/lib/Generated/Model/ConfigProjectSettingsAllOfIntegrations.php @@ -0,0 +1,478 @@ + + */ +class ConfigProjectSettingsAllOfIntegrations implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ConfigProject_settings_allOf_integrations'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'google_analytics' => '\OpenAPI\Client\Model\GASettings', + 'visitor_insights' => '\OpenAPI\Client\Model\VisitorInsightsData', + 'kissmetrics' => '\OpenAPI\Client\Model\ConfigProjectSettingsAllOfIntegrationsKissmetrics' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'google_analytics' => null, + 'visitor_insights' => null, + 'kissmetrics' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'google_analytics' => false, + 'visitor_insights' => false, + 'kissmetrics' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'google_analytics' => 'google_analytics', + 'visitor_insights' => 'visitor_insights', + 'kissmetrics' => 'kissmetrics' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'google_analytics' => 'setGoogleAnalytics', + 'visitor_insights' => 'setVisitorInsights', + 'kissmetrics' => 'setKissmetrics' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'google_analytics' => 'getGoogleAnalytics', + 'visitor_insights' => 'getVisitorInsights', + 'kissmetrics' => 'getKissmetrics' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('google_analytics', $data ?? [], null); + $this->setIfExists('visitor_insights', $data ?? [], null); + $this->setIfExists('kissmetrics', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets google_analytics + * + * @return \OpenAPI\Client\Model\GASettings|null + */ + public function getGoogleAnalytics() + { + return $this->container['google_analytics']; + } + + /** + * Sets google_analytics + * + * @param \OpenAPI\Client\Model\GASettings|null $google_analytics google_analytics + * + * @return self + */ + public function setGoogleAnalytics($google_analytics) + { + if (is_null($google_analytics)) { + throw new \InvalidArgumentException('non-nullable google_analytics cannot be null'); + } + $this->container['google_analytics'] = $google_analytics; + + return $this; + } + + /** + * Gets visitor_insights + * + * @return \OpenAPI\Client\Model\VisitorInsightsData|null + */ + public function getVisitorInsights() + { + return $this->container['visitor_insights']; + } + + /** + * Sets visitor_insights + * + * @param \OpenAPI\Client\Model\VisitorInsightsData|null $visitor_insights visitor_insights + * + * @return self + */ + public function setVisitorInsights($visitor_insights) + { + if (is_null($visitor_insights)) { + throw new \InvalidArgumentException('non-nullable visitor_insights cannot be null'); + } + $this->container['visitor_insights'] = $visitor_insights; + + return $this; + } + + /** + * Gets kissmetrics + * + * @return \OpenAPI\Client\Model\ConfigProjectSettingsAllOfIntegrationsKissmetrics|null + */ + public function getKissmetrics() + { + return $this->container['kissmetrics']; + } + + /** + * Sets kissmetrics + * + * @param \OpenAPI\Client\Model\ConfigProjectSettingsAllOfIntegrationsKissmetrics|null $kissmetrics kissmetrics + * + * @return self + */ + public function setKissmetrics($kissmetrics) + { + if (is_null($kissmetrics)) { + throw new \InvalidArgumentException('non-nullable kissmetrics cannot be null'); + } + $this->container['kissmetrics'] = $kissmetrics; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/ConfigProjectSettingsAllOfIntegrationsKissmetrics.php b/packages/Types/lib/Generated/Model/ConfigProjectSettingsAllOfIntegrationsKissmetrics.php new file mode 100644 index 0000000..9429d32 --- /dev/null +++ b/packages/Types/lib/Generated/Model/ConfigProjectSettingsAllOfIntegrationsKissmetrics.php @@ -0,0 +1,409 @@ + + */ +class ConfigProjectSettingsAllOfIntegrationsKissmetrics implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ConfigProject_settings_allOf_integrations_kissmetrics'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'enabled' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'enabled' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'enabled' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'enabled' => 'enabled' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'enabled' => 'setEnabled' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'enabled' => 'getEnabled' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('enabled', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets enabled + * + * @return bool|null + */ + public function getEnabled() + { + return $this->container['enabled']; + } + + /** + * Sets enabled + * + * @param bool|null $enabled Flag indicating whether Kissmetrics integration is enabled or not for this project + * + * @return self + */ + public function setEnabled($enabled) + { + if (is_null($enabled)) { + throw new \InvalidArgumentException('non-nullable enabled cannot be null'); + } + $this->container['enabled'] = $enabled; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/ConfigResponseData.php b/packages/Types/lib/Generated/Model/ConfigResponseData.php new file mode 100644 index 0000000..3a8315d --- /dev/null +++ b/packages/Types/lib/Generated/Model/ConfigResponseData.php @@ -0,0 +1,716 @@ + + */ +class ConfigResponseData implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ConfigResponseData'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'account_id' => 'string', + 'project' => '\OpenAPI\Client\Model\ConfigProject', + 'goals' => '\OpenAPI\Client\Model\ConfigGoal[]', + 'locations' => '\OpenAPI\Client\Model\ConfigLocation[]', + 'audiences' => '\OpenAPI\Client\Model\ConfigAudience[]', + 'segments' => '\OpenAPI\Client\Model\ConfigSegment[]', + 'experiences' => '\OpenAPI\Client\Model\ConfigExperience[]', + 'archived_experiences' => 'string[]', + 'features' => '\OpenAPI\Client\Model\ConfigFeature[]', + 'is_debug' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'account_id' => null, + 'project' => null, + 'goals' => null, + 'locations' => null, + 'audiences' => null, + 'segments' => null, + 'experiences' => null, + 'archived_experiences' => null, + 'features' => null, + 'is_debug' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'account_id' => false, + 'project' => false, + 'goals' => false, + 'locations' => false, + 'audiences' => false, + 'segments' => false, + 'experiences' => false, + 'archived_experiences' => false, + 'features' => false, + 'is_debug' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'account_id' => 'account_id', + 'project' => 'project', + 'goals' => 'goals', + 'locations' => 'locations', + 'audiences' => 'audiences', + 'segments' => 'segments', + 'experiences' => 'experiences', + 'archived_experiences' => 'archived_experiences', + 'features' => 'features', + 'is_debug' => 'is_debug' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'account_id' => 'setAccountId', + 'project' => 'setProject', + 'goals' => 'setGoals', + 'locations' => 'setLocations', + 'audiences' => 'setAudiences', + 'segments' => 'setSegments', + 'experiences' => 'setExperiences', + 'archived_experiences' => 'setArchivedExperiences', + 'features' => 'setFeatures', + 'is_debug' => 'setIsDebug' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'account_id' => 'getAccountId', + 'project' => 'getProject', + 'goals' => 'getGoals', + 'locations' => 'getLocations', + 'audiences' => 'getAudiences', + 'segments' => 'getSegments', + 'experiences' => 'getExperiences', + 'archived_experiences' => 'getArchivedExperiences', + 'features' => 'getFeatures', + 'is_debug' => 'getIsDebug' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('account_id', $data ?? [], null); + $this->setIfExists('project', $data ?? [], null); + $this->setIfExists('goals', $data ?? [], null); + $this->setIfExists('locations', $data ?? [], null); + $this->setIfExists('audiences', $data ?? [], null); + $this->setIfExists('segments', $data ?? [], null); + $this->setIfExists('experiences', $data ?? [], null); + $this->setIfExists('archived_experiences', $data ?? [], null); + $this->setIfExists('features', $data ?? [], null); + $this->setIfExists('is_debug', $data ?? [], false); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets account_id + * + * @return string|null + */ + public function getAccountId() + { + return $this->container['account_id']; + } + + /** + * Sets account_id + * + * @param string|null $account_id Account ID under which the project exists + * + * @return self + */ + public function setAccountId($account_id) + { + if (is_null($account_id)) { + throw new \InvalidArgumentException('non-nullable account_id cannot be null'); + } + $this->container['account_id'] = $account_id; + + return $this; + } + + /** + * Gets project + * + * @return \OpenAPI\Client\Model\ConfigProject|null + */ + public function getProject() + { + return $this->container['project']; + } + + /** + * Sets project + * + * @param \OpenAPI\Client\Model\ConfigProject|null $project project + * + * @return self + */ + public function setProject($project) + { + if (is_null($project)) { + throw new \InvalidArgumentException('non-nullable project cannot be null'); + } + $this->container['project'] = $project; + + return $this; + } + + /** + * Gets goals + * + * @return \OpenAPI\Client\Model\ConfigGoal[]|null + */ + public function getGoals() + { + return $this->container['goals']; + } + + /** + * Sets goals + * + * @param \OpenAPI\Client\Model\ConfigGoal[]|null $goals List of goals to be tracked in the project + * + * @return self + */ + public function setGoals($goals) + { + if (is_null($goals)) { + throw new \InvalidArgumentException('non-nullable goals cannot be null'); + } + $this->container['goals'] = $goals; + + return $this; + } + + /** + * Gets locations + * + * @return \OpenAPI\Client\Model\ConfigLocation[]|null + */ + public function getLocations() + { + return $this->container['locations']; + } + + /** + * Sets locations + * + * @param \OpenAPI\Client\Model\ConfigLocation[]|null $locations List of locations that are used inside this project + * + * @return self + */ + public function setLocations($locations) + { + if (is_null($locations)) { + throw new \InvalidArgumentException('non-nullable locations cannot be null'); + } + $this->container['locations'] = $locations; + + return $this; + } + + /** + * Gets audiences + * + * @return \OpenAPI\Client\Model\ConfigAudience[]|null + */ + public function getAudiences() + { + return $this->container['audiences']; + } + + /** + * Sets audiences + * + * @param \OpenAPI\Client\Model\ConfigAudience[]|null $audiences List of audiences that are used inside this project + * + * @return self + */ + public function setAudiences($audiences) + { + if (is_null($audiences)) { + throw new \InvalidArgumentException('non-nullable audiences cannot be null'); + } + $this->container['audiences'] = $audiences; + + return $this; + } + + /** + * Gets segments + * + * @return \OpenAPI\Client\Model\ConfigSegment[]|null + */ + public function getSegments() + { + return $this->container['segments']; + } + + /** + * Sets segments + * + * @param \OpenAPI\Client\Model\ConfigSegment[]|null $segments List of custom that are devined inside this project + * + * @return self + */ + public function setSegments($segments) + { + if (is_null($segments)) { + throw new \InvalidArgumentException('non-nullable segments cannot be null'); + } + $this->container['segments'] = $segments; + + return $this; + } + + /** + * Gets experiences + * + * @return \OpenAPI\Client\Model\ConfigExperience[]|null + */ + public function getExperiences() + { + return $this->container['experiences']; + } + + /** + * Sets experiences + * + * @param \OpenAPI\Client\Model\ConfigExperience[]|null $experiences List of active experiences inside this project + * + * @return self + */ + public function setExperiences($experiences) + { + if (is_null($experiences)) { + throw new \InvalidArgumentException('non-nullable experiences cannot be null'); + } + $this->container['experiences'] = $experiences; + + return $this; + } + + /** + * Gets archived_experiences + * + * @return string[]|null + */ + public function getArchivedExperiences() + { + return $this->container['archived_experiences']; + } + + /** + * Sets archived_experiences + * + * @param string[]|null $archived_experiences List of archived experiences inside this project, which were archived within the last 8 months + * + * @return self + */ + public function setArchivedExperiences($archived_experiences) + { + if (is_null($archived_experiences)) { + throw new \InvalidArgumentException('non-nullable archived_experiences cannot be null'); + } + $this->container['archived_experiences'] = $archived_experiences; + + return $this; + } + + /** + * Gets features + * + * @return \OpenAPI\Client\Model\ConfigFeature[]|null + */ + public function getFeatures() + { + return $this->container['features']; + } + + /** + * Sets features + * + * @param \OpenAPI\Client\Model\ConfigFeature[]|null $features List of features inside this project. Presented only for fullstack projects + * + * @return self + */ + public function setFeatures($features) + { + if (is_null($features)) { + throw new \InvalidArgumentException('non-nullable features cannot be null'); + } + $this->container['features'] = $features; + + return $this; + } + + /** + * Gets is_debug + * + * @return bool|null + */ + public function getIsDebug() + { + return $this->container['is_debug']; + } + + /** + * Sets is_debug + * + * @param bool|null $is_debug Flag indicating if the returned config is in debug mode + * + * @return self + */ + public function setIsDebug($is_debug) + { + if (is_null($is_debug)) { + throw new \InvalidArgumentException('non-nullable is_debug cannot be null'); + } + $this->container['is_debug'] = $is_debug; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/ConfigSegment.php b/packages/Types/lib/Generated/Model/ConfigSegment.php new file mode 100644 index 0000000..ce3103b --- /dev/null +++ b/packages/Types/lib/Generated/Model/ConfigSegment.php @@ -0,0 +1,519 @@ + + */ +class ConfigSegment implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ConfigSegment'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'string', + 'key' => 'string', + 'name' => 'string', + 'rules' => '\OpenAPI\Client\Model\RuleObject' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'key' => null, + 'name' => null, + 'rules' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'key' => false, + 'name' => false, + 'rules' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'key' => 'key', + 'name' => 'name', + 'rules' => 'rules' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'key' => 'setKey', + 'name' => 'setName', + 'rules' => 'setRules' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'key' => 'getKey', + 'name' => 'getName', + 'rules' => 'getRules' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('key', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('rules', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id Segment ID + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets key + * + * @return string|null + */ + public function getKey() + { + return $this->container['key']; + } + + /** + * Sets key + * + * @param string|null $key Segment unique key + * + * @return self + */ + public function setKey($key) + { + if (is_null($key)) { + throw new \InvalidArgumentException('non-nullable key cannot be null'); + } + $this->container['key'] = $key; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name Segment Name + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets rules + * + * @return \OpenAPI\Client\Model\RuleObject|null + */ + public function getRules() + { + return $this->container['rules']; + } + + /** + * Sets rules + * + * @param \OpenAPI\Client\Model\RuleObject|null $rules rules + * + * @return self + */ + public function setRules($rules) + { + if (is_null($rules)) { + array_push($this->openAPINullablesSetToNull, 'rules'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('rules', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['rules'] = $rules; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/ConversionEvent.php b/packages/Types/lib/Generated/Model/ConversionEvent.php new file mode 100644 index 0000000..67cdfab --- /dev/null +++ b/packages/Types/lib/Generated/Model/ConversionEvent.php @@ -0,0 +1,481 @@ + + */ +class ConversionEvent implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ConversionEvent'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'goal_id' => 'string', + 'goal_data' => '\OpenAPI\Client\Model\ConversionEventGoalDataInner[]', + 'bucketing_data' => 'array' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'goal_id' => null, + 'goal_data' => null, + 'bucketing_data' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'goal_id' => false, + 'goal_data' => false, + 'bucketing_data' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'goal_id' => 'goalId', + 'goal_data' => 'goalData', + 'bucketing_data' => 'bucketingData' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'goal_id' => 'setGoalId', + 'goal_data' => 'setGoalData', + 'bucketing_data' => 'setBucketingData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'goal_id' => 'getGoalId', + 'goal_data' => 'getGoalData', + 'bucketing_data' => 'getBucketingData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('goal_id', $data ?? [], null); + $this->setIfExists('goal_data', $data ?? [], null); + $this->setIfExists('bucketing_data', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['goal_id'] === null) { + $invalidProperties[] = "'goal_id' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets goal_id + * + * @return string + */ + public function getGoalId() + { + return $this->container['goal_id']; + } + + /** + * Sets goal_id + * + * @param string $goal_id Id of the conversion goal to be fired + * + * @return self + */ + public function setGoalId($goal_id) + { + if (is_null($goal_id)) { + throw new \InvalidArgumentException('non-nullable goal_id cannot be null'); + } + $this->container['goal_id'] = $goal_id; + + return $this; + } + + /** + * Gets goal_data + * + * @return \OpenAPI\Client\Model\ConversionEventGoalDataInner[]|null + */ + public function getGoalData() + { + return $this->container['goal_data']; + } + + /** + * Sets goal_data + * + * @param \OpenAPI\Client\Model\ConversionEventGoalDataInner[]|null $goal_data Data connected to this conversion, for non binomial metrics, eg revenue + * + * @return self + */ + public function setGoalData($goal_data) + { + if (is_null($goal_data)) { + throw new \InvalidArgumentException('non-nullable goal_data cannot be null'); + } + $this->container['goal_data'] = $goal_data; + + return $this; + } + + /** + * Gets bucketing_data + * + * @return array|null + */ + public function getBucketingData() + { + return $this->container['bucketing_data']; + } + + /** + * Sets bucketing_data + * + * @param array|null $bucketing_data Bucketing data (experiences that this visitor is currently part of) for the visitor. In case that **enrichData=true** flag is being sent and this attribute is not provided, the bucketing stored on the backend datastore for the given visitor is gonna be used. If both **enrichData=true** and **bucketingData**, the **bucketingData** is gonna be merged with the stored data inside the backend data source, the request provided data having the biggest overwriting bucketing for the same experience which might exist on the backend + * + * @return self + */ + public function setBucketingData($bucketing_data) + { + if (is_null($bucketing_data)) { + throw new \InvalidArgumentException('non-nullable bucketing_data cannot be null'); + } + $this->container['bucketing_data'] = $bucketing_data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/ConversionEventGoalDataInner.php b/packages/Types/lib/Generated/Model/ConversionEventGoalDataInner.php new file mode 100644 index 0000000..d41f516 --- /dev/null +++ b/packages/Types/lib/Generated/Model/ConversionEventGoalDataInner.php @@ -0,0 +1,479 @@ + + */ +class ConversionEventGoalDataInner implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ConversionEvent_goalData_inner'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'key' => 'string', + 'value' => '\OpenAPI\Client\Model\ConversionEventGoalDataInnerValue' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'key' => null, + 'value' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'key' => false, + 'value' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'key' => 'key', + 'value' => 'value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'key' => 'setKey', + 'value' => 'setValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'key' => 'getKey', + 'value' => 'getValue' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const KEY_AMOUNT = 'amount'; + public const KEY_PRODUCTS_COUNT = 'productsCount'; + public const KEY_TRANSACTION_ID = 'transactionId'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getKeyAllowableValues() + { + return [ + self::KEY_AMOUNT, + self::KEY_PRODUCTS_COUNT, + self::KEY_TRANSACTION_ID, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('key', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getKeyAllowableValues(); + if (!is_null($this->container['key']) && !in_array($this->container['key'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'key', must be one of '%s'", + $this->container['key'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets key + * + * @return string|null + */ + public function getKey() + { + return $this->container['key']; + } + + /** + * Sets key + * + * @param string|null $key Key of the metric + * + * @return self + */ + public function setKey($key) + { + if (is_null($key)) { + throw new \InvalidArgumentException('non-nullable key cannot be null'); + } + $allowedValues = $this->getKeyAllowableValues(); + if (!in_array($key, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'key', must be one of '%s'", + $key, + implode("', '", $allowedValues) + ) + ); + } + $this->container['key'] = $key; + + return $this; + } + + /** + * Gets value + * + * @return \OpenAPI\Client\Model\ConversionEventGoalDataInnerValue|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param \OpenAPI\Client\Model\ConversionEventGoalDataInnerValue|null $value value + * + * @return self + */ + public function setValue($value) + { + if (is_null($value)) { + throw new \InvalidArgumentException('non-nullable value cannot be null'); + } + $this->container['value'] = $value; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/ConversionEventGoalDataInnerValue.php b/packages/Types/lib/Generated/Model/ConversionEventGoalDataInnerValue.php new file mode 100644 index 0000000..2b7e109 --- /dev/null +++ b/packages/Types/lib/Generated/Model/ConversionEventGoalDataInnerValue.php @@ -0,0 +1,382 @@ + + */ +class ConversionEventGoalDataInnerValue implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ConversionEvent_goalData_inner_value'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/CookieMatchRule.php b/packages/Types/lib/Generated/Model/CookieMatchRule.php new file mode 100644 index 0000000..f2da95e --- /dev/null +++ b/packages/Types/lib/Generated/Model/CookieMatchRule.php @@ -0,0 +1,514 @@ + + */ +class CookieMatchRule implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CookieMatchRule'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'rule_type' => '\OpenAPI\Client\Model\CookieMatchRulesTypes', + 'value' => 'string', + 'matching' => '\OpenAPI\Client\Model\CookieMatchRuleAllOfMatching', + 'key' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'rule_type' => null, + 'value' => null, + 'matching' => null, + 'key' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'rule_type' => false, + 'value' => false, + 'matching' => false, + 'key' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'rule_type' => 'rule_type', + 'value' => 'value', + 'matching' => 'matching', + 'key' => 'key' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'rule_type' => 'setRuleType', + 'value' => 'setValue', + 'matching' => 'setMatching', + 'key' => 'setKey' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'rule_type' => 'getRuleType', + 'value' => 'getValue', + 'matching' => 'getMatching', + 'key' => 'getKey' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('rule_type', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); + $this->setIfExists('matching', $data ?? [], null); + $this->setIfExists('key', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['rule_type'] === null) { + $invalidProperties[] = "'rule_type' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets rule_type + * + * @return \OpenAPI\Client\Model\CookieMatchRulesTypes + */ + public function getRuleType() + { + return $this->container['rule_type']; + } + + /** + * Sets rule_type + * + * @param \OpenAPI\Client\Model\CookieMatchRulesTypes $rule_type rule_type + * + * @return self + */ + public function setRuleType($rule_type) + { + if (is_null($rule_type)) { + throw new \InvalidArgumentException('non-nullable rule_type cannot be null'); + } + $this->container['rule_type'] = $rule_type; + + return $this; + } + + /** + * Gets value + * + * @return string|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param string|null $value The value used to match against 'rule_type' using 'matching' + * + * @return self + */ + public function setValue($value) + { + if (is_null($value)) { + throw new \InvalidArgumentException('non-nullable value cannot be null'); + } + $this->container['value'] = $value; + + return $this; + } + + /** + * Gets matching + * + * @return \OpenAPI\Client\Model\CookieMatchRuleAllOfMatching|null + */ + public function getMatching() + { + return $this->container['matching']; + } + + /** + * Sets matching + * + * @param \OpenAPI\Client\Model\CookieMatchRuleAllOfMatching|null $matching matching + * + * @return self + */ + public function setMatching($matching) + { + if (is_null($matching)) { + throw new \InvalidArgumentException('non-nullable matching cannot be null'); + } + $this->container['matching'] = $matching; + + return $this; + } + + /** + * Gets key + * + * @return string|null + */ + public function getKey() + { + return $this->container['key']; + } + + /** + * Sets key + * + * @param string|null $key The name of the cookie which value is compared to the given rule value + * + * @return self + */ + public function setKey($key) + { + if (is_null($key)) { + throw new \InvalidArgumentException('non-nullable key cannot be null'); + } + $this->container['key'] = $key; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/CookieMatchRuleAllOfMatching.php b/packages/Types/lib/Generated/Model/CookieMatchRuleAllOfMatching.php new file mode 100644 index 0000000..787ca7a --- /dev/null +++ b/packages/Types/lib/Generated/Model/CookieMatchRuleAllOfMatching.php @@ -0,0 +1,443 @@ + + */ +class CookieMatchRuleAllOfMatching implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CookieMatchRule_allOf_matching'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'negated' => 'bool', + 'match_type' => '\OpenAPI\Client\Model\TextMatchingOptions' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'negated' => null, + 'match_type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'negated' => false, + 'match_type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'negated' => 'negated', + 'match_type' => 'match_type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'negated' => 'setNegated', + 'match_type' => 'setMatchType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'negated' => 'getNegated', + 'match_type' => 'getMatchType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('negated', $data ?? [], null); + $this->setIfExists('match_type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets negated + * + * @return bool|null + */ + public function getNegated() + { + return $this->container['negated']; + } + + /** + * Sets negated + * + * @param bool|null $negated When true, the rule result is gonna be negated. example: `url contains \"test\"` with *negated* = true becomes `url does not contain \"test\"` + * + * @return self + */ + public function setNegated($negated) + { + if (is_null($negated)) { + throw new \InvalidArgumentException('non-nullable negated cannot be null'); + } + $this->container['negated'] = $negated; + + return $this; + } + + /** + * Gets match_type + * + * @return \OpenAPI\Client\Model\TextMatchingOptions|null + */ + public function getMatchType() + { + return $this->container['match_type']; + } + + /** + * Sets match_type + * + * @param \OpenAPI\Client\Model\TextMatchingOptions|null $match_type match_type + * + * @return self + */ + public function setMatchType($match_type) + { + if (is_null($match_type)) { + throw new \InvalidArgumentException('non-nullable match_type cannot be null'); + } + $this->container['match_type'] = $match_type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/CookieMatchRulesTypes.php b/packages/Types/lib/Generated/Model/CookieMatchRulesTypes.php new file mode 100644 index 0000000..29825a8 --- /dev/null +++ b/packages/Types/lib/Generated/Model/CookieMatchRulesTypes.php @@ -0,0 +1,59 @@ + + */ +class CountryMatchRule implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CountryMatchRule'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'rule_type' => '\OpenAPI\Client\Model\CountryMatchRulesTypes', + 'value' => 'string', + 'matching' => '\OpenAPI\Client\Model\CountryMatchRuleAllOfMatching' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'rule_type' => null, + 'value' => null, + 'matching' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'rule_type' => false, + 'value' => false, + 'matching' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'rule_type' => 'rule_type', + 'value' => 'value', + 'matching' => 'matching' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'rule_type' => 'setRuleType', + 'value' => 'setValue', + 'matching' => 'setMatching' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'rule_type' => 'getRuleType', + 'value' => 'getValue', + 'matching' => 'getMatching' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('rule_type', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); + $this->setIfExists('matching', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['rule_type'] === null) { + $invalidProperties[] = "'rule_type' can't be null"; + } + if (!is_null($this->container['value']) && (mb_strlen($this->container['value']) > 2)) { + $invalidProperties[] = "invalid value for 'value', the character length must be smaller than or equal to 2."; + } + + if (!is_null($this->container['value']) && (mb_strlen($this->container['value']) < 2)) { + $invalidProperties[] = "invalid value for 'value', the character length must be bigger than or equal to 2."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets rule_type + * + * @return \OpenAPI\Client\Model\CountryMatchRulesTypes + */ + public function getRuleType() + { + return $this->container['rule_type']; + } + + /** + * Sets rule_type + * + * @param \OpenAPI\Client\Model\CountryMatchRulesTypes $rule_type rule_type + * + * @return self + */ + public function setRuleType($rule_type) + { + if (is_null($rule_type)) { + throw new \InvalidArgumentException('non-nullable rule_type cannot be null'); + } + $this->container['rule_type'] = $rule_type; + + return $this; + } + + /** + * Gets value + * + * @return string|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param string|null $value The 2 letter ISO country code used for matching + * + * @return self + */ + public function setValue($value) + { + if (is_null($value)) { + throw new \InvalidArgumentException('non-nullable value cannot be null'); + } + if ((mb_strlen($value) > 2)) { + throw new \InvalidArgumentException('invalid length for $value when calling CountryMatchRule., must be smaller than or equal to 2.'); + } + if ((mb_strlen($value) < 2)) { + throw new \InvalidArgumentException('invalid length for $value when calling CountryMatchRule., must be bigger than or equal to 2.'); + } + + $this->container['value'] = $value; + + return $this; + } + + /** + * Gets matching + * + * @return \OpenAPI\Client\Model\CountryMatchRuleAllOfMatching|null + */ + public function getMatching() + { + return $this->container['matching']; + } + + /** + * Sets matching + * + * @param \OpenAPI\Client\Model\CountryMatchRuleAllOfMatching|null $matching matching + * + * @return self + */ + public function setMatching($matching) + { + if (is_null($matching)) { + throw new \InvalidArgumentException('non-nullable matching cannot be null'); + } + $this->container['matching'] = $matching; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/CountryMatchRuleAllOfMatching.php b/packages/Types/lib/Generated/Model/CountryMatchRuleAllOfMatching.php new file mode 100644 index 0000000..d7ff41a --- /dev/null +++ b/packages/Types/lib/Generated/Model/CountryMatchRuleAllOfMatching.php @@ -0,0 +1,443 @@ + + */ +class CountryMatchRuleAllOfMatching implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CountryMatchRule_allOf_matching'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'negated' => 'bool', + 'match_type' => '\OpenAPI\Client\Model\ChoiceMatchingOptions' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'negated' => null, + 'match_type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'negated' => false, + 'match_type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'negated' => 'negated', + 'match_type' => 'match_type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'negated' => 'setNegated', + 'match_type' => 'setMatchType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'negated' => 'getNegated', + 'match_type' => 'getMatchType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('negated', $data ?? [], null); + $this->setIfExists('match_type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets negated + * + * @return bool|null + */ + public function getNegated() + { + return $this->container['negated']; + } + + /** + * Sets negated + * + * @param bool|null $negated When true, the rule result is gonna be negated. example: `url contains \"test\"` with *negated* = true becomes `url does not contain \"test\"` + * + * @return self + */ + public function setNegated($negated) + { + if (is_null($negated)) { + throw new \InvalidArgumentException('non-nullable negated cannot be null'); + } + $this->container['negated'] = $negated; + + return $this; + } + + /** + * Gets match_type + * + * @return \OpenAPI\Client\Model\ChoiceMatchingOptions|null + */ + public function getMatchType() + { + return $this->container['match_type']; + } + + /** + * Sets match_type + * + * @param \OpenAPI\Client\Model\ChoiceMatchingOptions|null $match_type match_type + * + * @return self + */ + public function setMatchType($match_type) + { + if (is_null($match_type)) { + throw new \InvalidArgumentException('non-nullable match_type cannot be null'); + } + $this->container['match_type'] = $match_type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/CountryMatchRulesTypes.php b/packages/Types/lib/Generated/Model/CountryMatchRulesTypes.php new file mode 100644 index 0000000..9a3b283 --- /dev/null +++ b/packages/Types/lib/Generated/Model/CountryMatchRulesTypes.php @@ -0,0 +1,59 @@ + + */ +class DateRange implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'DateRange'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'date_from' => '\DateTime', + 'date_to' => '\DateTime' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'date_from' => 'date', + 'date_to' => 'date' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'date_from' => true, + 'date_to' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'date_from' => 'date_from', + 'date_to' => 'date_to' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'date_from' => 'setDateFrom', + 'date_to' => 'setDateTo' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'date_from' => 'getDateFrom', + 'date_to' => 'getDateTo' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('date_from', $data ?? [], null); + $this->setIfExists('date_to', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets date_from + * + * @return \DateTime|null + */ + public function getDateFrom() + { + return $this->container['date_from']; + } + + /** + * Sets date_from + * + * @param \DateTime|null $date_from The start date for the range. The value must be in the format `YYYY-MM-DD`. + * + * @return self + */ + public function setDateFrom($date_from) + { + if (is_null($date_from)) { + array_push($this->openAPINullablesSetToNull, 'date_from'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('date_from', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['date_from'] = $date_from; + + return $this; + } + + /** + * Gets date_to + * + * @return \DateTime|null + */ + public function getDateTo() + { + return $this->container['date_to']; + } + + /** + * Sets date_to + * + * @param \DateTime|null $date_to The end date for the range. The value must be in the format `YYYY-MM-DD`. + * + * @return self + */ + public function setDateTo($date_to) + { + if (is_null($date_to)) { + array_push($this->openAPINullablesSetToNull, 'date_to'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('date_to', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['date_to'] = $date_to; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/DayOfWeekMatchRule.php b/packages/Types/lib/Generated/Model/DayOfWeekMatchRule.php new file mode 100644 index 0000000..edb033f --- /dev/null +++ b/packages/Types/lib/Generated/Model/DayOfWeekMatchRule.php @@ -0,0 +1,496 @@ + + */ +class DayOfWeekMatchRule implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'DayOfWeekMatchRule'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'rule_type' => '\OpenAPI\Client\Model\DayOfWeekMatchRulesTypes', + 'value' => 'float', + 'matching' => '\OpenAPI\Client\Model\DayOfWeekMatchRuleAllOfMatching' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'rule_type' => null, + 'value' => null, + 'matching' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'rule_type' => false, + 'value' => false, + 'matching' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'rule_type' => 'rule_type', + 'value' => 'value', + 'matching' => 'matching' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'rule_type' => 'setRuleType', + 'value' => 'setValue', + 'matching' => 'setMatching' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'rule_type' => 'getRuleType', + 'value' => 'getValue', + 'matching' => 'getMatching' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('rule_type', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); + $this->setIfExists('matching', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['rule_type'] === null) { + $invalidProperties[] = "'rule_type' can't be null"; + } + if (!is_null($this->container['value']) && ($this->container['value'] > 7)) { + $invalidProperties[] = "invalid value for 'value', must be smaller than or equal to 7."; + } + + if (!is_null($this->container['value']) && ($this->container['value'] < 1)) { + $invalidProperties[] = "invalid value for 'value', must be bigger than or equal to 1."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets rule_type + * + * @return \OpenAPI\Client\Model\DayOfWeekMatchRulesTypes + */ + public function getRuleType() + { + return $this->container['rule_type']; + } + + /** + * Sets rule_type + * + * @param \OpenAPI\Client\Model\DayOfWeekMatchRulesTypes $rule_type rule_type + * + * @return self + */ + public function setRuleType($rule_type) + { + if (is_null($rule_type)) { + throw new \InvalidArgumentException('non-nullable rule_type cannot be null'); + } + $this->container['rule_type'] = $rule_type; + + return $this; + } + + /** + * Gets value + * + * @return float|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param float|null $value Day of week used for matching + * + * @return self + */ + public function setValue($value) + { + if (is_null($value)) { + throw new \InvalidArgumentException('non-nullable value cannot be null'); + } + + if (($value > 7)) { + throw new \InvalidArgumentException('invalid value for $value when calling DayOfWeekMatchRule., must be smaller than or equal to 7.'); + } + if (($value < 1)) { + throw new \InvalidArgumentException('invalid value for $value when calling DayOfWeekMatchRule., must be bigger than or equal to 1.'); + } + + $this->container['value'] = $value; + + return $this; + } + + /** + * Gets matching + * + * @return \OpenAPI\Client\Model\DayOfWeekMatchRuleAllOfMatching|null + */ + public function getMatching() + { + return $this->container['matching']; + } + + /** + * Sets matching + * + * @param \OpenAPI\Client\Model\DayOfWeekMatchRuleAllOfMatching|null $matching matching + * + * @return self + */ + public function setMatching($matching) + { + if (is_null($matching)) { + throw new \InvalidArgumentException('non-nullable matching cannot be null'); + } + $this->container['matching'] = $matching; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/DayOfWeekMatchRuleAllOfMatching.php b/packages/Types/lib/Generated/Model/DayOfWeekMatchRuleAllOfMatching.php new file mode 100644 index 0000000..ece4efa --- /dev/null +++ b/packages/Types/lib/Generated/Model/DayOfWeekMatchRuleAllOfMatching.php @@ -0,0 +1,443 @@ + + */ +class DayOfWeekMatchRuleAllOfMatching implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'DayOfWeekMatchRule_allOf_matching'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'negated' => 'bool', + 'match_type' => '\OpenAPI\Client\Model\NumericMatchingOptions' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'negated' => null, + 'match_type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'negated' => false, + 'match_type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'negated' => 'negated', + 'match_type' => 'match_type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'negated' => 'setNegated', + 'match_type' => 'setMatchType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'negated' => 'getNegated', + 'match_type' => 'getMatchType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('negated', $data ?? [], null); + $this->setIfExists('match_type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets negated + * + * @return bool|null + */ + public function getNegated() + { + return $this->container['negated']; + } + + /** + * Sets negated + * + * @param bool|null $negated When true, the rule result is gonna be negated. example: `url contains \"test\"` with *negated* = true becomes `url does not contain \"test\"` + * + * @return self + */ + public function setNegated($negated) + { + if (is_null($negated)) { + throw new \InvalidArgumentException('non-nullable negated cannot be null'); + } + $this->container['negated'] = $negated; + + return $this; + } + + /** + * Gets match_type + * + * @return \OpenAPI\Client\Model\NumericMatchingOptions|null + */ + public function getMatchType() + { + return $this->container['match_type']; + } + + /** + * Sets match_type + * + * @param \OpenAPI\Client\Model\NumericMatchingOptions|null $match_type match_type + * + * @return self + */ + public function setMatchType($match_type) + { + if (is_null($match_type)) { + throw new \InvalidArgumentException('non-nullable match_type cannot be null'); + } + $this->container['match_type'] = $match_type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/DayOfWeekMatchRulesTypes.php b/packages/Types/lib/Generated/Model/DayOfWeekMatchRulesTypes.php new file mode 100644 index 0000000..033a5c2 --- /dev/null +++ b/packages/Types/lib/Generated/Model/DayOfWeekMatchRulesTypes.php @@ -0,0 +1,62 @@ + + */ +class DomInteractionGoal implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'DomInteractionGoal'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'string', + 'name' => 'string', + 'key' => 'string', + 'type' => 'string', + 'rules' => '\OpenAPI\Client\Model\RuleObject', + 'settings' => '\OpenAPI\Client\Model\DomInteractionGoalSettings' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'name' => null, + 'key' => null, + 'type' => null, + 'rules' => null, + 'settings' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'name' => false, + 'key' => false, + 'type' => false, + 'rules' => true, + 'settings' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'name' => 'name', + 'key' => 'key', + 'type' => 'type', + 'rules' => 'rules', + 'settings' => 'settings' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'name' => 'setName', + 'key' => 'setKey', + 'type' => 'setType', + 'rules' => 'setRules', + 'settings' => 'setSettings' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'name' => 'getName', + 'key' => 'getKey', + 'type' => 'getType', + 'rules' => 'getRules', + 'settings' => 'getSettings' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_DOM_INTERACTION = 'dom_interaction'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_DOM_INTERACTION, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('key', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('rules', $data ?? [], null); + $this->setIfExists('settings', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id Goal ID + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name Goal Name. + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets key + * + * @return string|null + */ + public function getKey() + { + return $this->container['key']; + } + + /** + * Sets key + * + * @param string|null $key Goal Key + * + * @return self + */ + public function setKey($key) + { + if (is_null($key)) { + throw new \InvalidArgumentException('non-nullable key cannot be null'); + } + $this->container['key'] = $key; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type type + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets rules + * + * @return \OpenAPI\Client\Model\RuleObject|null + */ + public function getRules() + { + return $this->container['rules']; + } + + /** + * Sets rules + * + * @param \OpenAPI\Client\Model\RuleObject|null $rules rules + * + * @return self + */ + public function setRules($rules) + { + if (is_null($rules)) { + array_push($this->openAPINullablesSetToNull, 'rules'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('rules', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['rules'] = $rules; + + return $this; + } + + /** + * Gets settings + * + * @return \OpenAPI\Client\Model\DomInteractionGoalSettings|null + */ + public function getSettings() + { + return $this->container['settings']; + } + + /** + * Sets settings + * + * @param \OpenAPI\Client\Model\DomInteractionGoalSettings|null $settings settings + * + * @return self + */ + public function setSettings($settings) + { + if (is_null($settings)) { + throw new \InvalidArgumentException('non-nullable settings cannot be null'); + } + $this->container['settings'] = $settings; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/DomInteractionGoalSettings.php b/packages/Types/lib/Generated/Model/DomInteractionGoalSettings.php new file mode 100644 index 0000000..56afbea --- /dev/null +++ b/packages/Types/lib/Generated/Model/DomInteractionGoalSettings.php @@ -0,0 +1,412 @@ + + */ +class DomInteractionGoalSettings implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'DomInteractionGoalSettings'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'tracked_items' => '\OpenAPI\Client\Model\DomInteractionGoalSettingsTrackedItemsInner[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'tracked_items' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'tracked_items' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'tracked_items' => 'tracked_items' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'tracked_items' => 'setTrackedItems' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'tracked_items' => 'getTrackedItems' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('tracked_items', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['tracked_items'] === null) { + $invalidProperties[] = "'tracked_items' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets tracked_items + * + * @return \OpenAPI\Client\Model\DomInteractionGoalSettingsTrackedItemsInner[] + */ + public function getTrackedItems() + { + return $this->container['tracked_items']; + } + + /** + * Sets tracked_items + * + * @param \OpenAPI\Client\Model\DomInteractionGoalSettingsTrackedItemsInner[] $tracked_items Array of Events to be tracked by this goal + * + * @return self + */ + public function setTrackedItems($tracked_items) + { + if (is_null($tracked_items)) { + throw new \InvalidArgumentException('non-nullable tracked_items cannot be null'); + } + $this->container['tracked_items'] = $tracked_items; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/DomInteractionGoalSettingsTrackedItemsInner.php b/packages/Types/lib/Generated/Model/DomInteractionGoalSettingsTrackedItemsInner.php new file mode 100644 index 0000000..d245c35 --- /dev/null +++ b/packages/Types/lib/Generated/Model/DomInteractionGoalSettingsTrackedItemsInner.php @@ -0,0 +1,444 @@ + + */ +class DomInteractionGoalSettingsTrackedItemsInner implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'DomInteractionGoalSettings_tracked_items_inner'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'selector' => 'string', + 'event' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'selector' => null, + 'event' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'selector' => false, + 'event' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'selector' => 'selector', + 'event' => 'event' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'selector' => 'setSelector', + 'event' => 'setEvent' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'selector' => 'getSelector', + 'event' => 'getEvent' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('selector', $data ?? [], null); + $this->setIfExists('event', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets selector + * + * @return string|null + */ + public function getSelector() + { + return $this->container['selector']; + } + + /** + * Sets selector + * + * @param string|null $selector Css selector that identifies the DOM element(s) on which 'event' is to be monitored in order to fire the goal. + * + * @return self + */ + public function setSelector($selector) + { + if (is_null($selector)) { + throw new \InvalidArgumentException('non-nullable selector cannot be null'); + } + $this->container['selector'] = $selector; + + return $this; + } + + /** + * Gets event + * + * @return string|null + */ + public function getEvent() + { + return $this->container['event']; + } + + /** + * Sets event + * + * @param string|null $event The event to monitor in order to fire the goal. + * + * @return self + */ + public function setEvent($event) + { + if (is_null($event)) { + throw new \InvalidArgumentException('non-nullable event cannot be null'); + } + $this->container['event'] = $event; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/ErrorData.php b/packages/Types/lib/Generated/Model/ErrorData.php new file mode 100644 index 0000000..805971e --- /dev/null +++ b/packages/Types/lib/Generated/Model/ErrorData.php @@ -0,0 +1,477 @@ + + */ +class ErrorData implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ErrorData'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'code' => 'int', + 'message' => 'string', + 'fields' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'code' => 'int32', + 'message' => null, + 'fields' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'code' => false, + 'message' => false, + 'fields' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'code' => 'code', + 'message' => 'message', + 'fields' => 'fields' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'code' => 'setCode', + 'message' => 'setMessage', + 'fields' => 'setFields' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'code' => 'getCode', + 'message' => 'getMessage', + 'fields' => 'getFields' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('code', $data ?? [], null); + $this->setIfExists('message', $data ?? [], null); + $this->setIfExists('fields', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets code + * + * @return int|null + */ + public function getCode() + { + return $this->container['code']; + } + + /** + * Sets code + * + * @param int|null $code code + * + * @return self + */ + public function setCode($code) + { + if (is_null($code)) { + throw new \InvalidArgumentException('non-nullable code cannot be null'); + } + $this->container['code'] = $code; + + return $this; + } + + /** + * Gets message + * + * @return string|null + */ + public function getMessage() + { + return $this->container['message']; + } + + /** + * Sets message + * + * @param string|null $message message + * + * @return self + */ + public function setMessage($message) + { + if (is_null($message)) { + throw new \InvalidArgumentException('non-nullable message cannot be null'); + } + $this->container['message'] = $message; + + return $this; + } + + /** + * Gets fields + * + * @return string|null + */ + public function getFields() + { + return $this->container['fields']; + } + + /** + * Sets fields + * + * @param string|null $fields fields + * + * @return self + */ + public function setFields($fields) + { + if (is_null($fields)) { + throw new \InvalidArgumentException('non-nullable fields cannot be null'); + } + $this->container['fields'] = $fields; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/ExperienceBucketedMatchRule.php b/packages/Types/lib/Generated/Model/ExperienceBucketedMatchRule.php new file mode 100644 index 0000000..e909e2c --- /dev/null +++ b/packages/Types/lib/Generated/Model/ExperienceBucketedMatchRule.php @@ -0,0 +1,480 @@ + + */ +class ExperienceBucketedMatchRule implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ExperienceBucketedMatchRule'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'rule_type' => 'string', + 'value' => 'float', + 'matching' => '\OpenAPI\Client\Model\ExperienceBucketedMatchRuleAllOfMatching' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'rule_type' => null, + 'value' => null, + 'matching' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'rule_type' => false, + 'value' => false, + 'matching' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'rule_type' => 'rule_type', + 'value' => 'value', + 'matching' => 'matching' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'rule_type' => 'setRuleType', + 'value' => 'setValue', + 'matching' => 'setMatching' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'rule_type' => 'getRuleType', + 'value' => 'getValue', + 'matching' => 'getMatching' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('rule_type', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); + $this->setIfExists('matching', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['rule_type'] === null) { + $invalidProperties[] = "'rule_type' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets rule_type + * + * @return string + */ + public function getRuleType() + { + return $this->container['rule_type']; + } + + /** + * Sets rule_type + * + * @param string $rule_type rule_type + * + * @return self + */ + public function setRuleType($rule_type) + { + if (is_null($rule_type)) { + throw new \InvalidArgumentException('non-nullable rule_type cannot be null'); + } + $this->container['rule_type'] = $rule_type; + + return $this; + } + + /** + * Gets value + * + * @return float|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param float|null $value ID of the experience used for matching + * + * @return self + */ + public function setValue($value) + { + if (is_null($value)) { + throw new \InvalidArgumentException('non-nullable value cannot be null'); + } + $this->container['value'] = $value; + + return $this; + } + + /** + * Gets matching + * + * @return \OpenAPI\Client\Model\ExperienceBucketedMatchRuleAllOfMatching|null + */ + public function getMatching() + { + return $this->container['matching']; + } + + /** + * Sets matching + * + * @param \OpenAPI\Client\Model\ExperienceBucketedMatchRuleAllOfMatching|null $matching matching + * + * @return self + */ + public function setMatching($matching) + { + if (is_null($matching)) { + throw new \InvalidArgumentException('non-nullable matching cannot be null'); + } + $this->container['matching'] = $matching; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/ExperienceBucketedMatchRuleAllOfMatching.php b/packages/Types/lib/Generated/Model/ExperienceBucketedMatchRuleAllOfMatching.php new file mode 100644 index 0000000..45b164a --- /dev/null +++ b/packages/Types/lib/Generated/Model/ExperienceBucketedMatchRuleAllOfMatching.php @@ -0,0 +1,443 @@ + + */ +class ExperienceBucketedMatchRuleAllOfMatching implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ExperienceBucketedMatchRule_allOf_matching'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'negated' => 'bool', + 'match_type' => '\OpenAPI\Client\Model\ChoiceMatchingOptions' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'negated' => null, + 'match_type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'negated' => false, + 'match_type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'negated' => 'negated', + 'match_type' => 'match_type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'negated' => 'setNegated', + 'match_type' => 'setMatchType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'negated' => 'getNegated', + 'match_type' => 'getMatchType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('negated', $data ?? [], null); + $this->setIfExists('match_type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets negated + * + * @return bool|null + */ + public function getNegated() + { + return $this->container['negated']; + } + + /** + * Sets negated + * + * @param bool|null $negated When true, the rule result is gonna be negated. example: `url contains \"test\"` with *negated* = true becomes `url does not contain \"test\"` + * + * @return self + */ + public function setNegated($negated) + { + if (is_null($negated)) { + throw new \InvalidArgumentException('non-nullable negated cannot be null'); + } + $this->container['negated'] = $negated; + + return $this; + } + + /** + * Gets match_type + * + * @return \OpenAPI\Client\Model\ChoiceMatchingOptions|null + */ + public function getMatchType() + { + return $this->container['match_type']; + } + + /** + * Sets match_type + * + * @param \OpenAPI\Client\Model\ChoiceMatchingOptions|null $match_type match_type + * + * @return self + */ + public function setMatchType($match_type) + { + if (is_null($match_type)) { + throw new \InvalidArgumentException('non-nullable match_type cannot be null'); + } + $this->container['match_type'] = $match_type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/ExperienceChange.php b/packages/Types/lib/Generated/Model/ExperienceChange.php new file mode 100644 index 0000000..defe6ea --- /dev/null +++ b/packages/Types/lib/Generated/Model/ExperienceChange.php @@ -0,0 +1,523 @@ + + */ +class ExperienceChange implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = 'type'; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ExperienceChange'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'int', + 'type' => 'string', + 'data' => '\OpenAPI\Client\Model\ExperienceChangeFullStackFeatureBaseAllOfData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'type' => null, + 'data' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'type' => false, + 'data' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'type' => 'type', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'type' => 'setType', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'type' => 'getType', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_DEFAULT_CODE = 'defaultCode'; + public const TYPE_DEFAULT_CODE_MULTIPAGE = 'defaultCodeMultipage'; + public const TYPE_DEFAULT_REDIRECT = 'defaultRedirect'; + public const TYPE_CUSTOM_CODE = 'customCode'; + public const TYPE_RICH_STRUCTURE = 'richStructure'; + public const TYPE_FULL_STACK_FEATURE = 'fullStackFeature'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_DEFAULT_CODE, + self::TYPE_DEFAULT_CODE_MULTIPAGE, + self::TYPE_DEFAULT_REDIRECT, + self::TYPE_CUSTOM_CODE, + self::TYPE_RICH_STRUCTURE, + self::TYPE_FULL_STACK_FEATURE, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('data', $data ?? [], null); + + // Initialize discriminator property with the model name. + $this->container['type'] = static::$openAPIModelName; + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return int|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the experience change + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type type + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets data + * + * @return \OpenAPI\Client\Model\ExperienceChangeFullStackFeatureBaseAllOfData|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \OpenAPI\Client\Model\ExperienceChangeFullStackFeatureBaseAllOfData|null $data data + * + * @return self + */ + public function setData($data) + { + if (is_null($data)) { + throw new \InvalidArgumentException('non-nullable data cannot be null'); + } + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/ExperienceChangeAdd.php b/packages/Types/lib/Generated/Model/ExperienceChangeAdd.php new file mode 100644 index 0000000..3bdf4c9 --- /dev/null +++ b/packages/Types/lib/Generated/Model/ExperienceChangeAdd.php @@ -0,0 +1,536 @@ + + */ +class ExperienceChangeAdd implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = 'type'; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ExperienceChangeAdd'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'int', + 'type' => 'string', + 'data' => 'mixed' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'type' => null, + 'data' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'type' => false, + 'data' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'type' => 'type', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'type' => 'setType', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'type' => 'getType', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_DEFAULT_CODE = 'defaultCode'; + public const TYPE_DEFAULT_CODE_MULTIPAGE = 'defaultCodeMultipage'; + public const TYPE_DEFAULT_REDIRECT = 'defaultRedirect'; + public const TYPE_CUSTOM_CODE = 'customCode'; + public const TYPE_RICH_STRUCTURE = 'richStructure'; + public const TYPE_FULL_STACK_FEATURE = 'fullStackFeature'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_DEFAULT_CODE, + self::TYPE_DEFAULT_CODE_MULTIPAGE, + self::TYPE_DEFAULT_REDIRECT, + self::TYPE_CUSTOM_CODE, + self::TYPE_RICH_STRUCTURE, + self::TYPE_FULL_STACK_FEATURE, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('data', $data ?? [], null); + + // Initialize discriminator property with the model name. + $this->container['type'] = static::$openAPIModelName; + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['data'] === null) { + $invalidProperties[] = "'data' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return int|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the experience change + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type type + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets data + * + * @return mixed + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param mixed $data data + * + * @return self + */ + public function setData($data) + { + if (is_null($data)) { + array_push($this->openAPINullablesSetToNull, 'data'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('data', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/ExperienceChangeBase.php b/packages/Types/lib/Generated/Model/ExperienceChangeBase.php new file mode 100644 index 0000000..90d45a5 --- /dev/null +++ b/packages/Types/lib/Generated/Model/ExperienceChangeBase.php @@ -0,0 +1,486 @@ + + */ +class ExperienceChangeBase implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ExperienceChangeBase'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'type' => 'string', + 'data' => 'object' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'type' => null, + 'data' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'type' => false, + 'data' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'type' => 'type', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'type' => 'setType', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'type' => 'getType', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_RICH_STRUCTURE = 'richStructure'; + public const TYPE_CUSTOM_CODE = 'customCode'; + public const TYPE_DEFAULT_CODE = 'defaultCode'; + public const TYPE_DEFAULT_CODE_MULTIPAGE = 'defaultCodeMultipage'; + public const TYPE_DEFAULT_REDIRECT = 'defaultRedirect'; + public const TYPE_FULL_STACK_FEATURE = 'fullStackFeature'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_RICH_STRUCTURE, + self::TYPE_CUSTOM_CODE, + self::TYPE_DEFAULT_CODE, + self::TYPE_DEFAULT_CODE_MULTIPAGE, + self::TYPE_DEFAULT_REDIRECT, + self::TYPE_FULL_STACK_FEATURE, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('data', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type type + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets data + * + * @return object|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param object|null $data This contains all data of this change, any code, settings etc This is sent by default in the following requests responses: **getExperienceChange**; All other responses that return this field, will only return it if \"include\" request parameter contains its name Data object structure will correspond to the \"type\" field + * + * @return self + */ + public function setData($data) + { + if (is_null($data)) { + throw new \InvalidArgumentException('non-nullable data cannot be null'); + } + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/ExperienceChangeCustomCodeData.php b/packages/Types/lib/Generated/Model/ExperienceChangeCustomCodeData.php new file mode 100644 index 0000000..62a7302 --- /dev/null +++ b/packages/Types/lib/Generated/Model/ExperienceChangeCustomCodeData.php @@ -0,0 +1,510 @@ + + */ +class ExperienceChangeCustomCodeData implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ExperienceChangeCustomCodeData'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'int', + 'type' => 'string', + 'data' => '\OpenAPI\Client\Model\ExperienceChangeCustomCodeDataBaseAllOfData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'type' => null, + 'data' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'type' => false, + 'data' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'type' => 'type', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'type' => 'setType', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'type' => 'getType', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_CUSTOM_CODE = 'customCode'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_CUSTOM_CODE, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('data', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return int|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the experience change + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type type + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets data + * + * @return \OpenAPI\Client\Model\ExperienceChangeCustomCodeDataBaseAllOfData|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \OpenAPI\Client\Model\ExperienceChangeCustomCodeDataBaseAllOfData|null $data data + * + * @return self + */ + public function setData($data) + { + if (is_null($data)) { + throw new \InvalidArgumentException('non-nullable data cannot be null'); + } + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/ExperienceChangeCustomCodeDataAdd.php b/packages/Types/lib/Generated/Model/ExperienceChangeCustomCodeDataAdd.php new file mode 100644 index 0000000..2f2472e --- /dev/null +++ b/packages/Types/lib/Generated/Model/ExperienceChangeCustomCodeDataAdd.php @@ -0,0 +1,523 @@ + + */ +class ExperienceChangeCustomCodeDataAdd implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ExperienceChangeCustomCodeDataAdd'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'int', + 'type' => 'string', + 'data' => 'mixed' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'type' => null, + 'data' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'type' => false, + 'data' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'type' => 'type', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'type' => 'setType', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'type' => 'getType', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_CUSTOM_CODE = 'customCode'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_CUSTOM_CODE, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('data', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['data'] === null) { + $invalidProperties[] = "'data' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return int|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the experience change + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type type + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets data + * + * @return mixed + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param mixed $data data + * + * @return self + */ + public function setData($data) + { + if (is_null($data)) { + array_push($this->openAPINullablesSetToNull, 'data'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('data', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/ExperienceChangeCustomCodeDataBase.php b/packages/Types/lib/Generated/Model/ExperienceChangeCustomCodeDataBase.php new file mode 100644 index 0000000..a78bfd4 --- /dev/null +++ b/packages/Types/lib/Generated/Model/ExperienceChangeCustomCodeDataBase.php @@ -0,0 +1,476 @@ + + */ +class ExperienceChangeCustomCodeDataBase implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ExperienceChangeCustomCodeDataBase'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'type' => 'string', + 'data' => '\OpenAPI\Client\Model\ExperienceChangeCustomCodeDataBaseAllOfData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'type' => null, + 'data' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'type' => false, + 'data' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'type' => 'type', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'type' => 'setType', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'type' => 'getType', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_CUSTOM_CODE = 'customCode'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_CUSTOM_CODE, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('data', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type type + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets data + * + * @return \OpenAPI\Client\Model\ExperienceChangeCustomCodeDataBaseAllOfData|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \OpenAPI\Client\Model\ExperienceChangeCustomCodeDataBaseAllOfData|null $data data + * + * @return self + */ + public function setData($data) + { + if (is_null($data)) { + throw new \InvalidArgumentException('non-nullable data cannot be null'); + } + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/ExperienceChangeCustomCodeDataBaseAllOfData.php b/packages/Types/lib/Generated/Model/ExperienceChangeCustomCodeDataBaseAllOfData.php new file mode 100644 index 0000000..ee313c3 --- /dev/null +++ b/packages/Types/lib/Generated/Model/ExperienceChangeCustomCodeDataBaseAllOfData.php @@ -0,0 +1,492 @@ + + */ +class ExperienceChangeCustomCodeDataBaseAllOfData implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ExperienceChangeCustomCodeDataBase_allOf_data'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'css' => 'string', + 'js' => 'string', + 'page_id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'css' => null, + 'js' => null, + 'page_id' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'css' => true, + 'js' => true, + 'page_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'css' => 'css', + 'js' => 'js', + 'page_id' => 'page_id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'css' => 'setCss', + 'js' => 'setJs', + 'page_id' => 'setPageId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'css' => 'getCss', + 'js' => 'getJs', + 'page_id' => 'getPageId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('css', $data ?? [], null); + $this->setIfExists('js', $data ?? [], null); + $this->setIfExists('page_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets css + * + * @return string|null + */ + public function getCss() + { + return $this->container['css']; + } + + /** + * Sets css + * + * @param string|null $css CSS code to be applied by this change + * + * @return self + */ + public function setCss($css) + { + if (is_null($css)) { + array_push($this->openAPINullablesSetToNull, 'css'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('css', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['css'] = $css; + + return $this; + } + + /** + * Gets js + * + * @return string|null + */ + public function getJs() + { + return $this->container['js']; + } + + /** + * Sets js + * + * @param string|null $js Custom javascript code to be applied by this change + * + * @return self + */ + public function setJs($js) + { + if (is_null($js)) { + array_push($this->openAPINullablesSetToNull, 'js'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('js', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['js'] = $js; + + return $this; + } + + /** + * Gets page_id + * + * @return string|null + */ + public function getPageId() + { + return $this->container['page_id']; + } + + /** + * Sets page_id + * + * @param string|null $page_id The **id** of the page connected to this change, in case this is a **multi-page** experiment + * + * @return self + */ + public function setPageId($page_id) + { + if (is_null($page_id)) { + throw new \InvalidArgumentException('non-nullable page_id cannot be null'); + } + $this->container['page_id'] = $page_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/ExperienceChangeCustomCodeDataUpdate.php b/packages/Types/lib/Generated/Model/ExperienceChangeCustomCodeDataUpdate.php new file mode 100644 index 0000000..2ce880a --- /dev/null +++ b/packages/Types/lib/Generated/Model/ExperienceChangeCustomCodeDataUpdate.php @@ -0,0 +1,519 @@ + + */ +class ExperienceChangeCustomCodeDataUpdate implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ExperienceChangeCustomCodeDataUpdate'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'int', + 'type' => 'string', + 'data' => '\OpenAPI\Client\Model\ExperienceChangeCustomCodeDataBaseAllOfData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'type' => null, + 'data' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'type' => false, + 'data' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'type' => 'type', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'type' => 'setType', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'type' => 'getType', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_CUSTOM_CODE = 'customCode'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_CUSTOM_CODE, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('data', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['data'] === null) { + $invalidProperties[] = "'data' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id The ID of the experience change + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type type + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets data + * + * @return \OpenAPI\Client\Model\ExperienceChangeCustomCodeDataBaseAllOfData + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \OpenAPI\Client\Model\ExperienceChangeCustomCodeDataBaseAllOfData $data data + * + * @return self + */ + public function setData($data) + { + if (is_null($data)) { + throw new \InvalidArgumentException('non-nullable data cannot be null'); + } + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/ExperienceChangeCustomCodeDataUpdateNoId.php b/packages/Types/lib/Generated/Model/ExperienceChangeCustomCodeDataUpdateNoId.php new file mode 100644 index 0000000..0610211 --- /dev/null +++ b/packages/Types/lib/Generated/Model/ExperienceChangeCustomCodeDataUpdateNoId.php @@ -0,0 +1,482 @@ + + */ +class ExperienceChangeCustomCodeDataUpdateNoId implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ExperienceChangeCustomCodeDataUpdateNoId'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'type' => 'string', + 'data' => '\OpenAPI\Client\Model\ExperienceChangeCustomCodeDataBaseAllOfData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'type' => null, + 'data' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'type' => false, + 'data' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'type' => 'type', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'type' => 'setType', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'type' => 'getType', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_CUSTOM_CODE = 'customCode'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_CUSTOM_CODE, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('data', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['data'] === null) { + $invalidProperties[] = "'data' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type type + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets data + * + * @return \OpenAPI\Client\Model\ExperienceChangeCustomCodeDataBaseAllOfData + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \OpenAPI\Client\Model\ExperienceChangeCustomCodeDataBaseAllOfData $data data + * + * @return self + */ + public function setData($data) + { + if (is_null($data)) { + throw new \InvalidArgumentException('non-nullable data cannot be null'); + } + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/ExperienceChangeDefaultCodeData.php b/packages/Types/lib/Generated/Model/ExperienceChangeDefaultCodeData.php new file mode 100644 index 0000000..8778ce0 --- /dev/null +++ b/packages/Types/lib/Generated/Model/ExperienceChangeDefaultCodeData.php @@ -0,0 +1,510 @@ + + */ +class ExperienceChangeDefaultCodeData implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ExperienceChangeDefaultCodeData'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'int', + 'type' => 'string', + 'data' => '\OpenAPI\Client\Model\ExperienceChangeDefaultCodeDataBaseAllOfData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'type' => null, + 'data' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'type' => false, + 'data' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'type' => 'type', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'type' => 'setType', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'type' => 'getType', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_DEFAULT_CODE = 'defaultCode'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_DEFAULT_CODE, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('data', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return int|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the experience change + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type type + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets data + * + * @return \OpenAPI\Client\Model\ExperienceChangeDefaultCodeDataBaseAllOfData|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \OpenAPI\Client\Model\ExperienceChangeDefaultCodeDataBaseAllOfData|null $data data + * + * @return self + */ + public function setData($data) + { + if (is_null($data)) { + throw new \InvalidArgumentException('non-nullable data cannot be null'); + } + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/ExperienceChangeDefaultCodeDataAdd.php b/packages/Types/lib/Generated/Model/ExperienceChangeDefaultCodeDataAdd.php new file mode 100644 index 0000000..ea8195c --- /dev/null +++ b/packages/Types/lib/Generated/Model/ExperienceChangeDefaultCodeDataAdd.php @@ -0,0 +1,523 @@ + + */ +class ExperienceChangeDefaultCodeDataAdd implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ExperienceChangeDefaultCodeDataAdd'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'int', + 'type' => 'string', + 'data' => 'mixed' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'type' => null, + 'data' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'type' => false, + 'data' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'type' => 'type', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'type' => 'setType', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'type' => 'getType', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_DEFAULT_CODE = 'defaultCode'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_DEFAULT_CODE, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('data', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['data'] === null) { + $invalidProperties[] = "'data' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return int|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the experience change + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type type + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets data + * + * @return mixed + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param mixed $data data + * + * @return self + */ + public function setData($data) + { + if (is_null($data)) { + array_push($this->openAPINullablesSetToNull, 'data'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('data', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/ExperienceChangeDefaultCodeDataBase.php b/packages/Types/lib/Generated/Model/ExperienceChangeDefaultCodeDataBase.php new file mode 100644 index 0000000..93f98b0 --- /dev/null +++ b/packages/Types/lib/Generated/Model/ExperienceChangeDefaultCodeDataBase.php @@ -0,0 +1,476 @@ + + */ +class ExperienceChangeDefaultCodeDataBase implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ExperienceChangeDefaultCodeDataBase'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'type' => 'string', + 'data' => '\OpenAPI\Client\Model\ExperienceChangeDefaultCodeDataBaseAllOfData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'type' => null, + 'data' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'type' => false, + 'data' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'type' => 'type', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'type' => 'setType', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'type' => 'getType', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_DEFAULT_CODE = 'defaultCode'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_DEFAULT_CODE, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('data', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type type + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets data + * + * @return \OpenAPI\Client\Model\ExperienceChangeDefaultCodeDataBaseAllOfData|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \OpenAPI\Client\Model\ExperienceChangeDefaultCodeDataBaseAllOfData|null $data data + * + * @return self + */ + public function setData($data) + { + if (is_null($data)) { + throw new \InvalidArgumentException('non-nullable data cannot be null'); + } + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/ExperienceChangeDefaultCodeDataBaseAllOfData.php b/packages/Types/lib/Generated/Model/ExperienceChangeDefaultCodeDataBaseAllOfData.php new file mode 100644 index 0000000..b4e4e8d --- /dev/null +++ b/packages/Types/lib/Generated/Model/ExperienceChangeDefaultCodeDataBaseAllOfData.php @@ -0,0 +1,499 @@ + + */ +class ExperienceChangeDefaultCodeDataBaseAllOfData implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ExperienceChangeDefaultCodeDataBase_allOf_data'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'css' => 'string', + 'js' => 'string', + 'custom_js' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'css' => null, + 'js' => null, + 'custom_js' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'css' => true, + 'js' => true, + 'custom_js' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'css' => 'css', + 'js' => 'js', + 'custom_js' => 'custom_js' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'css' => 'setCss', + 'js' => 'setJs', + 'custom_js' => 'setCustomJs' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'css' => 'getCss', + 'js' => 'getJs', + 'custom_js' => 'getCustomJs' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('css', $data ?? [], null); + $this->setIfExists('js', $data ?? [], null); + $this->setIfExists('custom_js', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets css + * + * @return string|null + */ + public function getCss() + { + return $this->container['css']; + } + + /** + * Sets css + * + * @param string|null $css CSS code to be applied by this change + * + * @return self + */ + public function setCss($css) + { + if (is_null($css)) { + array_push($this->openAPINullablesSetToNull, 'css'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('css', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['css'] = $css; + + return $this; + } + + /** + * Gets js + * + * @return string|null + */ + public function getJs() + { + return $this->container['js']; + } + + /** + * Sets js + * + * @param string|null $js Javascript code generated by the visual editor or written in the same structure, to be applied by this experience change + * + * @return self + */ + public function setJs($js) + { + if (is_null($js)) { + array_push($this->openAPINullablesSetToNull, 'js'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('js', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['js'] = $js; + + return $this; + } + + /** + * Gets custom_js + * + * @return string|null + */ + public function getCustomJs() + { + return $this->container['custom_js']; + } + + /** + * Sets custom_js + * + * @param string|null $custom_js Custom javascript code to be applied by this change + * + * @return self + */ + public function setCustomJs($custom_js) + { + if (is_null($custom_js)) { + array_push($this->openAPINullablesSetToNull, 'custom_js'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('custom_js', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['custom_js'] = $custom_js; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/ExperienceChangeDefaultCodeDataUpdate.php b/packages/Types/lib/Generated/Model/ExperienceChangeDefaultCodeDataUpdate.php new file mode 100644 index 0000000..a5404a9 --- /dev/null +++ b/packages/Types/lib/Generated/Model/ExperienceChangeDefaultCodeDataUpdate.php @@ -0,0 +1,519 @@ + + */ +class ExperienceChangeDefaultCodeDataUpdate implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ExperienceChangeDefaultCodeDataUpdate'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'int', + 'type' => 'string', + 'data' => '\OpenAPI\Client\Model\ExperienceChangeDefaultCodeDataBaseAllOfData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'type' => null, + 'data' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'type' => false, + 'data' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'type' => 'type', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'type' => 'setType', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'type' => 'getType', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_DEFAULT_CODE = 'defaultCode'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_DEFAULT_CODE, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('data', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['data'] === null) { + $invalidProperties[] = "'data' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id The ID of the experience change + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type type + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets data + * + * @return \OpenAPI\Client\Model\ExperienceChangeDefaultCodeDataBaseAllOfData + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \OpenAPI\Client\Model\ExperienceChangeDefaultCodeDataBaseAllOfData $data data + * + * @return self + */ + public function setData($data) + { + if (is_null($data)) { + throw new \InvalidArgumentException('non-nullable data cannot be null'); + } + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/ExperienceChangeDefaultCodeDataUpdateNoId.php b/packages/Types/lib/Generated/Model/ExperienceChangeDefaultCodeDataUpdateNoId.php new file mode 100644 index 0000000..b442929 --- /dev/null +++ b/packages/Types/lib/Generated/Model/ExperienceChangeDefaultCodeDataUpdateNoId.php @@ -0,0 +1,482 @@ + + */ +class ExperienceChangeDefaultCodeDataUpdateNoId implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ExperienceChangeDefaultCodeDataUpdateNoId'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'type' => 'string', + 'data' => '\OpenAPI\Client\Model\ExperienceChangeDefaultCodeDataBaseAllOfData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'type' => null, + 'data' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'type' => false, + 'data' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'type' => 'type', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'type' => 'setType', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'type' => 'getType', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_DEFAULT_CODE = 'defaultCode'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_DEFAULT_CODE, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('data', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['data'] === null) { + $invalidProperties[] = "'data' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type type + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets data + * + * @return \OpenAPI\Client\Model\ExperienceChangeDefaultCodeDataBaseAllOfData + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \OpenAPI\Client\Model\ExperienceChangeDefaultCodeDataBaseAllOfData $data data + * + * @return self + */ + public function setData($data) + { + if (is_null($data)) { + throw new \InvalidArgumentException('non-nullable data cannot be null'); + } + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/ExperienceChangeDefaultCodeMultipageData.php b/packages/Types/lib/Generated/Model/ExperienceChangeDefaultCodeMultipageData.php new file mode 100644 index 0000000..d1ff24a --- /dev/null +++ b/packages/Types/lib/Generated/Model/ExperienceChangeDefaultCodeMultipageData.php @@ -0,0 +1,510 @@ + + */ +class ExperienceChangeDefaultCodeMultipageData implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ExperienceChangeDefaultCodeMultipageData'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'int', + 'type' => 'string', + 'data' => '\OpenAPI\Client\Model\ExperienceChangeDefaultCodeMultipageDataBaseAllOfData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'type' => null, + 'data' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'type' => false, + 'data' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'type' => 'type', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'type' => 'setType', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'type' => 'getType', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_DEFAULT_CODE_MULTIPAGE = 'defaultCodeMultipage'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_DEFAULT_CODE_MULTIPAGE, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('data', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return int|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the experience change + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type type + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets data + * + * @return \OpenAPI\Client\Model\ExperienceChangeDefaultCodeMultipageDataBaseAllOfData|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \OpenAPI\Client\Model\ExperienceChangeDefaultCodeMultipageDataBaseAllOfData|null $data data + * + * @return self + */ + public function setData($data) + { + if (is_null($data)) { + throw new \InvalidArgumentException('non-nullable data cannot be null'); + } + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/ExperienceChangeDefaultCodeMultipageDataAdd.php b/packages/Types/lib/Generated/Model/ExperienceChangeDefaultCodeMultipageDataAdd.php new file mode 100644 index 0000000..56f2ffb --- /dev/null +++ b/packages/Types/lib/Generated/Model/ExperienceChangeDefaultCodeMultipageDataAdd.php @@ -0,0 +1,523 @@ + + */ +class ExperienceChangeDefaultCodeMultipageDataAdd implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ExperienceChangeDefaultCodeMultipageDataAdd'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'int', + 'type' => 'string', + 'data' => 'mixed' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'type' => null, + 'data' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'type' => false, + 'data' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'type' => 'type', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'type' => 'setType', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'type' => 'getType', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_DEFAULT_CODE_MULTIPAGE = 'defaultCodeMultipage'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_DEFAULT_CODE_MULTIPAGE, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('data', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['data'] === null) { + $invalidProperties[] = "'data' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return int|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the experience change + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type type + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets data + * + * @return mixed + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param mixed $data data + * + * @return self + */ + public function setData($data) + { + if (is_null($data)) { + array_push($this->openAPINullablesSetToNull, 'data'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('data', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/ExperienceChangeDefaultCodeMultipageDataBase.php b/packages/Types/lib/Generated/Model/ExperienceChangeDefaultCodeMultipageDataBase.php new file mode 100644 index 0000000..6aeb169 --- /dev/null +++ b/packages/Types/lib/Generated/Model/ExperienceChangeDefaultCodeMultipageDataBase.php @@ -0,0 +1,476 @@ + + */ +class ExperienceChangeDefaultCodeMultipageDataBase implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ExperienceChangeDefaultCodeMultipageDataBase'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'type' => 'string', + 'data' => '\OpenAPI\Client\Model\ExperienceChangeDefaultCodeMultipageDataBaseAllOfData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'type' => null, + 'data' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'type' => false, + 'data' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'type' => 'type', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'type' => 'setType', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'type' => 'getType', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_DEFAULT_CODE_MULTIPAGE = 'defaultCodeMultipage'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_DEFAULT_CODE_MULTIPAGE, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('data', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type type + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets data + * + * @return \OpenAPI\Client\Model\ExperienceChangeDefaultCodeMultipageDataBaseAllOfData|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \OpenAPI\Client\Model\ExperienceChangeDefaultCodeMultipageDataBaseAllOfData|null $data data + * + * @return self + */ + public function setData($data) + { + if (is_null($data)) { + throw new \InvalidArgumentException('non-nullable data cannot be null'); + } + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/ExperienceChangeDefaultCodeMultipageDataBaseAllOfData.php b/packages/Types/lib/Generated/Model/ExperienceChangeDefaultCodeMultipageDataBaseAllOfData.php new file mode 100644 index 0000000..094e81d --- /dev/null +++ b/packages/Types/lib/Generated/Model/ExperienceChangeDefaultCodeMultipageDataBaseAllOfData.php @@ -0,0 +1,533 @@ + + */ +class ExperienceChangeDefaultCodeMultipageDataBaseAllOfData implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ExperienceChangeDefaultCodeMultipageDataBase_allOf_data'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'css' => 'string', + 'js' => 'string', + 'custom_js' => 'string', + 'page_id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'css' => null, + 'js' => null, + 'custom_js' => null, + 'page_id' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'css' => true, + 'js' => true, + 'custom_js' => true, + 'page_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'css' => 'css', + 'js' => 'js', + 'custom_js' => 'custom_js', + 'page_id' => 'page_id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'css' => 'setCss', + 'js' => 'setJs', + 'custom_js' => 'setCustomJs', + 'page_id' => 'setPageId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'css' => 'getCss', + 'js' => 'getJs', + 'custom_js' => 'getCustomJs', + 'page_id' => 'getPageId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('css', $data ?? [], null); + $this->setIfExists('js', $data ?? [], null); + $this->setIfExists('custom_js', $data ?? [], null); + $this->setIfExists('page_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets css + * + * @return string|null + */ + public function getCss() + { + return $this->container['css']; + } + + /** + * Sets css + * + * @param string|null $css CSS code to be applied by this change + * + * @return self + */ + public function setCss($css) + { + if (is_null($css)) { + array_push($this->openAPINullablesSetToNull, 'css'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('css', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['css'] = $css; + + return $this; + } + + /** + * Gets js + * + * @return string|null + */ + public function getJs() + { + return $this->container['js']; + } + + /** + * Sets js + * + * @param string|null $js Javascript code generated by the visual editor or written in the same structure, to be applied by this experience change + * + * @return self + */ + public function setJs($js) + { + if (is_null($js)) { + array_push($this->openAPINullablesSetToNull, 'js'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('js', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['js'] = $js; + + return $this; + } + + /** + * Gets custom_js + * + * @return string|null + */ + public function getCustomJs() + { + return $this->container['custom_js']; + } + + /** + * Sets custom_js + * + * @param string|null $custom_js Custom javascript code to be applied by this change + * + * @return self + */ + public function setCustomJs($custom_js) + { + if (is_null($custom_js)) { + array_push($this->openAPINullablesSetToNull, 'custom_js'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('custom_js', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['custom_js'] = $custom_js; + + return $this; + } + + /** + * Gets page_id + * + * @return string|null + */ + public function getPageId() + { + return $this->container['page_id']; + } + + /** + * Sets page_id + * + * @param string|null $page_id The **id** of the page connected to this change. + * + * @return self + */ + public function setPageId($page_id) + { + if (is_null($page_id)) { + throw new \InvalidArgumentException('non-nullable page_id cannot be null'); + } + $this->container['page_id'] = $page_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/ExperienceChangeDefaultCodeMultipageDataUpdate.php b/packages/Types/lib/Generated/Model/ExperienceChangeDefaultCodeMultipageDataUpdate.php new file mode 100644 index 0000000..9d6ec8c --- /dev/null +++ b/packages/Types/lib/Generated/Model/ExperienceChangeDefaultCodeMultipageDataUpdate.php @@ -0,0 +1,519 @@ + + */ +class ExperienceChangeDefaultCodeMultipageDataUpdate implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ExperienceChangeDefaultCodeMultipageDataUpdate'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'int', + 'type' => 'string', + 'data' => '\OpenAPI\Client\Model\ExperienceChangeDefaultCodeMultipageDataBaseAllOfData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'type' => null, + 'data' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'type' => false, + 'data' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'type' => 'type', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'type' => 'setType', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'type' => 'getType', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_DEFAULT_CODE_MULTIPAGE = 'defaultCodeMultipage'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_DEFAULT_CODE_MULTIPAGE, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('data', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['data'] === null) { + $invalidProperties[] = "'data' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id The ID of the experience change + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type type + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets data + * + * @return \OpenAPI\Client\Model\ExperienceChangeDefaultCodeMultipageDataBaseAllOfData + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \OpenAPI\Client\Model\ExperienceChangeDefaultCodeMultipageDataBaseAllOfData $data data + * + * @return self + */ + public function setData($data) + { + if (is_null($data)) { + throw new \InvalidArgumentException('non-nullable data cannot be null'); + } + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/ExperienceChangeDefaultCodeMultipageDataUpdateNoId.php b/packages/Types/lib/Generated/Model/ExperienceChangeDefaultCodeMultipageDataUpdateNoId.php new file mode 100644 index 0000000..839f019 --- /dev/null +++ b/packages/Types/lib/Generated/Model/ExperienceChangeDefaultCodeMultipageDataUpdateNoId.php @@ -0,0 +1,482 @@ + + */ +class ExperienceChangeDefaultCodeMultipageDataUpdateNoId implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ExperienceChangeDefaultCodeMultipageDataUpdateNoId'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'type' => 'string', + 'data' => '\OpenAPI\Client\Model\ExperienceChangeDefaultCodeMultipageDataBaseAllOfData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'type' => null, + 'data' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'type' => false, + 'data' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'type' => 'type', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'type' => 'setType', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'type' => 'getType', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_DEFAULT_CODE_MULTIPAGE = 'defaultCodeMultipage'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_DEFAULT_CODE_MULTIPAGE, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('data', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['data'] === null) { + $invalidProperties[] = "'data' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type type + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets data + * + * @return \OpenAPI\Client\Model\ExperienceChangeDefaultCodeMultipageDataBaseAllOfData + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \OpenAPI\Client\Model\ExperienceChangeDefaultCodeMultipageDataBaseAllOfData $data data + * + * @return self + */ + public function setData($data) + { + if (is_null($data)) { + throw new \InvalidArgumentException('non-nullable data cannot be null'); + } + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/ExperienceChangeDefaultRedirectData.php b/packages/Types/lib/Generated/Model/ExperienceChangeDefaultRedirectData.php new file mode 100644 index 0000000..1235cfc --- /dev/null +++ b/packages/Types/lib/Generated/Model/ExperienceChangeDefaultRedirectData.php @@ -0,0 +1,510 @@ + + */ +class ExperienceChangeDefaultRedirectData implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ExperienceChangeDefaultRedirectData'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'int', + 'type' => 'string', + 'data' => '\OpenAPI\Client\Model\ExperienceChangeDefaultRedirectDataBaseAllOfData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'type' => null, + 'data' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'type' => false, + 'data' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'type' => 'type', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'type' => 'setType', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'type' => 'getType', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_DEFAULT_REDIRECT = 'defaultRedirect'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_DEFAULT_REDIRECT, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('data', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return int|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the experience change + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type type + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets data + * + * @return \OpenAPI\Client\Model\ExperienceChangeDefaultRedirectDataBaseAllOfData|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \OpenAPI\Client\Model\ExperienceChangeDefaultRedirectDataBaseAllOfData|null $data data + * + * @return self + */ + public function setData($data) + { + if (is_null($data)) { + throw new \InvalidArgumentException('non-nullable data cannot be null'); + } + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/ExperienceChangeDefaultRedirectDataAdd.php b/packages/Types/lib/Generated/Model/ExperienceChangeDefaultRedirectDataAdd.php new file mode 100644 index 0000000..38a12c3 --- /dev/null +++ b/packages/Types/lib/Generated/Model/ExperienceChangeDefaultRedirectDataAdd.php @@ -0,0 +1,523 @@ + + */ +class ExperienceChangeDefaultRedirectDataAdd implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ExperienceChangeDefaultRedirectDataAdd'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'int', + 'type' => 'string', + 'data' => 'mixed' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'type' => null, + 'data' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'type' => false, + 'data' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'type' => 'type', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'type' => 'setType', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'type' => 'getType', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_DEFAULT_REDIRECT = 'defaultRedirect'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_DEFAULT_REDIRECT, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('data', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['data'] === null) { + $invalidProperties[] = "'data' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return int|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the experience change + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type type + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets data + * + * @return mixed + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param mixed $data data + * + * @return self + */ + public function setData($data) + { + if (is_null($data)) { + array_push($this->openAPINullablesSetToNull, 'data'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('data', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/ExperienceChangeDefaultRedirectDataBase.php b/packages/Types/lib/Generated/Model/ExperienceChangeDefaultRedirectDataBase.php new file mode 100644 index 0000000..a1f8749 --- /dev/null +++ b/packages/Types/lib/Generated/Model/ExperienceChangeDefaultRedirectDataBase.php @@ -0,0 +1,476 @@ + + */ +class ExperienceChangeDefaultRedirectDataBase implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ExperienceChangeDefaultRedirectDataBase'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'type' => 'string', + 'data' => '\OpenAPI\Client\Model\ExperienceChangeDefaultRedirectDataBaseAllOfData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'type' => null, + 'data' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'type' => false, + 'data' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'type' => 'type', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'type' => 'setType', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'type' => 'getType', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_DEFAULT_REDIRECT = 'defaultRedirect'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_DEFAULT_REDIRECT, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('data', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type type + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets data + * + * @return \OpenAPI\Client\Model\ExperienceChangeDefaultRedirectDataBaseAllOfData|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \OpenAPI\Client\Model\ExperienceChangeDefaultRedirectDataBaseAllOfData|null $data data + * + * @return self + */ + public function setData($data) + { + if (is_null($data)) { + throw new \InvalidArgumentException('non-nullable data cannot be null'); + } + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/ExperienceChangeDefaultRedirectDataBaseAllOfData.php b/packages/Types/lib/Generated/Model/ExperienceChangeDefaultRedirectDataBaseAllOfData.php new file mode 100644 index 0000000..eaf5c93 --- /dev/null +++ b/packages/Types/lib/Generated/Model/ExperienceChangeDefaultRedirectDataBaseAllOfData.php @@ -0,0 +1,478 @@ + + */ +class ExperienceChangeDefaultRedirectDataBaseAllOfData implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ExperienceChangeDefaultRedirectDataBase_allOf_data'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'case_sensitive' => 'bool', + 'original_pattern' => 'string', + 'variation_pattern' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'case_sensitive' => null, + 'original_pattern' => null, + 'variation_pattern' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'case_sensitive' => false, + 'original_pattern' => false, + 'variation_pattern' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'case_sensitive' => 'case_sensitive', + 'original_pattern' => 'original_pattern', + 'variation_pattern' => 'variation_pattern' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'case_sensitive' => 'setCaseSensitive', + 'original_pattern' => 'setOriginalPattern', + 'variation_pattern' => 'setVariationPattern' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'case_sensitive' => 'getCaseSensitive', + 'original_pattern' => 'getOriginalPattern', + 'variation_pattern' => 'getVariationPattern' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('case_sensitive', $data ?? [], null); + $this->setIfExists('original_pattern', $data ?? [], null); + $this->setIfExists('variation_pattern', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets case_sensitive + * + * @return bool|null + */ + public function getCaseSensitive() + { + return $this->container['case_sensitive']; + } + + /** + * Sets case_sensitive + * + * @param bool|null $case_sensitive Defines whether the URL matching is case sensitive or not + * + * @return self + */ + public function setCaseSensitive($case_sensitive) + { + if (is_null($case_sensitive)) { + throw new \InvalidArgumentException('non-nullable case_sensitive cannot be null'); + } + $this->container['case_sensitive'] = $case_sensitive; + + return $this; + } + + /** + * Gets original_pattern + * + * @return string|null + */ + public function getOriginalPattern() + { + return $this->container['original_pattern']; + } + + /** + * Sets original_pattern + * + * @param string|null $original_pattern Pattern for matching the Original URL in order to construct the redirect URL + * + * @return self + */ + public function setOriginalPattern($original_pattern) + { + if (is_null($original_pattern)) { + throw new \InvalidArgumentException('non-nullable original_pattern cannot be null'); + } + $this->container['original_pattern'] = $original_pattern; + + return $this; + } + + /** + * Gets variation_pattern + * + * @return string|null + */ + public function getVariationPattern() + { + return $this->container['variation_pattern']; + } + + /** + * Sets variation_pattern + * + * @param string|null $variation_pattern String used to construct the variation redirect URL. This string can contain matches from original_url or it can be a standard URL + * + * @return self + */ + public function setVariationPattern($variation_pattern) + { + if (is_null($variation_pattern)) { + throw new \InvalidArgumentException('non-nullable variation_pattern cannot be null'); + } + $this->container['variation_pattern'] = $variation_pattern; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/ExperienceChangeDefaultRedirectDataUpdate.php b/packages/Types/lib/Generated/Model/ExperienceChangeDefaultRedirectDataUpdate.php new file mode 100644 index 0000000..ce2d65a --- /dev/null +++ b/packages/Types/lib/Generated/Model/ExperienceChangeDefaultRedirectDataUpdate.php @@ -0,0 +1,519 @@ + + */ +class ExperienceChangeDefaultRedirectDataUpdate implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ExperienceChangeDefaultRedirectDataUpdate'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'int', + 'type' => 'string', + 'data' => '\OpenAPI\Client\Model\ExperienceChangeDefaultRedirectDataBaseAllOfData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'type' => null, + 'data' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'type' => false, + 'data' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'type' => 'type', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'type' => 'setType', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'type' => 'getType', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_DEFAULT_REDIRECT = 'defaultRedirect'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_DEFAULT_REDIRECT, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('data', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['data'] === null) { + $invalidProperties[] = "'data' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id The ID of the experience change + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type type + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets data + * + * @return \OpenAPI\Client\Model\ExperienceChangeDefaultRedirectDataBaseAllOfData + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \OpenAPI\Client\Model\ExperienceChangeDefaultRedirectDataBaseAllOfData $data data + * + * @return self + */ + public function setData($data) + { + if (is_null($data)) { + throw new \InvalidArgumentException('non-nullable data cannot be null'); + } + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/ExperienceChangeDefaultRedirectDataUpdateNoId.php b/packages/Types/lib/Generated/Model/ExperienceChangeDefaultRedirectDataUpdateNoId.php new file mode 100644 index 0000000..493f82c --- /dev/null +++ b/packages/Types/lib/Generated/Model/ExperienceChangeDefaultRedirectDataUpdateNoId.php @@ -0,0 +1,482 @@ + + */ +class ExperienceChangeDefaultRedirectDataUpdateNoId implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ExperienceChangeDefaultRedirectDataUpdateNoId'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'type' => 'string', + 'data' => '\OpenAPI\Client\Model\ExperienceChangeDefaultRedirectDataBaseAllOfData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'type' => null, + 'data' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'type' => false, + 'data' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'type' => 'type', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'type' => 'setType', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'type' => 'getType', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_DEFAULT_REDIRECT = 'defaultRedirect'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_DEFAULT_REDIRECT, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('data', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['data'] === null) { + $invalidProperties[] = "'data' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type type + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets data + * + * @return \OpenAPI\Client\Model\ExperienceChangeDefaultRedirectDataBaseAllOfData + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \OpenAPI\Client\Model\ExperienceChangeDefaultRedirectDataBaseAllOfData $data data + * + * @return self + */ + public function setData($data) + { + if (is_null($data)) { + throw new \InvalidArgumentException('non-nullable data cannot be null'); + } + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/ExperienceChangeFullStackFeature.php b/packages/Types/lib/Generated/Model/ExperienceChangeFullStackFeature.php new file mode 100644 index 0000000..18aa100 --- /dev/null +++ b/packages/Types/lib/Generated/Model/ExperienceChangeFullStackFeature.php @@ -0,0 +1,510 @@ + + */ +class ExperienceChangeFullStackFeature implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ExperienceChangeFullStackFeature'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'int', + 'type' => 'string', + 'data' => '\OpenAPI\Client\Model\ExperienceChangeFullStackFeatureBaseAllOfData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'type' => null, + 'data' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'type' => false, + 'data' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'type' => 'type', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'type' => 'setType', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'type' => 'getType', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_FULL_STACK_FEATURE = 'fullStackFeature'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_FULL_STACK_FEATURE, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('data', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return int|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the experience change + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type type + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets data + * + * @return \OpenAPI\Client\Model\ExperienceChangeFullStackFeatureBaseAllOfData|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \OpenAPI\Client\Model\ExperienceChangeFullStackFeatureBaseAllOfData|null $data data + * + * @return self + */ + public function setData($data) + { + if (is_null($data)) { + throw new \InvalidArgumentException('non-nullable data cannot be null'); + } + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/ExperienceChangeFullStackFeatureAdd.php b/packages/Types/lib/Generated/Model/ExperienceChangeFullStackFeatureAdd.php new file mode 100644 index 0000000..c0615f5 --- /dev/null +++ b/packages/Types/lib/Generated/Model/ExperienceChangeFullStackFeatureAdd.php @@ -0,0 +1,523 @@ + + */ +class ExperienceChangeFullStackFeatureAdd implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ExperienceChangeFullStackFeatureAdd'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'int', + 'type' => 'string', + 'data' => 'mixed' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'type' => null, + 'data' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'type' => false, + 'data' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'type' => 'type', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'type' => 'setType', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'type' => 'getType', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_FULL_STACK_FEATURE = 'fullStackFeature'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_FULL_STACK_FEATURE, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('data', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['data'] === null) { + $invalidProperties[] = "'data' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return int|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the experience change + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type type + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets data + * + * @return mixed + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param mixed $data data + * + * @return self + */ + public function setData($data) + { + if (is_null($data)) { + array_push($this->openAPINullablesSetToNull, 'data'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('data', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/ExperienceChangeFullStackFeatureBase.php b/packages/Types/lib/Generated/Model/ExperienceChangeFullStackFeatureBase.php new file mode 100644 index 0000000..422d1f8 --- /dev/null +++ b/packages/Types/lib/Generated/Model/ExperienceChangeFullStackFeatureBase.php @@ -0,0 +1,476 @@ + + */ +class ExperienceChangeFullStackFeatureBase implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ExperienceChangeFullStackFeatureBase'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'type' => 'string', + 'data' => '\OpenAPI\Client\Model\ExperienceChangeFullStackFeatureBaseAllOfData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'type' => null, + 'data' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'type' => false, + 'data' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'type' => 'type', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'type' => 'setType', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'type' => 'getType', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_FULL_STACK_FEATURE = 'fullStackFeature'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_FULL_STACK_FEATURE, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('data', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type type + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets data + * + * @return \OpenAPI\Client\Model\ExperienceChangeFullStackFeatureBaseAllOfData|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \OpenAPI\Client\Model\ExperienceChangeFullStackFeatureBaseAllOfData|null $data data + * + * @return self + */ + public function setData($data) + { + if (is_null($data)) { + throw new \InvalidArgumentException('non-nullable data cannot be null'); + } + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/ExperienceChangeFullStackFeatureBaseAllOfData.php b/packages/Types/lib/Generated/Model/ExperienceChangeFullStackFeatureBaseAllOfData.php new file mode 100644 index 0000000..006c79e --- /dev/null +++ b/packages/Types/lib/Generated/Model/ExperienceChangeFullStackFeatureBaseAllOfData.php @@ -0,0 +1,444 @@ + + */ +class ExperienceChangeFullStackFeatureBaseAllOfData implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ExperienceChangeFullStackFeatureBase_allOf_data'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'feature_id' => 'int', + 'variables_data' => 'object' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'feature_id' => null, + 'variables_data' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'feature_id' => false, + 'variables_data' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'feature_id' => 'feature_id', + 'variables_data' => 'variables_data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'feature_id' => 'setFeatureId', + 'variables_data' => 'setVariablesData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'feature_id' => 'getFeatureId', + 'variables_data' => 'getVariablesData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('feature_id', $data ?? [], null); + $this->setIfExists('variables_data', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets feature_id + * + * @return int|null + */ + public function getFeatureId() + { + return $this->container['feature_id']; + } + + /** + * Sets feature_id + * + * @param int|null $feature_id The **id** of the feature connected to this change + * + * @return self + */ + public function setFeatureId($feature_id) + { + if (is_null($feature_id)) { + throw new \InvalidArgumentException('non-nullable feature_id cannot be null'); + } + $this->container['feature_id'] = $feature_id; + + return $this; + } + + /** + * Gets variables_data + * + * @return object|null + */ + public function getVariablesData() + { + return $this->container['variables_data']; + } + + /** + * Sets variables_data + * + * @param object|null $variables_data A key-value object defined by user which describes the variables values. Where the key is variable name defined in connected feature and value is a variable's value with corresponding type + * + * @return self + */ + public function setVariablesData($variables_data) + { + if (is_null($variables_data)) { + throw new \InvalidArgumentException('non-nullable variables_data cannot be null'); + } + $this->container['variables_data'] = $variables_data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/ExperienceChangeFullStackFeatureUpdate.php b/packages/Types/lib/Generated/Model/ExperienceChangeFullStackFeatureUpdate.php new file mode 100644 index 0000000..520c063 --- /dev/null +++ b/packages/Types/lib/Generated/Model/ExperienceChangeFullStackFeatureUpdate.php @@ -0,0 +1,519 @@ + + */ +class ExperienceChangeFullStackFeatureUpdate implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ExperienceChangeFullStackFeatureUpdate'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'int', + 'type' => 'string', + 'data' => '\OpenAPI\Client\Model\ExperienceChangeFullStackFeatureBaseAllOfData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'type' => null, + 'data' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'type' => false, + 'data' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'type' => 'type', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'type' => 'setType', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'type' => 'getType', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_FULL_STACK_FEATURE = 'fullStackFeature'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_FULL_STACK_FEATURE, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('data', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['data'] === null) { + $invalidProperties[] = "'data' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id The ID of the experience change + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type type + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets data + * + * @return \OpenAPI\Client\Model\ExperienceChangeFullStackFeatureBaseAllOfData + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \OpenAPI\Client\Model\ExperienceChangeFullStackFeatureBaseAllOfData $data data + * + * @return self + */ + public function setData($data) + { + if (is_null($data)) { + throw new \InvalidArgumentException('non-nullable data cannot be null'); + } + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/ExperienceChangeFullStackFeatureUpdateNoId.php b/packages/Types/lib/Generated/Model/ExperienceChangeFullStackFeatureUpdateNoId.php new file mode 100644 index 0000000..8d9341f --- /dev/null +++ b/packages/Types/lib/Generated/Model/ExperienceChangeFullStackFeatureUpdateNoId.php @@ -0,0 +1,482 @@ + + */ +class ExperienceChangeFullStackFeatureUpdateNoId implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ExperienceChangeFullStackFeatureUpdateNoId'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'type' => 'string', + 'data' => '\OpenAPI\Client\Model\ExperienceChangeFullStackFeatureBaseAllOfData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'type' => null, + 'data' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'type' => false, + 'data' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'type' => 'type', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'type' => 'setType', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'type' => 'getType', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_FULL_STACK_FEATURE = 'fullStackFeature'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_FULL_STACK_FEATURE, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('data', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['data'] === null) { + $invalidProperties[] = "'data' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type type + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets data + * + * @return \OpenAPI\Client\Model\ExperienceChangeFullStackFeatureBaseAllOfData + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \OpenAPI\Client\Model\ExperienceChangeFullStackFeatureBaseAllOfData $data data + * + * @return self + */ + public function setData($data) + { + if (is_null($data)) { + throw new \InvalidArgumentException('non-nullable data cannot be null'); + } + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/ExperienceChangeId.php b/packages/Types/lib/Generated/Model/ExperienceChangeId.php new file mode 100644 index 0000000..f93f437 --- /dev/null +++ b/packages/Types/lib/Generated/Model/ExperienceChangeId.php @@ -0,0 +1,413 @@ + + */ +class ExperienceChangeId implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ExperienceChangeId'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id The ID of the experience change + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/ExperienceChangeIdReadOnly.php b/packages/Types/lib/Generated/Model/ExperienceChangeIdReadOnly.php new file mode 100644 index 0000000..f7bd9f0 --- /dev/null +++ b/packages/Types/lib/Generated/Model/ExperienceChangeIdReadOnly.php @@ -0,0 +1,410 @@ + + */ +class ExperienceChangeIdReadOnly implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ExperienceChangeIdReadOnly'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return int|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the experience change + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/ExperienceChangeRichStructureData.php b/packages/Types/lib/Generated/Model/ExperienceChangeRichStructureData.php new file mode 100644 index 0000000..481a843 --- /dev/null +++ b/packages/Types/lib/Generated/Model/ExperienceChangeRichStructureData.php @@ -0,0 +1,510 @@ + + */ +class ExperienceChangeRichStructureData implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ExperienceChangeRichStructureData'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'int', + 'type' => 'string', + 'data' => '\OpenAPI\Client\Model\ExperienceChangeRichStructureDataBaseAllOfData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'type' => null, + 'data' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'type' => false, + 'data' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'type' => 'type', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'type' => 'setType', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'type' => 'getType', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_RICH_STRUCTURE = 'richStructure'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_RICH_STRUCTURE, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('data', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return int|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the experience change + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type type + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets data + * + * @return \OpenAPI\Client\Model\ExperienceChangeRichStructureDataBaseAllOfData|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \OpenAPI\Client\Model\ExperienceChangeRichStructureDataBaseAllOfData|null $data data + * + * @return self + */ + public function setData($data) + { + if (is_null($data)) { + throw new \InvalidArgumentException('non-nullable data cannot be null'); + } + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/ExperienceChangeRichStructureDataAdd.php b/packages/Types/lib/Generated/Model/ExperienceChangeRichStructureDataAdd.php new file mode 100644 index 0000000..924aa78 --- /dev/null +++ b/packages/Types/lib/Generated/Model/ExperienceChangeRichStructureDataAdd.php @@ -0,0 +1,523 @@ + + */ +class ExperienceChangeRichStructureDataAdd implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ExperienceChangeRichStructureDataAdd'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'int', + 'type' => 'string', + 'data' => 'mixed' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'type' => null, + 'data' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'type' => false, + 'data' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'type' => 'type', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'type' => 'setType', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'type' => 'getType', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_RICH_STRUCTURE = 'richStructure'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_RICH_STRUCTURE, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('data', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['data'] === null) { + $invalidProperties[] = "'data' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return int|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The ID of the experience change + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type type + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets data + * + * @return mixed + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param mixed $data data + * + * @return self + */ + public function setData($data) + { + if (is_null($data)) { + array_push($this->openAPINullablesSetToNull, 'data'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('data', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/ExperienceChangeRichStructureDataBase.php b/packages/Types/lib/Generated/Model/ExperienceChangeRichStructureDataBase.php new file mode 100644 index 0000000..9edbee2 --- /dev/null +++ b/packages/Types/lib/Generated/Model/ExperienceChangeRichStructureDataBase.php @@ -0,0 +1,476 @@ + + */ +class ExperienceChangeRichStructureDataBase implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ExperienceChangeRichStructureDataBase'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'type' => 'string', + 'data' => '\OpenAPI\Client\Model\ExperienceChangeRichStructureDataBaseAllOfData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'type' => null, + 'data' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'type' => false, + 'data' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'type' => 'type', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'type' => 'setType', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'type' => 'getType', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_RICH_STRUCTURE = 'richStructure'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_RICH_STRUCTURE, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('data', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type type + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets data + * + * @return \OpenAPI\Client\Model\ExperienceChangeRichStructureDataBaseAllOfData|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \OpenAPI\Client\Model\ExperienceChangeRichStructureDataBaseAllOfData|null $data data + * + * @return self + */ + public function setData($data) + { + if (is_null($data)) { + throw new \InvalidArgumentException('non-nullable data cannot be null'); + } + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/ExperienceChangeRichStructureDataBaseAllOfData.php b/packages/Types/lib/Generated/Model/ExperienceChangeRichStructureDataBaseAllOfData.php new file mode 100644 index 0000000..6152128 --- /dev/null +++ b/packages/Types/lib/Generated/Model/ExperienceChangeRichStructureDataBaseAllOfData.php @@ -0,0 +1,485 @@ + + */ +class ExperienceChangeRichStructureDataBaseAllOfData implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ExperienceChangeRichStructureDataBase_allOf_data'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'js' => 'string', + 'selector' => 'string', + 'page_id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'js' => null, + 'selector' => null, + 'page_id' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'js' => true, + 'selector' => false, + 'page_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'js' => 'js', + 'selector' => 'selector', + 'page_id' => 'page_id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'js' => 'setJs', + 'selector' => 'setSelector', + 'page_id' => 'setPageId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'js' => 'getJs', + 'selector' => 'getSelector', + 'page_id' => 'getPageId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('js', $data ?? [], null); + $this->setIfExists('selector', $data ?? [], null); + $this->setIfExists('page_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets js + * + * @return string|null + */ + public function getJs() + { + return $this->container['js']; + } + + /** + * Sets js + * + * @param string|null $js Javascript code generated by the visual editor or written in the same structure, to be applied by this experience change + * + * @return self + */ + public function setJs($js) + { + if (is_null($js)) { + array_push($this->openAPINullablesSetToNull, 'js'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('js', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['js'] = $js; + + return $this; + } + + /** + * Gets selector + * + * @return string|null + */ + public function getSelector() + { + return $this->container['selector']; + } + + /** + * Sets selector + * + * @param string|null $selector CSS selector of the element to which the change refers to, if this is a change concerning one DOM element + * + * @return self + */ + public function setSelector($selector) + { + if (is_null($selector)) { + throw new \InvalidArgumentException('non-nullable selector cannot be null'); + } + $this->container['selector'] = $selector; + + return $this; + } + + /** + * Gets page_id + * + * @return string|null + */ + public function getPageId() + { + return $this->container['page_id']; + } + + /** + * Sets page_id + * + * @param string|null $page_id The **id** of the page connected to this change, in case this is a **multi-page** experiment + * + * @return self + */ + public function setPageId($page_id) + { + if (is_null($page_id)) { + throw new \InvalidArgumentException('non-nullable page_id cannot be null'); + } + $this->container['page_id'] = $page_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/ExperienceChangeRichStructureDataUpdate.php b/packages/Types/lib/Generated/Model/ExperienceChangeRichStructureDataUpdate.php new file mode 100644 index 0000000..00dd6ea --- /dev/null +++ b/packages/Types/lib/Generated/Model/ExperienceChangeRichStructureDataUpdate.php @@ -0,0 +1,519 @@ + + */ +class ExperienceChangeRichStructureDataUpdate implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ExperienceChangeRichStructureDataUpdate'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'int', + 'type' => 'string', + 'data' => '\OpenAPI\Client\Model\ExperienceChangeRichStructureDataBaseAllOfData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'type' => null, + 'data' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'type' => false, + 'data' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'type' => 'type', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'type' => 'setType', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'type' => 'getType', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_RICH_STRUCTURE = 'richStructure'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_RICH_STRUCTURE, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('data', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['data'] === null) { + $invalidProperties[] = "'data' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id The ID of the experience change + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type type + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets data + * + * @return \OpenAPI\Client\Model\ExperienceChangeRichStructureDataBaseAllOfData + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \OpenAPI\Client\Model\ExperienceChangeRichStructureDataBaseAllOfData $data data + * + * @return self + */ + public function setData($data) + { + if (is_null($data)) { + throw new \InvalidArgumentException('non-nullable data cannot be null'); + } + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/ExperienceChangeRichStructureDataUpdateNoId.php b/packages/Types/lib/Generated/Model/ExperienceChangeRichStructureDataUpdateNoId.php new file mode 100644 index 0000000..66bbbea --- /dev/null +++ b/packages/Types/lib/Generated/Model/ExperienceChangeRichStructureDataUpdateNoId.php @@ -0,0 +1,482 @@ + + */ +class ExperienceChangeRichStructureDataUpdateNoId implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ExperienceChangeRichStructureDataUpdateNoId'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'type' => 'string', + 'data' => '\OpenAPI\Client\Model\ExperienceChangeRichStructureDataBaseAllOfData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'type' => null, + 'data' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'type' => false, + 'data' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'type' => 'type', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'type' => 'setType', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'type' => 'getType', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_RICH_STRUCTURE = 'richStructure'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_RICH_STRUCTURE, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('data', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['data'] === null) { + $invalidProperties[] = "'data' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type type + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets data + * + * @return \OpenAPI\Client\Model\ExperienceChangeRichStructureDataBaseAllOfData + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \OpenAPI\Client\Model\ExperienceChangeRichStructureDataBaseAllOfData $data data + * + * @return self + */ + public function setData($data) + { + if (is_null($data)) { + throw new \InvalidArgumentException('non-nullable data cannot be null'); + } + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/ExperienceChangeUpdate.php b/packages/Types/lib/Generated/Model/ExperienceChangeUpdate.php new file mode 100644 index 0000000..f97ecdb --- /dev/null +++ b/packages/Types/lib/Generated/Model/ExperienceChangeUpdate.php @@ -0,0 +1,532 @@ + + */ +class ExperienceChangeUpdate implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = 'type'; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ExperienceChangeUpdate'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'int', + 'type' => 'string', + 'data' => '\OpenAPI\Client\Model\ExperienceChangeFullStackFeatureBaseAllOfData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'type' => null, + 'data' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'type' => false, + 'data' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'type' => 'type', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'type' => 'setType', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'type' => 'getType', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_DEFAULT_CODE = 'defaultCode'; + public const TYPE_DEFAULT_CODE_MULTIPAGE = 'defaultCodeMultipage'; + public const TYPE_DEFAULT_REDIRECT = 'defaultRedirect'; + public const TYPE_RICH_STRUCTURE = 'richStructure'; + public const TYPE_CUSTOM_CODE = 'customCode'; + public const TYPE_FULL_STACK_FEATURE = 'fullStackFeature'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_DEFAULT_CODE, + self::TYPE_DEFAULT_CODE_MULTIPAGE, + self::TYPE_DEFAULT_REDIRECT, + self::TYPE_RICH_STRUCTURE, + self::TYPE_CUSTOM_CODE, + self::TYPE_FULL_STACK_FEATURE, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('data', $data ?? [], null); + + // Initialize discriminator property with the model name. + $this->container['type'] = static::$openAPIModelName; + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['data'] === null) { + $invalidProperties[] = "'data' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id The ID of the experience change + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type type + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets data + * + * @return \OpenAPI\Client\Model\ExperienceChangeFullStackFeatureBaseAllOfData + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \OpenAPI\Client\Model\ExperienceChangeFullStackFeatureBaseAllOfData $data data + * + * @return self + */ + public function setData($data) + { + if (is_null($data)) { + throw new \InvalidArgumentException('non-nullable data cannot be null'); + } + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/ExperienceChangeUpdateNoId.php b/packages/Types/lib/Generated/Model/ExperienceChangeUpdateNoId.php new file mode 100644 index 0000000..138562c --- /dev/null +++ b/packages/Types/lib/Generated/Model/ExperienceChangeUpdateNoId.php @@ -0,0 +1,495 @@ + + */ +class ExperienceChangeUpdateNoId implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = 'type'; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ExperienceChangeUpdateNoId'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'type' => 'string', + 'data' => '\OpenAPI\Client\Model\ExperienceChangeFullStackFeatureBaseAllOfData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'type' => null, + 'data' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'type' => false, + 'data' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'type' => 'type', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'type' => 'setType', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'type' => 'getType', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_DEFAULT_CODE = 'defaultCode'; + public const TYPE_DEFAULT_CODE_MULTIPAGE = 'defaultCodeMultipage'; + public const TYPE_DEFAULT_REDIRECT = 'defaultRedirect'; + public const TYPE_RICH_STRUCTURE = 'richStructure'; + public const TYPE_CUSTOM_CODE = 'customCode'; + public const TYPE_FULL_STACK_FEATURE = 'fullStackFeature'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_DEFAULT_CODE, + self::TYPE_DEFAULT_CODE_MULTIPAGE, + self::TYPE_DEFAULT_REDIRECT, + self::TYPE_RICH_STRUCTURE, + self::TYPE_CUSTOM_CODE, + self::TYPE_FULL_STACK_FEATURE, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('data', $data ?? [], null); + + // Initialize discriminator property with the model name. + $this->container['type'] = static::$openAPIModelName; + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['data'] === null) { + $invalidProperties[] = "'data' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type type + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets data + * + * @return \OpenAPI\Client\Model\ExperienceChangeFullStackFeatureBaseAllOfData + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \OpenAPI\Client\Model\ExperienceChangeFullStackFeatureBaseAllOfData $data data + * + * @return self + */ + public function setData($data) + { + if (is_null($data)) { + throw new \InvalidArgumentException('non-nullable data cannot be null'); + } + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/ExperienceIntegrationBaidu.php b/packages/Types/lib/Generated/Model/ExperienceIntegrationBaidu.php new file mode 100644 index 0000000..b1c8086 --- /dev/null +++ b/packages/Types/lib/Generated/Model/ExperienceIntegrationBaidu.php @@ -0,0 +1,490 @@ + + */ +class ExperienceIntegrationBaidu implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ExperienceIntegrationBaidu'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'provider' => '\OpenAPI\Client\Model\IntegrationProvider', + 'enabled' => 'bool', + 'custom_dimension' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'provider' => null, + 'enabled' => null, + 'custom_dimension' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'provider' => false, + 'enabled' => true, + 'custom_dimension' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'provider' => 'provider', + 'enabled' => 'enabled', + 'custom_dimension' => 'custom_dimension' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'provider' => 'setProvider', + 'enabled' => 'setEnabled', + 'custom_dimension' => 'setCustomDimension' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'provider' => 'getProvider', + 'enabled' => 'getEnabled', + 'custom_dimension' => 'getCustomDimension' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('provider', $data ?? [], null); + $this->setIfExists('enabled', $data ?? [], null); + $this->setIfExists('custom_dimension', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['provider'] === null) { + $invalidProperties[] = "'provider' can't be null"; + } + if ($this->container['custom_dimension'] === null) { + $invalidProperties[] = "'custom_dimension' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets provider + * + * @return \OpenAPI\Client\Model\IntegrationProvider + */ + public function getProvider() + { + return $this->container['provider']; + } + + /** + * Sets provider + * + * @param \OpenAPI\Client\Model\IntegrationProvider $provider provider + * + * @return self + */ + public function setProvider($provider) + { + if (is_null($provider)) { + throw new \InvalidArgumentException('non-nullable provider cannot be null'); + } + $this->container['provider'] = $provider; + + return $this; + } + + /** + * Gets enabled + * + * @return bool|null + */ + public function getEnabled() + { + return $this->container['enabled']; + } + + /** + * Sets enabled + * + * @param bool|null $enabled Boolean flag indicating whether the integration is enabled or not. When updating experience's integrations, to disable an integration, this flag needs to be passed as **false**. If not passed, integration is assumed to be **enabled=true** + * + * @return self + */ + public function setEnabled($enabled) + { + if (is_null($enabled)) { + array_push($this->openAPINullablesSetToNull, 'enabled'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('enabled', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['enabled'] = $enabled; + + return $this; + } + + /** + * Gets custom_dimension + * + * @return string + */ + public function getCustomDimension() + { + return $this->container['custom_dimension']; + } + + /** + * Sets custom_dimension + * + * @param string $custom_dimension Custom dimension where experience data should be sent to. + * + * @return self + */ + public function setCustomDimension($custom_dimension) + { + if (is_null($custom_dimension)) { + throw new \InvalidArgumentException('non-nullable custom_dimension cannot be null'); + } + $this->container['custom_dimension'] = $custom_dimension; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/ExperienceIntegrationBase.php b/packages/Types/lib/Generated/Model/ExperienceIntegrationBase.php new file mode 100644 index 0000000..118c13e --- /dev/null +++ b/packages/Types/lib/Generated/Model/ExperienceIntegrationBase.php @@ -0,0 +1,453 @@ + + */ +class ExperienceIntegrationBase implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ExperienceIntegrationBase'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'provider' => '\OpenAPI\Client\Model\IntegrationProvider', + 'enabled' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'provider' => null, + 'enabled' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'provider' => false, + 'enabled' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'provider' => 'provider', + 'enabled' => 'enabled' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'provider' => 'setProvider', + 'enabled' => 'setEnabled' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'provider' => 'getProvider', + 'enabled' => 'getEnabled' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('provider', $data ?? [], null); + $this->setIfExists('enabled', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['provider'] === null) { + $invalidProperties[] = "'provider' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets provider + * + * @return \OpenAPI\Client\Model\IntegrationProvider + */ + public function getProvider() + { + return $this->container['provider']; + } + + /** + * Sets provider + * + * @param \OpenAPI\Client\Model\IntegrationProvider $provider provider + * + * @return self + */ + public function setProvider($provider) + { + if (is_null($provider)) { + throw new \InvalidArgumentException('non-nullable provider cannot be null'); + } + $this->container['provider'] = $provider; + + return $this; + } + + /** + * Gets enabled + * + * @return bool|null + */ + public function getEnabled() + { + return $this->container['enabled']; + } + + /** + * Sets enabled + * + * @param bool|null $enabled Boolean flag indicating whether the integration is enabled or not. When updating experience's integrations, to disable an integration, this flag needs to be passed as **false**. If not passed, integration is assumed to be **enabled=true** + * + * @return self + */ + public function setEnabled($enabled) + { + if (is_null($enabled)) { + array_push($this->openAPINullablesSetToNull, 'enabled'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('enabled', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['enabled'] = $enabled; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/ExperienceIntegrationClicktale.php b/packages/Types/lib/Generated/Model/ExperienceIntegrationClicktale.php new file mode 100644 index 0000000..5cbe2c5 --- /dev/null +++ b/packages/Types/lib/Generated/Model/ExperienceIntegrationClicktale.php @@ -0,0 +1,453 @@ + + */ +class ExperienceIntegrationClicktale implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ExperienceIntegrationClicktale'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'provider' => '\OpenAPI\Client\Model\IntegrationProvider', + 'enabled' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'provider' => null, + 'enabled' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'provider' => false, + 'enabled' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'provider' => 'provider', + 'enabled' => 'enabled' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'provider' => 'setProvider', + 'enabled' => 'setEnabled' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'provider' => 'getProvider', + 'enabled' => 'getEnabled' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('provider', $data ?? [], null); + $this->setIfExists('enabled', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['provider'] === null) { + $invalidProperties[] = "'provider' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets provider + * + * @return \OpenAPI\Client\Model\IntegrationProvider + */ + public function getProvider() + { + return $this->container['provider']; + } + + /** + * Sets provider + * + * @param \OpenAPI\Client\Model\IntegrationProvider $provider provider + * + * @return self + */ + public function setProvider($provider) + { + if (is_null($provider)) { + throw new \InvalidArgumentException('non-nullable provider cannot be null'); + } + $this->container['provider'] = $provider; + + return $this; + } + + /** + * Gets enabled + * + * @return bool|null + */ + public function getEnabled() + { + return $this->container['enabled']; + } + + /** + * Sets enabled + * + * @param bool|null $enabled Boolean flag indicating whether the integration is enabled or not. When updating experience's integrations, to disable an integration, this flag needs to be passed as **false**. If not passed, integration is assumed to be **enabled=true** + * + * @return self + */ + public function setEnabled($enabled) + { + if (is_null($enabled)) { + array_push($this->openAPINullablesSetToNull, 'enabled'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('enabled', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['enabled'] = $enabled; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/ExperienceIntegrationClicky.php b/packages/Types/lib/Generated/Model/ExperienceIntegrationClicky.php new file mode 100644 index 0000000..39eaf8f --- /dev/null +++ b/packages/Types/lib/Generated/Model/ExperienceIntegrationClicky.php @@ -0,0 +1,453 @@ + + */ +class ExperienceIntegrationClicky implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ExperienceIntegrationClicky'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'provider' => '\OpenAPI\Client\Model\IntegrationProvider', + 'enabled' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'provider' => null, + 'enabled' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'provider' => false, + 'enabled' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'provider' => 'provider', + 'enabled' => 'enabled' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'provider' => 'setProvider', + 'enabled' => 'setEnabled' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'provider' => 'getProvider', + 'enabled' => 'getEnabled' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('provider', $data ?? [], null); + $this->setIfExists('enabled', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['provider'] === null) { + $invalidProperties[] = "'provider' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets provider + * + * @return \OpenAPI\Client\Model\IntegrationProvider + */ + public function getProvider() + { + return $this->container['provider']; + } + + /** + * Sets provider + * + * @param \OpenAPI\Client\Model\IntegrationProvider $provider provider + * + * @return self + */ + public function setProvider($provider) + { + if (is_null($provider)) { + throw new \InvalidArgumentException('non-nullable provider cannot be null'); + } + $this->container['provider'] = $provider; + + return $this; + } + + /** + * Gets enabled + * + * @return bool|null + */ + public function getEnabled() + { + return $this->container['enabled']; + } + + /** + * Sets enabled + * + * @param bool|null $enabled Boolean flag indicating whether the integration is enabled or not. When updating experience's integrations, to disable an integration, this flag needs to be passed as **false**. If not passed, integration is assumed to be **enabled=true** + * + * @return self + */ + public function setEnabled($enabled) + { + if (is_null($enabled)) { + array_push($this->openAPINullablesSetToNull, 'enabled'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('enabled', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['enabled'] = $enabled; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/ExperienceIntegrationCnzz.php b/packages/Types/lib/Generated/Model/ExperienceIntegrationCnzz.php new file mode 100644 index 0000000..5391634 --- /dev/null +++ b/packages/Types/lib/Generated/Model/ExperienceIntegrationCnzz.php @@ -0,0 +1,490 @@ + + */ +class ExperienceIntegrationCnzz implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ExperienceIntegrationCnzz'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'provider' => '\OpenAPI\Client\Model\IntegrationProvider', + 'enabled' => 'bool', + 'custom_dimension' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'provider' => null, + 'enabled' => null, + 'custom_dimension' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'provider' => false, + 'enabled' => true, + 'custom_dimension' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'provider' => 'provider', + 'enabled' => 'enabled', + 'custom_dimension' => 'custom_dimension' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'provider' => 'setProvider', + 'enabled' => 'setEnabled', + 'custom_dimension' => 'setCustomDimension' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'provider' => 'getProvider', + 'enabled' => 'getEnabled', + 'custom_dimension' => 'getCustomDimension' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('provider', $data ?? [], null); + $this->setIfExists('enabled', $data ?? [], null); + $this->setIfExists('custom_dimension', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['provider'] === null) { + $invalidProperties[] = "'provider' can't be null"; + } + if ($this->container['custom_dimension'] === null) { + $invalidProperties[] = "'custom_dimension' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets provider + * + * @return \OpenAPI\Client\Model\IntegrationProvider + */ + public function getProvider() + { + return $this->container['provider']; + } + + /** + * Sets provider + * + * @param \OpenAPI\Client\Model\IntegrationProvider $provider provider + * + * @return self + */ + public function setProvider($provider) + { + if (is_null($provider)) { + throw new \InvalidArgumentException('non-nullable provider cannot be null'); + } + $this->container['provider'] = $provider; + + return $this; + } + + /** + * Gets enabled + * + * @return bool|null + */ + public function getEnabled() + { + return $this->container['enabled']; + } + + /** + * Sets enabled + * + * @param bool|null $enabled Boolean flag indicating whether the integration is enabled or not. When updating experience's integrations, to disable an integration, this flag needs to be passed as **false**. If not passed, integration is assumed to be **enabled=true** + * + * @return self + */ + public function setEnabled($enabled) + { + if (is_null($enabled)) { + array_push($this->openAPINullablesSetToNull, 'enabled'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('enabled', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['enabled'] = $enabled; + + return $this; + } + + /** + * Gets custom_dimension + * + * @return string + */ + public function getCustomDimension() + { + return $this->container['custom_dimension']; + } + + /** + * Sets custom_dimension + * + * @param string $custom_dimension Custom dimension where experience data should be sent to. + * + * @return self + */ + public function setCustomDimension($custom_dimension) + { + if (is_null($custom_dimension)) { + throw new \InvalidArgumentException('non-nullable custom_dimension cannot be null'); + } + $this->container['custom_dimension'] = $custom_dimension; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/ExperienceIntegrationCrazyegg.php b/packages/Types/lib/Generated/Model/ExperienceIntegrationCrazyegg.php new file mode 100644 index 0000000..e032b29 --- /dev/null +++ b/packages/Types/lib/Generated/Model/ExperienceIntegrationCrazyegg.php @@ -0,0 +1,454 @@ + + */ +class ExperienceIntegrationCrazyegg implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ExperienceIntegrationCrazyegg'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'provider' => '\OpenAPI\Client\Model\IntegrationProvider', + 'enabled' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'provider' => null, + 'enabled' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'provider' => false, + 'enabled' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'provider' => 'provider', + 'enabled' => 'enabled' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'provider' => 'setProvider', + 'enabled' => 'setEnabled' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'provider' => 'getProvider', + 'enabled' => 'getEnabled' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('provider', $data ?? [], null); + $this->setIfExists('enabled', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['provider'] === null) { + $invalidProperties[] = "'provider' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets provider + * + * @return \OpenAPI\Client\Model\IntegrationProvider + */ + public function getProvider() + { + return $this->container['provider']; + } + + /** + * Sets provider + * + * @param \OpenAPI\Client\Model\IntegrationProvider $provider provider + * + * @return self + */ + public function setProvider($provider) + { + if (is_null($provider)) { + throw new \InvalidArgumentException('non-nullable provider cannot be null'); + } + $this->container['provider'] = $provider; + + return $this; + } + + /** + * Gets enabled + * + * @return bool|null + */ + public function getEnabled() + { + return $this->container['enabled']; + } + + /** + * Sets enabled + * + * @param bool|null $enabled Boolean flag indicating whether the integration is enabled or not. When updating experience's integrations, to disable an integration, this flag needs to be passed as **false**. If not passed, integration is assumed to be **enabled=true** + * + * @return self + */ + public function setEnabled($enabled) + { + if (is_null($enabled)) { + array_push($this->openAPINullablesSetToNull, 'enabled'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('enabled', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['enabled'] = $enabled; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/ExperienceIntegrationEconda.php b/packages/Types/lib/Generated/Model/ExperienceIntegrationEconda.php new file mode 100644 index 0000000..9cad320 --- /dev/null +++ b/packages/Types/lib/Generated/Model/ExperienceIntegrationEconda.php @@ -0,0 +1,453 @@ + + */ +class ExperienceIntegrationEconda implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ExperienceIntegrationEconda'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'provider' => '\OpenAPI\Client\Model\IntegrationProvider', + 'enabled' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'provider' => null, + 'enabled' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'provider' => false, + 'enabled' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'provider' => 'provider', + 'enabled' => 'enabled' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'provider' => 'setProvider', + 'enabled' => 'setEnabled' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'provider' => 'getProvider', + 'enabled' => 'getEnabled' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('provider', $data ?? [], null); + $this->setIfExists('enabled', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['provider'] === null) { + $invalidProperties[] = "'provider' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets provider + * + * @return \OpenAPI\Client\Model\IntegrationProvider + */ + public function getProvider() + { + return $this->container['provider']; + } + + /** + * Sets provider + * + * @param \OpenAPI\Client\Model\IntegrationProvider $provider provider + * + * @return self + */ + public function setProvider($provider) + { + if (is_null($provider)) { + throw new \InvalidArgumentException('non-nullable provider cannot be null'); + } + $this->container['provider'] = $provider; + + return $this; + } + + /** + * Gets enabled + * + * @return bool|null + */ + public function getEnabled() + { + return $this->container['enabled']; + } + + /** + * Sets enabled + * + * @param bool|null $enabled Boolean flag indicating whether the integration is enabled or not. When updating experience's integrations, to disable an integration, this flag needs to be passed as **false**. If not passed, integration is assumed to be **enabled=true** + * + * @return self + */ + public function setEnabled($enabled) + { + if (is_null($enabled)) { + array_push($this->openAPINullablesSetToNull, 'enabled'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('enabled', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['enabled'] = $enabled; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/ExperienceIntegrationEulerian.php b/packages/Types/lib/Generated/Model/ExperienceIntegrationEulerian.php new file mode 100644 index 0000000..75d4d0d --- /dev/null +++ b/packages/Types/lib/Generated/Model/ExperienceIntegrationEulerian.php @@ -0,0 +1,453 @@ + + */ +class ExperienceIntegrationEulerian implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ExperienceIntegrationEulerian'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'provider' => '\OpenAPI\Client\Model\IntegrationProvider', + 'enabled' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'provider' => null, + 'enabled' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'provider' => false, + 'enabled' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'provider' => 'provider', + 'enabled' => 'enabled' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'provider' => 'setProvider', + 'enabled' => 'setEnabled' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'provider' => 'getProvider', + 'enabled' => 'getEnabled' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('provider', $data ?? [], null); + $this->setIfExists('enabled', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['provider'] === null) { + $invalidProperties[] = "'provider' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets provider + * + * @return \OpenAPI\Client\Model\IntegrationProvider + */ + public function getProvider() + { + return $this->container['provider']; + } + + /** + * Sets provider + * + * @param \OpenAPI\Client\Model\IntegrationProvider $provider provider + * + * @return self + */ + public function setProvider($provider) + { + if (is_null($provider)) { + throw new \InvalidArgumentException('non-nullable provider cannot be null'); + } + $this->container['provider'] = $provider; + + return $this; + } + + /** + * Gets enabled + * + * @return bool|null + */ + public function getEnabled() + { + return $this->container['enabled']; + } + + /** + * Sets enabled + * + * @param bool|null $enabled Boolean flag indicating whether the integration is enabled or not. When updating experience's integrations, to disable an integration, this flag needs to be passed as **false**. If not passed, integration is assumed to be **enabled=true** + * + * @return self + */ + public function setEnabled($enabled) + { + if (is_null($enabled)) { + array_push($this->openAPINullablesSetToNull, 'enabled'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('enabled', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['enabled'] = $enabled; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/ExperienceIntegrationGA3.php b/packages/Types/lib/Generated/Model/ExperienceIntegrationGA3.php new file mode 100644 index 0000000..2b2aa95 --- /dev/null +++ b/packages/Types/lib/Generated/Model/ExperienceIntegrationGA3.php @@ -0,0 +1,602 @@ + + */ +class ExperienceIntegrationGA3 implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ExperienceIntegrationGA3'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'enabled' => 'bool', + 'provider' => '\OpenAPI\Client\Model\IntegrationProvider', + 'type' => 'string', + 'property_ua' => 'string', + 'custom_dimension' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'enabled' => null, + 'provider' => null, + 'type' => null, + 'property_ua' => null, + 'custom_dimension' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'enabled' => true, + 'provider' => false, + 'type' => false, + 'property_ua' => true, + 'custom_dimension' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'enabled' => 'enabled', + 'provider' => 'provider', + 'type' => 'type', + 'property_ua' => 'property_UA', + 'custom_dimension' => 'custom_dimension' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'enabled' => 'setEnabled', + 'provider' => 'setProvider', + 'type' => 'setType', + 'property_ua' => 'setPropertyUa', + 'custom_dimension' => 'setCustomDimension' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'enabled' => 'getEnabled', + 'provider' => 'getProvider', + 'type' => 'getType', + 'property_ua' => 'getPropertyUa', + 'custom_dimension' => 'getCustomDimension' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_GA3 = 'ga3'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_GA3, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('enabled', $data ?? [], null); + $this->setIfExists('provider', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('property_ua', $data ?? [], null); + $this->setIfExists('custom_dimension', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['provider'] === null) { + $invalidProperties[] = "'provider' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + if (!is_null($this->container['property_ua']) && (mb_strlen($this->container['property_ua']) > 150)) { + $invalidProperties[] = "invalid value for 'property_ua', the character length must be smaller than or equal to 150."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets enabled + * + * @return bool|null + */ + public function getEnabled() + { + return $this->container['enabled']; + } + + /** + * Sets enabled + * + * @param bool|null $enabled Boolean flag indicating whether the integration is enabled or not. When updating experience's integrations, to disable an integration, this flag needs to be passed as **false**. If not passed, integration is assumed to be **enabled=true** + * + * @return self + */ + public function setEnabled($enabled) + { + if (is_null($enabled)) { + array_push($this->openAPINullablesSetToNull, 'enabled'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('enabled', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['enabled'] = $enabled; + + return $this; + } + + /** + * Gets provider + * + * @return \OpenAPI\Client\Model\IntegrationProvider + */ + public function getProvider() + { + return $this->container['provider']; + } + + /** + * Sets provider + * + * @param \OpenAPI\Client\Model\IntegrationProvider $provider provider + * + * @return self + */ + public function setProvider($provider) + { + if (is_null($provider)) { + throw new \InvalidArgumentException('non-nullable provider cannot be null'); + } + $this->container['provider'] = $provider; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type type + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets property_ua + * + * @return string|null + */ + public function getPropertyUa() + { + return $this->container['property_ua']; + } + + /** + * Sets property_ua + * + * @param string|null $property_ua Universal Analytics property to be used for tracking + * + * @return self + */ + public function setPropertyUa($property_ua) + { + if (is_null($property_ua)) { + array_push($this->openAPINullablesSetToNull, 'property_ua'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('property_ua', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($property_ua) && (mb_strlen($property_ua) > 150)) { + throw new \InvalidArgumentException('invalid length for $property_ua when calling ExperienceIntegrationGA3., must be smaller than or equal to 150.'); + } + + $this->container['property_ua'] = $property_ua; + + return $this; + } + + /** + * Gets custom_dimension + * + * @return string|null + */ + public function getCustomDimension() + { + return $this->container['custom_dimension']; + } + + /** + * Sets custom_dimension + * + * @param string|null $custom_dimension Custom dimension where experience data should be sent to. + * + * @return self + */ + public function setCustomDimension($custom_dimension) + { + if (is_null($custom_dimension)) { + throw new \InvalidArgumentException('non-nullable custom_dimension cannot be null'); + } + $this->container['custom_dimension'] = $custom_dimension; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/ExperienceIntegrationGA4.php b/packages/Types/lib/Generated/Model/ExperienceIntegrationGA4.php new file mode 100644 index 0000000..868104f --- /dev/null +++ b/packages/Types/lib/Generated/Model/ExperienceIntegrationGA4.php @@ -0,0 +1,621 @@ + + */ +class ExperienceIntegrationGA4 implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ExperienceIntegrationGA4'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'enabled' => 'bool', + 'provider' => '\OpenAPI\Client\Model\IntegrationProvider', + 'type' => 'string', + 'measurement_id' => 'string', + 'property_id' => 'string', + 'audiences' => 'array' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'enabled' => null, + 'provider' => null, + 'type' => null, + 'measurement_id' => null, + 'property_id' => null, + 'audiences' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'enabled' => true, + 'provider' => false, + 'type' => false, + 'measurement_id' => false, + 'property_id' => false, + 'audiences' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'enabled' => 'enabled', + 'provider' => 'provider', + 'type' => 'type', + 'measurement_id' => 'measurementId', + 'property_id' => 'propertyId', + 'audiences' => 'audiences' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'enabled' => 'setEnabled', + 'provider' => 'setProvider', + 'type' => 'setType', + 'measurement_id' => 'setMeasurementId', + 'property_id' => 'setPropertyId', + 'audiences' => 'setAudiences' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'enabled' => 'getEnabled', + 'provider' => 'getProvider', + 'type' => 'getType', + 'measurement_id' => 'getMeasurementId', + 'property_id' => 'getPropertyId', + 'audiences' => 'getAudiences' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_GA4 = 'ga4'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_GA4, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('enabled', $data ?? [], null); + $this->setIfExists('provider', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('measurement_id', $data ?? [], null); + $this->setIfExists('property_id', $data ?? [], null); + $this->setIfExists('audiences', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['provider'] === null) { + $invalidProperties[] = "'provider' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets enabled + * + * @return bool|null + */ + public function getEnabled() + { + return $this->container['enabled']; + } + + /** + * Sets enabled + * + * @param bool|null $enabled Boolean flag indicating whether the integration is enabled or not. When updating experience's integrations, to disable an integration, this flag needs to be passed as **false**. If not passed, integration is assumed to be **enabled=true** + * + * @return self + */ + public function setEnabled($enabled) + { + if (is_null($enabled)) { + array_push($this->openAPINullablesSetToNull, 'enabled'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('enabled', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['enabled'] = $enabled; + + return $this; + } + + /** + * Gets provider + * + * @return \OpenAPI\Client\Model\IntegrationProvider + */ + public function getProvider() + { + return $this->container['provider']; + } + + /** + * Sets provider + * + * @param \OpenAPI\Client\Model\IntegrationProvider $provider provider + * + * @return self + */ + public function setProvider($provider) + { + if (is_null($provider)) { + throw new \InvalidArgumentException('non-nullable provider cannot be null'); + } + $this->container['provider'] = $provider; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type type + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets measurement_id + * + * @return string|null + */ + public function getMeasurementId() + { + return $this->container['measurement_id']; + } + + /** + * Sets measurement_id + * + * @param string|null $measurement_id ID of the ga4 property where data will be sent. Used internally for API calls to GoogleAnalytics + * + * @return self + */ + public function setMeasurementId($measurement_id) + { + if (is_null($measurement_id)) { + throw new \InvalidArgumentException('non-nullable measurement_id cannot be null'); + } + $this->container['measurement_id'] = $measurement_id; + + return $this; + } + + /** + * Gets property_id + * + * @return string|null + */ + public function getPropertyId() + { + return $this->container['property_id']; + } + + /** + * Sets property_id + * + * @param string|null $property_id ID of the ga4 property where data will be sent. Used internally for API calls to GoogleAnalytics + * + * @return self + */ + public function setPropertyId($property_id) + { + if (is_null($property_id)) { + throw new \InvalidArgumentException('non-nullable property_id cannot be null'); + } + $this->container['property_id'] = $property_id; + + return $this; + } + + /** + * Gets audiences + * + * @return array|null + */ + public function getAudiences() + { + return $this->container['audiences']; + } + + /** + * Sets audiences + * + * @param array|null $audiences List of GA audiences created for each of this experience's variations + * + * @return self + */ + public function setAudiences($audiences) + { + if (is_null($audiences)) { + throw new \InvalidArgumentException('non-nullable audiences cannot be null'); + } + $this->container['audiences'] = $audiences; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/ExperienceIntegrationGA4Base.php b/packages/Types/lib/Generated/Model/ExperienceIntegrationGA4Base.php new file mode 100644 index 0000000..e5abb3a --- /dev/null +++ b/packages/Types/lib/Generated/Model/ExperienceIntegrationGA4Base.php @@ -0,0 +1,553 @@ + + */ +class ExperienceIntegrationGA4Base implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ExperienceIntegrationGA4Base'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'enabled' => 'bool', + 'provider' => '\OpenAPI\Client\Model\IntegrationProvider', + 'type' => 'string', + 'measurement_id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'enabled' => null, + 'provider' => null, + 'type' => null, + 'measurement_id' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'enabled' => true, + 'provider' => false, + 'type' => false, + 'measurement_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'enabled' => 'enabled', + 'provider' => 'provider', + 'type' => 'type', + 'measurement_id' => 'measurementId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'enabled' => 'setEnabled', + 'provider' => 'setProvider', + 'type' => 'setType', + 'measurement_id' => 'setMeasurementId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'enabled' => 'getEnabled', + 'provider' => 'getProvider', + 'type' => 'getType', + 'measurement_id' => 'getMeasurementId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_GA4 = 'ga4'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_GA4, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('enabled', $data ?? [], null); + $this->setIfExists('provider', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('measurement_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['provider'] === null) { + $invalidProperties[] = "'provider' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets enabled + * + * @return bool|null + */ + public function getEnabled() + { + return $this->container['enabled']; + } + + /** + * Sets enabled + * + * @param bool|null $enabled Boolean flag indicating whether the integration is enabled or not. When updating experience's integrations, to disable an integration, this flag needs to be passed as **false**. If not passed, integration is assumed to be **enabled=true** + * + * @return self + */ + public function setEnabled($enabled) + { + if (is_null($enabled)) { + array_push($this->openAPINullablesSetToNull, 'enabled'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('enabled', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['enabled'] = $enabled; + + return $this; + } + + /** + * Gets provider + * + * @return \OpenAPI\Client\Model\IntegrationProvider + */ + public function getProvider() + { + return $this->container['provider']; + } + + /** + * Sets provider + * + * @param \OpenAPI\Client\Model\IntegrationProvider $provider provider + * + * @return self + */ + public function setProvider($provider) + { + if (is_null($provider)) { + throw new \InvalidArgumentException('non-nullable provider cannot be null'); + } + $this->container['provider'] = $provider; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type type + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets measurement_id + * + * @return string|null + */ + public function getMeasurementId() + { + return $this->container['measurement_id']; + } + + /** + * Sets measurement_id + * + * @param string|null $measurement_id ID of the ga4 property where data will be sent. Used internally for API calls to GoogleAnalytics + * + * @return self + */ + public function setMeasurementId($measurement_id) + { + if (is_null($measurement_id)) { + throw new \InvalidArgumentException('non-nullable measurement_id cannot be null'); + } + $this->container['measurement_id'] = $measurement_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/ExperienceIntegrationGAServing.php b/packages/Types/lib/Generated/Model/ExperienceIntegrationGAServing.php new file mode 100644 index 0000000..b143599 --- /dev/null +++ b/packages/Types/lib/Generated/Model/ExperienceIntegrationGAServing.php @@ -0,0 +1,641 @@ + + */ +class ExperienceIntegrationGAServing implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = 'type'; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ExperienceIntegrationGAServing'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'enabled' => 'bool', + 'provider' => '\OpenAPI\Client\Model\IntegrationProvider', + 'type' => 'string', + 'property_ua' => 'string', + 'custom_dimension' => 'string', + 'measurement_id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'enabled' => null, + 'provider' => null, + 'type' => null, + 'property_ua' => null, + 'custom_dimension' => null, + 'measurement_id' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'enabled' => true, + 'provider' => false, + 'type' => false, + 'property_ua' => true, + 'custom_dimension' => false, + 'measurement_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'enabled' => 'enabled', + 'provider' => 'provider', + 'type' => 'type', + 'property_ua' => 'property_UA', + 'custom_dimension' => 'custom_dimension', + 'measurement_id' => 'measurementId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'enabled' => 'setEnabled', + 'provider' => 'setProvider', + 'type' => 'setType', + 'property_ua' => 'setPropertyUa', + 'custom_dimension' => 'setCustomDimension', + 'measurement_id' => 'setMeasurementId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'enabled' => 'getEnabled', + 'provider' => 'getProvider', + 'type' => 'getType', + 'property_ua' => 'getPropertyUa', + 'custom_dimension' => 'getCustomDimension', + 'measurement_id' => 'getMeasurementId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_GA3 = 'ga3'; + public const TYPE_GA4 = 'ga4'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_GA3, + self::TYPE_GA4, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('enabled', $data ?? [], null); + $this->setIfExists('provider', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('property_ua', $data ?? [], null); + $this->setIfExists('custom_dimension', $data ?? [], null); + $this->setIfExists('measurement_id', $data ?? [], null); + + // Initialize discriminator property with the model name. + $this->container['type'] = static::$openAPIModelName; + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['provider'] === null) { + $invalidProperties[] = "'provider' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + if (!is_null($this->container['property_ua']) && (mb_strlen($this->container['property_ua']) > 150)) { + $invalidProperties[] = "invalid value for 'property_ua', the character length must be smaller than or equal to 150."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets enabled + * + * @return bool|null + */ + public function getEnabled() + { + return $this->container['enabled']; + } + + /** + * Sets enabled + * + * @param bool|null $enabled Boolean flag indicating whether the integration is enabled or not. When updating experience's integrations, to disable an integration, this flag needs to be passed as **false**. If not passed, integration is assumed to be **enabled=true** + * + * @return self + */ + public function setEnabled($enabled) + { + if (is_null($enabled)) { + array_push($this->openAPINullablesSetToNull, 'enabled'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('enabled', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['enabled'] = $enabled; + + return $this; + } + + /** + * Gets provider + * + * @return \OpenAPI\Client\Model\IntegrationProvider + */ + public function getProvider() + { + return $this->container['provider']; + } + + /** + * Sets provider + * + * @param \OpenAPI\Client\Model\IntegrationProvider $provider provider + * + * @return self + */ + public function setProvider($provider) + { + if (is_null($provider)) { + throw new \InvalidArgumentException('non-nullable provider cannot be null'); + } + $this->container['provider'] = $provider; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type type + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets property_ua + * + * @return string|null + */ + public function getPropertyUa() + { + return $this->container['property_ua']; + } + + /** + * Sets property_ua + * + * @param string|null $property_ua Universal Analytics property to be used for tracking + * + * @return self + */ + public function setPropertyUa($property_ua) + { + if (is_null($property_ua)) { + array_push($this->openAPINullablesSetToNull, 'property_ua'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('property_ua', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($property_ua) && (mb_strlen($property_ua) > 150)) { + throw new \InvalidArgumentException('invalid length for $property_ua when calling ExperienceIntegrationGAServing., must be smaller than or equal to 150.'); + } + + $this->container['property_ua'] = $property_ua; + + return $this; + } + + /** + * Gets custom_dimension + * + * @return string|null + */ + public function getCustomDimension() + { + return $this->container['custom_dimension']; + } + + /** + * Sets custom_dimension + * + * @param string|null $custom_dimension Custom dimension where experience data should be sent to. + * + * @return self + */ + public function setCustomDimension($custom_dimension) + { + if (is_null($custom_dimension)) { + throw new \InvalidArgumentException('non-nullable custom_dimension cannot be null'); + } + $this->container['custom_dimension'] = $custom_dimension; + + return $this; + } + + /** + * Gets measurement_id + * + * @return string|null + */ + public function getMeasurementId() + { + return $this->container['measurement_id']; + } + + /** + * Sets measurement_id + * + * @param string|null $measurement_id ID of the ga4 property where data will be sent. Used internally for API calls to GoogleAnalytics + * + * @return self + */ + public function setMeasurementId($measurement_id) + { + if (is_null($measurement_id)) { + throw new \InvalidArgumentException('non-nullable measurement_id cannot be null'); + } + $this->container['measurement_id'] = $measurement_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/ExperienceIntegrationGoogleAnalytics.php b/packages/Types/lib/Generated/Model/ExperienceIntegrationGoogleAnalytics.php new file mode 100644 index 0000000..1ca60e9 --- /dev/null +++ b/packages/Types/lib/Generated/Model/ExperienceIntegrationGoogleAnalytics.php @@ -0,0 +1,709 @@ + + */ +class ExperienceIntegrationGoogleAnalytics implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = 'type'; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ExperienceIntegrationGoogleAnalytics'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'enabled' => 'bool', + 'provider' => '\OpenAPI\Client\Model\IntegrationProvider', + 'type' => 'string', + 'property_ua' => 'string', + 'custom_dimension' => 'string', + 'measurement_id' => 'string', + 'property_id' => 'string', + 'audiences' => 'array' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'enabled' => null, + 'provider' => null, + 'type' => null, + 'property_ua' => null, + 'custom_dimension' => null, + 'measurement_id' => null, + 'property_id' => null, + 'audiences' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'enabled' => true, + 'provider' => false, + 'type' => false, + 'property_ua' => true, + 'custom_dimension' => false, + 'measurement_id' => false, + 'property_id' => false, + 'audiences' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'enabled' => 'enabled', + 'provider' => 'provider', + 'type' => 'type', + 'property_ua' => 'property_UA', + 'custom_dimension' => 'custom_dimension', + 'measurement_id' => 'measurementId', + 'property_id' => 'propertyId', + 'audiences' => 'audiences' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'enabled' => 'setEnabled', + 'provider' => 'setProvider', + 'type' => 'setType', + 'property_ua' => 'setPropertyUa', + 'custom_dimension' => 'setCustomDimension', + 'measurement_id' => 'setMeasurementId', + 'property_id' => 'setPropertyId', + 'audiences' => 'setAudiences' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'enabled' => 'getEnabled', + 'provider' => 'getProvider', + 'type' => 'getType', + 'property_ua' => 'getPropertyUa', + 'custom_dimension' => 'getCustomDimension', + 'measurement_id' => 'getMeasurementId', + 'property_id' => 'getPropertyId', + 'audiences' => 'getAudiences' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_GA3 = 'ga3'; + public const TYPE_GA4 = 'ga4'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_GA3, + self::TYPE_GA4, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('enabled', $data ?? [], null); + $this->setIfExists('provider', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('property_ua', $data ?? [], null); + $this->setIfExists('custom_dimension', $data ?? [], null); + $this->setIfExists('measurement_id', $data ?? [], null); + $this->setIfExists('property_id', $data ?? [], null); + $this->setIfExists('audiences', $data ?? [], null); + + // Initialize discriminator property with the model name. + $this->container['type'] = static::$openAPIModelName; + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['provider'] === null) { + $invalidProperties[] = "'provider' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + if (!is_null($this->container['property_ua']) && (mb_strlen($this->container['property_ua']) > 150)) { + $invalidProperties[] = "invalid value for 'property_ua', the character length must be smaller than or equal to 150."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets enabled + * + * @return bool|null + */ + public function getEnabled() + { + return $this->container['enabled']; + } + + /** + * Sets enabled + * + * @param bool|null $enabled Boolean flag indicating whether the integration is enabled or not. When updating experience's integrations, to disable an integration, this flag needs to be passed as **false**. If not passed, integration is assumed to be **enabled=true** + * + * @return self + */ + public function setEnabled($enabled) + { + if (is_null($enabled)) { + array_push($this->openAPINullablesSetToNull, 'enabled'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('enabled', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['enabled'] = $enabled; + + return $this; + } + + /** + * Gets provider + * + * @return \OpenAPI\Client\Model\IntegrationProvider + */ + public function getProvider() + { + return $this->container['provider']; + } + + /** + * Sets provider + * + * @param \OpenAPI\Client\Model\IntegrationProvider $provider provider + * + * @return self + */ + public function setProvider($provider) + { + if (is_null($provider)) { + throw new \InvalidArgumentException('non-nullable provider cannot be null'); + } + $this->container['provider'] = $provider; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type type + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets property_ua + * + * @return string|null + */ + public function getPropertyUa() + { + return $this->container['property_ua']; + } + + /** + * Sets property_ua + * + * @param string|null $property_ua Universal Analytics property to be used for tracking + * + * @return self + */ + public function setPropertyUa($property_ua) + { + if (is_null($property_ua)) { + array_push($this->openAPINullablesSetToNull, 'property_ua'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('property_ua', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($property_ua) && (mb_strlen($property_ua) > 150)) { + throw new \InvalidArgumentException('invalid length for $property_ua when calling ExperienceIntegrationGoogleAnalytics., must be smaller than or equal to 150.'); + } + + $this->container['property_ua'] = $property_ua; + + return $this; + } + + /** + * Gets custom_dimension + * + * @return string|null + */ + public function getCustomDimension() + { + return $this->container['custom_dimension']; + } + + /** + * Sets custom_dimension + * + * @param string|null $custom_dimension Custom dimension where experience data should be sent to. + * + * @return self + */ + public function setCustomDimension($custom_dimension) + { + if (is_null($custom_dimension)) { + throw new \InvalidArgumentException('non-nullable custom_dimension cannot be null'); + } + $this->container['custom_dimension'] = $custom_dimension; + + return $this; + } + + /** + * Gets measurement_id + * + * @return string|null + */ + public function getMeasurementId() + { + return $this->container['measurement_id']; + } + + /** + * Sets measurement_id + * + * @param string|null $measurement_id ID of the ga4 property where data will be sent. Used internally for API calls to GoogleAnalytics + * + * @return self + */ + public function setMeasurementId($measurement_id) + { + if (is_null($measurement_id)) { + throw new \InvalidArgumentException('non-nullable measurement_id cannot be null'); + } + $this->container['measurement_id'] = $measurement_id; + + return $this; + } + + /** + * Gets property_id + * + * @return string|null + */ + public function getPropertyId() + { + return $this->container['property_id']; + } + + /** + * Sets property_id + * + * @param string|null $property_id ID of the ga4 property where data will be sent. Used internally for API calls to GoogleAnalytics + * + * @return self + */ + public function setPropertyId($property_id) + { + if (is_null($property_id)) { + throw new \InvalidArgumentException('non-nullable property_id cannot be null'); + } + $this->container['property_id'] = $property_id; + + return $this; + } + + /** + * Gets audiences + * + * @return array|null + */ + public function getAudiences() + { + return $this->container['audiences']; + } + + /** + * Sets audiences + * + * @param array|null $audiences List of GA audiences created for each of this experience's variations + * + * @return self + */ + public function setAudiences($audiences) + { + if (is_null($audiences)) { + throw new \InvalidArgumentException('non-nullable audiences cannot be null'); + } + $this->container['audiences'] = $audiences; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/ExperienceIntegrationGosquared.php b/packages/Types/lib/Generated/Model/ExperienceIntegrationGosquared.php new file mode 100644 index 0000000..7ee5613 --- /dev/null +++ b/packages/Types/lib/Generated/Model/ExperienceIntegrationGosquared.php @@ -0,0 +1,453 @@ + + */ +class ExperienceIntegrationGosquared implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ExperienceIntegrationGosquared'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'provider' => '\OpenAPI\Client\Model\IntegrationProvider', + 'enabled' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'provider' => null, + 'enabled' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'provider' => false, + 'enabled' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'provider' => 'provider', + 'enabled' => 'enabled' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'provider' => 'setProvider', + 'enabled' => 'setEnabled' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'provider' => 'getProvider', + 'enabled' => 'getEnabled' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('provider', $data ?? [], null); + $this->setIfExists('enabled', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['provider'] === null) { + $invalidProperties[] = "'provider' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets provider + * + * @return \OpenAPI\Client\Model\IntegrationProvider + */ + public function getProvider() + { + return $this->container['provider']; + } + + /** + * Sets provider + * + * @param \OpenAPI\Client\Model\IntegrationProvider $provider provider + * + * @return self + */ + public function setProvider($provider) + { + if (is_null($provider)) { + throw new \InvalidArgumentException('non-nullable provider cannot be null'); + } + $this->container['provider'] = $provider; + + return $this; + } + + /** + * Gets enabled + * + * @return bool|null + */ + public function getEnabled() + { + return $this->container['enabled']; + } + + /** + * Sets enabled + * + * @param bool|null $enabled Boolean flag indicating whether the integration is enabled or not. When updating experience's integrations, to disable an integration, this flag needs to be passed as **false**. If not passed, integration is assumed to be **enabled=true** + * + * @return self + */ + public function setEnabled($enabled) + { + if (is_null($enabled)) { + array_push($this->openAPINullablesSetToNull, 'enabled'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('enabled', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['enabled'] = $enabled; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/ExperienceIntegrationHeapanalytics.php b/packages/Types/lib/Generated/Model/ExperienceIntegrationHeapanalytics.php new file mode 100644 index 0000000..bb45727 --- /dev/null +++ b/packages/Types/lib/Generated/Model/ExperienceIntegrationHeapanalytics.php @@ -0,0 +1,453 @@ + + */ +class ExperienceIntegrationHeapanalytics implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ExperienceIntegrationHeapanalytics'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'provider' => '\OpenAPI\Client\Model\IntegrationProvider', + 'enabled' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'provider' => null, + 'enabled' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'provider' => false, + 'enabled' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'provider' => 'provider', + 'enabled' => 'enabled' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'provider' => 'setProvider', + 'enabled' => 'setEnabled' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'provider' => 'getProvider', + 'enabled' => 'getEnabled' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('provider', $data ?? [], null); + $this->setIfExists('enabled', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['provider'] === null) { + $invalidProperties[] = "'provider' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets provider + * + * @return \OpenAPI\Client\Model\IntegrationProvider + */ + public function getProvider() + { + return $this->container['provider']; + } + + /** + * Sets provider + * + * @param \OpenAPI\Client\Model\IntegrationProvider $provider provider + * + * @return self + */ + public function setProvider($provider) + { + if (is_null($provider)) { + throw new \InvalidArgumentException('non-nullable provider cannot be null'); + } + $this->container['provider'] = $provider; + + return $this; + } + + /** + * Gets enabled + * + * @return bool|null + */ + public function getEnabled() + { + return $this->container['enabled']; + } + + /** + * Sets enabled + * + * @param bool|null $enabled Boolean flag indicating whether the integration is enabled or not. When updating experience's integrations, to disable an integration, this flag needs to be passed as **false**. If not passed, integration is assumed to be **enabled=true** + * + * @return self + */ + public function setEnabled($enabled) + { + if (is_null($enabled)) { + array_push($this->openAPINullablesSetToNull, 'enabled'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('enabled', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['enabled'] = $enabled; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/ExperienceIntegrationHotjar.php b/packages/Types/lib/Generated/Model/ExperienceIntegrationHotjar.php new file mode 100644 index 0000000..23f2983 --- /dev/null +++ b/packages/Types/lib/Generated/Model/ExperienceIntegrationHotjar.php @@ -0,0 +1,453 @@ + + */ +class ExperienceIntegrationHotjar implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ExperienceIntegrationHotjar'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'provider' => '\OpenAPI\Client\Model\IntegrationProvider', + 'enabled' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'provider' => null, + 'enabled' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'provider' => false, + 'enabled' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'provider' => 'provider', + 'enabled' => 'enabled' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'provider' => 'setProvider', + 'enabled' => 'setEnabled' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'provider' => 'getProvider', + 'enabled' => 'getEnabled' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('provider', $data ?? [], null); + $this->setIfExists('enabled', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['provider'] === null) { + $invalidProperties[] = "'provider' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets provider + * + * @return \OpenAPI\Client\Model\IntegrationProvider + */ + public function getProvider() + { + return $this->container['provider']; + } + + /** + * Sets provider + * + * @param \OpenAPI\Client\Model\IntegrationProvider $provider provider + * + * @return self + */ + public function setProvider($provider) + { + if (is_null($provider)) { + throw new \InvalidArgumentException('non-nullable provider cannot be null'); + } + $this->container['provider'] = $provider; + + return $this; + } + + /** + * Gets enabled + * + * @return bool|null + */ + public function getEnabled() + { + return $this->container['enabled']; + } + + /** + * Sets enabled + * + * @param bool|null $enabled Boolean flag indicating whether the integration is enabled or not. When updating experience's integrations, to disable an integration, this flag needs to be passed as **false**. If not passed, integration is assumed to be **enabled=true** + * + * @return self + */ + public function setEnabled($enabled) + { + if (is_null($enabled)) { + array_push($this->openAPINullablesSetToNull, 'enabled'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('enabled', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['enabled'] = $enabled; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/ExperienceIntegrationMixpanel.php b/packages/Types/lib/Generated/Model/ExperienceIntegrationMixpanel.php new file mode 100644 index 0000000..007ac70 --- /dev/null +++ b/packages/Types/lib/Generated/Model/ExperienceIntegrationMixpanel.php @@ -0,0 +1,453 @@ + + */ +class ExperienceIntegrationMixpanel implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ExperienceIntegrationMixpanel'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'provider' => '\OpenAPI\Client\Model\IntegrationProvider', + 'enabled' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'provider' => null, + 'enabled' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'provider' => false, + 'enabled' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'provider' => 'provider', + 'enabled' => 'enabled' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'provider' => 'setProvider', + 'enabled' => 'setEnabled' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'provider' => 'getProvider', + 'enabled' => 'getEnabled' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('provider', $data ?? [], null); + $this->setIfExists('enabled', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['provider'] === null) { + $invalidProperties[] = "'provider' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets provider + * + * @return \OpenAPI\Client\Model\IntegrationProvider + */ + public function getProvider() + { + return $this->container['provider']; + } + + /** + * Sets provider + * + * @param \OpenAPI\Client\Model\IntegrationProvider $provider provider + * + * @return self + */ + public function setProvider($provider) + { + if (is_null($provider)) { + throw new \InvalidArgumentException('non-nullable provider cannot be null'); + } + $this->container['provider'] = $provider; + + return $this; + } + + /** + * Gets enabled + * + * @return bool|null + */ + public function getEnabled() + { + return $this->container['enabled']; + } + + /** + * Sets enabled + * + * @param bool|null $enabled Boolean flag indicating whether the integration is enabled or not. When updating experience's integrations, to disable an integration, this flag needs to be passed as **false**. If not passed, integration is assumed to be **enabled=true** + * + * @return self + */ + public function setEnabled($enabled) + { + if (is_null($enabled)) { + array_push($this->openAPINullablesSetToNull, 'enabled'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('enabled', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['enabled'] = $enabled; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/ExperienceIntegrationMouseflow.php b/packages/Types/lib/Generated/Model/ExperienceIntegrationMouseflow.php new file mode 100644 index 0000000..9ef793c --- /dev/null +++ b/packages/Types/lib/Generated/Model/ExperienceIntegrationMouseflow.php @@ -0,0 +1,453 @@ + + */ +class ExperienceIntegrationMouseflow implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ExperienceIntegrationMouseflow'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'provider' => '\OpenAPI\Client\Model\IntegrationProvider', + 'enabled' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'provider' => null, + 'enabled' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'provider' => false, + 'enabled' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'provider' => 'provider', + 'enabled' => 'enabled' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'provider' => 'setProvider', + 'enabled' => 'setEnabled' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'provider' => 'getProvider', + 'enabled' => 'getEnabled' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('provider', $data ?? [], null); + $this->setIfExists('enabled', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['provider'] === null) { + $invalidProperties[] = "'provider' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets provider + * + * @return \OpenAPI\Client\Model\IntegrationProvider + */ + public function getProvider() + { + return $this->container['provider']; + } + + /** + * Sets provider + * + * @param \OpenAPI\Client\Model\IntegrationProvider $provider provider + * + * @return self + */ + public function setProvider($provider) + { + if (is_null($provider)) { + throw new \InvalidArgumentException('non-nullable provider cannot be null'); + } + $this->container['provider'] = $provider; + + return $this; + } + + /** + * Gets enabled + * + * @return bool|null + */ + public function getEnabled() + { + return $this->container['enabled']; + } + + /** + * Sets enabled + * + * @param bool|null $enabled Boolean flag indicating whether the integration is enabled or not. When updating experience's integrations, to disable an integration, this flag needs to be passed as **false**. If not passed, integration is assumed to be **enabled=true** + * + * @return self + */ + public function setEnabled($enabled) + { + if (is_null($enabled)) { + array_push($this->openAPINullablesSetToNull, 'enabled'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('enabled', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['enabled'] = $enabled; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/ExperienceIntegrationPiwik.php b/packages/Types/lib/Generated/Model/ExperienceIntegrationPiwik.php new file mode 100644 index 0000000..0e75d3a --- /dev/null +++ b/packages/Types/lib/Generated/Model/ExperienceIntegrationPiwik.php @@ -0,0 +1,490 @@ + + */ +class ExperienceIntegrationPiwik implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ExperienceIntegrationPiwik'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'provider' => '\OpenAPI\Client\Model\IntegrationProvider', + 'enabled' => 'bool', + 'custom_dimension' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'provider' => null, + 'enabled' => null, + 'custom_dimension' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'provider' => false, + 'enabled' => true, + 'custom_dimension' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'provider' => 'provider', + 'enabled' => 'enabled', + 'custom_dimension' => 'custom_dimension' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'provider' => 'setProvider', + 'enabled' => 'setEnabled', + 'custom_dimension' => 'setCustomDimension' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'provider' => 'getProvider', + 'enabled' => 'getEnabled', + 'custom_dimension' => 'getCustomDimension' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('provider', $data ?? [], null); + $this->setIfExists('enabled', $data ?? [], null); + $this->setIfExists('custom_dimension', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['provider'] === null) { + $invalidProperties[] = "'provider' can't be null"; + } + if ($this->container['custom_dimension'] === null) { + $invalidProperties[] = "'custom_dimension' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets provider + * + * @return \OpenAPI\Client\Model\IntegrationProvider + */ + public function getProvider() + { + return $this->container['provider']; + } + + /** + * Sets provider + * + * @param \OpenAPI\Client\Model\IntegrationProvider $provider provider + * + * @return self + */ + public function setProvider($provider) + { + if (is_null($provider)) { + throw new \InvalidArgumentException('non-nullable provider cannot be null'); + } + $this->container['provider'] = $provider; + + return $this; + } + + /** + * Gets enabled + * + * @return bool|null + */ + public function getEnabled() + { + return $this->container['enabled']; + } + + /** + * Sets enabled + * + * @param bool|null $enabled Boolean flag indicating whether the integration is enabled or not. When updating experience's integrations, to disable an integration, this flag needs to be passed as **false**. If not passed, integration is assumed to be **enabled=true** + * + * @return self + */ + public function setEnabled($enabled) + { + if (is_null($enabled)) { + array_push($this->openAPINullablesSetToNull, 'enabled'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('enabled', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['enabled'] = $enabled; + + return $this; + } + + /** + * Gets custom_dimension + * + * @return string + */ + public function getCustomDimension() + { + return $this->container['custom_dimension']; + } + + /** + * Sets custom_dimension + * + * @param string $custom_dimension Custom dimension where experience data should be sent to. + * + * @return self + */ + public function setCustomDimension($custom_dimension) + { + if (is_null($custom_dimension)) { + throw new \InvalidArgumentException('non-nullable custom_dimension cannot be null'); + } + $this->container['custom_dimension'] = $custom_dimension; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/ExperienceIntegrationSegmentio.php b/packages/Types/lib/Generated/Model/ExperienceIntegrationSegmentio.php new file mode 100644 index 0000000..f22ef77 --- /dev/null +++ b/packages/Types/lib/Generated/Model/ExperienceIntegrationSegmentio.php @@ -0,0 +1,453 @@ + + */ +class ExperienceIntegrationSegmentio implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ExperienceIntegrationSegmentio'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'provider' => '\OpenAPI\Client\Model\IntegrationProvider', + 'enabled' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'provider' => null, + 'enabled' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'provider' => false, + 'enabled' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'provider' => 'provider', + 'enabled' => 'enabled' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'provider' => 'setProvider', + 'enabled' => 'setEnabled' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'provider' => 'getProvider', + 'enabled' => 'getEnabled' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('provider', $data ?? [], null); + $this->setIfExists('enabled', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['provider'] === null) { + $invalidProperties[] = "'provider' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets provider + * + * @return \OpenAPI\Client\Model\IntegrationProvider + */ + public function getProvider() + { + return $this->container['provider']; + } + + /** + * Sets provider + * + * @param \OpenAPI\Client\Model\IntegrationProvider $provider provider + * + * @return self + */ + public function setProvider($provider) + { + if (is_null($provider)) { + throw new \InvalidArgumentException('non-nullable provider cannot be null'); + } + $this->container['provider'] = $provider; + + return $this; + } + + /** + * Gets enabled + * + * @return bool|null + */ + public function getEnabled() + { + return $this->container['enabled']; + } + + /** + * Sets enabled + * + * @param bool|null $enabled Boolean flag indicating whether the integration is enabled or not. When updating experience's integrations, to disable an integration, this flag needs to be passed as **false**. If not passed, integration is assumed to be **enabled=true** + * + * @return self + */ + public function setEnabled($enabled) + { + if (is_null($enabled)) { + array_push($this->openAPINullablesSetToNull, 'enabled'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('enabled', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['enabled'] = $enabled; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/ExperienceIntegrationSitecatalyst.php b/packages/Types/lib/Generated/Model/ExperienceIntegrationSitecatalyst.php new file mode 100644 index 0000000..de4ba69 --- /dev/null +++ b/packages/Types/lib/Generated/Model/ExperienceIntegrationSitecatalyst.php @@ -0,0 +1,490 @@ + + */ +class ExperienceIntegrationSitecatalyst implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ExperienceIntegrationSitecatalyst'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'provider' => '\OpenAPI\Client\Model\IntegrationProvider', + 'enabled' => 'bool', + 'evar' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'provider' => null, + 'enabled' => null, + 'evar' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'provider' => false, + 'enabled' => true, + 'evar' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'provider' => 'provider', + 'enabled' => 'enabled', + 'evar' => 'evar' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'provider' => 'setProvider', + 'enabled' => 'setEnabled', + 'evar' => 'setEvar' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'provider' => 'getProvider', + 'enabled' => 'getEnabled', + 'evar' => 'getEvar' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('provider', $data ?? [], null); + $this->setIfExists('enabled', $data ?? [], null); + $this->setIfExists('evar', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['provider'] === null) { + $invalidProperties[] = "'provider' can't be null"; + } + if ($this->container['evar'] === null) { + $invalidProperties[] = "'evar' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets provider + * + * @return \OpenAPI\Client\Model\IntegrationProvider + */ + public function getProvider() + { + return $this->container['provider']; + } + + /** + * Sets provider + * + * @param \OpenAPI\Client\Model\IntegrationProvider $provider provider + * + * @return self + */ + public function setProvider($provider) + { + if (is_null($provider)) { + throw new \InvalidArgumentException('non-nullable provider cannot be null'); + } + $this->container['provider'] = $provider; + + return $this; + } + + /** + * Gets enabled + * + * @return bool|null + */ + public function getEnabled() + { + return $this->container['enabled']; + } + + /** + * Sets enabled + * + * @param bool|null $enabled Boolean flag indicating whether the integration is enabled or not. When updating experience's integrations, to disable an integration, this flag needs to be passed as **false**. If not passed, integration is assumed to be **enabled=true** + * + * @return self + */ + public function setEnabled($enabled) + { + if (is_null($enabled)) { + array_push($this->openAPINullablesSetToNull, 'enabled'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('enabled', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['enabled'] = $enabled; + + return $this; + } + + /** + * Gets evar + * + * @return string + */ + public function getEvar() + { + return $this->container['evar']; + } + + /** + * Sets evar + * + * @param string $evar Custom dimension where experience data should be sent to. + * + * @return self + */ + public function setEvar($evar) + { + if (is_null($evar)) { + throw new \InvalidArgumentException('non-nullable evar cannot be null'); + } + $this->container['evar'] = $evar; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/ExperienceIntegrationWoopra.php b/packages/Types/lib/Generated/Model/ExperienceIntegrationWoopra.php new file mode 100644 index 0000000..8c18ecc --- /dev/null +++ b/packages/Types/lib/Generated/Model/ExperienceIntegrationWoopra.php @@ -0,0 +1,453 @@ + + */ +class ExperienceIntegrationWoopra implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ExperienceIntegrationWoopra'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'provider' => '\OpenAPI\Client\Model\IntegrationProvider', + 'enabled' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'provider' => null, + 'enabled' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'provider' => false, + 'enabled' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'provider' => 'provider', + 'enabled' => 'enabled' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'provider' => 'setProvider', + 'enabled' => 'setEnabled' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'provider' => 'getProvider', + 'enabled' => 'getEnabled' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('provider', $data ?? [], null); + $this->setIfExists('enabled', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['provider'] === null) { + $invalidProperties[] = "'provider' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets provider + * + * @return \OpenAPI\Client\Model\IntegrationProvider + */ + public function getProvider() + { + return $this->container['provider']; + } + + /** + * Sets provider + * + * @param \OpenAPI\Client\Model\IntegrationProvider $provider provider + * + * @return self + */ + public function setProvider($provider) + { + if (is_null($provider)) { + throw new \InvalidArgumentException('non-nullable provider cannot be null'); + } + $this->container['provider'] = $provider; + + return $this; + } + + /** + * Gets enabled + * + * @return bool|null + */ + public function getEnabled() + { + return $this->container['enabled']; + } + + /** + * Sets enabled + * + * @param bool|null $enabled Boolean flag indicating whether the integration is enabled or not. When updating experience's integrations, to disable an integration, this flag needs to be passed as **false**. If not passed, integration is assumed to be **enabled=true** + * + * @return self + */ + public function setEnabled($enabled) + { + if (is_null($enabled)) { + array_push($this->openAPINullablesSetToNull, 'enabled'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('enabled', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['enabled'] = $enabled; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/ExperienceIntegrationYsance.php b/packages/Types/lib/Generated/Model/ExperienceIntegrationYsance.php new file mode 100644 index 0000000..246b447 --- /dev/null +++ b/packages/Types/lib/Generated/Model/ExperienceIntegrationYsance.php @@ -0,0 +1,490 @@ + + */ +class ExperienceIntegrationYsance implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ExperienceIntegrationYsance'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'provider' => '\OpenAPI\Client\Model\IntegrationProvider', + 'enabled' => 'bool', + 'custom_dimension' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'provider' => null, + 'enabled' => null, + 'custom_dimension' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'provider' => false, + 'enabled' => true, + 'custom_dimension' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'provider' => 'provider', + 'enabled' => 'enabled', + 'custom_dimension' => 'custom_dimension' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'provider' => 'setProvider', + 'enabled' => 'setEnabled', + 'custom_dimension' => 'setCustomDimension' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'provider' => 'getProvider', + 'enabled' => 'getEnabled', + 'custom_dimension' => 'getCustomDimension' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('provider', $data ?? [], null); + $this->setIfExists('enabled', $data ?? [], null); + $this->setIfExists('custom_dimension', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['provider'] === null) { + $invalidProperties[] = "'provider' can't be null"; + } + if ($this->container['custom_dimension'] === null) { + $invalidProperties[] = "'custom_dimension' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets provider + * + * @return \OpenAPI\Client\Model\IntegrationProvider + */ + public function getProvider() + { + return $this->container['provider']; + } + + /** + * Sets provider + * + * @param \OpenAPI\Client\Model\IntegrationProvider $provider provider + * + * @return self + */ + public function setProvider($provider) + { + if (is_null($provider)) { + throw new \InvalidArgumentException('non-nullable provider cannot be null'); + } + $this->container['provider'] = $provider; + + return $this; + } + + /** + * Gets enabled + * + * @return bool|null + */ + public function getEnabled() + { + return $this->container['enabled']; + } + + /** + * Sets enabled + * + * @param bool|null $enabled Boolean flag indicating whether the integration is enabled or not. When updating experience's integrations, to disable an integration, this flag needs to be passed as **false**. If not passed, integration is assumed to be **enabled=true** + * + * @return self + */ + public function setEnabled($enabled) + { + if (is_null($enabled)) { + array_push($this->openAPINullablesSetToNull, 'enabled'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('enabled', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['enabled'] = $enabled; + + return $this; + } + + /** + * Gets custom_dimension + * + * @return string + */ + public function getCustomDimension() + { + return $this->container['custom_dimension']; + } + + /** + * Sets custom_dimension + * + * @param string $custom_dimension Custom dimension where experience data should be sent to. + * + * @return self + */ + public function setCustomDimension($custom_dimension) + { + if (is_null($custom_dimension)) { + throw new \InvalidArgumentException('non-nullable custom_dimension cannot be null'); + } + $this->container['custom_dimension'] = $custom_dimension; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/ExperienceStatuses.php b/packages/Types/lib/Generated/Model/ExperienceStatuses.php new file mode 100644 index 0000000..2563e3f --- /dev/null +++ b/packages/Types/lib/Generated/Model/ExperienceStatuses.php @@ -0,0 +1,71 @@ + + */ +class ExperienceVariationConfig implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ExperienceVariationConfig'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'string', + 'name' => 'string', + 'key' => 'string', + 'traffic_allocation' => 'float', + 'status' => '\OpenAPI\Client\Model\VariationStatuses', + 'changes' => '\OpenAPI\Client\Model\ExperienceChange[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'name' => null, + 'key' => null, + 'traffic_allocation' => null, + 'status' => null, + 'changes' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'name' => false, + 'key' => false, + 'traffic_allocation' => false, + 'status' => false, + 'changes' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'name' => 'name', + 'key' => 'key', + 'traffic_allocation' => 'traffic_allocation', + 'status' => 'status', + 'changes' => 'changes' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'name' => 'setName', + 'key' => 'setKey', + 'traffic_allocation' => 'setTrafficAllocation', + 'status' => 'setStatus', + 'changes' => 'setChanges' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'name' => 'getName', + 'key' => 'getKey', + 'traffic_allocation' => 'getTrafficAllocation', + 'status' => 'getStatus', + 'changes' => 'getChanges' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('key', $data ?? [], null); + $this->setIfExists('traffic_allocation', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('changes', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!is_null($this->container['traffic_allocation']) && ($this->container['traffic_allocation'] > 10000)) { + $invalidProperties[] = "invalid value for 'traffic_allocation', must be smaller than or equal to 10000."; + } + + if (!is_null($this->container['traffic_allocation']) && ($this->container['traffic_allocation'] < 0)) { + $invalidProperties[] = "invalid value for 'traffic_allocation', must be bigger than or equal to 0."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id Variation ID + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name Variation name + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets key + * + * @return string|null + */ + public function getKey() + { + return $this->container['key']; + } + + /** + * Sets key + * + * @param string|null $key Variation Key + * + * @return self + */ + public function setKey($key) + { + if (is_null($key)) { + throw new \InvalidArgumentException('non-nullable key cannot be null'); + } + $this->container['key'] = $key; + + return $this; + } + + /** + * Gets traffic_allocation + * + * @return float|null + */ + public function getTrafficAllocation() + { + return $this->container['traffic_allocation']; + } + + /** + * Sets traffic_allocation + * + * @param float|null $traffic_allocation Percentage of traffic allocation for this variation, as a number from 0 to 10000. For an experience, the sum of the traffic allocations for all variations cannot be greater than 10000. + * + * @return self + */ + public function setTrafficAllocation($traffic_allocation) + { + if (is_null($traffic_allocation)) { + throw new \InvalidArgumentException('non-nullable traffic_allocation cannot be null'); + } + + if (($traffic_allocation > 10000)) { + throw new \InvalidArgumentException('invalid value for $traffic_allocation when calling ExperienceVariationConfig., must be smaller than or equal to 10000.'); + } + if (($traffic_allocation < 0)) { + throw new \InvalidArgumentException('invalid value for $traffic_allocation when calling ExperienceVariationConfig., must be bigger than or equal to 0.'); + } + + $this->container['traffic_allocation'] = $traffic_allocation; + + return $this; + } + + /** + * Gets status + * + * @return \OpenAPI\Client\Model\VariationStatuses|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param \OpenAPI\Client\Model\VariationStatuses|null $status status + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets changes + * + * @return \OpenAPI\Client\Model\ExperienceChange[]|null + */ + public function getChanges() + { + return $this->container['changes']; + } + + /** + * Sets changes + * + * @param \OpenAPI\Client\Model\ExperienceChange[]|null $changes List of changes that this variation is exposing. + * + * @return self + */ + public function setChanges($changes) + { + if (is_null($changes)) { + throw new \InvalidArgumentException('non-nullable changes cannot be null'); + } + $this->container['changes'] = $changes; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/Extra.php b/packages/Types/lib/Generated/Model/Extra.php new file mode 100644 index 0000000..b1dc077 --- /dev/null +++ b/packages/Types/lib/Generated/Model/Extra.php @@ -0,0 +1,409 @@ + + */ +class Extra implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Extra'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'pagination' => '\OpenAPI\Client\Model\Pagination' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'pagination' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'pagination' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'pagination' => 'pagination' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'pagination' => 'setPagination' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'pagination' => 'getPagination' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('pagination', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets pagination + * + * @return \OpenAPI\Client\Model\Pagination|null + */ + public function getPagination() + { + return $this->container['pagination']; + } + + /** + * Sets pagination + * + * @param \OpenAPI\Client\Model\Pagination|null $pagination pagination + * + * @return self + */ + public function setPagination($pagination) + { + if (is_null($pagination)) { + throw new \InvalidArgumentException('non-nullable pagination cannot be null'); + } + $this->container['pagination'] = $pagination; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/FeatureVariableItemData.php b/packages/Types/lib/Generated/Model/FeatureVariableItemData.php new file mode 100644 index 0000000..6fb4544 --- /dev/null +++ b/packages/Types/lib/Generated/Model/FeatureVariableItemData.php @@ -0,0 +1,492 @@ + + */ +class FeatureVariableItemData implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'FeatureVariableItemData'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'key' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'key' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'key' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'key' => 'key', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'key' => 'setKey', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'key' => 'getKey', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_BOOLEAN = 'boolean'; + public const TYPE_FLOAT = 'float'; + public const TYPE_JSON = 'json'; + public const TYPE_INTEGER = 'integer'; + public const TYPE_STRING = 'string'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_BOOLEAN, + self::TYPE_FLOAT, + self::TYPE_JSON, + self::TYPE_INTEGER, + self::TYPE_STRING, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('key', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!is_null($this->container['key']) && (mb_strlen($this->container['key']) > 16)) { + $invalidProperties[] = "invalid value for 'key', the character length must be smaller than or equal to 16."; + } + + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets key + * + * @return string|null + */ + public function getKey() + { + return $this->container['key']; + } + + /** + * Sets key + * + * @param string|null $key A user-defined variable name + * + * @return self + */ + public function setKey($key) + { + if (is_null($key)) { + throw new \InvalidArgumentException('non-nullable key cannot be null'); + } + if ((mb_strlen($key) > 16)) { + throw new \InvalidArgumentException('invalid length for $key when calling FeatureVariableItemData., must be smaller than or equal to 16.'); + } + + $this->container['key'] = $key; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type A variable's type + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/GASettings.php b/packages/Types/lib/Generated/Model/GASettings.php new file mode 100644 index 0000000..6535e2f --- /dev/null +++ b/packages/Types/lib/Generated/Model/GASettings.php @@ -0,0 +1,631 @@ + + */ +class GASettings implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = 'type'; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GA_Settings'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'enabled' => 'bool', + 'auto_revenue_tracking' => 'bool', + 'type' => 'string', + 'property_ua' => 'string', + 'measurement_id' => 'string', + 'no_wait_pageview' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'enabled' => null, + 'auto_revenue_tracking' => null, + 'type' => null, + 'property_ua' => null, + 'measurement_id' => null, + 'no_wait_pageview' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'enabled' => false, + 'auto_revenue_tracking' => false, + 'type' => false, + 'property_ua' => true, + 'measurement_id' => false, + 'no_wait_pageview' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'enabled' => 'enabled', + 'auto_revenue_tracking' => 'auto_revenue_tracking', + 'type' => 'type', + 'property_ua' => 'property_UA', + 'measurement_id' => 'measurementId', + 'no_wait_pageview' => 'no_wait_pageview' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'enabled' => 'setEnabled', + 'auto_revenue_tracking' => 'setAutoRevenueTracking', + 'type' => 'setType', + 'property_ua' => 'setPropertyUa', + 'measurement_id' => 'setMeasurementId', + 'no_wait_pageview' => 'setNoWaitPageview' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'enabled' => 'getEnabled', + 'auto_revenue_tracking' => 'getAutoRevenueTracking', + 'type' => 'getType', + 'property_ua' => 'getPropertyUa', + 'measurement_id' => 'getMeasurementId', + 'no_wait_pageview' => 'getNoWaitPageview' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_GA3 = 'ga3'; + public const TYPE_GA4 = 'ga4'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_GA3, + self::TYPE_GA4, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('enabled', $data ?? [], null); + $this->setIfExists('auto_revenue_tracking', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('property_ua', $data ?? [], null); + $this->setIfExists('measurement_id', $data ?? [], null); + $this->setIfExists('no_wait_pageview', $data ?? [], null); + + // Initialize discriminator property with the model name. + $this->container['type'] = static::$openAPIModelName; + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + if (!is_null($this->container['property_ua']) && (mb_strlen($this->container['property_ua']) > 150)) { + $invalidProperties[] = "invalid value for 'property_ua', the character length must be smaller than or equal to 150."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets enabled + * + * @return bool|null + */ + public function getEnabled() + { + return $this->container['enabled']; + } + + /** + * Sets enabled + * + * @param bool|null $enabled Flag indicating whether Google Analytics integration is enabled or not. + * + * @return self + */ + public function setEnabled($enabled) + { + if (is_null($enabled)) { + throw new \InvalidArgumentException('non-nullable enabled cannot be null'); + } + $this->container['enabled'] = $enabled; + + return $this; + } + + /** + * Gets auto_revenue_tracking + * + * @return bool|null + */ + public function getAutoRevenueTracking() + { + return $this->container['auto_revenue_tracking']; + } + + /** + * Sets auto_revenue_tracking + * + * @param bool|null $auto_revenue_tracking Attempt to pull revenue data from Google Analytics Revenue Tracking code. + * + * @return self + */ + public function setAutoRevenueTracking($auto_revenue_tracking) + { + if (is_null($auto_revenue_tracking)) { + throw new \InvalidArgumentException('non-nullable auto_revenue_tracking cannot be null'); + } + $this->container['auto_revenue_tracking'] = $auto_revenue_tracking; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type type + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets property_ua + * + * @return string|null + */ + public function getPropertyUa() + { + return $this->container['property_ua']; + } + + /** + * Sets property_ua + * + * @param string|null $property_ua Universal Analytics property to be used for tracking + * + * @return self + */ + public function setPropertyUa($property_ua) + { + if (is_null($property_ua)) { + array_push($this->openAPINullablesSetToNull, 'property_ua'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('property_ua', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($property_ua) && (mb_strlen($property_ua) > 150)) { + throw new \InvalidArgumentException('invalid length for $property_ua when calling GASettings., must be smaller than or equal to 150.'); + } + + $this->container['property_ua'] = $property_ua; + + return $this; + } + + /** + * Gets measurement_id + * + * @return string|null + */ + public function getMeasurementId() + { + return $this->container['measurement_id']; + } + + /** + * Sets measurement_id + * + * @param string|null $measurement_id ID of the ga4 property where data will be sent. Used internally for API calls to GoogleAnalytics + * + * @return self + */ + public function setMeasurementId($measurement_id) + { + if (is_null($measurement_id)) { + throw new \InvalidArgumentException('non-nullable measurement_id cannot be null'); + } + $this->container['measurement_id'] = $measurement_id; + + return $this; + } + + /** + * Gets no_wait_pageview + * + * @return bool|null + */ + public function getNoWaitPageview() + { + return $this->container['no_wait_pageview']; + } + + /** + * Sets no_wait_pageview + * + * @param bool|null $no_wait_pageview Boolean indicating whether to wait for the page view event to complete before sending other events. + * + * @return self + */ + public function setNoWaitPageview($no_wait_pageview) + { + if (is_null($no_wait_pageview)) { + throw new \InvalidArgumentException('non-nullable no_wait_pageview cannot be null'); + } + $this->container['no_wait_pageview'] = $no_wait_pageview; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/GASettingsBase.php b/packages/Types/lib/Generated/Model/GASettingsBase.php new file mode 100644 index 0000000..1ba74ce --- /dev/null +++ b/packages/Types/lib/Generated/Model/GASettingsBase.php @@ -0,0 +1,409 @@ + + */ +class GASettingsBase implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GA_SettingsBase'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'enabled' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'enabled' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'enabled' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'enabled' => 'enabled' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'enabled' => 'setEnabled' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'enabled' => 'getEnabled' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('enabled', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets enabled + * + * @return bool|null + */ + public function getEnabled() + { + return $this->container['enabled']; + } + + /** + * Sets enabled + * + * @param bool|null $enabled Flag indicating whether Google Analytics integration is enabled or not. + * + * @return self + */ + public function setEnabled($enabled) + { + if (is_null($enabled)) { + throw new \InvalidArgumentException('non-nullable enabled cannot be null'); + } + $this->container['enabled'] = $enabled; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/GaGoal.php b/packages/Types/lib/Generated/Model/GaGoal.php new file mode 100644 index 0000000..290e3e9 --- /dev/null +++ b/packages/Types/lib/Generated/Model/GaGoal.php @@ -0,0 +1,618 @@ + + */ +class GaGoal implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GaGoal'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'string', + 'name' => 'string', + 'key' => 'string', + 'type' => 'string', + 'rules' => '\OpenAPI\Client\Model\RuleObject', + 'settings' => '\OpenAPI\Client\Model\GaGoalSettings' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'name' => null, + 'key' => null, + 'type' => null, + 'rules' => null, + 'settings' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'name' => false, + 'key' => false, + 'type' => false, + 'rules' => true, + 'settings' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'name' => 'name', + 'key' => 'key', + 'type' => 'type', + 'rules' => 'rules', + 'settings' => 'settings' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'name' => 'setName', + 'key' => 'setKey', + 'type' => 'setType', + 'rules' => 'setRules', + 'settings' => 'setSettings' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'name' => 'getName', + 'key' => 'getKey', + 'type' => 'getType', + 'rules' => 'getRules', + 'settings' => 'getSettings' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_GA_IMPORT = 'ga_import'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_GA_IMPORT, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('key', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('rules', $data ?? [], null); + $this->setIfExists('settings', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id Goal ID + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name Goal Name. + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets key + * + * @return string|null + */ + public function getKey() + { + return $this->container['key']; + } + + /** + * Sets key + * + * @param string|null $key Goal Key + * + * @return self + */ + public function setKey($key) + { + if (is_null($key)) { + throw new \InvalidArgumentException('non-nullable key cannot be null'); + } + $this->container['key'] = $key; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type type + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets rules + * + * @return \OpenAPI\Client\Model\RuleObject|null + */ + public function getRules() + { + return $this->container['rules']; + } + + /** + * Sets rules + * + * @param \OpenAPI\Client\Model\RuleObject|null $rules rules + * + * @return self + */ + public function setRules($rules) + { + if (is_null($rules)) { + array_push($this->openAPINullablesSetToNull, 'rules'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('rules', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['rules'] = $rules; + + return $this; + } + + /** + * Gets settings + * + * @return \OpenAPI\Client\Model\GaGoalSettings|null + */ + public function getSettings() + { + return $this->container['settings']; + } + + /** + * Sets settings + * + * @param \OpenAPI\Client\Model\GaGoalSettings|null $settings settings + * + * @return self + */ + public function setSettings($settings) + { + if (is_null($settings)) { + throw new \InvalidArgumentException('non-nullable settings cannot be null'); + } + $this->container['settings'] = $settings; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/GaGoalSettings.php b/packages/Types/lib/Generated/Model/GaGoalSettings.php new file mode 100644 index 0000000..bdcc703 --- /dev/null +++ b/packages/Types/lib/Generated/Model/GaGoalSettings.php @@ -0,0 +1,409 @@ + + */ +class GaGoalSettings implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GaGoalSettings'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'ga_event' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'ga_event' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'ga_event' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'ga_event' => 'ga_event' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'ga_event' => 'setGaEvent' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'ga_event' => 'getGaEvent' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('ga_event', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets ga_event + * + * @return string|null + */ + public function getGaEvent() + { + return $this->container['ga_event']; + } + + /** + * Sets ga_event + * + * @param string|null $ga_event GA4 event name + * + * @return self + */ + public function setGaEvent($ga_event) + { + if (is_null($ga_event)) { + throw new \InvalidArgumentException('non-nullable ga_event cannot be null'); + } + $this->container['ga_event'] = $ga_event; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/GenericBoolKeyValueMatchRule.php b/packages/Types/lib/Generated/Model/GenericBoolKeyValueMatchRule.php new file mode 100644 index 0000000..6f566eb --- /dev/null +++ b/packages/Types/lib/Generated/Model/GenericBoolKeyValueMatchRule.php @@ -0,0 +1,514 @@ + + */ +class GenericBoolKeyValueMatchRule implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GenericBoolKeyValueMatchRule'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'rule_type' => '\OpenAPI\Client\Model\GenericBoolKeyValueMatchRulesTypes', + 'value' => 'bool', + 'key' => 'string', + 'matching' => '\OpenAPI\Client\Model\GenericBoolKeyValueMatchRuleAllOfMatching' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'rule_type' => null, + 'value' => null, + 'key' => null, + 'matching' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'rule_type' => false, + 'value' => false, + 'key' => false, + 'matching' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'rule_type' => 'rule_type', + 'value' => 'value', + 'key' => 'key', + 'matching' => 'matching' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'rule_type' => 'setRuleType', + 'value' => 'setValue', + 'key' => 'setKey', + 'matching' => 'setMatching' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'rule_type' => 'getRuleType', + 'value' => 'getValue', + 'key' => 'getKey', + 'matching' => 'getMatching' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('rule_type', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); + $this->setIfExists('key', $data ?? [], null); + $this->setIfExists('matching', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['rule_type'] === null) { + $invalidProperties[] = "'rule_type' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets rule_type + * + * @return \OpenAPI\Client\Model\GenericBoolKeyValueMatchRulesTypes + */ + public function getRuleType() + { + return $this->container['rule_type']; + } + + /** + * Sets rule_type + * + * @param \OpenAPI\Client\Model\GenericBoolKeyValueMatchRulesTypes $rule_type rule_type + * + * @return self + */ + public function setRuleType($rule_type) + { + if (is_null($rule_type)) { + throw new \InvalidArgumentException('non-nullable rule_type cannot be null'); + } + $this->container['rule_type'] = $rule_type; + + return $this; + } + + /** + * Gets value + * + * @return bool|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param bool|null $value The value used to match against 'rule_type' using 'matching' + * + * @return self + */ + public function setValue($value) + { + if (is_null($value)) { + throw new \InvalidArgumentException('non-nullable value cannot be null'); + } + $this->container['value'] = $value; + + return $this; + } + + /** + * Gets key + * + * @return string|null + */ + public function getKey() + { + return $this->container['key']; + } + + /** + * Sets key + * + * @param string|null $key The key used to identify the data that would be matched against rule **value** + * + * @return self + */ + public function setKey($key) + { + if (is_null($key)) { + throw new \InvalidArgumentException('non-nullable key cannot be null'); + } + $this->container['key'] = $key; + + return $this; + } + + /** + * Gets matching + * + * @return \OpenAPI\Client\Model\GenericBoolKeyValueMatchRuleAllOfMatching|null + */ + public function getMatching() + { + return $this->container['matching']; + } + + /** + * Sets matching + * + * @param \OpenAPI\Client\Model\GenericBoolKeyValueMatchRuleAllOfMatching|null $matching matching + * + * @return self + */ + public function setMatching($matching) + { + if (is_null($matching)) { + throw new \InvalidArgumentException('non-nullable matching cannot be null'); + } + $this->container['matching'] = $matching; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/GenericBoolKeyValueMatchRuleAllOfMatching.php b/packages/Types/lib/Generated/Model/GenericBoolKeyValueMatchRuleAllOfMatching.php new file mode 100644 index 0000000..3f7f774 --- /dev/null +++ b/packages/Types/lib/Generated/Model/GenericBoolKeyValueMatchRuleAllOfMatching.php @@ -0,0 +1,443 @@ + + */ +class GenericBoolKeyValueMatchRuleAllOfMatching implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GenericBoolKeyValueMatchRule_allOf_matching'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'negated' => 'bool', + 'match_type' => '\OpenAPI\Client\Model\ChoiceMatchingOptions' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'negated' => null, + 'match_type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'negated' => false, + 'match_type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'negated' => 'negated', + 'match_type' => 'match_type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'negated' => 'setNegated', + 'match_type' => 'setMatchType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'negated' => 'getNegated', + 'match_type' => 'getMatchType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('negated', $data ?? [], null); + $this->setIfExists('match_type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets negated + * + * @return bool|null + */ + public function getNegated() + { + return $this->container['negated']; + } + + /** + * Sets negated + * + * @param bool|null $negated When true, the rule result is gonna be negated. example: `url contains \"test\"` with *negated* = true becomes `url does not contain \"test\"` + * + * @return self + */ + public function setNegated($negated) + { + if (is_null($negated)) { + throw new \InvalidArgumentException('non-nullable negated cannot be null'); + } + $this->container['negated'] = $negated; + + return $this; + } + + /** + * Gets match_type + * + * @return \OpenAPI\Client\Model\ChoiceMatchingOptions|null + */ + public function getMatchType() + { + return $this->container['match_type']; + } + + /** + * Sets match_type + * + * @param \OpenAPI\Client\Model\ChoiceMatchingOptions|null $match_type match_type + * + * @return self + */ + public function setMatchType($match_type) + { + if (is_null($match_type)) { + throw new \InvalidArgumentException('non-nullable match_type cannot be null'); + } + $this->container['match_type'] = $match_type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/GenericBoolKeyValueMatchRulesTypes.php b/packages/Types/lib/Generated/Model/GenericBoolKeyValueMatchRulesTypes.php new file mode 100644 index 0000000..a285e7c --- /dev/null +++ b/packages/Types/lib/Generated/Model/GenericBoolKeyValueMatchRulesTypes.php @@ -0,0 +1,59 @@ + + */ +class GenericBoolMatchRule implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GenericBoolMatchRule'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'rule_type' => '\OpenAPI\Client\Model\BoolMatchRulesTypes', + 'value' => 'bool', + 'matching' => '\OpenAPI\Client\Model\GenericBoolMatchRuleAllOfMatching' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'rule_type' => null, + 'value' => null, + 'matching' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'rule_type' => false, + 'value' => false, + 'matching' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'rule_type' => 'rule_type', + 'value' => 'value', + 'matching' => 'matching' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'rule_type' => 'setRuleType', + 'value' => 'setValue', + 'matching' => 'setMatching' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'rule_type' => 'getRuleType', + 'value' => 'getValue', + 'matching' => 'getMatching' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('rule_type', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); + $this->setIfExists('matching', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['rule_type'] === null) { + $invalidProperties[] = "'rule_type' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets rule_type + * + * @return \OpenAPI\Client\Model\BoolMatchRulesTypes + */ + public function getRuleType() + { + return $this->container['rule_type']; + } + + /** + * Sets rule_type + * + * @param \OpenAPI\Client\Model\BoolMatchRulesTypes $rule_type rule_type + * + * @return self + */ + public function setRuleType($rule_type) + { + if (is_null($rule_type)) { + throw new \InvalidArgumentException('non-nullable rule_type cannot be null'); + } + $this->container['rule_type'] = $rule_type; + + return $this; + } + + /** + * Gets value + * + * @return bool|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param bool|null $value The value used to match against 'rule_type' using 'matching' + * + * @return self + */ + public function setValue($value) + { + if (is_null($value)) { + throw new \InvalidArgumentException('non-nullable value cannot be null'); + } + $this->container['value'] = $value; + + return $this; + } + + /** + * Gets matching + * + * @return \OpenAPI\Client\Model\GenericBoolMatchRuleAllOfMatching|null + */ + public function getMatching() + { + return $this->container['matching']; + } + + /** + * Sets matching + * + * @param \OpenAPI\Client\Model\GenericBoolMatchRuleAllOfMatching|null $matching matching + * + * @return self + */ + public function setMatching($matching) + { + if (is_null($matching)) { + throw new \InvalidArgumentException('non-nullable matching cannot be null'); + } + $this->container['matching'] = $matching; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/GenericBoolMatchRuleAllOfMatching.php b/packages/Types/lib/Generated/Model/GenericBoolMatchRuleAllOfMatching.php new file mode 100644 index 0000000..000868c --- /dev/null +++ b/packages/Types/lib/Generated/Model/GenericBoolMatchRuleAllOfMatching.php @@ -0,0 +1,443 @@ + + */ +class GenericBoolMatchRuleAllOfMatching implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GenericBoolMatchRule_allOf_matching'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'negated' => 'bool', + 'match_type' => '\OpenAPI\Client\Model\ChoiceMatchingOptions' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'negated' => null, + 'match_type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'negated' => false, + 'match_type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'negated' => 'negated', + 'match_type' => 'match_type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'negated' => 'setNegated', + 'match_type' => 'setMatchType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'negated' => 'getNegated', + 'match_type' => 'getMatchType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('negated', $data ?? [], null); + $this->setIfExists('match_type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets negated + * + * @return bool|null + */ + public function getNegated() + { + return $this->container['negated']; + } + + /** + * Sets negated + * + * @param bool|null $negated When true, the rule result is gonna be negated. example: `url contains \"test\"` with *negated* = true becomes `url does not contain \"test\"` + * + * @return self + */ + public function setNegated($negated) + { + if (is_null($negated)) { + throw new \InvalidArgumentException('non-nullable negated cannot be null'); + } + $this->container['negated'] = $negated; + + return $this; + } + + /** + * Gets match_type + * + * @return \OpenAPI\Client\Model\ChoiceMatchingOptions|null + */ + public function getMatchType() + { + return $this->container['match_type']; + } + + /** + * Sets match_type + * + * @param \OpenAPI\Client\Model\ChoiceMatchingOptions|null $match_type match_type + * + * @return self + */ + public function setMatchType($match_type) + { + if (is_null($match_type)) { + throw new \InvalidArgumentException('non-nullable match_type cannot be null'); + } + $this->container['match_type'] = $match_type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/GenericKey.php b/packages/Types/lib/Generated/Model/GenericKey.php new file mode 100644 index 0000000..38e645d --- /dev/null +++ b/packages/Types/lib/Generated/Model/GenericKey.php @@ -0,0 +1,409 @@ + + */ +class GenericKey implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GenericKey'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'key' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'key' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'key' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'key' => 'key' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'key' => 'setKey' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'key' => 'getKey' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('key', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets key + * + * @return string|null + */ + public function getKey() + { + return $this->container['key']; + } + + /** + * Sets key + * + * @param string|null $key The key used to identify the data that would be matched against rule **value** + * + * @return self + */ + public function setKey($key) + { + if (is_null($key)) { + throw new \InvalidArgumentException('non-nullable key cannot be null'); + } + $this->container['key'] = $key; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/GenericListMatchingOptions.php b/packages/Types/lib/Generated/Model/GenericListMatchingOptions.php new file mode 100644 index 0000000..a3fdb4f --- /dev/null +++ b/packages/Types/lib/Generated/Model/GenericListMatchingOptions.php @@ -0,0 +1,63 @@ + + */ +class GenericNumericKeyValueMatchRule implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GenericNumericKeyValueMatchRule'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'rule_type' => '\OpenAPI\Client\Model\GenericNumericKeyValueMatchRulesTypes', + 'value' => 'float', + 'key' => 'string', + 'matching' => '\OpenAPI\Client\Model\GenericNumericKeyValueMatchRuleAllOfMatching' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'rule_type' => null, + 'value' => null, + 'key' => null, + 'matching' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'rule_type' => false, + 'value' => false, + 'key' => false, + 'matching' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'rule_type' => 'rule_type', + 'value' => 'value', + 'key' => 'key', + 'matching' => 'matching' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'rule_type' => 'setRuleType', + 'value' => 'setValue', + 'key' => 'setKey', + 'matching' => 'setMatching' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'rule_type' => 'getRuleType', + 'value' => 'getValue', + 'key' => 'getKey', + 'matching' => 'getMatching' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('rule_type', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); + $this->setIfExists('key', $data ?? [], null); + $this->setIfExists('matching', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['rule_type'] === null) { + $invalidProperties[] = "'rule_type' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets rule_type + * + * @return \OpenAPI\Client\Model\GenericNumericKeyValueMatchRulesTypes + */ + public function getRuleType() + { + return $this->container['rule_type']; + } + + /** + * Sets rule_type + * + * @param \OpenAPI\Client\Model\GenericNumericKeyValueMatchRulesTypes $rule_type rule_type + * + * @return self + */ + public function setRuleType($rule_type) + { + if (is_null($rule_type)) { + throw new \InvalidArgumentException('non-nullable rule_type cannot be null'); + } + $this->container['rule_type'] = $rule_type; + + return $this; + } + + /** + * Gets value + * + * @return float|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param float|null $value The value used to match against 'rule_type' using 'matching' + * + * @return self + */ + public function setValue($value) + { + if (is_null($value)) { + throw new \InvalidArgumentException('non-nullable value cannot be null'); + } + $this->container['value'] = $value; + + return $this; + } + + /** + * Gets key + * + * @return string|null + */ + public function getKey() + { + return $this->container['key']; + } + + /** + * Sets key + * + * @param string|null $key The key used to identify the data that would be matched against rule **value** + * + * @return self + */ + public function setKey($key) + { + if (is_null($key)) { + throw new \InvalidArgumentException('non-nullable key cannot be null'); + } + $this->container['key'] = $key; + + return $this; + } + + /** + * Gets matching + * + * @return \OpenAPI\Client\Model\GenericNumericKeyValueMatchRuleAllOfMatching|null + */ + public function getMatching() + { + return $this->container['matching']; + } + + /** + * Sets matching + * + * @param \OpenAPI\Client\Model\GenericNumericKeyValueMatchRuleAllOfMatching|null $matching matching + * + * @return self + */ + public function setMatching($matching) + { + if (is_null($matching)) { + throw new \InvalidArgumentException('non-nullable matching cannot be null'); + } + $this->container['matching'] = $matching; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/GenericNumericKeyValueMatchRuleAllOfMatching.php b/packages/Types/lib/Generated/Model/GenericNumericKeyValueMatchRuleAllOfMatching.php new file mode 100644 index 0000000..0ead291 --- /dev/null +++ b/packages/Types/lib/Generated/Model/GenericNumericKeyValueMatchRuleAllOfMatching.php @@ -0,0 +1,443 @@ + + */ +class GenericNumericKeyValueMatchRuleAllOfMatching implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GenericNumericKeyValueMatchRule_allOf_matching'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'negated' => 'bool', + 'match_type' => '\OpenAPI\Client\Model\NumericMatchingOptions' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'negated' => null, + 'match_type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'negated' => false, + 'match_type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'negated' => 'negated', + 'match_type' => 'match_type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'negated' => 'setNegated', + 'match_type' => 'setMatchType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'negated' => 'getNegated', + 'match_type' => 'getMatchType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('negated', $data ?? [], null); + $this->setIfExists('match_type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets negated + * + * @return bool|null + */ + public function getNegated() + { + return $this->container['negated']; + } + + /** + * Sets negated + * + * @param bool|null $negated When true, the rule result is gonna be negated. example: `url contains \"test\"` with *negated* = true becomes `url does not contain \"test\"` + * + * @return self + */ + public function setNegated($negated) + { + if (is_null($negated)) { + throw new \InvalidArgumentException('non-nullable negated cannot be null'); + } + $this->container['negated'] = $negated; + + return $this; + } + + /** + * Gets match_type + * + * @return \OpenAPI\Client\Model\NumericMatchingOptions|null + */ + public function getMatchType() + { + return $this->container['match_type']; + } + + /** + * Sets match_type + * + * @param \OpenAPI\Client\Model\NumericMatchingOptions|null $match_type match_type + * + * @return self + */ + public function setMatchType($match_type) + { + if (is_null($match_type)) { + throw new \InvalidArgumentException('non-nullable match_type cannot be null'); + } + $this->container['match_type'] = $match_type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/GenericNumericKeyValueMatchRulesTypes.php b/packages/Types/lib/Generated/Model/GenericNumericKeyValueMatchRulesTypes.php new file mode 100644 index 0000000..4e1fa86 --- /dev/null +++ b/packages/Types/lib/Generated/Model/GenericNumericKeyValueMatchRulesTypes.php @@ -0,0 +1,59 @@ + + */ +class GenericNumericMatchRule implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GenericNumericMatchRule'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'rule_type' => '\OpenAPI\Client\Model\NumericMatchRulesTypes', + 'value' => 'float', + 'matching' => '\OpenAPI\Client\Model\GenericNumericMatchRuleAllOfMatching' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'rule_type' => null, + 'value' => null, + 'matching' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'rule_type' => false, + 'value' => false, + 'matching' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'rule_type' => 'rule_type', + 'value' => 'value', + 'matching' => 'matching' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'rule_type' => 'setRuleType', + 'value' => 'setValue', + 'matching' => 'setMatching' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'rule_type' => 'getRuleType', + 'value' => 'getValue', + 'matching' => 'getMatching' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('rule_type', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); + $this->setIfExists('matching', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['rule_type'] === null) { + $invalidProperties[] = "'rule_type' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets rule_type + * + * @return \OpenAPI\Client\Model\NumericMatchRulesTypes + */ + public function getRuleType() + { + return $this->container['rule_type']; + } + + /** + * Sets rule_type + * + * @param \OpenAPI\Client\Model\NumericMatchRulesTypes $rule_type rule_type + * + * @return self + */ + public function setRuleType($rule_type) + { + if (is_null($rule_type)) { + throw new \InvalidArgumentException('non-nullable rule_type cannot be null'); + } + $this->container['rule_type'] = $rule_type; + + return $this; + } + + /** + * Gets value + * + * @return float|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param float|null $value The value used to match against 'rule_type' using 'matching' + * + * @return self + */ + public function setValue($value) + { + if (is_null($value)) { + throw new \InvalidArgumentException('non-nullable value cannot be null'); + } + $this->container['value'] = $value; + + return $this; + } + + /** + * Gets matching + * + * @return \OpenAPI\Client\Model\GenericNumericMatchRuleAllOfMatching|null + */ + public function getMatching() + { + return $this->container['matching']; + } + + /** + * Sets matching + * + * @param \OpenAPI\Client\Model\GenericNumericMatchRuleAllOfMatching|null $matching matching + * + * @return self + */ + public function setMatching($matching) + { + if (is_null($matching)) { + throw new \InvalidArgumentException('non-nullable matching cannot be null'); + } + $this->container['matching'] = $matching; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/GenericNumericMatchRuleAllOfMatching.php b/packages/Types/lib/Generated/Model/GenericNumericMatchRuleAllOfMatching.php new file mode 100644 index 0000000..9e29e26 --- /dev/null +++ b/packages/Types/lib/Generated/Model/GenericNumericMatchRuleAllOfMatching.php @@ -0,0 +1,443 @@ + + */ +class GenericNumericMatchRuleAllOfMatching implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GenericNumericMatchRule_allOf_matching'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'negated' => 'bool', + 'match_type' => '\OpenAPI\Client\Model\NumericMatchingOptions' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'negated' => null, + 'match_type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'negated' => false, + 'match_type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'negated' => 'negated', + 'match_type' => 'match_type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'negated' => 'setNegated', + 'match_type' => 'setMatchType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'negated' => 'getNegated', + 'match_type' => 'getMatchType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('negated', $data ?? [], null); + $this->setIfExists('match_type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets negated + * + * @return bool|null + */ + public function getNegated() + { + return $this->container['negated']; + } + + /** + * Sets negated + * + * @param bool|null $negated When true, the rule result is gonna be negated. example: `url contains \"test\"` with *negated* = true becomes `url does not contain \"test\"` + * + * @return self + */ + public function setNegated($negated) + { + if (is_null($negated)) { + throw new \InvalidArgumentException('non-nullable negated cannot be null'); + } + $this->container['negated'] = $negated; + + return $this; + } + + /** + * Gets match_type + * + * @return \OpenAPI\Client\Model\NumericMatchingOptions|null + */ + public function getMatchType() + { + return $this->container['match_type']; + } + + /** + * Sets match_type + * + * @param \OpenAPI\Client\Model\NumericMatchingOptions|null $match_type match_type + * + * @return self + */ + public function setMatchType($match_type) + { + if (is_null($match_type)) { + throw new \InvalidArgumentException('non-nullable match_type cannot be null'); + } + $this->container['match_type'] = $match_type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/GenericSetMatchRule.php b/packages/Types/lib/Generated/Model/GenericSetMatchRule.php new file mode 100644 index 0000000..da6dec5 --- /dev/null +++ b/packages/Types/lib/Generated/Model/GenericSetMatchRule.php @@ -0,0 +1,480 @@ + + */ +class GenericSetMatchRule implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GenericSetMatchRule'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'rule_type' => 'string', + 'value' => 'string', + 'matching' => '\OpenAPI\Client\Model\GenericSetMatchRuleAllOfMatching' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'rule_type' => null, + 'value' => null, + 'matching' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'rule_type' => false, + 'value' => false, + 'matching' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'rule_type' => 'rule_type', + 'value' => 'value', + 'matching' => 'matching' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'rule_type' => 'setRuleType', + 'value' => 'setValue', + 'matching' => 'setMatching' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'rule_type' => 'getRuleType', + 'value' => 'getValue', + 'matching' => 'getMatching' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('rule_type', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); + $this->setIfExists('matching', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['rule_type'] === null) { + $invalidProperties[] = "'rule_type' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets rule_type + * + * @return string + */ + public function getRuleType() + { + return $this->container['rule_type']; + } + + /** + * Sets rule_type + * + * @param string $rule_type rule_type + * + * @return self + */ + public function setRuleType($rule_type) + { + if (is_null($rule_type)) { + throw new \InvalidArgumentException('non-nullable rule_type cannot be null'); + } + $this->container['rule_type'] = $rule_type; + + return $this; + } + + /** + * Gets value + * + * @return string|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param string|null $value The value used to match against 'rule_type' using 'matching' + * + * @return self + */ + public function setValue($value) + { + if (is_null($value)) { + throw new \InvalidArgumentException('non-nullable value cannot be null'); + } + $this->container['value'] = $value; + + return $this; + } + + /** + * Gets matching + * + * @return \OpenAPI\Client\Model\GenericSetMatchRuleAllOfMatching|null + */ + public function getMatching() + { + return $this->container['matching']; + } + + /** + * Sets matching + * + * @param \OpenAPI\Client\Model\GenericSetMatchRuleAllOfMatching|null $matching matching + * + * @return self + */ + public function setMatching($matching) + { + if (is_null($matching)) { + throw new \InvalidArgumentException('non-nullable matching cannot be null'); + } + $this->container['matching'] = $matching; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/GenericSetMatchRuleAllOfMatching.php b/packages/Types/lib/Generated/Model/GenericSetMatchRuleAllOfMatching.php new file mode 100644 index 0000000..e8bc762 --- /dev/null +++ b/packages/Types/lib/Generated/Model/GenericSetMatchRuleAllOfMatching.php @@ -0,0 +1,443 @@ + + */ +class GenericSetMatchRuleAllOfMatching implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GenericSetMatchRule_allOf_matching'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'negated' => 'bool', + 'match_type' => '\OpenAPI\Client\Model\SetMatchingOptions' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'negated' => null, + 'match_type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'negated' => false, + 'match_type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'negated' => 'negated', + 'match_type' => 'match_type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'negated' => 'setNegated', + 'match_type' => 'setMatchType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'negated' => 'getNegated', + 'match_type' => 'getMatchType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('negated', $data ?? [], null); + $this->setIfExists('match_type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets negated + * + * @return bool|null + */ + public function getNegated() + { + return $this->container['negated']; + } + + /** + * Sets negated + * + * @param bool|null $negated When true, the rule result is gonna be negated. example: `url contains \"test\"` with *negated* = true becomes `url does not contain \"test\"` + * + * @return self + */ + public function setNegated($negated) + { + if (is_null($negated)) { + throw new \InvalidArgumentException('non-nullable negated cannot be null'); + } + $this->container['negated'] = $negated; + + return $this; + } + + /** + * Gets match_type + * + * @return \OpenAPI\Client\Model\SetMatchingOptions|null + */ + public function getMatchType() + { + return $this->container['match_type']; + } + + /** + * Sets match_type + * + * @param \OpenAPI\Client\Model\SetMatchingOptions|null $match_type match_type + * + * @return self + */ + public function setMatchType($match_type) + { + if (is_null($match_type)) { + throw new \InvalidArgumentException('non-nullable match_type cannot be null'); + } + $this->container['match_type'] = $match_type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/GenericTextKeyValueMatchRule.php b/packages/Types/lib/Generated/Model/GenericTextKeyValueMatchRule.php new file mode 100644 index 0000000..c4ef04d --- /dev/null +++ b/packages/Types/lib/Generated/Model/GenericTextKeyValueMatchRule.php @@ -0,0 +1,514 @@ + + */ +class GenericTextKeyValueMatchRule implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GenericTextKeyValueMatchRule'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'rule_type' => '\OpenAPI\Client\Model\GenericTextKeyValueMatchRulesTypes', + 'value' => 'string', + 'key' => 'string', + 'matching' => '\OpenAPI\Client\Model\GenericTextKeyValueMatchRuleAllOfMatching' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'rule_type' => null, + 'value' => null, + 'key' => null, + 'matching' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'rule_type' => false, + 'value' => false, + 'key' => false, + 'matching' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'rule_type' => 'rule_type', + 'value' => 'value', + 'key' => 'key', + 'matching' => 'matching' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'rule_type' => 'setRuleType', + 'value' => 'setValue', + 'key' => 'setKey', + 'matching' => 'setMatching' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'rule_type' => 'getRuleType', + 'value' => 'getValue', + 'key' => 'getKey', + 'matching' => 'getMatching' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('rule_type', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); + $this->setIfExists('key', $data ?? [], null); + $this->setIfExists('matching', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['rule_type'] === null) { + $invalidProperties[] = "'rule_type' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets rule_type + * + * @return \OpenAPI\Client\Model\GenericTextKeyValueMatchRulesTypes + */ + public function getRuleType() + { + return $this->container['rule_type']; + } + + /** + * Sets rule_type + * + * @param \OpenAPI\Client\Model\GenericTextKeyValueMatchRulesTypes $rule_type rule_type + * + * @return self + */ + public function setRuleType($rule_type) + { + if (is_null($rule_type)) { + throw new \InvalidArgumentException('non-nullable rule_type cannot be null'); + } + $this->container['rule_type'] = $rule_type; + + return $this; + } + + /** + * Gets value + * + * @return string|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param string|null $value The value used to match against 'rule_type' using 'matching' + * + * @return self + */ + public function setValue($value) + { + if (is_null($value)) { + throw new \InvalidArgumentException('non-nullable value cannot be null'); + } + $this->container['value'] = $value; + + return $this; + } + + /** + * Gets key + * + * @return string|null + */ + public function getKey() + { + return $this->container['key']; + } + + /** + * Sets key + * + * @param string|null $key The key used to identify the data that would be matched against rule **value** + * + * @return self + */ + public function setKey($key) + { + if (is_null($key)) { + throw new \InvalidArgumentException('non-nullable key cannot be null'); + } + $this->container['key'] = $key; + + return $this; + } + + /** + * Gets matching + * + * @return \OpenAPI\Client\Model\GenericTextKeyValueMatchRuleAllOfMatching|null + */ + public function getMatching() + { + return $this->container['matching']; + } + + /** + * Sets matching + * + * @param \OpenAPI\Client\Model\GenericTextKeyValueMatchRuleAllOfMatching|null $matching matching + * + * @return self + */ + public function setMatching($matching) + { + if (is_null($matching)) { + throw new \InvalidArgumentException('non-nullable matching cannot be null'); + } + $this->container['matching'] = $matching; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/GenericTextKeyValueMatchRuleAllOfMatching.php b/packages/Types/lib/Generated/Model/GenericTextKeyValueMatchRuleAllOfMatching.php new file mode 100644 index 0000000..c8b10cc --- /dev/null +++ b/packages/Types/lib/Generated/Model/GenericTextKeyValueMatchRuleAllOfMatching.php @@ -0,0 +1,443 @@ + + */ +class GenericTextKeyValueMatchRuleAllOfMatching implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GenericTextKeyValueMatchRule_allOf_matching'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'negated' => 'bool', + 'match_type' => '\OpenAPI\Client\Model\TextMatchingOptions' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'negated' => null, + 'match_type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'negated' => false, + 'match_type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'negated' => 'negated', + 'match_type' => 'match_type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'negated' => 'setNegated', + 'match_type' => 'setMatchType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'negated' => 'getNegated', + 'match_type' => 'getMatchType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('negated', $data ?? [], null); + $this->setIfExists('match_type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets negated + * + * @return bool|null + */ + public function getNegated() + { + return $this->container['negated']; + } + + /** + * Sets negated + * + * @param bool|null $negated When true, the rule result is gonna be negated. example: `url contains \"test\"` with *negated* = true becomes `url does not contain \"test\"` + * + * @return self + */ + public function setNegated($negated) + { + if (is_null($negated)) { + throw new \InvalidArgumentException('non-nullable negated cannot be null'); + } + $this->container['negated'] = $negated; + + return $this; + } + + /** + * Gets match_type + * + * @return \OpenAPI\Client\Model\TextMatchingOptions|null + */ + public function getMatchType() + { + return $this->container['match_type']; + } + + /** + * Sets match_type + * + * @param \OpenAPI\Client\Model\TextMatchingOptions|null $match_type match_type + * + * @return self + */ + public function setMatchType($match_type) + { + if (is_null($match_type)) { + throw new \InvalidArgumentException('non-nullable match_type cannot be null'); + } + $this->container['match_type'] = $match_type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/GenericTextKeyValueMatchRulesTypes.php b/packages/Types/lib/Generated/Model/GenericTextKeyValueMatchRulesTypes.php new file mode 100644 index 0000000..6a3ebc3 --- /dev/null +++ b/packages/Types/lib/Generated/Model/GenericTextKeyValueMatchRulesTypes.php @@ -0,0 +1,59 @@ + + */ +class GenericTextMatchRule implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GenericTextMatchRule'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'rule_type' => '\OpenAPI\Client\Model\TextMatchRulesTypes', + 'value' => 'string', + 'matching' => '\OpenAPI\Client\Model\GenericTextMatchRuleAllOfMatching' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'rule_type' => null, + 'value' => null, + 'matching' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'rule_type' => false, + 'value' => false, + 'matching' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'rule_type' => 'rule_type', + 'value' => 'value', + 'matching' => 'matching' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'rule_type' => 'setRuleType', + 'value' => 'setValue', + 'matching' => 'setMatching' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'rule_type' => 'getRuleType', + 'value' => 'getValue', + 'matching' => 'getMatching' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('rule_type', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); + $this->setIfExists('matching', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['rule_type'] === null) { + $invalidProperties[] = "'rule_type' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets rule_type + * + * @return \OpenAPI\Client\Model\TextMatchRulesTypes + */ + public function getRuleType() + { + return $this->container['rule_type']; + } + + /** + * Sets rule_type + * + * @param \OpenAPI\Client\Model\TextMatchRulesTypes $rule_type rule_type + * + * @return self + */ + public function setRuleType($rule_type) + { + if (is_null($rule_type)) { + throw new \InvalidArgumentException('non-nullable rule_type cannot be null'); + } + $this->container['rule_type'] = $rule_type; + + return $this; + } + + /** + * Gets value + * + * @return string|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param string|null $value The value used to match against 'rule_type' using 'matching' + * + * @return self + */ + public function setValue($value) + { + if (is_null($value)) { + throw new \InvalidArgumentException('non-nullable value cannot be null'); + } + $this->container['value'] = $value; + + return $this; + } + + /** + * Gets matching + * + * @return \OpenAPI\Client\Model\GenericTextMatchRuleAllOfMatching|null + */ + public function getMatching() + { + return $this->container['matching']; + } + + /** + * Sets matching + * + * @param \OpenAPI\Client\Model\GenericTextMatchRuleAllOfMatching|null $matching matching + * + * @return self + */ + public function setMatching($matching) + { + if (is_null($matching)) { + throw new \InvalidArgumentException('non-nullable matching cannot be null'); + } + $this->container['matching'] = $matching; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/GenericTextMatchRuleAllOfMatching.php b/packages/Types/lib/Generated/Model/GenericTextMatchRuleAllOfMatching.php new file mode 100644 index 0000000..9d5b30f --- /dev/null +++ b/packages/Types/lib/Generated/Model/GenericTextMatchRuleAllOfMatching.php @@ -0,0 +1,443 @@ + + */ +class GenericTextMatchRuleAllOfMatching implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GenericTextMatchRule_allOf_matching'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'negated' => 'bool', + 'match_type' => '\OpenAPI\Client\Model\TextMatchingOptions' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'negated' => null, + 'match_type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'negated' => false, + 'match_type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'negated' => 'negated', + 'match_type' => 'match_type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'negated' => 'setNegated', + 'match_type' => 'setMatchType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'negated' => 'getNegated', + 'match_type' => 'getMatchType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('negated', $data ?? [], null); + $this->setIfExists('match_type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets negated + * + * @return bool|null + */ + public function getNegated() + { + return $this->container['negated']; + } + + /** + * Sets negated + * + * @param bool|null $negated When true, the rule result is gonna be negated. example: `url contains \"test\"` with *negated* = true becomes `url does not contain \"test\"` + * + * @return self + */ + public function setNegated($negated) + { + if (is_null($negated)) { + throw new \InvalidArgumentException('non-nullable negated cannot be null'); + } + $this->container['negated'] = $negated; + + return $this; + } + + /** + * Gets match_type + * + * @return \OpenAPI\Client\Model\TextMatchingOptions|null + */ + public function getMatchType() + { + return $this->container['match_type']; + } + + /** + * Sets match_type + * + * @param \OpenAPI\Client\Model\TextMatchingOptions|null $match_type match_type + * + * @return self + */ + public function setMatchType($match_type) + { + if (is_null($match_type)) { + throw new \InvalidArgumentException('non-nullable match_type cannot be null'); + } + $this->container['match_type'] = $match_type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/GoalTriggeredMatchRule.php b/packages/Types/lib/Generated/Model/GoalTriggeredMatchRule.php new file mode 100644 index 0000000..c9e8b69 --- /dev/null +++ b/packages/Types/lib/Generated/Model/GoalTriggeredMatchRule.php @@ -0,0 +1,480 @@ + + */ +class GoalTriggeredMatchRule implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GoalTriggeredMatchRule'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'rule_type' => '\OpenAPI\Client\Model\GoalTriggeredMatchRulesTypes', + 'value' => 'float', + 'matching' => '\OpenAPI\Client\Model\GoalTriggeredMatchRuleAllOfMatching' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'rule_type' => null, + 'value' => null, + 'matching' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'rule_type' => false, + 'value' => false, + 'matching' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'rule_type' => 'rule_type', + 'value' => 'value', + 'matching' => 'matching' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'rule_type' => 'setRuleType', + 'value' => 'setValue', + 'matching' => 'setMatching' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'rule_type' => 'getRuleType', + 'value' => 'getValue', + 'matching' => 'getMatching' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('rule_type', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); + $this->setIfExists('matching', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['rule_type'] === null) { + $invalidProperties[] = "'rule_type' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets rule_type + * + * @return \OpenAPI\Client\Model\GoalTriggeredMatchRulesTypes + */ + public function getRuleType() + { + return $this->container['rule_type']; + } + + /** + * Sets rule_type + * + * @param \OpenAPI\Client\Model\GoalTriggeredMatchRulesTypes $rule_type rule_type + * + * @return self + */ + public function setRuleType($rule_type) + { + if (is_null($rule_type)) { + throw new \InvalidArgumentException('non-nullable rule_type cannot be null'); + } + $this->container['rule_type'] = $rule_type; + + return $this; + } + + /** + * Gets value + * + * @return float|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param float|null $value ID of the goal used for matching + * + * @return self + */ + public function setValue($value) + { + if (is_null($value)) { + throw new \InvalidArgumentException('non-nullable value cannot be null'); + } + $this->container['value'] = $value; + + return $this; + } + + /** + * Gets matching + * + * @return \OpenAPI\Client\Model\GoalTriggeredMatchRuleAllOfMatching|null + */ + public function getMatching() + { + return $this->container['matching']; + } + + /** + * Sets matching + * + * @param \OpenAPI\Client\Model\GoalTriggeredMatchRuleAllOfMatching|null $matching matching + * + * @return self + */ + public function setMatching($matching) + { + if (is_null($matching)) { + throw new \InvalidArgumentException('non-nullable matching cannot be null'); + } + $this->container['matching'] = $matching; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/GoalTriggeredMatchRuleAllOfMatching.php b/packages/Types/lib/Generated/Model/GoalTriggeredMatchRuleAllOfMatching.php new file mode 100644 index 0000000..91871ca --- /dev/null +++ b/packages/Types/lib/Generated/Model/GoalTriggeredMatchRuleAllOfMatching.php @@ -0,0 +1,443 @@ + + */ +class GoalTriggeredMatchRuleAllOfMatching implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GoalTriggeredMatchRule_allOf_matching'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'negated' => 'bool', + 'match_type' => '\OpenAPI\Client\Model\ChoiceMatchingOptions' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'negated' => null, + 'match_type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'negated' => false, + 'match_type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'negated' => 'negated', + 'match_type' => 'match_type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'negated' => 'setNegated', + 'match_type' => 'setMatchType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'negated' => 'getNegated', + 'match_type' => 'getMatchType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('negated', $data ?? [], null); + $this->setIfExists('match_type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets negated + * + * @return bool|null + */ + public function getNegated() + { + return $this->container['negated']; + } + + /** + * Sets negated + * + * @param bool|null $negated When true, the rule result is gonna be negated. example: `url contains \"test\"` with *negated* = true becomes `url does not contain \"test\"` + * + * @return self + */ + public function setNegated($negated) + { + if (is_null($negated)) { + throw new \InvalidArgumentException('non-nullable negated cannot be null'); + } + $this->container['negated'] = $negated; + + return $this; + } + + /** + * Gets match_type + * + * @return \OpenAPI\Client\Model\ChoiceMatchingOptions|null + */ + public function getMatchType() + { + return $this->container['match_type']; + } + + /** + * Sets match_type + * + * @param \OpenAPI\Client\Model\ChoiceMatchingOptions|null $match_type match_type + * + * @return self + */ + public function setMatchType($match_type) + { + if (is_null($match_type)) { + throw new \InvalidArgumentException('non-nullable match_type cannot be null'); + } + $this->container['match_type'] = $match_type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/GoalTriggeredMatchRulesTypes.php b/packages/Types/lib/Generated/Model/GoalTriggeredMatchRulesTypes.php new file mode 100644 index 0000000..83f00d9 --- /dev/null +++ b/packages/Types/lib/Generated/Model/GoalTriggeredMatchRulesTypes.php @@ -0,0 +1,59 @@ + + */ +class HourOfDayMatchRule implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'HourOfDayMatchRule'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'rule_type' => '\OpenAPI\Client\Model\HourOfDayMatchRulesTypes', + 'value' => 'float', + 'matching' => '\OpenAPI\Client\Model\HourOfDayMatchRuleAllOfMatching' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'rule_type' => null, + 'value' => null, + 'matching' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'rule_type' => false, + 'value' => false, + 'matching' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'rule_type' => 'rule_type', + 'value' => 'value', + 'matching' => 'matching' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'rule_type' => 'setRuleType', + 'value' => 'setValue', + 'matching' => 'setMatching' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'rule_type' => 'getRuleType', + 'value' => 'getValue', + 'matching' => 'getMatching' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('rule_type', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); + $this->setIfExists('matching', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['rule_type'] === null) { + $invalidProperties[] = "'rule_type' can't be null"; + } + if (!is_null($this->container['value']) && ($this->container['value'] > 24)) { + $invalidProperties[] = "invalid value for 'value', must be smaller than or equal to 24."; + } + + if (!is_null($this->container['value']) && ($this->container['value'] < 0)) { + $invalidProperties[] = "invalid value for 'value', must be bigger than or equal to 0."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets rule_type + * + * @return \OpenAPI\Client\Model\HourOfDayMatchRulesTypes + */ + public function getRuleType() + { + return $this->container['rule_type']; + } + + /** + * Sets rule_type + * + * @param \OpenAPI\Client\Model\HourOfDayMatchRulesTypes $rule_type rule_type + * + * @return self + */ + public function setRuleType($rule_type) + { + if (is_null($rule_type)) { + throw new \InvalidArgumentException('non-nullable rule_type cannot be null'); + } + $this->container['rule_type'] = $rule_type; + + return $this; + } + + /** + * Gets value + * + * @return float|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param float|null $value Hour of day used for matching + * + * @return self + */ + public function setValue($value) + { + if (is_null($value)) { + throw new \InvalidArgumentException('non-nullable value cannot be null'); + } + + if (($value > 24)) { + throw new \InvalidArgumentException('invalid value for $value when calling HourOfDayMatchRule., must be smaller than or equal to 24.'); + } + if (($value < 0)) { + throw new \InvalidArgumentException('invalid value for $value when calling HourOfDayMatchRule., must be bigger than or equal to 0.'); + } + + $this->container['value'] = $value; + + return $this; + } + + /** + * Gets matching + * + * @return \OpenAPI\Client\Model\HourOfDayMatchRuleAllOfMatching|null + */ + public function getMatching() + { + return $this->container['matching']; + } + + /** + * Sets matching + * + * @param \OpenAPI\Client\Model\HourOfDayMatchRuleAllOfMatching|null $matching matching + * + * @return self + */ + public function setMatching($matching) + { + if (is_null($matching)) { + throw new \InvalidArgumentException('non-nullable matching cannot be null'); + } + $this->container['matching'] = $matching; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/HourOfDayMatchRuleAllOfMatching.php b/packages/Types/lib/Generated/Model/HourOfDayMatchRuleAllOfMatching.php new file mode 100644 index 0000000..c6b3a81 --- /dev/null +++ b/packages/Types/lib/Generated/Model/HourOfDayMatchRuleAllOfMatching.php @@ -0,0 +1,443 @@ + + */ +class HourOfDayMatchRuleAllOfMatching implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'HourOfDayMatchRule_allOf_matching'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'negated' => 'bool', + 'match_type' => '\OpenAPI\Client\Model\NumericMatchingOptions' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'negated' => null, + 'match_type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'negated' => false, + 'match_type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'negated' => 'negated', + 'match_type' => 'match_type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'negated' => 'setNegated', + 'match_type' => 'setMatchType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'negated' => 'getNegated', + 'match_type' => 'getMatchType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('negated', $data ?? [], null); + $this->setIfExists('match_type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets negated + * + * @return bool|null + */ + public function getNegated() + { + return $this->container['negated']; + } + + /** + * Sets negated + * + * @param bool|null $negated When true, the rule result is gonna be negated. example: `url contains \"test\"` with *negated* = true becomes `url does not contain \"test\"` + * + * @return self + */ + public function setNegated($negated) + { + if (is_null($negated)) { + throw new \InvalidArgumentException('non-nullable negated cannot be null'); + } + $this->container['negated'] = $negated; + + return $this; + } + + /** + * Gets match_type + * + * @return \OpenAPI\Client\Model\NumericMatchingOptions|null + */ + public function getMatchType() + { + return $this->container['match_type']; + } + + /** + * Sets match_type + * + * @param \OpenAPI\Client\Model\NumericMatchingOptions|null $match_type match_type + * + * @return self + */ + public function setMatchType($match_type) + { + if (is_null($match_type)) { + throw new \InvalidArgumentException('non-nullable match_type cannot be null'); + } + $this->container['match_type'] = $match_type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/HourOfDayMatchRulesTypes.php b/packages/Types/lib/Generated/Model/HourOfDayMatchRulesTypes.php new file mode 100644 index 0000000..a58739a --- /dev/null +++ b/packages/Types/lib/Generated/Model/HourOfDayMatchRulesTypes.php @@ -0,0 +1,62 @@ + + */ +class ImportProjectDataSuccess implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ImportProjectDataSuccess'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'code' => 'int', + 'message' => 'string', + 'imported' => '\OpenAPI\Client\Model\ImportProjectDataSuccessAllOfImported' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'code' => 'int32', + 'message' => null, + 'imported' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'code' => false, + 'message' => false, + 'imported' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'code' => 'code', + 'message' => 'message', + 'imported' => 'imported' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'code' => 'setCode', + 'message' => 'setMessage', + 'imported' => 'setImported' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'code' => 'getCode', + 'message' => 'getMessage', + 'imported' => 'getImported' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('code', $data ?? [], null); + $this->setIfExists('message', $data ?? [], null); + $this->setIfExists('imported', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets code + * + * @return int|null + */ + public function getCode() + { + return $this->container['code']; + } + + /** + * Sets code + * + * @param int|null $code code + * + * @return self + */ + public function setCode($code) + { + if (is_null($code)) { + throw new \InvalidArgumentException('non-nullable code cannot be null'); + } + $this->container['code'] = $code; + + return $this; + } + + /** + * Gets message + * + * @return string|null + */ + public function getMessage() + { + return $this->container['message']; + } + + /** + * Sets message + * + * @param string|null $message message + * + * @return self + */ + public function setMessage($message) + { + if (is_null($message)) { + throw new \InvalidArgumentException('non-nullable message cannot be null'); + } + $this->container['message'] = $message; + + return $this; + } + + /** + * Gets imported + * + * @return \OpenAPI\Client\Model\ImportProjectDataSuccessAllOfImported|null + */ + public function getImported() + { + return $this->container['imported']; + } + + /** + * Sets imported + * + * @param \OpenAPI\Client\Model\ImportProjectDataSuccessAllOfImported|null $imported imported + * + * @return self + */ + public function setImported($imported) + { + if (is_null($imported)) { + throw new \InvalidArgumentException('non-nullable imported cannot be null'); + } + $this->container['imported'] = $imported; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/ImportProjectDataSuccessAllOfImported.php b/packages/Types/lib/Generated/Model/ImportProjectDataSuccessAllOfImported.php new file mode 100644 index 0000000..0adb74f --- /dev/null +++ b/packages/Types/lib/Generated/Model/ImportProjectDataSuccessAllOfImported.php @@ -0,0 +1,546 @@ + + */ +class ImportProjectDataSuccessAllOfImported implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ImportProjectDataSuccess_allOf_imported'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'experiences' => 'int[]', + 'audiences' => 'int[]', + 'locations' => 'int[]', + 'goals' => 'int[]', + 'hypothesis' => 'int[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'experiences' => null, + 'audiences' => null, + 'locations' => null, + 'goals' => null, + 'hypothesis' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'experiences' => false, + 'audiences' => false, + 'locations' => false, + 'goals' => false, + 'hypothesis' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'experiences' => 'experiences', + 'audiences' => 'audiences', + 'locations' => 'locations', + 'goals' => 'goals', + 'hypothesis' => 'hypothesis' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'experiences' => 'setExperiences', + 'audiences' => 'setAudiences', + 'locations' => 'setLocations', + 'goals' => 'setGoals', + 'hypothesis' => 'setHypothesis' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'experiences' => 'getExperiences', + 'audiences' => 'getAudiences', + 'locations' => 'getLocations', + 'goals' => 'getGoals', + 'hypothesis' => 'getHypothesis' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('experiences', $data ?? [], null); + $this->setIfExists('audiences', $data ?? [], null); + $this->setIfExists('locations', $data ?? [], null); + $this->setIfExists('goals', $data ?? [], null); + $this->setIfExists('hypothesis', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets experiences + * + * @return int[]|null + */ + public function getExperiences() + { + return $this->container['experiences']; + } + + /** + * Sets experiences + * + * @param int[]|null $experiences List of created experiences. Empty if nothing imported + * + * @return self + */ + public function setExperiences($experiences) + { + if (is_null($experiences)) { + throw new \InvalidArgumentException('non-nullable experiences cannot be null'); + } + $this->container['experiences'] = $experiences; + + return $this; + } + + /** + * Gets audiences + * + * @return int[]|null + */ + public function getAudiences() + { + return $this->container['audiences']; + } + + /** + * Sets audiences + * + * @param int[]|null $audiences List of created audiences. Empty if nothing imported + * + * @return self + */ + public function setAudiences($audiences) + { + if (is_null($audiences)) { + throw new \InvalidArgumentException('non-nullable audiences cannot be null'); + } + $this->container['audiences'] = $audiences; + + return $this; + } + + /** + * Gets locations + * + * @return int[]|null + */ + public function getLocations() + { + return $this->container['locations']; + } + + /** + * Sets locations + * + * @param int[]|null $locations List of created locations. Empty if nothing imported + * + * @return self + */ + public function setLocations($locations) + { + if (is_null($locations)) { + throw new \InvalidArgumentException('non-nullable locations cannot be null'); + } + $this->container['locations'] = $locations; + + return $this; + } + + /** + * Gets goals + * + * @return int[]|null + */ + public function getGoals() + { + return $this->container['goals']; + } + + /** + * Sets goals + * + * @param int[]|null $goals List of created goals. Empty if nothing imported + * + * @return self + */ + public function setGoals($goals) + { + if (is_null($goals)) { + throw new \InvalidArgumentException('non-nullable goals cannot be null'); + } + $this->container['goals'] = $goals; + + return $this; + } + + /** + * Gets hypothesis + * + * @return int[]|null + */ + public function getHypothesis() + { + return $this->container['hypothesis']; + } + + /** + * Sets hypothesis + * + * @param int[]|null $hypothesis List of created hypothesis. Empty if nothing imported + * + * @return self + */ + public function setHypothesis($hypothesis) + { + if (is_null($hypothesis)) { + throw new \InvalidArgumentException('non-nullable hypothesis cannot be null'); + } + $this->container['hypothesis'] = $hypothesis; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/IntegrationGA3.php b/packages/Types/lib/Generated/Model/IntegrationGA3.php new file mode 100644 index 0000000..3b8f468 --- /dev/null +++ b/packages/Types/lib/Generated/Model/IntegrationGA3.php @@ -0,0 +1,490 @@ + + */ +class IntegrationGA3 implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'IntegrationGA3'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'type' => 'string', + 'property_ua' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'type' => null, + 'property_ua' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'type' => false, + 'property_ua' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'type' => 'type', + 'property_ua' => 'property_UA' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'type' => 'setType', + 'property_ua' => 'setPropertyUa' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'type' => 'getType', + 'property_ua' => 'getPropertyUa' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_GA3 = 'ga3'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_GA3, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('property_ua', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + if (!is_null($this->container['property_ua']) && (mb_strlen($this->container['property_ua']) > 150)) { + $invalidProperties[] = "invalid value for 'property_ua', the character length must be smaller than or equal to 150."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type type + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets property_ua + * + * @return string|null + */ + public function getPropertyUa() + { + return $this->container['property_ua']; + } + + /** + * Sets property_ua + * + * @param string|null $property_ua Universal Analytics property to be used for tracking + * + * @return self + */ + public function setPropertyUa($property_ua) + { + if (is_null($property_ua)) { + array_push($this->openAPINullablesSetToNull, 'property_ua'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('property_ua', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($property_ua) && (mb_strlen($property_ua) > 150)) { + throw new \InvalidArgumentException('invalid length for $property_ua when calling IntegrationGA3., must be smaller than or equal to 150.'); + } + + $this->container['property_ua'] = $property_ua; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/IntegrationGA4.php b/packages/Types/lib/Generated/Model/IntegrationGA4.php new file mode 100644 index 0000000..12cfd7d --- /dev/null +++ b/packages/Types/lib/Generated/Model/IntegrationGA4.php @@ -0,0 +1,509 @@ + + */ +class IntegrationGA4 implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'IntegrationGA4'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'type' => 'string', + 'measurement_id' => 'string', + 'property_id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'type' => null, + 'measurement_id' => null, + 'property_id' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'type' => false, + 'measurement_id' => false, + 'property_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'type' => 'type', + 'measurement_id' => 'measurementId', + 'property_id' => 'propertyId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'type' => 'setType', + 'measurement_id' => 'setMeasurementId', + 'property_id' => 'setPropertyId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'type' => 'getType', + 'measurement_id' => 'getMeasurementId', + 'property_id' => 'getPropertyId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_GA4 = 'ga4'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_GA4, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('measurement_id', $data ?? [], null); + $this->setIfExists('property_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type type + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets measurement_id + * + * @return string|null + */ + public function getMeasurementId() + { + return $this->container['measurement_id']; + } + + /** + * Sets measurement_id + * + * @param string|null $measurement_id ID of the ga4 property where data will be sent. Used internally for API calls to GoogleAnalytics + * + * @return self + */ + public function setMeasurementId($measurement_id) + { + if (is_null($measurement_id)) { + throw new \InvalidArgumentException('non-nullable measurement_id cannot be null'); + } + $this->container['measurement_id'] = $measurement_id; + + return $this; + } + + /** + * Gets property_id + * + * @return string|null + */ + public function getPropertyId() + { + return $this->container['property_id']; + } + + /** + * Sets property_id + * + * @param string|null $property_id ID of the ga4 property where data will be sent. Used internally for API calls to GoogleAnalytics + * + * @return self + */ + public function setPropertyId($property_id) + { + if (is_null($property_id)) { + throw new \InvalidArgumentException('non-nullable property_id cannot be null'); + } + $this->container['property_id'] = $property_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/IntegrationGA4Base.php b/packages/Types/lib/Generated/Model/IntegrationGA4Base.php new file mode 100644 index 0000000..4fac833 --- /dev/null +++ b/packages/Types/lib/Generated/Model/IntegrationGA4Base.php @@ -0,0 +1,475 @@ + + */ +class IntegrationGA4Base implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'IntegrationGA4Base'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'type' => 'string', + 'measurement_id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'type' => null, + 'measurement_id' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'type' => false, + 'measurement_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'type' => 'type', + 'measurement_id' => 'measurementId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'type' => 'setType', + 'measurement_id' => 'setMeasurementId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'type' => 'getType', + 'measurement_id' => 'getMeasurementId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_GA4 = 'ga4'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_GA4, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('measurement_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type type + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets measurement_id + * + * @return string|null + */ + public function getMeasurementId() + { + return $this->container['measurement_id']; + } + + /** + * Sets measurement_id + * + * @param string|null $measurement_id ID of the ga4 property where data will be sent. Used internally for API calls to GoogleAnalytics + * + * @return self + */ + public function setMeasurementId($measurement_id) + { + if (is_null($measurement_id)) { + throw new \InvalidArgumentException('non-nullable measurement_id cannot be null'); + } + $this->container['measurement_id'] = $measurement_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/IntegrationProvider.php b/packages/Types/lib/Generated/Model/IntegrationProvider.php new file mode 100644 index 0000000..3b59c8b --- /dev/null +++ b/packages/Types/lib/Generated/Model/IntegrationProvider.php @@ -0,0 +1,111 @@ + + */ +class JsConditionMatchRule implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'JsConditionMatchRule'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'rule_type' => '\OpenAPI\Client\Model\JsConditionMatchRulesTypes', + 'value' => 'string', + 'matching' => '\OpenAPI\Client\Model\JsConditionMatchRuleAllOfMatching' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'rule_type' => null, + 'value' => null, + 'matching' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'rule_type' => false, + 'value' => false, + 'matching' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'rule_type' => 'rule_type', + 'value' => 'value', + 'matching' => 'matching' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'rule_type' => 'setRuleType', + 'value' => 'setValue', + 'matching' => 'setMatching' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'rule_type' => 'getRuleType', + 'value' => 'getValue', + 'matching' => 'getMatching' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('rule_type', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); + $this->setIfExists('matching', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['rule_type'] === null) { + $invalidProperties[] = "'rule_type' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets rule_type + * + * @return \OpenAPI\Client\Model\JsConditionMatchRulesTypes + */ + public function getRuleType() + { + return $this->container['rule_type']; + } + + /** + * Sets rule_type + * + * @param \OpenAPI\Client\Model\JsConditionMatchRulesTypes $rule_type rule_type + * + * @return self + */ + public function setRuleType($rule_type) + { + if (is_null($rule_type)) { + throw new \InvalidArgumentException('non-nullable rule_type cannot be null'); + } + $this->container['rule_type'] = $rule_type; + + return $this; + } + + /** + * Gets value + * + * @return string|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param string|null $value The JS code that would be executed when rule is checked. The return value of this JS code is what is gonna be matched against **true**(or **false** if **matching.negated = true** is provided) + * + * @return self + */ + public function setValue($value) + { + if (is_null($value)) { + throw new \InvalidArgumentException('non-nullable value cannot be null'); + } + $this->container['value'] = $value; + + return $this; + } + + /** + * Gets matching + * + * @return \OpenAPI\Client\Model\JsConditionMatchRuleAllOfMatching|null + */ + public function getMatching() + { + return $this->container['matching']; + } + + /** + * Sets matching + * + * @param \OpenAPI\Client\Model\JsConditionMatchRuleAllOfMatching|null $matching matching + * + * @return self + */ + public function setMatching($matching) + { + if (is_null($matching)) { + throw new \InvalidArgumentException('non-nullable matching cannot be null'); + } + $this->container['matching'] = $matching; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/JsConditionMatchRuleAllOfMatching.php b/packages/Types/lib/Generated/Model/JsConditionMatchRuleAllOfMatching.php new file mode 100644 index 0000000..45cf2d1 --- /dev/null +++ b/packages/Types/lib/Generated/Model/JsConditionMatchRuleAllOfMatching.php @@ -0,0 +1,443 @@ + + */ +class JsConditionMatchRuleAllOfMatching implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'JsConditionMatchRule_allOf_matching'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'negated' => 'bool', + 'match_type' => '\OpenAPI\Client\Model\ChoiceMatchingOptions' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'negated' => null, + 'match_type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'negated' => false, + 'match_type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'negated' => 'negated', + 'match_type' => 'match_type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'negated' => 'setNegated', + 'match_type' => 'setMatchType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'negated' => 'getNegated', + 'match_type' => 'getMatchType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('negated', $data ?? [], null); + $this->setIfExists('match_type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets negated + * + * @return bool|null + */ + public function getNegated() + { + return $this->container['negated']; + } + + /** + * Sets negated + * + * @param bool|null $negated When true, the rule result is gonna be negated. example: `url contains \"test\"` with *negated* = true becomes `url does not contain \"test\"` + * + * @return self + */ + public function setNegated($negated) + { + if (is_null($negated)) { + throw new \InvalidArgumentException('non-nullable negated cannot be null'); + } + $this->container['negated'] = $negated; + + return $this; + } + + /** + * Gets match_type + * + * @return \OpenAPI\Client\Model\ChoiceMatchingOptions|null + */ + public function getMatchType() + { + return $this->container['match_type']; + } + + /** + * Sets match_type + * + * @param \OpenAPI\Client\Model\ChoiceMatchingOptions|null $match_type match_type + * + * @return self + */ + public function setMatchType($match_type) + { + if (is_null($match_type)) { + throw new \InvalidArgumentException('non-nullable match_type cannot be null'); + } + $this->container['match_type'] = $match_type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/JsConditionMatchRulesTypes.php b/packages/Types/lib/Generated/Model/JsConditionMatchRulesTypes.php new file mode 100644 index 0000000..05e1bc6 --- /dev/null +++ b/packages/Types/lib/Generated/Model/JsConditionMatchRulesTypes.php @@ -0,0 +1,59 @@ + + */ +class KeyValueMatchRulesTypes implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'KeyValueMatchRulesTypes'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/LanguageMatchRule.php b/packages/Types/lib/Generated/Model/LanguageMatchRule.php new file mode 100644 index 0000000..627fa6c --- /dev/null +++ b/packages/Types/lib/Generated/Model/LanguageMatchRule.php @@ -0,0 +1,495 @@ + + */ +class LanguageMatchRule implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'LanguageMatchRule'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'rule_type' => '\OpenAPI\Client\Model\LanguageMatchRulesTypes', + 'value' => 'string', + 'matching' => '\OpenAPI\Client\Model\LanguageMatchRuleAllOfMatching' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'rule_type' => null, + 'value' => null, + 'matching' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'rule_type' => false, + 'value' => false, + 'matching' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'rule_type' => 'rule_type', + 'value' => 'value', + 'matching' => 'matching' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'rule_type' => 'setRuleType', + 'value' => 'setValue', + 'matching' => 'setMatching' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'rule_type' => 'getRuleType', + 'value' => 'getValue', + 'matching' => 'getMatching' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('rule_type', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); + $this->setIfExists('matching', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['rule_type'] === null) { + $invalidProperties[] = "'rule_type' can't be null"; + } + if (!is_null($this->container['value']) && (mb_strlen($this->container['value']) > 2)) { + $invalidProperties[] = "invalid value for 'value', the character length must be smaller than or equal to 2."; + } + + if (!is_null($this->container['value']) && (mb_strlen($this->container['value']) < 2)) { + $invalidProperties[] = "invalid value for 'value', the character length must be bigger than or equal to 2."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets rule_type + * + * @return \OpenAPI\Client\Model\LanguageMatchRulesTypes + */ + public function getRuleType() + { + return $this->container['rule_type']; + } + + /** + * Sets rule_type + * + * @param \OpenAPI\Client\Model\LanguageMatchRulesTypes $rule_type rule_type + * + * @return self + */ + public function setRuleType($rule_type) + { + if (is_null($rule_type)) { + throw new \InvalidArgumentException('non-nullable rule_type cannot be null'); + } + $this->container['rule_type'] = $rule_type; + + return $this; + } + + /** + * Gets value + * + * @return string|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param string|null $value The 2 letter ISO language code used for matching + * + * @return self + */ + public function setValue($value) + { + if (is_null($value)) { + throw new \InvalidArgumentException('non-nullable value cannot be null'); + } + if ((mb_strlen($value) > 2)) { + throw new \InvalidArgumentException('invalid length for $value when calling LanguageMatchRule., must be smaller than or equal to 2.'); + } + if ((mb_strlen($value) < 2)) { + throw new \InvalidArgumentException('invalid length for $value when calling LanguageMatchRule., must be bigger than or equal to 2.'); + } + + $this->container['value'] = $value; + + return $this; + } + + /** + * Gets matching + * + * @return \OpenAPI\Client\Model\LanguageMatchRuleAllOfMatching|null + */ + public function getMatching() + { + return $this->container['matching']; + } + + /** + * Sets matching + * + * @param \OpenAPI\Client\Model\LanguageMatchRuleAllOfMatching|null $matching matching + * + * @return self + */ + public function setMatching($matching) + { + if (is_null($matching)) { + throw new \InvalidArgumentException('non-nullable matching cannot be null'); + } + $this->container['matching'] = $matching; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/LanguageMatchRuleAllOfMatching.php b/packages/Types/lib/Generated/Model/LanguageMatchRuleAllOfMatching.php new file mode 100644 index 0000000..5d738bf --- /dev/null +++ b/packages/Types/lib/Generated/Model/LanguageMatchRuleAllOfMatching.php @@ -0,0 +1,443 @@ + + */ +class LanguageMatchRuleAllOfMatching implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'LanguageMatchRule_allOf_matching'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'negated' => 'bool', + 'match_type' => '\OpenAPI\Client\Model\ChoiceMatchingOptions' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'negated' => null, + 'match_type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'negated' => false, + 'match_type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'negated' => 'negated', + 'match_type' => 'match_type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'negated' => 'setNegated', + 'match_type' => 'setMatchType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'negated' => 'getNegated', + 'match_type' => 'getMatchType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('negated', $data ?? [], null); + $this->setIfExists('match_type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets negated + * + * @return bool|null + */ + public function getNegated() + { + return $this->container['negated']; + } + + /** + * Sets negated + * + * @param bool|null $negated When true, the rule result is gonna be negated. example: `url contains \"test\"` with *negated* = true becomes `url does not contain \"test\"` + * + * @return self + */ + public function setNegated($negated) + { + if (is_null($negated)) { + throw new \InvalidArgumentException('non-nullable negated cannot be null'); + } + $this->container['negated'] = $negated; + + return $this; + } + + /** + * Gets match_type + * + * @return \OpenAPI\Client\Model\ChoiceMatchingOptions|null + */ + public function getMatchType() + { + return $this->container['match_type']; + } + + /** + * Sets match_type + * + * @param \OpenAPI\Client\Model\ChoiceMatchingOptions|null $match_type match_type + * + * @return self + */ + public function setMatchType($match_type) + { + if (is_null($match_type)) { + throw new \InvalidArgumentException('non-nullable match_type cannot be null'); + } + $this->container['match_type'] = $match_type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/LanguageMatchRulesTypes.php b/packages/Types/lib/Generated/Model/LanguageMatchRulesTypes.php new file mode 100644 index 0000000..70eb3c8 --- /dev/null +++ b/packages/Types/lib/Generated/Model/LanguageMatchRulesTypes.php @@ -0,0 +1,59 @@ + + */ +class LocationTrigger implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = 'type'; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'LocationTrigger'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'type' => 'string', + 'selector' => 'string', + 'events' => '\OpenAPI\Client\Model\LocationDomTriggerEvents[]', + 'js' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'type' => null, + 'selector' => null, + 'events' => null, + 'js' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'type' => false, + 'selector' => false, + 'events' => false, + 'js' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'type' => 'type', + 'selector' => 'selector', + 'events' => 'events', + 'js' => 'js' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'type' => 'setType', + 'selector' => 'setSelector', + 'events' => 'setEvents', + 'js' => 'setJs' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'type' => 'getType', + 'selector' => 'getSelector', + 'events' => 'getEvents', + 'js' => 'getJs' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_DOM_ELEMENT = 'dom_element'; + public const TYPE_CALLBACK = 'callback'; + public const TYPE_MANUAL = 'manual'; + public const TYPE_UPON_RUN = 'upon_run'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_DOM_ELEMENT, + self::TYPE_CALLBACK, + self::TYPE_MANUAL, + self::TYPE_UPON_RUN, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('selector', $data ?? [], null); + $this->setIfExists('events', $data ?? [], null); + $this->setIfExists('js', $data ?? [], null); + + // Initialize discriminator property with the model name. + $this->container['type'] = static::$openAPIModelName; + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['selector'] === null) { + $invalidProperties[] = "'selector' can't be null"; + } + if ($this->container['events'] === null) { + $invalidProperties[] = "'events' can't be null"; + } + if ($this->container['js'] === null) { + $invalidProperties[] = "'js' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type type + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets selector + * + * @return string + */ + public function getSelector() + { + return $this->container['selector']; + } + + /** + * Sets selector + * + * @param string $selector Describes html selector + * + * @return self + */ + public function setSelector($selector) + { + if (is_null($selector)) { + throw new \InvalidArgumentException('non-nullable selector cannot be null'); + } + $this->container['selector'] = $selector; + + return $this; + } + + /** + * Gets events + * + * @return \OpenAPI\Client\Model\LocationDomTriggerEvents[] + */ + public function getEvents() + { + return $this->container['events']; + } + + /** + * Sets events + * + * @param \OpenAPI\Client\Model\LocationDomTriggerEvents[] $events Events for LocationTriggerDomElement + * + * @return self + */ + public function setEvents($events) + { + if (is_null($events)) { + throw new \InvalidArgumentException('non-nullable events cannot be null'); + } + $this->container['events'] = $events; + + return $this; + } + + /** + * Gets js + * + * @return string + */ + public function getJs() + { + return $this->container['js']; + } + + /** + * Sets js + * + * @param string $js Describes the js callback that will be executed in order to fire the experience. It is called with two arguments: - `activate` - a function that should be called when the experience should be activated - `options` - an object with the following properties: - `locationId` - id of the location that is being activated - `isActive` - boolean flag that indicates if the location is active Example: ``` function(activate, options) { if (options.isActive) { setTimeout(function() { /_* it activates the experiences 1 second after the location trigger is initialized - at the load of the tracking script*_/ activate(); }, 1000); } } ``` + * + * @return self + */ + public function setJs($js) + { + if (is_null($js)) { + throw new \InvalidArgumentException('non-nullable js cannot be null'); + } + $this->container['js'] = $js; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/LocationTriggerBase.php b/packages/Types/lib/Generated/Model/LocationTriggerBase.php new file mode 100644 index 0000000..c9b8508 --- /dev/null +++ b/packages/Types/lib/Generated/Model/LocationTriggerBase.php @@ -0,0 +1,412 @@ + + */ +class LocationTriggerBase implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'LocationTriggerBase'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'type' => '\OpenAPI\Client\Model\LocationTriggerTypes' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return \OpenAPI\Client\Model\LocationTriggerTypes + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param \OpenAPI\Client\Model\LocationTriggerTypes $type type + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/LocationTriggerCallback.php b/packages/Types/lib/Generated/Model/LocationTriggerCallback.php new file mode 100644 index 0000000..8b7c629 --- /dev/null +++ b/packages/Types/lib/Generated/Model/LocationTriggerCallback.php @@ -0,0 +1,481 @@ + + */ +class LocationTriggerCallback implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'LocationTriggerCallback'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'type' => 'string', + 'js' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'type' => null, + 'js' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'type' => false, + 'js' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'type' => 'type', + 'js' => 'js' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'type' => 'setType', + 'js' => 'setJs' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'type' => 'getType', + 'js' => 'getJs' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_CALLBACK = 'callback'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_CALLBACK, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('js', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['js'] === null) { + $invalidProperties[] = "'js' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type type + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets js + * + * @return string + */ + public function getJs() + { + return $this->container['js']; + } + + /** + * Sets js + * + * @param string $js Describes the js callback that will be executed in order to fire the experience. It is called with two arguments: - `activate` - a function that should be called when the experience should be activated - `options` - an object with the following properties: - `locationId` - id of the location that is being activated - `isActive` - boolean flag that indicates if the location is active Example: ``` function(activate, options) { if (options.isActive) { setTimeout(function() { /_* it activates the experiences 1 second after the location trigger is initialized - at the load of the tracking script*_/ activate(); }, 1000); } } ``` + * + * @return self + */ + public function setJs($js) + { + if (is_null($js)) { + throw new \InvalidArgumentException('non-nullable js cannot be null'); + } + $this->container['js'] = $js; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/LocationTriggerDomElement.php b/packages/Types/lib/Generated/Model/LocationTriggerDomElement.php new file mode 100644 index 0000000..6dcff01 --- /dev/null +++ b/packages/Types/lib/Generated/Model/LocationTriggerDomElement.php @@ -0,0 +1,518 @@ + + */ +class LocationTriggerDomElement implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'LocationTriggerDomElement'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'type' => 'string', + 'selector' => 'string', + 'events' => '\OpenAPI\Client\Model\LocationDomTriggerEvents[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'type' => null, + 'selector' => null, + 'events' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'type' => false, + 'selector' => false, + 'events' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'type' => 'type', + 'selector' => 'selector', + 'events' => 'events' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'type' => 'setType', + 'selector' => 'setSelector', + 'events' => 'setEvents' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'type' => 'getType', + 'selector' => 'getSelector', + 'events' => 'getEvents' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_DOM_ELEMENT = 'dom_element'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_DOM_ELEMENT, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('selector', $data ?? [], null); + $this->setIfExists('events', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['selector'] === null) { + $invalidProperties[] = "'selector' can't be null"; + } + if ($this->container['events'] === null) { + $invalidProperties[] = "'events' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type type + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets selector + * + * @return string + */ + public function getSelector() + { + return $this->container['selector']; + } + + /** + * Sets selector + * + * @param string $selector Describes html selector + * + * @return self + */ + public function setSelector($selector) + { + if (is_null($selector)) { + throw new \InvalidArgumentException('non-nullable selector cannot be null'); + } + $this->container['selector'] = $selector; + + return $this; + } + + /** + * Gets events + * + * @return \OpenAPI\Client\Model\LocationDomTriggerEvents[] + */ + public function getEvents() + { + return $this->container['events']; + } + + /** + * Sets events + * + * @param \OpenAPI\Client\Model\LocationDomTriggerEvents[] $events Events for LocationTriggerDomElement + * + * @return self + */ + public function setEvents($events) + { + if (is_null($events)) { + throw new \InvalidArgumentException('non-nullable events cannot be null'); + } + $this->container['events'] = $events; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/LocationTriggerManual.php b/packages/Types/lib/Generated/Model/LocationTriggerManual.php new file mode 100644 index 0000000..68e8467 --- /dev/null +++ b/packages/Types/lib/Generated/Model/LocationTriggerManual.php @@ -0,0 +1,444 @@ + + */ +class LocationTriggerManual implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'LocationTriggerManual'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_MANUAL = 'manual'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_MANUAL, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type type + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/LocationTriggerTypes.php b/packages/Types/lib/Generated/Model/LocationTriggerTypes.php new file mode 100644 index 0000000..00b3e24 --- /dev/null +++ b/packages/Types/lib/Generated/Model/LocationTriggerTypes.php @@ -0,0 +1,69 @@ + + */ +class LocationTriggerUponRun implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'LocationTriggerUponRun'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_UPON_RUN = 'upon_run'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_UPON_RUN, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type type + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/MinuteOfHourMatchRule.php b/packages/Types/lib/Generated/Model/MinuteOfHourMatchRule.php new file mode 100644 index 0000000..80c1507 --- /dev/null +++ b/packages/Types/lib/Generated/Model/MinuteOfHourMatchRule.php @@ -0,0 +1,496 @@ + + */ +class MinuteOfHourMatchRule implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'MinuteOfHourMatchRule'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'rule_type' => '\OpenAPI\Client\Model\MinuteOfHourMatchRulesTypes', + 'value' => 'float', + 'matching' => '\OpenAPI\Client\Model\MinuteOfHourMatchRuleAllOfMatching' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'rule_type' => null, + 'value' => null, + 'matching' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'rule_type' => false, + 'value' => false, + 'matching' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'rule_type' => 'rule_type', + 'value' => 'value', + 'matching' => 'matching' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'rule_type' => 'setRuleType', + 'value' => 'setValue', + 'matching' => 'setMatching' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'rule_type' => 'getRuleType', + 'value' => 'getValue', + 'matching' => 'getMatching' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('rule_type', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); + $this->setIfExists('matching', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['rule_type'] === null) { + $invalidProperties[] = "'rule_type' can't be null"; + } + if (!is_null($this->container['value']) && ($this->container['value'] > 60)) { + $invalidProperties[] = "invalid value for 'value', must be smaller than or equal to 60."; + } + + if (!is_null($this->container['value']) && ($this->container['value'] < 1)) { + $invalidProperties[] = "invalid value for 'value', must be bigger than or equal to 1."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets rule_type + * + * @return \OpenAPI\Client\Model\MinuteOfHourMatchRulesTypes + */ + public function getRuleType() + { + return $this->container['rule_type']; + } + + /** + * Sets rule_type + * + * @param \OpenAPI\Client\Model\MinuteOfHourMatchRulesTypes $rule_type rule_type + * + * @return self + */ + public function setRuleType($rule_type) + { + if (is_null($rule_type)) { + throw new \InvalidArgumentException('non-nullable rule_type cannot be null'); + } + $this->container['rule_type'] = $rule_type; + + return $this; + } + + /** + * Gets value + * + * @return float|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param float|null $value Minute of hour used for matching + * + * @return self + */ + public function setValue($value) + { + if (is_null($value)) { + throw new \InvalidArgumentException('non-nullable value cannot be null'); + } + + if (($value > 60)) { + throw new \InvalidArgumentException('invalid value for $value when calling MinuteOfHourMatchRule., must be smaller than or equal to 60.'); + } + if (($value < 1)) { + throw new \InvalidArgumentException('invalid value for $value when calling MinuteOfHourMatchRule., must be bigger than or equal to 1.'); + } + + $this->container['value'] = $value; + + return $this; + } + + /** + * Gets matching + * + * @return \OpenAPI\Client\Model\MinuteOfHourMatchRuleAllOfMatching|null + */ + public function getMatching() + { + return $this->container['matching']; + } + + /** + * Sets matching + * + * @param \OpenAPI\Client\Model\MinuteOfHourMatchRuleAllOfMatching|null $matching matching + * + * @return self + */ + public function setMatching($matching) + { + if (is_null($matching)) { + throw new \InvalidArgumentException('non-nullable matching cannot be null'); + } + $this->container['matching'] = $matching; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/MinuteOfHourMatchRuleAllOfMatching.php b/packages/Types/lib/Generated/Model/MinuteOfHourMatchRuleAllOfMatching.php new file mode 100644 index 0000000..9e14a0e --- /dev/null +++ b/packages/Types/lib/Generated/Model/MinuteOfHourMatchRuleAllOfMatching.php @@ -0,0 +1,443 @@ + + */ +class MinuteOfHourMatchRuleAllOfMatching implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'MinuteOfHourMatchRule_allOf_matching'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'negated' => 'bool', + 'match_type' => '\OpenAPI\Client\Model\NumericMatchingOptions' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'negated' => null, + 'match_type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'negated' => false, + 'match_type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'negated' => 'negated', + 'match_type' => 'match_type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'negated' => 'setNegated', + 'match_type' => 'setMatchType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'negated' => 'getNegated', + 'match_type' => 'getMatchType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('negated', $data ?? [], null); + $this->setIfExists('match_type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets negated + * + * @return bool|null + */ + public function getNegated() + { + return $this->container['negated']; + } + + /** + * Sets negated + * + * @param bool|null $negated When true, the rule result is gonna be negated. example: `url contains \"test\"` with *negated* = true becomes `url does not contain \"test\"` + * + * @return self + */ + public function setNegated($negated) + { + if (is_null($negated)) { + throw new \InvalidArgumentException('non-nullable negated cannot be null'); + } + $this->container['negated'] = $negated; + + return $this; + } + + /** + * Gets match_type + * + * @return \OpenAPI\Client\Model\NumericMatchingOptions|null + */ + public function getMatchType() + { + return $this->container['match_type']; + } + + /** + * Sets match_type + * + * @param \OpenAPI\Client\Model\NumericMatchingOptions|null $match_type match_type + * + * @return self + */ + public function setMatchType($match_type) + { + if (is_null($match_type)) { + throw new \InvalidArgumentException('non-nullable match_type cannot be null'); + } + $this->container['match_type'] = $match_type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/MinuteOfHourMatchRulesTypes.php b/packages/Types/lib/Generated/Model/MinuteOfHourMatchRulesTypes.php new file mode 100644 index 0000000..1d8f581 --- /dev/null +++ b/packages/Types/lib/Generated/Model/MinuteOfHourMatchRulesTypes.php @@ -0,0 +1,62 @@ + + */ +class MultipageExperiencePage implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'MultipageExperiencePage'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'string', + 'name' => 'string', + 'url' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'name' => null, + 'url' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'name' => false, + 'url' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'name' => 'name', + 'url' => 'url' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'name' => 'setName', + 'url' => 'setUrl' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'name' => 'getName', + 'url' => 'getUrl' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('url', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!is_null($this->container['id']) && (mb_strlen($this->container['id']) > 2)) { + $invalidProperties[] = "invalid value for 'id', the character length must be smaller than or equal to 2."; + } + + if (!is_null($this->container['id']) && (mb_strlen($this->container['id']) < 1)) { + $invalidProperties[] = "invalid value for 'id', the character length must be bigger than or equal to 1."; + } + + if (!is_null($this->container['id']) && !preg_match("/^[0-9a-z]{1,2}$/", $this->container['id'])) { + $invalidProperties[] = "invalid value for 'id', must be conform to the pattern /^[0-9a-z]{1,2}$/."; + } + + if (!is_null($this->container['name']) && (mb_strlen($this->container['name']) > 200)) { + $invalidProperties[] = "invalid value for 'name', the character length must be smaller than or equal to 200."; + } + + if (!is_null($this->container['url']) && (mb_strlen($this->container['url']) > 2048)) { + $invalidProperties[] = "invalid value for 'url', the character length must be smaller than or equal to 2048."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id The ID of the page. + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + if ((mb_strlen($id) > 2)) { + throw new \InvalidArgumentException('invalid length for $id when calling MultipageExperiencePage., must be smaller than or equal to 2.'); + } + if ((mb_strlen($id) < 1)) { + throw new \InvalidArgumentException('invalid length for $id when calling MultipageExperiencePage., must be bigger than or equal to 1.'); + } + if ((!preg_match("/^[0-9a-z]{1,2}$/", ObjectSerializer::toString($id)))) { + throw new \InvalidArgumentException("invalid value for \$id when calling MultipageExperiencePage., must conform to the pattern /^[0-9a-z]{1,2}$/."); + } + + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name Name of the page + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + if ((mb_strlen($name) > 200)) { + throw new \InvalidArgumentException('invalid length for $name when calling MultipageExperiencePage., must be smaller than or equal to 200.'); + } + + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets url + * + * @return string|null + */ + public function getUrl() + { + return $this->container['url']; + } + + /** + * Sets url + * + * @param string|null $url The url of page to load + * + * @return self + */ + public function setUrl($url) + { + if (is_null($url)) { + throw new \InvalidArgumentException('non-nullable url cannot be null'); + } + if ((mb_strlen($url) > 2048)) { + throw new \InvalidArgumentException('invalid length for $url when calling MultipageExperiencePage., must be smaller than or equal to 2048.'); + } + + $this->container['url'] = $url; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/NoSettingsGoal.php b/packages/Types/lib/Generated/Model/NoSettingsGoal.php new file mode 100644 index 0000000..ef0da22 --- /dev/null +++ b/packages/Types/lib/Generated/Model/NoSettingsGoal.php @@ -0,0 +1,588 @@ + + */ +class NoSettingsGoal implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'NoSettingsGoal'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'string', + 'name' => 'string', + 'key' => 'string', + 'type' => 'string', + 'rules' => '\OpenAPI\Client\Model\RuleObject' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'name' => null, + 'key' => null, + 'type' => null, + 'rules' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'name' => false, + 'key' => false, + 'type' => false, + 'rules' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'name' => 'name', + 'key' => 'key', + 'type' => 'type', + 'rules' => 'rules' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'name' => 'setName', + 'key' => 'setKey', + 'type' => 'setType', + 'rules' => 'setRules' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'name' => 'getName', + 'key' => 'getKey', + 'type' => 'getType', + 'rules' => 'getRules' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_ADVANCED = 'advanced'; + public const TYPE_VISITS_PAGE = 'visits_page'; + public const TYPE_CODE_TRIGGER = 'code_trigger'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_ADVANCED, + self::TYPE_VISITS_PAGE, + self::TYPE_CODE_TRIGGER, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('key', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('rules', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id Goal ID + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name Goal Name. + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets key + * + * @return string|null + */ + public function getKey() + { + return $this->container['key']; + } + + /** + * Sets key + * + * @param string|null $key Goal Key + * + * @return self + */ + public function setKey($key) + { + if (is_null($key)) { + throw new \InvalidArgumentException('non-nullable key cannot be null'); + } + $this->container['key'] = $key; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type type + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets rules + * + * @return \OpenAPI\Client\Model\RuleObject|null + */ + public function getRules() + { + return $this->container['rules']; + } + + /** + * Sets rules + * + * @param \OpenAPI\Client\Model\RuleObject|null $rules rules + * + * @return self + */ + public function setRules($rules) + { + if (is_null($rules)) { + array_push($this->openAPINullablesSetToNull, 'rules'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('rules', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['rules'] = $rules; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/NumericMatchRulesTypes.php b/packages/Types/lib/Generated/Model/NumericMatchRulesTypes.php new file mode 100644 index 0000000..cad3dbd --- /dev/null +++ b/packages/Types/lib/Generated/Model/NumericMatchRulesTypes.php @@ -0,0 +1,74 @@ + + */ +class NumericOutlier implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = 'detection_type'; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'NumericOutlier'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'detection_type' => 'string', + 'min' => '\OpenAPI\Client\Model\NumericOutlierPercentileAllOfMin', + 'max' => '\OpenAPI\Client\Model\NumericOutlierPercentileAllOfMax' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'detection_type' => null, + 'min' => null, + 'max' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'detection_type' => false, + 'min' => false, + 'max' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'detection_type' => 'detection_type', + 'min' => 'min', + 'max' => 'max' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'detection_type' => 'setDetectionType', + 'min' => 'setMin', + 'max' => 'setMax' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'detection_type' => 'getDetectionType', + 'min' => 'getMin', + 'max' => 'getMax' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const DETECTION_TYPE_PERCENTILE = 'percentile'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getDetectionTypeAllowableValues() + { + return [ + self::DETECTION_TYPE_PERCENTILE, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('detection_type', $data ?? [], null); + $this->setIfExists('min', $data ?? [], null); + $this->setIfExists('max', $data ?? [], null); + + // Initialize discriminator property with the model name. + $this->container['detection_type'] = static::$openAPIModelName; + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['detection_type'] === null) { + $invalidProperties[] = "'detection_type' can't be null"; + } + $allowedValues = $this->getDetectionTypeAllowableValues(); + if (!is_null($this->container['detection_type']) && !in_array($this->container['detection_type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'detection_type', must be one of '%s'", + $this->container['detection_type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets detection_type + * + * @return string + */ + public function getDetectionType() + { + return $this->container['detection_type']; + } + + /** + * Sets detection_type + * + * @param string $detection_type detection_type + * + * @return self + */ + public function setDetectionType($detection_type) + { + if (is_null($detection_type)) { + throw new \InvalidArgumentException('non-nullable detection_type cannot be null'); + } + $allowedValues = $this->getDetectionTypeAllowableValues(); + if (!in_array($detection_type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'detection_type', must be one of '%s'", + $detection_type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['detection_type'] = $detection_type; + + return $this; + } + + /** + * Gets min + * + * @return \OpenAPI\Client\Model\NumericOutlierPercentileAllOfMin|null + */ + public function getMin() + { + return $this->container['min']; + } + + /** + * Sets min + * + * @param \OpenAPI\Client\Model\NumericOutlierPercentileAllOfMin|null $min min + * + * @return self + */ + public function setMin($min) + { + if (is_null($min)) { + throw new \InvalidArgumentException('non-nullable min cannot be null'); + } + $this->container['min'] = $min; + + return $this; + } + + /** + * Gets max + * + * @return \OpenAPI\Client\Model\NumericOutlierPercentileAllOfMax|null + */ + public function getMax() + { + return $this->container['max']; + } + + /** + * Sets max + * + * @param \OpenAPI\Client\Model\NumericOutlierPercentileAllOfMax|null $max max + * + * @return self + */ + public function setMax($max) + { + if (is_null($max)) { + throw new \InvalidArgumentException('non-nullable max cannot be null'); + } + $this->container['max'] = $max; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/NumericOutlierBase.php b/packages/Types/lib/Generated/Model/NumericOutlierBase.php new file mode 100644 index 0000000..4908e01 --- /dev/null +++ b/packages/Types/lib/Generated/Model/NumericOutlierBase.php @@ -0,0 +1,412 @@ + + */ +class NumericOutlierBase implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'NumericOutlierBase'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'detection_type' => '\OpenAPI\Client\Model\NumericOutlierTypes' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'detection_type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'detection_type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'detection_type' => 'detection_type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'detection_type' => 'setDetectionType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'detection_type' => 'getDetectionType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('detection_type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['detection_type'] === null) { + $invalidProperties[] = "'detection_type' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets detection_type + * + * @return \OpenAPI\Client\Model\NumericOutlierTypes + */ + public function getDetectionType() + { + return $this->container['detection_type']; + } + + /** + * Sets detection_type + * + * @param \OpenAPI\Client\Model\NumericOutlierTypes $detection_type detection_type + * + * @return self + */ + public function setDetectionType($detection_type) + { + if (is_null($detection_type)) { + throw new \InvalidArgumentException('non-nullable detection_type cannot be null'); + } + $this->container['detection_type'] = $detection_type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/NumericOutlierMinMax.php b/packages/Types/lib/Generated/Model/NumericOutlierMinMax.php new file mode 100644 index 0000000..dd0b0b3 --- /dev/null +++ b/packages/Types/lib/Generated/Model/NumericOutlierMinMax.php @@ -0,0 +1,512 @@ + + */ +class NumericOutlierMinMax implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'NumericOutlierMinMax'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'detection_type' => 'string', + 'min' => 'float', + 'max' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'detection_type' => null, + 'min' => null, + 'max' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'detection_type' => false, + 'min' => false, + 'max' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'detection_type' => 'detection_type', + 'min' => 'min', + 'max' => 'max' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'detection_type' => 'setDetectionType', + 'min' => 'setMin', + 'max' => 'setMax' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'detection_type' => 'getDetectionType', + 'min' => 'getMin', + 'max' => 'getMax' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const DETECTION_TYPE_MIN_MAX = 'min_max'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getDetectionTypeAllowableValues() + { + return [ + self::DETECTION_TYPE_MIN_MAX, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('detection_type', $data ?? [], null); + $this->setIfExists('min', $data ?? [], null); + $this->setIfExists('max', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['detection_type'] === null) { + $invalidProperties[] = "'detection_type' can't be null"; + } + $allowedValues = $this->getDetectionTypeAllowableValues(); + if (!is_null($this->container['detection_type']) && !in_array($this->container['detection_type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'detection_type', must be one of '%s'", + $this->container['detection_type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets detection_type + * + * @return string + */ + public function getDetectionType() + { + return $this->container['detection_type']; + } + + /** + * Sets detection_type + * + * @param string $detection_type detection_type + * + * @return self + */ + public function setDetectionType($detection_type) + { + if (is_null($detection_type)) { + throw new \InvalidArgumentException('non-nullable detection_type cannot be null'); + } + $allowedValues = $this->getDetectionTypeAllowableValues(); + if (!in_array($detection_type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'detection_type', must be one of '%s'", + $detection_type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['detection_type'] = $detection_type; + + return $this; + } + + /** + * Gets min + * + * @return float|null + */ + public function getMin() + { + return $this->container['min']; + } + + /** + * Sets min + * + * @param float|null $min Minimum value for the outlier detection, under which, the value is considered an outlier + * + * @return self + */ + public function setMin($min) + { + if (is_null($min)) { + throw new \InvalidArgumentException('non-nullable min cannot be null'); + } + $this->container['min'] = $min; + + return $this; + } + + /** + * Gets max + * + * @return float|null + */ + public function getMax() + { + return $this->container['max']; + } + + /** + * Sets max + * + * @param float|null $max Maximum value for the outlier detection, over which, the value is considered an outlier + * + * @return self + */ + public function setMax($max) + { + if (is_null($max)) { + throw new \InvalidArgumentException('non-nullable max cannot be null'); + } + $this->container['max'] = $max; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/NumericOutlierNone.php b/packages/Types/lib/Generated/Model/NumericOutlierNone.php new file mode 100644 index 0000000..bf4ec1b --- /dev/null +++ b/packages/Types/lib/Generated/Model/NumericOutlierNone.php @@ -0,0 +1,444 @@ + + */ +class NumericOutlierNone implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'NumericOutlierNone'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'detection_type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'detection_type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'detection_type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'detection_type' => 'detection_type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'detection_type' => 'setDetectionType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'detection_type' => 'getDetectionType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const DETECTION_TYPE_NONE = 'none'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getDetectionTypeAllowableValues() + { + return [ + self::DETECTION_TYPE_NONE, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('detection_type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['detection_type'] === null) { + $invalidProperties[] = "'detection_type' can't be null"; + } + $allowedValues = $this->getDetectionTypeAllowableValues(); + if (!is_null($this->container['detection_type']) && !in_array($this->container['detection_type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'detection_type', must be one of '%s'", + $this->container['detection_type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets detection_type + * + * @return string + */ + public function getDetectionType() + { + return $this->container['detection_type']; + } + + /** + * Sets detection_type + * + * @param string $detection_type detection_type + * + * @return self + */ + public function setDetectionType($detection_type) + { + if (is_null($detection_type)) { + throw new \InvalidArgumentException('non-nullable detection_type cannot be null'); + } + $allowedValues = $this->getDetectionTypeAllowableValues(); + if (!in_array($detection_type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'detection_type', must be one of '%s'", + $detection_type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['detection_type'] = $detection_type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/NumericOutlierPercentile.php b/packages/Types/lib/Generated/Model/NumericOutlierPercentile.php new file mode 100644 index 0000000..3a27fb3 --- /dev/null +++ b/packages/Types/lib/Generated/Model/NumericOutlierPercentile.php @@ -0,0 +1,512 @@ + + */ +class NumericOutlierPercentile implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'NumericOutlierPercentile'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'detection_type' => 'string', + 'min' => '\OpenAPI\Client\Model\NumericOutlierPercentileAllOfMin', + 'max' => '\OpenAPI\Client\Model\NumericOutlierPercentileAllOfMax' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'detection_type' => null, + 'min' => null, + 'max' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'detection_type' => false, + 'min' => false, + 'max' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'detection_type' => 'detection_type', + 'min' => 'min', + 'max' => 'max' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'detection_type' => 'setDetectionType', + 'min' => 'setMin', + 'max' => 'setMax' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'detection_type' => 'getDetectionType', + 'min' => 'getMin', + 'max' => 'getMax' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const DETECTION_TYPE_PERCENTILE = 'percentile'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getDetectionTypeAllowableValues() + { + return [ + self::DETECTION_TYPE_PERCENTILE, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('detection_type', $data ?? [], null); + $this->setIfExists('min', $data ?? [], null); + $this->setIfExists('max', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['detection_type'] === null) { + $invalidProperties[] = "'detection_type' can't be null"; + } + $allowedValues = $this->getDetectionTypeAllowableValues(); + if (!is_null($this->container['detection_type']) && !in_array($this->container['detection_type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'detection_type', must be one of '%s'", + $this->container['detection_type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets detection_type + * + * @return string + */ + public function getDetectionType() + { + return $this->container['detection_type']; + } + + /** + * Sets detection_type + * + * @param string $detection_type detection_type + * + * @return self + */ + public function setDetectionType($detection_type) + { + if (is_null($detection_type)) { + throw new \InvalidArgumentException('non-nullable detection_type cannot be null'); + } + $allowedValues = $this->getDetectionTypeAllowableValues(); + if (!in_array($detection_type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'detection_type', must be one of '%s'", + $detection_type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['detection_type'] = $detection_type; + + return $this; + } + + /** + * Gets min + * + * @return \OpenAPI\Client\Model\NumericOutlierPercentileAllOfMin|null + */ + public function getMin() + { + return $this->container['min']; + } + + /** + * Sets min + * + * @param \OpenAPI\Client\Model\NumericOutlierPercentileAllOfMin|null $min min + * + * @return self + */ + public function setMin($min) + { + if (is_null($min)) { + throw new \InvalidArgumentException('non-nullable min cannot be null'); + } + $this->container['min'] = $min; + + return $this; + } + + /** + * Gets max + * + * @return \OpenAPI\Client\Model\NumericOutlierPercentileAllOfMax|null + */ + public function getMax() + { + return $this->container['max']; + } + + /** + * Sets max + * + * @param \OpenAPI\Client\Model\NumericOutlierPercentileAllOfMax|null $max max + * + * @return self + */ + public function setMax($max) + { + if (is_null($max)) { + throw new \InvalidArgumentException('non-nullable max cannot be null'); + } + $this->container['max'] = $max; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/NumericOutlierPercentileAllOfMax.php b/packages/Types/lib/Generated/Model/NumericOutlierPercentileAllOfMax.php new file mode 100644 index 0000000..29a1c9b --- /dev/null +++ b/packages/Types/lib/Generated/Model/NumericOutlierPercentileAllOfMax.php @@ -0,0 +1,381 @@ + + */ +class NumericOutlierPercentileAllOfMax implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'NumericOutlierPercentile_allOf_max'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/NumericOutlierPercentileAllOfMin.php b/packages/Types/lib/Generated/Model/NumericOutlierPercentileAllOfMin.php new file mode 100644 index 0000000..c8d214c --- /dev/null +++ b/packages/Types/lib/Generated/Model/NumericOutlierPercentileAllOfMin.php @@ -0,0 +1,381 @@ + + */ +class NumericOutlierPercentileAllOfMin implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'NumericOutlierPercentile_allOf_min'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/NumericOutlierTypes.php b/packages/Types/lib/Generated/Model/NumericOutlierTypes.php new file mode 100644 index 0000000..779f864 --- /dev/null +++ b/packages/Types/lib/Generated/Model/NumericOutlierTypes.php @@ -0,0 +1,66 @@ + + */ +class OnlyCount implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'OnlyCount'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'only_count' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'only_count' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'only_count' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'only_count' => 'onlyCount' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'only_count' => 'setOnlyCount' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'only_count' => 'getOnlyCount' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('only_count', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets only_count + * + * @return bool|null + */ + public function getOnlyCount() + { + return $this->container['only_count']; + } + + /** + * Sets only_count + * + * @param bool|null $only_count When provided in requests that allow it, the response would only contain count of records and no real records' data + * + * @return self + */ + public function setOnlyCount($only_count) + { + if (is_null($only_count)) { + throw new \InvalidArgumentException('non-nullable only_count cannot be null'); + } + $this->container['only_count'] = $only_count; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/OsMatchRule.php b/packages/Types/lib/Generated/Model/OsMatchRule.php new file mode 100644 index 0000000..b7040bf --- /dev/null +++ b/packages/Types/lib/Generated/Model/OsMatchRule.php @@ -0,0 +1,524 @@ + + */ +class OsMatchRule implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'OsMatchRule'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'rule_type' => '\OpenAPI\Client\Model\OsMatchRulesTypes', + 'value' => 'string', + 'matching' => '\OpenAPI\Client\Model\OsMatchRuleAllOfMatching' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'rule_type' => null, + 'value' => null, + 'matching' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'rule_type' => false, + 'value' => false, + 'matching' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'rule_type' => 'rule_type', + 'value' => 'value', + 'matching' => 'matching' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'rule_type' => 'setRuleType', + 'value' => 'setValue', + 'matching' => 'setMatching' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'rule_type' => 'getRuleType', + 'value' => 'getValue', + 'matching' => 'getMatching' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const VALUE_ANDROID = 'android'; + public const VALUE_IPHONE = 'iphone'; + public const VALUE_IPOD = 'ipod'; + public const VALUE_IPAD = 'ipad'; + public const VALUE_WINDOWS = 'windows'; + public const VALUE_MACOS = 'macos'; + public const VALUE_LINUX = 'linux'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getValueAllowableValues() + { + return [ + self::VALUE_ANDROID, + self::VALUE_IPHONE, + self::VALUE_IPOD, + self::VALUE_IPAD, + self::VALUE_WINDOWS, + self::VALUE_MACOS, + self::VALUE_LINUX, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('rule_type', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); + $this->setIfExists('matching', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['rule_type'] === null) { + $invalidProperties[] = "'rule_type' can't be null"; + } + $allowedValues = $this->getValueAllowableValues(); + if (!is_null($this->container['value']) && !in_array($this->container['value'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'value', must be one of '%s'", + $this->container['value'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets rule_type + * + * @return \OpenAPI\Client\Model\OsMatchRulesTypes + */ + public function getRuleType() + { + return $this->container['rule_type']; + } + + /** + * Sets rule_type + * + * @param \OpenAPI\Client\Model\OsMatchRulesTypes $rule_type rule_type + * + * @return self + */ + public function setRuleType($rule_type) + { + if (is_null($rule_type)) { + throw new \InvalidArgumentException('non-nullable rule_type cannot be null'); + } + $this->container['rule_type'] = $rule_type; + + return $this; + } + + /** + * Gets value + * + * @return string|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param string|null $value Operating System name used for matching + * + * @return self + */ + public function setValue($value) + { + if (is_null($value)) { + throw new \InvalidArgumentException('non-nullable value cannot be null'); + } + $allowedValues = $this->getValueAllowableValues(); + if (!in_array($value, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'value', must be one of '%s'", + $value, + implode("', '", $allowedValues) + ) + ); + } + $this->container['value'] = $value; + + return $this; + } + + /** + * Gets matching + * + * @return \OpenAPI\Client\Model\OsMatchRuleAllOfMatching|null + */ + public function getMatching() + { + return $this->container['matching']; + } + + /** + * Sets matching + * + * @param \OpenAPI\Client\Model\OsMatchRuleAllOfMatching|null $matching matching + * + * @return self + */ + public function setMatching($matching) + { + if (is_null($matching)) { + throw new \InvalidArgumentException('non-nullable matching cannot be null'); + } + $this->container['matching'] = $matching; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/OsMatchRuleAllOfMatching.php b/packages/Types/lib/Generated/Model/OsMatchRuleAllOfMatching.php new file mode 100644 index 0000000..9cedb5a --- /dev/null +++ b/packages/Types/lib/Generated/Model/OsMatchRuleAllOfMatching.php @@ -0,0 +1,443 @@ + + */ +class OsMatchRuleAllOfMatching implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'OsMatchRule_allOf_matching'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'negated' => 'bool', + 'match_type' => '\OpenAPI\Client\Model\ChoiceMatchingOptions' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'negated' => null, + 'match_type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'negated' => false, + 'match_type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'negated' => 'negated', + 'match_type' => 'match_type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'negated' => 'setNegated', + 'match_type' => 'setMatchType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'negated' => 'getNegated', + 'match_type' => 'getMatchType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('negated', $data ?? [], null); + $this->setIfExists('match_type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets negated + * + * @return bool|null + */ + public function getNegated() + { + return $this->container['negated']; + } + + /** + * Sets negated + * + * @param bool|null $negated When true, the rule result is gonna be negated. example: `url contains \"test\"` with *negated* = true becomes `url does not contain \"test\"` + * + * @return self + */ + public function setNegated($negated) + { + if (is_null($negated)) { + throw new \InvalidArgumentException('non-nullable negated cannot be null'); + } + $this->container['negated'] = $negated; + + return $this; + } + + /** + * Gets match_type + * + * @return \OpenAPI\Client\Model\ChoiceMatchingOptions|null + */ + public function getMatchType() + { + return $this->container['match_type']; + } + + /** + * Sets match_type + * + * @param \OpenAPI\Client\Model\ChoiceMatchingOptions|null $match_type match_type + * + * @return self + */ + public function setMatchType($match_type) + { + if (is_null($match_type)) { + throw new \InvalidArgumentException('non-nullable match_type cannot be null'); + } + $this->container['match_type'] = $match_type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/OsMatchRulesTypes.php b/packages/Types/lib/Generated/Model/OsMatchRulesTypes.php new file mode 100644 index 0000000..e31792e --- /dev/null +++ b/packages/Types/lib/Generated/Model/OsMatchRulesTypes.php @@ -0,0 +1,59 @@ + + */ +class PageNumber implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PageNumber'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'page' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'page' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'page' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'page' => 'page' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'page' => 'setPage' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'page' => 'getPage' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('page', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!is_null($this->container['page']) && ($this->container['page'] < 1)) { + $invalidProperties[] = "invalid value for 'page', must be bigger than or equal to 1."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets page + * + * @return int|null + */ + public function getPage() + { + return $this->container['page']; + } + + /** + * Sets page + * + * @param int|null $page Describes the page number of the fetched results. \"results_per_page\" results are gonna be returned for each page Defaults to 1 when not sent + * + * @return self + */ + public function setPage($page) + { + if (is_null($page)) { + throw new \InvalidArgumentException('non-nullable page cannot be null'); + } + + if (($page < 1)) { + throw new \InvalidArgumentException('invalid value for $page when calling PageNumber., must be bigger than or equal to 1.'); + } + + $this->container['page'] = $page; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/Pagination.php b/packages/Types/lib/Generated/Model/Pagination.php new file mode 100644 index 0000000..d52495d --- /dev/null +++ b/packages/Types/lib/Generated/Model/Pagination.php @@ -0,0 +1,547 @@ + + */ +class Pagination implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Pagination'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'current_page' => 'int', + 'items_count' => 'int', + 'items_per_page' => 'int', + 'pages_count' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'current_page' => null, + 'items_count' => null, + 'items_per_page' => null, + 'pages_count' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'current_page' => false, + 'items_count' => false, + 'items_per_page' => false, + 'pages_count' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'current_page' => 'current_page', + 'items_count' => 'items_count', + 'items_per_page' => 'items_per_page', + 'pages_count' => 'pages_count' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'current_page' => 'setCurrentPage', + 'items_count' => 'setItemsCount', + 'items_per_page' => 'setItemsPerPage', + 'pages_count' => 'setPagesCount' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'current_page' => 'getCurrentPage', + 'items_count' => 'getItemsCount', + 'items_per_page' => 'getItemsPerPage', + 'pages_count' => 'getPagesCount' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('current_page', $data ?? [], null); + $this->setIfExists('items_count', $data ?? [], null); + $this->setIfExists('items_per_page', $data ?? [], null); + $this->setIfExists('pages_count', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!is_null($this->container['current_page']) && ($this->container['current_page'] < 1)) { + $invalidProperties[] = "invalid value for 'current_page', must be bigger than or equal to 1."; + } + + if (!is_null($this->container['items_count']) && ($this->container['items_count'] < 0)) { + $invalidProperties[] = "invalid value for 'items_count', must be bigger than or equal to 0."; + } + + if (!is_null($this->container['items_per_page']) && ($this->container['items_per_page'] < 0)) { + $invalidProperties[] = "invalid value for 'items_per_page', must be bigger than or equal to 0."; + } + + if (!is_null($this->container['pages_count']) && ($this->container['pages_count'] < 0)) { + $invalidProperties[] = "invalid value for 'pages_count', must be bigger than or equal to 0."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets current_page + * + * @return int|null + */ + public function getCurrentPage() + { + return $this->container['current_page']; + } + + /** + * Sets current_page + * + * @param int|null $current_page Current page number + * + * @return self + */ + public function setCurrentPage($current_page) + { + if (is_null($current_page)) { + throw new \InvalidArgumentException('non-nullable current_page cannot be null'); + } + + if (($current_page < 1)) { + throw new \InvalidArgumentException('invalid value for $current_page when calling Pagination., must be bigger than or equal to 1.'); + } + + $this->container['current_page'] = $current_page; + + return $this; + } + + /** + * Gets items_count + * + * @return int|null + */ + public function getItemsCount() + { + return $this->container['items_count']; + } + + /** + * Sets items_count + * + * @param int|null $items_count Total number of records + * + * @return self + */ + public function setItemsCount($items_count) + { + if (is_null($items_count)) { + throw new \InvalidArgumentException('non-nullable items_count cannot be null'); + } + + if (($items_count < 0)) { + throw new \InvalidArgumentException('invalid value for $items_count when calling Pagination., must be bigger than or equal to 0.'); + } + + $this->container['items_count'] = $items_count; + + return $this; + } + + /** + * Gets items_per_page + * + * @return int|null + */ + public function getItemsPerPage() + { + return $this->container['items_per_page']; + } + + /** + * Sets items_per_page + * + * @param int|null $items_per_page Number of records per page + * + * @return self + */ + public function setItemsPerPage($items_per_page) + { + if (is_null($items_per_page)) { + throw new \InvalidArgumentException('non-nullable items_per_page cannot be null'); + } + + if (($items_per_page < 0)) { + throw new \InvalidArgumentException('invalid value for $items_per_page when calling Pagination., must be bigger than or equal to 0.'); + } + + $this->container['items_per_page'] = $items_per_page; + + return $this; + } + + /** + * Gets pages_count + * + * @return int|null + */ + public function getPagesCount() + { + return $this->container['pages_count']; + } + + /** + * Sets pages_count + * + * @param int|null $pages_count Limitation number of records per page + * + * @return self + */ + public function setPagesCount($pages_count) + { + if (is_null($pages_count)) { + throw new \InvalidArgumentException('non-nullable pages_count cannot be null'); + } + + if (($pages_count < 0)) { + throw new \InvalidArgumentException('invalid value for $pages_count when calling Pagination., must be bigger than or equal to 0.'); + } + + $this->container['pages_count'] = $pages_count; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/Percentiles.php b/packages/Types/lib/Generated/Model/Percentiles.php new file mode 100644 index 0000000..213448f --- /dev/null +++ b/packages/Types/lib/Generated/Model/Percentiles.php @@ -0,0 +1,84 @@ + + */ +class ProjectGASettingsBase implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ProjectGASettingsBase'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'enabled' => 'bool', + 'auto_revenue_tracking' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'enabled' => null, + 'auto_revenue_tracking' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'enabled' => false, + 'auto_revenue_tracking' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'enabled' => 'enabled', + 'auto_revenue_tracking' => 'auto_revenue_tracking' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'enabled' => 'setEnabled', + 'auto_revenue_tracking' => 'setAutoRevenueTracking' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'enabled' => 'getEnabled', + 'auto_revenue_tracking' => 'getAutoRevenueTracking' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('enabled', $data ?? [], null); + $this->setIfExists('auto_revenue_tracking', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets enabled + * + * @return bool|null + */ + public function getEnabled() + { + return $this->container['enabled']; + } + + /** + * Sets enabled + * + * @param bool|null $enabled Flag indicating whether Google Analytics integration is enabled or not. + * + * @return self + */ + public function setEnabled($enabled) + { + if (is_null($enabled)) { + throw new \InvalidArgumentException('non-nullable enabled cannot be null'); + } + $this->container['enabled'] = $enabled; + + return $this; + } + + /** + * Gets auto_revenue_tracking + * + * @return bool|null + */ + public function getAutoRevenueTracking() + { + return $this->container['auto_revenue_tracking']; + } + + /** + * Sets auto_revenue_tracking + * + * @param bool|null $auto_revenue_tracking Attempt to pull revenue data from Google Analytics Revenue Tracking code. + * + * @return self + */ + public function setAutoRevenueTracking($auto_revenue_tracking) + { + if (is_null($auto_revenue_tracking)) { + throw new \InvalidArgumentException('non-nullable auto_revenue_tracking cannot be null'); + } + $this->container['auto_revenue_tracking'] = $auto_revenue_tracking; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/ProjectIntegrationGA3.php b/packages/Types/lib/Generated/Model/ProjectIntegrationGA3.php new file mode 100644 index 0000000..dd4eb0c --- /dev/null +++ b/packages/Types/lib/Generated/Model/ProjectIntegrationGA3.php @@ -0,0 +1,558 @@ + + */ +class ProjectIntegrationGA3 implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ProjectIntegrationGA3'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'enabled' => 'bool', + 'auto_revenue_tracking' => 'bool', + 'type' => 'string', + 'property_ua' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'enabled' => null, + 'auto_revenue_tracking' => null, + 'type' => null, + 'property_ua' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'enabled' => false, + 'auto_revenue_tracking' => false, + 'type' => false, + 'property_ua' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'enabled' => 'enabled', + 'auto_revenue_tracking' => 'auto_revenue_tracking', + 'type' => 'type', + 'property_ua' => 'property_UA' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'enabled' => 'setEnabled', + 'auto_revenue_tracking' => 'setAutoRevenueTracking', + 'type' => 'setType', + 'property_ua' => 'setPropertyUa' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'enabled' => 'getEnabled', + 'auto_revenue_tracking' => 'getAutoRevenueTracking', + 'type' => 'getType', + 'property_ua' => 'getPropertyUa' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_GA3 = 'ga3'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_GA3, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('enabled', $data ?? [], null); + $this->setIfExists('auto_revenue_tracking', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('property_ua', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + if (!is_null($this->container['property_ua']) && (mb_strlen($this->container['property_ua']) > 150)) { + $invalidProperties[] = "invalid value for 'property_ua', the character length must be smaller than or equal to 150."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets enabled + * + * @return bool|null + */ + public function getEnabled() + { + return $this->container['enabled']; + } + + /** + * Sets enabled + * + * @param bool|null $enabled Flag indicating whether Google Analytics integration is enabled or not. + * + * @return self + */ + public function setEnabled($enabled) + { + if (is_null($enabled)) { + throw new \InvalidArgumentException('non-nullable enabled cannot be null'); + } + $this->container['enabled'] = $enabled; + + return $this; + } + + /** + * Gets auto_revenue_tracking + * + * @return bool|null + */ + public function getAutoRevenueTracking() + { + return $this->container['auto_revenue_tracking']; + } + + /** + * Sets auto_revenue_tracking + * + * @param bool|null $auto_revenue_tracking Attempt to pull revenue data from Google Analytics Revenue Tracking code. + * + * @return self + */ + public function setAutoRevenueTracking($auto_revenue_tracking) + { + if (is_null($auto_revenue_tracking)) { + throw new \InvalidArgumentException('non-nullable auto_revenue_tracking cannot be null'); + } + $this->container['auto_revenue_tracking'] = $auto_revenue_tracking; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type type + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets property_ua + * + * @return string|null + */ + public function getPropertyUa() + { + return $this->container['property_ua']; + } + + /** + * Sets property_ua + * + * @param string|null $property_ua Universal Analytics property to be used for tracking + * + * @return self + */ + public function setPropertyUa($property_ua) + { + if (is_null($property_ua)) { + array_push($this->openAPINullablesSetToNull, 'property_ua'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('property_ua', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($property_ua) && (mb_strlen($property_ua) > 150)) { + throw new \InvalidArgumentException('invalid length for $property_ua when calling ProjectIntegrationGA3., must be smaller than or equal to 150.'); + } + + $this->container['property_ua'] = $property_ua; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/ProjectIntegrationGA4.php b/packages/Types/lib/Generated/Model/ProjectIntegrationGA4.php new file mode 100644 index 0000000..73932aa --- /dev/null +++ b/packages/Types/lib/Generated/Model/ProjectIntegrationGA4.php @@ -0,0 +1,577 @@ + + */ +class ProjectIntegrationGA4 implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ProjectIntegrationGA4'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'enabled' => 'bool', + 'auto_revenue_tracking' => 'bool', + 'type' => 'string', + 'measurement_id' => 'string', + 'no_wait_pageview' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'enabled' => null, + 'auto_revenue_tracking' => null, + 'type' => null, + 'measurement_id' => null, + 'no_wait_pageview' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'enabled' => false, + 'auto_revenue_tracking' => false, + 'type' => false, + 'measurement_id' => false, + 'no_wait_pageview' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'enabled' => 'enabled', + 'auto_revenue_tracking' => 'auto_revenue_tracking', + 'type' => 'type', + 'measurement_id' => 'measurementId', + 'no_wait_pageview' => 'no_wait_pageview' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'enabled' => 'setEnabled', + 'auto_revenue_tracking' => 'setAutoRevenueTracking', + 'type' => 'setType', + 'measurement_id' => 'setMeasurementId', + 'no_wait_pageview' => 'setNoWaitPageview' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'enabled' => 'getEnabled', + 'auto_revenue_tracking' => 'getAutoRevenueTracking', + 'type' => 'getType', + 'measurement_id' => 'getMeasurementId', + 'no_wait_pageview' => 'getNoWaitPageview' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_GA4 = 'ga4'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_GA4, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('enabled', $data ?? [], null); + $this->setIfExists('auto_revenue_tracking', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('measurement_id', $data ?? [], null); + $this->setIfExists('no_wait_pageview', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets enabled + * + * @return bool|null + */ + public function getEnabled() + { + return $this->container['enabled']; + } + + /** + * Sets enabled + * + * @param bool|null $enabled Flag indicating whether Google Analytics integration is enabled or not. + * + * @return self + */ + public function setEnabled($enabled) + { + if (is_null($enabled)) { + throw new \InvalidArgumentException('non-nullable enabled cannot be null'); + } + $this->container['enabled'] = $enabled; + + return $this; + } + + /** + * Gets auto_revenue_tracking + * + * @return bool|null + */ + public function getAutoRevenueTracking() + { + return $this->container['auto_revenue_tracking']; + } + + /** + * Sets auto_revenue_tracking + * + * @param bool|null $auto_revenue_tracking Attempt to pull revenue data from Google Analytics Revenue Tracking code. + * + * @return self + */ + public function setAutoRevenueTracking($auto_revenue_tracking) + { + if (is_null($auto_revenue_tracking)) { + throw new \InvalidArgumentException('non-nullable auto_revenue_tracking cannot be null'); + } + $this->container['auto_revenue_tracking'] = $auto_revenue_tracking; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type type + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets measurement_id + * + * @return string|null + */ + public function getMeasurementId() + { + return $this->container['measurement_id']; + } + + /** + * Sets measurement_id + * + * @param string|null $measurement_id ID of the ga4 property where data will be sent. Used internally for API calls to GoogleAnalytics + * + * @return self + */ + public function setMeasurementId($measurement_id) + { + if (is_null($measurement_id)) { + throw new \InvalidArgumentException('non-nullable measurement_id cannot be null'); + } + $this->container['measurement_id'] = $measurement_id; + + return $this; + } + + /** + * Gets no_wait_pageview + * + * @return bool|null + */ + public function getNoWaitPageview() + { + return $this->container['no_wait_pageview']; + } + + /** + * Sets no_wait_pageview + * + * @param bool|null $no_wait_pageview Boolean indicating whether to wait for the page view event to complete before sending other events. + * + * @return self + */ + public function setNoWaitPageview($no_wait_pageview) + { + if (is_null($no_wait_pageview)) { + throw new \InvalidArgumentException('non-nullable no_wait_pageview cannot be null'); + } + $this->container['no_wait_pageview'] = $no_wait_pageview; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/ResultsPerPage.php b/packages/Types/lib/Generated/Model/ResultsPerPage.php new file mode 100644 index 0000000..a80a9cd --- /dev/null +++ b/packages/Types/lib/Generated/Model/ResultsPerPage.php @@ -0,0 +1,432 @@ + + */ +class ResultsPerPage implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ResultsPerPage'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'results_per_page' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'results_per_page' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'results_per_page' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'results_per_page' => 'results_per_page' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'results_per_page' => 'setResultsPerPage' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'results_per_page' => 'getResultsPerPage' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('results_per_page', $data ?? [], 30); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!is_null($this->container['results_per_page']) && ($this->container['results_per_page'] > 50)) { + $invalidProperties[] = "invalid value for 'results_per_page', must be smaller than or equal to 50."; + } + + if (!is_null($this->container['results_per_page']) && ($this->container['results_per_page'] < 0)) { + $invalidProperties[] = "invalid value for 'results_per_page', must be bigger than or equal to 0."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets results_per_page + * + * @return int|null + */ + public function getResultsPerPage() + { + return $this->container['results_per_page']; + } + + /** + * Sets results_per_page + * + * @param int|null $results_per_page A value that would be used for setting the number of records that would be returned per page. Defaults to 30 when not sent + * + * @return self + */ + public function setResultsPerPage($results_per_page) + { + if (is_null($results_per_page)) { + array_push($this->openAPINullablesSetToNull, 'results_per_page'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('results_per_page', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + if (!is_null($results_per_page) && ($results_per_page > 50)) { + throw new \InvalidArgumentException('invalid value for $results_per_page when calling ResultsPerPage., must be smaller than or equal to 50.'); + } + if (!is_null($results_per_page) && ($results_per_page < 0)) { + throw new \InvalidArgumentException('invalid value for $results_per_page when calling ResultsPerPage., must be bigger than or equal to 0.'); + } + + $this->container['results_per_page'] = $results_per_page; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/RevenueGoal.php b/packages/Types/lib/Generated/Model/RevenueGoal.php new file mode 100644 index 0000000..f8c2f38 --- /dev/null +++ b/packages/Types/lib/Generated/Model/RevenueGoal.php @@ -0,0 +1,618 @@ + + */ +class RevenueGoal implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'RevenueGoal'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'string', + 'name' => 'string', + 'key' => 'string', + 'type' => 'string', + 'rules' => '\OpenAPI\Client\Model\RuleObject', + 'settings' => '\OpenAPI\Client\Model\RevenueGoalSettings' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'name' => null, + 'key' => null, + 'type' => null, + 'rules' => null, + 'settings' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'name' => false, + 'key' => false, + 'type' => false, + 'rules' => true, + 'settings' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'name' => 'name', + 'key' => 'key', + 'type' => 'type', + 'rules' => 'rules', + 'settings' => 'settings' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'name' => 'setName', + 'key' => 'setKey', + 'type' => 'setType', + 'rules' => 'setRules', + 'settings' => 'setSettings' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'name' => 'getName', + 'key' => 'getKey', + 'type' => 'getType', + 'rules' => 'getRules', + 'settings' => 'getSettings' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_REVENUE = 'revenue'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_REVENUE, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('key', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('rules', $data ?? [], null); + $this->setIfExists('settings', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id Goal ID + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name Goal Name. + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets key + * + * @return string|null + */ + public function getKey() + { + return $this->container['key']; + } + + /** + * Sets key + * + * @param string|null $key Goal Key + * + * @return self + */ + public function setKey($key) + { + if (is_null($key)) { + throw new \InvalidArgumentException('non-nullable key cannot be null'); + } + $this->container['key'] = $key; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type type + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets rules + * + * @return \OpenAPI\Client\Model\RuleObject|null + */ + public function getRules() + { + return $this->container['rules']; + } + + /** + * Sets rules + * + * @param \OpenAPI\Client\Model\RuleObject|null $rules rules + * + * @return self + */ + public function setRules($rules) + { + if (is_null($rules)) { + array_push($this->openAPINullablesSetToNull, 'rules'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('rules', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['rules'] = $rules; + + return $this; + } + + /** + * Gets settings + * + * @return \OpenAPI\Client\Model\RevenueGoalSettings|null + */ + public function getSettings() + { + return $this->container['settings']; + } + + /** + * Sets settings + * + * @param \OpenAPI\Client\Model\RevenueGoalSettings|null $settings settings + * + * @return self + */ + public function setSettings($settings) + { + if (is_null($settings)) { + throw new \InvalidArgumentException('non-nullable settings cannot be null'); + } + $this->container['settings'] = $settings; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/RevenueGoalSettings.php b/packages/Types/lib/Generated/Model/RevenueGoalSettings.php new file mode 100644 index 0000000..8774bf7 --- /dev/null +++ b/packages/Types/lib/Generated/Model/RevenueGoalSettings.php @@ -0,0 +1,446 @@ + + */ +class RevenueGoalSettings implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'RevenueGoalSettings'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'triggering_type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'triggering_type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'triggering_type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'triggering_type' => 'triggering_type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'triggering_type' => 'setTriggeringType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'triggering_type' => 'getTriggeringType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TRIGGERING_TYPE_MANUAL = 'manual'; + public const TRIGGERING_TYPE_GA = 'ga'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTriggeringTypeAllowableValues() + { + return [ + self::TRIGGERING_TYPE_MANUAL, + self::TRIGGERING_TYPE_GA, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('triggering_type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['triggering_type'] === null) { + $invalidProperties[] = "'triggering_type' can't be null"; + } + $allowedValues = $this->getTriggeringTypeAllowableValues(); + if (!is_null($this->container['triggering_type']) && !in_array($this->container['triggering_type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'triggering_type', must be one of '%s'", + $this->container['triggering_type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets triggering_type + * + * @return string + */ + public function getTriggeringType() + { + return $this->container['triggering_type']; + } + + /** + * Sets triggering_type + * + * @param string $triggering_type Type of the revenue goal tracking, one of the below. * \"manual\" - goal will be triggered through the given revenue tracking code; An empty **triggering_rule** has to be provided as that takes priority over manual triggering * \"ga\" - Convert will attempt to pick revenue from GA revenue tracking code and attach it to this goal, when on page where this goal is triggered via \"triggering_rule\" + * + * @return self + */ + public function setTriggeringType($triggering_type) + { + if (is_null($triggering_type)) { + throw new \InvalidArgumentException('non-nullable triggering_type cannot be null'); + } + $allowedValues = $this->getTriggeringTypeAllowableValues(); + if (!in_array($triggering_type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'triggering_type', must be one of '%s'", + $triggering_type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['triggering_type'] = $triggering_type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/RuleElement.php b/packages/Types/lib/Generated/Model/RuleElement.php new file mode 100644 index 0000000..a30faa0 --- /dev/null +++ b/packages/Types/lib/Generated/Model/RuleElement.php @@ -0,0 +1,517 @@ + + */ +class RuleElement implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = 'rule_type'; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'RuleElement'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'rule_type' => '\OpenAPI\Client\Model\JsConditionMatchRulesTypes', + 'value' => 'string', + 'matching' => '\OpenAPI\Client\Model\JsConditionMatchRuleAllOfMatching', + 'key' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'rule_type' => null, + 'value' => null, + 'matching' => null, + 'key' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'rule_type' => false, + 'value' => false, + 'matching' => false, + 'key' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'rule_type' => 'rule_type', + 'value' => 'value', + 'matching' => 'matching', + 'key' => 'key' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'rule_type' => 'setRuleType', + 'value' => 'setValue', + 'matching' => 'setMatching', + 'key' => 'setKey' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'rule_type' => 'getRuleType', + 'value' => 'getValue', + 'matching' => 'getMatching', + 'key' => 'getKey' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('rule_type', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); + $this->setIfExists('matching', $data ?? [], null); + $this->setIfExists('key', $data ?? [], null); + + // Initialize discriminator property with the model name. + $this->container['rule_type'] = static::$openAPIModelName; + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['rule_type'] === null) { + $invalidProperties[] = "'rule_type' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets rule_type + * + * @return \OpenAPI\Client\Model\JsConditionMatchRulesTypes + */ + public function getRuleType() + { + return $this->container['rule_type']; + } + + /** + * Sets rule_type + * + * @param \OpenAPI\Client\Model\JsConditionMatchRulesTypes $rule_type rule_type + * + * @return self + */ + public function setRuleType($rule_type) + { + if (is_null($rule_type)) { + throw new \InvalidArgumentException('non-nullable rule_type cannot be null'); + } + $this->container['rule_type'] = $rule_type; + + return $this; + } + + /** + * Gets value + * + * @return string|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param string|null $value The JS code that would be executed when rule is checked. The return value of this JS code is what is gonna be matched against **true**(or **false** if **matching.negated = true** is provided) + * + * @return self + */ + public function setValue($value) + { + if (is_null($value)) { + throw new \InvalidArgumentException('non-nullable value cannot be null'); + } + $this->container['value'] = $value; + + return $this; + } + + /** + * Gets matching + * + * @return \OpenAPI\Client\Model\JsConditionMatchRuleAllOfMatching|null + */ + public function getMatching() + { + return $this->container['matching']; + } + + /** + * Sets matching + * + * @param \OpenAPI\Client\Model\JsConditionMatchRuleAllOfMatching|null $matching matching + * + * @return self + */ + public function setMatching($matching) + { + if (is_null($matching)) { + throw new \InvalidArgumentException('non-nullable matching cannot be null'); + } + $this->container['matching'] = $matching; + + return $this; + } + + /** + * Gets key + * + * @return string|null + */ + public function getKey() + { + return $this->container['key']; + } + + /** + * Sets key + * + * @param string|null $key The name of the cookie which value is compared to the given rule value + * + * @return self + */ + public function setKey($key) + { + if (is_null($key)) { + throw new \InvalidArgumentException('non-nullable key cannot be null'); + } + $this->container['key'] = $key; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/RuleElementNoUrl.php b/packages/Types/lib/Generated/Model/RuleElementNoUrl.php new file mode 100644 index 0000000..d676a81 --- /dev/null +++ b/packages/Types/lib/Generated/Model/RuleElementNoUrl.php @@ -0,0 +1,517 @@ + + */ +class RuleElementNoUrl implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = 'rule_type'; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'RuleElementNoUrl'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'rule_type' => '\OpenAPI\Client\Model\JsConditionMatchRulesTypes', + 'value' => 'string', + 'matching' => '\OpenAPI\Client\Model\JsConditionMatchRuleAllOfMatching', + 'key' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'rule_type' => null, + 'value' => null, + 'matching' => null, + 'key' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'rule_type' => false, + 'value' => false, + 'matching' => false, + 'key' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'rule_type' => 'rule_type', + 'value' => 'value', + 'matching' => 'matching', + 'key' => 'key' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'rule_type' => 'setRuleType', + 'value' => 'setValue', + 'matching' => 'setMatching', + 'key' => 'setKey' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'rule_type' => 'getRuleType', + 'value' => 'getValue', + 'matching' => 'getMatching', + 'key' => 'getKey' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('rule_type', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); + $this->setIfExists('matching', $data ?? [], null); + $this->setIfExists('key', $data ?? [], null); + + // Initialize discriminator property with the model name. + $this->container['rule_type'] = static::$openAPIModelName; + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['rule_type'] === null) { + $invalidProperties[] = "'rule_type' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets rule_type + * + * @return \OpenAPI\Client\Model\JsConditionMatchRulesTypes + */ + public function getRuleType() + { + return $this->container['rule_type']; + } + + /** + * Sets rule_type + * + * @param \OpenAPI\Client\Model\JsConditionMatchRulesTypes $rule_type rule_type + * + * @return self + */ + public function setRuleType($rule_type) + { + if (is_null($rule_type)) { + throw new \InvalidArgumentException('non-nullable rule_type cannot be null'); + } + $this->container['rule_type'] = $rule_type; + + return $this; + } + + /** + * Gets value + * + * @return string|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param string|null $value The JS code that would be executed when rule is checked. The return value of this JS code is what is gonna be matched against **true**(or **false** if **matching.negated = true** is provided) + * + * @return self + */ + public function setValue($value) + { + if (is_null($value)) { + throw new \InvalidArgumentException('non-nullable value cannot be null'); + } + $this->container['value'] = $value; + + return $this; + } + + /** + * Gets matching + * + * @return \OpenAPI\Client\Model\JsConditionMatchRuleAllOfMatching|null + */ + public function getMatching() + { + return $this->container['matching']; + } + + /** + * Sets matching + * + * @param \OpenAPI\Client\Model\JsConditionMatchRuleAllOfMatching|null $matching matching + * + * @return self + */ + public function setMatching($matching) + { + if (is_null($matching)) { + throw new \InvalidArgumentException('non-nullable matching cannot be null'); + } + $this->container['matching'] = $matching; + + return $this; + } + + /** + * Gets key + * + * @return string|null + */ + public function getKey() + { + return $this->container['key']; + } + + /** + * Sets key + * + * @param string|null $key The key used to identify the data that would be matched against rule **value** + * + * @return self + */ + public function setKey($key) + { + if (is_null($key)) { + throw new \InvalidArgumentException('non-nullable key cannot be null'); + } + $this->container['key'] = $key; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/RuleObject.php b/packages/Types/lib/Generated/Model/RuleObject.php new file mode 100644 index 0000000..7ae97db --- /dev/null +++ b/packages/Types/lib/Generated/Model/RuleObject.php @@ -0,0 +1,410 @@ + + */ +class RuleObject implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'RuleObject'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'OR' => '\OpenAPI\Client\Model\RuleObjectORInner[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'OR' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'OR' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'OR' => 'OR' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'OR' => 'setOr' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'OR' => 'getOr' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('OR', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets or + * + * @return \OpenAPI\Client\Model\RuleObjectORInner[]|null + */ + public function getOr() + { + return $this->container['OR']; + } + + /** + * Sets or + * + * @param \OpenAPI\Client\Model\RuleObjectORInner[]|null $or This describes an outer set of blocks which are evaluated using OR's between them + * + * @return self + */ + public function setOr($or) + { + if (is_null($or)) { + throw new \InvalidArgumentException('non-nullable or cannot be null'); + } + $this->container['or'] = $or; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/RuleObjectNoUrl.php b/packages/Types/lib/Generated/Model/RuleObjectNoUrl.php new file mode 100644 index 0000000..5886018 --- /dev/null +++ b/packages/Types/lib/Generated/Model/RuleObjectNoUrl.php @@ -0,0 +1,410 @@ + + */ +class RuleObjectNoUrl implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'RuleObjectNoUrl'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'or' => '\OpenAPI\Client\Model\RuleObjectNoUrlORInner[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'or' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'or' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'or' => 'OR' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'or' => 'setOr' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'or' => 'getOr' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('or', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets or + * + * @return \OpenAPI\Client\Model\RuleObjectNoUrlORInner[]|null + */ + public function getOr() + { + return $this->container['or']; + } + + /** + * Sets or + * + * @param \OpenAPI\Client\Model\RuleObjectNoUrlORInner[]|null $or This describes an outer set of blocks which are evaluated using OR's between them + * + * @return self + */ + public function setOr($or) + { + if (is_null($or)) { + throw new \InvalidArgumentException('non-nullable or cannot be null'); + } + $this->container['or'] = $or; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/RuleObjectNoUrlORInner.php b/packages/Types/lib/Generated/Model/RuleObjectNoUrlORInner.php new file mode 100644 index 0000000..01391d4 --- /dev/null +++ b/packages/Types/lib/Generated/Model/RuleObjectNoUrlORInner.php @@ -0,0 +1,409 @@ + + */ +class RuleObjectNoUrlORInner implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'RuleObjectNoUrl_OR_inner'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'and' => '\OpenAPI\Client\Model\RuleObjectNoUrlORInnerANDInner[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'and' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'and' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'and' => 'AND' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'and' => 'setAnd' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'and' => 'getAnd' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('and', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets and + * + * @return \OpenAPI\Client\Model\RuleObjectNoUrlORInnerANDInner[]|null + */ + public function getAnd() + { + return $this->container['and']; + } + + /** + * Sets and + * + * @param \OpenAPI\Client\Model\RuleObjectNoUrlORInnerANDInner[]|null $and This describes a colections of logical blocks which are evaluated using AND's between them + * + * @return self + */ + public function setAnd($and) + { + if (is_null($and)) { + throw new \InvalidArgumentException('non-nullable and cannot be null'); + } + $this->container['and'] = $and; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/RuleObjectNoUrlORInnerANDInner.php b/packages/Types/lib/Generated/Model/RuleObjectNoUrlORInnerANDInner.php new file mode 100644 index 0000000..663d20d --- /dev/null +++ b/packages/Types/lib/Generated/Model/RuleObjectNoUrlORInnerANDInner.php @@ -0,0 +1,409 @@ + + */ +class RuleObjectNoUrlORInnerANDInner implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'RuleObjectNoUrl_OR_inner_AND_inner'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'or_when' => '\OpenAPI\Client\Model\RuleElementNoUrl[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'or_when' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'or_when' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'or_when' => 'OR_WHEN' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'or_when' => 'setOrWhen' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'or_when' => 'getOrWhen' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('or_when', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets or_when + * + * @return \OpenAPI\Client\Model\RuleElementNoUrl[]|null + */ + public function getOrWhen() + { + return $this->container['or_when']; + } + + /** + * Sets or_when + * + * @param \OpenAPI\Client\Model\RuleElementNoUrl[]|null $or_when This describes a colections of logical blocks which are evaluated using OR's between them + * + * @return self + */ + public function setOrWhen($or_when) + { + if (is_null($or_when)) { + throw new \InvalidArgumentException('non-nullable or_when cannot be null'); + } + $this->container['or_when'] = $or_when; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/RuleObjectORInner.php b/packages/Types/lib/Generated/Model/RuleObjectORInner.php new file mode 100644 index 0000000..96c72e6 --- /dev/null +++ b/packages/Types/lib/Generated/Model/RuleObjectORInner.php @@ -0,0 +1,409 @@ + + */ +class RuleObjectORInner implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'RuleObject_OR_inner'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'and' => '\OpenAPI\Client\Model\RuleObjectORInnerANDInner[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'and' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'and' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'and' => 'AND' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'and' => 'setAnd' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'and' => 'getAnd' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('and', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets and + * + * @return \OpenAPI\Client\Model\RuleObjectORInnerANDInner[]|null + */ + public function getAnd() + { + return $this->container['and']; + } + + /** + * Sets and + * + * @param \OpenAPI\Client\Model\RuleObjectORInnerANDInner[]|null $and This describes a colections of logical blocks which are evaluated using AND's between them + * + * @return self + */ + public function setAnd($and) + { + if (is_null($and)) { + throw new \InvalidArgumentException('non-nullable and cannot be null'); + } + $this->container['and'] = $and; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/RuleObjectORInnerANDInner.php b/packages/Types/lib/Generated/Model/RuleObjectORInnerANDInner.php new file mode 100644 index 0000000..260a32a --- /dev/null +++ b/packages/Types/lib/Generated/Model/RuleObjectORInnerANDInner.php @@ -0,0 +1,409 @@ + + */ +class RuleObjectORInnerANDInner implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'RuleObject_OR_inner_AND_inner'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'or_when' => '\OpenAPI\Client\Model\RuleElement[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'or_when' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'or_when' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'or_when' => 'OR_WHEN' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'or_when' => 'setOrWhen' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'or_when' => 'getOrWhen' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('or_when', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets or_when + * + * @return \OpenAPI\Client\Model\RuleElement[]|null + */ + public function getOrWhen() + { + return $this->container['or_when']; + } + + /** + * Sets or_when + * + * @param \OpenAPI\Client\Model\RuleElement[]|null $or_when This describes a colections of logical blocks which are evaluated using OR's between them + * + * @return self + */ + public function setOrWhen($or_when) + { + if (is_null($or_when)) { + throw new \InvalidArgumentException('non-nullable or_when cannot be null'); + } + $this->container['or_when'] = $or_when; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/RulesTypes.php b/packages/Types/lib/Generated/Model/RulesTypes.php new file mode 100644 index 0000000..54f0c21 --- /dev/null +++ b/packages/Types/lib/Generated/Model/RulesTypes.php @@ -0,0 +1,381 @@ + + */ +class RulesTypes implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'RulesTypes'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/ScrollPercentageGoal.php b/packages/Types/lib/Generated/Model/ScrollPercentageGoal.php new file mode 100644 index 0000000..797927b --- /dev/null +++ b/packages/Types/lib/Generated/Model/ScrollPercentageGoal.php @@ -0,0 +1,618 @@ + + */ +class ScrollPercentageGoal implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ScrollPercentageGoal'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'string', + 'name' => 'string', + 'key' => 'string', + 'type' => 'string', + 'rules' => '\OpenAPI\Client\Model\RuleObject', + 'settings' => '\OpenAPI\Client\Model\ScrollPercentageGoalSettings' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'name' => null, + 'key' => null, + 'type' => null, + 'rules' => null, + 'settings' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'name' => false, + 'key' => false, + 'type' => false, + 'rules' => true, + 'settings' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'name' => 'name', + 'key' => 'key', + 'type' => 'type', + 'rules' => 'rules', + 'settings' => 'settings' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'name' => 'setName', + 'key' => 'setKey', + 'type' => 'setType', + 'rules' => 'setRules', + 'settings' => 'setSettings' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'name' => 'getName', + 'key' => 'getKey', + 'type' => 'getType', + 'rules' => 'getRules', + 'settings' => 'getSettings' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_SCROLL_PERCENTAGE = 'scroll_percentage'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_SCROLL_PERCENTAGE, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('key', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('rules', $data ?? [], null); + $this->setIfExists('settings', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id Goal ID + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name Goal Name. + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets key + * + * @return string|null + */ + public function getKey() + { + return $this->container['key']; + } + + /** + * Sets key + * + * @param string|null $key Goal Key + * + * @return self + */ + public function setKey($key) + { + if (is_null($key)) { + throw new \InvalidArgumentException('non-nullable key cannot be null'); + } + $this->container['key'] = $key; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type type + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets rules + * + * @return \OpenAPI\Client\Model\RuleObject|null + */ + public function getRules() + { + return $this->container['rules']; + } + + /** + * Sets rules + * + * @param \OpenAPI\Client\Model\RuleObject|null $rules rules + * + * @return self + */ + public function setRules($rules) + { + if (is_null($rules)) { + array_push($this->openAPINullablesSetToNull, 'rules'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('rules', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['rules'] = $rules; + + return $this; + } + + /** + * Gets settings + * + * @return \OpenAPI\Client\Model\ScrollPercentageGoalSettings|null + */ + public function getSettings() + { + return $this->container['settings']; + } + + /** + * Sets settings + * + * @param \OpenAPI\Client\Model\ScrollPercentageGoalSettings|null $settings settings + * + * @return self + */ + public function setSettings($settings) + { + if (is_null($settings)) { + throw new \InvalidArgumentException('non-nullable settings cannot be null'); + } + $this->container['settings'] = $settings; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/ScrollPercentageGoalSettings.php b/packages/Types/lib/Generated/Model/ScrollPercentageGoalSettings.php new file mode 100644 index 0000000..affb04d --- /dev/null +++ b/packages/Types/lib/Generated/Model/ScrollPercentageGoalSettings.php @@ -0,0 +1,412 @@ + + */ +class ScrollPercentageGoalSettings implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ScrollPercentageGoalSettings'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'percentage' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'percentage' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'percentage' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'percentage' => 'percentage' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'percentage' => 'setPercentage' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'percentage' => 'getPercentage' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('percentage', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['percentage'] === null) { + $invalidProperties[] = "'percentage' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets percentage + * + * @return float + */ + public function getPercentage() + { + return $this->container['percentage']; + } + + /** + * Sets percentage + * + * @param float $percentage The percentage of scrolling after which the goal will be fired + * + * @return self + */ + public function setPercentage($percentage) + { + if (is_null($percentage)) { + throw new \InvalidArgumentException('non-nullable percentage cannot be null'); + } + $this->container['percentage'] = $percentage; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/SegmentBucketedMatchRule.php b/packages/Types/lib/Generated/Model/SegmentBucketedMatchRule.php new file mode 100644 index 0000000..8b0f8d4 --- /dev/null +++ b/packages/Types/lib/Generated/Model/SegmentBucketedMatchRule.php @@ -0,0 +1,480 @@ + + */ +class SegmentBucketedMatchRule implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SegmentBucketedMatchRule'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'rule_type' => '\OpenAPI\Client\Model\SegmentBucketedMatchRulesTypes', + 'value' => 'float', + 'matching' => '\OpenAPI\Client\Model\SegmentBucketedMatchRuleAllOfMatching' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'rule_type' => null, + 'value' => null, + 'matching' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'rule_type' => false, + 'value' => false, + 'matching' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'rule_type' => 'rule_type', + 'value' => 'value', + 'matching' => 'matching' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'rule_type' => 'setRuleType', + 'value' => 'setValue', + 'matching' => 'setMatching' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'rule_type' => 'getRuleType', + 'value' => 'getValue', + 'matching' => 'getMatching' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('rule_type', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); + $this->setIfExists('matching', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['rule_type'] === null) { + $invalidProperties[] = "'rule_type' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets rule_type + * + * @return \OpenAPI\Client\Model\SegmentBucketedMatchRulesTypes + */ + public function getRuleType() + { + return $this->container['rule_type']; + } + + /** + * Sets rule_type + * + * @param \OpenAPI\Client\Model\SegmentBucketedMatchRulesTypes $rule_type rule_type + * + * @return self + */ + public function setRuleType($rule_type) + { + if (is_null($rule_type)) { + throw new \InvalidArgumentException('non-nullable rule_type cannot be null'); + } + $this->container['rule_type'] = $rule_type; + + return $this; + } + + /** + * Gets value + * + * @return float|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param float|null $value ID of the segment used for matching + * + * @return self + */ + public function setValue($value) + { + if (is_null($value)) { + throw new \InvalidArgumentException('non-nullable value cannot be null'); + } + $this->container['value'] = $value; + + return $this; + } + + /** + * Gets matching + * + * @return \OpenAPI\Client\Model\SegmentBucketedMatchRuleAllOfMatching|null + */ + public function getMatching() + { + return $this->container['matching']; + } + + /** + * Sets matching + * + * @param \OpenAPI\Client\Model\SegmentBucketedMatchRuleAllOfMatching|null $matching matching + * + * @return self + */ + public function setMatching($matching) + { + if (is_null($matching)) { + throw new \InvalidArgumentException('non-nullable matching cannot be null'); + } + $this->container['matching'] = $matching; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/SegmentBucketedMatchRuleAllOfMatching.php b/packages/Types/lib/Generated/Model/SegmentBucketedMatchRuleAllOfMatching.php new file mode 100644 index 0000000..ecaaf36 --- /dev/null +++ b/packages/Types/lib/Generated/Model/SegmentBucketedMatchRuleAllOfMatching.php @@ -0,0 +1,443 @@ + + */ +class SegmentBucketedMatchRuleAllOfMatching implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SegmentBucketedMatchRule_allOf_matching'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'negated' => 'bool', + 'match_type' => '\OpenAPI\Client\Model\ChoiceMatchingOptions' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'negated' => null, + 'match_type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'negated' => false, + 'match_type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'negated' => 'negated', + 'match_type' => 'match_type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'negated' => 'setNegated', + 'match_type' => 'setMatchType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'negated' => 'getNegated', + 'match_type' => 'getMatchType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('negated', $data ?? [], null); + $this->setIfExists('match_type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets negated + * + * @return bool|null + */ + public function getNegated() + { + return $this->container['negated']; + } + + /** + * Sets negated + * + * @param bool|null $negated When true, the rule result is gonna be negated. example: `url contains \"test\"` with *negated* = true becomes `url does not contain \"test\"` + * + * @return self + */ + public function setNegated($negated) + { + if (is_null($negated)) { + throw new \InvalidArgumentException('non-nullable negated cannot be null'); + } + $this->container['negated'] = $negated; + + return $this; + } + + /** + * Gets match_type + * + * @return \OpenAPI\Client\Model\ChoiceMatchingOptions|null + */ + public function getMatchType() + { + return $this->container['match_type']; + } + + /** + * Sets match_type + * + * @param \OpenAPI\Client\Model\ChoiceMatchingOptions|null $match_type match_type + * + * @return self + */ + public function setMatchType($match_type) + { + if (is_null($match_type)) { + throw new \InvalidArgumentException('non-nullable match_type cannot be null'); + } + $this->container['match_type'] = $match_type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/SegmentBucketedMatchRulesTypes.php b/packages/Types/lib/Generated/Model/SegmentBucketedMatchRulesTypes.php new file mode 100644 index 0000000..0e5682f --- /dev/null +++ b/packages/Types/lib/Generated/Model/SegmentBucketedMatchRulesTypes.php @@ -0,0 +1,59 @@ + + */ +class SendTrackingEventsRequestData implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SendTrackingEventsRequestData'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'account_id' => 'string', + 'project_id' => 'string', + 'enrich_data' => 'bool', + 'visitors' => '\OpenAPI\Client\Model\SendTrackingEventsRequestDataVisitorsInner[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'account_id' => null, + 'project_id' => null, + 'enrich_data' => null, + 'visitors' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'account_id' => false, + 'project_id' => false, + 'enrich_data' => false, + 'visitors' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'account_id' => 'accountId', + 'project_id' => 'projectId', + 'enrich_data' => 'enrichData', + 'visitors' => 'visitors' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'account_id' => 'setAccountId', + 'project_id' => 'setProjectId', + 'enrich_data' => 'setEnrichData', + 'visitors' => 'setVisitors' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'account_id' => 'getAccountId', + 'project_id' => 'getProjectId', + 'enrich_data' => 'getEnrichData', + 'visitors' => 'getVisitors' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('account_id', $data ?? [], null); + $this->setIfExists('project_id', $data ?? [], null); + $this->setIfExists('enrich_data', $data ?? [], null); + $this->setIfExists('visitors', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets account_id + * + * @return string|null + */ + public function getAccountId() + { + return $this->container['account_id']; + } + + /** + * Sets account_id + * + * @param string|null $account_id ID of the account under which the project is setup + * + * @return self + */ + public function setAccountId($account_id) + { + if (is_null($account_id)) { + throw new \InvalidArgumentException('non-nullable account_id cannot be null'); + } + $this->container['account_id'] = $account_id; + + return $this; + } + + /** + * Gets project_id + * + * @return string|null + */ + public function getProjectId() + { + return $this->container['project_id']; + } + + /** + * Sets project_id + * + * @param string|null $project_id ID of the project under which the tracking occurs + * + * @return self + */ + public function setProjectId($project_id) + { + if (is_null($project_id)) { + throw new \InvalidArgumentException('non-nullable project_id cannot be null'); + } + $this->container['project_id'] = $project_id; + + return $this; + } + + /** + * Gets enrich_data + * + * @return bool|null + */ + public function getEnrichData() + { + return $this->container['enrich_data']; + } + + /** + * Sets enrich_data + * + * @param bool|null $enrich_data Flag to determine whether the data is gonna be enriched before the events are stored for reporting. For example, in case of a conversion event, if this flag is on and bucketing is not provided, the bucketing stored on the backend datastore for the given visitor ID would be used. Same applies for segments. *Note*: this flag is only available for some plans + * + * @return self + */ + public function setEnrichData($enrich_data) + { + if (is_null($enrich_data)) { + throw new \InvalidArgumentException('non-nullable enrich_data cannot be null'); + } + $this->container['enrich_data'] = $enrich_data; + + return $this; + } + + /** + * Gets visitors + * + * @return \OpenAPI\Client\Model\SendTrackingEventsRequestDataVisitorsInner[]|null + */ + public function getVisitors() + { + return $this->container['visitors']; + } + + /** + * Sets visitors + * + * @param \OpenAPI\Client\Model\SendTrackingEventsRequestDataVisitorsInner[]|null $visitors List of visitors tracked. Each visitor can have multiple events. + * + * @return self + */ + public function setVisitors($visitors) + { + if (is_null($visitors)) { + throw new \InvalidArgumentException('non-nullable visitors cannot be null'); + } + $this->container['visitors'] = $visitors; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/SendTrackingEventsRequestDataVisitorsInner.php b/packages/Types/lib/Generated/Model/SendTrackingEventsRequestDataVisitorsInner.php new file mode 100644 index 0000000..d9ca49b --- /dev/null +++ b/packages/Types/lib/Generated/Model/SendTrackingEventsRequestDataVisitorsInner.php @@ -0,0 +1,477 @@ + + */ +class SendTrackingEventsRequestDataVisitorsInner implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SendTrackingEventsRequestData_visitors_inner'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'segments' => '\OpenAPI\Client\Model\VisitorSegments', + 'visitor_id' => 'string', + 'events' => '\OpenAPI\Client\Model\VisitorTrackingEvents[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'segments' => null, + 'visitor_id' => null, + 'events' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'segments' => false, + 'visitor_id' => false, + 'events' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'segments' => 'segments', + 'visitor_id' => 'visitorId', + 'events' => 'events' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'segments' => 'setSegments', + 'visitor_id' => 'setVisitorId', + 'events' => 'setEvents' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'segments' => 'getSegments', + 'visitor_id' => 'getVisitorId', + 'events' => 'getEvents' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('segments', $data ?? [], null); + $this->setIfExists('visitor_id', $data ?? [], null); + $this->setIfExists('events', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets segments + * + * @return \OpenAPI\Client\Model\VisitorSegments|null + */ + public function getSegments() + { + return $this->container['segments']; + } + + /** + * Sets segments + * + * @param \OpenAPI\Client\Model\VisitorSegments|null $segments segments + * + * @return self + */ + public function setSegments($segments) + { + if (is_null($segments)) { + throw new \InvalidArgumentException('non-nullable segments cannot be null'); + } + $this->container['segments'] = $segments; + + return $this; + } + + /** + * Gets visitor_id + * + * @return string|null + */ + public function getVisitorId() + { + return $this->container['visitor_id']; + } + + /** + * Sets visitor_id + * + * @param string|null $visitor_id Id of the visitor tracked + * + * @return self + */ + public function setVisitorId($visitor_id) + { + if (is_null($visitor_id)) { + throw new \InvalidArgumentException('non-nullable visitor_id cannot be null'); + } + $this->container['visitor_id'] = $visitor_id; + + return $this; + } + + /** + * Gets events + * + * @return \OpenAPI\Client\Model\VisitorTrackingEvents[]|null + */ + public function getEvents() + { + return $this->container['events']; + } + + /** + * Sets events + * + * @param \OpenAPI\Client\Model\VisitorTrackingEvents[]|null $events List of events fired for the given visitor + * + * @return self + */ + public function setEvents($events) + { + if (is_null($events)) { + throw new \InvalidArgumentException('non-nullable events cannot be null'); + } + $this->container['events'] = $events; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/SetMatchingOptions.php b/packages/Types/lib/Generated/Model/SetMatchingOptions.php new file mode 100644 index 0000000..1eb3a34 --- /dev/null +++ b/packages/Types/lib/Generated/Model/SetMatchingOptions.php @@ -0,0 +1,59 @@ + + */ +class SortDirection implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SortDirection'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'sort_direction' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'sort_direction' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'sort_direction' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'sort_direction' => 'sort_direction' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'sort_direction' => 'setSortDirection' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'sort_direction' => 'getSortDirection' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const SORT_DIRECTION_ASC = 'asc'; + public const SORT_DIRECTION_DESC = 'desc'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getSortDirectionAllowableValues() + { + return [ + self::SORT_DIRECTION_ASC, + self::SORT_DIRECTION_DESC, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('sort_direction', $data ?? [], 'desc'); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getSortDirectionAllowableValues(); + if (!is_null($this->container['sort_direction']) && !in_array($this->container['sort_direction'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'sort_direction', must be one of '%s'", + $this->container['sort_direction'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets sort_direction + * + * @return string|null + */ + public function getSortDirection() + { + return $this->container['sort_direction']; + } + + /** + * Sets sort_direction + * + * @param string|null $sort_direction Data sorting direction using \"sort_by\" field. \"asc\" for ascending direction, \"desc\" for descending direction Defaults to **desc** when not sent in a request + * + * @return self + */ + public function setSortDirection($sort_direction) + { + if (is_null($sort_direction)) { + array_push($this->openAPINullablesSetToNull, 'sort_direction'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('sort_direction', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $allowedValues = $this->getSortDirectionAllowableValues(); + if (!is_null($sort_direction) && !in_array($sort_direction, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'sort_direction', must be one of '%s'", + $sort_direction, + implode("', '", $allowedValues) + ) + ); + } + $this->container['sort_direction'] = $sort_direction; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/SubmitsFormGoal.php b/packages/Types/lib/Generated/Model/SubmitsFormGoal.php new file mode 100644 index 0000000..a6e5f66 --- /dev/null +++ b/packages/Types/lib/Generated/Model/SubmitsFormGoal.php @@ -0,0 +1,618 @@ + + */ +class SubmitsFormGoal implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SubmitsFormGoal'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'string', + 'name' => 'string', + 'key' => 'string', + 'type' => 'string', + 'rules' => '\OpenAPI\Client\Model\RuleObject', + 'settings' => '\OpenAPI\Client\Model\SubmitsFormGoalSettings' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'name' => null, + 'key' => null, + 'type' => null, + 'rules' => null, + 'settings' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'name' => false, + 'key' => false, + 'type' => false, + 'rules' => true, + 'settings' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'name' => 'name', + 'key' => 'key', + 'type' => 'type', + 'rules' => 'rules', + 'settings' => 'settings' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'name' => 'setName', + 'key' => 'setKey', + 'type' => 'setType', + 'rules' => 'setRules', + 'settings' => 'setSettings' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'name' => 'getName', + 'key' => 'getKey', + 'type' => 'getType', + 'rules' => 'getRules', + 'settings' => 'getSettings' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_SUBMITS_FORM = 'submits_form'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_SUBMITS_FORM, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('key', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('rules', $data ?? [], null); + $this->setIfExists('settings', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id Goal ID + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name Goal Name. + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets key + * + * @return string|null + */ + public function getKey() + { + return $this->container['key']; + } + + /** + * Sets key + * + * @param string|null $key Goal Key + * + * @return self + */ + public function setKey($key) + { + if (is_null($key)) { + throw new \InvalidArgumentException('non-nullable key cannot be null'); + } + $this->container['key'] = $key; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type type + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets rules + * + * @return \OpenAPI\Client\Model\RuleObject|null + */ + public function getRules() + { + return $this->container['rules']; + } + + /** + * Sets rules + * + * @param \OpenAPI\Client\Model\RuleObject|null $rules rules + * + * @return self + */ + public function setRules($rules) + { + if (is_null($rules)) { + array_push($this->openAPINullablesSetToNull, 'rules'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('rules', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['rules'] = $rules; + + return $this; + } + + /** + * Gets settings + * + * @return \OpenAPI\Client\Model\SubmitsFormGoalSettings|null + */ + public function getSettings() + { + return $this->container['settings']; + } + + /** + * Sets settings + * + * @param \OpenAPI\Client\Model\SubmitsFormGoalSettings|null $settings settings + * + * @return self + */ + public function setSettings($settings) + { + if (is_null($settings)) { + throw new \InvalidArgumentException('non-nullable settings cannot be null'); + } + $this->container['settings'] = $settings; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/SubmitsFormGoalSettings.php b/packages/Types/lib/Generated/Model/SubmitsFormGoalSettings.php new file mode 100644 index 0000000..6beff51 --- /dev/null +++ b/packages/Types/lib/Generated/Model/SubmitsFormGoalSettings.php @@ -0,0 +1,412 @@ + + */ +class SubmitsFormGoalSettings implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SubmitsFormGoalSettings'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'action' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'action' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'action' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'action' => 'action' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'action' => 'setAction' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'action' => 'getAction' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('action', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['action'] === null) { + $invalidProperties[] = "'action' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets action + * + * @return string + */ + public function getAction() + { + return $this->container['action']; + } + + /** + * Sets action + * + * @param string $action Url representing form's action attribute used to identify forms which will be tracked for submit event. + * + * @return self + */ + public function setAction($action) + { + if (is_null($action)) { + throw new \InvalidArgumentException('non-nullable action cannot be null'); + } + $this->container['action'] = $action; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/SuccessData.php b/packages/Types/lib/Generated/Model/SuccessData.php new file mode 100644 index 0000000..25bb065 --- /dev/null +++ b/packages/Types/lib/Generated/Model/SuccessData.php @@ -0,0 +1,443 @@ + + */ +class SuccessData implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SuccessData'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'code' => 'int', + 'message' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'code' => 'int32', + 'message' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'code' => false, + 'message' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'code' => 'code', + 'message' => 'message' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'code' => 'setCode', + 'message' => 'setMessage' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'code' => 'getCode', + 'message' => 'getMessage' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('code', $data ?? [], null); + $this->setIfExists('message', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets code + * + * @return int|null + */ + public function getCode() + { + return $this->container['code']; + } + + /** + * Sets code + * + * @param int|null $code code + * + * @return self + */ + public function setCode($code) + { + if (is_null($code)) { + throw new \InvalidArgumentException('non-nullable code cannot be null'); + } + $this->container['code'] = $code; + + return $this; + } + + /** + * Gets message + * + * @return string|null + */ + public function getMessage() + { + return $this->container['message']; + } + + /** + * Sets message + * + * @param string|null $message message + * + * @return self + */ + public function setMessage($message) + { + if (is_null($message)) { + throw new \InvalidArgumentException('non-nullable message cannot be null'); + } + $this->container['message'] = $message; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/TextMatchRulesTypes.php b/packages/Types/lib/Generated/Model/TextMatchRulesTypes.php new file mode 100644 index 0000000..aa5ea39 --- /dev/null +++ b/packages/Types/lib/Generated/Model/TextMatchRulesTypes.php @@ -0,0 +1,119 @@ + + */ +class TrackingScriptReleaseBase implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'TrackingScriptReleaseBase'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'current_version' => 'string', + 'latest_version' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'current_version' => null, + 'latest_version' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'current_version' => false, + 'latest_version' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'current_version' => 'current_version', + 'latest_version' => 'latest_version' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'current_version' => 'setCurrentVersion', + 'latest_version' => 'setLatestVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'current_version' => 'getCurrentVersion', + 'latest_version' => 'getLatestVersion' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('current_version', $data ?? [], null); + $this->setIfExists('latest_version', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets current_version + * + * @return string|null + */ + public function getCurrentVersion() + { + return $this->container['current_version']; + } + + /** + * Sets current_version + * + * @param string|null $current_version Current version of the tracking script bundle + * + * @return self + */ + public function setCurrentVersion($current_version) + { + if (is_null($current_version)) { + throw new \InvalidArgumentException('non-nullable current_version cannot be null'); + } + $this->container['current_version'] = $current_version; + + return $this; + } + + /** + * Gets latest_version + * + * @return string|null + */ + public function getLatestVersion() + { + return $this->container['latest_version']; + } + + /** + * Sets latest_version + * + * @param string|null $latest_version Latest available version of the tracking script bundle. + * + * @return self + */ + public function setLatestVersion($latest_version) + { + if (is_null($latest_version)) { + array_push($this->openAPINullablesSetToNull, 'latest_version'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('latest_version', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['latest_version'] = $latest_version; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/UpdateExperienceChangeRequestData.php b/packages/Types/lib/Generated/Model/UpdateExperienceChangeRequestData.php new file mode 100644 index 0000000..0b11ace --- /dev/null +++ b/packages/Types/lib/Generated/Model/UpdateExperienceChangeRequestData.php @@ -0,0 +1,381 @@ + + */ +class UpdateExperienceChangeRequestData implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'UpdateExperienceChangeRequestData'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/VariationStatuses.php b/packages/Types/lib/Generated/Model/VariationStatuses.php new file mode 100644 index 0000000..6630836 --- /dev/null +++ b/packages/Types/lib/Generated/Model/VariationStatuses.php @@ -0,0 +1,63 @@ + + */ +class VisitorInsightsData implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'VisitorInsightsData'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'tracking_id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'tracking_id' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'tracking_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'tracking_id' => 'tracking_id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'tracking_id' => 'setTrackingId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'tracking_id' => 'getTrackingId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('tracking_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets tracking_id + * + * @return string|null + */ + public function getTrackingId() + { + return $this->container['tracking_id']; + } + + /** + * Sets tracking_id + * + * @param string|null $tracking_id tracking_id + * + * @return self + */ + public function setTrackingId($tracking_id) + { + if (is_null($tracking_id)) { + throw new \InvalidArgumentException('non-nullable tracking_id cannot be null'); + } + $this->container['tracking_id'] = $tracking_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/VisitorSegments.php b/packages/Types/lib/Generated/Model/VisitorSegments.php new file mode 100644 index 0000000..6ab4d09 --- /dev/null +++ b/packages/Types/lib/Generated/Model/VisitorSegments.php @@ -0,0 +1,779 @@ + + */ +class VisitorSegments implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'VisitorSegments'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'browser' => 'string', + 'devices' => 'string[]', + 'source' => 'string', + 'campaign' => 'string', + 'visitor_type' => 'string', + 'country' => 'string', + 'custom_segments' => 'string[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'browser' => null, + 'devices' => null, + 'source' => null, + 'campaign' => null, + 'visitor_type' => null, + 'country' => null, + 'custom_segments' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'browser' => false, + 'devices' => false, + 'source' => false, + 'campaign' => false, + 'visitor_type' => false, + 'country' => false, + 'custom_segments' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'browser' => 'browser', + 'devices' => 'devices', + 'source' => 'source', + 'campaign' => 'campaign', + 'visitor_type' => 'visitorType', + 'country' => 'country', + 'custom_segments' => 'custom_segments' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'browser' => 'setBrowser', + 'devices' => 'setDevices', + 'source' => 'setSource', + 'campaign' => 'setCampaign', + 'visitor_type' => 'setVisitorType', + 'country' => 'setCountry', + 'custom_segments' => 'setCustomSegments' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'browser' => 'getBrowser', + 'devices' => 'getDevices', + 'source' => 'getSource', + 'campaign' => 'getCampaign', + 'visitor_type' => 'getVisitorType', + 'country' => 'getCountry', + 'custom_segments' => 'getCustomSegments' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const BROWSER_IE = 'IE'; + public const BROWSER_CH = 'CH'; + public const BROWSER_FF = 'FF'; + public const BROWSER_OP = 'OP'; + public const BROWSER_SF = 'SF'; + public const BROWSER_OTH = 'OTH'; + public const DEVICES_ALLPH = 'ALLPH'; + public const DEVICES_IPH = 'IPH'; + public const DEVICES_OTHPH = 'OTHPH'; + public const DEVICES_ALLTAB = 'ALLTAB'; + public const DEVICES_IPAD = 'IPAD'; + public const DEVICES_OTHTAB = 'OTHTAB'; + public const DEVICES_DESK = 'DESK'; + public const DEVICES_OTHDEV = 'OTHDEV'; + public const SOURCE_CAMPAIGN = 'campaign'; + public const SOURCE_SEARCH = 'search'; + public const SOURCE_REFERRAL = 'referral'; + public const SOURCE_DIRECT = 'direct'; + public const VISITOR_TYPE__NEW = 'new'; + public const VISITOR_TYPE_RETURNING = 'returning'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getBrowserAllowableValues() + { + return [ + self::BROWSER_IE, + self::BROWSER_CH, + self::BROWSER_FF, + self::BROWSER_OP, + self::BROWSER_SF, + self::BROWSER_OTH, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getDevicesAllowableValues() + { + return [ + self::DEVICES_ALLPH, + self::DEVICES_IPH, + self::DEVICES_OTHPH, + self::DEVICES_ALLTAB, + self::DEVICES_IPAD, + self::DEVICES_OTHTAB, + self::DEVICES_DESK, + self::DEVICES_OTHDEV, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getSourceAllowableValues() + { + return [ + self::SOURCE_CAMPAIGN, + self::SOURCE_SEARCH, + self::SOURCE_REFERRAL, + self::SOURCE_DIRECT, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getVisitorTypeAllowableValues() + { + return [ + self::VISITOR_TYPE__NEW, + self::VISITOR_TYPE_RETURNING, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('browser', $data ?? [], null); + $this->setIfExists('devices', $data ?? [], null); + $this->setIfExists('source', $data ?? [], null); + $this->setIfExists('campaign', $data ?? [], null); + $this->setIfExists('visitor_type', $data ?? [], null); + $this->setIfExists('country', $data ?? [], null); + $this->setIfExists('custom_segments', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getBrowserAllowableValues(); + if (!is_null($this->container['browser']) && !in_array($this->container['browser'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'browser', must be one of '%s'", + $this->container['browser'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getSourceAllowableValues(); + if (!is_null($this->container['source']) && !in_array($this->container['source'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'source', must be one of '%s'", + $this->container['source'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getVisitorTypeAllowableValues(); + if (!is_null($this->container['visitor_type']) && !in_array($this->container['visitor_type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'visitor_type', must be one of '%s'", + $this->container['visitor_type'], + implode("', '", $allowedValues) + ); + } + + if (!is_null($this->container['country']) && (mb_strlen($this->container['country']) > 2)) { + $invalidProperties[] = "invalid value for 'country', the character length must be smaller than or equal to 2."; + } + + if (!is_null($this->container['country']) && (mb_strlen($this->container['country']) < 2)) { + $invalidProperties[] = "invalid value for 'country', the character length must be bigger than or equal to 2."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets browser + * + * @return string|null + */ + public function getBrowser() + { + return $this->container['browser']; + } + + /** + * Sets browser + * + * @param string|null $browser Browser used: IE - Internet Explorer CH - Chrome FF - Firefox OP - Opera SF - Safari OTH - Other + * + * @return self + */ + public function setBrowser($browser) + { + if (is_null($browser)) { + throw new \InvalidArgumentException('non-nullable browser cannot be null'); + } + $allowedValues = $this->getBrowserAllowableValues(); + if (!in_array($browser, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'browser', must be one of '%s'", + $browser, + implode("', '", $allowedValues) + ) + ); + } + $this->container['browser'] = $browser; + + return $this; + } + + /** + * Gets devices + * + * @return string[]|null + */ + public function getDevices() + { + return $this->container['devices']; + } + + /** + * Sets devices + * + * @param string[]|null $devices List of device classes that the visitor device falls into + * + * @return self + */ + public function setDevices($devices) + { + if (is_null($devices)) { + throw new \InvalidArgumentException('non-nullable devices cannot be null'); + } + $allowedValues = $this->getDevicesAllowableValues(); + if (array_diff($devices, $allowedValues)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'devices', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['devices'] = $devices; + + return $this; + } + + /** + * Gets source + * + * @return string|null + */ + public function getSource() + { + return $this->container['source']; + } + + /** + * Sets source + * + * @param string|null $source Traffic source + * + * @return self + */ + public function setSource($source) + { + if (is_null($source)) { + throw new \InvalidArgumentException('non-nullable source cannot be null'); + } + $allowedValues = $this->getSourceAllowableValues(); + if (!in_array($source, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'source', must be one of '%s'", + $source, + implode("', '", $allowedValues) + ) + ); + } + $this->container['source'] = $source; + + return $this; + } + + /** + * Gets campaign + * + * @return string|null + */ + public function getCampaign() + { + return $this->container['campaign']; + } + + /** + * Sets campaign + * + * @param string|null $campaign Campaign string + * + * @return self + */ + public function setCampaign($campaign) + { + if (is_null($campaign)) { + throw new \InvalidArgumentException('non-nullable campaign cannot be null'); + } + $this->container['campaign'] = $campaign; + + return $this; + } + + /** + * Gets visitor_type + * + * @return string|null + */ + public function getVisitorType() + { + return $this->container['visitor_type']; + } + + /** + * Sets visitor_type + * + * @param string|null $visitor_type Type of the visitor + * + * @return self + */ + public function setVisitorType($visitor_type) + { + if (is_null($visitor_type)) { + throw new \InvalidArgumentException('non-nullable visitor_type cannot be null'); + } + $allowedValues = $this->getVisitorTypeAllowableValues(); + if (!in_array($visitor_type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'visitor_type', must be one of '%s'", + $visitor_type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['visitor_type'] = $visitor_type; + + return $this; + } + + /** + * Gets country + * + * @return string|null + */ + public function getCountry() + { + return $this->container['country']; + } + + /** + * Sets country + * + * @param string|null $country Two ISO country code for visitor's country + * + * @return self + */ + public function setCountry($country) + { + if (is_null($country)) { + throw new \InvalidArgumentException('non-nullable country cannot be null'); + } + if ((mb_strlen($country) > 2)) { + throw new \InvalidArgumentException('invalid length for $country when calling VisitorSegments., must be smaller than or equal to 2.'); + } + if ((mb_strlen($country) < 2)) { + throw new \InvalidArgumentException('invalid length for $country when calling VisitorSegments., must be bigger than or equal to 2.'); + } + + $this->container['country'] = $country; + + return $this; + } + + /** + * Gets custom_segments + * + * @return string[]|null + */ + public function getCustomSegments() + { + return $this->container['custom_segments']; + } + + /** + * Sets custom_segments + * + * @param string[]|null $custom_segments Custom Segments as defined inside Convert app. This will be the list of segments' IDs + * + * @return self + */ + public function setCustomSegments($custom_segments) + { + if (is_null($custom_segments)) { + throw new \InvalidArgumentException('non-nullable custom_segments cannot be null'); + } + $this->container['custom_segments'] = $custom_segments; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/VisitorTrackingEvents.php b/packages/Types/lib/Generated/Model/VisitorTrackingEvents.php new file mode 100644 index 0000000..b327018 --- /dev/null +++ b/packages/Types/lib/Generated/Model/VisitorTrackingEvents.php @@ -0,0 +1,478 @@ + + */ +class VisitorTrackingEvents implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'VisitorTrackingEvents'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'eventType' => 'string', + 'data' => '\OpenAPI\Client\Model\VisitorTrackingEventsData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'eventType' => null, + 'data' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'eventType' => false, + 'data' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'eventType' => 'eventType', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'eventType' => 'setEventType', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'eventType' => 'getEventType', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const EVENT_TYPE_BUCKETING = 'bucketing'; + public const EVENT_TYPE_CONVERSION = 'conversion'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getEventTypeAllowableValues() + { + return [ + self::EVENT_TYPE_BUCKETING, + self::EVENT_TYPE_CONVERSION, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('eventType', $data ?? [], null); + $this->setIfExists('data', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getEventTypeAllowableValues(); + if (!is_null($this->container['eventType']) && !in_array($this->container['eventType'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'eventType', must be one of '%s'", + $this->container['eventType'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets event_type + * + * @return string|null + */ + public function getEventType() + { + return $this->container['eventType']; + } + + /** + * Sets event_type + * + * @param string|null $event_type Type of the event. It can be a bucketing or a conversion event + * + * @return self + */ + public function setEventType($event_type) + { + if (is_null($event_type)) { + throw new \InvalidArgumentException('non-nullable event_type cannot be null'); + } + $allowedValues = $this->getEventTypeAllowableValues(); + if (!in_array($event_type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'event_type', must be one of '%s'", + $event_type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['eventType'] = $event_type; + + return $this; + } + + /** + * Gets data + * + * @return \OpenAPI\Client\Model\VisitorTrackingEventsData|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \OpenAPI\Client\Model\VisitorTrackingEventsData|null $data data + * + * @return self + */ + public function setData($data) + { + if (is_null($data)) { + throw new \InvalidArgumentException('non-nullable data cannot be null'); + } + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/VisitorTrackingEventsData.php b/packages/Types/lib/Generated/Model/VisitorTrackingEventsData.php new file mode 100644 index 0000000..349e888 --- /dev/null +++ b/packages/Types/lib/Generated/Model/VisitorTrackingEventsData.php @@ -0,0 +1,554 @@ + + */ +class VisitorTrackingEventsData implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'VisitorTrackingEvents_data'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'experience_id' => 'string', + 'variation_id' => 'string', + 'goal_id' => 'string', + 'goal_data' => '\OpenAPI\Client\Model\ConversionEventGoalDataInner[]', + 'bucketing_data' => 'array' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'experience_id' => null, + 'variation_id' => null, + 'goal_id' => null, + 'goal_data' => null, + 'bucketing_data' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'experience_id' => false, + 'variation_id' => false, + 'goal_id' => false, + 'goal_data' => false, + 'bucketing_data' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'experience_id' => 'experienceId', + 'variation_id' => 'variationId', + 'goal_id' => 'goalId', + 'goal_data' => 'goalData', + 'bucketing_data' => 'bucketingData' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'experience_id' => 'setExperienceId', + 'variation_id' => 'setVariationId', + 'goal_id' => 'setGoalId', + 'goal_data' => 'setGoalData', + 'bucketing_data' => 'setBucketingData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'experience_id' => 'getExperienceId', + 'variation_id' => 'getVariationId', + 'goal_id' => 'getGoalId', + 'goal_data' => 'getGoalData', + 'bucketing_data' => 'getBucketingData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('experience_id', $data ?? [], null); + $this->setIfExists('variation_id', $data ?? [], null); + $this->setIfExists('goal_id', $data ?? [], null); + $this->setIfExists('goal_data', $data ?? [], null); + $this->setIfExists('bucketing_data', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['experience_id'] === null) { + $invalidProperties[] = "'experience_id' can't be null"; + } + if ($this->container['variation_id'] === null) { + $invalidProperties[] = "'variation_id' can't be null"; + } + if ($this->container['goal_id'] === null) { + $invalidProperties[] = "'goal_id' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets experience_id + * + * @return string + */ + public function getExperienceId() + { + return $this->container['experience_id']; + } + + /** + * Sets experience_id + * + * @param string $experience_id Experience ID to which the visitor is bucketed. In case that **enrichData=true** flag is being sent, only unique events are gonna be recorded. Otherwise, it's up to the client to ensure that duplicates of the same event for the same visitor do not get sent to the tracking endpoint. + * + * @return self + */ + public function setExperienceId($experience_id) + { + if (is_null($experience_id)) { + throw new \InvalidArgumentException('non-nullable experience_id cannot be null'); + } + $this->container['experience_id'] = $experience_id; + + return $this; + } + + /** + * Gets variation_id + * + * @return string + */ + public function getVariationId() + { + return $this->container['variation_id']; + } + + /** + * Sets variation_id + * + * @param string $variation_id Variation ID corresponding to the experience identified by experienceID, that is assigned to the visitor. + * + * @return self + */ + public function setVariationId($variation_id) + { + if (is_null($variation_id)) { + throw new \InvalidArgumentException('non-nullable variation_id cannot be null'); + } + $this->container['variation_id'] = $variation_id; + + return $this; + } + + /** + * Gets goal_id + * + * @return string + */ + public function getGoalId() + { + return $this->container['goal_id']; + } + + /** + * Sets goal_id + * + * @param string $goal_id Id of the conversion goal to be fired + * + * @return self + */ + public function setGoalId($goal_id) + { + if (is_null($goal_id)) { + throw new \InvalidArgumentException('non-nullable goal_id cannot be null'); + } + $this->container['goal_id'] = $goal_id; + + return $this; + } + + /** + * Gets goal_data + * + * @return \OpenAPI\Client\Model\ConversionEventGoalDataInner[]|null + */ + public function getGoalData() + { + return $this->container['goal_data']; + } + + /** + * Sets goal_data + * + * @param \OpenAPI\Client\Model\ConversionEventGoalDataInner[]|null $goal_data Data connected to this conversion, for non binomial metrics, eg revenue + * + * @return self + */ + public function setGoalData($goal_data) + { + if (is_null($goal_data)) { + throw new \InvalidArgumentException('non-nullable goal_data cannot be null'); + } + $this->container['goal_data'] = $goal_data; + + return $this; + } + + /** + * Gets bucketing_data + * + * @return array|null + */ + public function getBucketingData() + { + return $this->container['bucketing_data']; + } + + /** + * Sets bucketing_data + * + * @param array|null $bucketing_data Bucketing data (experiences that this visitor is currently part of) for the visitor. In case that **enrichData=true** flag is being sent and this attribute is not provided, the bucketing stored on the backend datastore for the given visitor is gonna be used. If both **enrichData=true** and **bucketingData**, the **bucketingData** is gonna be merged with the stored data inside the backend data source, the request provided data having the biggest overwriting bucketing for the same experience which might exist on the backend + * + * @return self + */ + public function setBucketingData($bucketing_data) + { + if (is_null($bucketing_data)) { + throw new \InvalidArgumentException('non-nullable bucketing_data cannot be null'); + } + $this->container['bucketing_data'] = $bucketing_data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/VisitorTypeMatchRule.php b/packages/Types/lib/Generated/Model/VisitorTypeMatchRule.php new file mode 100644 index 0000000..e01a3a6 --- /dev/null +++ b/packages/Types/lib/Generated/Model/VisitorTypeMatchRule.php @@ -0,0 +1,514 @@ + + */ +class VisitorTypeMatchRule implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'VisitorTypeMatchRule'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'rule_type' => '\OpenAPI\Client\Model\VisitorTypeMatchRulesTypes', + 'value' => 'string', + 'matching' => '\OpenAPI\Client\Model\VisitorTypeMatchRuleAllOfMatching' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'rule_type' => null, + 'value' => null, + 'matching' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'rule_type' => false, + 'value' => false, + 'matching' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'rule_type' => 'rule_type', + 'value' => 'value', + 'matching' => 'matching' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'rule_type' => 'setRuleType', + 'value' => 'setValue', + 'matching' => 'setMatching' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'rule_type' => 'getRuleType', + 'value' => 'getValue', + 'matching' => 'getMatching' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const VALUE__NEW = 'new'; + public const VALUE_RETURNING = 'returning'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getValueAllowableValues() + { + return [ + self::VALUE__NEW, + self::VALUE_RETURNING, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('rule_type', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); + $this->setIfExists('matching', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['rule_type'] === null) { + $invalidProperties[] = "'rule_type' can't be null"; + } + $allowedValues = $this->getValueAllowableValues(); + if (!is_null($this->container['value']) && !in_array($this->container['value'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'value', must be one of '%s'", + $this->container['value'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets rule_type + * + * @return \OpenAPI\Client\Model\VisitorTypeMatchRulesTypes + */ + public function getRuleType() + { + return $this->container['rule_type']; + } + + /** + * Sets rule_type + * + * @param \OpenAPI\Client\Model\VisitorTypeMatchRulesTypes $rule_type rule_type + * + * @return self + */ + public function setRuleType($rule_type) + { + if (is_null($rule_type)) { + throw new \InvalidArgumentException('non-nullable rule_type cannot be null'); + } + $this->container['rule_type'] = $rule_type; + + return $this; + } + + /** + * Gets value + * + * @return string|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param string|null $value Type of the visitors + * + * @return self + */ + public function setValue($value) + { + if (is_null($value)) { + throw new \InvalidArgumentException('non-nullable value cannot be null'); + } + $allowedValues = $this->getValueAllowableValues(); + if (!in_array($value, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'value', must be one of '%s'", + $value, + implode("', '", $allowedValues) + ) + ); + } + $this->container['value'] = $value; + + return $this; + } + + /** + * Gets matching + * + * @return \OpenAPI\Client\Model\VisitorTypeMatchRuleAllOfMatching|null + */ + public function getMatching() + { + return $this->container['matching']; + } + + /** + * Sets matching + * + * @param \OpenAPI\Client\Model\VisitorTypeMatchRuleAllOfMatching|null $matching matching + * + * @return self + */ + public function setMatching($matching) + { + if (is_null($matching)) { + throw new \InvalidArgumentException('non-nullable matching cannot be null'); + } + $this->container['matching'] = $matching; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/VisitorTypeMatchRuleAllOfMatching.php b/packages/Types/lib/Generated/Model/VisitorTypeMatchRuleAllOfMatching.php new file mode 100644 index 0000000..70f6ea1 --- /dev/null +++ b/packages/Types/lib/Generated/Model/VisitorTypeMatchRuleAllOfMatching.php @@ -0,0 +1,443 @@ + + */ +class VisitorTypeMatchRuleAllOfMatching implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'VisitorTypeMatchRule_allOf_matching'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'negated' => 'bool', + 'match_type' => '\OpenAPI\Client\Model\ChoiceMatchingOptions' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'negated' => null, + 'match_type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'negated' => false, + 'match_type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'negated' => 'negated', + 'match_type' => 'match_type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'negated' => 'setNegated', + 'match_type' => 'setMatchType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'negated' => 'getNegated', + 'match_type' => 'getMatchType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('negated', $data ?? [], null); + $this->setIfExists('match_type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets negated + * + * @return bool|null + */ + public function getNegated() + { + return $this->container['negated']; + } + + /** + * Sets negated + * + * @param bool|null $negated When true, the rule result is gonna be negated. example: `url contains \"test\"` with *negated* = true becomes `url does not contain \"test\"` + * + * @return self + */ + public function setNegated($negated) + { + if (is_null($negated)) { + throw new \InvalidArgumentException('non-nullable negated cannot be null'); + } + $this->container['negated'] = $negated; + + return $this; + } + + /** + * Gets match_type + * + * @return \OpenAPI\Client\Model\ChoiceMatchingOptions|null + */ + public function getMatchType() + { + return $this->container['match_type']; + } + + /** + * Sets match_type + * + * @param \OpenAPI\Client\Model\ChoiceMatchingOptions|null $match_type match_type + * + * @return self + */ + public function setMatchType($match_type) + { + if (is_null($match_type)) { + throw new \InvalidArgumentException('non-nullable match_type cannot be null'); + } + $this->container['match_type'] = $match_type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/VisitorTypeMatchRulesTypes.php b/packages/Types/lib/Generated/Model/VisitorTypeMatchRulesTypes.php new file mode 100644 index 0000000..4f98e20 --- /dev/null +++ b/packages/Types/lib/Generated/Model/VisitorTypeMatchRulesTypes.php @@ -0,0 +1,59 @@ + + */ +class WeatherConditionMatchRule implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'WeatherConditionMatchRule'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'rule_type' => '\OpenAPI\Client\Model\WeatherConditionMatchRulesTypes', + 'value' => 'string', + 'matching' => '\OpenAPI\Client\Model\WeatherConditionMatchRuleAllOfMatching' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'rule_type' => null, + 'value' => null, + 'matching' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'rule_type' => false, + 'value' => false, + 'matching' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'rule_type' => 'rule_type', + 'value' => 'value', + 'matching' => 'matching' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'rule_type' => 'setRuleType', + 'value' => 'setValue', + 'matching' => 'setMatching' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'rule_type' => 'getRuleType', + 'value' => 'getValue', + 'matching' => 'getMatching' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('rule_type', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); + $this->setIfExists('matching', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['rule_type'] === null) { + $invalidProperties[] = "'rule_type' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets rule_type + * + * @return \OpenAPI\Client\Model\WeatherConditionMatchRulesTypes + */ + public function getRuleType() + { + return $this->container['rule_type']; + } + + /** + * Sets rule_type + * + * @param \OpenAPI\Client\Model\WeatherConditionMatchRulesTypes $rule_type rule_type + * + * @return self + */ + public function setRuleType($rule_type) + { + if (is_null($rule_type)) { + throw new \InvalidArgumentException('non-nullable rule_type cannot be null'); + } + $this->container['rule_type'] = $rule_type; + + return $this; + } + + /** + * Gets value + * + * @return string|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param string|null $value Weather Condition name used for matching. Full or partial condition. The weather provider used by Convert detects the following conditions: - Blizzard - Blowing snow - Cloudy - Fog - Freezing drizzle - Freezing fog - Heavy freezing drizzle - Heavy rain - Heavy rain at times - Light drizzle - Light freezing rain - Light rain - Mist - Moderate rain - Moderate rain at times - Overcast - Partly cloudy - Patchy freezing drizzle possible - Patchy light drizzle - Patchy light rain - Patchy rain possible - Patchy sleet possible - Patchy snow possible - Sunny - Thundery outbreaks possible + * + * @return self + */ + public function setValue($value) + { + if (is_null($value)) { + throw new \InvalidArgumentException('non-nullable value cannot be null'); + } + $this->container['value'] = $value; + + return $this; + } + + /** + * Gets matching + * + * @return \OpenAPI\Client\Model\WeatherConditionMatchRuleAllOfMatching|null + */ + public function getMatching() + { + return $this->container['matching']; + } + + /** + * Sets matching + * + * @param \OpenAPI\Client\Model\WeatherConditionMatchRuleAllOfMatching|null $matching matching + * + * @return self + */ + public function setMatching($matching) + { + if (is_null($matching)) { + throw new \InvalidArgumentException('non-nullable matching cannot be null'); + } + $this->container['matching'] = $matching; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/WeatherConditionMatchRuleAllOfMatching.php b/packages/Types/lib/Generated/Model/WeatherConditionMatchRuleAllOfMatching.php new file mode 100644 index 0000000..e359ec1 --- /dev/null +++ b/packages/Types/lib/Generated/Model/WeatherConditionMatchRuleAllOfMatching.php @@ -0,0 +1,443 @@ + + */ +class WeatherConditionMatchRuleAllOfMatching implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'WeatherConditionMatchRule_allOf_matching'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'negated' => 'bool', + 'match_type' => '\OpenAPI\Client\Model\TextMatchingOptions' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'negated' => null, + 'match_type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'negated' => false, + 'match_type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'negated' => 'negated', + 'match_type' => 'match_type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'negated' => 'setNegated', + 'match_type' => 'setMatchType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'negated' => 'getNegated', + 'match_type' => 'getMatchType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('negated', $data ?? [], null); + $this->setIfExists('match_type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets negated + * + * @return bool|null + */ + public function getNegated() + { + return $this->container['negated']; + } + + /** + * Sets negated + * + * @param bool|null $negated When true, the rule result is gonna be negated. example: `url contains \"test\"` with *negated* = true becomes `url does not contain \"test\"` + * + * @return self + */ + public function setNegated($negated) + { + if (is_null($negated)) { + throw new \InvalidArgumentException('non-nullable negated cannot be null'); + } + $this->container['negated'] = $negated; + + return $this; + } + + /** + * Gets match_type + * + * @return \OpenAPI\Client\Model\TextMatchingOptions|null + */ + public function getMatchType() + { + return $this->container['match_type']; + } + + /** + * Sets match_type + * + * @param \OpenAPI\Client\Model\TextMatchingOptions|null $match_type match_type + * + * @return self + */ + public function setMatchType($match_type) + { + if (is_null($match_type)) { + throw new \InvalidArgumentException('non-nullable match_type cannot be null'); + } + $this->container['match_type'] = $match_type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/packages/Types/lib/Generated/Model/WeatherConditionMatchRulesTypes.php b/packages/Types/lib/Generated/Model/WeatherConditionMatchRulesTypes.php new file mode 100644 index 0000000..45b0433 --- /dev/null +++ b/packages/Types/lib/Generated/Model/WeatherConditionMatchRulesTypes.php @@ -0,0 +1,59 @@ +format('Y-m-d') : $data->format(self::$dateTimeFormat); + } + + if (is_array($data)) { + foreach ($data as $property => $value) { + $data[$property] = self::sanitizeForSerialization($value); + } + return $data; + } + + if (is_object($data)) { + $values = []; + if ($data instanceof ModelInterface) { + $formats = $data::openAPIFormats(); + foreach ($data::openAPITypes() as $property => $openAPIType) { + $getter = $data::getters()[$property]; + $value = $data->$getter(); + if ($value !== null && !in_array($openAPIType, ['\DateTime', '\SplFileObject', 'array', 'bool', 'boolean', 'byte', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)) { + $callable = [$openAPIType, 'getAllowableEnumValues']; + if (is_callable($callable)) { + /** array $callable */ + $allowedEnumTypes = $callable(); + if (!in_array($value, $allowedEnumTypes, true)) { + $imploded = implode("', '", $allowedEnumTypes); + throw new \InvalidArgumentException("Invalid value for enum '$openAPIType', must be one of: '$imploded'"); + } + } + } + if (($data::isNullable($property) && $data->isNullableSetToNull($property)) || $value !== null) { + $values[$data::attributeMap()[$property]] = self::sanitizeForSerialization($value, $openAPIType, $formats[$property]); + } + } + } else { + foreach($data as $property => $value) { + $values[$property] = self::sanitizeForSerialization($value); + } + } + return (object)$values; + } else { + return (string)$data; + } + } + + /** + * Sanitize filename by removing path. + * e.g. ../../sun.gif becomes sun.gif + * + * @param string $filename filename to be sanitized + * + * @return string the sanitized filename + */ + public static function sanitizeFilename($filename) + { + if (preg_match("/.*[\/\\\\](.*)$/", $filename, $match)) { + return $match[1]; + } else { + return $filename; + } + } + + /** + * Shorter timestamp microseconds to 6 digits length. + * + * @param string $timestamp Original timestamp + * + * @return string the shorten timestamp + */ + public static function sanitizeTimestamp($timestamp) + { + if (!is_string($timestamp)) return $timestamp; + + return preg_replace('/(:\d{2}.\d{6})\d*/', '$1', $timestamp); + } + + /** + * Take value and turn it into a string suitable for inclusion in + * the path, by url-encoding. + * + * @param string $value a string which will be part of the path + * + * @return string the serialized object + */ + public static function toPathValue($value) + { + return rawurlencode(self::toString($value)); + } + + /** + * Checks if a value is empty, based on its OpenAPI type. + * + * @param mixed $value + * @param string $openApiType + * + * @return bool true if $value is empty + */ + private static function isEmptyValue($value, string $openApiType): bool + { + # If empty() returns false, it is not empty regardless of its type. + if (!empty($value)) { + return false; + } + + # Null is always empty, as we cannot send a real "null" value in a query parameter. + if ($value === null) { + return true; + } + + switch ($openApiType) { + # For numeric values, false and '' are considered empty. + # This comparison is safe for floating point values, since the previous call to empty() will + # filter out values that don't match 0. + case 'int': + case 'integer': + return $value !== 0; + + case 'number': + case 'float': + return $value !== 0 && $value !== 0.0; + + # For boolean values, '' is considered empty + case 'bool': + case 'boolean': + return !in_array($value, [false, 0], true); + + # For string values, '' is considered empty. + case 'string': + return $value === ''; + + # For all the other types, any value at this point can be considered empty. + default: + return true; + } + } + + /** + * Take query parameter properties and turn it into an array suitable for + * native http_build_query or GuzzleHttp\Psr7\Query::build. + * + * @param mixed $value Parameter value + * @param string $paramName Parameter name + * @param string $openApiType OpenAPIType eg. array or object + * @param string $style Parameter serialization style + * @param bool $explode Parameter explode option + * @param bool $required Whether query param is required or not + * + * @return array + */ + public static function toQueryValue( + $value, + string $paramName, + string $openApiType = 'string', + string $style = 'form', + bool $explode = true, + bool $required = true + ): array { + + # Check if we should omit this parameter from the query. This should only happen when: + # - Parameter is NOT required; AND + # - its value is set to a value that is equivalent to "empty", depending on its OpenAPI type. For + # example, 0 as "int" or "boolean" is NOT an empty value. + if (self::isEmptyValue($value, $openApiType)) { + if ($required) { + return ["{$paramName}" => '']; + } else { + return []; + } + } + + # Handle DateTime objects in query + if($openApiType === "\\DateTime" && $value instanceof \DateTime) { + return ["{$paramName}" => $value->format(self::$dateTimeFormat)]; + } + + $query = []; + $value = (in_array($openApiType, ['object', 'array'], true)) ? (array)$value : $value; + + // since \GuzzleHttp\Psr7\Query::build fails with nested arrays + // need to flatten array first + $flattenArray = function ($arr, $name, &$result = []) use (&$flattenArray, $style, $explode) { + if (!is_array($arr)) return $arr; + + foreach ($arr as $k => $v) { + $prop = ($style === 'deepObject') ? $prop = "{$name}[{$k}]" : $k; + + if (is_array($v)) { + $flattenArray($v, $prop, $result); + } else { + if ($style !== 'deepObject' && !$explode) { + // push key itself + $result[] = $prop; + } + $result[$prop] = $v; + } + } + return $result; + }; + + $value = $flattenArray($value, $paramName); + + // https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#style-values + if ($openApiType === 'array' && $style === 'deepObject' && $explode) { + return $value; + } + + if ($openApiType === 'object' && ($style === 'deepObject' || $explode)) { + return $value; + } + + if ('boolean' === $openApiType && is_bool($value)) { + $value = self::convertBoolToQueryStringFormat($value); + } + + // handle style in serializeCollection + $query[$paramName] = ($explode) ? $value : self::serializeCollection((array)$value, $style); + + return $query; + } + + /** + * Convert boolean value to format for query string. + * + * @param bool $value Boolean value + * + * @return int|string Boolean value in format + */ + public static function convertBoolToQueryStringFormat(bool $value) + { + if (Configuration::BOOLEAN_FORMAT_STRING == Configuration::getDefaultConfiguration()->getBooleanFormatForQueryString()) { + return $value ? 'true' : 'false'; + } + + return (int) $value; + } + + /** + * Take value and turn it into a string suitable for inclusion in + * the header. If it's a string, pass through unchanged + * If it's a datetime object, format it in ISO8601 + * + * @param string $value a string which will be part of the header + * + * @return string the header string + */ + public static function toHeaderValue($value) + { + $callable = [$value, 'toHeaderValue']; + if (is_callable($callable)) { + return $callable(); + } + + return self::toString($value); + } + + /** + * Take value and turn it into a string suitable for inclusion in + * the http body (form parameter). If it's a string, pass through unchanged + * If it's a datetime object, format it in ISO8601 + * + * @param string|\SplFileObject $value the value of the form parameter + * + * @return string the form string + */ + public static function toFormValue($value) + { + if ($value instanceof \SplFileObject) { + return $value->getRealPath(); + } else { + return self::toString($value); + } + } + + /** + * Take value and turn it into a string suitable for inclusion in + * the parameter. If it's a string, pass through unchanged + * If it's a datetime object, format it in ISO8601 + * If it's a boolean, convert it to "true" or "false". + * + * @param float|int|bool|\DateTime $value the value of the parameter + * + * @return string the header string + */ + public static function toString($value) + { + if ($value instanceof \DateTime) { // datetime in ISO8601 format + return $value->format(self::$dateTimeFormat); + } elseif (is_bool($value)) { + return $value ? 'true' : 'false'; + } else { + return (string) $value; + } + } + + /** + * Serialize an array to a string. + * + * @param array $collection collection to serialize to a string + * @param string $style the format use for serialization (csv, + * ssv, tsv, pipes, multi) + * @param bool $allowCollectionFormatMulti allow collection format to be a multidimensional array + * + * @return string + */ + public static function serializeCollection(array $collection, $style, $allowCollectionFormatMulti = false) + { + if ($allowCollectionFormatMulti && ('multi' === $style)) { + // http_build_query() almost does the job for us. We just + // need to fix the result of multidimensional arrays. + return preg_replace('/%5B[0-9]+%5D=/', '=', http_build_query($collection, '', '&')); + } + switch ($style) { + case 'pipeDelimited': + case 'pipes': + return implode('|', $collection); + + case 'tsv': + return implode("\t", $collection); + + case 'spaceDelimited': + case 'ssv': + return implode(' ', $collection); + + case 'simple': + case 'csv': + // Deliberate fall through. CSV is default format. + default: + return implode(',', $collection); + } + } + + /** + * Deserialize a JSON string into an object + * + * @param mixed $data object or primitive to be deserialized + * @param string $class class name is passed as a string + * @param string[]|null $httpHeaders HTTP headers + * + * @return object|array|null a single or an array of $class instances + */ + public static function deserialize($data, $class, $httpHeaders = null) + { + if (null === $data) { + return null; + } + + if (strcasecmp(substr($class, -2), '[]') === 0) { + $data = is_string($data) ? json_decode($data) : $data; + + if (!is_array($data)) { + throw new \InvalidArgumentException("Invalid array '$class'"); + } + + $subClass = substr($class, 0, -2); + $values = []; + foreach ($data as $key => $value) { + $values[] = self::deserialize($value, $subClass, null); + } + return $values; + } + + if (preg_match('/^(array<|map\[)/', $class)) { // for associative array e.g. array + $data = is_string($data) ? json_decode($data) : $data; + settype($data, 'array'); + $inner = substr($class, 4, -1); + $deserialized = []; + if (strrpos($inner, ",") !== false) { + $subClass_array = explode(',', $inner, 2); + $subClass = $subClass_array[1]; + foreach ($data as $key => $value) { + $deserialized[$key] = self::deserialize($value, $subClass, null); + } + } + return $deserialized; + } + + if ($class === 'object') { + settype($data, 'array'); + return $data; + } elseif ($class === 'mixed') { + settype($data, gettype($data)); + return $data; + } + + if ($class === '\DateTime') { + // Some APIs return an invalid, empty string as a + // date-time property. DateTime::__construct() will return + // the current time for empty input which is probably not + // what is meant. The invalid empty string is probably to + // be interpreted as a missing field/value. Let's handle + // this graceful. + if (!empty($data)) { + try { + return new \DateTime($data); + } catch (\Exception $exception) { + // Some APIs return a date-time with too high nanosecond + // precision for php's DateTime to handle. + // With provided regexp 6 digits of microseconds saved + return new \DateTime(self::sanitizeTimestamp($data)); + } + } else { + return null; + } + } + + if ($class === '\SplFileObject') { + $data = Utils::streamFor($data); + + /** @var \Psr\Http\Message\StreamInterface $data */ + + // determine file name + if ( + is_array($httpHeaders) + && array_key_exists('Content-Disposition', $httpHeaders) + && preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match) + ) { + $filename = Configuration::getDefaultConfiguration()->getTempFolderPath() . DIRECTORY_SEPARATOR . self::sanitizeFilename($match[1]); + } else { + $filename = tempnam(Configuration::getDefaultConfiguration()->getTempFolderPath(), ''); + } + + $file = fopen($filename, 'w'); + while ($chunk = $data->read(200)) { + fwrite($file, $chunk); + } + fclose($file); + + return new \SplFileObject($filename, 'r'); + } + + /** @psalm-suppress ParadoxicalCondition */ + if (in_array($class, ['\DateTime', '\SplFileObject', 'array', 'bool', 'boolean', 'byte', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)) { + settype($data, $class); + return $data; + } + + + if (method_exists($class, 'getAllowableEnumValues')) { + if (!in_array($data, $class::getAllowableEnumValues(), true)) { + $imploded = implode("', '", $class::getAllowableEnumValues()); + throw new \InvalidArgumentException("Invalid value for enum '$class', must be one of: '$imploded'"); + } + return $data; + } else { + $data = is_string($data) ? json_decode($data) : $data; + + if (is_array($data)) { + $data = (object)$data; + } + + // If a discriminator is defined and points to a valid subclass, use it. + $discriminator = $class::DISCRIMINATOR; + if (!empty($discriminator) && isset($data->{$discriminator}) && is_string($data->{$discriminator})) { + $subclass = '\OpenAPI\Client\Model\\' . $data->{$discriminator}; + if (is_subclass_of($subclass, $class)) { + $class = $subclass; + } + } + + /** @var ModelInterface $instance */ + $instance = new $class(); + foreach ($instance::openAPITypes() as $property => $type) { + $propertySetter = $instance::setters()[$property]; + + if (!isset($propertySetter)) { + continue; + } + + if (!isset($data->{$instance::attributeMap()[$property]})) { + if ($instance::isNullable($property)) { + $instance->$propertySetter(null); + } + + continue; + } + + if (isset($data->{$instance::attributeMap()[$property]})) { + $propertyValue = $data->{$instance::attributeMap()[$property]}; + $instance->$propertySetter(self::deserialize($propertyValue, $type, null)); + } + } + return $instance; + } + } + + /** + * Build a query string from an array of key value pairs. + * + * This function can use the return value of `parse()` to build a query + * string. This function does not modify the provided keys when an array is + * encountered (like `http_build_query()` would). + * + * The function is copied from https://github.com/guzzle/psr7/blob/a243f80a1ca7fe8ceed4deee17f12c1930efe662/src/Query.php#L59-L112 + * with a modification which is described in https://github.com/guzzle/psr7/pull/603 + * + * @param array $params Query string parameters. + * @param int|false $encoding Set to false to not encode, PHP_QUERY_RFC3986 + * to encode using RFC3986, or PHP_QUERY_RFC1738 + * to encode using RFC1738. + */ + public static function buildQuery(array $params, $encoding = PHP_QUERY_RFC3986): string + { + if (!$params) { + return ''; + } + + if ($encoding === false) { + $encoder = function (string $str): string { + return $str; + }; + } elseif ($encoding === PHP_QUERY_RFC3986) { + $encoder = 'rawurlencode'; + } elseif ($encoding === PHP_QUERY_RFC1738) { + $encoder = 'urlencode'; + } else { + throw new \InvalidArgumentException('Invalid type'); + } + + $castBool = Configuration::BOOLEAN_FORMAT_INT == Configuration::getDefaultConfiguration()->getBooleanFormatForQueryString() + ? function ($v) { return (int) $v; } + : function ($v) { return $v ? 'true' : 'false'; }; + + $qs = ''; + foreach ($params as $k => $v) { + $k = $encoder((string) $k); + if (!is_array($v)) { + $qs .= $k; + $v = is_bool($v) ? $castBool($v) : $v; + if ($v !== null) { + $qs .= '='.$encoder((string) $v); + } + $qs .= '&'; + } else { + foreach ($v as $vv) { + $qs .= $k; + $vv = is_bool($vv) ? $castBool($vv) : $vv; + if ($vv !== null) { + $qs .= '='.$encoder((string) $vv); + } + $qs .= '&'; + } + } + } + + return $qs ? (string) substr($qs, 0, -1) : ''; + } +} diff --git a/packages/Types/lib/GoalData.php b/packages/Types/lib/GoalData.php new file mode 100644 index 0000000..2ba6ed1 --- /dev/null +++ b/packages/Types/lib/GoalData.php @@ -0,0 +1,92 @@ +key = $key; + + $this->value = $data['value'] ?? null; + } + + /** + * Get the goal key. + * + * @return string|null + */ + public function getKey(): ?string + { + return $this->key; + } + + /** + * Set the goal key. + * + * @param string|null $key + * @return self + * @throws \InvalidArgumentException If key is not a valid GoalDataKey + */ + public function setKey(?string $key): self + { + if ($key !== null && GoalDataKey::tryFrom($key) === null) { + throw new \InvalidArgumentException("Invalid GoalData key: '$key'. Must be one of: " . implode(', ', array_column(GoalDataKey::cases(), 'value'))); + } + $this->key = $key; + return $this; + } + + /** + * Get the goal value. + * + * @return float|string|null + */ + public function getValue() + { + return $this->value; + } + + /** + * Set the goal value. + * + * @param float|string|null $value + * @return self + */ + public function setValue($value): self + { + $this->value = $value; + return $this; + } +} \ No newline at end of file diff --git a/packages/Types/lib/IdentityField.php b/packages/Types/lib/IdentityField.php new file mode 100644 index 0000000..bf2b716 --- /dev/null +++ b/packages/Types/lib/IdentityField.php @@ -0,0 +1,36 @@ +locationProperties = $data['locationProperties'] ?? null; + + $identityField = $data['identityField'] ?? null; + if ($identityField !== null && !IdentityField::isValid($identityField)) { + throw new \InvalidArgumentException("Invalid identityField: '$identityField'. Must be one of: " . implode(', ', IdentityField::getValues())); + } + $this->identityField = $identityField; + + $this->forceEvent = $data['forceEvent'] ?? null; + } + + /** + * Get the location properties. + * + * @return array|null + */ + public function getLocationProperties(): ?array + { + return $this->locationProperties; + } + + /** + * Set the location properties. + * + * @param array|null $locationProperties + * @return self + */ + public function setLocationProperties(?array $locationProperties): self + { + $this->locationProperties = $locationProperties; + return $this; + } + + /** + * Get the identity field. + * + * @return string|null + */ + public function getIdentityField(): ?string + { + return $this->identityField; + } + + /** + * Set the identity field. + * + * @param string|null $identityField + * @return self + * @throws \InvalidArgumentException If identityField is not a valid IdentityField value + */ + public function setIdentityField(?string $identityField): self + { + if ($identityField !== null && !IdentityField::isValid($identityField)) { + throw new \InvalidArgumentException("Invalid identityField: '$identityField'. Must be one of: " . implode(', ', IdentityField::getValues())); + } + $this->identityField = $identityField; + return $this; + } + + /** + * Get whether to force an event. + * + * @return bool|null + */ + public function getForceEvent(): ?bool + { + return $this->forceEvent; + } + + /** + * Set whether to force an event. + * + * @param bool|null $forceEvent + * @return self + */ + public function setForceEvent(?bool $forceEvent): self + { + $this->forceEvent = $forceEvent; + return $this; + } +} \ No newline at end of file diff --git a/packages/Types/lib/RuleAnd.php b/packages/Types/lib/RuleAnd.php new file mode 100644 index 0000000..96f71ce --- /dev/null +++ b/packages/Types/lib/RuleAnd.php @@ -0,0 +1,78 @@ +and = $and; + } + + /** + * Gets the AND group. + * + * @return RuleOrWhen[] + */ + public function getAnd(): array + { + return $this->and; + } + + /** + * Sets the AND group. + * + * @param RuleOrWhen[] $and Array of RuleOrWhen instances. + * @return self + * @throws \InvalidArgumentException if any element is not an instance of RuleOrWhen. + */ + public function setAnd(array $and): self + { + foreach ($and as $orWhen) { + if (!$orWhen instanceof RuleOrWhen) { + throw new \InvalidArgumentException('Each element in AND must be an instance of RuleOrWhen.'); + } + } + $this->and = $and; + return $this; + } +} \ No newline at end of file diff --git a/packages/Types/lib/RuleOrWhen.php b/packages/Types/lib/RuleOrWhen.php new file mode 100644 index 0000000..a4920f6 --- /dev/null +++ b/packages/Types/lib/RuleOrWhen.php @@ -0,0 +1,84 @@ +orWhen = $orWhen; + } + + /** + * Gets the OR_WHEN rule elements. + * + * @return RuleElement[] + */ + public function getOrWhen(): array + { + return $this->orWhen; + } + + /** + * Sets the OR_WHEN rule elements. + * + * @param RuleElement[] $orWhen Array of RuleElement instances. + * @return self + * @throws \InvalidArgumentException if any element is not an instance of RuleElement. + */ + public function setOrWhen(array $orWhen): self + { + foreach ($orWhen as $element) { + if (!$element instanceof RuleElement) { + throw new \InvalidArgumentException('Each element in OR_WHEN must be an instance of RuleElement.'); + } + } + $this->orWhen = $orWhen; + return $this; + } +} + diff --git a/packages/Types/lib/StoreData.php b/packages/Types/lib/StoreData.php new file mode 100644 index 0000000..6568ed4 --- /dev/null +++ b/packages/Types/lib/StoreData.php @@ -0,0 +1,140 @@ +|null Key-value pairs for bucketing + */ + protected $bucketing; + + /** + * @var string[]|null List of location identifiers + */ + protected $locations; + + /** + * @var VisitorSegments|null Visitor segments data + */ + protected $segments; + + /** + * @var array|null Key-value pairs for goals + */ + protected $goals; + + /** + * Constructor to initialize the object with data. + * + * @param array $data Associative array of property values + */ + public function __construct(array $data = []) + { + $this->bucketing = $data['bucketing'] ?? null; + $this->locations = $data['locations'] ?? null; + $this->segments = isset($data['segments']) && is_array($data['segments']) + ? new VisitorSegments($data['segments']) + : ($data['segments'] ?? null); + $this->goals = $data['goals'] ?? null; + } + + /** + * Get the bucketing data. + * + * @return array|null + */ + public function getBucketing(): ?array + { + return $this->bucketing; + } + + /** + * Set the bucketing data. + * + * @param array|null $bucketing + * @return self + */ + public function setBucketing(?array $bucketing): self + { + $this->bucketing = $bucketing; + return $this; + } + + /** + * Get the locations. + * + * @return string[]|null + */ + public function getLocations(): ?array + { + return $this->locations; + } + + /** + * Set the locations. + * + * @param string[]|null $locations + * @return self + */ + public function setLocations(?array $locations): self + { + $this->locations = $locations; + return $this; + } + + /** + * Get the segments. + * + * @return VisitorSegments|null + */ + public function getSegments(): ?VisitorSegments + { + return $this->segments; + } + + /** + * Set the segments. + * + * @param VisitorSegments|null $segments + * @return self + */ + public function setSegments(?VisitorSegments $segments): self + { + $this->segments = $segments; + return $this; + } + + /** + * Get the goals. + * + * @return array|null + */ + public function getGoals(): ?array + { + return $this->goals; + } + + /** + * Set the goals. + * + * @param array|null $goals + * @return self + */ + public function setGoals(?array $goals): self + { + $this->goals = $goals; + return $this; + } +} \ No newline at end of file diff --git a/packages/Types/lib/VisitorsQueue.php b/packages/Types/lib/VisitorsQueue.php new file mode 100644 index 0000000..1293b42 --- /dev/null +++ b/packages/Types/lib/VisitorsQueue.php @@ -0,0 +1,95 @@ + List of visitor data + */ + private array $items = []; + + /** + * Constructor + */ + public function __construct() + { + $this->length = 0; + $this->items = []; + } + + /** + * Add or update a visitor in the queue. + * + * @param string $visitorId The unique identifier of the visitor + * @param VisitorTrackingEvents $eventRequest The event to associate with the visitor + * @param VisitorSegments|null $segments Optional segments for the visitor + * @return void + */ + public function push(string $visitorId, array $eventRequest, array $segments): void + { + $visitorIndex = -1; + foreach ($this->items as $index => $item) { + if ($item['visitorId'] === $visitorId) { + $visitorIndex = $index; + break; + } + } + + if ($visitorIndex !== -1) { + // Visitor exists, append the event + $this->items[$visitorIndex]['events'][] = $eventRequest; + } else { + // New visitor, create and add to queue + $visitor = [ + 'visitorId' => $visitorId, + 'events' => [$eventRequest] + ]; + if ($segments !== null) { + $visitor['segments'] = $segments; + } + $this->items[] = $visitor; + $this->length++; + } + } + + /** + * Reset the queue, clearing all visitors. + * + * @return void + */ + public function reset(): void + { + $this->items = []; + $this->length = 0; + } + + /** + * Get the list of visitors in the queue. + * + * @return array + */ + public function getItems(): array + { + return $this->items; + } +} \ No newline at end of file diff --git a/packages/Utils/composer.json b/packages/Utils/composer.json new file mode 100644 index 0000000..fe07d48 --- /dev/null +++ b/packages/Utils/composer.json @@ -0,0 +1,44 @@ +{ + "name": "convertcom/php-sdk-utils", + "description": "Convert Insights PHP SDK Utils", + "type": "library", + "license": "Apache-2.0", + "authors": [ + { + "name": "Convert Insights, Inc", + "homepage": "https://www.convert.com" + } + ], + "autoload": { + "psr-4": { + "ConvertSdk\\Utils\\": "src/", + "ConvertSdk\\Tests\\": "tests/" + } + }, + "repositories": { + "Enums": { + "type": "path", + "url": "../Enums" + }, + "Types": { + "type": "path", + "url": "../Types" + } + }, + "require": { + "php": "^8.2", + "convertcom/php-sdk-enums": ">=1.0.0", + "convertcom/php-sdk-types": ">=1.0.0", + "lastguest/murmurhash": "^2.1" + }, + "require-dev": { + "phpunit/phpunit": "^11.0" + }, + "scripts": { + "test": "phpunit" + }, + "minimum-stability": "stable", + "prefer-stable": true, + "version": "1.0.0" + +} diff --git a/packages/Utils/composer.lock b/packages/Utils/composer.lock new file mode 100644 index 0000000..63e580d --- /dev/null +++ b/packages/Utils/composer.lock @@ -0,0 +1,4774 @@ +{ + "_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": "64a462c1caeca1d194a6c0968a5de562", + "packages": [ + { + "name": "convertcom/php-sdk-enums", + "version": "1.0.0", + "dist": { + "type": "path", + "url": "../Enums", + "reference": "7e158fdb7421652c7384f128f0470a3e9b869339" + }, + "require": { + "php": ">=7.2" + }, + "type": "library", + "autoload": { + "psr-4": { + "ConvertSdk\\Enums\\": "src/" + } + }, + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "Convert Insights, Inc" + } + ], + "description": "PHP implementation of Convert JS SDK enums", + "transport-options": { + "relative": true + } + }, + { + "name": "guzzlehttp/guzzle", + "version": "7.9.2", + "source": { + "type": "git", + "url": "https://github.com/guzzle/guzzle.git", + "reference": "d281ed313b989f213357e3be1a179f02196ac99b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/d281ed313b989f213357e3be1a179f02196ac99b", + "reference": "d281ed313b989f213357e3be1a179f02196ac99b", + "shasum": "" + }, + "require": { + "ext-json": "*", + "guzzlehttp/promises": "^1.5.3 || ^2.0.3", + "guzzlehttp/psr7": "^2.7.0", + "php": "^7.2.5 || ^8.0", + "psr/http-client": "^1.0", + "symfony/deprecation-contracts": "^2.2 || ^3.0" + }, + "provide": { + "psr/http-client-implementation": "1.0" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.8.2", + "ext-curl": "*", + "guzzle/client-integration-tests": "3.0.2", + "php-http/message-factory": "^1.1", + "phpunit/phpunit": "^8.5.39 || ^9.6.20", + "psr/log": "^1.1 || ^2.0 || ^3.0" + }, + "suggest": { + "ext-curl": "Required for CURL handler support", + "ext-intl": "Required for Internationalized Domain Name (IDN) support", + "psr/log": "Required for using the Log middleware" + }, + "type": "library", + "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": false + } + }, + "autoload": { + "files": [ + "src/functions_include.php" + ], + "psr-4": { + "GuzzleHttp\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Jeremy Lindblom", + "email": "jeremeamia@gmail.com", + "homepage": "https://github.com/jeremeamia" + }, + { + "name": "George Mponos", + "email": "gmponos@gmail.com", + "homepage": "https://github.com/gmponos" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://github.com/sagikazarmark" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" + } + ], + "description": "Guzzle is a PHP HTTP client library", + "keywords": [ + "client", + "curl", + "framework", + "http", + "http client", + "psr-18", + "psr-7", + "rest", + "web service" + ], + "support": { + "issues": "https://github.com/guzzle/guzzle/issues", + "source": "https://github.com/guzzle/guzzle/tree/7.9.2" + }, + "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": "2024-07-24T11:22:20+00:00" + }, + { + "name": "guzzlehttp/promises", + "version": "2.0.4", + "source": { + "type": "git", + "url": "https://github.com/guzzle/promises.git", + "reference": "f9c436286ab2892c7db7be8c8da4ef61ccf7b455" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/promises/zipball/f9c436286ab2892c7db7be8c8da4ef61ccf7b455", + "reference": "f9c436286ab2892c7db7be8c8da4ef61ccf7b455", + "shasum": "" + }, + "require": { + "php": "^7.2.5 || ^8.0" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.8.2", + "phpunit/phpunit": "^8.5.39 || ^9.6.20" + }, + "type": "library", + "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": false + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Promise\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" + } + ], + "description": "Guzzle promises library", + "keywords": [ + "promise" + ], + "support": { + "issues": "https://github.com/guzzle/promises/issues", + "source": "https://github.com/guzzle/promises/tree/2.0.4" + }, + "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": "2024-10-17T10:06:22+00:00" + }, + { + "name": "guzzlehttp/psr7", + "version": "2.7.0", + "source": { + "type": "git", + "url": "https://github.com/guzzle/psr7.git", + "reference": "a70f5c95fb43bc83f07c9c948baa0dc1829bf201" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/a70f5c95fb43bc83f07c9c948baa0dc1829bf201", + "reference": "a70f5c95fb43bc83f07c9c948baa0dc1829bf201", + "shasum": "" + }, + "require": { + "php": "^7.2.5 || ^8.0", + "psr/http-factory": "^1.0", + "psr/http-message": "^1.1 || ^2.0", + "ralouphie/getallheaders": "^3.0" + }, + "provide": { + "psr/http-factory-implementation": "1.0", + "psr/http-message-implementation": "1.0" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.8.2", + "http-interop/http-factory-tests": "0.9.0", + "phpunit/phpunit": "^8.5.39 || ^9.6.20" + }, + "suggest": { + "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" + }, + "type": "library", + "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": false + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Psr7\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "George Mponos", + "email": "gmponos@gmail.com", + "homepage": "https://github.com/gmponos" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://github.com/sagikazarmark" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://sagikazarmark.hu" + } + ], + "description": "PSR-7 message implementation that also provides common utility methods", + "keywords": [ + "http", + "message", + "psr-7", + "request", + "response", + "stream", + "uri", + "url" + ], + "support": { + "issues": "https://github.com/guzzle/psr7/issues", + "source": "https://github.com/guzzle/psr7/tree/2.7.0" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/psr7", + "type": "tidelift" + } + ], + "time": "2024-07-18T11:15:46+00:00" + }, + { + "name": "lastguest/murmurhash", + "version": "2.1.1", + "source": { + "type": "git", + "url": "https://github.com/lastguest/murmurhash-php.git", + "reference": "0150ba26fb7025d1f936983a167cdc74149f87c8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/lastguest/murmurhash-php/zipball/0150ba26fb7025d1f936983a167cdc74149f87c8", + "reference": "0150ba26fb7025d1f936983a167cdc74149f87c8", + "shasum": "" + }, + "require": { + "php": "^7||^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^0.12", + "phpunit/phpunit": "^7||^9" + }, + "type": "library", + "autoload": { + "psr-4": { + "lastguest\\": "src/lastguest/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Stefano Azzolini", + "email": "lastguest@gmail.com", + "homepage": "https://github.com/lastguest/murmurhash-php" + } + ], + "description": "MurmurHash3 Hash", + "homepage": "https://github.com/lastguest/murmurhash-php", + "keywords": [ + "hash", + "hashing", + "murmur" + ], + "support": { + "issues": "https://github.com/lastguest/murmurhash-php/issues", + "source": "https://github.com/lastguest/murmurhash-php/tree/2.1.1" + }, + "time": "2021-04-13T16:23:45+00:00" + }, + { + "name": "psr/http-client", + "version": "1.0.3", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-client.git", + "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-client/zipball/bb5906edc1c324c9a05aa0873d40117941e5fa90", + "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90", + "shasum": "" + }, + "require": { + "php": "^7.0 || ^8.0", + "psr/http-message": "^1.0 || ^2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Client\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP clients", + "homepage": "https://github.com/php-fig/http-client", + "keywords": [ + "http", + "http-client", + "psr", + "psr-18" + ], + "support": { + "source": "https://github.com/php-fig/http-client" + }, + "time": "2023-09-23T14:17:50+00:00" + }, + { + "name": "psr/http-factory", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-factory.git", + "reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-factory/zipball/2b4765fddfe3b508ac62f829e852b1501d3f6e8a", + "reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a", + "shasum": "" + }, + "require": { + "php": ">=7.1", + "psr/http-message": "^1.0 || ^2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "PSR-17: Common interfaces for PSR-7 HTTP message factories", + "keywords": [ + "factory", + "http", + "message", + "psr", + "psr-17", + "psr-7", + "request", + "response" + ], + "support": { + "source": "https://github.com/php-fig/http-factory" + }, + "time": "2024-04-15T12:06:14+00:00" + }, + { + "name": "psr/http-message", + "version": "2.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-message.git", + "reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/402d35bcb92c70c026d1a6a9883f06b2ead23d71", + "reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP messages", + "homepage": "https://github.com/php-fig/http-message", + "keywords": [ + "http", + "http-message", + "psr", + "psr-7", + "request", + "response" + ], + "support": { + "source": "https://github.com/php-fig/http-message/tree/2.0" + }, + "time": "2023-04-04T09:54:51+00:00" + }, + { + "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/deprecation-contracts", + "version": "v3.5.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/deprecation-contracts.git", + "reference": "74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6", + "reference": "74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, + "branch-alias": { + "dev-main": "3.5-dev" + } + }, + "autoload": { + "files": [ + "function.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "A generic function and convention to trigger deprecation notices", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.5.1" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-09-25T14:20:29+00:00" + } + ], + "packages-dev": [ + { + "name": "clue/ndjson-react", + "version": "v1.3.0", + "source": { + "type": "git", + "url": "https://github.com/clue/reactphp-ndjson.git", + "reference": "392dc165fce93b5bb5c637b67e59619223c931b0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/clue/reactphp-ndjson/zipball/392dc165fce93b5bb5c637b67e59619223c931b0", + "reference": "392dc165fce93b5bb5c637b67e59619223c931b0", + "shasum": "" + }, + "require": { + "php": ">=5.3", + "react/stream": "^1.2" + }, + "require-dev": { + "phpunit/phpunit": "^9.5 || ^5.7 || ^4.8.35", + "react/event-loop": "^1.2" + }, + "type": "library", + "autoload": { + "psr-4": { + "Clue\\React\\NDJson\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering" + } + ], + "description": "Streaming newline-delimited JSON (NDJSON) parser and encoder for ReactPHP.", + "homepage": "https://github.com/clue/reactphp-ndjson", + "keywords": [ + "NDJSON", + "json", + "jsonlines", + "newline", + "reactphp", + "streaming" + ], + "support": { + "issues": "https://github.com/clue/reactphp-ndjson/issues", + "source": "https://github.com/clue/reactphp-ndjson/tree/v1.3.0" + }, + "funding": [ + { + "url": "https://clue.engineering/support", + "type": "custom" + }, + { + "url": "https://github.com/clue", + "type": "github" + } + ], + "time": "2022-12-23T10:58:28+00:00" + }, + { + "name": "composer/pcre", + "version": "3.3.2", + "source": { + "type": "git", + "url": "https://github.com/composer/pcre.git", + "reference": "b2bed4734f0cc156ee1fe9c0da2550420d99a21e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/pcre/zipball/b2bed4734f0cc156ee1fe9c0da2550420d99a21e", + "reference": "b2bed4734f0cc156ee1fe9c0da2550420d99a21e", + "shasum": "" + }, + "require": { + "php": "^7.4 || ^8.0" + }, + "conflict": { + "phpstan/phpstan": "<1.11.10" + }, + "require-dev": { + "phpstan/phpstan": "^1.12 || ^2", + "phpstan/phpstan-strict-rules": "^1 || ^2", + "phpunit/phpunit": "^8 || ^9" + }, + "type": "library", + "extra": { + "phpstan": { + "includes": [ + "extension.neon" + ] + }, + "branch-alias": { + "dev-main": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\Pcre\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + } + ], + "description": "PCRE wrapping library that offers type-safe preg_* replacements.", + "keywords": [ + "PCRE", + "preg", + "regex", + "regular expression" + ], + "support": { + "issues": "https://github.com/composer/pcre/issues", + "source": "https://github.com/composer/pcre/tree/3.3.2" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2024-11-12T16:29:46+00:00" + }, + { + "name": "composer/semver", + "version": "3.4.3", + "source": { + "type": "git", + "url": "https://github.com/composer/semver.git", + "reference": "4313d26ada5e0c4edfbd1dc481a92ff7bff91f12" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/semver/zipball/4313d26ada5e0c4edfbd1dc481a92ff7bff91f12", + "reference": "4313d26ada5e0c4edfbd1dc481a92ff7bff91f12", + "shasum": "" + }, + "require": { + "php": "^5.3.2 || ^7.0 || ^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^1.11", + "symfony/phpunit-bridge": "^3 || ^7" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\Semver\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nils Adermann", + "email": "naderman@naderman.de", + "homepage": "http://www.naderman.de" + }, + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + }, + { + "name": "Rob Bast", + "email": "rob.bast@gmail.com", + "homepage": "http://robbast.nl" + } + ], + "description": "Semver library that offers utilities, version constraint parsing and validation.", + "keywords": [ + "semantic", + "semver", + "validation", + "versioning" + ], + "support": { + "irc": "ircs://irc.libera.chat:6697/composer", + "issues": "https://github.com/composer/semver/issues", + "source": "https://github.com/composer/semver/tree/3.4.3" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2024-09-19T14:15:21+00:00" + }, + { + "name": "composer/xdebug-handler", + "version": "3.0.5", + "source": { + "type": "git", + "url": "https://github.com/composer/xdebug-handler.git", + "reference": "6c1925561632e83d60a44492e0b344cf48ab85ef" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/6c1925561632e83d60a44492e0b344cf48ab85ef", + "reference": "6c1925561632e83d60a44492e0b344cf48ab85ef", + "shasum": "" + }, + "require": { + "composer/pcre": "^1 || ^2 || ^3", + "php": "^7.2.5 || ^8.0", + "psr/log": "^1 || ^2 || ^3" + }, + "require-dev": { + "phpstan/phpstan": "^1.0", + "phpstan/phpstan-strict-rules": "^1.1", + "phpunit/phpunit": "^8.5 || ^9.6 || ^10.5" + }, + "type": "library", + "autoload": { + "psr-4": { + "Composer\\XdebugHandler\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "John Stevenson", + "email": "john-stevenson@blueyonder.co.uk" + } + ], + "description": "Restarts a process without Xdebug.", + "keywords": [ + "Xdebug", + "performance" + ], + "support": { + "irc": "ircs://irc.libera.chat:6697/composer", + "issues": "https://github.com/composer/xdebug-handler/issues", + "source": "https://github.com/composer/xdebug-handler/tree/3.0.5" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2024-05-06T16:37:16+00:00" + }, + { + "name": "evenement/evenement", + "version": "v3.0.2", + "source": { + "type": "git", + "url": "https://github.com/igorw/evenement.git", + "reference": "0a16b0d71ab13284339abb99d9d2bd813640efbc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/igorw/evenement/zipball/0a16b0d71ab13284339abb99d9d2bd813640efbc", + "reference": "0a16b0d71ab13284339abb99d9d2bd813640efbc", + "shasum": "" + }, + "require": { + "php": ">=7.0" + }, + "require-dev": { + "phpunit/phpunit": "^9 || ^6" + }, + "type": "library", + "autoload": { + "psr-4": { + "Evenement\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Igor Wiedler", + "email": "igor@wiedler.ch" + } + ], + "description": "Événement is a very simple event dispatching library for PHP", + "keywords": [ + "event-dispatcher", + "event-emitter" + ], + "support": { + "issues": "https://github.com/igorw/evenement/issues", + "source": "https://github.com/igorw/evenement/tree/v3.0.2" + }, + "time": "2023-08-08T05:53:35+00:00" + }, + { + "name": "fidry/cpu-core-counter", + "version": "1.2.0", + "source": { + "type": "git", + "url": "https://github.com/theofidry/cpu-core-counter.git", + "reference": "8520451a140d3f46ac33042715115e290cf5785f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/theofidry/cpu-core-counter/zipball/8520451a140d3f46ac33042715115e290cf5785f", + "reference": "8520451a140d3f46ac33042715115e290cf5785f", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "require-dev": { + "fidry/makefile": "^0.2.0", + "fidry/php-cs-fixer-config": "^1.1.2", + "phpstan/extension-installer": "^1.2.0", + "phpstan/phpstan": "^1.9.2", + "phpstan/phpstan-deprecation-rules": "^1.0.0", + "phpstan/phpstan-phpunit": "^1.2.2", + "phpstan/phpstan-strict-rules": "^1.4.4", + "phpunit/phpunit": "^8.5.31 || ^9.5.26", + "webmozarts/strict-phpunit": "^7.5" + }, + "type": "library", + "autoload": { + "psr-4": { + "Fidry\\CpuCoreCounter\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Théo FIDRY", + "email": "theo.fidry@gmail.com" + } + ], + "description": "Tiny utility to get the number of CPU cores.", + "keywords": [ + "CPU", + "core" + ], + "support": { + "issues": "https://github.com/theofidry/cpu-core-counter/issues", + "source": "https://github.com/theofidry/cpu-core-counter/tree/1.2.0" + }, + "funding": [ + { + "url": "https://github.com/theofidry", + "type": "github" + } + ], + "time": "2024-08-06T10:04:20+00:00" + }, + { + "name": "friendsofphp/php-cs-fixer", + "version": "v3.70.0", + "source": { + "type": "git", + "url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git", + "reference": "2ecd5aae0edc937f0d5aa4a22d1d705c6b2e084e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/2ecd5aae0edc937f0d5aa4a22d1d705c6b2e084e", + "reference": "2ecd5aae0edc937f0d5aa4a22d1d705c6b2e084e", + "shasum": "" + }, + "require": { + "clue/ndjson-react": "^1.0", + "composer/semver": "^3.4", + "composer/xdebug-handler": "^3.0.3", + "ext-filter": "*", + "ext-json": "*", + "ext-tokenizer": "*", + "fidry/cpu-core-counter": "^1.2", + "php": "^7.4 || ^8.0", + "react/child-process": "^0.6.5", + "react/event-loop": "^1.0", + "react/promise": "^2.0 || ^3.0", + "react/socket": "^1.0", + "react/stream": "^1.0", + "sebastian/diff": "^4.0 || ^5.1 || ^6.0 || ^7.0", + "symfony/console": "^5.4 || ^6.4 || ^7.0", + "symfony/event-dispatcher": "^5.4 || ^6.4 || ^7.0", + "symfony/filesystem": "^5.4 || ^6.4 || ^7.0", + "symfony/finder": "^5.4 || ^6.4 || ^7.0", + "symfony/options-resolver": "^5.4 || ^6.4 || ^7.0", + "symfony/polyfill-mbstring": "^1.31", + "symfony/polyfill-php80": "^1.31", + "symfony/polyfill-php81": "^1.31", + "symfony/process": "^5.4 || ^6.4 || ^7.2", + "symfony/stopwatch": "^5.4 || ^6.4 || ^7.0" + }, + "require-dev": { + "facile-it/paraunit": "^1.3.1 || ^2.5", + "infection/infection": "^0.29.10", + "justinrainbow/json-schema": "^5.3 || ^6.0", + "keradus/cli-executor": "^2.1", + "mikey179/vfsstream": "^1.6.12", + "php-coveralls/php-coveralls": "^2.7", + "php-cs-fixer/accessible-object": "^1.1", + "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.6", + "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.6", + "phpunit/phpunit": "^9.6.22 || ^10.5.45 || ^11.5.7", + "symfony/var-dumper": "^5.4.48 || ^6.4.18 || ^7.2.0", + "symfony/yaml": "^5.4.45 || ^6.4.18 || ^7.2.0" + }, + "suggest": { + "ext-dom": "For handling output formats in XML", + "ext-mbstring": "For handling non-UTF8 characters." + }, + "bin": [ + "php-cs-fixer" + ], + "type": "application", + "autoload": { + "psr-4": { + "PhpCsFixer\\": "src/" + }, + "exclude-from-classmap": [ + "src/Fixer/Internal/*" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Dariusz Rumiński", + "email": "dariusz.ruminski@gmail.com" + } + ], + "description": "A tool to automatically fix PHP code style", + "keywords": [ + "Static code analysis", + "fixer", + "standards", + "static analysis" + ], + "support": { + "issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues", + "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.70.0" + }, + "funding": [ + { + "url": "https://github.com/keradus", + "type": "github" + } + ], + "time": "2025-02-22T23:30:51+00:00" + }, + { + "name": "myclabs/deep-copy", + "version": "1.13.0", + "source": { + "type": "git", + "url": "https://github.com/myclabs/DeepCopy.git", + "reference": "024473a478be9df5fdaca2c793f2232fe788e414" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/024473a478be9df5fdaca2c793f2232fe788e414", + "reference": "024473a478be9df5fdaca2c793f2232fe788e414", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "conflict": { + "doctrine/collections": "<1.6.8", + "doctrine/common": "<2.13.3 || >=3 <3.2.2" + }, + "require-dev": { + "doctrine/collections": "^1.6.8", + "doctrine/common": "^2.13.3 || ^3.2.2", + "phpspec/prophecy": "^1.10", + "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13" + }, + "type": "library", + "autoload": { + "files": [ + "src/DeepCopy/deep_copy.php" + ], + "psr-4": { + "DeepCopy\\": "src/DeepCopy/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Create deep copies (clones) of your objects", + "keywords": [ + "clone", + "copy", + "duplicate", + "object", + "object graph" + ], + "support": { + "issues": "https://github.com/myclabs/DeepCopy/issues", + "source": "https://github.com/myclabs/DeepCopy/tree/1.13.0" + }, + "funding": [ + { + "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", + "type": "tidelift" + } + ], + "time": "2025-02-12T12:17:51+00:00" + }, + { + "name": "nikic/php-parser", + "version": "v5.4.0", + "source": { + "type": "git", + "url": "https://github.com/nikic/PHP-Parser.git", + "reference": "447a020a1f875a434d62f2a401f53b82a396e494" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/447a020a1f875a434d62f2a401f53b82a396e494", + "reference": "447a020a1f875a434d62f2a401f53b82a396e494", + "shasum": "" + }, + "require": { + "ext-ctype": "*", + "ext-json": "*", + "ext-tokenizer": "*", + "php": ">=7.4" + }, + "require-dev": { + "ircmaxell/php-yacc": "^0.0.7", + "phpunit/phpunit": "^9.0" + }, + "bin": [ + "bin/php-parse" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0-dev" + } + }, + "autoload": { + "psr-4": { + "PhpParser\\": "lib/PhpParser" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Nikita Popov" + } + ], + "description": "A PHP parser written in PHP", + "keywords": [ + "parser", + "php" + ], + "support": { + "issues": "https://github.com/nikic/PHP-Parser/issues", + "source": "https://github.com/nikic/PHP-Parser/tree/v5.4.0" + }, + "time": "2024-12-30T11:07:19+00:00" + }, + { + "name": "phar-io/manifest", + "version": "2.0.4", + "source": { + "type": "git", + "url": "https://github.com/phar-io/manifest.git", + "reference": "54750ef60c58e43759730615a392c31c80e23176" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/54750ef60c58e43759730615a392c31c80e23176", + "reference": "54750ef60c58e43759730615a392c31c80e23176", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-libxml": "*", + "ext-phar": "*", + "ext-xmlwriter": "*", + "phar-io/version": "^3.0.1", + "php": "^7.2 || ^8.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", + "support": { + "issues": "https://github.com/phar-io/manifest/issues", + "source": "https://github.com/phar-io/manifest/tree/2.0.4" + }, + "funding": [ + { + "url": "https://github.com/theseer", + "type": "github" + } + ], + "time": "2024-03-03T12:33:53+00:00" + }, + { + "name": "phar-io/version", + "version": "3.2.1", + "source": { + "type": "git", + "url": "https://github.com/phar-io/version.git", + "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/version/zipball/4f7fd7836c6f332bb2933569e566a0d6c4cbed74", + "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Library for handling version information and constraints", + "support": { + "issues": "https://github.com/phar-io/version/issues", + "source": "https://github.com/phar-io/version/tree/3.2.1" + }, + "time": "2022-02-21T01:04:05+00:00" + }, + { + "name": "phpstan/phpstan", + "version": "1.12.19", + "source": { + "type": "git", + "url": "https://github.com/phpstan/phpstan.git", + "reference": "c42ba9bab7a940ed00092ecb1c77bad98896d789" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/c42ba9bab7a940ed00092ecb1c77bad98896d789", + "reference": "c42ba9bab7a940ed00092ecb1c77bad98896d789", + "shasum": "" + }, + "require": { + "php": "^7.2|^8.0" + }, + "conflict": { + "phpstan/phpstan-shim": "*" + }, + "bin": [ + "phpstan", + "phpstan.phar" + ], + "type": "library", + "autoload": { + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "PHPStan - PHP Static Analysis Tool", + "keywords": [ + "dev", + "static analysis" + ], + "support": { + "docs": "https://phpstan.org/user-guide/getting-started", + "forum": "https://github.com/phpstan/phpstan/discussions", + "issues": "https://github.com/phpstan/phpstan/issues", + "security": "https://github.com/phpstan/phpstan/security/policy", + "source": "https://github.com/phpstan/phpstan-src" + }, + "funding": [ + { + "url": "https://github.com/ondrejmirtes", + "type": "github" + }, + { + "url": "https://github.com/phpstan", + "type": "github" + } + ], + "time": "2025-02-19T15:42:21+00:00" + }, + { + "name": "phpunit/php-code-coverage", + "version": "10.1.16", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "7e308268858ed6baedc8704a304727d20bc07c77" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/7e308268858ed6baedc8704a304727d20bc07c77", + "reference": "7e308268858ed6baedc8704a304727d20bc07c77", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-libxml": "*", + "ext-xmlwriter": "*", + "nikic/php-parser": "^4.19.1 || ^5.1.0", + "php": ">=8.1", + "phpunit/php-file-iterator": "^4.1.0", + "phpunit/php-text-template": "^3.0.1", + "sebastian/code-unit-reverse-lookup": "^3.0.0", + "sebastian/complexity": "^3.2.0", + "sebastian/environment": "^6.1.0", + "sebastian/lines-of-code": "^2.0.2", + "sebastian/version": "^4.0.1", + "theseer/tokenizer": "^1.2.3" + }, + "require-dev": { + "phpunit/phpunit": "^10.1" + }, + "suggest": { + "ext-pcov": "PHP extension that provides line coverage", + "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "10.1.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", + "homepage": "https://github.com/sebastianbergmann/php-code-coverage", + "keywords": [ + "coverage", + "testing", + "xunit" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", + "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/10.1.16" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-08-22T04:31:57+00:00" + }, + { + "name": "phpunit/php-file-iterator", + "version": "4.1.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "a95037b6d9e608ba092da1b23931e537cadc3c3c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/a95037b6d9e608ba092da1b23931e537cadc3c3c", + "reference": "a95037b6d9e608ba092da1b23931e537cadc3c3c", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "require-dev": { + "phpunit/phpunit": "^10.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "FilterIterator implementation that filters files based on a list of suffixes.", + "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", + "keywords": [ + "filesystem", + "iterator" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", + "security": "https://github.com/sebastianbergmann/php-file-iterator/security/policy", + "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/4.1.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-08-31T06:24:48+00:00" + }, + { + "name": "phpunit/php-invoker", + "version": "4.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-invoker.git", + "reference": "f5e568ba02fa5ba0ddd0f618391d5a9ea50b06d7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/f5e568ba02fa5ba0ddd0f618391d5a9ea50b06d7", + "reference": "f5e568ba02fa5ba0ddd0f618391d5a9ea50b06d7", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "require-dev": { + "ext-pcntl": "*", + "phpunit/phpunit": "^10.0" + }, + "suggest": { + "ext-pcntl": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Invoke callables with a timeout", + "homepage": "https://github.com/sebastianbergmann/php-invoker/", + "keywords": [ + "process" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-invoker/issues", + "source": "https://github.com/sebastianbergmann/php-invoker/tree/4.0.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T06:56:09+00:00" + }, + { + "name": "phpunit/php-text-template", + "version": "3.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-text-template.git", + "reference": "0c7b06ff49e3d5072f057eb1fa59258bf287a748" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/0c7b06ff49e3d5072f057eb1fa59258bf287a748", + "reference": "0c7b06ff49e3d5072f057eb1fa59258bf287a748", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "require-dev": { + "phpunit/phpunit": "^10.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Simple template engine.", + "homepage": "https://github.com/sebastianbergmann/php-text-template/", + "keywords": [ + "template" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-text-template/issues", + "security": "https://github.com/sebastianbergmann/php-text-template/security/policy", + "source": "https://github.com/sebastianbergmann/php-text-template/tree/3.0.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-08-31T14:07:24+00:00" + }, + { + "name": "phpunit/php-timer", + "version": "6.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "e2a2d67966e740530f4a3343fe2e030ffdc1161d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/e2a2d67966e740530f4a3343fe2e030ffdc1161d", + "reference": "e2a2d67966e740530f4a3343fe2e030ffdc1161d", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "require-dev": { + "phpunit/phpunit": "^10.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "6.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "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/6.0.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T06:57:52+00:00" + }, + { + "name": "phpunit/phpunit", + "version": "10.5.45", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "bd68a781d8e30348bc297449f5234b3458267ae8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/bd68a781d8e30348bc297449f5234b3458267ae8", + "reference": "bd68a781d8e30348bc297449f5234b3458267ae8", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-json": "*", + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-xml": "*", + "ext-xmlwriter": "*", + "myclabs/deep-copy": "^1.12.1", + "phar-io/manifest": "^2.0.4", + "phar-io/version": "^3.2.1", + "php": ">=8.1", + "phpunit/php-code-coverage": "^10.1.16", + "phpunit/php-file-iterator": "^4.1.0", + "phpunit/php-invoker": "^4.0.0", + "phpunit/php-text-template": "^3.0.1", + "phpunit/php-timer": "^6.0.0", + "sebastian/cli-parser": "^2.0.1", + "sebastian/code-unit": "^2.0.0", + "sebastian/comparator": "^5.0.3", + "sebastian/diff": "^5.1.1", + "sebastian/environment": "^6.1.0", + "sebastian/exporter": "^5.1.2", + "sebastian/global-state": "^6.0.2", + "sebastian/object-enumerator": "^5.0.0", + "sebastian/recursion-context": "^5.0.0", + "sebastian/type": "^4.0.0", + "sebastian/version": "^4.0.1" + }, + "suggest": { + "ext-soap": "To be able to generate mocks based on WSDL files" + }, + "bin": [ + "phpunit" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "10.5-dev" + } + }, + "autoload": { + "files": [ + "src/Framework/Assert/Functions.php" + ], + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "The PHP Unit Testing framework.", + "homepage": "https://phpunit.de/", + "keywords": [ + "phpunit", + "testing", + "xunit" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/phpunit/issues", + "security": "https://github.com/sebastianbergmann/phpunit/security/policy", + "source": "https://github.com/sebastianbergmann/phpunit/tree/10.5.45" + }, + "funding": [ + { + "url": "https://phpunit.de/sponsors.html", + "type": "custom" + }, + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpunit/phpunit", + "type": "tidelift" + } + ], + "time": "2025-02-06T16:08:12+00:00" + }, + { + "name": "psr/container", + "version": "2.0.2", + "source": { + "type": "git", + "url": "https://github.com/php-fig/container.git", + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/container/zipball/c71ecc56dfe541dbd90c5360474fbc405f8d5963", + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963", + "shasum": "" + }, + "require": { + "php": ">=7.4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Container\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", + "keywords": [ + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" + ], + "support": { + "issues": "https://github.com/php-fig/container/issues", + "source": "https://github.com/php-fig/container/tree/2.0.2" + }, + "time": "2021-11-05T16:47:00+00:00" + }, + { + "name": "psr/event-dispatcher", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/event-dispatcher.git", + "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/event-dispatcher/zipball/dbefd12671e8a14ec7f180cab83036ed26714bb0", + "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0", + "shasum": "" + }, + "require": { + "php": ">=7.2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\EventDispatcher\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Standard interfaces for event handling.", + "keywords": [ + "events", + "psr", + "psr-14" + ], + "support": { + "issues": "https://github.com/php-fig/event-dispatcher/issues", + "source": "https://github.com/php-fig/event-dispatcher/tree/1.0.0" + }, + "time": "2019-01-08T18:20:26+00:00" + }, + { + "name": "psr/log", + "version": "3.0.2", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/f16e1d5863e37f8d8c2a01719f5b34baa2b714d3", + "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3", + "shasum": "" + }, + "require": { + "php": ">=8.0.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "support": { + "source": "https://github.com/php-fig/log/tree/3.0.2" + }, + "time": "2024-09-11T13:17:53+00:00" + }, + { + "name": "react/cache", + "version": "v1.2.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/cache.git", + "reference": "d47c472b64aa5608225f47965a484b75c7817d5b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/cache/zipball/d47c472b64aa5608225f47965a484b75c7817d5b", + "reference": "d47c472b64aa5608225f47965a484b75c7817d5b", + "shasum": "" + }, + "require": { + "php": ">=5.3.0", + "react/promise": "^3.0 || ^2.0 || ^1.1" + }, + "require-dev": { + "phpunit/phpunit": "^9.5 || ^5.7 || ^4.8.35" + }, + "type": "library", + "autoload": { + "psr-4": { + "React\\Cache\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" + } + ], + "description": "Async, Promise-based cache interface for ReactPHP", + "keywords": [ + "cache", + "caching", + "promise", + "reactphp" + ], + "support": { + "issues": "https://github.com/reactphp/cache/issues", + "source": "https://github.com/reactphp/cache/tree/v1.2.0" + }, + "funding": [ + { + "url": "https://opencollective.com/reactphp", + "type": "open_collective" + } + ], + "time": "2022-11-30T15:59:55+00:00" + }, + { + "name": "react/child-process", + "version": "v0.6.6", + "source": { + "type": "git", + "url": "https://github.com/reactphp/child-process.git", + "reference": "1721e2b93d89b745664353b9cfc8f155ba8a6159" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/child-process/zipball/1721e2b93d89b745664353b9cfc8f155ba8a6159", + "reference": "1721e2b93d89b745664353b9cfc8f155ba8a6159", + "shasum": "" + }, + "require": { + "evenement/evenement": "^3.0 || ^2.0 || ^1.0", + "php": ">=5.3.0", + "react/event-loop": "^1.2", + "react/stream": "^1.4" + }, + "require-dev": { + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36", + "react/socket": "^1.16", + "sebastian/environment": "^5.0 || ^3.0 || ^2.0 || ^1.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "React\\ChildProcess\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" + } + ], + "description": "Event-driven library for executing child processes with ReactPHP.", + "keywords": [ + "event-driven", + "process", + "reactphp" + ], + "support": { + "issues": "https://github.com/reactphp/child-process/issues", + "source": "https://github.com/reactphp/child-process/tree/v0.6.6" + }, + "funding": [ + { + "url": "https://opencollective.com/reactphp", + "type": "open_collective" + } + ], + "time": "2025-01-01T16:37:48+00:00" + }, + { + "name": "react/dns", + "version": "v1.13.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/dns.git", + "reference": "eb8ae001b5a455665c89c1df97f6fb682f8fb0f5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/dns/zipball/eb8ae001b5a455665c89c1df97f6fb682f8fb0f5", + "reference": "eb8ae001b5a455665c89c1df97f6fb682f8fb0f5", + "shasum": "" + }, + "require": { + "php": ">=5.3.0", + "react/cache": "^1.0 || ^0.6 || ^0.5", + "react/event-loop": "^1.2", + "react/promise": "^3.2 || ^2.7 || ^1.2.1" + }, + "require-dev": { + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36", + "react/async": "^4.3 || ^3 || ^2", + "react/promise-timer": "^1.11" + }, + "type": "library", + "autoload": { + "psr-4": { + "React\\Dns\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" + } + ], + "description": "Async DNS resolver for ReactPHP", + "keywords": [ + "async", + "dns", + "dns-resolver", + "reactphp" + ], + "support": { + "issues": "https://github.com/reactphp/dns/issues", + "source": "https://github.com/reactphp/dns/tree/v1.13.0" + }, + "funding": [ + { + "url": "https://opencollective.com/reactphp", + "type": "open_collective" + } + ], + "time": "2024-06-13T14:18:03+00:00" + }, + { + "name": "react/event-loop", + "version": "v1.5.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/event-loop.git", + "reference": "bbe0bd8c51ffc05ee43f1729087ed3bdf7d53354" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/event-loop/zipball/bbe0bd8c51ffc05ee43f1729087ed3bdf7d53354", + "reference": "bbe0bd8c51ffc05ee43f1729087ed3bdf7d53354", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36" + }, + "suggest": { + "ext-pcntl": "For signal handling support when using the StreamSelectLoop" + }, + "type": "library", + "autoload": { + "psr-4": { + "React\\EventLoop\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" + } + ], + "description": "ReactPHP's core reactor event loop that libraries can use for evented I/O.", + "keywords": [ + "asynchronous", + "event-loop" + ], + "support": { + "issues": "https://github.com/reactphp/event-loop/issues", + "source": "https://github.com/reactphp/event-loop/tree/v1.5.0" + }, + "funding": [ + { + "url": "https://opencollective.com/reactphp", + "type": "open_collective" + } + ], + "time": "2023-11-13T13:48:05+00:00" + }, + { + "name": "react/promise", + "version": "v3.2.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/promise.git", + "reference": "8a164643313c71354582dc850b42b33fa12a4b63" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/promise/zipball/8a164643313c71354582dc850b42b33fa12a4b63", + "reference": "8a164643313c71354582dc850b42b33fa12a4b63", + "shasum": "" + }, + "require": { + "php": ">=7.1.0" + }, + "require-dev": { + "phpstan/phpstan": "1.10.39 || 1.4.10", + "phpunit/phpunit": "^9.6 || ^7.5" + }, + "type": "library", + "autoload": { + "files": [ + "src/functions_include.php" + ], + "psr-4": { + "React\\Promise\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" + } + ], + "description": "A lightweight implementation of CommonJS Promises/A for PHP", + "keywords": [ + "promise", + "promises" + ], + "support": { + "issues": "https://github.com/reactphp/promise/issues", + "source": "https://github.com/reactphp/promise/tree/v3.2.0" + }, + "funding": [ + { + "url": "https://opencollective.com/reactphp", + "type": "open_collective" + } + ], + "time": "2024-05-24T10:39:05+00:00" + }, + { + "name": "react/socket", + "version": "v1.16.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/socket.git", + "reference": "23e4ff33ea3e160d2d1f59a0e6050e4b0fb0eac1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/socket/zipball/23e4ff33ea3e160d2d1f59a0e6050e4b0fb0eac1", + "reference": "23e4ff33ea3e160d2d1f59a0e6050e4b0fb0eac1", + "shasum": "" + }, + "require": { + "evenement/evenement": "^3.0 || ^2.0 || ^1.0", + "php": ">=5.3.0", + "react/dns": "^1.13", + "react/event-loop": "^1.2", + "react/promise": "^3.2 || ^2.6 || ^1.2.1", + "react/stream": "^1.4" + }, + "require-dev": { + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36", + "react/async": "^4.3 || ^3.3 || ^2", + "react/promise-stream": "^1.4", + "react/promise-timer": "^1.11" + }, + "type": "library", + "autoload": { + "psr-4": { + "React\\Socket\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" + } + ], + "description": "Async, streaming plaintext TCP/IP and secure TLS socket server and client connections for ReactPHP", + "keywords": [ + "Connection", + "Socket", + "async", + "reactphp", + "stream" + ], + "support": { + "issues": "https://github.com/reactphp/socket/issues", + "source": "https://github.com/reactphp/socket/tree/v1.16.0" + }, + "funding": [ + { + "url": "https://opencollective.com/reactphp", + "type": "open_collective" + } + ], + "time": "2024-07-26T10:38:09+00:00" + }, + { + "name": "react/stream", + "version": "v1.4.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/stream.git", + "reference": "1e5b0acb8fe55143b5b426817155190eb6f5b18d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/stream/zipball/1e5b0acb8fe55143b5b426817155190eb6f5b18d", + "reference": "1e5b0acb8fe55143b5b426817155190eb6f5b18d", + "shasum": "" + }, + "require": { + "evenement/evenement": "^3.0 || ^2.0 || ^1.0", + "php": ">=5.3.8", + "react/event-loop": "^1.2" + }, + "require-dev": { + "clue/stream-filter": "~1.2", + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36" + }, + "type": "library", + "autoload": { + "psr-4": { + "React\\Stream\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" + } + ], + "description": "Event-driven readable and writable streams for non-blocking I/O in ReactPHP", + "keywords": [ + "event-driven", + "io", + "non-blocking", + "pipe", + "reactphp", + "readable", + "stream", + "writable" + ], + "support": { + "issues": "https://github.com/reactphp/stream/issues", + "source": "https://github.com/reactphp/stream/tree/v1.4.0" + }, + "funding": [ + { + "url": "https://opencollective.com/reactphp", + "type": "open_collective" + } + ], + "time": "2024-06-11T12:45:25+00:00" + }, + { + "name": "sebastian/cli-parser", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/cli-parser.git", + "reference": "c34583b87e7b7a8055bf6c450c2c77ce32a24084" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/c34583b87e7b7a8055bf6c450c2c77ce32a24084", + "reference": "c34583b87e7b7a8055bf6c450c2c77ce32a24084", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "require-dev": { + "phpunit/phpunit": "^10.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for parsing CLI options", + "homepage": "https://github.com/sebastianbergmann/cli-parser", + "support": { + "issues": "https://github.com/sebastianbergmann/cli-parser/issues", + "security": "https://github.com/sebastianbergmann/cli-parser/security/policy", + "source": "https://github.com/sebastianbergmann/cli-parser/tree/2.0.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-03-02T07:12:49+00:00" + }, + { + "name": "sebastian/code-unit", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit.git", + "reference": "a81fee9eef0b7a76af11d121767abc44c104e503" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/a81fee9eef0b7a76af11d121767abc44c104e503", + "reference": "a81fee9eef0b7a76af11d121767abc44c104e503", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "require-dev": { + "phpunit/phpunit": "^10.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Collection of value objects that represent the PHP code units", + "homepage": "https://github.com/sebastianbergmann/code-unit", + "support": { + "issues": "https://github.com/sebastianbergmann/code-unit/issues", + "source": "https://github.com/sebastianbergmann/code-unit/tree/2.0.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T06:58:43+00:00" + }, + { + "name": "sebastian/code-unit-reverse-lookup", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", + "reference": "5e3a687f7d8ae33fb362c5c0743794bbb2420a1d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/5e3a687f7d8ae33fb362c5c0743794bbb2420a1d", + "reference": "5e3a687f7d8ae33fb362c5c0743794bbb2420a1d", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "require-dev": { + "phpunit/phpunit": "^10.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "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/3.0.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T06:59:15+00:00" + }, + { + "name": "sebastian/comparator", + "version": "5.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "a18251eb0b7a2dcd2f7aa3d6078b18545ef0558e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/a18251eb0b7a2dcd2f7aa3d6078b18545ef0558e", + "reference": "a18251eb0b7a2dcd2f7aa3d6078b18545ef0558e", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-mbstring": "*", + "php": ">=8.1", + "sebastian/diff": "^5.0", + "sebastian/exporter": "^5.0" + }, + "require-dev": { + "phpunit/phpunit": "^10.5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "5.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + } + ], + "description": "Provides the functionality to compare PHP values for equality", + "homepage": "https://github.com/sebastianbergmann/comparator", + "keywords": [ + "comparator", + "compare", + "equality" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/comparator/issues", + "security": "https://github.com/sebastianbergmann/comparator/security/policy", + "source": "https://github.com/sebastianbergmann/comparator/tree/5.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-10-18T14:56:07+00:00" + }, + { + "name": "sebastian/complexity", + "version": "3.2.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/complexity.git", + "reference": "68ff824baeae169ec9f2137158ee529584553799" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/68ff824baeae169ec9f2137158ee529584553799", + "reference": "68ff824baeae169ec9f2137158ee529584553799", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^4.18 || ^5.0", + "php": ">=8.1" + }, + "require-dev": { + "phpunit/phpunit": "^10.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.2-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for calculating the complexity of PHP code units", + "homepage": "https://github.com/sebastianbergmann/complexity", + "support": { + "issues": "https://github.com/sebastianbergmann/complexity/issues", + "security": "https://github.com/sebastianbergmann/complexity/security/policy", + "source": "https://github.com/sebastianbergmann/complexity/tree/3.2.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-12-21T08:37:17+00:00" + }, + { + "name": "sebastian/diff", + "version": "5.1.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "c41e007b4b62af48218231d6c2275e4c9b975b2e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/c41e007b4b62af48218231d6c2275e4c9b975b2e", + "reference": "c41e007b4b62af48218231d6c2275e4c9b975b2e", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "require-dev": { + "phpunit/phpunit": "^10.0", + "symfony/process": "^6.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "5.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + } + ], + "description": "Diff implementation", + "homepage": "https://github.com/sebastianbergmann/diff", + "keywords": [ + "diff", + "udiff", + "unidiff", + "unified diff" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/diff/issues", + "security": "https://github.com/sebastianbergmann/diff/security/policy", + "source": "https://github.com/sebastianbergmann/diff/tree/5.1.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-03-02T07:15:17+00:00" + }, + { + "name": "sebastian/environment", + "version": "6.1.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "8074dbcd93529b357029f5cc5058fd3e43666984" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/8074dbcd93529b357029f5cc5058fd3e43666984", + "reference": "8074dbcd93529b357029f5cc5058fd3e43666984", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "require-dev": { + "phpunit/phpunit": "^10.0" + }, + "suggest": { + "ext-posix": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "6.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides functionality to handle HHVM/PHP environments", + "homepage": "https://github.com/sebastianbergmann/environment", + "keywords": [ + "Xdebug", + "environment", + "hhvm" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/environment/issues", + "security": "https://github.com/sebastianbergmann/environment/security/policy", + "source": "https://github.com/sebastianbergmann/environment/tree/6.1.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-03-23T08:47:14+00:00" + }, + { + "name": "sebastian/exporter", + "version": "5.1.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "955288482d97c19a372d3f31006ab3f37da47adf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/955288482d97c19a372d3f31006ab3f37da47adf", + "reference": "955288482d97c19a372d3f31006ab3f37da47adf", + "shasum": "" + }, + "require": { + "ext-mbstring": "*", + "php": ">=8.1", + "sebastian/recursion-context": "^5.0" + }, + "require-dev": { + "phpunit/phpunit": "^10.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "5.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Provides the functionality to export PHP variables for visualization", + "homepage": "https://www.github.com/sebastianbergmann/exporter", + "keywords": [ + "export", + "exporter" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/exporter/issues", + "security": "https://github.com/sebastianbergmann/exporter/security/policy", + "source": "https://github.com/sebastianbergmann/exporter/tree/5.1.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-03-02T07:17:12+00:00" + }, + { + "name": "sebastian/global-state", + "version": "6.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/global-state.git", + "reference": "987bafff24ecc4c9ac418cab1145b96dd6e9cbd9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/987bafff24ecc4c9ac418cab1145b96dd6e9cbd9", + "reference": "987bafff24ecc4c9ac418cab1145b96dd6e9cbd9", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "sebastian/object-reflector": "^3.0", + "sebastian/recursion-context": "^5.0" + }, + "require-dev": { + "ext-dom": "*", + "phpunit/phpunit": "^10.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "6.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Snapshotting of global state", + "homepage": "https://www.github.com/sebastianbergmann/global-state", + "keywords": [ + "global state" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/global-state/issues", + "security": "https://github.com/sebastianbergmann/global-state/security/policy", + "source": "https://github.com/sebastianbergmann/global-state/tree/6.0.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-03-02T07:19:19+00:00" + }, + { + "name": "sebastian/lines-of-code", + "version": "2.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/lines-of-code.git", + "reference": "856e7f6a75a84e339195d48c556f23be2ebf75d0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/856e7f6a75a84e339195d48c556f23be2ebf75d0", + "reference": "856e7f6a75a84e339195d48c556f23be2ebf75d0", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^4.18 || ^5.0", + "php": ">=8.1" + }, + "require-dev": { + "phpunit/phpunit": "^10.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for counting the lines of code in PHP source code", + "homepage": "https://github.com/sebastianbergmann/lines-of-code", + "support": { + "issues": "https://github.com/sebastianbergmann/lines-of-code/issues", + "security": "https://github.com/sebastianbergmann/lines-of-code/security/policy", + "source": "https://github.com/sebastianbergmann/lines-of-code/tree/2.0.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-12-21T08:38:20+00:00" + }, + { + "name": "sebastian/object-enumerator", + "version": "5.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-enumerator.git", + "reference": "202d0e344a580d7f7d04b3fafce6933e59dae906" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/202d0e344a580d7f7d04b3fafce6933e59dae906", + "reference": "202d0e344a580d7f7d04b3fafce6933e59dae906", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "sebastian/object-reflector": "^3.0", + "sebastian/recursion-context": "^5.0" + }, + "require-dev": { + "phpunit/phpunit": "^10.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "5.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "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/5.0.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T07:08:32+00:00" + }, + { + "name": "sebastian/object-reflector", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-reflector.git", + "reference": "24ed13d98130f0e7122df55d06c5c4942a577957" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/24ed13d98130f0e7122df55d06c5c4942a577957", + "reference": "24ed13d98130f0e7122df55d06c5c4942a577957", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "require-dev": { + "phpunit/phpunit": "^10.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Allows reflection of object attributes, including inherited and non-public ones", + "homepage": "https://github.com/sebastianbergmann/object-reflector/", + "support": { + "issues": "https://github.com/sebastianbergmann/object-reflector/issues", + "source": "https://github.com/sebastianbergmann/object-reflector/tree/3.0.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T07:06:18+00:00" + }, + { + "name": "sebastian/recursion-context", + "version": "5.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "05909fb5bc7df4c52992396d0116aed689f93712" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/05909fb5bc7df4c52992396d0116aed689f93712", + "reference": "05909fb5bc7df4c52992396d0116aed689f93712", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "require-dev": { + "phpunit/phpunit": "^10.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "5.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + } + ], + "description": "Provides functionality to recursively process PHP variables", + "homepage": "https://github.com/sebastianbergmann/recursion-context", + "support": { + "issues": "https://github.com/sebastianbergmann/recursion-context/issues", + "source": "https://github.com/sebastianbergmann/recursion-context/tree/5.0.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T07:05:40+00:00" + }, + { + "name": "sebastian/type", + "version": "4.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/type.git", + "reference": "462699a16464c3944eefc02ebdd77882bd3925bf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/462699a16464c3944eefc02ebdd77882bd3925bf", + "reference": "462699a16464c3944eefc02ebdd77882bd3925bf", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "require-dev": { + "phpunit/phpunit": "^10.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Collection of value objects that represent the types of the PHP type system", + "homepage": "https://github.com/sebastianbergmann/type", + "support": { + "issues": "https://github.com/sebastianbergmann/type/issues", + "source": "https://github.com/sebastianbergmann/type/tree/4.0.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T07:10:45+00:00" + }, + { + "name": "sebastian/version", + "version": "4.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/version.git", + "reference": "c51fa83a5d8f43f1402e3f32a005e6262244ef17" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c51fa83a5d8f43f1402e3f32a005e6262244ef17", + "reference": "c51fa83a5d8f43f1402e3f32a005e6262244ef17", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library 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/4.0.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-07T11:34:05+00:00" + }, + { + "name": "symfony/console", + "version": "v7.2.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/console.git", + "reference": "fefcc18c0f5d0efe3ab3152f15857298868dc2c3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/console/zipball/fefcc18c0f5d0efe3ab3152f15857298868dc2c3", + "reference": "fefcc18c0f5d0efe3ab3152f15857298868dc2c3", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "symfony/polyfill-mbstring": "~1.0", + "symfony/service-contracts": "^2.5|^3", + "symfony/string": "^6.4|^7.0" + }, + "conflict": { + "symfony/dependency-injection": "<6.4", + "symfony/dotenv": "<6.4", + "symfony/event-dispatcher": "<6.4", + "symfony/lock": "<6.4", + "symfony/process": "<6.4" + }, + "provide": { + "psr/log-implementation": "1.0|2.0|3.0" + }, + "require-dev": { + "psr/log": "^1|^2|^3", + "symfony/config": "^6.4|^7.0", + "symfony/dependency-injection": "^6.4|^7.0", + "symfony/event-dispatcher": "^6.4|^7.0", + "symfony/http-foundation": "^6.4|^7.0", + "symfony/http-kernel": "^6.4|^7.0", + "symfony/lock": "^6.4|^7.0", + "symfony/messenger": "^6.4|^7.0", + "symfony/process": "^6.4|^7.0", + "symfony/stopwatch": "^6.4|^7.0", + "symfony/var-dumper": "^6.4|^7.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Console\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Eases the creation of beautiful and testable command line interfaces", + "homepage": "https://symfony.com", + "keywords": [ + "cli", + "command-line", + "console", + "terminal" + ], + "support": { + "source": "https://github.com/symfony/console/tree/v7.2.1" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-12-11T03:49:26+00:00" + }, + { + "name": "symfony/event-dispatcher", + "version": "v7.2.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/event-dispatcher.git", + "reference": "910c5db85a5356d0fea57680defec4e99eb9c8c1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/910c5db85a5356d0fea57680defec4e99eb9c8c1", + "reference": "910c5db85a5356d0fea57680defec4e99eb9c8c1", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "symfony/event-dispatcher-contracts": "^2.5|^3" + }, + "conflict": { + "symfony/dependency-injection": "<6.4", + "symfony/service-contracts": "<2.5" + }, + "provide": { + "psr/event-dispatcher-implementation": "1.0", + "symfony/event-dispatcher-implementation": "2.0|3.0" + }, + "require-dev": { + "psr/log": "^1|^2|^3", + "symfony/config": "^6.4|^7.0", + "symfony/dependency-injection": "^6.4|^7.0", + "symfony/error-handler": "^6.4|^7.0", + "symfony/expression-language": "^6.4|^7.0", + "symfony/http-foundation": "^6.4|^7.0", + "symfony/service-contracts": "^2.5|^3", + "symfony/stopwatch": "^6.4|^7.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\EventDispatcher\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/event-dispatcher/tree/v7.2.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-09-25T14:21:43+00:00" + }, + { + "name": "symfony/event-dispatcher-contracts", + "version": "v3.5.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/event-dispatcher-contracts.git", + "reference": "7642f5e970b672283b7823222ae8ef8bbc160b9f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/7642f5e970b672283b7823222ae8ef8bbc160b9f", + "reference": "7642f5e970b672283b7823222ae8ef8bbc160b9f", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "psr/event-dispatcher": "^1" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, + "branch-alias": { + "dev-main": "3.5-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\EventDispatcher\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to dispatching event", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "support": { + "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.5.1" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-09-25T14:20:29+00:00" + }, + { + "name": "symfony/filesystem", + "version": "v7.2.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/filesystem.git", + "reference": "b8dce482de9d7c9fe2891155035a7248ab5c7fdb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/b8dce482de9d7c9fe2891155035a7248ab5c7fdb", + "reference": "b8dce482de9d7c9fe2891155035a7248ab5c7fdb", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-mbstring": "~1.8" + }, + "require-dev": { + "symfony/process": "^6.4|^7.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Filesystem\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides basic utilities for the filesystem", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/filesystem/tree/v7.2.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-10-25T15:15:23+00:00" + }, + { + "name": "symfony/finder", + "version": "v7.2.2", + "source": { + "type": "git", + "url": "https://github.com/symfony/finder.git", + "reference": "87a71856f2f56e4100373e92529eed3171695cfb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/finder/zipball/87a71856f2f56e4100373e92529eed3171695cfb", + "reference": "87a71856f2f56e4100373e92529eed3171695cfb", + "shasum": "" + }, + "require": { + "php": ">=8.2" + }, + "require-dev": { + "symfony/filesystem": "^6.4|^7.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Finder\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Finds files and directories via an intuitive fluent interface", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/finder/tree/v7.2.2" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-12-30T19:00:17+00:00" + }, + { + "name": "symfony/options-resolver", + "version": "v7.2.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/options-resolver.git", + "reference": "7da8fbac9dcfef75ffc212235d76b2754ce0cf50" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/7da8fbac9dcfef75ffc212235d76b2754ce0cf50", + "reference": "7da8fbac9dcfef75ffc212235d76b2754ce0cf50", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "symfony/deprecation-contracts": "^2.5|^3" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\OptionsResolver\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides an improved replacement for the array_replace PHP function", + "homepage": "https://symfony.com", + "keywords": [ + "config", + "configuration", + "options" + ], + "support": { + "source": "https://github.com/symfony/options-resolver/tree/v7.2.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-11-20T11:17:29+00:00" + }, + { + "name": "symfony/polyfill-ctype", + "version": "v1.31.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "a3cc8b044a6ea513310cbd48ef7333b384945638" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/a3cc8b044a6ea513310cbd48ef7333b384945638", + "reference": "a3cc8b044a6ea513310cbd48ef7333b384945638", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "provide": { + "ext-ctype": "*" + }, + "suggest": { + "ext-ctype": "For best performance" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], + "support": { + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.31.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-09-09T11:45:10+00:00" + }, + { + "name": "symfony/polyfill-intl-grapheme", + "version": "v1.31.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-grapheme.git", + "reference": "b9123926e3b7bc2f98c02ad54f6a4b02b91a8abe" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/b9123926e3b7bc2f98c02ad54f6a4b02b91a8abe", + "reference": "b9123926e3b7bc2f98c02ad54f6a4b02b91a8abe", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Intl\\Grapheme\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for intl's grapheme_* functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "grapheme", + "intl", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.31.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-09-09T11:45:10+00:00" + }, + { + "name": "symfony/polyfill-intl-normalizer", + "version": "v1.31.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-normalizer.git", + "reference": "3833d7255cc303546435cb650316bff708a1c75c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/3833d7255cc303546435cb650316bff708a1c75c", + "reference": "3833d7255cc303546435cb650316bff708a1c75c", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Intl\\Normalizer\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for intl's Normalizer class and related functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "intl", + "normalizer", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.31.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-09-09T11:45:10+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.31.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/85181ba99b2345b0ef10ce42ecac37612d9fd341", + "reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "provide": { + "ext-mbstring": "*" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.31.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-09-09T11:45:10+00:00" + }, + { + "name": "symfony/polyfill-php80", + "version": "v1.31.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php80.git", + "reference": "60328e362d4c2c802a54fcbf04f9d3fb892b4cf8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/60328e362d4c2c802a54fcbf04f9d3fb892b4cf8", + "reference": "60328e362d4c2c802a54fcbf04f9d3fb892b4cf8", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php80\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ion Bazan", + "email": "ion.bazan@gmail.com" + }, + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php80/tree/v1.31.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-09-09T11:45:10+00:00" + }, + { + "name": "symfony/polyfill-php81", + "version": "v1.31.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php81.git", + "reference": "4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c", + "reference": "4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php81\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.1+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php81/tree/v1.31.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-09-09T11:45:10+00:00" + }, + { + "name": "symfony/process", + "version": "v7.2.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/process.git", + "reference": "d34b22ba9390ec19d2dd966c40aa9e8462f27a7e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/process/zipball/d34b22ba9390ec19d2dd966c40aa9e8462f27a7e", + "reference": "d34b22ba9390ec19d2dd966c40aa9e8462f27a7e", + "shasum": "" + }, + "require": { + "php": ">=8.2" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Process\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Executes commands in sub-processes", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/process/tree/v7.2.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-11-06T14:24:19+00:00" + }, + { + "name": "symfony/service-contracts", + "version": "v3.5.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/service-contracts.git", + "reference": "e53260aabf78fb3d63f8d79d69ece59f80d5eda0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/e53260aabf78fb3d63f8d79d69ece59f80d5eda0", + "reference": "e53260aabf78fb3d63f8d79d69ece59f80d5eda0", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "psr/container": "^1.1|^2.0", + "symfony/deprecation-contracts": "^2.5|^3" + }, + "conflict": { + "ext-psr": "<1.1|>=2" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, + "branch-alias": { + "dev-main": "3.5-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\Service\\": "" + }, + "exclude-from-classmap": [ + "/Test/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to writing services", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "support": { + "source": "https://github.com/symfony/service-contracts/tree/v3.5.1" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-09-25T14:20:29+00:00" + }, + { + "name": "symfony/stopwatch", + "version": "v7.2.2", + "source": { + "type": "git", + "url": "https://github.com/symfony/stopwatch.git", + "reference": "e46690d5b9d7164a6d061cab1e8d46141b9f49df" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/e46690d5b9d7164a6d061cab1e8d46141b9f49df", + "reference": "e46690d5b9d7164a6d061cab1e8d46141b9f49df", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "symfony/service-contracts": "^2.5|^3" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Stopwatch\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides a way to profile code", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/stopwatch/tree/v7.2.2" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-12-18T14:28:33+00:00" + }, + { + "name": "symfony/string", + "version": "v7.2.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/string.git", + "reference": "446e0d146f991dde3e73f45f2c97a9faad773c82" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/string/zipball/446e0d146f991dde3e73f45f2c97a9faad773c82", + "reference": "446e0d146f991dde3e73f45f2c97a9faad773c82", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-intl-grapheme": "~1.0", + "symfony/polyfill-intl-normalizer": "~1.0", + "symfony/polyfill-mbstring": "~1.0" + }, + "conflict": { + "symfony/translation-contracts": "<2.5" + }, + "require-dev": { + "symfony/emoji": "^7.1", + "symfony/error-handler": "^6.4|^7.0", + "symfony/http-client": "^6.4|^7.0", + "symfony/intl": "^6.4|^7.0", + "symfony/translation-contracts": "^2.5|^3.0", + "symfony/var-exporter": "^6.4|^7.0" + }, + "type": "library", + "autoload": { + "files": [ + "Resources/functions.php" + ], + "psr-4": { + "Symfony\\Component\\String\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters in a unified way", + "homepage": "https://symfony.com", + "keywords": [ + "grapheme", + "i18n", + "string", + "unicode", + "utf-8", + "utf8" + ], + "support": { + "source": "https://github.com/symfony/string/tree/v7.2.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-11-13T13:31:26+00:00" + }, + { + "name": "theseer/tokenizer", + "version": "1.2.3", + "source": { + "type": "git", + "url": "https://github.com/theseer/tokenizer.git", + "reference": "737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2", + "reference": "737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": "^7.2 || ^8.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + } + ], + "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", + "support": { + "issues": "https://github.com/theseer/tokenizer/issues", + "source": "https://github.com/theseer/tokenizer/tree/1.2.3" + }, + "funding": [ + { + "url": "https://github.com/theseer", + "type": "github" + } + ], + "time": "2024-03-03T12:36:25+00:00" + } + ], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": {}, + "prefer-stable": true, + "prefer-lowest": false, + "platform": { + "php": ">=7.4" + }, + "platform-dev": {}, + "plugin-api-version": "2.6.0" +} diff --git a/packages/Utils/phpunit.xml b/packages/Utils/phpunit.xml new file mode 100644 index 0000000..055bb18 --- /dev/null +++ b/packages/Utils/phpunit.xml @@ -0,0 +1,22 @@ + + + + + ./tests + + + + + + + + + src + + + diff --git a/packages/Utils/src/ArrayUtils.php b/packages/Utils/src/ArrayUtils.php new file mode 100644 index 0000000..0bc6682 --- /dev/null +++ b/packages/Utils/src/ArrayUtils.php @@ -0,0 +1,19 @@ + 0; + } +} diff --git a/packages/Utils/src/Comparisons.php b/packages/Utils/src/Comparisons.php new file mode 100644 index 0000000..60446bf --- /dev/null +++ b/packages/Utils/src/Comparisons.php @@ -0,0 +1,246 @@ +file = $file; + try { + if (!file_exists($this->file)) { + file_put_contents($this->file, '{}'); + } + } catch (\Exception $e) { + error_log($e->getMessage()); + } + } + + /** + * Get value by key + */ + public function get(string $key): mixed + { + try { + $contents = file_get_contents($this->file); + $data = json_decode($contents, true); + return $data[$key] ?? null; + } catch (\Exception $e) { + error_log($e->getMessage()); + } + return null; + } + + /** + * Store value by key + */ + public function set(string $key, mixed $value): void + { + try { + $contents = file_get_contents($this->file); + $data = json_decode($contents, true); + $data[$key] = $value; + file_put_contents($this->file, json_encode($data)); + } catch (\Exception $e) { + error_log($e->getMessage()); + } + } + + /** + * Delete value by key + */ + public function delete(string $key): void + { + try { + $contents = file_get_contents($this->file); + $data = json_decode($contents, true); + unset($data[$key]); + file_put_contents($this->file, json_encode($data)); + } catch (\Exception $e) { + error_log($e->getMessage()); + } + } +} diff --git a/packages/Utils/src/FileLogger.php b/packages/Utils/src/FileLogger.php new file mode 100644 index 0000000..e6c753f --- /dev/null +++ b/packages/Utils/src/FileLogger.php @@ -0,0 +1,77 @@ +file = $file; + $this->fs = $fs; + $this->appendMethod = $appendMethod; + } + + /** + * Writes output to the file. (For testing, errors are allowed to propagate.) + * + * @param string $method + * @param mixed ...$args + * @return void + */ + private function _write(string $method, mixed ...$args): void + { + $prefix = sprintf('%s [%s]', (new DateTime())->format(DateTime::ATOM), strtoupper($method)); + $output = $prefix . ' ' . implode("\n" . $prefix . ' ', array_map('json_encode', $args)) . "\n"; + if ($this->appendMethod === 'append') { + // This will throw an error if, for example, the file is invalid or not writable. + file_put_contents($this->file, $output, FILE_APPEND); + } else { + if (is_callable([$this->fs, $this->appendMethod])) { + call_user_func([$this->fs, $this->appendMethod], $this->file, $output); + } else { + throw new \Exception('Append method not callable'); + } + } + } + + public function log(mixed ...$args): void + { + $this->_write('log', ...$args); + } + + public function info(mixed ...$args): void + { + $this->_write('info', ...$args); + } + + public function debug(mixed ...$args): void + { + $this->_write('debug', ...$args); + } + + public function warn(mixed ...$args): void + { + $this->_write('warn', ...$args); + } + + public function error(mixed ...$args): void + { + $this->_write('error', ...$args); + } +} diff --git a/packages/Utils/src/LogUtils.php b/packages/Utils/src/LogUtils.php new file mode 100644 index 0000000..506da9d --- /dev/null +++ b/packages/Utils/src/LogUtils.php @@ -0,0 +1,82 @@ + ObjectSerializer::sanitizeForSerialization(), which throws + * InvalidArgumentException for any real-world value outside the narrowed set. LogManager catches + * the throw and substitutes "[log serialization error: …]" for the real payload. + * + * LogUtils::toLoggable() converts any OpenAPI ModelInterface into a plain associative array via + * the model's own ::attributeMap() + ::getters() surface — bypassing ObjectSerializer entirely. + * Recurses into arrays, Traversable and nested models. Scalars and null pass through unchanged. + * + * Note: OpenAPI-generated models are tree-shaped by construction (no cycles in spec schemas), + * so no visited-set guard is required. If a future schema introduces a cycle, wrap $value in + * a SplObjectStorage visited-set before calling this method. + */ +final class LogUtils +{ + public static function toLoggable(mixed $value): mixed + { + if ($value === null || is_scalar($value)) { + return $value; + } + + if ($value instanceof DateTimeInterface) { + return $value->format(DateTimeInterface::ATOM); + } + + if (is_array($value)) { + $out = []; + foreach ($value as $key => $item) { + $out[$key] = self::toLoggable($item); + } + return $out; + } + + if ($value instanceof ModelInterface) { + $out = []; + $getters = $value::getters(); + foreach ($value::attributeMap() as $property => $serializedName) { + $getter = $getters[$property] ?? null; + if ($getter === null || !method_exists($value, $getter)) { + continue; + } + $out[$serializedName] = self::toLoggable($value->$getter()); + } + return $out; + } + + // JsonSerializable intent takes precedence over raw iteration for non-model objects + // that explicitly declare how they want to be serialised. + if ($value instanceof JsonSerializable) { + return self::toLoggable($value->jsonSerialize()); + } + + if ($value instanceof Traversable) { + $out = []; + foreach ($value as $key => $item) { + $out[$key] = self::toLoggable($item); + } + return $out; + } + + if (is_object($value)) { + return self::toLoggable(get_object_vars($value)); + } + + return $value; + } +} diff --git a/packages/Utils/src/ObjectUtils.php b/packages/Utils/src/ObjectUtils.php new file mode 100644 index 0000000..d04d360 --- /dev/null +++ b/packages/Utils/src/ObjectUtils.php @@ -0,0 +1,108 @@ + $oVal) { + $pVal = $result[$key] ?? null; + + if (is_array($pVal) && is_array($oVal)) { + // Check if both are associative arrays + if ($isAssoc($pVal) && $isAssoc($oVal)) { + $result[$key] = self::objectDeepMerge($pVal, $oVal); + } else { + // Merge numeric arrays and deduplicate (mirrors JS SDK's Set behavior) + $result[$key] = array_values(array_unique(array_merge($oVal, $pVal))); + } + } elseif (is_array($oVal)) { + $result[$key] = $oVal; + } else { + $result[$key] = $oVal; + } + } + } + return $result; + } + + + public static function objectNotEmpty(mixed $object): bool + { + if (is_array($object)) { + return !empty($object); + } elseif (is_object($object)) { + return count(get_object_vars($object)) > 0; + } + return false; + } + + public static function objectDeepEqual(mixed $a, mixed $b): bool + { + if ($a === $b) { + return true; + } + if (!is_array($a) || !is_array($b) || $a === null || $b === null) { + return false; + } + $keysA = array_keys($a); + $keysB = array_keys($b); + if (count($keysA) !== count($keysB)) { + return false; + } + foreach ($keysA as $key) { + if (!in_array($key, $keysB, true)) { + return false; + } + if (is_array($a[$key]) || is_array($b[$key])) { + if (!self::objectDeepEqual($a[$key], $b[$key])) { + return false; + } + } elseif (is_callable($a[$key]) || is_callable($b[$key])) { + if ((string)$a[$key] !== (string)$b[$key]) { + return false; + } + } else { + if ($a[$key] !== $b[$key]) { + return false; + } + } + } + return true; + } +} diff --git a/packages/Utils/src/StringUtils.php b/packages/Utils/src/StringUtils.php new file mode 100644 index 0000000..bdaabe7 --- /dev/null +++ b/packages/Utils/src/StringUtils.php @@ -0,0 +1,74 @@ + $seed])); + } + + return Murmur::hash3_int($value, $seed); + } +} diff --git a/packages/Utils/src/TypeUtils.php b/packages/Utils/src/TypeUtils.php new file mode 100644 index 0000000..823b28b --- /dev/null +++ b/packages/Utils/src/TypeUtils.php @@ -0,0 +1,56 @@ +assertTrue($result, 'Expected non-empty array to return true'); + } + + public function testShouldReturnTrueForNotEmptyArrayWithOneItem() + { + $array = [0]; + $result = ArrayUtils::arrayNotEmpty($array); + $this->assertTrue($result, 'Expected array with one item (0) to return true'); + } + + public function testShouldReturnTrueForNotEmptyArrayWithOneBooleanItem() + { + $array = [false]; + $result = ArrayUtils::arrayNotEmpty($array); + $this->assertTrue($result, 'Expected array with one boolean item (false) to return true'); + } + + public function testShouldReturnFalseForEmptyArray() + { + $array = []; + $result = ArrayUtils::arrayNotEmpty($array); + $this->assertFalse($result, 'Expected empty array to return false'); + } + + public function testShouldReturnFalseForNull() + { + $array = null; + $result = ArrayUtils::arrayNotEmpty($array); + $this->assertFalse($result, 'Expected null to return false'); + } + + public function testShouldReturnFalseForDeclaredNotDefinedVariable() + { + // In PHP, an uninitialized variable would cause an error, so we simulate it as null. + $array = null; + $result = ArrayUtils::arrayNotEmpty($array); + $this->assertFalse($result, 'Expected uninitialized (null) variable to return false'); + } + + public function testShouldReturnFalseForObject() + { + // Create an object instead of an array. + $notArray = (object)['key' => 'value']; + $result = ArrayUtils::arrayNotEmpty($notArray); + $this->assertFalse($result, 'Expected object to return false'); + } + + public function testShouldReturnFalseForString() + { + $notArray = 'A string'; + $result = ArrayUtils::arrayNotEmpty($notArray); + $this->assertFalse($result, 'Expected string to return false'); + } + + public function testShouldReturnFalseForInteger() + { + $notArray = 0; + $result = ArrayUtils::arrayNotEmpty($notArray); + $this->assertFalse($result, 'Expected integer to return false'); + } +} diff --git a/packages/Utils/tests/ComparisonsTest.php b/packages/Utils/tests/ComparisonsTest.php new file mode 100644 index 0000000..999ad2d --- /dev/null +++ b/packages/Utils/tests/ComparisonsTest.php @@ -0,0 +1,434 @@ +assertTrue($result); + } + + public function testEqualsReturnsFalseForEqualNumbersWithNegation() + { + $result = Comparisons::equals(123, 123, true); + $this->assertFalse($result); + } + + public function testEqualsReturnsFalseForDifferentNumbers() + { + $result = Comparisons::equals(321, 123); + $this->assertFalse($result); + } + + public function testEqualsReturnsTrueForEqualStrings() + { + $result = Comparisons::equals('value', 'value'); + $this->assertTrue($result); + } + + public function testEqualsReturnsFalseForStringAndNumberMismatch() + { + $result = Comparisons::equals('value', 123); + $this->assertFalse($result); + } + + public function testEqualsReturnsTrueForStringAndNumberMismatchWithNegation() + { + $result = Comparisons::equals('value', 123, true); + $this->assertTrue($result); + } + + // less() tests + public function testLessReturnsTrueForLessNumbers() + { + $result = Comparisons::less(-111, 123); + $this->assertTrue($result); + } + + public function testLessReturnsFalseForLessNumbersWithNegation() + { + $result = Comparisons::less(-111, 123, true); + $this->assertFalse($result); + } + + public function testLessReturnsTrueForEqualNumbersWithNegation() + { + $result = Comparisons::less(123, 123, true); + $this->assertTrue($result); + } + + public function testLessReturnsFalseForInvalidComparison() + { + $result = Comparisons::less(321, -123); + $this->assertFalse($result); + } + + public function testLessReturnsTrueForInvalidComparisonWithNegation() + { + $result = Comparisons::less(321, -123, true); + $this->assertTrue($result); + } + + public function testLessReturnsTrueForStringComparison() + { + $result = Comparisons::less('abcde', 'axyz'); + $this->assertTrue($result); + } + + public function testLessReturnsFalseForReversedStringComparison() + { + $result = Comparisons::less('axyz', 'abcde'); + $this->assertFalse($result); + } + + public function testLessReturnsFalseForMismatchedTypes1() + { + $result = Comparisons::less(4, 'orange'); + $this->assertFalse($result); + } + + public function testLessReturnsFalseForMismatchedTypes2() + { + $result = Comparisons::less('orange', 4); + $this->assertFalse($result); + } + + public function testLessReturnsFalseForMismatchedTypesWithNegation() + { + $result = Comparisons::less('orange', 4, true); + $this->assertFalse($result); + } + + public function testLessReturnsFalseForEqualNumbers() + { + $result = Comparisons::less(4, 4); + $this->assertFalse($result); + } + + // lessEqual() tests + public function testLessEqualReturnsTrueForEqualNumbers() + { + $result = Comparisons::lessEqual(4, 4); + $this->assertTrue($result); + } + + public function testLessEqualReturnsFalseForMismatchedTypes1() + { + $result = Comparisons::lessEqual(4, 'orange'); + $this->assertFalse($result); + } + + public function testLessEqualReturnsFalseForMismatchedTypesWithNegation() + { + $result = Comparisons::lessEqual(4, 'orange', true); + $this->assertFalse($result); + } + + public function testLessEqualReturnsTrueForValidComparison() + { + $result = Comparisons::lessEqual(4, 123); + $this->assertTrue($result); + } + + public function testLessEqualReturnsFalseForInvalidComparison() + { + $result = Comparisons::lessEqual(123, 4); + $this->assertFalse($result); + } + + public function testLessEqualReturnsTrueForInvalidComparisonWithNegation() + { + $result = Comparisons::lessEqual(123, 4, true); + $this->assertTrue($result); + } + + public function testLessEqualReturnsFalseForStringComparison() + { + $result = Comparisons::lessEqual('axyz', 'abcde'); + $this->assertFalse($result); + } + + public function testLessEqualReturnsFalseForEqualNumbersWithNegation() + { + $result = Comparisons::lessEqual(1234, 1234, true); + $this->assertFalse($result); + } + + public function testLessEqualReturnsTrueForValidStringComparison() + { + $result = Comparisons::lessEqual('abcde', 'axyz'); + $this->assertTrue($result); + } + + // contains() tests + public function testContainsReturnsTrueForSubstring() + { + $result = Comparisons::contains('abcde', 'a'); + $this->assertTrue($result); + } + + public function testContainsReturnsTrueForNumberSubstring() + { + $result = Comparisons::contains(12345, 23); + $this->assertTrue($result); + } + + public function testContainsReturnsFalseForReverseNumberSubstring() + { + $result = Comparisons::contains(23, 12345); + $this->assertFalse($result); + } + + public function testContainsReturnsTrueForReverseNumberSubstringWithNegation() + { + $result = Comparisons::contains(23, 12345, true); + $this->assertTrue($result); + } + + public function testContainsReturnsTrueForEmptyTestAgainst() + { + $result = Comparisons::contains('abcde', ''); + $this->assertTrue($result); + } + + // isIn() tests + public function testIsInReturnsTrueForSameNumber() + { + $result = Comparisons::isIn(23, 23); + $this->assertTrue($result); + } + + public function testIsInReturnsTrueForDelimitedString() + { + $result = Comparisons::isIn('a', 'a|b|c|d|e'); + $this->assertTrue($result); + } + + public function testIsInReturnsFalseForDelimitedStringWithNegation() + { + $result = Comparisons::isIn('a', 'a|b|c|d|e', true); + $this->assertFalse($result); + } + + public function testIsInReturnsTrueForDelimitedStringArray() + { + $result = Comparisons::isIn('a|c', 'a|b|c|d|e'); + $this->assertTrue($result); + } + + public function testIsInReturnsFalseForMismatchedArrayAndString() + { + $result = Comparisons::isIn('orange', ['ab', 'cd', 'ef']); + $this->assertFalse($result); + } + + public function testIsInReturnsTrueForNegatedMismatchedArrayAndString() + { + $result = Comparisons::isIn('orange', ['ab', 'cd', 'ef'], true); + $this->assertTrue($result); + } + + public function testIsInReturnsTrueForDelimitedStringAgainstArray() + { + $result = Comparisons::isIn('ab|ef', ['ab', 'cd', 'ef']); + $this->assertTrue($result); + } + + public function testIsInReturnsFalseForEmptyArrayAgainstEmptyString() + { + $result = Comparisons::isIn('', []); + $this->assertFalse($result); + } + + public function testIsInReturnsFalseForCommaSplitterMismatch1() + { + $result = Comparisons::isIn('ab|ef', ['ab', 'cd', 'ef'], false, ','); + $this->assertFalse($result); + } + + public function testIsInReturnsFalseForCommaSplitterMismatch2() + { + $result = Comparisons::isIn('a|c', 'a|b|c|d|e', false, ','); + $this->assertFalse($result); + } + + public function testIsInReturnsTrueForCommaDelimitedComparisonString() + { + $result = Comparisons::isIn('a,c', 'a,b,c,d,e', false, ','); + $this->assertTrue($result); + } + + public function testIsInReturnsTrueForCommaDelimitedComparisonAgainstArray() + { + $result = Comparisons::isIn('ab,ef', ['ab', 'cd', 'ef'], false, ','); + $this->assertTrue($result); + } + + public function testIsInReturnsTrueForNumberInArray() + { + $result = Comparisons::isIn(456, [123, 456, 789]); + $this->assertTrue($result); + } + + public function testIsInReturnsFalseForNumberAgainstObject() + { + // Passing an object should return false. + $result = Comparisons::isIn(456, (object)['foo' => 'bar']); + $this->assertFalse($result); + } + + // startsWith() tests + public function testStartsWithReturnsTrueForNumberPrefix() + { + $result = Comparisons::startsWith(12345678, 12); + $this->assertTrue($result); + } + + public function testStartsWithReturnsTrueForStringPrefix() + { + $result = Comparisons::startsWith('orange is fruit', 'orange'); + $this->assertTrue($result); + } + + public function testStartsWithIsCaseInsensitive() + { + $result = Comparisons::startsWith('oRaNgE is fruit', 'ORANGE'); + $this->assertTrue($result); + } + + public function testStartsWithReturnsFalseForNonMatchingPrefix() + { + $result = Comparisons::startsWith('orange is fruit', 'is'); + $this->assertFalse($result); + } + + public function testStartsWithReturnsTrueForNegatedNonMatchingPrefix() + { + $result = Comparisons::startsWith('orange is fruit', 'is', true); + $this->assertTrue($result); + } + + public function testStartsWithReturnsTrueForEmptyTestAgainst() + { + $result = Comparisons::startsWith('orange is fruit', ''); + $this->assertTrue($result); + } + + // endsWith() tests + public function testEndsWithReturnsFalseForNonMatchingSuffix() + { + $result = Comparisons::endsWith(12345678, 4567); + $this->assertFalse($result); + } + + public function testEndsWithReturnsTrueForNegatedNonMatchingSuffix() + { + $result = Comparisons::endsWith(12345678, 4567, true); + $this->assertTrue($result); + } + + public function testEndsWithReturnsTrueForMatchingSuffix() + { + $result = Comparisons::endsWith(12345678, 45678); + $this->assertTrue($result); + } + + public function testEndsWithReturnsFalseForNegatedMatchingSuffix() + { + $result = Comparisons::endsWith(12345678, 45678, true); + $this->assertFalse($result); + } + + public function testEndsWithReturnsTrueForStringSuffixCaseInsensitive() + { + $result = Comparisons::endsWith('orange is fruit', 'FRUIT'); + $this->assertTrue($result); + } + + public function testEndsWithReturnsFalseForNonMatchingStringSuffix() + { + $result = Comparisons::endsWith('orange is fruit', 'is'); + $this->assertFalse($result); + } + + public function testEndsWithReturnsTrueForEmptyTestAgainstSuffix() + { + $result = Comparisons::endsWith('orange is fruit', ''); + $this->assertTrue($result); + } + + // regexMatches() tests + public function testRegexMatchesReturnsFalseForInvalidRegex() + { + $result = Comparisons::regexMatches('/?wwww', 'orange'); + $this->assertFalse($result); + } + + public function testRegexMatchesReturnsTrueForWordCharacters() + { + $result = Comparisons::regexMatches('orange', '\\w+'); + $this->assertTrue($result); + } + + public function testRegexMatchesReturnsTrueForWordCharactersWithExclamation() + { + $result = Comparisons::regexMatches('An APPle!', '\\w+'); + $this->assertTrue($result); + } + + public function testRegexMatchesReturnsTrueForNumbers() + { + $result = Comparisons::regexMatches(111222333, '\\d+'); + $this->assertTrue($result); + } + + public function testRegexMatchesReturnsFalseForNumbersWithNegation() + { + $result = Comparisons::regexMatches(111222333, '\\d+', true); + $this->assertFalse($result); + } + + public function testRegexMatchesEmailValidation1() + { + $result = Comparisons::regexMatches( + 'test@email.com', + "^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\\.[a-zA-Z0-9-]+)*$" + ); + $this->assertTrue($result); + } + + public function testRegexMatchesEmailValidation2() + { + $result = Comparisons::regexMatches( + 'more.complex.e-mail123@subdomain.email.com', + "^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\\.[a-zA-Z0-9-]+)*$" + ); + $this->assertTrue($result); + } + + public function testRegexMatchesInvalidEmail() + { + $result = Comparisons::regexMatches( + 'Not an email', + "^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\\.[a-zA-Z0-9-]+)*$" + ); + $this->assertFalse($result); + } + + public function testRegexMatchesWrongEmailFormat() + { + $result = Comparisons::regexMatches( + 'wrong()\\Email.co@m', + "^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\\.[a-zA-Z0-9-]+)*$" + ); + $this->assertFalse($result); + } +} diff --git a/packages/Utils/tests/FileLoggerTest.php b/packages/Utils/tests/FileLoggerTest.php new file mode 100644 index 0000000..4c54083 --- /dev/null +++ b/packages/Utils/tests/FileLoggerTest.php @@ -0,0 +1,141 @@ +originalErrorHandler = set_error_handler(function ($errno, $errstr, $errfile, $errline) { + throw new \ErrorException($errstr, 0, $errno, $errfile, $errline); + }); + + // Ensure the test file does not exist before each test. + if (file_exists($this->testFile)) { + unlink($this->testFile); + } + } + + protected function tearDown(): void + { + // Restore the original error handler. + restore_error_handler(); + + // Remove the test file if it exists. + if (file_exists($this->testFile)) { + unlink($this->testFile); + } + } + + public function testShouldReturnAnErrorWithInvalidFile(): void + { + try { + $logger = new FileLogger('', new \stdClass()); + $logger->log('testing invalid file'); + $this->fail('Expected ValueError was not thrown.'); + } catch (\ValueError $e) { + $this->assertStringContainsString('Path cannot be empty', $e->getMessage()); + } + } + + public function testShouldReturnAnErrorWithReadOnlyFile() + { + // Create an empty file and set it to read-only. + file_put_contents($this->testFile, ''); + chmod($this->testFile, 0444); // read-only + $logger = new FileLogger($this->testFile, null); + try { + $logger->log('testing read-only log file'); + $this->fail('Expected error was not thrown.'); + } catch (\ErrorException $e) { + $this->assertStringContainsString('Failed to open stream', $e->getMessage()); + } + } + + public function testShouldLogToFile() + { + $logger = new FileLogger($this->testFile, null); + $output = 'testing log file'; + $logger->log($output); + + // Read the contents of the file. + $logContent = file_get_contents($this->testFile); + + // Our logger prefixes the log with an ISO timestamp and [LOG]. + // We'll check that the log content contains [LOG] and the JSON-encoded message. + $this->assertStringContainsString('[LOG]', $logContent); + $this->assertStringContainsString(json_encode($output), $logContent); + } + + public function testInfoShouldWriteWithInfoPrefix(): void + { + $logger = new FileLogger($this->testFile, null); + $logger->info('info message'); + $logContent = file_get_contents($this->testFile); + $this->assertStringContainsString('[INFO]', $logContent); + $this->assertStringContainsString(json_encode('info message'), $logContent); + } + + public function testDebugShouldWriteWithDebugPrefix(): void + { + $logger = new FileLogger($this->testFile, null); + $logger->debug('debug message'); + $logContent = file_get_contents($this->testFile); + $this->assertStringContainsString('[DEBUG]', $logContent); + $this->assertStringContainsString(json_encode('debug message'), $logContent); + } + + public function testWarnShouldWriteWithWarnPrefix(): void + { + $logger = new FileLogger($this->testFile, null); + $logger->warn('warn message'); + $logContent = file_get_contents($this->testFile); + $this->assertStringContainsString('[WARN]', $logContent); + $this->assertStringContainsString(json_encode('warn message'), $logContent); + } + + public function testErrorShouldWriteWithErrorPrefix(): void + { + $logger = new FileLogger($this->testFile, null); + $logger->error('error message'); + $logContent = file_get_contents($this->testFile); + $this->assertStringContainsString('[ERROR]', $logContent); + $this->assertStringContainsString(json_encode('error message'), $logContent); + } + + public function testCustomAppendMethodShouldCallFsMethod(): void + { + $fs = new class () { + public string $capturedFile = ''; + public string $capturedContent = ''; + public function customAppend(string $file, string $content): void + { + $this->capturedFile = $file; + $this->capturedContent = $content; + } + }; + + $logger = new FileLogger($this->testFile, $fs, 'customAppend'); + $logger->log('custom append test'); + $this->assertSame($this->testFile, $fs->capturedFile); + $this->assertStringContainsString('[LOG]', $fs->capturedContent); + } + + public function testNonCallableAppendMethodShouldThrowException(): void + { + $fs = new \stdClass(); + $logger = new FileLogger($this->testFile, $fs, 'nonExistentMethod'); + $this->expectException(\Exception::class); + $this->expectExceptionMessage('Append method not callable'); + $logger->log('should fail'); + } +} diff --git a/packages/Utils/tests/LogUtilsTest.php b/packages/Utils/tests/LogUtilsTest.php new file mode 100644 index 0000000..38884cd --- /dev/null +++ b/packages/Utils/tests/LogUtilsTest.php @@ -0,0 +1,165 @@ +assertNull(LogUtils::toLoggable(null)); + } + + public function testIntPassesThrough(): void + { + $this->assertSame(42, LogUtils::toLoggable(42)); + } + + public function testFloatPassesThrough(): void + { + $this->assertSame(3.14, LogUtils::toLoggable(3.14)); + } + + public function testStringPassesThrough(): void + { + $this->assertSame('hello', LogUtils::toLoggable('hello')); + } + + public function testBoolPassesThrough(): void + { + $this->assertTrue(LogUtils::toLoggable(true)); + $this->assertFalse(LogUtils::toLoggable(false)); + } + + public function testPlainNestedArrayPassesThrough(): void + { + $input = ['a' => 1, 'b' => ['c' => 'x', 'd' => [2, 3, 4]]]; + $this->assertSame($input, LogUtils::toLoggable($input)); + } + + public function testDateTimeImmutableFormatsAsAtom(): void + { + $dt = new DateTimeImmutable('2026-04-22T10:30:00+00:00'); + $this->assertSame('2026-04-22T10:30:00+00:00', LogUtils::toLoggable($dt)); + } + + public function testDateTimeFormatsAsAtom(): void + { + $dt = new DateTime('2026-04-22T10:30:00+00:00'); + $this->assertSame('2026-04-22T10:30:00+00:00', LogUtils::toLoggable($dt)); + } + + public function testOpenApiModelWithNarrowEnumMismatchDoesNotThrow(): void + { + // This is the entire point of LogUtils: if the OpenAPI ObjectSerializer path were used, + // it would throw InvalidArgumentException for rule_type != 'js_condition'. toLoggable() + // must bypass that via attributeMap() + getters() and surface the real value. + $rule = $this->makeRuleElementWithRuleType('generic_text_key_value'); + + $result = LogUtils::toLoggable($rule); + + $this->assertIsArray($result); + $this->assertArrayHasKey('rule_type', $result); + $this->assertSame('generic_text_key_value', $result['rule_type']); + } + + public function testOpenApiModelValuePreservedAcrossAllProperties(): void + { + $rule = $this->makeRuleElementWithRuleType('generic_text_key_value'); + $rule->offsetSet('value', 'events'); + $rule->offsetSet('key', 'location'); + $rule->offsetSet('matching', ['match_type' => 'matches', 'negated' => false]); + + $result = LogUtils::toLoggable($rule); + + $this->assertSame('generic_text_key_value', $result['rule_type']); + $this->assertSame('events', $result['value']); + $this->assertSame('location', $result['key']); + $this->assertSame(['match_type' => 'matches', 'negated' => false], $result['matching']); + } + + public function testArrayContainingOpenApiModelRecurses(): void + { + $rule = $this->makeRuleElementWithRuleType('generic_text_key_value'); + + $result = LogUtils::toLoggable(['rules' => [$rule]]); + + $this->assertIsArray($result); + $this->assertIsArray($result['rules']); + $this->assertIsArray($result['rules'][0]); + $this->assertSame('generic_text_key_value', $result['rules'][0]['rule_type']); + } + + public function testTraversableIsIterated(): void + { + $iter = new ArrayIterator(['a' => 1, 'b' => 2]); + $this->assertSame(['a' => 1, 'b' => 2], LogUtils::toLoggable($iter)); + } + + public function testTraversableContainingOpenApiModelRecurses(): void + { + $rule = $this->makeRuleElementWithRuleType('generic_text_key_value'); + $iter = new ArrayIterator([$rule]); + + $result = LogUtils::toLoggable($iter); + + $this->assertIsArray($result); + $this->assertIsArray($result[0]); + $this->assertSame('generic_text_key_value', $result[0]['rule_type']); + } + + public function testNonModelJsonSerializableRecursesViaJsonSerialize(): void + { + $obj = new class () implements JsonSerializable { + public function jsonSerialize(): array + { + return ['kind' => 'custom', 'values' => [1, 2, 3]]; + } + }; + + $this->assertSame(['kind' => 'custom', 'values' => [1, 2, 3]], LogUtils::toLoggable($obj)); + } + + public function testPlainObjectConvertsToArray(): void + { + $obj = (object)['alpha' => 'a', 'beta' => 'b']; + $this->assertSame(['alpha' => 'a', 'beta' => 'b'], LogUtils::toLoggable($obj)); + } + + public function testEmptyArrayReturnsEmptyArray(): void + { + $this->assertSame([], LogUtils::toLoggable([])); + } + + public function testJsonEncodeOnToLoggableResultDoesNotTriggerEnumValidation(): void + { + // Regression test mirroring the real bug: json_encode on the untouched model throws; + // json_encode on toLoggable()'s result must succeed. + $rule = $this->makeRuleElementWithRuleType('generic_text_key_value'); + + $encoded = json_encode(LogUtils::toLoggable($rule)); + + $this->assertNotFalse($encoded); + $this->assertStringContainsString('"rule_type":"generic_text_key_value"', (string)$encoded); + } + + /** + * Build a real RuleElement and override its rule_type via offsetSet — same path the + * ObjectSerializer uses when deserialising config responses from the API. + */ + private function makeRuleElementWithRuleType(string $ruleType): RuleElement + { + $rule = new RuleElement(); + $rule->offsetSet('rule_type', $ruleType); + return $rule; + } +} diff --git a/packages/Utils/tests/ObjectUtilsTest.php b/packages/Utils/tests/ObjectUtilsTest.php new file mode 100644 index 0000000..9a976fc --- /dev/null +++ b/packages/Utils/tests/ObjectUtilsTest.php @@ -0,0 +1,251 @@ + [ + 'endpoint' => 'Lorem ipsum dolor sit amet', + ], + ]; + + $res = ObjectUtils::objectDeepValue($obj, 'api.endpoint'); + $this->assertEquals($obj['api']['endpoint'], $res); + } + + public function testObjectDeepValueShouldReturnDefaultWhenPathNotFound() + { + $obj = [ + 'api' => [ + 'endpoint' => 'Lorem ipsum dolor sit amet', + ], + ]; + + $defaultValue = 'default value'; + $res = ObjectUtils::objectDeepValue($obj, 'api.notFound', $defaultValue); + $this->assertEquals($defaultValue, $res); + } + + public function testObjectDeepValueShouldConsiderZeroAsNormalValue() + { + $obj = [ + 'api' => [ + 'maxResults' => 0, + ], + ]; + + $res = ObjectUtils::objectDeepValue($obj, 'api.maxResults', 1, true); + $this->assertEquals($obj['api']['maxResults'], $res); + } + + public function testObjectDeepValueShouldConsiderFalseAsNormalValue() + { + $obj = [ + 'api' => [ + 'hasLimit' => false, + ], + ]; + + $res = ObjectUtils::objectDeepValue($obj, 'api.hasLimit', 0, true); + $this->assertEquals($obj['api']['hasLimit'], $res); + } + + // Test objectDeepMerge method + public function testObjectDeepMergeShouldMergeObjectsAndTheirKeys() + { + $obj1 = [ + 'api' => [ + 'endpoint' => 'Lorem ipsum dolor sit amet', + ], + ]; + $obj2 = [ + 'api' => [ + 'maxResults' => 3, + ], + 'test' => true, + ]; + + $expected = [ + 'api' => [ + 'endpoint' => 'Lorem ipsum dolor sit amet', + 'maxResults' => 3, + ], + 'test' => true, + ]; + + $res = ObjectUtils::objectDeepMerge($obj1, $obj2); + $this->assertEquals($expected, $res); + } + + // Test objectNotEmpty method + public function testObjectNotEmptyShouldReturnTrueForNonEmptyArray() + { + $obj = [ + 'api' => [ + 'endpoint' => 'Lorem ipsum dolor sit amet', + ], + ]; + + $res = ObjectUtils::objectNotEmpty($obj); + $this->assertTrue($res); + } + + public function testObjectNotEmptyShouldReturnFalseForEmptyArray() + { + $obj = []; + + $res = ObjectUtils::objectNotEmpty($obj); + $this->assertFalse($res); + } + + // Test objectDeepEqual method + public function testObjectDeepEqualShouldReturnTrueForEqualObjects() + { + $obj1 = [ + 'api' => [ + 'endpoint' => 'Lorem ipsum dolor sit amet', + ], + ]; + $obj2 = [ + 'api' => [ + 'endpoint' => 'Lorem ipsum dolor sit amet', + ], + ]; + + $res = ObjectUtils::objectDeepEqual($obj1, $obj2); + $this->assertTrue($res); + } + + public function testObjectDeepEqualShouldReturnFalseForDifferentObjects() + { + $obj1 = [ + 'api' => [ + 'endpoint' => 'Lorem ipsum dolor sit amet', + ], + ]; + $obj2 = [ + 'api' => [ + 'endpoint' => 'Different value', + ], + ]; + + $res = ObjectUtils::objectDeepEqual($obj1, $obj2); + $this->assertFalse($res); + } + + public function testObjectDeepEqualShouldReturnFalseForDifferentKeys() + { + $obj1 = [ + 'api' => [ + 'endpoint' => 'Lorem ipsum dolor sit amet', + ], + ]; + $obj2 = [ + 'api' => [ + 'otherKey' => 'Different value', + ], + ]; + + $res = ObjectUtils::objectDeepEqual($obj1, $obj2); + $this->assertFalse($res); + } + + public function testObjectDeepEqualShouldReturnFalseWhenOneIsNull(): void + { + $this->assertFalse(ObjectUtils::objectDeepEqual(null, ['a' => 1])); + $this->assertFalse(ObjectUtils::objectDeepEqual(['a' => 1], null)); + } + + public function testObjectDeepEqualShouldReturnTrueForIdenticalScalars(): void + { + $this->assertTrue(ObjectUtils::objectDeepEqual(42, 42)); + $this->assertTrue(ObjectUtils::objectDeepEqual('hello', 'hello')); + } + + public function testObjectDeepEqualShouldReturnFalseForDifferentSizedArrays(): void + { + $this->assertFalse(ObjectUtils::objectDeepEqual(['a' => 1], ['a' => 1, 'b' => 2])); + } + + public function testObjectDeepMergeShouldHandleNumericArrays(): void + { + $obj1 = ['items' => [1, 2, 3]]; + $obj2 = ['items' => [4, 5]]; + + // Mirrors JS SDK: [...new Set([...oVal, ...pVal])] — new values first, deduplicated + $result = ObjectUtils::objectDeepMerge($obj1, $obj2); + $this->assertSame([4, 5, 1, 2, 3], $result['items']); + } + + public function testObjectDeepMergeShouldDeduplicateNumericArrays(): void + { + $obj1 = ['locations' => ['pricing', 'events']]; + $obj2 = ['locations' => ['pricing', 'stats']]; + + $result = ObjectUtils::objectDeepMerge($obj1, $obj2); + $this->assertSame(['pricing', 'stats', 'events'], $result['locations']); + } + + public function testObjectDeepMergeShouldNotGrowExponentially(): void + { + $data = ['locations' => ['loc-a']]; + + // Simulate repeated merges like putData() does on each runExperience call + for ($i = 0; $i < 20; $i++) { + $data = ObjectUtils::objectDeepMerge($data, ['locations' => ['loc-a']]); + } + + // Without deduplication this would be 2^20 = 1,048,576 entries + $this->assertCount(1, $data['locations']); + $this->assertSame(['loc-a'], $data['locations']); + } + + public function testObjectDeepMergeShouldHandleOverwritingScalarWithArray(): void + { + $obj1 = ['key' => 'scalar']; + $obj2 = ['key' => ['nested' => 'value']]; + + $result = ObjectUtils::objectDeepMerge($obj1, $obj2); + $this->assertSame(['nested' => 'value'], $result['key']); + } + + public function testObjectDeepValueShouldReturnDefaultForEmptyArray(): void + { + $res = ObjectUtils::objectDeepValue([], 'any.path', 'default'); + $this->assertSame('default', $res); + } + + public function testObjectDeepValueShouldReturnDefaultForFalsyValueWithoutTruthy(): void + { + $obj = ['val' => 0]; + $res = ObjectUtils::objectDeepValue($obj, 'val', 'default', false); + $this->assertSame('default', $res); + } + + public function testObjectNotEmptyShouldReturnTrueForNonEmptyObject(): void + { + $obj = new \stdClass(); + $obj->name = 'test'; + $this->assertTrue(ObjectUtils::objectNotEmpty($obj)); + } + + public function testObjectNotEmptyShouldReturnFalseForEmptyObject(): void + { + $obj = new \stdClass(); + $this->assertFalse(ObjectUtils::objectNotEmpty($obj)); + } + + public function testObjectNotEmptyShouldReturnFalseForNonArrayNonObject(): void + { + $this->assertFalse(ObjectUtils::objectNotEmpty('string')); + $this->assertFalse(ObjectUtils::objectNotEmpty(42)); + $this->assertFalse(ObjectUtils::objectNotEmpty(null)); + } +} diff --git a/packages/Utils/tests/StringUtilsTest.php b/packages/Utils/tests/StringUtilsTest.php new file mode 100644 index 0000000..6a95262 --- /dev/null +++ b/packages/Utils/tests/StringUtilsTest.php @@ -0,0 +1,84 @@ +assertEquals($template, $result); + } + + public function testStringFormatWithStringArgument() + { + $template = 'Lorem %s dolor sit amet'; + $result = StringUtils::stringFormat($template, 'ipsum'); + $this->assertEquals('Lorem ipsum dolor sit amet', $result); + } + + public function testStringFormatWithFunctionArgument() + { + $template = 'Lorem %s dolor sit amet'; + $result = StringUtils::stringFormat($template, function () { + return 'ipsum'; + }); + $this->assertEquals('Lorem ipsum dolor sit amet', $result); + } + + public function testStringFormatWithMultipleArguments() + { + $template = 'Lorem %s dolor %s amet'; + $result = StringUtils::stringFormat($template, 'ipsum', 'sit'); + $this->assertEquals('Lorem ipsum dolor sit amet', $result); + } + + public function testStringFormatWithJsonArgument() + { + $template = '%j'; + $result = StringUtils::stringFormat($template, 'Lorem ipsum dolor sit amet'); + $this->assertEquals('"Lorem ipsum dolor sit amet"', $result); + } + + public function testStringFormatWithArrayArgument() + { + $template = 'This is array: %j'; + $result = StringUtils::stringFormat($template, [1, 2, 3]); + $this->assertEquals('This is array: [1,2,3]', $result); + } + + public function testStringFormatWithEscapedPercentSign() + { + $template = 'Lorem %s dolor %%s'; + $result = StringUtils::stringFormat($template, 'ipsum'); + $this->assertEquals('Lorem ipsum dolor %s', $result); + } + + public function testCamelCaseConversion() + { + $input = 'Some text'; + $result = StringUtils::camelCase($input); + $this->assertEquals('someText', $result); + } + + public function testGenerateHashWithDefaultSeed() + { + $value = 'testString'; + $hash = StringUtils::generateHash($value); + + // Assert the hash is an integer (or check with an expected value if needed) + $this->assertIsInt($hash); + } + + public function testGenerateHashWithCustomSeed() + { + $value = 'testValue'; + $seed = 1234; + $result = StringUtils::generateHash($value, $seed); + $this->assertIsInt($result); + } +} diff --git a/packages/Utils/tests/TypeUtilsTest.php b/packages/Utils/tests/TypeUtilsTest.php new file mode 100644 index 0000000..f40b6b0 --- /dev/null +++ b/packages/Utils/tests/TypeUtilsTest.php @@ -0,0 +1,95 @@ +assertTrue(TypeUtils::castType('true', 'boolean')); + } + + public function testCastTypeBooleanWithFalseString(): void + { + $this->assertFalse(TypeUtils::castType('false', 'boolean')); + } + + public function testCastTypeBooleanWithNonBooleanString(): void + { + $this->assertTrue(TypeUtils::castType('yes', 'boolean')); + $this->assertFalse(TypeUtils::castType('', 'boolean')); + $this->assertTrue(TypeUtils::castType(1, 'boolean')); + $this->assertFalse(TypeUtils::castType(0, 'boolean')); + } + + // Float casting + public function testCastTypeFloatWithTrueValue(): void + { + $this->assertSame(1.0, TypeUtils::castType(true, 'float')); + } + + public function testCastTypeFloatWithFalseValue(): void + { + $this->assertSame(0.0, TypeUtils::castType(false, 'float')); + } + + public function testCastTypeFloatWithNumericString(): void + { + $this->assertSame(3.14, TypeUtils::castType('3.14', 'float')); + } + + // Integer casting + public function testCastTypeIntegerWithTrueValue(): void + { + $this->assertSame(1, TypeUtils::castType(true, 'integer')); + } + + public function testCastTypeIntegerWithFalseValue(): void + { + $this->assertSame(0, TypeUtils::castType(false, 'integer')); + } + + public function testCastTypeIntegerWithNumericString(): void + { + $this->assertSame(42, TypeUtils::castType('42', 'integer')); + } + + // JSON casting + public function testCastTypeJsonWithValidJsonString(): void + { + $result = TypeUtils::castType('{"key":"value"}', 'json'); + $this->assertSame(['key' => 'value'], $result); + } + + public function testCastTypeJsonWithInvalidJsonString(): void + { + $result = TypeUtils::castType('{invalid json}', 'json'); + $this->assertSame('{invalid json}', $result); + } + + public function testCastTypeJsonWithArrayValue(): void + { + $input = ['key' => 'value']; + $result = TypeUtils::castType($input, 'json'); + $this->assertSame($input, $result); + } + + // String casting + public function testCastTypeString(): void + { + $this->assertSame('123', TypeUtils::castType(123, 'string')); + } + + // Default (unknown type) + public function testCastTypeUnknownTypeReturnsValueUnchanged(): void + { + $this->assertSame(42, TypeUtils::castType(42, 'unknown')); + $this->assertSame('hello', TypeUtils::castType('hello', 'nonexistent')); + } +} diff --git a/phpstan.neon b/phpstan.neon new file mode 100644 index 0000000..abdae47 --- /dev/null +++ b/phpstan.neon @@ -0,0 +1,122 @@ +parameters: + level: 6 + paths: + - packages/Api/src + - packages/Bucketing/src + - packages/Data/src + - packages/Enums/src + - packages/Event/src + - packages/Experience/src + - packages/Logger/src + - packages/Php-sdk/src + - packages/Rules/src + - packages/Segments/src + - packages/Utils/src + excludePaths: + - packages/Types/lib + scanDirectories: + - packages/Types/lib + reportUnmatchedIgnoredErrors: false + ignoreErrors: + # --------------------------------------------------------------- + # OpenAPI model namespace mismatch + # Types package declares "OpenApi\Client" but autoloader maps "OpenAPI\Client". + # Generated files cannot be modified. + # --------------------------------------------------------------- + - identifier: class.nameCase + + # --------------------------------------------------------------- + # OpenAPI models implement ArrayAccess but PHPStan doesn't track + # dynamic offsets. At runtime, models are often hydrated from raw + # arrays and accessed via bracket notation (JS SDK parity). + # --------------------------------------------------------------- + - identifier: offsetAccess.notFound + - identifier: offsetAssign.dimType + - identifier: isset.offset + - identifier: empty.offset + + # --------------------------------------------------------------- + # PHPDoc type gaps — SDK ported from JS, many array returns lack + # value-type annotations. Fixing incrementally; suppress globally + # until full PHPDoc coverage is achieved. + # --------------------------------------------------------------- + - identifier: missingType.iterableValue + - identifier: missingType.parameter + - identifier: missingType.generics + - identifier: return.phpDocType + - identifier: parameter.phpDocType + - identifier: phpDoc.parseError + + # --------------------------------------------------------------- + # Defensive runtime checks + # PHPStan proves these are redundant at the type level, but they + # exist as runtime safety for data that arrives as untyped arrays + # from the API. Keeping them is intentional (JS SDK parity). + # --------------------------------------------------------------- + - identifier: nullsafe.neverNull + - identifier: function.alreadyNarrowedType + - identifier: function.impossibleType + - identifier: instanceof.alwaysTrue + - identifier: instanceof.alwaysFalse + - identifier: booleanAnd.alwaysFalse + - identifier: booleanAnd.leftAlwaysFalse + - identifier: booleanAnd.leftAlwaysTrue + - identifier: booleanOr.alwaysFalse + - identifier: booleanOr.alwaysTrue + - identifier: identical.alwaysFalse + - identifier: identical.alwaysTrue + - identifier: notIdentical.alwaysFalse + - identifier: ternary.alwaysTrue + - identifier: if.alwaysTrue + - identifier: greater.alwaysTrue + - identifier: empty.variable + + # --------------------------------------------------------------- + # Properties / dead code + # Some properties are stored for future use or API compatibility. + # Some code paths are unreachable per PHPStan but kept for safety. + # --------------------------------------------------------------- + - identifier: property.onlyWritten + - identifier: property.unusedType + - identifier: property.nonObject + - identifier: deadCode.unreachable + - identifier: nullCoalesce.offset + - identifier: nullCoalesce.expr + - identifier: nullCoalesce.variable + - identifier: foreach.nonIterable + - identifier: foreach.emptyArray + - identifier: return.unusedType + - identifier: method.unused + + # --------------------------------------------------------------- + # Scoped suppressions for known legacy issues + # These identifiers catch real bugs, so they are path-restricted + # rather than globally suppressed. + # --------------------------------------------------------------- + + # RuleAnd/RuleOrWhen constructors expect typed params but receive + # ArrayAccess objects; get_class_methods called on array (custom interface) + - + identifier: argument.type + paths: + - packages/Rules/src/RuleManager.php + - packages/Php-sdk/src/Context.php + - packages/Data/src/DataManager.php + + # PHPDoc references StoreData, GoalData, Entity from Types namespace + # that resolve under the wrong case (OpenApi vs OpenAPI) + - + identifier: class.notFound + paths: + - packages/Data/src/DataManager.php + - packages/Data/src/Interfaces/DataManagerInterface.php + + # DataManager._mapper() — closure stored as property, invoked as method + - + identifier: method.notFound + path: packages/Data/src/DataManager.php + + # FeatureManager.runFeatureById return type shape mismatch + - + identifier: return.type + path: packages/Php-sdk/src/FeatureManager.php diff --git a/phpunit.xml b/phpunit.xml new file mode 100644 index 0000000..60c54be --- /dev/null +++ b/phpunit.xml @@ -0,0 +1,31 @@ + + + + + packages/*/tests + + + tests/CrossSdk + + + tests/Integration + + + + + packages/*/src + + + packages/Segments/src + + packages/Types + + + diff --git a/release.config.mjs b/release.config.mjs new file mode 100644 index 0000000..9cf3c16 --- /dev/null +++ b/release.config.mjs @@ -0,0 +1,51 @@ +export default { + branches: ['main'], + tagFormat: 'v${version}', + plugins: [ + // 1. Custom commit analyzer with rollover logic (replaces @semantic-release/commit-analyzer) + './scripts/rollover-version-plugin.mjs', + + // 2. Generate release notes — only feat/fix/refactor visible + [ + '@semantic-release/release-notes-generator', + { + preset: 'conventionalcommits', + presetConfig: { + types: [ + { type: 'feat', section: 'Features' }, + { type: 'fix', section: 'Bug Fixes' }, + { type: 'refactor', section: 'Refactoring' }, + { type: 'chore', hidden: true }, + { type: 'docs', hidden: true }, + { type: 'ci', hidden: true }, + { type: 'test', hidden: true }, + { type: 'style', hidden: true }, + { type: 'perf', hidden: true }, + ], + }, + }, + ], + + // 3. Write CHANGELOG.md + '@semantic-release/changelog', + + // 4. Sync all 12 package versions via monorepo-builder + [ + '@semantic-release/exec', + { + prepareCmd: + 'composer exec monorepo-builder bump-interdependency "^${nextRelease.version}" && composer exec monorepo-builder release "${nextRelease.version}"', + }, + ], + + // 5. Commit CHANGELOG + bumped composer.json files, create tag + [ + '@semantic-release/git', + { + assets: ['CHANGELOG.md', 'packages/*/composer.json', 'composer.json'], + message: + 'chore(release): v${nextRelease.version} [skip ci]\n\n${nextRelease.notes}', + }, + ], + ], +}; diff --git a/scripts/rollover-version-plugin.mjs b/scripts/rollover-version-plugin.mjs new file mode 100644 index 0000000..cfca0b6 --- /dev/null +++ b/scripts/rollover-version-plugin.mjs @@ -0,0 +1,95 @@ +import { CommitParser } from 'conventional-commits-parser'; + +const parser = new CommitParser(); + +/** + * Custom semantic-release analyzeCommits plugin. + * + * Determines the logical release type from conventional commits, then + * translates it into the semver bump that respects the digit-capped + * rollover scheme (each position capped at 9). + * + * Commit mapping: + * fix: / feat: → logical patch + * refactor: → logical minor + * BREAKING CHANGE → logical major (direct, no rollover) + * everything else → no release + * + * Rollover rules (patch and minor only): + * logical patch: patch<9 → patch | minor<9 → minor | else → major + * logical minor: minor<9 → minor | else → major + * logical major: always → major (standard semver) + */ + +function getLogicalType(commits) { + let hasMajor = false; + let hasMinor = false; + let hasPatch = false; + + for (const commit of commits) { + const parsed = parser.parse(commit.message); + if (!parsed) continue; + + const type = parsed.type; + const hasBreaking = + parsed.notes?.some((note) => note.title === 'BREAKING CHANGE') ?? false; + + if (hasBreaking) { + hasMajor = true; + } else if (type === 'refactor') { + hasMinor = true; + } else if (type === 'feat' || type === 'fix') { + hasPatch = true; + } + } + + if (hasMajor) return 'major'; + if (hasMinor) return 'minor'; + if (hasPatch) return 'patch'; + return null; +} + +function getEffectiveReleaseType(logicalType, lastVersion) { + const parts = lastVersion.replace(/^v/, '').split('.'); + const minor = parseInt(parts[1], 10) || 0; + const patch = parseInt(parts[2], 10) || 0; + + if (logicalType === 'patch') { + if (patch < 9) return 'patch'; + if (minor < 9) return 'minor'; + return 'major'; + } + + if (logicalType === 'minor') { + if (minor < 9) return 'minor'; + return 'major'; + } + + if (logicalType === 'major') { + return 'major'; + } + + return null; +} + +export async function analyzeCommits(pluginConfig, context) { + const { commits, lastRelease, logger } = context; + + const logicalType = getLogicalType(commits); + if (!logicalType) { + logger.log('No releasable commits found.'); + return null; + } + + const lastVersion = lastRelease?.version || '1.0.0'; + const effectiveType = getEffectiveReleaseType(logicalType, lastVersion); + + logger.log( + 'Rollover analysis: logical=%s, lastVersion=%s, effective=%s', + logicalType, + lastVersion, + effectiveType, + ); + + return effectiveType; +} diff --git a/tests/CrossSdk/BucketingConsistencyTest.php b/tests/CrossSdk/BucketingConsistencyTest.php new file mode 100644 index 0000000..4db7174 --- /dev/null +++ b/tests/CrossSdk/BucketingConsistencyTest.php @@ -0,0 +1,152 @@ + [$vector['input'], $vector['seed'], $vector['expected']]; + } + } + + #[DataProvider('vectorProvider')] + public function testStringUtilsHashMatchesVector(string $input, int $seed, int $expected): void + { + $this->assertSame( + $expected, + StringUtils::generateHash($input, $seed), + "Hash mismatch for input=\"$input\" seed=$seed" + ); + } + + public static function bucketingPipelineProvider(): iterable + { + $path = __DIR__ . '/test-vectors.json'; + $vectors = json_decode(file_get_contents($path), true); + + // Use a subset of vectors for full pipeline testing: + // pick vectors with default seed (9999) which is what bucketing uses + foreach ($vectors as $vector) { + if ($vector['seed'] !== 9999) { + continue; + } + $label = sprintf('%s: "%s"', $vector['category'], mb_substr($vector['input'], 0, 30)); + yield $label => [$vector['input'], $vector['expected']]; + } + } + + #[DataProvider('bucketingPipelineProvider')] + public function testBucketingPipelineNormalization(string $input, int $expectedHash): void + { + $manager = new BucketingManager(); + + // The full pipeline: hash → normalize to [0, maxTraffic) + // Formula: intval((hash / MAX_HASH) * maxTraffic) + $expectedNormalized = intval(($expectedHash / self::MAX_HASH) * self::DEFAULT_MAX_TRAFFIC); + + // Use input as both experienceId+visitorId concatenated + // getValueVisitorBased concatenates experienceId + visitorId, so we pass + // empty experienceId and input as visitorId to get hash of just input + $actualNormalized = $manager->getValueVisitorBased($input, [ + 'experienceId' => '', + 'seed' => 9999, + ]); + + $this->assertSame( + $expectedNormalized, + $actualNormalized, + "Normalized value mismatch for input=\"$input\"" + ); + } + + public function testFullBucketingPipelineWithKnownInputs(): void + { + $manager = new BucketingManager(); + + // Known input from Dev Notes: + // visitorId="visitor-456", experienceId="100234567", seed=9999 + // Step 1: concatenate → "100234567visitor-456" + // Step 2: hash = StringUtils::generateHash("100234567visitor-456", 9999) + $hash = StringUtils::generateHash('100234567visitor-456', 9999); + $expectedNormalized = intval(($hash / self::MAX_HASH) * self::DEFAULT_MAX_TRAFFIC); + + $actualNormalized = $manager->getValueVisitorBased('visitor-456', [ + 'experienceId' => '100234567', + 'seed' => 9999, + ]); + + $this->assertSame($expectedNormalized, $actualNormalized); + + // Step 4: selectBucket maps normalized value to variation + $buckets = [ + 'var-A' => 50, + 'var-B' => 50, + ]; + + $result = $manager->getBucketForVisitor($buckets, 'visitor-456', [ + 'experienceId' => '100234567', + ]); + + $this->assertNotNull($result); + $this->assertArrayHasKey('variationId', $result); + $this->assertArrayHasKey('bucketingAllocation', $result); + $this->assertSame($actualNormalized, $result['bucketingAllocation']); + } + + public function testBucketingDeterminismAcrossInstances(): void + { + // Create two separate BucketingManager instances + $manager1 = new BucketingManager(); + $manager2 = new BucketingManager(); + + $buckets = [ + 'variation-1' => 33, + 'variation-2' => 33, + 'variation-3' => 34, + ]; + + // Same inputs must produce same results across instances + for ($i = 0; $i < 100; $i++) { + $visitorId = "visitor-$i"; + $result1 = $manager1->getBucketForVisitor($buckets, $visitorId, ['experienceId' => 'exp-1']); + $result2 = $manager2->getBucketForVisitor($buckets, $visitorId, ['experienceId' => 'exp-1']); + + $this->assertSame($result1, $result2, "Mismatch for $visitorId across instances"); + } + } +} diff --git a/tests/CrossSdk/HashParityTest.php b/tests/CrossSdk/HashParityTest.php new file mode 100644 index 0000000..e4a358a --- /dev/null +++ b/tests/CrossSdk/HashParityTest.php @@ -0,0 +1,125 @@ + $vector) { + $label = sprintf( + '%s: "%s" seed=%d', + $vector['category'], + mb_substr($vector['input'], 0, 30), + $vector['seed'] + ); + yield $label => [$vector['input'], $vector['seed'], $vector['expected']]; + } + } + + #[DataProvider('vectorProvider')] + public function testLastguestMurmurMatchesJsSdk(string $input, int $seed, int $expected): void + { + $actual = Murmur::hash3_int($input, $seed); + + $this->assertSame( + $expected, + $actual, + sprintf( + 'Murmur::hash3_int("%s", %d) returned %d, expected %d (JS SDK)', + mb_substr($input, 0, 30), + $seed, + $actual, + $expected + ) + ); + } + + #[DataProvider('vectorProvider')] + public function testStringUtilsGenerateHashMatchesJsSdk(string $input, int $seed, int $expected): void + { + $actual = StringUtils::generateHash($input, $seed); + + $this->assertSame( + $expected, + $actual, + sprintf( + 'StringUtils::generateHash("%s", %d) returned %d, expected %d (JS SDK)', + mb_substr($input, 0, 30), + $seed, + $actual, + $expected + ) + ); + } + + #[DataProvider('vectorProvider')] + public function testNativePhpMurmur3aMatchesJsSdk(string $input, int $seed, int $expected): void + { + if (!in_array('murmur3a', hash_algos(), true)) { + $this->markTestSkipped('Native murmur3a hash algorithm not available'); + } + + // StringUtils::generateHash() uses native PHP as the primary path, + // so this MUST be a hard assertion — not informational. + $actual = (int) hexdec(hash('murmur3a', $input, false, ['seed' => $seed])); + + $this->assertSame( + $expected, + $actual, + sprintf( + 'Native hash("murmur3a", "%s", seed=%d) returned %d, expected %d (JS SDK)', + mb_substr($input, 0, 30), + $seed, + $actual, + $expected + ) + ); + } + + public function testAllVectorsPresent(): void + { + $this->assertNotEmpty(self::$vectors, 'Test vectors file is empty'); + + $categories = array_unique(array_column(self::$vectors, 'category')); + $requiredCategories = ['ascii', 'unicode', 'empty', 'numeric', 'long']; + + foreach ($requiredCategories as $category) { + $this->assertContains( + $category, + $categories, + "Missing required category: $category" + ); + } + } + + public function testVectorCountMinimum(): void + { + // 15 inputs x 5 seeds = 75 vectors minimum + $this->assertGreaterThanOrEqual(75, count(self::$vectors)); + } +} diff --git a/tests/CrossSdk/RuleParityTest.php b/tests/CrossSdk/RuleParityTest.php new file mode 100644 index 0000000..50353fb --- /dev/null +++ b/tests/CrossSdk/RuleParityTest.php @@ -0,0 +1,154 @@ + $case) { + $label = sprintf( + '%s: %s (#%d)', + $group['method'], + $case['note'], + $i + ); + yield $label => [ + $group['method'], + $case['value'], + $case['testAgainst'], + $case['negation'], + $case['expected'], + ]; + } + } + } + + #[DataProvider('comparisonVectorProvider')] + public function testComparisonOperatorParity( + string $method, + mixed $value, + mixed $testAgainst, + bool $negation, + bool $expected + ): void { + $result = Comparisons::$method($value, $testAgainst, $negation); + $this->assertSame( + $expected, + $result, + sprintf( + 'Comparisons::%s(%s, %s, %s) returned %s, expected %s', + $method, + var_export($value, true), + var_export($testAgainst, true), + $negation ? 'true' : 'false', + var_export($result, true), + var_export($expected, true) + ) + ); + } + + // ---- Rule evaluation parity tests ---- + + public static function ruleVectorProvider(): iterable + { + $path = __DIR__ . '/rule-test-vectors.json'; + $vectors = json_decode(file_get_contents($path), true); + + foreach ($vectors['rule_evaluation'] as $i => $vector) { + $label = sprintf('%s: %s', $vector['category'], $vector['description']); + yield $label => [ + $vector['data'], + $vector['ruleSet'], + $vector['expected'], + $vector['keysCaseSensitive'] ?? true, + ]; + } + } + + #[DataProvider('ruleVectorProvider')] + public function testRuleEvaluationMatchesExpected( + array $data, + array $ruleSet, + bool $expected, + bool $keysCaseSensitive = true + ): void { + $ruleManager = new RuleManager(keysCaseSensitive: $keysCaseSensitive); + $result = $ruleManager->isRuleMatched($data, new RuleObject($ruleSet)); + $this->assertSame( + $expected, + $result, + sprintf( + 'Rule evaluation for "%s" data returned %s, expected %s', + json_encode($data), + var_export($result, true), + var_export($expected, true) + ) + ); + } + + // ---- Structural tests ---- + + public function testAllComparisonCategoriesPresent(): void + { + $categories = array_column(self::$vectors['comparison_operators'], 'category'); + $required = ['equals', 'equalsNumber', 'matches', 'less', 'lessEqual', 'contains', 'isIn', 'startsWith', 'endsWith', 'regexMatches']; + + foreach ($required as $category) { + $this->assertContains($category, $categories, "Missing comparison category: $category"); + } + } + + public function testAllRuleEvaluationCategoriesPresent(): void + { + $categories = array_column(self::$vectors['rule_evaluation'], 'category'); + $required = ['equals_operator', 'regex_operator', 'and_group_partial', 'or_group_single_match', 'negation_operator', 'missing_key']; + + foreach ($required as $category) { + $this->assertContains($category, $categories, "Missing rule evaluation category: $category"); + } + } + + public function testComparisonVectorMinimumCount(): void + { + $totalCases = 0; + foreach (self::$vectors['comparison_operators'] as $group) { + $totalCases += count($group['cases']); + } + // At least 3 cases per operator * 10 operators = 30 minimum + $this->assertGreaterThanOrEqual(30, $totalCases); + } + + public function testRuleEvaluationVectorMinimumCount(): void + { + $this->assertGreaterThanOrEqual(10, count(self::$vectors['rule_evaluation'])); + } +} diff --git a/tests/CrossSdk/phpunit.xml b/tests/CrossSdk/phpunit.xml new file mode 100644 index 0000000..4284579 --- /dev/null +++ b/tests/CrossSdk/phpunit.xml @@ -0,0 +1,13 @@ + + + + + . + + + diff --git a/tests/CrossSdk/rule-test-vectors.json b/tests/CrossSdk/rule-test-vectors.json new file mode 100644 index 0000000..8f5a8f1 --- /dev/null +++ b/tests/CrossSdk/rule-test-vectors.json @@ -0,0 +1,529 @@ +{ + "comparison_operators": [ + { + "category": "equals", + "method": "equals", + "cases": [ + { "value": "US", "testAgainst": "US", "negation": false, "expected": true, "note": "exact match" }, + { "value": "US", "testAgainst": "us", "negation": false, "expected": true, "note": "case-insensitive" }, + { "value": "us", "testAgainst": "US", "negation": false, "expected": true, "note": "case-insensitive reverse" }, + { "value": "US", "testAgainst": "GB", "negation": false, "expected": false, "note": "no match" }, + { "value": "US", "testAgainst": "US", "negation": true, "expected": false, "note": "negated match" }, + { "value": "US", "testAgainst": "GB", "negation": true, "expected": true, "note": "negated no-match" }, + { "value": "", "testAgainst": "", "negation": false, "expected": true, "note": "empty strings" }, + { "value": "123", "testAgainst": "123", "negation": false, "expected": true, "note": "numeric strings" }, + { "value": ["a", "b", "c"], "testAgainst": "b", "negation": false, "expected": true, "note": "array indexOf match" }, + { "value": ["a", "b", "c"], "testAgainst": "d", "negation": false, "expected": false, "note": "array indexOf no match" }, + { "value": ["a", "b", "c"], "testAgainst": "d", "negation": true, "expected": true, "note": "array indexOf negated no-match" } + ] + }, + { + "category": "equalsNumber", + "method": "equalsNumber", + "cases": [ + { "value": 42, "testAgainst": 42, "negation": false, "expected": true, "note": "equal integers" }, + { "value": 42, "testAgainst": 99, "negation": false, "expected": false, "note": "different integers" }, + { "value": 42, "testAgainst": 42, "negation": true, "expected": false, "note": "negated equal" } + ] + }, + { + "category": "matches", + "method": "matches", + "cases": [ + { "value": "hello", "testAgainst": "HELLO", "negation": false, "expected": true, "note": "case-insensitive match" }, + { "value": "hello", "testAgainst": "world", "negation": false, "expected": false, "note": "no match" } + ] + }, + { + "category": "less", + "method": "less", + "cases": [ + { "value": 5, "testAgainst": 10, "negation": false, "expected": true, "note": "int less than" }, + { "value": 10, "testAgainst": 5, "negation": false, "expected": false, "note": "int not less than" }, + { "value": 5, "testAgainst": 5, "negation": false, "expected": false, "note": "equal not less" }, + { "value": -10, "testAgainst": 0, "negation": false, "expected": true, "note": "negative less than zero" }, + { "value": 5, "testAgainst": 10, "negation": true, "expected": false, "note": "negated less" }, + { "value": 10, "testAgainst": 5, "negation": true, "expected": true, "note": "negated not-less" }, + { "value": "abc", "testAgainst": "xyz", "negation": false, "expected": true, "note": "string less than" }, + { "value": "xyz", "testAgainst": "abc", "negation": false, "expected": false, "note": "string not less than" }, + { "value": 5, "testAgainst": 10.5, "negation": false, "expected": true, "note": "int vs float parity (JS SDK normalizes both to number)" }, + { "value": "5", "testAgainst": 10, "negation": false, "expected": true, "note": "numeric string vs int parity" } + ] + }, + { + "category": "lessEqual", + "method": "lessEqual", + "cases": [ + { "value": 5, "testAgainst": 10, "negation": false, "expected": true, "note": "less than" }, + { "value": 5, "testAgainst": 5, "negation": false, "expected": true, "note": "equal" }, + { "value": 10, "testAgainst": 5, "negation": false, "expected": false, "note": "greater than" }, + { "value": 5, "testAgainst": 5, "negation": true, "expected": false, "note": "negated equal" }, + { "value": 10, "testAgainst": 5, "negation": true, "expected": true, "note": "negated greater" }, + { "value": 5, "testAgainst": 5.0, "negation": false, "expected": true, "note": "int vs float equal parity" } + ] + }, + { + "category": "contains", + "method": "contains", + "cases": [ + { "value": "hello world", "testAgainst": "world", "negation": false, "expected": true, "note": "substring found" }, + { "value": "hello world", "testAgainst": "WORLD", "negation": false, "expected": true, "note": "case-insensitive" }, + { "value": "hello world", "testAgainst": "xyz", "negation": false, "expected": false, "note": "not found" }, + { "value": "hello world", "testAgainst": "", "negation": false, "expected": true, "note": "empty always matches" }, + { "value": "hello world", "testAgainst": " ", "negation": false, "expected": true, "note": "whitespace always matches" }, + { "value": "hello world", "testAgainst": "world", "negation": true, "expected": false, "note": "negated found" }, + { "value": "hello world", "testAgainst": "xyz", "negation": true, "expected": true, "note": "negated not-found" } + ] + }, + { + "category": "isIn", + "method": "isIn", + "cases": [ + { "value": "a", "testAgainst": "a|b|c", "negation": false, "expected": true, "note": "single value in set" }, + { "value": "d", "testAgainst": "a|b|c", "negation": false, "expected": false, "note": "value not in set" }, + { "value": "a|c", "testAgainst": "a|b|c|d|e", "negation": false, "expected": true, "note": "multiple values in set" }, + { "value": "A", "testAgainst": "a|b|c", "negation": false, "expected": true, "note": "case-insensitive" }, + { "value": "a", "testAgainst": "a|b|c", "negation": true, "expected": false, "note": "negated in-set" }, + { "value": "d", "testAgainst": "a|b|c", "negation": true, "expected": true, "note": "negated not-in-set" }, + { "value": "phone", "testAgainst": "phone|tablet", "negation": false, "expected": true, "note": "device matching" } + ] + }, + { + "category": "startsWith", + "method": "startsWith", + "cases": [ + { "value": "hello world", "testAgainst": "hello", "negation": false, "expected": true, "note": "prefix match" }, + { "value": "hello world", "testAgainst": "HELLO", "negation": false, "expected": true, "note": "case-insensitive" }, + { "value": "hello world", "testAgainst": "world", "negation": false, "expected": false, "note": "not a prefix" }, + { "value": "hello world", "testAgainst": "", "negation": false, "expected": true, "note": "empty prefix" }, + { "value": "hello world", "testAgainst": "hello", "negation": true, "expected": false, "note": "negated prefix match" }, + { "value": "hello world", "testAgainst": "world", "negation": true, "expected": true, "note": "negated non-prefix" } + ] + }, + { + "category": "endsWith", + "method": "endsWith", + "cases": [ + { "value": "hello world", "testAgainst": "world", "negation": false, "expected": true, "note": "suffix match" }, + { "value": "hello world", "testAgainst": "WORLD", "negation": false, "expected": true, "note": "case-insensitive" }, + { "value": "hello world", "testAgainst": "hello", "negation": false, "expected": false, "note": "not a suffix" }, + { "value": "hello world", "testAgainst": "", "negation": false, "expected": true, "note": "empty suffix" }, + { "value": "hello world", "testAgainst": "world", "negation": true, "expected": false, "note": "negated suffix match" }, + { "value": "hello world", "testAgainst": "hello", "negation": true, "expected": true, "note": "negated non-suffix" } + ] + }, + { + "category": "regexMatches", + "method": "regexMatches", + "cases": [ + { "value": "user-42", "testAgainst": "^user-[0-9]+$", "negation": false, "expected": true, "note": "regex match" }, + { "value": "admin-42", "testAgainst": "^user-[0-9]+$", "negation": false, "expected": false, "note": "regex no match" }, + { "value": "test@email.com", "testAgainst": "^[a-zA-Z0-9.]+@[a-zA-Z0-9-]+\\.[a-zA-Z]+$", "negation": false, "expected": true, "note": "email regex" }, + { "value": "orange", "testAgainst": "\\w+", "negation": false, "expected": true, "note": "word characters" }, + { "value": "111222", "testAgainst": "\\d+", "negation": false, "expected": true, "note": "digits" }, + { "value": "111222", "testAgainst": "\\d+", "negation": true, "expected": false, "note": "negated digits" }, + { "value": "USER-42", "testAgainst": "^user-[0-9]+$", "negation": false, "expected": true, "note": "case-insensitive regex" } + ] + } + ], + "rule_evaluation": [ + { + "category": "equals_operator", + "description": "AC #1: equals operator with country US", + "data": { "country": "US" }, + "ruleSet": { + "OR": [ + { + "AND": [ + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { "match_type": "equals", "negated": false }, + "value": "US", + "key": "country" + } + ] + } + ] + } + ] + }, + "expected": true + }, + { + "category": "regex_operator", + "description": "AC #2: regex operator matching user-42", + "data": { "username": "user-42" }, + "ruleSet": { + "OR": [ + { + "AND": [ + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { "match_type": "regexMatches", "negated": false }, + "value": "^user-[0-9]+$", + "key": "username" + } + ] + } + ] + } + ] + }, + "expected": true + }, + { + "category": "and_group_partial", + "description": "AC #3: AND group with 3 rules, only 2 match", + "data": { "country": "US", "browser": "chrome", "device": "mobile" }, + "ruleSet": { + "OR": [ + { + "AND": [ + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { "match_type": "equals", "negated": false }, + "value": "US", + "key": "country" + } + ] + }, + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { "match_type": "equals", "negated": false }, + "value": "chrome", + "key": "browser" + } + ] + }, + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { "match_type": "equals", "negated": false }, + "value": "desktop", + "key": "device" + } + ] + } + ] + } + ] + }, + "expected": false + }, + { + "category": "and_group_all_match", + "description": "AND group with 3 rules, all match", + "data": { "country": "US", "browser": "chrome", "device": "desktop" }, + "ruleSet": { + "OR": [ + { + "AND": [ + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { "match_type": "equals", "negated": false }, + "value": "US", + "key": "country" + } + ] + }, + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { "match_type": "equals", "negated": false }, + "value": "chrome", + "key": "browser" + } + ] + }, + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { "match_type": "equals", "negated": false }, + "value": "desktop", + "key": "device" + } + ] + } + ] + } + ] + }, + "expected": true + }, + { + "category": "or_group_single_match", + "description": "AC #4: OR group with 3 rules, only 1 matches", + "data": { "country": "US" }, + "ruleSet": { + "OR": [ + { + "AND": [ + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { "match_type": "equals", "negated": false }, + "value": "GB", + "key": "country" + } + ] + } + ] + }, + { + "AND": [ + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { "match_type": "equals", "negated": false }, + "value": "US", + "key": "country" + } + ] + } + ] + }, + { + "AND": [ + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { "match_type": "equals", "negated": false }, + "value": "DE", + "key": "country" + } + ] + } + ] + } + ] + }, + "expected": true + }, + { + "category": "or_group_none_match", + "description": "OR group with 3 rules, none match", + "data": { "country": "FR" }, + "ruleSet": { + "OR": [ + { + "AND": [ + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { "match_type": "equals", "negated": false }, + "value": "GB", + "key": "country" + } + ] + } + ] + }, + { + "AND": [ + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { "match_type": "equals", "negated": false }, + "value": "US", + "key": "country" + } + ] + } + ] + }, + { + "AND": [ + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { "match_type": "equals", "negated": false }, + "value": "DE", + "key": "country" + } + ] + } + ] + } + ] + }, + "expected": false + }, + { + "category": "negation_operator", + "description": "Negated equals operator", + "data": { "country": "US" }, + "ruleSet": { + "OR": [ + { + "AND": [ + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { "match_type": "equals", "negated": true }, + "value": "GB", + "key": "country" + } + ] + } + ] + } + ] + }, + "expected": true + }, + { + "category": "missing_key", + "description": "AC #8: Key not in data returns false (no match)", + "data": { "browser": "chrome" }, + "ruleSet": { + "OR": [ + { + "AND": [ + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { "match_type": "equals", "negated": false }, + "value": "US", + "key": "country" + } + ] + } + ] + } + ] + }, + "expected": false + }, + { + "category": "case_insensitive_keys", + "description": "Case-insensitive key matching", + "data": { "COUNTRY": "US" }, + "keysCaseSensitive": false, + "ruleSet": { + "OR": [ + { + "AND": [ + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { "match_type": "equals", "negated": false }, + "value": "US", + "key": "country" + } + ] + } + ] + } + ] + }, + "expected": true + }, + { + "category": "or_when_first_match", + "description": "OR_WHEN returns on first match", + "data": { "device": "phone" }, + "ruleSet": { + "OR": [ + { + "AND": [ + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { "match_type": "equals", "negated": false }, + "value": "phone", + "key": "device" + }, + { + "rule_type": "generic_key_value", + "matching": { "match_type": "equals", "negated": false }, + "value": "tablet", + "key": "device" + } + ] + } + ] + } + ] + }, + "expected": true + }, + { + "category": "nested_hierarchy", + "description": "Full OR → AND → OR_WHEN hierarchy", + "data": { "device": "tablet", "browser": "safari", "age": 31 }, + "ruleSet": { + "OR": [ + { + "AND": [ + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { "match_type": "isIn", "negated": false }, + "value": "phone|tablet", + "key": "device" + } + ] + }, + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { "match_type": "equals", "negated": false }, + "value": "safari", + "key": "browser" + } + ] + } + ] + }, + { + "AND": [ + { + "OR_WHEN": [ + { + "rule_type": "generic_key_value", + "matching": { "match_type": "less", "negated": true }, + "value": 30, + "key": "age" + } + ] + } + ] + } + ] + }, + "expected": true + }, + { + "category": "empty_ruleset", + "description": "Empty data and empty rule set", + "data": {}, + "ruleSet": {}, + "expected": false + } + ] +} diff --git a/tests/CrossSdk/test-vectors.json b/tests/CrossSdk/test-vectors.json new file mode 100644 index 0000000..4c43e3f --- /dev/null +++ b/tests/CrossSdk/test-vectors.json @@ -0,0 +1,452 @@ +[ + { + "category": "ascii", + "input": "testString", + "seed": 9999, + "expected": 2241850228 + }, + { + "category": "ascii", + "input": "testString", + "seed": 0, + "expected": 2859361711 + }, + { + "category": "ascii", + "input": "testString", + "seed": 1, + "expected": 3650062624 + }, + { + "category": "ascii", + "input": "testString", + "seed": 42, + "expected": 1122469937 + }, + { + "category": "ascii", + "input": "testString", + "seed": 2147483647, + "expected": 2715170286 + }, + { + "category": "ascii", + "input": "hello", + "seed": 9999, + "expected": 198804431 + }, + { + "category": "ascii", + "input": "hello", + "seed": 0, + "expected": 613153351 + }, + { + "category": "ascii", + "input": "hello", + "seed": 1, + "expected": 3142237357 + }, + { + "category": "ascii", + "input": "hello", + "seed": 42, + "expected": 3806057185 + }, + { + "category": "ascii", + "input": "hello", + "seed": 2147483647, + "expected": 2932207495 + }, + { + "category": "ascii", + "input": "visitor-123", + "seed": 9999, + "expected": 1130634450 + }, + { + "category": "ascii", + "input": "visitor-123", + "seed": 0, + "expected": 2147676167 + }, + { + "category": "ascii", + "input": "visitor-123", + "seed": 1, + "expected": 2265131852 + }, + { + "category": "ascii", + "input": "visitor-123", + "seed": 42, + "expected": 3924851732 + }, + { + "category": "ascii", + "input": "visitor-123", + "seed": 2147483647, + "expected": 1043475628 + }, + { + "category": "ascii", + "input": "01ABCD", + "seed": 9999, + "expected": 2347149437 + }, + { + "category": "ascii", + "input": "01ABCD", + "seed": 0, + "expected": 849284242 + }, + { + "category": "ascii", + "input": "01ABCD", + "seed": 1, + "expected": 1421184423 + }, + { + "category": "ascii", + "input": "01ABCD", + "seed": 42, + "expected": 1595999719 + }, + { + "category": "ascii", + "input": "01ABCD", + "seed": 2147483647, + "expected": 3737462854 + }, + { + "category": "ascii", + "input": "exp100234567visitor-456", + "seed": 9999, + "expected": 389144390 + }, + { + "category": "ascii", + "input": "exp100234567visitor-456", + "seed": 0, + "expected": 251686026 + }, + { + "category": "ascii", + "input": "exp100234567visitor-456", + "seed": 1, + "expected": 903160116 + }, + { + "category": "ascii", + "input": "exp100234567visitor-456", + "seed": 42, + "expected": 728223044 + }, + { + "category": "ascii", + "input": "exp100234567visitor-456", + "seed": 2147483647, + "expected": 2674321400 + }, + { + "category": "unicode", + "input": "こんにちは", + "seed": 9999, + "expected": 383202654 + }, + { + "category": "unicode", + "input": "こんにちは", + "seed": 0, + "expected": 757219804 + }, + { + "category": "unicode", + "input": "こんにちは", + "seed": 1, + "expected": 3536108979 + }, + { + "category": "unicode", + "input": "こんにちは", + "seed": 42, + "expected": 1571673518 + }, + { + "category": "unicode", + "input": "こんにちは", + "seed": 2147483647, + "expected": 2164962015 + }, + { + "category": "unicode", + "input": "über", + "seed": 9999, + "expected": 3630651915 + }, + { + "category": "unicode", + "input": "über", + "seed": 0, + "expected": 2684790572 + }, + { + "category": "unicode", + "input": "über", + "seed": 1, + "expected": 86538514 + }, + { + "category": "unicode", + "input": "über", + "seed": 42, + "expected": 3585450250 + }, + { + "category": "unicode", + "input": "über", + "seed": 2147483647, + "expected": 401251216 + }, + { + "category": "unicode", + "input": "café", + "seed": 9999, + "expected": 3512853862 + }, + { + "category": "unicode", + "input": "café", + "seed": 0, + "expected": 605818632 + }, + { + "category": "unicode", + "input": "café", + "seed": 1, + "expected": 3339761266 + }, + { + "category": "unicode", + "input": "café", + "seed": 42, + "expected": 1312538061 + }, + { + "category": "unicode", + "input": "café", + "seed": 2147483647, + "expected": 3122006092 + }, + { + "category": "unicode", + "input": "emoji🎉test", + "seed": 9999, + "expected": 3359303706 + }, + { + "category": "unicode", + "input": "emoji🎉test", + "seed": 0, + "expected": 1901250822 + }, + { + "category": "unicode", + "input": "emoji🎉test", + "seed": 1, + "expected": 281452684 + }, + { + "category": "unicode", + "input": "emoji🎉test", + "seed": 42, + "expected": 1478545735 + }, + { + "category": "unicode", + "input": "emoji🎉test", + "seed": 2147483647, + "expected": 2585104342 + }, + { + "category": "empty", + "input": "", + "seed": 9999, + "expected": 3523940263 + }, + { + "category": "empty", + "input": "", + "seed": 0, + "expected": 0 + }, + { + "category": "empty", + "input": "", + "seed": 1, + "expected": 1364076727 + }, + { + "category": "empty", + "input": "", + "seed": 42, + "expected": 142593372 + }, + { + "category": "empty", + "input": "", + "seed": 2147483647, + "expected": 4190899880 + }, + { + "category": "numeric", + "input": "12345", + "seed": 9999, + "expected": 495772237 + }, + { + "category": "numeric", + "input": "12345", + "seed": 0, + "expected": 329585043 + }, + { + "category": "numeric", + "input": "12345", + "seed": 1, + "expected": 1377935000 + }, + { + "category": "numeric", + "input": "12345", + "seed": 42, + "expected": 762312584 + }, + { + "category": "numeric", + "input": "12345", + "seed": 2147483647, + "expected": 2156089812 + }, + { + "category": "numeric", + "input": "0", + "seed": 9999, + "expected": 935988371 + }, + { + "category": "numeric", + "input": "0", + "seed": 0, + "expected": 3530670207 + }, + { + "category": "numeric", + "input": "0", + "seed": 1, + "expected": 2992457707 + }, + { + "category": "numeric", + "input": "0", + "seed": 42, + "expected": 3495505081 + }, + { + "category": "numeric", + "input": "0", + "seed": 2147483647, + "expected": 1636712044 + }, + { + "category": "numeric", + "input": "999999999", + "seed": 9999, + "expected": 776928737 + }, + { + "category": "numeric", + "input": "999999999", + "seed": 0, + "expected": 1409968506 + }, + { + "category": "numeric", + "input": "999999999", + "seed": 1, + "expected": 88589017 + }, + { + "category": "numeric", + "input": "999999999", + "seed": 42, + "expected": 3748054925 + }, + { + "category": "numeric", + "input": "999999999", + "seed": 2147483647, + "expected": 2028654253 + }, + { + "category": "long", + "input": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "seed": 9999, + "expected": 3355690396 + }, + { + "category": "long", + "input": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "seed": 0, + "expected": 1589327108 + }, + { + "category": "long", + "input": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "seed": 1, + "expected": 2657342247 + }, + { + "category": "long", + "input": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "seed": 42, + "expected": 3438819463 + }, + { + "category": "long", + "input": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "seed": 2147483647, + "expected": 1662756128 + }, + { + "category": "long", + "input": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb", + "seed": 9999, + "expected": 3766794393 + }, + { + "category": "long", + "input": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb", + "seed": 0, + "expected": 167809087 + }, + { + "category": "long", + "input": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb", + "seed": 1, + "expected": 1226858266 + }, + { + "category": "long", + "input": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb", + "seed": 42, + "expected": 2011089253 + }, + { + "category": "long", + "input": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb", + "seed": 2147483647, + "expected": 403187954 + } +] diff --git a/tests/Integration/FullChainIntegrationTest.php b/tests/Integration/FullChainIntegrationTest.php new file mode 100644 index 0000000..34ab2b1 --- /dev/null +++ b/tests/Integration/FullChainIntegrationTest.php @@ -0,0 +1,536 @@ + ['static'], + 'live' => ['live'], + 'live-secret' => ['live-secret'], + ]; + } + + private function skipIfLiveDisabled(string $mode): void + { + if ($mode === 'live' && !getenv('CONVERT_STAGING_SDK_KEY')) { + $this->markTestSkipped('Live tests require CONVERT_STAGING_SDK_KEY env var'); + } + if ($mode === 'live-secret' && (!getenv('CONVERT_STAGING_SDK_KEY2') || !getenv('CONVERT_STAGING_SDK_KEY2_SECRET'))) { + $this->markTestSkipped('Live-secret tests require CONVERT_STAGING_SDK_KEY2 and CONVERT_STAGING_SDK_KEY2_SECRET env vars'); + } + } + + private function createSdk(string $mode, array $overrides = []): Core + { + if ($mode === 'live' || $mode === 'live-secret') { + // Restore real HTTP strategies for live CDN fetch + ClassDiscovery::setStrategies(self::$originalStrategies); + try { + $config = [ + 'environment' => 'staging', + 'network' => ['tracking' => false, 'cacheLevel' => 'low'], + ]; + if ($mode === 'live-secret') { + $config['sdkKey'] = getenv('CONVERT_STAGING_SDK_KEY2'); + $config['sdkKeySecret'] = getenv('CONVERT_STAGING_SDK_KEY2_SECRET'); + } else { + $config['sdkKey'] = getenv('CONVERT_STAGING_SDK_KEY'); + } + return ConvertSDK::create(array_merge($config, $overrides)); + } finally { + // Re-add mock strategy for subsequent static tests + ClassDiscovery::prependStrategy(MockClientStrategy::class); + } + } + // Static mode + return ConvertSDK::create(array_merge([ + 'data' => $this->configData, + 'environment' => $this->environment, + 'network' => ['tracking' => false], + ], $overrides)); + } + + private function createTrackingEnabledSdk(string $mode): Core + { + return $this->createSdk($mode, [ + 'network' => ($mode === 'live' || $mode === 'live-secret') + ? ['tracking' => true, 'cacheLevel' => 'low'] + : ['tracking' => true], + ]); + } + + protected function setUp(): void + { + $json = file_get_contents(__DIR__ . '/static-config.json'); + $this->configData = json_decode($json, true); + $this->environment = 'staging'; + + // Experience -4 uses pricing-location (rule: location=pricing), no audiences + $this->qualifyingAttributes = new BucketingAttributes([ + 'locationProperties' => ['location' => 'pricing'], + 'typeCasting' => true, + ]); + } + + // -- Happy Path -------------------------------------------------------- + + #[DataProvider('authModes')] + public function testSdkInitializesAndIsReady(string $mode): void + { + $this->skipIfLiveDisabled($mode); + $sdk = $this->createSdk($mode); + $this->assertInstanceOf(Core::class, $sdk); + $this->assertTrue($sdk->isReady()); + } + + #[DataProvider('authModes')] + public function testReadyEventFiredOnInit(string $mode): void + { + $this->skipIfLiveDisabled($mode); + $events = []; + + $sdk = $this->createSdk($mode); + + // Deferred event: listener attached after create() still receives the Ready event + $sdk->on('ready', function ($args, $err) use (&$events) { + $events[] = ['args' => $args, 'err' => $err]; + }); + + $this->assertCount(1, $events, 'Ready event should fire exactly once'); + $this->assertNull($events[0]['err'], 'Ready event should have no error'); + } + + #[DataProvider('authModes')] + public function testCreateContextAndRunExperience(string $mode): void + { + $this->skipIfLiveDisabled($mode); + $sdk = $this->createSdk($mode); + $context = $sdk->createContext('visitor-integration-test', null); + $this->assertNotNull($context); + + $result = $context->runExperience(self::EXPERIENCE_KEY, $this->qualifyingAttributes); + + $this->assertInstanceOf(BucketedVariation::class, $result); + $this->assertSame(self::EXPERIENCE_KEY, $result->experienceKey); + $this->assertContains($result->variationId, ['1003180877', '1003180878']); + $this->assertNotEmpty($result->variationKey, 'variationKey should be non-empty'); + $this->assertNotEmpty($result->changes); + } + + #[DataProvider('authModes')] + public function testBucketingDeterminism(string $mode): void + { + $this->skipIfLiveDisabled($mode); + $sdk = $this->createSdk($mode); + $context = $sdk->createContext('determinism-visitor', null); + $results = []; + + for ($i = 0; $i < 10; $i++) { + $variation = $context->runExperience(self::EXPERIENCE_KEY, $this->qualifyingAttributes); + $this->assertNotNull($variation); + $results[] = $variation->variationId; + } + + $unique = array_unique($results); + $this->assertCount(1, $unique, 'Same visitor must always get the same variation'); + } + + #[DataProvider('authModes')] + public function testBucketingEventFiredOnExperience(string $mode): void + { + $this->skipIfLiveDisabled($mode); + $sdk = $this->createSdk($mode); + $bucketingEvents = []; + + $sdk->on('bucketing', function ($args, $err) use (&$bucketingEvents) { + $bucketingEvents[] = ['args' => $args, 'err' => $err]; + }); + + $context = $sdk->createContext('event-spy-visitor', null); + $context->runExperience(self::EXPERIENCE_KEY, $this->qualifyingAttributes); + + $this->assertNotEmpty($bucketingEvents, 'Bucketing event should fire when running an experience'); + } + + #[DataProvider('authModes')] + public function testRunFeatureWithTypedVariables(string $mode): void + { + $this->skipIfLiveDisabled($mode); + $sdk = $this->createSdk($mode); + $context = $sdk->createContext('feature-typed-visitor', null); + $result = $context->runFeature(self::FEATURE_TYPED_KEY, $this->qualifyingAttributes); + + $this->assertInstanceOf(BucketedFeature::class, $result); + $this->assertSame(FeatureStatus::Enabled, $result->status); + $this->assertSame(self::FEATURE_TYPED_KEY, $result->featureKey); + + // Verify typed variables + $this->assertIsFloat($result->variables['price']); + $this->assertIsInt($result->variables['button-height']); + + // JSON variable should be decoded to array/object + $additionalData = $result->variables['additionalData']; + $this->assertIsArray($additionalData); + $this->assertSame('bar', $additionalData['foo']); + $this->assertSame(2, $additionalData['v']); + } + + #[DataProvider('authModes')] + public function testFullChainInitContextBucketFeatureVerify(string $mode): void + { + $this->skipIfLiveDisabled($mode); + // Init + $sdk = $this->createSdk($mode); + $this->assertTrue($sdk->isReady()); + + // Attach event spies + $readyEvents = []; + $bucketingEvents = []; + + $sdk->on('ready', function ($args, $err) use (&$readyEvents) { + $readyEvents[] = ['args' => $args, 'err' => $err]; + }); + $sdk->on('bucketing', function ($args, $err) use (&$bucketingEvents) { + $bucketingEvents[] = ['args' => $args, 'err' => $err]; + }); + + // Context + $context = $sdk->createContext('full-chain-visitor'); + $this->assertNotNull($context); + + // Bucket + $variation = $context->runExperience(self::EXPERIENCE_KEY, $this->qualifyingAttributes); + $this->assertInstanceOf(BucketedVariation::class, $variation); + + // Feature + $feature = $context->runFeature(self::FEATURE_BASIC_KEY, $this->qualifyingAttributes); + $this->assertInstanceOf(BucketedFeature::class, $feature); + $this->assertSame(FeatureStatus::Enabled, $feature->status); + + // Verify events + $this->assertCount(1, $readyEvents, 'Ready event should fire exactly once'); + $this->assertNotEmpty($bucketingEvents, 'Bucketing events should fire for experience and feature runs'); + + // Verify determinism: re-run same experience, expect same variationId + $secondRun = $context->runExperience(self::EXPERIENCE_KEY, $this->qualifyingAttributes); + $this->assertNotNull($secondRun); + $this->assertSame($variation->variationId, $secondRun->variationId); + } + + // -- Negative Paths ---------------------------------------------------- + + public function testCreateWithoutSdkKeyOrDataThrows(): void + { + $this->expectException(InvalidArgumentException::class); + ConvertSDK::create([]); + } + + #[DataProvider('authModes')] + public function testRunFeatureWithUnknownKeyReturnsNull(string $mode): void + { + $this->skipIfLiveDisabled($mode); + $sdk = $this->createSdk($mode); + $context = $sdk->createContext('null-feature-visitor', null); + $result = $context->runFeature('completely-nonexistent-feature-key', $this->qualifyingAttributes); + $this->assertNull($result); + } + + #[DataProvider('authModes')] + public function testRunExperienceWithNonQualifyingVisitorReturnsNull(string $mode): void + { + $this->skipIfLiveDisabled($mode); + $sdk = $this->createSdk($mode); + $context = $sdk->createContext('non-qualifying-visitor', null); + + $nonQualifyingAttributes = new BucketingAttributes([ + 'locationProperties' => ['location' => 'nonexistent'], + ]); + + $result = $context->runExperience(self::EXPERIENCE_KEY, $nonQualifyingAttributes); + $this->assertNull($result); + } + + #[DataProvider('authModes')] + public function testRunExperienceWithAudienceAndNoVisitorPropertiesReturnsNull(string $mode): void + { + $this->skipIfLiveDisabled($mode); + $sdk = $this->createSdk($mode); + $context = $sdk->createContext('audience-no-props-visitor', null); + + // Experience -1 has audience adv-audience (desktop=true AND browser!="CH" OR mobile=true). + // Omitting visitorProperties means audience rules can't be evaluated → null. + $locationOnlyAttributes = new BucketingAttributes([ + 'locationProperties' => ['location' => 'pricing'], + ]); + + $result = $context->runExperience('test-experience-ab-fullstack-1', $locationOnlyAttributes); + $this->assertNull($result, 'Experience with audiences should return null when visitorProperties is not provided'); + } + + // -- Conversion Tracking ----------------------------------------------- + + #[DataProvider('authModes')] + public function testTrackConversion(string $mode): void + { + $this->skipIfLiveDisabled($mode); + $sdk = $this->createTrackingEnabledSdk($mode); + + $queueReleasedEvents = []; + $sdk->on(SystemEvents::ApiQueueReleased->value, function ($args) use (&$queueReleasedEvents) { + $queueReleasedEvents[] = $args; + }); + + $context = $sdk->createContext('tracking-visitor-basic'); + $context->runExperience(self::EXPERIENCE_KEY, $this->qualifyingAttributes); + + $result = $context->trackConversion(self::GOAL_KEY); + $sdk->flush(); + + $this->assertNull($result, 'trackConversion should return null on success'); + $this->assertNotEmpty($queueReleasedEvents, 'ApiQueueReleased should fire (tracking POST sent)'); + } + + #[DataProvider('authModes')] + public function testConversionEventFiredOnTrackConversion(string $mode): void + { + $this->skipIfLiveDisabled($mode); + $sdk = $this->createTrackingEnabledSdk($mode); + + $conversionEvents = []; + $sdk->on(SystemEvents::Conversion->value, function ($args) use (&$conversionEvents) { + $conversionEvents[] = $args; + }); + + $context = $sdk->createContext('tracking-visitor-event'); + $context->runExperience(self::EXPERIENCE_KEY, $this->qualifyingAttributes); + $context->trackConversion(self::GOAL_KEY); + + $this->assertCount(1, $conversionEvents, 'Conversion event should fire exactly once'); + $this->assertSame('tracking-visitor-event', $conversionEvents[0]['visitorId']); + $this->assertSame(self::GOAL_KEY, $conversionEvents[0]['goalKey']); + } + + #[DataProvider('authModes')] + public function testGoalDeduplication(string $mode): void + { + $this->skipIfLiveDisabled($mode); + $sdk = $this->createTrackingEnabledSdk($mode); + + $queueReleasedEvents = []; + $sdk->on(SystemEvents::ApiQueueReleased->value, function ($args) use (&$queueReleasedEvents) { + $queueReleasedEvents[] = $args; + }); + + $context = $sdk->createContext('tracking-visitor-dedup'); + $context->runExperience(self::EXPERIENCE_KEY, $this->qualifyingAttributes); + + // First call — should enqueue and release on flush + $context->trackConversion(self::GOAL_KEY); + $sdk->flush(); + $countAfterFirst = count($queueReleasedEvents); + $this->assertGreaterThan(0, $countAfterFirst, 'First conversion should trigger API queue release'); + + // Second call — deduplicated, nothing enqueued, flush is no-op + $secondResult = $context->trackConversion(self::GOAL_KEY); + $sdk->flush(); + $this->assertNull($secondResult, 'Deduplicated conversion should still return null (same as first call)'); + $this->assertCount($countAfterFirst, $queueReleasedEvents, 'Second conversion should be deduplicated (no new API queue release)'); + } + + #[DataProvider('authModes')] + public function testTrackConversionWithRevenue(string $mode): void + { + $this->skipIfLiveDisabled($mode); + $sdk = $this->createTrackingEnabledSdk($mode); + + $queueReleasedEvents = []; + $sdk->on(SystemEvents::ApiQueueReleased->value, function ($args) use (&$queueReleasedEvents) { + $queueReleasedEvents[] = $args; + }); + + $context = $sdk->createContext('tracking-visitor-revenue'); + $context->runExperience(self::EXPERIENCE_KEY, $this->qualifyingAttributes); + + $result = $context->trackConversion(self::GOAL_KEY, new ConversionAttributes( + conversionData: [ + new GoalData(GoalDataKey::Amount, 49.99), + new GoalData(GoalDataKey::TransactionId, 'txn-integration-001'), + ], + )); + + $sdk->flush(); + + $this->assertNull($result, 'Revenue conversion should return null on success'); + // Revenue tracking enqueues conversion + transaction events, flushed as a single batched release + $this->assertGreaterThanOrEqual(1, count($queueReleasedEvents), 'Revenue conversion should trigger at least 1 API release'); + + // Verify released payload contains visitor data + $lastEvent = end($queueReleasedEvents); + $this->assertArrayHasKey('visitors', $lastEvent); + } + + #[DataProvider('authModes')] + public function testForceMultipleTransactions(string $mode): void + { + $this->skipIfLiveDisabled($mode); + $sdk = $this->createTrackingEnabledSdk($mode); + + $queueReleasedEvents = []; + $sdk->on(SystemEvents::ApiQueueReleased->value, function ($args) use (&$queueReleasedEvents) { + $queueReleasedEvents[] = $args; + }); + + $context = $sdk->createContext('tracking-visitor-force'); + $context->runExperience(self::EXPERIENCE_KEY, $this->qualifyingAttributes); + + // First call with goalData: conversion + transaction enqueued, flushed as batch + $context->trackConversion(self::GOAL_KEY, new ConversionAttributes( + conversionData: [new GoalData(GoalDataKey::Amount, 25.00)], + )); + $sdk->flush(); + $countAfterFirst = count($queueReleasedEvents); + $this->assertGreaterThanOrEqual(1, $countAfterFirst, 'First revenue conversion should trigger at least 1 release'); + + // Second call with forceMultipleTransactions: transaction event should still be sent + $context->trackConversion(self::GOAL_KEY, new ConversionAttributes( + conversionData: [new GoalData(GoalDataKey::Amount, 25.00)], + conversionSetting: [ConversionSettingKey::ForceMultipleTransactions->value => true], + )); + $sdk->flush(); + $this->assertGreaterThan($countAfterFirst, count($queueReleasedEvents), 'forceMultipleTransactions should allow repeat transaction'); + + // Verify the forced release carried a transaction (visitor data with goalData) + $lastRelease = $queueReleasedEvents[array_key_last($queueReleasedEvents)]; + $this->assertArrayHasKey('visitors', $lastRelease); + $lastVisitor = $lastRelease['visitors'][0] ?? null; + $this->assertNotNull($lastVisitor, 'Released payload should contain visitor data'); + $this->assertArrayHasKey('events', $lastVisitor); + $lastEvent = end($lastVisitor['events']); + $this->assertArrayHasKey('goalData', $lastEvent['data'] ?? [], 'Forced repeat release should contain a transaction event with goalData'); + } + + #[DataProvider('authModes')] + public function testTrackConversionWithNonexistentGoalReturnsFalse(string $mode): void + { + $this->skipIfLiveDisabled($mode); + $sdk = $this->createSdk($mode); + $conversionEvents = []; + $sdk->on(SystemEvents::Conversion->value, function ($args) use (&$conversionEvents) { + $conversionEvents[] = $args; + }); + + $context = $sdk->createContext('tracking-visitor-fake-goal'); + $result = $context->trackConversion('totally-fake-goal'); + + $this->assertFalse($result, 'Non-existent goal should return false'); + $this->assertEmpty($conversionEvents, 'No conversion event should fire for non-existent goal'); + } + + // -- Complete Chain ---------------------------------------------------- + + #[DataProvider('authModes')] + public function testCompleteChainInitThroughFlush(string $mode): void + { + $this->skipIfLiveDisabled($mode); + // Init with tracking enabled + $sdk = $this->createTrackingEnabledSdk($mode); + $this->assertTrue($sdk->isReady()); + + // Attach event spies + $readyEvents = []; + $bucketingEvents = []; + $conversionEvents = []; + $queueReleasedEvents = []; + + $sdk->on('ready', function ($args, $err) use (&$readyEvents) { + $readyEvents[] = ['args' => $args, 'err' => $err]; + }); + $sdk->on('bucketing', function ($args, $err) use (&$bucketingEvents) { + $bucketingEvents[] = ['args' => $args, 'err' => $err]; + }); + $sdk->on(SystemEvents::Conversion->value, function ($args) use (&$conversionEvents) { + $conversionEvents[] = $args; + }); + $sdk->on(SystemEvents::ApiQueueReleased->value, function ($args) use (&$queueReleasedEvents) { + $queueReleasedEvents[] = $args; + }); + + // Context + $context = $sdk->createContext('complete-chain-visitor'); + $this->assertNotNull($context); + + // Bucket — runExperience + $variation = $context->runExperience(self::EXPERIENCE_KEY, $this->qualifyingAttributes); + $this->assertInstanceOf(BucketedVariation::class, $variation); + + // Feature — runFeature + $feature = $context->runFeature(self::FEATURE_BASIC_KEY, $this->qualifyingAttributes); + $this->assertInstanceOf(BucketedFeature::class, $feature); + $this->assertSame(FeatureStatus::Enabled, $feature->status); + + // Track — conversion + $result = $context->trackConversion(self::GOAL_KEY); + $this->assertNull($result, 'trackConversion should return null on success'); + + // Flush — release all queued events as a single batched POST + $sdk->flush(); + + // Verify all event types fired + $this->assertCount(1, $readyEvents, 'Ready event should fire exactly once'); + $this->assertNotEmpty($bucketingEvents, 'Bucketing events should fire for experience and feature runs'); + $this->assertCount(1, $conversionEvents, 'Conversion event should fire once'); + $this->assertSame('complete-chain-visitor', $conversionEvents[0]['visitorId']); + $this->assertNotEmpty($queueReleasedEvents, 'API queue should be released (tracking POST sent)'); + } +} diff --git a/tests/Integration/static-config.json b/tests/Integration/static-config.json new file mode 100644 index 0000000..f324b7b --- /dev/null +++ b/tests/Integration/static-config.json @@ -0,0 +1 @@ +{"account_id":"10035569","project":{"id":"10034190","name":"FS-Test-Proj - DO NOT DELETE","type":"fullstack","utc_offset":"0","domains":[],"global_javascript":"","settings":{"include_jquery":false,"include_jquery_v1":false,"disable_spa_functionality":false,"do_not_track_referral":false,"allow_crossdomain_tracking":false,"data_anonymization":false,"do_not_track":"OFF","global_privacy_control":"OFF","min_order_value":0,"max_order_value":99999,"version":"2026-03-22T07:46:28+00:00-259","tracking_script":null,"outliers":{"order_value":{"detection_type":"none"},"products_ordered_count":{"detection_type":"none"}},"placeholders":[],"global_javascript_placeholders":[],"integrations":{"google_analytics":{"enabled":false},"kissmetrics":{"enabled":false},"visitor_insights":{"tracking_id":null}}},"custom_domain":null},"experiences":[{"id":"100334665","name":"Test Experience AB Fullstack","type":"a\/b_fullstack","status":"active","global_js":"","global_css":"","environment":"staging","settings":{"min_order_value":0,"max_order_value":99999,"matching_options":{"audiences":"any","locations":"any"},"placeholders":[],"outliers":{"order_value":{"detection_type":"none"},"products_ordered_count":{"detection_type":"none"}}},"key":"test-experience-ab-fullstack-1","version":8,"locations":["1003350","1003351","1003352","10036409"],"site_area":null,"audiences":["10033684"],"goals":["100322784"],"integrations":[],"environments":["staging"],"variations":[{"id":"1003142550","name":"Original Page","key":"1003142550-original-page","status":"running","changes":[{"id":1003122037,"type":"fullStackFeature","data":{"feature_id":10031,"variables_data":{"enabled":false,"caption":"Click this"}}}],"traffic_allocation":50.0},{"id":"1003142551","name":"Variation 1","key":"1003142551-variation-1","status":"running","changes":[{"id":1003122038,"type":"fullStackFeature","data":{"feature_id":10031,"variables_data":{"enabled":false,"caption":"Click that"}}}],"traffic_allocation":50.0}]},{"id":"100349071","name":"Test Experience AB Fullstack 4","type":"a\/b_fullstack","status":"active","global_js":"","global_css":"","environment":"staging","settings":{"min_order_value":0,"max_order_value":99999,"matching_options":{"audiences":"any","locations":"any"},"placeholders":[],"outliers":{"order_value":{"detection_type":"none"},"products_ordered_count":{"detection_type":"none"}}},"key":"test-experience-ab-fullstack-4","version":11,"locations":["1003352"],"site_area":null,"audiences":[],"goals":["100322782","100322783"],"integrations":[],"environments":["staging"],"variations":[{"id":"1003180877","name":"Original","key":"original","status":"running","changes":[{"id":1003183443,"type":"fullStackFeature","data":{"feature_id":100334,"variables_data":{"price":100,"button-height":40,"additionalData":{"foo":"bar","v":2}}}},{"id":1003183444,"type":"fullStackFeature","data":{"feature_id":10031,"variables_data":{"enabled":false,"caption":"Click that"}}}],"traffic_allocation":50.0},{"id":"1003180878","name":"Variation 1","key":"variation-1","status":"running","changes":[{"id":1003183445,"type":"fullStackFeature","data":{"feature_id":100334,"variables_data":{"price":100,"button-height":40,"additionalData":{"foo":"bar","v":2}}}},{"id":1003183446,"type":"fullStackFeature","data":{"feature_id":10031,"variables_data":{"enabled":false,"caption":"Not allowed"}}}],"traffic_allocation":50.0}]}],"audiences":[{"id":"10033684","name":"Adv Audience","key":"adv-audience","rules":{"OR":[{"AND":[{"OR_WHEN":[{"rule_type":"generic_bool_key_value","matching":{"match_type":"equals","negated":false},"value":true,"key":"desktop"}]},{"OR_WHEN":[{"rule_type":"generic_text_key_value","matching":{"match_type":"matches","negated":true},"value":"CH","key":"browser"}]}]},{"AND":[{"OR_WHEN":[{"rule_type":"generic_bool_key_value","matching":{"match_type":"equals","negated":false},"value":true,"key":"mobile"}]}]}]},"type":"permanent"}],"segments":[{"id":"10033690","name":"Test Segments","key":"test-segment-1","rules":{"OR":[{"AND":[{"OR_WHEN":[{"rule_type":"generic_bool_key_value","matching":{"match_type":"equals","negated":false},"value":true,"key":"enabled"}]}]}]}}],"goals":[{"id":"100322782","name":"Decrease BounceRate","key":"decrease-bounce-rate","type":"advanced","rules":{"OR":[{"AND":[{"OR_WHEN":[{"rule_type":"pages_visited_count","matching":{"match_type":"lessEqual","negated":true},"value":1,"key":"d"},{"rule_type":"visit_duration","matching":{"match_type":"lessEqual","negated":true},"value":10}]}]}]}},{"id":"100322783","name":"Increase Engagement","key":"increase-engagement","type":"dom_interaction","rules":null,"settings":{"tracked_items":[{"event":"click","selector":"a"},{"event":"submit","selector":"form"}]}},{"id":"100322784","name":"primary button click","key":"button-primary-click","type":"revenue","rules":{"OR":[{"AND":[{"OR_WHEN":[{"rule_type":"generic_text_key_value","matching":{"match_type":"matches","negated":false},"value":"buy","key":"action"}]}]}]},"settings":{"triggering_type":"manual"}}],"locations":[{"id":"1003350","key":"events-location","name":"Events Location","rules":{"OR":[{"AND":[{"OR_WHEN":[{"rule_type":"generic_text_key_value","matching":{"match_type":"matches","negated":false},"value":"events","key":"location"}]}]}]},"trigger":{"type":"upon_run"}},{"id":"1003351","key":"statistics-location","name":"Statistics Location","rules":{"OR":[{"AND":[{"OR_WHEN":[{"rule_type":"generic_text_key_value","matching":{"match_type":"matches","negated":false},"value":"statistics","key":"location"}]}]}]},"trigger":{"type":"upon_run"}},{"id":"1003352","key":"pricing-location","name":"Pricing Location","rules":{"OR":[{"AND":[{"OR_WHEN":[{"rule_type":"generic_text_key_value","matching":{"match_type":"matches","negated":false},"value":"pricing","key":"location"}]}]}]},"trigger":{"type":"upon_run"}},{"id":"10036407","key":"homescreen","name":"HomeScreen","rules":{"OR":[{"AND":[{"OR_WHEN":[{"rule_type":"generic_text_key_value","matching":{"match_type":"matches","negated":false},"value":"home","key":"screen"},{"rule_type":"generic_text_key_value","matching":{"match_type":"matches","negated":false},"value":"https:\/\/test.com","key":"feature"}]}]}]},"trigger":{"type":"upon_run"}},{"id":"10036409","key":"dasadsa","name":"dasadsa","rules":{"OR":[{"AND":[{"OR_WHEN":[{"rule_type":"generic_numeric_key_value","matching":{"match_type":"less","negated":false},"value":5,"key":"feature"}]}]}]},"trigger":{"type":"upon_run"}}],"archived_experiences":["100334668","100344096"],"features":[{"id":"10031","name":"Feature 1","key":"feature-1","variables":[{"key":"enabled","type":"boolean"},{"key":"caption","type":"string"}]},{"id":"10032","name":"Feature 4","key":"feature-4","variables":[{"key":"statistics","type":"json"}]},{"id":"10033","name":"Feature 5","key":"feature-5","variables":[{"key":"plans","type":"json"}]},{"id":"100320","name":"Button","key":"button","variables":[{"key":"Border","type":"boolean"},{"key":"Color","type":"string"}]},{"id":"100334","name":"Feature 2","key":"feature-2","variables":[{"key":"price","type":"float"},{"key":"button-height","type":"integer"},{"key":"additionalData","type":"json"}]},{"id":"100335","name":"Not Attached Feature 3","key":"not-attached-feature-3","variables":[{"key":"fee","type":"float"},{"key":"link","type":"string"},{"key":"additionalData","type":"json"}]}],"_s_t":"2026-03-22 08:01:02Z","is_debug":false} \ No newline at end of file diff --git a/tests/verify-php82-upgrade.sh b/tests/verify-php82-upgrade.sh new file mode 100755 index 0000000..c15d957 --- /dev/null +++ b/tests/verify-php82-upgrade.sh @@ -0,0 +1,86 @@ +#!/usr/bin/env bash +# Verification script for Story 1.1: PHP 8.2 Upgrade & Strict Types +# Validates all acceptance criteria are met. +set -euo pipefail + +REPO_ROOT="$(cd "$(dirname "$0")/.." && pwd)" +cd "$REPO_ROOT" + +FAIL=0 +pass() { echo " ✅ $1"; } +fail() { echo " ❌ $1"; FAIL=1; } + +echo "=== AC #1 & #5: PHP ^8.2 in all composer.json ===" +for f in composer.json packages/*/composer.json; do + if grep -q '"php": "\^8\.2"' "$f" 2>/dev/null; then + pass "$f" + else + fail "$f — missing or incorrect php constraint" + fi +done + +echo "" +echo "=== AC #2: declare(strict_types=1) in all PHP files (excl Types/lib) ===" +MISSING=$(find packages -name "*.php" \( -path "*/src/*" -o -path "*/tests/*" \) ! -path "*/Types/lib/*" -exec grep -L 'declare(strict_types=1)' {} \;) +if [ -z "$MISSING" ]; then + pass "All PHP files have declare(strict_types=1)" +else + fail "Files missing strict_types:" + echo "$MISSING" +fi + +echo "" +echo "=== AC #2 (format): Blank line between declare and namespace ===" +BAD_FORMAT=0 +for f in $(find packages -name "*.php" \( -path "*/src/*" -o -path "*/tests/*" \) ! -path "*/Types/lib/*"); do + if head -6 "$f" | tr '\n' '|' | grep -q 'declare(strict_types=1);|namespace\|declare(strict_types=1);|use \|declare(strict_types=1);|//' 2>/dev/null; then + fail "$f — missing blank line after declare(strict_types=1)" + BAD_FORMAT=1 + fi +done +if [ "$BAD_FORMAT" -eq 0 ]; then + pass "All files have correct declare formatting" +fi + +echo "" +echo "=== AC #3: No ext-swoole references ===" +SWOOLE=$(grep -rl "ext-swoole" packages/*/composer.json composer.json 2>/dev/null || true) +if [ -z "$SWOOLE" ]; then + pass "No ext-swoole references found" +else + fail "ext-swoole found in: $SWOOLE" +fi + +echo "" +echo "=== AC #4: Namespace conventions ===" +BAD_NS=$(grep -rh "^namespace " packages/*/src/ --include="*.php" 2>/dev/null | grep -v "ConvertSdk" || true) +if [ -z "$BAD_NS" ]; then + pass "All non-Types packages use ConvertSdk\\ namespace" +else + fail "Non-ConvertSdk namespaces found: $BAD_NS" +fi + +TYPES_NS=$(grep -rh "^namespace " packages/Types/lib/ --include="*.php" 2>/dev/null | grep -v "OpenAPI\|OpenApi" || true) +if [ -z "$TYPES_NS" ]; then + pass "Types package uses OpenAPI\\Client\\ namespace" +else + fail "Types package has non-OpenAPI namespaces: $TYPES_NS" +fi + +echo "" +echo "=== AC #2 (exclusion): Types/lib files NOT modified ===" +TYPES_STRICT=$(grep -rl 'declare(strict_types=1)' packages/Types/lib/ 2>/dev/null || true) +if [ -z "$TYPES_STRICT" ]; then + pass "Types/lib files untouched" +else + fail "Types/lib files have strict_types: $TYPES_STRICT" +fi + +echo "" +if [ "$FAIL" -eq 0 ]; then + echo "🎉 ALL ACCEPTANCE CRITERIA PASS" + exit 0 +else + echo "💥 SOME CHECKS FAILED — see above" + exit 1 +fi diff --git a/yarn.lock b/yarn.lock new file mode 100644 index 0000000..2b35ff4 --- /dev/null +++ b/yarn.lock @@ -0,0 +1,4169 @@ +# This file is generated by running "yarn install" inside your project. +# Manual changes might be lost - proceed with caution! + +__metadata: + version: 8 + cacheKey: 10c0 + +"@babel/code-frame@npm:^7.0.0, @babel/code-frame@npm:^7.26.2": + version: 7.29.0 + resolution: "@babel/code-frame@npm:7.29.0" + dependencies: + "@babel/helper-validator-identifier": "npm:^7.28.5" + js-tokens: "npm:^4.0.0" + picocolors: "npm:^1.1.1" + checksum: 10c0/d34cc504e7765dfb576a663d97067afb614525806b5cad1a5cc1a7183b916fec8ff57fa233585e3926fd5a9e6b31aae6df91aa81ae9775fb7a28f658d3346f0d + languageName: node + linkType: hard + +"@babel/helper-validator-identifier@npm:^7.28.5": + version: 7.28.5 + resolution: "@babel/helper-validator-identifier@npm:7.28.5" + checksum: 10c0/42aaebed91f739a41f3d80b72752d1f95fd7c72394e8e4bd7cdd88817e0774d80a432451bcba17c2c642c257c483bf1d409dd4548883429ea9493a3bc4ab0847 + languageName: node + linkType: hard + +"@colors/colors@npm:1.5.0": + version: 1.5.0 + resolution: "@colors/colors@npm:1.5.0" + checksum: 10c0/eb42729851adca56d19a08e48d5a1e95efd2a32c55ae0323de8119052be0510d4b7a1611f2abcbf28c044a6c11e6b7d38f99fccdad7429300c37a8ea5fb95b44 + languageName: node + linkType: hard + +"@isaacs/cliui@npm:^8.0.2": + version: 8.0.2 + resolution: "@isaacs/cliui@npm:8.0.2" + dependencies: + string-width: "npm:^5.1.2" + string-width-cjs: "npm:string-width@^4.2.0" + strip-ansi: "npm:^7.0.1" + strip-ansi-cjs: "npm:strip-ansi@^6.0.1" + wrap-ansi: "npm:^8.1.0" + wrap-ansi-cjs: "npm:wrap-ansi@^7.0.0" + checksum: 10c0/b1bf42535d49f11dc137f18d5e4e63a28c5569de438a221c369483731e9dac9fb797af554e8bf02b6192d1e5eba6e6402cf93900c3d0ac86391d00d04876789e + languageName: node + linkType: hard + +"@isaacs/fs-minipass@npm:^4.0.0": + version: 4.0.1 + resolution: "@isaacs/fs-minipass@npm:4.0.1" + dependencies: + minipass: "npm:^7.0.4" + checksum: 10c0/c25b6dc1598790d5b55c0947a9b7d111cfa92594db5296c3b907e2f533c033666f692a3939eadac17b1c7c40d362d0b0635dc874cbfe3e70db7c2b07cc97a5d2 + languageName: node + linkType: hard + +"@isaacs/string-locale-compare@npm:^1.1.0": + version: 1.1.0 + resolution: "@isaacs/string-locale-compare@npm:1.1.0" + checksum: 10c0/d67226ff7ac544a495c77df38187e69e0e3a0783724777f86caadafb306e2155dc3b5787d5927916ddd7fb4a53561ac8f705448ac3235d18ea60da5854829fdf + languageName: node + linkType: hard + +"@npmcli/agent@npm:^3.0.0": + version: 3.0.0 + resolution: "@npmcli/agent@npm:3.0.0" + dependencies: + agent-base: "npm:^7.1.0" + http-proxy-agent: "npm:^7.0.0" + https-proxy-agent: "npm:^7.0.1" + lru-cache: "npm:^10.0.1" + socks-proxy-agent: "npm:^8.0.3" + checksum: 10c0/efe37b982f30740ee77696a80c196912c274ecd2cb243bc6ae7053a50c733ce0f6c09fda085145f33ecf453be19654acca74b69e81eaad4c90f00ccffe2f9271 + languageName: node + linkType: hard + +"@npmcli/arborist@npm:^8.0.4": + version: 8.0.4 + resolution: "@npmcli/arborist@npm:8.0.4" + dependencies: + "@isaacs/string-locale-compare": "npm:^1.1.0" + "@npmcli/fs": "npm:^4.0.0" + "@npmcli/installed-package-contents": "npm:^3.0.0" + "@npmcli/map-workspaces": "npm:^4.0.1" + "@npmcli/metavuln-calculator": "npm:^8.0.0" + "@npmcli/name-from-folder": "npm:^3.0.0" + "@npmcli/node-gyp": "npm:^4.0.0" + "@npmcli/package-json": "npm:^6.0.1" + "@npmcli/query": "npm:^4.0.0" + "@npmcli/redact": "npm:^3.0.0" + "@npmcli/run-script": "npm:^9.0.1" + bin-links: "npm:^5.0.0" + cacache: "npm:^19.0.1" + common-ancestor-path: "npm:^1.0.1" + hosted-git-info: "npm:^8.0.0" + json-parse-even-better-errors: "npm:^4.0.0" + json-stringify-nice: "npm:^1.1.4" + lru-cache: "npm:^10.2.2" + minimatch: "npm:^9.0.4" + nopt: "npm:^8.0.0" + npm-install-checks: "npm:^7.1.0" + npm-package-arg: "npm:^12.0.0" + npm-pick-manifest: "npm:^10.0.0" + npm-registry-fetch: "npm:^18.0.1" + pacote: "npm:^19.0.0" + parse-conflict-json: "npm:^4.0.0" + proc-log: "npm:^5.0.0" + proggy: "npm:^3.0.0" + promise-all-reject-late: "npm:^1.0.0" + promise-call-limit: "npm:^3.0.1" + promise-retry: "npm:^2.0.1" + read-package-json-fast: "npm:^4.0.0" + semver: "npm:^7.3.7" + ssri: "npm:^12.0.0" + treeverse: "npm:^3.0.0" + walk-up-path: "npm:^3.0.1" + bin: + arborist: bin/index.js + checksum: 10c0/a05946a8f700673b876fa0e61d8e731ac9d99a23a195c2b59609b604dbe09e8b4b5fc16ff7e1075e0314d73c09abb3aaf3cd9a789a5ff6ed09a130ca36abdfb8 + languageName: node + linkType: hard + +"@npmcli/config@npm:^9.0.0": + version: 9.0.0 + resolution: "@npmcli/config@npm:9.0.0" + dependencies: + "@npmcli/map-workspaces": "npm:^4.0.1" + "@npmcli/package-json": "npm:^6.0.1" + ci-info: "npm:^4.0.0" + ini: "npm:^5.0.0" + nopt: "npm:^8.0.0" + proc-log: "npm:^5.0.0" + semver: "npm:^7.3.5" + walk-up-path: "npm:^3.0.1" + checksum: 10c0/e059fa1dcf0d931bd9d8ae11cf1823b09945fa451a45d4bd55fd2382022f4f9210ce775fe445d52380324dd4985662f2e2d69c5d572b90eed48a8b904d76eba5 + languageName: node + linkType: hard + +"@npmcli/fs@npm:^4.0.0": + version: 4.0.0 + resolution: "@npmcli/fs@npm:4.0.0" + dependencies: + semver: "npm:^7.3.5" + checksum: 10c0/c90935d5ce670c87b6b14fab04a965a3b8137e585f8b2a6257263bd7f97756dd736cb165bb470e5156a9e718ecd99413dccc54b1138c1a46d6ec7cf325982fe5 + languageName: node + linkType: hard + +"@npmcli/git@npm:^6.0.0, @npmcli/git@npm:^6.0.1": + version: 6.0.3 + resolution: "@npmcli/git@npm:6.0.3" + dependencies: + "@npmcli/promise-spawn": "npm:^8.0.0" + ini: "npm:^5.0.0" + lru-cache: "npm:^10.0.1" + npm-pick-manifest: "npm:^10.0.0" + proc-log: "npm:^5.0.0" + promise-retry: "npm:^2.0.1" + semver: "npm:^7.3.5" + which: "npm:^5.0.0" + checksum: 10c0/a8ff1d5f997f7bfdc149fbe7478017b100efe3d08bd566df6b5ac716fd630d2eff0f7feebc6705831a3a7072a67a955a339a8fea8551ce4faffafa9526306e05 + languageName: node + linkType: hard + +"@npmcli/installed-package-contents@npm:^3.0.0": + version: 3.0.0 + resolution: "@npmcli/installed-package-contents@npm:3.0.0" + dependencies: + npm-bundled: "npm:^4.0.0" + npm-normalize-package-bin: "npm:^4.0.0" + bin: + installed-package-contents: bin/index.js + checksum: 10c0/8bb361251cd13b91ae2d04bfcc59b52ffb8cd475d074259c143b3c29a0c4c0ae90d76cfb2cab00ff61cc76bd0c38591b530ce1bdbbc8a61d60ddc6c9ecbf169b + languageName: node + linkType: hard + +"@npmcli/map-workspaces@npm:^4.0.1, @npmcli/map-workspaces@npm:^4.0.2": + version: 4.0.2 + resolution: "@npmcli/map-workspaces@npm:4.0.2" + dependencies: + "@npmcli/name-from-folder": "npm:^3.0.0" + "@npmcli/package-json": "npm:^6.0.0" + glob: "npm:^10.2.2" + minimatch: "npm:^9.0.0" + checksum: 10c0/26af5e5271c52d0986228583218fa04fcea2e0e1052f0c50f5c7941bbfb7be487cc98c2e6732f0a3f515f6d9228d7dc04414f0471f40a33b748e2b4cbb350b86 + languageName: node + linkType: hard + +"@npmcli/metavuln-calculator@npm:^8.0.0": + version: 8.0.1 + resolution: "@npmcli/metavuln-calculator@npm:8.0.1" + dependencies: + cacache: "npm:^19.0.0" + json-parse-even-better-errors: "npm:^4.0.0" + pacote: "npm:^20.0.0" + proc-log: "npm:^5.0.0" + semver: "npm:^7.3.5" + checksum: 10c0/df9407debeda3f260da0630bd2fce29200ee0e83442dcda8c2f548828782893fb92eebe1bf9bfe58bc205f5cd7a1b42c0835354e97be9c41bd04573c1c83e7c3 + languageName: node + linkType: hard + +"@npmcli/name-from-folder@npm:^3.0.0": + version: 3.0.0 + resolution: "@npmcli/name-from-folder@npm:3.0.0" + checksum: 10c0/d6a508c5b4920fb28c752718b906b36fc2374873eba804668afdac8b3c322e8b97a5f1a74f3448d847c615a10828446821d90caf7cdf603d424a9f40f3a733df + languageName: node + linkType: hard + +"@npmcli/node-gyp@npm:^4.0.0": + version: 4.0.0 + resolution: "@npmcli/node-gyp@npm:4.0.0" + checksum: 10c0/58422c2ce0693f519135dd32b5c5bcbb441823f08f9294d5ec19d9a22925ba1a5ec04a1b96f606f2ab09a5f5db56e704f6e201a485198ce9d11fb6b2705e6e79 + languageName: node + linkType: hard + +"@npmcli/package-json@npm:^6.0.0, @npmcli/package-json@npm:^6.0.1, @npmcli/package-json@npm:^6.2.0": + version: 6.2.0 + resolution: "@npmcli/package-json@npm:6.2.0" + dependencies: + "@npmcli/git": "npm:^6.0.0" + glob: "npm:^10.2.2" + hosted-git-info: "npm:^8.0.0" + json-parse-even-better-errors: "npm:^4.0.0" + proc-log: "npm:^5.0.0" + semver: "npm:^7.5.3" + validate-npm-package-license: "npm:^3.0.4" + checksum: 10c0/2bd8345a542a9ecfca9061614ccd191aac1c1b792a4b62a0f99e289280977ea6641897e449b6e206e5e78b1b3cc8fb822c70eb1df7d42763dba00cade80321c8 + languageName: node + linkType: hard + +"@npmcli/promise-spawn@npm:^8.0.0, @npmcli/promise-spawn@npm:^8.0.3": + version: 8.0.3 + resolution: "@npmcli/promise-spawn@npm:8.0.3" + dependencies: + which: "npm:^5.0.0" + checksum: 10c0/596b8f626d3764c761cb931982546b8a94ceedcb6d62884b90118be1b06c7e33b3f5890f4946e29d4b913ec3089384b13c3957d8b58e33ceb6ac4daf786e84a0 + languageName: node + linkType: hard + +"@npmcli/query@npm:^4.0.0": + version: 4.0.1 + resolution: "@npmcli/query@npm:4.0.1" + dependencies: + postcss-selector-parser: "npm:^7.0.0" + checksum: 10c0/ac88b1eb255e00f80be210f8641678a2d695a80b5935e60922fc523d3e19a9e4523accd38b0fa9d9c39a60e6eea3385b4a7161773950896f7e89ebd741dc542b + languageName: node + linkType: hard + +"@npmcli/redact@npm:^3.0.0, @npmcli/redact@npm:^3.2.2": + version: 3.2.2 + resolution: "@npmcli/redact@npm:3.2.2" + checksum: 10c0/4cfb43a5de22114eee40d3ca4f4dc6a4e0f0315e3427938b7e43dfc16684a54844d202b171cee3ec99852eb2ada22fb874a4fe61ad22399fd98897326b1cc7d7 + languageName: node + linkType: hard + +"@npmcli/run-script@npm:^9.0.0, @npmcli/run-script@npm:^9.0.1, @npmcli/run-script@npm:^9.1.0": + version: 9.1.0 + resolution: "@npmcli/run-script@npm:9.1.0" + dependencies: + "@npmcli/node-gyp": "npm:^4.0.0" + "@npmcli/package-json": "npm:^6.0.0" + "@npmcli/promise-spawn": "npm:^8.0.0" + node-gyp: "npm:^11.0.0" + proc-log: "npm:^5.0.0" + which: "npm:^5.0.0" + checksum: 10c0/4ed8eae5c7722c24814473f819d0bfe950f70e876bf9c52e05a61d3e74f2a044386da95e2e171e5a7a81e4c0b144582535addf2510e5decfd7d4aa7ae9e50931 + languageName: node + linkType: hard + +"@octokit/auth-token@npm:^6.0.0": + version: 6.0.0 + resolution: "@octokit/auth-token@npm:6.0.0" + checksum: 10c0/32ecc904c5f6f4e5d090bfcc679d70318690c0a0b5040cd9a25811ad9dcd44c33f2cf96b6dbee1cd56cf58fde28fb1819c01b58718aa5c971f79c822357cb5c0 + languageName: node + linkType: hard + +"@octokit/core@npm:^7.0.0": + version: 7.0.6 + resolution: "@octokit/core@npm:7.0.6" + dependencies: + "@octokit/auth-token": "npm:^6.0.0" + "@octokit/graphql": "npm:^9.0.3" + "@octokit/request": "npm:^10.0.6" + "@octokit/request-error": "npm:^7.0.2" + "@octokit/types": "npm:^16.0.0" + before-after-hook: "npm:^4.0.0" + universal-user-agent: "npm:^7.0.0" + checksum: 10c0/95a328ff7c7223d9eb4aa778c63171828514ae0e0f588d33beb81a4dc03bbeae055382f6060ce23c979ab46272409942ff2cf3172109999e48429c47055b1fbe + languageName: node + linkType: hard + +"@octokit/endpoint@npm:^11.0.3": + version: 11.0.3 + resolution: "@octokit/endpoint@npm:11.0.3" + dependencies: + "@octokit/types": "npm:^16.0.0" + universal-user-agent: "npm:^7.0.2" + checksum: 10c0/3f9b67e6923ece5009aebb0dcbae5837fb574bc422561424049a43ead7fea6f132234edb72239d6ec067cf734937a608e4081af81c109de2cb754528f0d00520 + languageName: node + linkType: hard + +"@octokit/graphql@npm:^9.0.3": + version: 9.0.3 + resolution: "@octokit/graphql@npm:9.0.3" + dependencies: + "@octokit/request": "npm:^10.0.6" + "@octokit/types": "npm:^16.0.0" + universal-user-agent: "npm:^7.0.0" + checksum: 10c0/58588d3fb2834f64244fa5376ca7922a30117b001b621e141fab0d52806370803ab0c046ac99b120fa5f45b770f52a815157fb6ffc147fc6c1da4047c1f1af49 + languageName: node + linkType: hard + +"@octokit/openapi-types@npm:^26.0.0": + version: 26.0.0 + resolution: "@octokit/openapi-types@npm:26.0.0" + checksum: 10c0/671f12c1db70b4bc8c719ec7aa10de034925f4326db0fff22837afcc0b41fd1c015d164673ef5603c5ac787a430c514b821852bfbe6f06edc4a41ad3de342e94 + languageName: node + linkType: hard + +"@octokit/openapi-types@npm:^27.0.0": + version: 27.0.0 + resolution: "@octokit/openapi-types@npm:27.0.0" + checksum: 10c0/602d1de033da180a2e982cdbd3646bd5b2e16ecf36b9955a0f23e37ae9e6cb086abb48ff2ae6f2de000fce03e8ae9051794611ae4a95a8f5f6fb63276e7b8e31 + languageName: node + linkType: hard + +"@octokit/plugin-paginate-rest@npm:^13.0.0": + version: 13.2.1 + resolution: "@octokit/plugin-paginate-rest@npm:13.2.1" + dependencies: + "@octokit/types": "npm:^15.0.1" + peerDependencies: + "@octokit/core": ">=6" + checksum: 10c0/16cd034ee6426f742514d0ca553a2c4355cd68c2eb9211030f3ec2538f4c833d587b3737bb720e34f98be8fae15acb07693d17314350cf067557abb4cb1598fb + languageName: node + linkType: hard + +"@octokit/plugin-retry@npm:^8.0.0": + version: 8.1.0 + resolution: "@octokit/plugin-retry@npm:8.1.0" + dependencies: + "@octokit/request-error": "npm:^7.0.2" + "@octokit/types": "npm:^16.0.0" + bottleneck: "npm:^2.15.3" + peerDependencies: + "@octokit/core": ">=7" + checksum: 10c0/9e10676d29ce642eff8e4f7f9aa2fe6d8c5bebdc5ed107d2e6183be5d50699680b4e1d01a6096d4bec959d2337baf38fd5a39e9d541e9b1a28baf648bc0fefaa + languageName: node + linkType: hard + +"@octokit/plugin-throttling@npm:^11.0.0": + version: 11.0.3 + resolution: "@octokit/plugin-throttling@npm:11.0.3" + dependencies: + "@octokit/types": "npm:^16.0.0" + bottleneck: "npm:^2.15.3" + peerDependencies: + "@octokit/core": ^7.0.0 + checksum: 10c0/5c7cc386962b6d2881ac769f57b28c28622d18e3dbe2f7600dfdfda0a98b56a95f69d831902b647ad023574921cc801b78aa54563fdb3f465ac8c883aaf6cbe3 + languageName: node + linkType: hard + +"@octokit/request-error@npm:^7.0.2": + version: 7.1.0 + resolution: "@octokit/request-error@npm:7.1.0" + dependencies: + "@octokit/types": "npm:^16.0.0" + checksum: 10c0/62b90a54545c36a30b5ffdda42e302c751be184d85b68ffc7f1242c51d7ca54dbd185b7d0027b491991776923a910c85c9c51269fe0d86111bac187507a5abc4 + languageName: node + linkType: hard + +"@octokit/request@npm:^10.0.6": + version: 10.0.8 + resolution: "@octokit/request@npm:10.0.8" + dependencies: + "@octokit/endpoint": "npm:^11.0.3" + "@octokit/request-error": "npm:^7.0.2" + "@octokit/types": "npm:^16.0.0" + fast-content-type-parse: "npm:^3.0.0" + json-with-bigint: "npm:^3.5.3" + universal-user-agent: "npm:^7.0.2" + checksum: 10c0/7ee384dbeb489d4e00856eeaaf6a70060c61b036919c539809c3288e2ba14b8f3f63a5b16b8d5b7fdc93d7b6fa5c45bc3d181a712031279f6e192f019e52d7fe + languageName: node + linkType: hard + +"@octokit/types@npm:^15.0.1": + version: 15.0.2 + resolution: "@octokit/types@npm:15.0.2" + dependencies: + "@octokit/openapi-types": "npm:^26.0.0" + checksum: 10c0/873f8ade7ad21bd01c18a9887cc2098e35a75675b58c09e22ea8b998b664d31e9fecf5c3629381a468e3dcc8115502e1b5b49912a06657b732504de983493c65 + languageName: node + linkType: hard + +"@octokit/types@npm:^16.0.0": + version: 16.0.0 + resolution: "@octokit/types@npm:16.0.0" + dependencies: + "@octokit/openapi-types": "npm:^27.0.0" + checksum: 10c0/b8d41098ba6fc194d13d641f9441347e3a3b96c0efabac0e14f57319340a2d4d1c8676e4cb37ab3062c5c323c617e790b0126916e9bf7b201b0cced0826f8ae2 + languageName: node + linkType: hard + +"@pkgjs/parseargs@npm:^0.11.0": + version: 0.11.0 + resolution: "@pkgjs/parseargs@npm:0.11.0" + checksum: 10c0/5bd7576bb1b38a47a7fc7b51ac9f38748e772beebc56200450c4a817d712232b8f1d3ef70532c80840243c657d491cf6a6be1e3a214cff907645819fdc34aadd + languageName: node + linkType: hard + +"@pnpm/config.env-replace@npm:^1.1.0": + version: 1.1.0 + resolution: "@pnpm/config.env-replace@npm:1.1.0" + checksum: 10c0/4cfc4a5c49ab3d0c6a1f196cfd4146374768b0243d441c7de8fa7bd28eaab6290f514b98490472cc65dbd080d34369447b3e9302585e1d5c099befd7c8b5e55f + languageName: node + linkType: hard + +"@pnpm/network.ca-file@npm:^1.0.1": + version: 1.0.2 + resolution: "@pnpm/network.ca-file@npm:1.0.2" + dependencies: + graceful-fs: "npm:4.2.10" + checksum: 10c0/95f6e0e38d047aca3283550719155ce7304ac00d98911e4ab026daedaf640a63bd83e3d13e17c623fa41ac72f3801382ba21260bcce431c14fbbc06430ecb776 + languageName: node + linkType: hard + +"@pnpm/npm-conf@npm:^3.0.2": + version: 3.0.2 + resolution: "@pnpm/npm-conf@npm:3.0.2" + dependencies: + "@pnpm/config.env-replace": "npm:^1.1.0" + "@pnpm/network.ca-file": "npm:^1.0.1" + config-chain: "npm:^1.1.11" + checksum: 10c0/50026ae4cac7d5d055d4dd4b2886fbc41964db6179406cf2decf625e7a280fbfffd47380df584c085464deba060101169caca5f79e6a062b6c25b527bf60cb67 + languageName: node + linkType: hard + +"@sec-ant/readable-stream@npm:^0.4.1": + version: 0.4.1 + resolution: "@sec-ant/readable-stream@npm:0.4.1" + checksum: 10c0/64e9e9cf161e848067a5bf60cdc04d18495dc28bb63a8d9f8993e4dd99b91ad34e4b563c85de17d91ffb177ec17a0664991d2e115f6543e73236a906068987af + languageName: node + linkType: hard + +"@semantic-release/changelog@npm:^6.0.0": + version: 6.0.3 + resolution: "@semantic-release/changelog@npm:6.0.3" + dependencies: + "@semantic-release/error": "npm:^3.0.0" + aggregate-error: "npm:^3.0.0" + fs-extra: "npm:^11.0.0" + lodash: "npm:^4.17.4" + peerDependencies: + semantic-release: ">=18.0.0" + checksum: 10c0/94c9c287d34fde6d4c6c574869e853dc04180b1d9e6036097d83e0d14783bf5bb8e546fdc4fac2e979d636fa170fd573eaa4265b9d332e436e4813b7aebe7728 + languageName: node + linkType: hard + +"@semantic-release/commit-analyzer@npm:^13.0.0-beta.1": + version: 13.0.1 + resolution: "@semantic-release/commit-analyzer@npm:13.0.1" + dependencies: + conventional-changelog-angular: "npm:^8.0.0" + conventional-changelog-writer: "npm:^8.0.0" + conventional-commits-filter: "npm:^5.0.0" + conventional-commits-parser: "npm:^6.0.0" + debug: "npm:^4.0.0" + import-from-esm: "npm:^2.0.0" + lodash-es: "npm:^4.17.21" + micromatch: "npm:^4.0.2" + peerDependencies: + semantic-release: ">=20.1.0" + checksum: 10c0/5b8f2a083c1de71b19ee795e45bfa07da08a047a62062df7128fb8a1b885c8137ad8502e75b7f788b7cdb631ac3f4da7a9c4f66b7c622065e4d20a292e4c08ab + languageName: node + linkType: hard + +"@semantic-release/error@npm:^3.0.0": + version: 3.0.0 + resolution: "@semantic-release/error@npm:3.0.0" + checksum: 10c0/51f06d11186a6efc543b44996ca1c368a77c6ed18dd823f0362188c37b7ef32f3580bd17654f594e6a72b931ebe69b44bbcb1ee16c755a1d3e44dcb652b47275 + languageName: node + linkType: hard + +"@semantic-release/error@npm:^4.0.0": + version: 4.0.0 + resolution: "@semantic-release/error@npm:4.0.0" + checksum: 10c0/c97fcfbd341765f7c7430bdb32d5f04c61ee15c3eeec374823fbb157640ad03453f24e3a85241bddb29e193b69c6aab480e4d16e76adabb052c01bfbd1698c18 + languageName: node + linkType: hard + +"@semantic-release/exec@npm:^7.0.0": + version: 7.1.0 + resolution: "@semantic-release/exec@npm:7.1.0" + dependencies: + "@semantic-release/error": "npm:^4.0.0" + aggregate-error: "npm:^3.0.0" + debug: "npm:^4.0.0" + execa: "npm:^9.0.0" + lodash-es: "npm:^4.17.21" + parse-json: "npm:^8.0.0" + peerDependencies: + semantic-release: ">=24.1.0" + checksum: 10c0/ee9cbc719d39e669304cd3f9dbd2eb9e4808466581b1815e2a039a5d2fb2d1a02660941bb7ff667c0373cde074a755a48c55daba10191a61e5e7f0020852b8ce + languageName: node + linkType: hard + +"@semantic-release/git@npm:^10.0.0": + version: 10.0.1 + resolution: "@semantic-release/git@npm:10.0.1" + dependencies: + "@semantic-release/error": "npm:^3.0.0" + aggregate-error: "npm:^3.0.0" + debug: "npm:^4.0.0" + dir-glob: "npm:^3.0.0" + execa: "npm:^5.0.0" + lodash: "npm:^4.17.4" + micromatch: "npm:^4.0.0" + p-reduce: "npm:^2.0.0" + peerDependencies: + semantic-release: ">=18.0.0" + checksum: 10c0/90077068b97ff894e5f6bea05d0c7482929d3bae64c242a1556bc85db4d8f0a52b71215300472539b95248778cdf239a3f8cbad5effaaba719a32bf347dbdd93 + languageName: node + linkType: hard + +"@semantic-release/github@npm:^11.0.0": + version: 11.0.6 + resolution: "@semantic-release/github@npm:11.0.6" + dependencies: + "@octokit/core": "npm:^7.0.0" + "@octokit/plugin-paginate-rest": "npm:^13.0.0" + "@octokit/plugin-retry": "npm:^8.0.0" + "@octokit/plugin-throttling": "npm:^11.0.0" + "@semantic-release/error": "npm:^4.0.0" + aggregate-error: "npm:^5.0.0" + debug: "npm:^4.3.4" + dir-glob: "npm:^3.0.1" + http-proxy-agent: "npm:^7.0.0" + https-proxy-agent: "npm:^7.0.0" + issue-parser: "npm:^7.0.0" + lodash-es: "npm:^4.17.21" + mime: "npm:^4.0.0" + p-filter: "npm:^4.0.0" + tinyglobby: "npm:^0.2.14" + url-join: "npm:^5.0.0" + peerDependencies: + semantic-release: ">=24.1.0" + checksum: 10c0/b81448159311d73cc00d65484847f02150e5936d8442493c4917c5b473da2c9064b5d1cb297574d79de642bd495cd8c26d2c633db69ed7db4c8892ad2306e7bf + languageName: node + linkType: hard + +"@semantic-release/npm@npm:^12.0.2": + version: 12.0.2 + resolution: "@semantic-release/npm@npm:12.0.2" + dependencies: + "@semantic-release/error": "npm:^4.0.0" + aggregate-error: "npm:^5.0.0" + execa: "npm:^9.0.0" + fs-extra: "npm:^11.0.0" + lodash-es: "npm:^4.17.21" + nerf-dart: "npm:^1.0.0" + normalize-url: "npm:^8.0.0" + npm: "npm:^10.9.3" + rc: "npm:^1.2.8" + read-pkg: "npm:^9.0.0" + registry-auth-token: "npm:^5.0.0" + semver: "npm:^7.1.2" + tempy: "npm:^3.0.0" + peerDependencies: + semantic-release: ">=20.1.0" + checksum: 10c0/b2dc6bd1c740f00706a72fac1764c7b2c0ada883e5e1fbc7f94f1c534a77fb2e1a5b2ad8d75a7941236e5d1b38f6b22ceab80969d7b6fe3ec4b69340d830e98e + languageName: node + linkType: hard + +"@semantic-release/release-notes-generator@npm:^14.0.0, @semantic-release/release-notes-generator@npm:^14.0.0-beta.1": + version: 14.1.0 + resolution: "@semantic-release/release-notes-generator@npm:14.1.0" + dependencies: + conventional-changelog-angular: "npm:^8.0.0" + conventional-changelog-writer: "npm:^8.0.0" + conventional-commits-filter: "npm:^5.0.0" + conventional-commits-parser: "npm:^6.0.0" + debug: "npm:^4.0.0" + get-stream: "npm:^7.0.0" + import-from-esm: "npm:^2.0.0" + into-stream: "npm:^7.0.0" + lodash-es: "npm:^4.17.21" + read-package-up: "npm:^11.0.0" + peerDependencies: + semantic-release: ">=20.1.0" + checksum: 10c0/6b6bc729274d2f67712a982daee6eb931fcd36377f4bd184ad8c3fcd204a77e77c500f571df1950264a0c43c1d3ce1ec9311a0a2ab90b0ab9fc7b070cd88c495 + languageName: node + linkType: hard + +"@sigstore/bundle@npm:^3.1.0": + version: 3.1.0 + resolution: "@sigstore/bundle@npm:3.1.0" + dependencies: + "@sigstore/protobuf-specs": "npm:^0.4.0" + checksum: 10c0/f34afa3efe81b0925cf1568eeea7678876c5889799fcdf9b81d1062067108e74fc3f3480b0d2b7daa7389f944e4a2523b5fc98d65dbbaa34d206d8c2edc4fa5a + languageName: node + linkType: hard + +"@sigstore/core@npm:^2.0.0": + version: 2.0.0 + resolution: "@sigstore/core@npm:2.0.0" + checksum: 10c0/bb7e668aedcda68312d2ff7c986fd0ba29057ca4dfbaef516c997b0799cd8858b2fc8017a7946fd2e43f237920adbcaa7455097a0a02909ed86cad9f98d592d4 + languageName: node + linkType: hard + +"@sigstore/protobuf-specs@npm:^0.4.0, @sigstore/protobuf-specs@npm:^0.4.1": + version: 0.4.3 + resolution: "@sigstore/protobuf-specs@npm:0.4.3" + checksum: 10c0/a7dbc66d1ff9e4455081a4d4c6b7a47a722072c55991698e2a900d91b7f0cb5ee9e8600b09ae5fd15ad3c6498d02418817f9d110c88b82d3e8edf9848fbf1222 + languageName: node + linkType: hard + +"@sigstore/sign@npm:^3.1.0": + version: 3.1.0 + resolution: "@sigstore/sign@npm:3.1.0" + dependencies: + "@sigstore/bundle": "npm:^3.1.0" + "@sigstore/core": "npm:^2.0.0" + "@sigstore/protobuf-specs": "npm:^0.4.0" + make-fetch-happen: "npm:^14.0.2" + proc-log: "npm:^5.0.0" + promise-retry: "npm:^2.0.1" + checksum: 10c0/7647f3a1350a09d66e7d77fdf8edf6eeb047f818acc2cd06325fc8ec9f0cd654dd25909876147b7ed052d459dc6a1d64e8cbaa44486300b241c3b139d778f254 + languageName: node + linkType: hard + +"@sigstore/tuf@npm:^3.1.0, @sigstore/tuf@npm:^3.1.1": + version: 3.1.1 + resolution: "@sigstore/tuf@npm:3.1.1" + dependencies: + "@sigstore/protobuf-specs": "npm:^0.4.1" + tuf-js: "npm:^3.0.1" + checksum: 10c0/08fdafb45c859cd58ef02e4f28e00a2d74f0c309dca36cf20fda17e55e194a3b7ebcfd9c40197c197d044ae4de0ff5d99b363aaec7cb6cbbf09611afa2661a55 + languageName: node + linkType: hard + +"@sigstore/verify@npm:^2.1.0": + version: 2.1.1 + resolution: "@sigstore/verify@npm:2.1.1" + dependencies: + "@sigstore/bundle": "npm:^3.1.0" + "@sigstore/core": "npm:^2.0.0" + "@sigstore/protobuf-specs": "npm:^0.4.1" + checksum: 10c0/4881d8cd798f7d0c5ffe42b643b950c2a8af1f07c96fc3f3a3409bf5f2221b832d4f018104a12ac8ae0740060ecbb837b99dec058765925d1dcb08ccbd92feb4 + languageName: node + linkType: hard + +"@simple-libs/stream-utils@npm:^1.2.0": + version: 1.2.0 + resolution: "@simple-libs/stream-utils@npm:1.2.0" + checksum: 10c0/2788ac7b167d1b6c81b8c6fae2f5d9688b1f02ab31e9e15b33c9dc2ae920cf7de87869de10679be8957f9adb645c91c8919e271f3e34b6b4ec56daf725522dc7 + languageName: node + linkType: hard + +"@sindresorhus/is@npm:^4.6.0": + version: 4.6.0 + resolution: "@sindresorhus/is@npm:4.6.0" + checksum: 10c0/33b6fb1d0834ec8dd7689ddc0e2781c2bfd8b9c4e4bacbcb14111e0ae00621f2c264b8a7d36541799d74888b5dccdf422a891a5cb5a709ace26325eedc81e22e + languageName: node + linkType: hard + +"@sindresorhus/merge-streams@npm:^4.0.0": + version: 4.0.0 + resolution: "@sindresorhus/merge-streams@npm:4.0.0" + checksum: 10c0/482ee543629aa1933b332f811a1ae805a213681ecdd98c042b1c1b89387df63e7812248bb4df3910b02b3cc5589d3d73e4393f30e197c9dde18046ccd471fc6b + languageName: node + linkType: hard + +"@tufjs/canonical-json@npm:2.0.0": + version: 2.0.0 + resolution: "@tufjs/canonical-json@npm:2.0.0" + checksum: 10c0/52c5ffaef1483ed5c3feedfeba26ca9142fa386eea54464e70ff515bd01c5e04eab05d01eff8c2593291dcaf2397ca7d9c512720e11f52072b04c47a5c279415 + languageName: node + linkType: hard + +"@tufjs/models@npm:3.0.1": + version: 3.0.1 + resolution: "@tufjs/models@npm:3.0.1" + dependencies: + "@tufjs/canonical-json": "npm:2.0.0" + minimatch: "npm:^9.0.5" + checksum: 10c0/0b2022589139102edf28f7fdcd094407fc98ac25bf530ebcf538dd63152baea9b6144b713c8dfc4f6b7580adeff706ab6ecc5f9716c4b816e58a04419abb1926 + languageName: node + linkType: hard + +"@types/normalize-package-data@npm:^2.4.3": + version: 2.4.4 + resolution: "@types/normalize-package-data@npm:2.4.4" + checksum: 10c0/aef7bb9b015883d6f4119c423dd28c4bdc17b0e8a0ccf112c78b4fe0e91fbc4af7c6204b04bba0e199a57d2f3fbbd5b4a14bf8739bf9d2a39b2a0aad545e0f86 + languageName: node + linkType: hard + +"abbrev@npm:^3.0.0, abbrev@npm:^3.0.1": + version: 3.0.1 + resolution: "abbrev@npm:3.0.1" + checksum: 10c0/21ba8f574ea57a3106d6d35623f2c4a9111d9ee3e9a5be47baed46ec2457d2eac46e07a5c4a60186f88cb98abbe3e24f2d4cca70bc2b12f1692523e2209a9ccf + languageName: node + linkType: hard + +"agent-base@npm:^7.1.0, agent-base@npm:^7.1.2": + version: 7.1.4 + resolution: "agent-base@npm:7.1.4" + checksum: 10c0/c2c9ab7599692d594b6a161559ada307b7a624fa4c7b03e3afdb5a5e31cd0e53269115b620fcab024c5ac6a6f37fa5eb2e004f076ad30f5f7e6b8b671f7b35fe + languageName: node + linkType: hard + +"aggregate-error@npm:^3.0.0": + version: 3.1.0 + resolution: "aggregate-error@npm:3.1.0" + dependencies: + clean-stack: "npm:^2.0.0" + indent-string: "npm:^4.0.0" + checksum: 10c0/a42f67faa79e3e6687a4923050e7c9807db3848a037076f791d10e092677d65c1d2d863b7848560699f40fc0502c19f40963fb1cd1fb3d338a7423df8e45e039 + languageName: node + linkType: hard + +"aggregate-error@npm:^5.0.0": + version: 5.0.0 + resolution: "aggregate-error@npm:5.0.0" + dependencies: + clean-stack: "npm:^5.2.0" + indent-string: "npm:^5.0.0" + checksum: 10c0/a5de7138571f514bad76290736f49a0db8809247082f2519037e0c37d03fc8d91d733e079d6b1674feda28a757b1932421ad205b8c0f8794a0c0e5bf1be2315e + languageName: node + linkType: hard + +"ansi-escapes@npm:^7.0.0": + version: 7.3.0 + resolution: "ansi-escapes@npm:7.3.0" + dependencies: + environment: "npm:^1.0.0" + checksum: 10c0/068961d99f0ef28b661a4a9f84a5d645df93ccf3b9b93816cc7d46bbe1913321d4cdf156bb842a4e1e4583b7375c631fa963efb43001c4eb7ff9ab8f78fc0679 + languageName: node + linkType: hard + +"ansi-regex@npm:^5.0.1": + version: 5.0.1 + resolution: "ansi-regex@npm:5.0.1" + checksum: 10c0/9a64bb8627b434ba9327b60c027742e5d17ac69277960d041898596271d992d4d52ba7267a63ca10232e29f6107fc8a835f6ce8d719b88c5f8493f8254813737 + languageName: node + linkType: hard + +"ansi-regex@npm:^6.1.0, ansi-regex@npm:^6.2.2": + version: 6.2.2 + resolution: "ansi-regex@npm:6.2.2" + checksum: 10c0/05d4acb1d2f59ab2cf4b794339c7b168890d44dda4bf0ce01152a8da0213aca207802f930442ce8cd22d7a92f44907664aac6508904e75e038fa944d2601b30f + languageName: node + linkType: hard + +"ansi-styles@npm:^3.2.1": + version: 3.2.1 + resolution: "ansi-styles@npm:3.2.1" + dependencies: + color-convert: "npm:^1.9.0" + checksum: 10c0/ece5a8ef069fcc5298f67e3f4771a663129abd174ea2dfa87923a2be2abf6cd367ef72ac87942da00ce85bd1d651d4cd8595aebdb1b385889b89b205860e977b + languageName: node + linkType: hard + +"ansi-styles@npm:^4.0.0, ansi-styles@npm:^4.1.0": + version: 4.3.0 + resolution: "ansi-styles@npm:4.3.0" + dependencies: + color-convert: "npm:^2.0.1" + checksum: 10c0/895a23929da416f2bd3de7e9cb4eabd340949328ab85ddd6e484a637d8f6820d485f53933446f5291c3b760cbc488beb8e88573dd0f9c7daf83dccc8fe81b041 + languageName: node + linkType: hard + +"ansi-styles@npm:^6.1.0": + version: 6.2.3 + resolution: "ansi-styles@npm:6.2.3" + checksum: 10c0/23b8a4ce14e18fb854693b95351e286b771d23d8844057ed2e7d083cd3e708376c3323707ec6a24365f7d7eda3ca00327fe04092e29e551499ec4c8b7bfac868 + languageName: node + linkType: hard + +"any-promise@npm:^1.0.0": + version: 1.3.0 + resolution: "any-promise@npm:1.3.0" + checksum: 10c0/60f0298ed34c74fef50daab88e8dab786036ed5a7fad02e012ab57e376e0a0b4b29e83b95ea9b5e7d89df762f5f25119b83e00706ecaccb22cfbacee98d74889 + languageName: node + linkType: hard + +"aproba@npm:^2.0.0": + version: 2.1.0 + resolution: "aproba@npm:2.1.0" + checksum: 10c0/ec8c1d351bac0717420c737eb062766fb63bde1552900e0f4fdad9eb064c3824fef23d1c416aa5f7a80f21ca682808e902d79b7c9ae756d342b5f1884f36932f + languageName: node + linkType: hard + +"archy@npm:~1.0.0": + version: 1.0.0 + resolution: "archy@npm:1.0.0" + checksum: 10c0/200c849dd1c304ea9914827b0555e7e1e90982302d574153e28637db1a663c53de62bad96df42d50e8ce7fc18d05e3437d9aa8c4b383803763755f0956c7d308 + languageName: node + linkType: hard + +"argparse@npm:^2.0.1": + version: 2.0.1 + resolution: "argparse@npm:2.0.1" + checksum: 10c0/c5640c2d89045371c7cedd6a70212a04e360fd34d6edeae32f6952c63949e3525ea77dbec0289d8213a99bbaeab5abfa860b5c12cf88a2e6cf8106e90dd27a7e + languageName: node + linkType: hard + +"argv-formatter@npm:~1.0.0": + version: 1.0.0 + resolution: "argv-formatter@npm:1.0.0" + checksum: 10c0/e5582aef98e6b9a70cfe038a3abf6cdd926714b5ce761830bcbd5ac7be86d17ae583fcc8a2cdf4a2ac0b6024ec100b7312160fcefb1520998f476473da6a941d + languageName: node + linkType: hard + +"array-ify@npm:^1.0.0": + version: 1.0.0 + resolution: "array-ify@npm:1.0.0" + checksum: 10c0/75c9c072faac47bd61779c0c595e912fe660d338504ac70d10e39e1b8a4a0c9c87658703d619b9d1b70d324177ae29dc8d07dda0d0a15d005597bc4c5a59c70c + languageName: node + linkType: hard + +"balanced-match@npm:^1.0.0": + version: 1.0.2 + resolution: "balanced-match@npm:1.0.2" + checksum: 10c0/9308baf0a7e4838a82bbfd11e01b1cb0f0cf2893bc1676c27c2a8c0e70cbae1c59120c3268517a8ae7fb6376b4639ef81ca22582611dbee4ed28df945134aaee + languageName: node + linkType: hard + +"before-after-hook@npm:^4.0.0": + version: 4.0.0 + resolution: "before-after-hook@npm:4.0.0" + checksum: 10c0/9f8ae8d1b06142bcfb9ef6625226b5e50348bb11210f266660eddcf9734e0db6f9afc4cb48397ee3f5ac0a3728f3ae401cdeea88413f7bed748a71db84657be2 + languageName: node + linkType: hard + +"bin-links@npm:^5.0.0": + version: 5.0.0 + resolution: "bin-links@npm:5.0.0" + dependencies: + cmd-shim: "npm:^7.0.0" + npm-normalize-package-bin: "npm:^4.0.0" + proc-log: "npm:^5.0.0" + read-cmd-shim: "npm:^5.0.0" + write-file-atomic: "npm:^6.0.0" + checksum: 10c0/7ef087164b13df1810bf087146880a5d43d7d0beb95c51ec0664224f9371e1ca0de70c813306de6de173fb1a3fd0ca49e636ba80c951a70ce6bd7cbf48daf075 + languageName: node + linkType: hard + +"binary-extensions@npm:^2.3.0": + version: 2.3.0 + resolution: "binary-extensions@npm:2.3.0" + checksum: 10c0/75a59cafc10fb12a11d510e77110c6c7ae3f4ca22463d52487709ca7f18f69d886aa387557cc9864fbdb10153d0bdb4caacabf11541f55e89ed6e18d12ece2b5 + languageName: node + linkType: hard + +"bottleneck@npm:^2.15.3": + version: 2.19.5 + resolution: "bottleneck@npm:2.19.5" + checksum: 10c0/b0f72e45b2e0f56a21ba720183f16bef8e693452fb0495d997fa354e42904353a94bd8fd429868e6751bc85e54b6755190519eed5a0ae0a94a5185209ae7c6d0 + languageName: node + linkType: hard + +"brace-expansion@npm:^2.0.2": + version: 2.0.2 + resolution: "brace-expansion@npm:2.0.2" + dependencies: + balanced-match: "npm:^1.0.0" + checksum: 10c0/6d117a4c793488af86b83172deb6af143e94c17bc53b0b3cec259733923b4ca84679d506ac261f4ba3c7ed37c46018e2ff442f9ce453af8643ecd64f4a54e6cf + languageName: node + linkType: hard + +"braces@npm:^3.0.3": + version: 3.0.3 + resolution: "braces@npm:3.0.3" + dependencies: + fill-range: "npm:^7.1.1" + checksum: 10c0/7c6dfd30c338d2997ba77500539227b9d1f85e388a5f43220865201e407e076783d0881f2d297b9f80951b4c957fcf0b51c1d2d24227631643c3f7c284b0aa04 + languageName: node + linkType: hard + +"cacache@npm:^19.0.0, cacache@npm:^19.0.1": + version: 19.0.1 + resolution: "cacache@npm:19.0.1" + dependencies: + "@npmcli/fs": "npm:^4.0.0" + fs-minipass: "npm:^3.0.0" + glob: "npm:^10.2.2" + lru-cache: "npm:^10.0.1" + minipass: "npm:^7.0.3" + minipass-collect: "npm:^2.0.1" + minipass-flush: "npm:^1.0.5" + minipass-pipeline: "npm:^1.2.4" + p-map: "npm:^7.0.2" + ssri: "npm:^12.0.0" + tar: "npm:^7.4.3" + unique-filename: "npm:^4.0.0" + checksum: 10c0/01f2134e1bd7d3ab68be851df96c8d63b492b1853b67f2eecb2c37bb682d37cb70bb858a16f2f0554d3c0071be6dfe21456a1ff6fa4b7eed996570d6a25ffe9c + languageName: node + linkType: hard + +"callsites@npm:^3.0.0": + version: 3.1.0 + resolution: "callsites@npm:3.1.0" + checksum: 10c0/fff92277400eb06c3079f9e74f3af120db9f8ea03bad0e84d9aede54bbe2d44a56cccb5f6cf12211f93f52306df87077ecec5b712794c5a9b5dac6d615a3f301 + languageName: node + linkType: hard + +"chalk@npm:^2.3.2": + version: 2.4.2 + resolution: "chalk@npm:2.4.2" + dependencies: + ansi-styles: "npm:^3.2.1" + escape-string-regexp: "npm:^1.0.5" + supports-color: "npm:^5.3.0" + checksum: 10c0/e6543f02ec877732e3a2d1c3c3323ddb4d39fbab687c23f526e25bd4c6a9bf3b83a696e8c769d078e04e5754921648f7821b2a2acfd16c550435fd630026e073 + languageName: node + linkType: hard + +"chalk@npm:^4.0.0": + version: 4.1.2 + resolution: "chalk@npm:4.1.2" + dependencies: + ansi-styles: "npm:^4.1.0" + supports-color: "npm:^7.1.0" + checksum: 10c0/4a3fef5cc34975c898ffe77141450f679721df9dde00f6c304353fa9c8b571929123b26a0e4617bde5018977eb655b31970c297b91b63ee83bb82aeb04666880 + languageName: node + linkType: hard + +"chalk@npm:^5.4.1, chalk@npm:^5.6.2": + version: 5.6.2 + resolution: "chalk@npm:5.6.2" + checksum: 10c0/99a4b0f0e7991796b1e7e3f52dceb9137cae2a9dfc8fc0784a550dc4c558e15ab32ed70b14b21b52beb2679b4892b41a0aa44249bcb996f01e125d58477c6976 + languageName: node + linkType: hard + +"char-regex@npm:^1.0.2": + version: 1.0.2 + resolution: "char-regex@npm:1.0.2" + checksum: 10c0/57a09a86371331e0be35d9083ba429e86c4f4648ecbe27455dbfb343037c16ee6fdc7f6b61f433a57cc5ded5561d71c56a150e018f40c2ffb7bc93a26dae341e + languageName: node + linkType: hard + +"chownr@npm:^3.0.0": + version: 3.0.0 + resolution: "chownr@npm:3.0.0" + checksum: 10c0/43925b87700f7e3893296c8e9c56cc58f926411cce3a6e5898136daaf08f08b9a8eb76d37d3267e707d0dcc17aed2e2ebdf5848c0c3ce95cf910a919935c1b10 + languageName: node + linkType: hard + +"ci-info@npm:^4.0.0, ci-info@npm:^4.4.0": + version: 4.4.0 + resolution: "ci-info@npm:4.4.0" + checksum: 10c0/44156201545b8dde01aa8a09ee2fe9fc7a73b1bef9adbd4606c9f61c8caeeb73fb7a575c88b0443f7b4edb5ee45debaa59ed54ba5f99698339393ca01349eb3a + languageName: node + linkType: hard + +"cidr-regex@npm:^4.1.1": + version: 4.1.3 + resolution: "cidr-regex@npm:4.1.3" + dependencies: + ip-regex: "npm:^5.0.0" + checksum: 10c0/884c85b886539c20e11eaad379d8e35fb3b98ccead12075283c99a45a9feb4747c778d77f4e3d2ea2cca5a4126d81b57e2b825176c6723778d24b73a8199693d + languageName: node + linkType: hard + +"clean-stack@npm:^2.0.0": + version: 2.2.0 + resolution: "clean-stack@npm:2.2.0" + checksum: 10c0/1f90262d5f6230a17e27d0c190b09d47ebe7efdd76a03b5a1127863f7b3c9aec4c3e6c8bb3a7bbf81d553d56a1fd35728f5a8ef4c63f867ac8d690109742a8c1 + languageName: node + linkType: hard + +"clean-stack@npm:^5.2.0": + version: 5.3.0 + resolution: "clean-stack@npm:5.3.0" + dependencies: + escape-string-regexp: "npm:5.0.0" + checksum: 10c0/1aa8b6772eed1f678a9dcf6e02c74c59f26b6fdad26eaaca1dc6a367ff19c924315836b6143484c2686366758e05396f1ac0f32aaa70481b11d8e23790947ca0 + languageName: node + linkType: hard + +"cli-columns@npm:^4.0.0": + version: 4.0.0 + resolution: "cli-columns@npm:4.0.0" + dependencies: + string-width: "npm:^4.2.3" + strip-ansi: "npm:^6.0.1" + checksum: 10c0/f724c874dba09376f7b2d6c70431d8691d5871bd5d26c6f658dd56b514e668ed5f5b8d803fb7e29f4000fc7f3a6d038d415b892ae7fa3dcd9cc458c07df17871 + languageName: node + linkType: hard + +"cli-highlight@npm:^2.1.11": + version: 2.1.11 + resolution: "cli-highlight@npm:2.1.11" + dependencies: + chalk: "npm:^4.0.0" + highlight.js: "npm:^10.7.1" + mz: "npm:^2.4.0" + parse5: "npm:^5.1.1" + parse5-htmlparser2-tree-adapter: "npm:^6.0.0" + yargs: "npm:^16.0.0" + bin: + highlight: bin/highlight + checksum: 10c0/b5b4af3b968aa9df77eee449a400fbb659cf47c4b03a395370bd98d5554a00afaa5819b41a9a8a1ca0d37b0b896a94e57c65289b37359a25b700b1f56eb04852 + languageName: node + linkType: hard + +"cli-table3@npm:^0.6.5": + version: 0.6.5 + resolution: "cli-table3@npm:0.6.5" + dependencies: + "@colors/colors": "npm:1.5.0" + string-width: "npm:^4.2.0" + dependenciesMeta: + "@colors/colors": + optional: true + checksum: 10c0/d7cc9ed12212ae68241cc7a3133c52b844113b17856e11f4f81308acc3febcea7cc9fd298e70933e294dd642866b29fd5d113c2c098948701d0c35f09455de78 + languageName: node + linkType: hard + +"cliui@npm:^7.0.2": + version: 7.0.4 + resolution: "cliui@npm:7.0.4" + dependencies: + string-width: "npm:^4.2.0" + strip-ansi: "npm:^6.0.0" + wrap-ansi: "npm:^7.0.0" + checksum: 10c0/6035f5daf7383470cef82b3d3db00bec70afb3423538c50394386ffbbab135e26c3689c41791f911fa71b62d13d3863c712fdd70f0fbdffd938a1e6fd09aac00 + languageName: node + linkType: hard + +"cliui@npm:^8.0.1": + version: 8.0.1 + resolution: "cliui@npm:8.0.1" + dependencies: + string-width: "npm:^4.2.0" + strip-ansi: "npm:^6.0.1" + wrap-ansi: "npm:^7.0.0" + checksum: 10c0/4bda0f09c340cbb6dfdc1ed508b3ca080f12992c18d68c6be4d9cf51756033d5266e61ec57529e610dacbf4da1c634423b0c1b11037709cc6b09045cbd815df5 + languageName: node + linkType: hard + +"cmd-shim@npm:^7.0.0": + version: 7.0.0 + resolution: "cmd-shim@npm:7.0.0" + checksum: 10c0/f2a14eccea9d29ac39f5182b416af60b2d4ad13ef96c541580175a394c63192aeaa53a3edfc73c7f988685574623465304b80c417dde4049d6ad7370a78dc792 + languageName: node + linkType: hard + +"color-convert@npm:^1.9.0": + version: 1.9.3 + resolution: "color-convert@npm:1.9.3" + dependencies: + color-name: "npm:1.1.3" + checksum: 10c0/5ad3c534949a8c68fca8fbc6f09068f435f0ad290ab8b2f76841b9e6af7e0bb57b98cb05b0e19fe33f5d91e5a8611ad457e5f69e0a484caad1f7487fd0e8253c + languageName: node + linkType: hard + +"color-convert@npm:^2.0.1": + version: 2.0.1 + resolution: "color-convert@npm:2.0.1" + dependencies: + color-name: "npm:~1.1.4" + checksum: 10c0/37e1150172f2e311fe1b2df62c6293a342ee7380da7b9cfdba67ea539909afbd74da27033208d01d6d5cfc65ee7868a22e18d7e7648e004425441c0f8a15a7d7 + languageName: node + linkType: hard + +"color-name@npm:1.1.3": + version: 1.1.3 + resolution: "color-name@npm:1.1.3" + checksum: 10c0/566a3d42cca25b9b3cd5528cd7754b8e89c0eb646b7f214e8e2eaddb69994ac5f0557d9c175eb5d8f0ad73531140d9c47525085ee752a91a2ab15ab459caf6d6 + languageName: node + linkType: hard + +"color-name@npm:~1.1.4": + version: 1.1.4 + resolution: "color-name@npm:1.1.4" + checksum: 10c0/a1a3f914156960902f46f7f56bc62effc6c94e84b2cae157a526b1c1f74b677a47ec602bf68a61abfa2b42d15b7c5651c6dbe72a43af720bc588dff885b10f95 + languageName: node + linkType: hard + +"common-ancestor-path@npm:^1.0.1": + version: 1.0.1 + resolution: "common-ancestor-path@npm:1.0.1" + checksum: 10c0/390c08d2a67a7a106d39499c002d827d2874966d938012453fd7ca34cd306881e2b9d604f657fa7a8e6e4896d67f39ebc09bf1bfd8da8ff318e0fb7a8752c534 + languageName: node + linkType: hard + +"compare-func@npm:^2.0.0": + version: 2.0.0 + resolution: "compare-func@npm:2.0.0" + dependencies: + array-ify: "npm:^1.0.0" + dot-prop: "npm:^5.1.0" + checksum: 10c0/78bd4dd4ed311a79bd264c9e13c36ed564cde657f1390e699e0f04b8eee1fc06ffb8698ce2dfb5fbe7342d509579c82d4e248f08915b708f77f7b72234086cc3 + languageName: node + linkType: hard + +"config-chain@npm:^1.1.11": + version: 1.1.13 + resolution: "config-chain@npm:1.1.13" + dependencies: + ini: "npm:^1.3.4" + proto-list: "npm:~1.2.1" + checksum: 10c0/39d1df18739d7088736cc75695e98d7087aea43646351b028dfabd5508d79cf6ef4c5bcd90471f52cd87ae470d1c5490c0a8c1a292fbe6ee9ff688061ea0963e + languageName: node + linkType: hard + +"conventional-changelog-angular@npm:^8.0.0": + version: 8.3.0 + resolution: "conventional-changelog-angular@npm:8.3.0" + dependencies: + compare-func: "npm:^2.0.0" + checksum: 10c0/bab87fa741a25e4fb623e2629912a5e592de5ed616398bee0cd9779dc950aae2a78ac48a6f4268cbb5f5544bb33644e01c7b40cea378bb9763ae5304cc22efc2 + languageName: node + linkType: hard + +"conventional-changelog-conventionalcommits@npm:^8.0.0": + version: 8.0.0 + resolution: "conventional-changelog-conventionalcommits@npm:8.0.0" + dependencies: + compare-func: "npm:^2.0.0" + checksum: 10c0/368ee2245094579b38e1beac110577f75d82ab341d1bc6943052d5243f8bacc9ea08222a91a595a17f5f4ccc321b926211da00dd25b43877a3c51d8218bc76f0 + languageName: node + linkType: hard + +"conventional-changelog-writer@npm:^8.0.0": + version: 8.4.0 + resolution: "conventional-changelog-writer@npm:8.4.0" + dependencies: + "@simple-libs/stream-utils": "npm:^1.2.0" + conventional-commits-filter: "npm:^5.0.0" + handlebars: "npm:^4.7.7" + meow: "npm:^13.0.0" + semver: "npm:^7.5.2" + bin: + conventional-changelog-writer: dist/cli/index.js + checksum: 10c0/d657bf74c470e5d515d3a07814d266e6e2aea018e6867bfefa4bc486bb3f948b47b01936d65e46b3090111823364c21c201f9fbe875b1fc805cdf884bb032bc1 + languageName: node + linkType: hard + +"conventional-commits-filter@npm:^5.0.0": + version: 5.0.0 + resolution: "conventional-commits-filter@npm:5.0.0" + checksum: 10c0/678900d6c589bbe1739929071ea0ca89c872b9f3cc6974994726eb7a197ca04243e9ea65cae39a55e41fdc20f27fdfc43060588750d828e0efab41f309a42934 + languageName: node + linkType: hard + +"conventional-commits-parser@npm:^6.0.0": + version: 6.3.0 + resolution: "conventional-commits-parser@npm:6.3.0" + dependencies: + "@simple-libs/stream-utils": "npm:^1.2.0" + meow: "npm:^13.0.0" + bin: + conventional-commits-parser: dist/cli/index.js + checksum: 10c0/7b152db0b63617fb5f993c3422942c05f48ff42fef4350d7e73b1d8a9f24489050b126478f2aabee5e45f205dbd02cb0b486e4bb865f9c0b18c35b4d13952b25 + languageName: node + linkType: hard + +"convert-hrtime@npm:^5.0.0": + version: 5.0.0 + resolution: "convert-hrtime@npm:5.0.0" + checksum: 10c0/2092e51aab205e1141440e84e2a89f8881e68e47c1f8bc168dfd7c67047d8f1db43bac28044bc05749205651fead4e7910f52c7bb6066213480df99e333e9f47 + languageName: node + linkType: hard + +"convertcom-php-sdk-release-tooling@workspace:.": + version: 0.0.0-use.local + resolution: "convertcom-php-sdk-release-tooling@workspace:." + dependencies: + "@semantic-release/changelog": "npm:^6.0.0" + "@semantic-release/exec": "npm:^7.0.0" + "@semantic-release/git": "npm:^10.0.0" + "@semantic-release/release-notes-generator": "npm:^14.0.0" + conventional-changelog-conventionalcommits: "npm:^8.0.0" + conventional-commits-parser: "npm:^6.0.0" + semantic-release: "npm:^24.0.0" + languageName: unknown + linkType: soft + +"core-util-is@npm:~1.0.0": + version: 1.0.3 + resolution: "core-util-is@npm:1.0.3" + checksum: 10c0/90a0e40abbddfd7618f8ccd63a74d88deea94e77d0e8dbbea059fa7ebebb8fbb4e2909667fe26f3a467073de1a542ebe6ae4c73a73745ac5833786759cd906c9 + languageName: node + linkType: hard + +"cosmiconfig@npm:^9.0.0": + version: 9.0.1 + resolution: "cosmiconfig@npm:9.0.1" + dependencies: + env-paths: "npm:^2.2.1" + import-fresh: "npm:^3.3.0" + js-yaml: "npm:^4.1.0" + parse-json: "npm:^5.2.0" + peerDependencies: + typescript: ">=4.9.5" + peerDependenciesMeta: + typescript: + optional: true + checksum: 10c0/a5d4d95599687532ee072bca60170133c24d4e08cd795529e0f22c6ce5fde9409eaf4f26e36e3d671f43270ef858fc68f3c7b0ec28e58fac7ddebda5b7725306 + languageName: node + linkType: hard + +"cross-spawn@npm:^7.0.3, cross-spawn@npm:^7.0.6": + version: 7.0.6 + resolution: "cross-spawn@npm:7.0.6" + dependencies: + path-key: "npm:^3.1.0" + shebang-command: "npm:^2.0.0" + which: "npm:^2.0.1" + checksum: 10c0/053ea8b2135caff68a9e81470e845613e374e7309a47731e81639de3eaeb90c3d01af0e0b44d2ab9d50b43467223b88567dfeb3262db942dc063b9976718ffc1 + languageName: node + linkType: hard + +"crypto-random-string@npm:^4.0.0": + version: 4.0.0 + resolution: "crypto-random-string@npm:4.0.0" + dependencies: + type-fest: "npm:^1.0.1" + checksum: 10c0/16e11a3c8140398f5408b7fded35a961b9423c5dac39a60cbbd08bd3f0e07d7de130e87262adea7db03ec1a7a4b7551054e0db07ee5408b012bac5400cfc07a5 + languageName: node + linkType: hard + +"cssesc@npm:^3.0.0": + version: 3.0.0 + resolution: "cssesc@npm:3.0.0" + bin: + cssesc: bin/cssesc + checksum: 10c0/6bcfd898662671be15ae7827120472c5667afb3d7429f1f917737f3bf84c4176003228131b643ae74543f17a394446247df090c597bb9a728cce298606ed0aa7 + languageName: node + linkType: hard + +"debug@npm:4, debug@npm:^4.0.0, debug@npm:^4.3.4, debug@npm:^4.4.1": + version: 4.4.3 + resolution: "debug@npm:4.4.3" + dependencies: + ms: "npm:^2.1.3" + peerDependenciesMeta: + supports-color: + optional: true + checksum: 10c0/d79136ec6c83ecbefd0f6a5593da6a9c91ec4d7ddc4b54c883d6e71ec9accb5f67a1a5e96d00a328196b5b5c86d365e98d8a3a70856aaf16b4e7b1985e67f5a6 + languageName: node + linkType: hard + +"deep-extend@npm:^0.6.0": + version: 0.6.0 + resolution: "deep-extend@npm:0.6.0" + checksum: 10c0/1c6b0abcdb901e13a44c7d699116d3d4279fdb261983122a3783e7273844d5f2537dc2e1c454a23fcf645917f93fbf8d07101c1d03c015a87faa662755212566 + languageName: node + linkType: hard + +"diff@npm:^5.1.0": + version: 5.2.2 + resolution: "diff@npm:5.2.2" + checksum: 10c0/52da594c54e9033423da26984b1449ae6accd782d5afc4431c9a192a8507ddc83120fe8f925d7220b9da5b5963c7b6f5e46add3660a00cb36df7a13420a09d4b + languageName: node + linkType: hard + +"dir-glob@npm:^3.0.0, dir-glob@npm:^3.0.1": + version: 3.0.1 + resolution: "dir-glob@npm:3.0.1" + dependencies: + path-type: "npm:^4.0.0" + checksum: 10c0/dcac00920a4d503e38bb64001acb19df4efc14536ada475725e12f52c16777afdee4db827f55f13a908ee7efc0cb282e2e3dbaeeb98c0993dd93d1802d3bf00c + languageName: node + linkType: hard + +"dot-prop@npm:^5.1.0": + version: 5.3.0 + resolution: "dot-prop@npm:5.3.0" + dependencies: + is-obj: "npm:^2.0.0" + checksum: 10c0/93f0d343ef87fe8869320e62f2459f7e70f49c6098d948cc47e060f4a3f827d0ad61e83cb82f2bd90cd5b9571b8d334289978a43c0f98fea4f0e99ee8faa0599 + languageName: node + linkType: hard + +"duplexer2@npm:~0.1.0": + version: 0.1.4 + resolution: "duplexer2@npm:0.1.4" + dependencies: + readable-stream: "npm:^2.0.2" + checksum: 10c0/0765a4cc6fe6d9615d43cc6dbccff6f8412811d89a6f6aa44828ca9422a0a469625ce023bf81cee68f52930dbedf9c5716056ff264ac886612702d134b5e39b4 + languageName: node + linkType: hard + +"eastasianwidth@npm:^0.2.0": + version: 0.2.0 + resolution: "eastasianwidth@npm:0.2.0" + checksum: 10c0/26f364ebcdb6395f95124fda411f63137a4bfb5d3a06453f7f23dfe52502905bd84e0488172e0f9ec295fdc45f05c23d5d91baf16bd26f0fe9acd777a188dc39 + languageName: node + linkType: hard + +"emoji-regex@npm:^8.0.0": + version: 8.0.0 + resolution: "emoji-regex@npm:8.0.0" + checksum: 10c0/b6053ad39951c4cf338f9092d7bfba448cdfd46fe6a2a034700b149ac9ffbc137e361cbd3c442297f86bed2e5f7576c1b54cc0a6bf8ef5106cc62f496af35010 + languageName: node + linkType: hard + +"emoji-regex@npm:^9.2.2": + version: 9.2.2 + resolution: "emoji-regex@npm:9.2.2" + checksum: 10c0/af014e759a72064cf66e6e694a7fc6b0ed3d8db680427b021a89727689671cefe9d04151b2cad51dbaf85d5ba790d061cd167f1cf32eb7b281f6368b3c181639 + languageName: node + linkType: hard + +"emojilib@npm:^2.4.0": + version: 2.4.0 + resolution: "emojilib@npm:2.4.0" + checksum: 10c0/6e66ba8921175842193f974e18af448bb6adb0cf7aeea75e08b9d4ea8e9baba0e4a5347b46ed901491dcaba277485891c33a8d70b0560ca5cc9672a94c21ab8f + languageName: node + linkType: hard + +"encoding@npm:^0.1.13": + version: 0.1.13 + resolution: "encoding@npm:0.1.13" + dependencies: + iconv-lite: "npm:^0.6.2" + checksum: 10c0/36d938712ff00fe1f4bac88b43bcffb5930c1efa57bbcdca9d67e1d9d6c57cfb1200fb01efe0f3109b2ce99b231f90779532814a81370a1bd3274a0f58585039 + languageName: node + linkType: hard + +"env-ci@npm:^11.0.0": + version: 11.2.0 + resolution: "env-ci@npm:11.2.0" + dependencies: + execa: "npm:^8.0.0" + java-properties: "npm:^1.0.2" + checksum: 10c0/cc22c947ff9357ea71499e14dc66edd104b0f73697308f6daf5f7d6dfeb04c6da8eb038d651d2a48a0049e8ab8bd9b5be2f82ffc95c7d0529fd9b54abd968668 + languageName: node + linkType: hard + +"env-paths@npm:^2.2.0, env-paths@npm:^2.2.1": + version: 2.2.1 + resolution: "env-paths@npm:2.2.1" + checksum: 10c0/285325677bf00e30845e330eec32894f5105529db97496ee3f598478e50f008c5352a41a30e5e72ec9de8a542b5a570b85699cd63bd2bc646dbcb9f311d83bc4 + languageName: node + linkType: hard + +"environment@npm:^1.0.0": + version: 1.1.0 + resolution: "environment@npm:1.1.0" + checksum: 10c0/fb26434b0b581ab397039e51ff3c92b34924a98b2039dcb47e41b7bca577b9dbf134a8eadb364415c74464b682e2d3afe1a4c0eb9873dc44ea814c5d3103331d + languageName: node + linkType: hard + +"err-code@npm:^2.0.2": + version: 2.0.3 + resolution: "err-code@npm:2.0.3" + checksum: 10c0/b642f7b4dd4a376e954947550a3065a9ece6733ab8e51ad80db727aaae0817c2e99b02a97a3d6cecc648a97848305e728289cf312d09af395403a90c9d4d8a66 + languageName: node + linkType: hard + +"error-ex@npm:^1.3.1": + version: 1.3.4 + resolution: "error-ex@npm:1.3.4" + dependencies: + is-arrayish: "npm:^0.2.1" + checksum: 10c0/b9e34ff4778b8f3b31a8377e1c654456f4c41aeaa3d10a1138c3b7635d8b7b2e03eb2475d46d8ae055c1f180a1063e100bffabf64ea7e7388b37735df5328664 + languageName: node + linkType: hard + +"escalade@npm:^3.1.1": + version: 3.2.0 + resolution: "escalade@npm:3.2.0" + checksum: 10c0/ced4dd3a78e15897ed3be74e635110bbf3b08877b0a41be50dcb325ee0e0b5f65fc2d50e9845194d7c4633f327e2e1c6cce00a71b617c5673df0374201d67f65 + languageName: node + linkType: hard + +"escape-string-regexp@npm:5.0.0": + version: 5.0.0 + resolution: "escape-string-regexp@npm:5.0.0" + checksum: 10c0/6366f474c6f37a802800a435232395e04e9885919873e382b157ab7e8f0feb8fed71497f84a6f6a81a49aab41815522f5839112bd38026d203aea0c91622df95 + languageName: node + linkType: hard + +"escape-string-regexp@npm:^1.0.5": + version: 1.0.5 + resolution: "escape-string-regexp@npm:1.0.5" + checksum: 10c0/a968ad453dd0c2724e14a4f20e177aaf32bb384ab41b674a8454afe9a41c5e6fe8903323e0a1052f56289d04bd600f81278edf140b0fcc02f5cac98d0f5b5371 + languageName: node + linkType: hard + +"execa@npm:^5.0.0": + version: 5.1.1 + resolution: "execa@npm:5.1.1" + dependencies: + cross-spawn: "npm:^7.0.3" + get-stream: "npm:^6.0.0" + human-signals: "npm:^2.1.0" + is-stream: "npm:^2.0.0" + merge-stream: "npm:^2.0.0" + npm-run-path: "npm:^4.0.1" + onetime: "npm:^5.1.2" + signal-exit: "npm:^3.0.3" + strip-final-newline: "npm:^2.0.0" + checksum: 10c0/c8e615235e8de4c5addf2fa4c3da3e3aa59ce975a3e83533b4f6a71750fb816a2e79610dc5f1799b6e28976c9ae86747a36a606655bf8cb414a74d8d507b304f + languageName: node + linkType: hard + +"execa@npm:^8.0.0": + version: 8.0.1 + resolution: "execa@npm:8.0.1" + dependencies: + cross-spawn: "npm:^7.0.3" + get-stream: "npm:^8.0.1" + human-signals: "npm:^5.0.0" + is-stream: "npm:^3.0.0" + merge-stream: "npm:^2.0.0" + npm-run-path: "npm:^5.1.0" + onetime: "npm:^6.0.0" + signal-exit: "npm:^4.1.0" + strip-final-newline: "npm:^3.0.0" + checksum: 10c0/2c52d8775f5bf103ce8eec9c7ab3059909ba350a5164744e9947ed14a53f51687c040a250bda833f906d1283aa8803975b84e6c8f7a7c42f99dc8ef80250d1af + languageName: node + linkType: hard + +"execa@npm:^9.0.0": + version: 9.6.1 + resolution: "execa@npm:9.6.1" + dependencies: + "@sindresorhus/merge-streams": "npm:^4.0.0" + cross-spawn: "npm:^7.0.6" + figures: "npm:^6.1.0" + get-stream: "npm:^9.0.0" + human-signals: "npm:^8.0.1" + is-plain-obj: "npm:^4.1.0" + is-stream: "npm:^4.0.1" + npm-run-path: "npm:^6.0.0" + pretty-ms: "npm:^9.2.0" + signal-exit: "npm:^4.1.0" + strip-final-newline: "npm:^4.0.0" + yoctocolors: "npm:^2.1.1" + checksum: 10c0/636b36585306a3c8bc3a9d7b25d2d915fb06d8c9b9b02a804280d62562de3b34535affc1b7702b039320e0953daa6545a073f3c4b63fe974c1fe11336c56b467 + languageName: node + linkType: hard + +"exponential-backoff@npm:^3.1.1": + version: 3.1.3 + resolution: "exponential-backoff@npm:3.1.3" + checksum: 10c0/77e3ae682b7b1f4972f563c6dbcd2b0d54ac679e62d5d32f3e5085feba20483cf28bd505543f520e287a56d4d55a28d7874299941faf637e779a1aa5994d1267 + languageName: node + linkType: hard + +"fast-content-type-parse@npm:^3.0.0": + version: 3.0.0 + resolution: "fast-content-type-parse@npm:3.0.0" + checksum: 10c0/06251880c83b7118af3a5e66e8bcee60d44f48b39396fc60acc2b4630bd5f3e77552b999b5c8e943d45a818854360e5e97164c374ec4b562b4df96a2cdf2e188 + languageName: node + linkType: hard + +"fastest-levenshtein@npm:^1.0.16": + version: 1.0.16 + resolution: "fastest-levenshtein@npm:1.0.16" + checksum: 10c0/7e3d8ae812a7f4fdf8cad18e9cde436a39addf266a5986f653ea0d81e0de0900f50c0f27c6d5aff3f686bcb48acbd45be115ae2216f36a6a13a7dbbf5cad878b + languageName: node + linkType: hard + +"fdir@npm:^6.5.0": + version: 6.5.0 + resolution: "fdir@npm:6.5.0" + peerDependencies: + picomatch: ^3 || ^4 + peerDependenciesMeta: + picomatch: + optional: true + checksum: 10c0/e345083c4306b3aed6cb8ec551e26c36bab5c511e99ea4576a16750ddc8d3240e63826cc624f5ae17ad4dc82e68a253213b60d556c11bfad064b7607847ed07f + languageName: node + linkType: hard + +"figures@npm:^2.0.0": + version: 2.0.0 + resolution: "figures@npm:2.0.0" + dependencies: + escape-string-regexp: "npm:^1.0.5" + checksum: 10c0/5dc5a75fec3e7e04ae65d6ce51d28b3e70d4656c51b06996b6fdb2cb5b542df512e3b3c04482f5193a964edddafa5521479ff948fa84e12ff556e53e094ab4ce + languageName: node + linkType: hard + +"figures@npm:^6.0.0, figures@npm:^6.1.0": + version: 6.1.0 + resolution: "figures@npm:6.1.0" + dependencies: + is-unicode-supported: "npm:^2.0.0" + checksum: 10c0/9159df4264d62ef447a3931537de92f5012210cf5135c35c010df50a2169377581378149abfe1eb238bd6acbba1c0d547b1f18e0af6eee49e30363cedaffcfe4 + languageName: node + linkType: hard + +"fill-range@npm:^7.1.1": + version: 7.1.1 + resolution: "fill-range@npm:7.1.1" + dependencies: + to-regex-range: "npm:^5.0.1" + checksum: 10c0/b75b691bbe065472f38824f694c2f7449d7f5004aa950426a2c28f0306c60db9b880c0b0e4ed819997ffb882d1da02cfcfc819bddc94d71627f5269682edf018 + languageName: node + linkType: hard + +"find-up-simple@npm:^1.0.0": + version: 1.0.1 + resolution: "find-up-simple@npm:1.0.1" + checksum: 10c0/ad34de157b7db925d50ff78302fefb28e309f3bc947c93ffca0f9b0bccf9cf1a2dc57d805d5c94ec9fc60f4838f5dbdfd2a48ecd77c23015fa44c6dd5f60bc40 + languageName: node + linkType: hard + +"find-up@npm:^2.0.0": + version: 2.1.0 + resolution: "find-up@npm:2.1.0" + dependencies: + locate-path: "npm:^2.0.0" + checksum: 10c0/c080875c9fe28eb1962f35cbe83c683796a0321899f1eed31a37577800055539815de13d53495049697d3ba313013344f843bb9401dd337a1b832be5edfc6840 + languageName: node + linkType: hard + +"find-versions@npm:^6.0.0": + version: 6.0.0 + resolution: "find-versions@npm:6.0.0" + dependencies: + semver-regex: "npm:^4.0.5" + super-regex: "npm:^1.0.0" + checksum: 10c0/1e38da3058f389c8657cd6f47fbcf12412051e7d2d14017594b8ca54ec239d19058f2d9dde80f27415726ab62822e32e3ed0a81141cfc206a3b8c8f0d87a5732 + languageName: node + linkType: hard + +"foreground-child@npm:^3.1.0": + version: 3.3.1 + resolution: "foreground-child@npm:3.3.1" + dependencies: + cross-spawn: "npm:^7.0.6" + signal-exit: "npm:^4.0.1" + checksum: 10c0/8986e4af2430896e65bc2788d6679067294d6aee9545daefc84923a0a4b399ad9c7a3ea7bd8c0b2b80fdf4a92de4c69df3f628233ff3224260e9c1541a9e9ed3 + languageName: node + linkType: hard + +"from2@npm:^2.3.0": + version: 2.3.0 + resolution: "from2@npm:2.3.0" + dependencies: + inherits: "npm:^2.0.1" + readable-stream: "npm:^2.0.0" + checksum: 10c0/f87f7a2e4513244d551454a7f8324ef1f7837864a8701c536417286ec19ff4915606b1dfa8909a21b7591ebd8440ffde3642f7c303690b9a4d7c832d62248aa1 + languageName: node + linkType: hard + +"fs-extra@npm:^11.0.0": + version: 11.3.4 + resolution: "fs-extra@npm:11.3.4" + dependencies: + graceful-fs: "npm:^4.2.0" + jsonfile: "npm:^6.0.1" + universalify: "npm:^2.0.0" + checksum: 10c0/e08276f767a62496ae97d711aaa692c6a478177f24a85979b6a2881c9db9c68b8c2ad5da0bcf92c0b2a474cea6e935ec245656441527958fd8372cb647087df0 + languageName: node + linkType: hard + +"fs-minipass@npm:^3.0.0, fs-minipass@npm:^3.0.3": + version: 3.0.3 + resolution: "fs-minipass@npm:3.0.3" + dependencies: + minipass: "npm:^7.0.3" + checksum: 10c0/63e80da2ff9b621e2cb1596abcb9207f1cf82b968b116ccd7b959e3323144cce7fb141462200971c38bbf2ecca51695069db45265705bed09a7cd93ae5b89f94 + languageName: node + linkType: hard + +"function-timeout@npm:^1.0.1": + version: 1.0.2 + resolution: "function-timeout@npm:1.0.2" + checksum: 10c0/75d7ac6c83c450b84face2c9d22307b00e10c7376aa3a34c7be260853582c5e4c502904e2f6bf1d4500c4052e748e001388f6bbd9d34ebfdfb6c4fec2169d0ff + languageName: node + linkType: hard + +"get-caller-file@npm:^2.0.5": + version: 2.0.5 + resolution: "get-caller-file@npm:2.0.5" + checksum: 10c0/c6c7b60271931fa752aeb92f2b47e355eac1af3a2673f47c9589e8f8a41adc74d45551c1bc57b5e66a80609f10ffb72b6f575e4370d61cc3f7f3aaff01757cde + languageName: node + linkType: hard + +"get-stream@npm:^6.0.0": + version: 6.0.1 + resolution: "get-stream@npm:6.0.1" + checksum: 10c0/49825d57d3fd6964228e6200a58169464b8e8970489b3acdc24906c782fb7f01f9f56f8e6653c4a50713771d6658f7cfe051e5eb8c12e334138c9c918b296341 + languageName: node + linkType: hard + +"get-stream@npm:^7.0.0": + version: 7.0.1 + resolution: "get-stream@npm:7.0.1" + checksum: 10c0/d0e34acd2f65c80ec2bef1f8add0c36bd4819d06aedd221eba59382d314ae980ae25b68e0000145798a6f7e2f541417f78b44fdc2a3eb942b2b28cfcce69cc71 + languageName: node + linkType: hard + +"get-stream@npm:^8.0.1": + version: 8.0.1 + resolution: "get-stream@npm:8.0.1" + checksum: 10c0/5c2181e98202b9dae0bb4a849979291043e5892eb40312b47f0c22b9414fc9b28a3b6063d2375705eb24abc41ecf97894d9a51f64ff021511b504477b27b4290 + languageName: node + linkType: hard + +"get-stream@npm:^9.0.0": + version: 9.0.1 + resolution: "get-stream@npm:9.0.1" + dependencies: + "@sec-ant/readable-stream": "npm:^0.4.1" + is-stream: "npm:^4.0.1" + checksum: 10c0/d70e73857f2eea1826ac570c3a912757dcfbe8a718a033fa0c23e12ac8e7d633195b01710e0559af574cbb5af101009b42df7b6f6b29ceec8dbdf7291931b948 + languageName: node + linkType: hard + +"git-log-parser@npm:^1.2.0": + version: 1.2.1 + resolution: "git-log-parser@npm:1.2.1" + dependencies: + argv-formatter: "npm:~1.0.0" + spawn-error-forwarder: "npm:~1.0.0" + split2: "npm:~1.0.0" + stream-combiner2: "npm:~1.1.1" + through2: "npm:~2.0.0" + traverse: "npm:0.6.8" + checksum: 10c0/8b35e5a4882a481164b1999a062141063645246152eedab4587f4efaf0c61a4964da6cb1891263e92bc1b91edf0850843a06b6cf88a389a7c6a66c1be67ead4f + languageName: node + linkType: hard + +"glob@npm:^10.2.2, glob@npm:^10.5.0": + version: 10.5.0 + resolution: "glob@npm:10.5.0" + dependencies: + foreground-child: "npm:^3.1.0" + jackspeak: "npm:^3.1.2" + minimatch: "npm:^9.0.4" + minipass: "npm:^7.1.2" + package-json-from-dist: "npm:^1.0.0" + path-scurry: "npm:^1.11.1" + bin: + glob: dist/esm/bin.mjs + checksum: 10c0/100705eddbde6323e7b35e1d1ac28bcb58322095bd8e63a7d0bef1a2cdafe0d0f7922a981b2b48369a4f8c1b077be5c171804534c3509dfe950dde15fbe6d828 + languageName: node + linkType: hard + +"graceful-fs@npm:4.2.10": + version: 4.2.10 + resolution: "graceful-fs@npm:4.2.10" + checksum: 10c0/4223a833e38e1d0d2aea630c2433cfb94ddc07dfc11d511dbd6be1d16688c5be848acc31f9a5d0d0ddbfb56d2ee5a6ae0278aceeb0ca6a13f27e06b9956fb952 + languageName: node + linkType: hard + +"graceful-fs@npm:^4.1.2, graceful-fs@npm:^4.1.6, graceful-fs@npm:^4.2.0, graceful-fs@npm:^4.2.11, graceful-fs@npm:^4.2.6": + version: 4.2.11 + resolution: "graceful-fs@npm:4.2.11" + checksum: 10c0/386d011a553e02bc594ac2ca0bd6d9e4c22d7fa8cfbfc448a6d148c59ea881b092db9dbe3547ae4b88e55f1b01f7c4a2ecc53b310c042793e63aa44cf6c257f2 + languageName: node + linkType: hard + +"handlebars@npm:^4.7.7": + version: 4.7.8 + resolution: "handlebars@npm:4.7.8" + dependencies: + minimist: "npm:^1.2.5" + neo-async: "npm:^2.6.2" + source-map: "npm:^0.6.1" + uglify-js: "npm:^3.1.4" + wordwrap: "npm:^1.0.0" + dependenciesMeta: + uglify-js: + optional: true + bin: + handlebars: bin/handlebars + checksum: 10c0/7aff423ea38a14bb379316f3857fe0df3c5d66119270944247f155ba1f08e07a92b340c58edaa00cfe985c21508870ee5183e0634dcb53dd405f35c93ef7f10d + languageName: node + linkType: hard + +"has-flag@npm:^3.0.0": + version: 3.0.0 + resolution: "has-flag@npm:3.0.0" + checksum: 10c0/1c6c83b14b8b1b3c25b0727b8ba3e3b647f99e9e6e13eb7322107261de07a4c1be56fc0d45678fc376e09772a3a1642ccdaf8fc69bdf123b6c086598397ce473 + languageName: node + linkType: hard + +"has-flag@npm:^4.0.0": + version: 4.0.0 + resolution: "has-flag@npm:4.0.0" + checksum: 10c0/2e789c61b7888d66993e14e8331449e525ef42aac53c627cc53d1c3334e768bcb6abdc4f5f0de1478a25beec6f0bd62c7549058b7ac53e924040d4f301f02fd1 + languageName: node + linkType: hard + +"highlight.js@npm:^10.7.1": + version: 10.7.3 + resolution: "highlight.js@npm:10.7.3" + checksum: 10c0/073837eaf816922427a9005c56c42ad8786473dc042332dfe7901aa065e92bc3d94ebf704975257526482066abb2c8677cc0326559bb8621e046c21c5991c434 + languageName: node + linkType: hard + +"hook-std@npm:^4.0.0": + version: 4.0.0 + resolution: "hook-std@npm:4.0.0" + checksum: 10c0/d7358c5495d56a1ded58438b8d5c9bfa4896118c7734fb4ac5a5f823b5252ac219b334c0003113cbda12d024f6a178b00fd68bc4c4f756f6a5347b8be1cf814b + languageName: node + linkType: hard + +"hosted-git-info@npm:^7.0.0": + version: 7.0.2 + resolution: "hosted-git-info@npm:7.0.2" + dependencies: + lru-cache: "npm:^10.0.1" + checksum: 10c0/b19dbd92d3c0b4b0f1513cf79b0fc189f54d6af2129eeb201de2e9baaa711f1936929c848b866d9c8667a0f956f34bf4f07418c12be1ee9ca74fd9246335ca1f + languageName: node + linkType: hard + +"hosted-git-info@npm:^8.0.0, hosted-git-info@npm:^8.1.0": + version: 8.1.0 + resolution: "hosted-git-info@npm:8.1.0" + dependencies: + lru-cache: "npm:^10.0.1" + checksum: 10c0/53cc838ecaa7d4aa69a81d9d8edc362c9d415f67b76ad38cdd781d2a2f5b45ad0aa9f9b013fb4ea54a9f64fd2365d0b6386b5a24bdf4cb90c80477cf3175aaa2 + languageName: node + linkType: hard + +"http-cache-semantics@npm:^4.1.1": + version: 4.2.0 + resolution: "http-cache-semantics@npm:4.2.0" + checksum: 10c0/45b66a945cf13ec2d1f29432277201313babf4a01d9e52f44b31ca923434083afeca03f18417f599c9ab3d0e7b618ceb21257542338b57c54b710463b4a53e37 + languageName: node + linkType: hard + +"http-proxy-agent@npm:^7.0.0": + version: 7.0.2 + resolution: "http-proxy-agent@npm:7.0.2" + dependencies: + agent-base: "npm:^7.1.0" + debug: "npm:^4.3.4" + checksum: 10c0/4207b06a4580fb85dd6dff521f0abf6db517489e70863dca1a0291daa7f2d3d2d6015a57bd702af068ea5cf9f1f6ff72314f5f5b4228d299c0904135d2aef921 + languageName: node + linkType: hard + +"https-proxy-agent@npm:^7.0.0, https-proxy-agent@npm:^7.0.1": + version: 7.0.6 + resolution: "https-proxy-agent@npm:7.0.6" + dependencies: + agent-base: "npm:^7.1.2" + debug: "npm:4" + checksum: 10c0/f729219bc735edb621fa30e6e84e60ee5d00802b8247aac0d7b79b0bd6d4b3294737a337b93b86a0bd9e68099d031858a39260c976dc14cdbba238ba1f8779ac + languageName: node + linkType: hard + +"human-signals@npm:^2.1.0": + version: 2.1.0 + resolution: "human-signals@npm:2.1.0" + checksum: 10c0/695edb3edfcfe9c8b52a76926cd31b36978782062c0ed9b1192b36bebc75c4c87c82e178dfcb0ed0fc27ca59d434198aac0bd0be18f5781ded775604db22304a + languageName: node + linkType: hard + +"human-signals@npm:^5.0.0": + version: 5.0.0 + resolution: "human-signals@npm:5.0.0" + checksum: 10c0/5a9359073fe17a8b58e5a085e9a39a950366d9f00217c4ff5878bd312e09d80f460536ea6a3f260b5943a01fe55c158d1cea3fc7bee3d0520aeef04f6d915c82 + languageName: node + linkType: hard + +"human-signals@npm:^8.0.1": + version: 8.0.1 + resolution: "human-signals@npm:8.0.1" + checksum: 10c0/195ac607108c56253757717242e17cd2e21b29f06c5d2dad362e86c672bf2d096e8a3bbb2601841c376c2301c4ae7cff129e87f740aa4ebff1390c163114c7c4 + languageName: node + linkType: hard + +"iconv-lite@npm:^0.6.2": + version: 0.6.3 + resolution: "iconv-lite@npm:0.6.3" + dependencies: + safer-buffer: "npm:>= 2.1.2 < 3.0.0" + checksum: 10c0/98102bc66b33fcf5ac044099d1257ba0b7ad5e3ccd3221f34dd508ab4070edff183276221684e1e0555b145fce0850c9f7d2b60a9fcac50fbb4ea0d6e845a3b1 + languageName: node + linkType: hard + +"ignore-walk@npm:^7.0.0": + version: 7.0.0 + resolution: "ignore-walk@npm:7.0.0" + dependencies: + minimatch: "npm:^9.0.0" + checksum: 10c0/3754bcde369a53a92c1d0835ea93feb6c5b2934984d3f5a8f9dd962d13ac33ee3a9e930901a89b5d46fc061870639d983f497186afdfe3484e135f2ad89f5577 + languageName: node + linkType: hard + +"import-fresh@npm:^3.3.0": + version: 3.3.1 + resolution: "import-fresh@npm:3.3.1" + dependencies: + parent-module: "npm:^1.0.0" + resolve-from: "npm:^4.0.0" + checksum: 10c0/bf8cc494872fef783249709385ae883b447e3eb09db0ebd15dcead7d9afe7224dad7bd7591c6b73b0b19b3c0f9640eb8ee884f01cfaf2887ab995b0b36a0cbec + languageName: node + linkType: hard + +"import-from-esm@npm:^2.0.0": + version: 2.0.0 + resolution: "import-from-esm@npm:2.0.0" + dependencies: + debug: "npm:^4.3.4" + import-meta-resolve: "npm:^4.0.0" + checksum: 10c0/6ee85521a1b540927c50f9f16c4f1fc25fa0383c16740483b5ba838d8deea8f5e7a30b6a9f6dff28292589317e679a07da8fa63890a0fd2e549a51e9d28a66fd + languageName: node + linkType: hard + +"import-meta-resolve@npm:^4.0.0": + version: 4.2.0 + resolution: "import-meta-resolve@npm:4.2.0" + checksum: 10c0/3ee8aeecb61d19b49d2703987f977e9d1c7d4ba47db615a570eaa02fe414f40dfa63f7b953e842cbe8470d26df6371332bfcf21b2fd92b0112f9fea80dde2c4c + languageName: node + linkType: hard + +"imurmurhash@npm:^0.1.4": + version: 0.1.4 + resolution: "imurmurhash@npm:0.1.4" + checksum: 10c0/8b51313850dd33605c6c9d3fd9638b714f4c4c40250cff658209f30d40da60f78992fb2df5dabee4acf589a6a82bbc79ad5486550754bd9ec4e3fc0d4a57d6a6 + languageName: node + linkType: hard + +"indent-string@npm:^4.0.0": + version: 4.0.0 + resolution: "indent-string@npm:4.0.0" + checksum: 10c0/1e1904ddb0cb3d6cce7cd09e27a90184908b7a5d5c21b92e232c93579d314f0b83c246ffb035493d0504b1e9147ba2c9b21df0030f48673fba0496ecd698161f + languageName: node + linkType: hard + +"indent-string@npm:^5.0.0": + version: 5.0.0 + resolution: "indent-string@npm:5.0.0" + checksum: 10c0/8ee77b57d92e71745e133f6f444d6fa3ed503ad0e1bcd7e80c8da08b42375c07117128d670589725ed07b1978065803fa86318c309ba45415b7fe13e7f170220 + languageName: node + linkType: hard + +"index-to-position@npm:^1.1.0": + version: 1.2.0 + resolution: "index-to-position@npm:1.2.0" + checksum: 10c0/d7ac9fae9fad1d7fbeb7bd92e1553b26e8b10522c2d80af5c362828428a41360e21fc5915d7b8c8227eb0f0d37b12099846ac77381a04d6c0059eb81749e374d + languageName: node + linkType: hard + +"inherits@npm:^2.0.1, inherits@npm:~2.0.3": + version: 2.0.4 + resolution: "inherits@npm:2.0.4" + checksum: 10c0/4e531f648b29039fb7426fb94075e6545faa1eb9fe83c29f0b6d9e7263aceb4289d2d4557db0d428188eeb449cc7c5e77b0a0b2c4e248ff2a65933a0dee49ef2 + languageName: node + linkType: hard + +"ini@npm:^1.3.4, ini@npm:~1.3.0": + version: 1.3.8 + resolution: "ini@npm:1.3.8" + checksum: 10c0/ec93838d2328b619532e4f1ff05df7909760b6f66d9c9e2ded11e5c1897d6f2f9980c54dd638f88654b00919ce31e827040631eab0a3969e4d1abefa0719516a + languageName: node + linkType: hard + +"ini@npm:^5.0.0": + version: 5.0.0 + resolution: "ini@npm:5.0.0" + checksum: 10c0/657491ce766cbb4b335ab221ee8f72b9654d9f0e35c32fe5ff2eb7ab8c5ce72237ff6456555b50cde88e6507a719a70e28e327b450782b4fc20c90326ec8c1a8 + languageName: node + linkType: hard + +"init-package-json@npm:^7.0.2": + version: 7.0.2 + resolution: "init-package-json@npm:7.0.2" + dependencies: + "@npmcli/package-json": "npm:^6.0.0" + npm-package-arg: "npm:^12.0.0" + promzard: "npm:^2.0.0" + read: "npm:^4.0.0" + semver: "npm:^7.3.5" + validate-npm-package-license: "npm:^3.0.4" + validate-npm-package-name: "npm:^6.0.0" + checksum: 10c0/258860a3a41abd2dcb83727e234dd2f2f56d0b30191e6fa8dd424b83d5127a44330d6e97573cbe8df7582ab76d1b3da4090008b38f06003403988a5e5101fd6b + languageName: node + linkType: hard + +"into-stream@npm:^7.0.0": + version: 7.0.0 + resolution: "into-stream@npm:7.0.0" + dependencies: + from2: "npm:^2.3.0" + p-is-promise: "npm:^3.0.0" + checksum: 10c0/ac6975c0029bf969931781ab1534996b35068f5d51ccd55a00b601e2fc638cf040a42c9fb8e3c8f320509af9a56c9b11da8f1159f76db3ed8096779cce618c95 + languageName: node + linkType: hard + +"ip-address@npm:^10.0.1": + version: 10.1.0 + resolution: "ip-address@npm:10.1.0" + checksum: 10c0/0103516cfa93f6433b3bd7333fa876eb21263912329bfa47010af5e16934eeeff86f3d2ae700a3744a137839ddfad62b900c7a445607884a49b5d1e32a3d7566 + languageName: node + linkType: hard + +"ip-regex@npm:^5.0.0": + version: 5.0.0 + resolution: "ip-regex@npm:5.0.0" + checksum: 10c0/23f07cf393436627b3a91f7121eee5bc831522d07c95ddd13f5a6f7757698b08551480f12e5dbb3bf248724da135d54405c9687733dba7314f74efae593bdf06 + languageName: node + linkType: hard + +"is-arrayish@npm:^0.2.1": + version: 0.2.1 + resolution: "is-arrayish@npm:0.2.1" + checksum: 10c0/e7fb686a739068bb70f860b39b67afc62acc62e36bb61c5f965768abce1873b379c563e61dd2adad96ebb7edf6651111b385e490cf508378959b0ed4cac4e729 + languageName: node + linkType: hard + +"is-cidr@npm:^5.1.1": + version: 5.1.1 + resolution: "is-cidr@npm:5.1.1" + dependencies: + cidr-regex: "npm:^4.1.1" + checksum: 10c0/79624e7a778f3b9f7d9d22e258b3dce6552d47a094663f038d40dfa12df4855b951087257e658602735814c1046d432710e94fda707040e2a43c57e18909742d + languageName: node + linkType: hard + +"is-fullwidth-code-point@npm:^3.0.0": + version: 3.0.0 + resolution: "is-fullwidth-code-point@npm:3.0.0" + checksum: 10c0/bb11d825e049f38e04c06373a8d72782eee0205bda9d908cc550ccb3c59b99d750ff9537982e01733c1c94a58e35400661f57042158ff5e8f3e90cf936daf0fc + languageName: node + linkType: hard + +"is-number@npm:^7.0.0": + version: 7.0.0 + resolution: "is-number@npm:7.0.0" + checksum: 10c0/b4686d0d3053146095ccd45346461bc8e53b80aeb7671cc52a4de02dbbf7dc0d1d2a986e2fe4ae206984b4d34ef37e8b795ebc4f4295c978373e6575e295d811 + languageName: node + linkType: hard + +"is-obj@npm:^2.0.0": + version: 2.0.0 + resolution: "is-obj@npm:2.0.0" + checksum: 10c0/85044ed7ba8bd169e2c2af3a178cacb92a97aa75de9569d02efef7f443a824b5e153eba72b9ae3aca6f8ce81955271aa2dc7da67a8b720575d3e38104208cb4e + languageName: node + linkType: hard + +"is-plain-obj@npm:^4.1.0": + version: 4.1.0 + resolution: "is-plain-obj@npm:4.1.0" + checksum: 10c0/32130d651d71d9564dc88ba7e6fda0e91a1010a3694648e9f4f47bb6080438140696d3e3e15c741411d712e47ac9edc1a8a9de1fe76f3487b0d90be06ac9975e + languageName: node + linkType: hard + +"is-stream@npm:^2.0.0": + version: 2.0.1 + resolution: "is-stream@npm:2.0.1" + checksum: 10c0/7c284241313fc6efc329b8d7f08e16c0efeb6baab1b4cd0ba579eb78e5af1aa5da11e68559896a2067cd6c526bd29241dda4eb1225e627d5aa1a89a76d4635a5 + languageName: node + linkType: hard + +"is-stream@npm:^3.0.0": + version: 3.0.0 + resolution: "is-stream@npm:3.0.0" + checksum: 10c0/eb2f7127af02ee9aa2a0237b730e47ac2de0d4e76a4a905a50a11557f2339df5765eaea4ceb8029f1efa978586abe776908720bfcb1900c20c6ec5145f6f29d8 + languageName: node + linkType: hard + +"is-stream@npm:^4.0.1": + version: 4.0.1 + resolution: "is-stream@npm:4.0.1" + checksum: 10c0/2706c7f19b851327ba374687bc4a3940805e14ca496dc672b9629e744d143b1ad9c6f1b162dece81c7bfbc0f83b32b61ccc19ad2e05aad2dd7af347408f60c7f + languageName: node + linkType: hard + +"is-unicode-supported@npm:^2.0.0": + version: 2.1.0 + resolution: "is-unicode-supported@npm:2.1.0" + checksum: 10c0/a0f53e9a7c1fdbcf2d2ef6e40d4736fdffff1c9f8944c75e15425118ff3610172c87bf7bc6c34d3903b04be59790bb2212ddbe21ee65b5a97030fc50370545a5 + languageName: node + linkType: hard + +"isarray@npm:~1.0.0": + version: 1.0.0 + resolution: "isarray@npm:1.0.0" + checksum: 10c0/18b5be6669be53425f0b84098732670ed4e727e3af33bc7f948aac01782110eb9a18b3b329c5323bcdd3acdaae547ee077d3951317e7f133bff7105264b3003d + languageName: node + linkType: hard + +"isexe@npm:^2.0.0": + version: 2.0.0 + resolution: "isexe@npm:2.0.0" + checksum: 10c0/228cfa503fadc2c31596ab06ed6aa82c9976eec2bfd83397e7eaf06d0ccf42cd1dfd6743bf9aeb01aebd4156d009994c5f76ea898d2832c1fe342da923ca457d + languageName: node + linkType: hard + +"isexe@npm:^3.1.1": + version: 3.1.5 + resolution: "isexe@npm:3.1.5" + checksum: 10c0/8be2973a09f2f804ea1f34bfccfd5ea219ef48083bdb12107fe5bcf96b3e36b85084409e1b09ddaf2fae8927fdd9f6d70d90baadb78caa1ca7c530935706c8a4 + languageName: node + linkType: hard + +"issue-parser@npm:^7.0.0": + version: 7.0.1 + resolution: "issue-parser@npm:7.0.1" + dependencies: + lodash.capitalize: "npm:^4.2.1" + lodash.escaperegexp: "npm:^4.1.2" + lodash.isplainobject: "npm:^4.0.6" + lodash.isstring: "npm:^4.0.1" + lodash.uniqby: "npm:^4.7.0" + checksum: 10c0/1b2dad16081ae423bb96143132701e89aa8f6345ab0a10f692594ddf5699b514adccaaaf24d7c59afc977c447895bdee15fff2dfc9d6015e177f6966b06f5dcb + languageName: node + linkType: hard + +"jackspeak@npm:^3.1.2": + version: 3.4.3 + resolution: "jackspeak@npm:3.4.3" + dependencies: + "@isaacs/cliui": "npm:^8.0.2" + "@pkgjs/parseargs": "npm:^0.11.0" + dependenciesMeta: + "@pkgjs/parseargs": + optional: true + checksum: 10c0/6acc10d139eaefdbe04d2f679e6191b3abf073f111edf10b1de5302c97ec93fffeb2fdd8681ed17f16268aa9dd4f8c588ed9d1d3bffbbfa6e8bf897cbb3149b9 + languageName: node + linkType: hard + +"java-properties@npm:^1.0.2": + version: 1.0.2 + resolution: "java-properties@npm:1.0.2" + checksum: 10c0/be0f58c83b5a852f313de2ea57f7b8b7d46dc062b2ffe487d58838e7034d4660f4d22f2a96aae4daa622af6d734726c0d08b01396e59666ededbcfdc25a694d6 + languageName: node + linkType: hard + +"js-tokens@npm:^4.0.0": + version: 4.0.0 + resolution: "js-tokens@npm:4.0.0" + checksum: 10c0/e248708d377aa058eacf2037b07ded847790e6de892bbad3dac0abba2e759cb9f121b00099a65195616badcb6eca8d14d975cb3e89eb1cfda644756402c8aeed + languageName: node + linkType: hard + +"js-yaml@npm:^4.1.0": + version: 4.1.1 + resolution: "js-yaml@npm:4.1.1" + dependencies: + argparse: "npm:^2.0.1" + bin: + js-yaml: bin/js-yaml.js + checksum: 10c0/561c7d7088c40a9bb53cc75becbfb1df6ae49b34b5e6e5a81744b14ae8667ec564ad2527709d1a6e7d5e5fa6d483aa0f373a50ad98d42fde368ec4a190d4fae7 + languageName: node + linkType: hard + +"json-parse-better-errors@npm:^1.0.1": + version: 1.0.2 + resolution: "json-parse-better-errors@npm:1.0.2" + checksum: 10c0/2f1287a7c833e397c9ddd361a78638e828fc523038bb3441fd4fc144cfd2c6cd4963ffb9e207e648cf7b692600f1e1e524e965c32df5152120910e4903a47dcb + languageName: node + linkType: hard + +"json-parse-even-better-errors@npm:^2.3.0": + version: 2.3.1 + resolution: "json-parse-even-better-errors@npm:2.3.1" + checksum: 10c0/140932564c8f0b88455432e0f33c4cb4086b8868e37524e07e723f4eaedb9425bdc2bafd71bd1d9765bd15fd1e2d126972bc83990f55c467168c228c24d665f3 + languageName: node + linkType: hard + +"json-parse-even-better-errors@npm:^4.0.0": + version: 4.0.0 + resolution: "json-parse-even-better-errors@npm:4.0.0" + checksum: 10c0/84cd9304a97e8fb2af3937bf53acb91c026aeb859703c332684e688ea60db27fc2242aa532a84e1883fdcbe1e5c1fb57c2bef38e312021aa1cd300defc63cf16 + languageName: node + linkType: hard + +"json-stringify-nice@npm:^1.1.4": + version: 1.1.4 + resolution: "json-stringify-nice@npm:1.1.4" + checksum: 10c0/13673b67ba9e7fde75a103cade0b0d2dd0d21cd3b918de8d8f6cd59d48ad8c78b0e85f6f4a5842073ddfc91ebdde5ef7c81c7f51945b96a33eaddc5d41324b87 + languageName: node + linkType: hard + +"json-with-bigint@npm:^3.5.3": + version: 3.5.8 + resolution: "json-with-bigint@npm:3.5.8" + checksum: 10c0/a0c4e37626d74a9a493539f9f9a94855933fa15ea2f028859a787229a42c5f11803db6f94f1ce7b1d89756c1e80a7c1f11006bac266ec7ce819b75701765ca0a + languageName: node + linkType: hard + +"jsonfile@npm:^6.0.1": + version: 6.2.0 + resolution: "jsonfile@npm:6.2.0" + dependencies: + graceful-fs: "npm:^4.1.6" + universalify: "npm:^2.0.0" + dependenciesMeta: + graceful-fs: + optional: true + checksum: 10c0/7f4f43b08d1869ded8a6822213d13ae3b99d651151d77efd1557ced0889c466296a7d9684e397bd126acf5eb2cfcb605808c3e681d0fdccd2fe5a04b47e76c0d + languageName: node + linkType: hard + +"jsonparse@npm:^1.3.1": + version: 1.3.1 + resolution: "jsonparse@npm:1.3.1" + checksum: 10c0/89bc68080cd0a0e276d4b5ab1b79cacd68f562467008d176dc23e16e97d4efec9e21741d92ba5087a8433526a45a7e6a9d5ef25408696c402ca1cfbc01a90bf0 + languageName: node + linkType: hard + +"just-diff-apply@npm:^5.2.0": + version: 5.5.0 + resolution: "just-diff-apply@npm:5.5.0" + checksum: 10c0/d7b85371f2a5a17a108467fda35dddd95264ab438ccec7837b67af5913c57ded7246039d1df2b5bc1ade034ccf815b56d69786c5f1e07383168a066007c796c0 + languageName: node + linkType: hard + +"just-diff@npm:^6.0.0": + version: 6.0.2 + resolution: "just-diff@npm:6.0.2" + checksum: 10c0/1931ca1f0cea4cc480172165c189a84889033ad7a60bee302268ba8ca9f222b43773fd5f272a23ee618d43d85d3048411f06b635571a198159e9a85bb2495f5c + languageName: node + linkType: hard + +"libnpmaccess@npm:^9.0.0": + version: 9.0.0 + resolution: "libnpmaccess@npm:9.0.0" + dependencies: + npm-package-arg: "npm:^12.0.0" + npm-registry-fetch: "npm:^18.0.1" + checksum: 10c0/5e86cb1b5ead4baa777ee2dbafe27e63c571056d547c83c8e0cd18a173712d9671728e26e405f74c14d10ca592bfd4f2c27c0a5f9882ab9ab3983c5b3d5e249a + languageName: node + linkType: hard + +"libnpmdiff@npm:^7.0.4": + version: 7.0.4 + resolution: "libnpmdiff@npm:7.0.4" + dependencies: + "@npmcli/arborist": "npm:^8.0.4" + "@npmcli/installed-package-contents": "npm:^3.0.0" + binary-extensions: "npm:^2.3.0" + diff: "npm:^5.1.0" + minimatch: "npm:^9.0.4" + npm-package-arg: "npm:^12.0.0" + pacote: "npm:^19.0.0" + tar: "npm:^7.5.11" + checksum: 10c0/dc76a1e2918800512de788207b2d7cfb04c2ddc3daef70f52e5ef1f50ce6a75a356370342c97af4830b0e344cbd12e1d53a1e760f3d0d0a803a3711a7b75b6cb + languageName: node + linkType: hard + +"libnpmexec@npm:^9.0.4": + version: 9.0.4 + resolution: "libnpmexec@npm:9.0.4" + dependencies: + "@npmcli/arborist": "npm:^8.0.4" + "@npmcli/run-script": "npm:^9.0.1" + ci-info: "npm:^4.0.0" + npm-package-arg: "npm:^12.0.0" + pacote: "npm:^19.0.0" + proc-log: "npm:^5.0.0" + read: "npm:^4.0.0" + read-package-json-fast: "npm:^4.0.0" + semver: "npm:^7.3.7" + walk-up-path: "npm:^3.0.1" + checksum: 10c0/ceb8b01fc13cea71044a69ec4f8c50684b81aeccca2775df2cad864c1dfa6930f4ea7f30c27ec9decbdefec63900ae7b9edd7491d1972e28b9767ca8d75cdf74 + languageName: node + linkType: hard + +"libnpmfund@npm:^6.0.4": + version: 6.0.4 + resolution: "libnpmfund@npm:6.0.4" + dependencies: + "@npmcli/arborist": "npm:^8.0.4" + checksum: 10c0/024a852f5a48b1e4c1438e983c462a169cf2a161c7c9b0ae100b244b5b936e8acce1bac0f45f6b3536fff69ca8a336e418ace51a34abad90baa8c16f4d1eeabf + languageName: node + linkType: hard + +"libnpmhook@npm:^11.0.0": + version: 11.0.0 + resolution: "libnpmhook@npm:11.0.0" + dependencies: + aproba: "npm:^2.0.0" + npm-registry-fetch: "npm:^18.0.1" + checksum: 10c0/edac74fb7f006f9305b9f8ac0dfc22bca5e404ba0bb65c9f2ef21c8b905ec1fc5ca90471b551fcfba1d216f08fc470804cd21b87f5405b75927df5a975ab0cae + languageName: node + linkType: hard + +"libnpmorg@npm:^7.0.0": + version: 7.0.0 + resolution: "libnpmorg@npm:7.0.0" + dependencies: + aproba: "npm:^2.0.0" + npm-registry-fetch: "npm:^18.0.1" + checksum: 10c0/7fbb0ae997de4920517658df20b633e32f91797d0b287fc9a3e361891fc8e31afbb3d3851dafd44e57067f497056e5ff2a7a6f805b353f2e8de5ecd1692e6ad6 + languageName: node + linkType: hard + +"libnpmpack@npm:^8.0.4": + version: 8.0.4 + resolution: "libnpmpack@npm:8.0.4" + dependencies: + "@npmcli/arborist": "npm:^8.0.4" + "@npmcli/run-script": "npm:^9.0.1" + npm-package-arg: "npm:^12.0.0" + pacote: "npm:^19.0.0" + checksum: 10c0/daa029169b5b2ec0f28a823917c53924868e1e09003f14c744163b30109044ef40afbddad9f7ee6d465a5ba82f0a414c82f08058b33837d038dac4e0b4efb15e + languageName: node + linkType: hard + +"libnpmpublish@npm:^10.0.2": + version: 10.0.2 + resolution: "libnpmpublish@npm:10.0.2" + dependencies: + ci-info: "npm:^4.0.0" + normalize-package-data: "npm:^7.0.0" + npm-package-arg: "npm:^12.0.0" + npm-registry-fetch: "npm:^18.0.1" + proc-log: "npm:^5.0.0" + semver: "npm:^7.3.7" + sigstore: "npm:^3.0.0" + ssri: "npm:^12.0.0" + checksum: 10c0/e663fe42d05046f1f2369b50bfab189ca459f212b46b6b8b8cdf24a22abbbb3529b3326b35285ef36a5395c91b4b9d09b4f7ab4bb677dca42caa4f96866cfd03 + languageName: node + linkType: hard + +"libnpmsearch@npm:^8.0.0": + version: 8.0.0 + resolution: "libnpmsearch@npm:8.0.0" + dependencies: + npm-registry-fetch: "npm:^18.0.1" + checksum: 10c0/96063ad6676ed85724b7b246da630c4d59cc7e9c0cc20431cf5b06d40060bb409c04b96070711825fadcc5d6c2abaccb1048268d7262d6c4db2be3a3f2a9404d + languageName: node + linkType: hard + +"libnpmteam@npm:^7.0.0": + version: 7.0.0 + resolution: "libnpmteam@npm:7.0.0" + dependencies: + aproba: "npm:^2.0.0" + npm-registry-fetch: "npm:^18.0.1" + checksum: 10c0/06872f449d6fd1f90c3507bd0654d8102b3820dd8a0882d20a01ad62a3b4f3f165e57f4d833f9a7454bb1ec884c2c7b722490d86a997804efab9697e9ae8cc0e + languageName: node + linkType: hard + +"libnpmversion@npm:^7.0.0": + version: 7.0.0 + resolution: "libnpmversion@npm:7.0.0" + dependencies: + "@npmcli/git": "npm:^6.0.1" + "@npmcli/run-script": "npm:^9.0.1" + json-parse-even-better-errors: "npm:^4.0.0" + proc-log: "npm:^5.0.0" + semver: "npm:^7.3.7" + checksum: 10c0/60d5543aa7fda90b11a10aeedf13482df242bb6ebff70c9eec4d26dcefb5c62cb9dd3fcfdd997b1aba84aa31d117a22b7f24633b75cbe63aa9cc4c519cab2c77 + languageName: node + linkType: hard + +"lines-and-columns@npm:^1.1.6": + version: 1.2.4 + resolution: "lines-and-columns@npm:1.2.4" + checksum: 10c0/3da6ee62d4cd9f03f5dc90b4df2540fb85b352081bee77fe4bbcd12c9000ead7f35e0a38b8d09a9bb99b13223446dd8689ff3c4959807620726d788701a83d2d + languageName: node + linkType: hard + +"load-json-file@npm:^4.0.0": + version: 4.0.0 + resolution: "load-json-file@npm:4.0.0" + dependencies: + graceful-fs: "npm:^4.1.2" + parse-json: "npm:^4.0.0" + pify: "npm:^3.0.0" + strip-bom: "npm:^3.0.0" + checksum: 10c0/6b48f6a0256bdfcc8970be2c57f68f10acb2ee7e63709b386b2febb6ad3c86198f840889cdbe71d28f741cbaa2f23a7771206b138cd1bdd159564511ca37c1d5 + languageName: node + linkType: hard + +"locate-path@npm:^2.0.0": + version: 2.0.0 + resolution: "locate-path@npm:2.0.0" + dependencies: + p-locate: "npm:^2.0.0" + path-exists: "npm:^3.0.0" + checksum: 10c0/24efa0e589be6aa3c469b502f795126b26ab97afa378846cb508174211515633b770aa0ba610cab113caedab8d2a4902b061a08aaed5297c12ab6f5be4df0133 + languageName: node + linkType: hard + +"lodash-es@npm:^4.17.21": + version: 4.17.23 + resolution: "lodash-es@npm:4.17.23" + checksum: 10c0/3150fb6660c14c7a6b5f23bd11597d884b140c0e862a17fdb415aaa5ef7741523182904a6b7929f04e5f60a11edb5a79499eb448734381c99ffb3c4734beeddd + languageName: node + linkType: hard + +"lodash.capitalize@npm:^4.2.1": + version: 4.2.1 + resolution: "lodash.capitalize@npm:4.2.1" + checksum: 10c0/b289326497c2e24d6b8afa2af2ca4e068ef6ef007ade36bfb6f70af77ce10ea3f090eeee947d5fdcf2db4bcfa4703c8c10a5857a2b39e308bddfd1d11ad35970 + languageName: node + linkType: hard + +"lodash.escaperegexp@npm:^4.1.2": + version: 4.1.2 + resolution: "lodash.escaperegexp@npm:4.1.2" + checksum: 10c0/484ad4067fa9119bb0f7c19a36ab143d0173a081314993fe977bd00cf2a3c6a487ce417a10f6bac598d968364f992153315f0dbe25c9e38e3eb7581dd333e087 + languageName: node + linkType: hard + +"lodash.isplainobject@npm:^4.0.6": + version: 4.0.6 + resolution: "lodash.isplainobject@npm:4.0.6" + checksum: 10c0/afd70b5c450d1e09f32a737bed06ff85b873ecd3d3d3400458725283e3f2e0bb6bf48e67dbe7a309eb371a822b16a26cca4a63c8c52db3fc7dc9d5f9dd324cbb + languageName: node + linkType: hard + +"lodash.isstring@npm:^4.0.1": + version: 4.0.1 + resolution: "lodash.isstring@npm:4.0.1" + checksum: 10c0/09eaf980a283f9eef58ef95b30ec7fee61df4d6bf4aba3b5f096869cc58f24c9da17900febc8ffd67819b4e29de29793190e88dc96983db92d84c95fa85d1c92 + languageName: node + linkType: hard + +"lodash.uniqby@npm:^4.7.0": + version: 4.7.0 + resolution: "lodash.uniqby@npm:4.7.0" + checksum: 10c0/c505c0de20ca759599a2ba38710e8fb95ff2d2028e24d86c901ef2c74be8056518571b9b754bfb75053b2818d30dd02243e4a4621a6940c206bbb3f7626db656 + languageName: node + linkType: hard + +"lodash@npm:^4.17.4": + version: 4.17.23 + resolution: "lodash@npm:4.17.23" + checksum: 10c0/1264a90469f5bb95d4739c43eb6277d15b6d9e186df4ac68c3620443160fc669e2f14c11e7d8b2ccf078b81d06147c01a8ccced9aab9f9f63d50dcf8cace6bf6 + languageName: node + linkType: hard + +"lru-cache@npm:^10.0.1, lru-cache@npm:^10.2.0, lru-cache@npm:^10.2.2": + version: 10.4.3 + resolution: "lru-cache@npm:10.4.3" + checksum: 10c0/ebd04fbca961e6c1d6c0af3799adcc966a1babe798f685bb84e6599266599cd95d94630b10262f5424539bc4640107e8a33aa28585374abf561d30d16f4b39fb + languageName: node + linkType: hard + +"make-asynchronous@npm:^1.0.1": + version: 1.1.0 + resolution: "make-asynchronous@npm:1.1.0" + dependencies: + p-event: "npm:^6.0.0" + type-fest: "npm:^4.6.0" + web-worker: "npm:^1.5.0" + checksum: 10c0/794c4876839f00bc6e287a1f07177dc3bb5c177d06d4ebe9e3a055758d9740b9b296a957c9015bed8d0d92d70035c70108e4c7d7bc2880fb16b94d0bd4b75a37 + languageName: node + linkType: hard + +"make-fetch-happen@npm:^14.0.0, make-fetch-happen@npm:^14.0.2, make-fetch-happen@npm:^14.0.3": + version: 14.0.3 + resolution: "make-fetch-happen@npm:14.0.3" + dependencies: + "@npmcli/agent": "npm:^3.0.0" + cacache: "npm:^19.0.1" + http-cache-semantics: "npm:^4.1.1" + minipass: "npm:^7.0.2" + minipass-fetch: "npm:^4.0.0" + minipass-flush: "npm:^1.0.5" + minipass-pipeline: "npm:^1.2.4" + negotiator: "npm:^1.0.0" + proc-log: "npm:^5.0.0" + promise-retry: "npm:^2.0.1" + ssri: "npm:^12.0.0" + checksum: 10c0/c40efb5e5296e7feb8e37155bde8eb70bc57d731b1f7d90e35a092fde403d7697c56fb49334d92d330d6f1ca29a98142036d6480a12681133a0a1453164cb2f0 + languageName: node + linkType: hard + +"marked-terminal@npm:^7.3.0": + version: 7.3.0 + resolution: "marked-terminal@npm:7.3.0" + dependencies: + ansi-escapes: "npm:^7.0.0" + ansi-regex: "npm:^6.1.0" + chalk: "npm:^5.4.1" + cli-highlight: "npm:^2.1.11" + cli-table3: "npm:^0.6.5" + node-emoji: "npm:^2.2.0" + supports-hyperlinks: "npm:^3.1.0" + peerDependencies: + marked: ">=1 <16" + checksum: 10c0/59d23c2ed9488c40856d828f431ae1d5d57426e791bbce8f05ec5a7d3a1f848cdb3b8d8880d76ae45570415f8b48ae459f50bbbd88ece5a31306f1e3de57f021 + languageName: node + linkType: hard + +"marked@npm:^15.0.0": + version: 15.0.12 + resolution: "marked@npm:15.0.12" + bin: + marked: bin/marked.js + checksum: 10c0/e09da211544b787ecfb25fed07af206060bf7cd6d9de6cb123f15c496a57f83b7aabea93340aaa94dae9c94e097ae129377cad6310abc16009590972e85f4212 + languageName: node + linkType: hard + +"meow@npm:^13.0.0": + version: 13.2.0 + resolution: "meow@npm:13.2.0" + checksum: 10c0/d5b339ae314715bcd0b619dd2f8a266891928e21526b4800d49b4fba1cc3fff7e2c1ff5edd3344149fac841bc2306157f858e8c4d5eaee4d52ce52ad925664ce + languageName: node + linkType: hard + +"merge-stream@npm:^2.0.0": + version: 2.0.0 + resolution: "merge-stream@npm:2.0.0" + checksum: 10c0/867fdbb30a6d58b011449b8885601ec1690c3e41c759ecd5a9d609094f7aed0096c37823ff4a7190ef0b8f22cc86beb7049196ff68c016e3b3c671d0dac91ce5 + languageName: node + linkType: hard + +"micromatch@npm:^4.0.0, micromatch@npm:^4.0.2": + version: 4.0.8 + resolution: "micromatch@npm:4.0.8" + dependencies: + braces: "npm:^3.0.3" + picomatch: "npm:^2.3.1" + checksum: 10c0/166fa6eb926b9553f32ef81f5f531d27b4ce7da60e5baf8c021d043b27a388fb95e46a8038d5045877881e673f8134122b59624d5cecbd16eb50a42e7a6b5ca8 + languageName: node + linkType: hard + +"mime@npm:^4.0.0": + version: 4.1.0 + resolution: "mime@npm:4.1.0" + bin: + mime: bin/cli.js + checksum: 10c0/3b8602e50dff1049aea8bb2d4c65afc55bf7f3eb5c17fd2bcb315b8c8ae225a7553297d424d3621757c24cdba99e930ecdc4108467009cdc7ed55614cd55031d + languageName: node + linkType: hard + +"mimic-fn@npm:^2.1.0": + version: 2.1.0 + resolution: "mimic-fn@npm:2.1.0" + checksum: 10c0/b26f5479d7ec6cc2bce275a08f146cf78f5e7b661b18114e2506dd91ec7ec47e7a25bf4360e5438094db0560bcc868079fb3b1fb3892b833c1ecbf63f80c95a4 + languageName: node + linkType: hard + +"mimic-fn@npm:^4.0.0": + version: 4.0.0 + resolution: "mimic-fn@npm:4.0.0" + checksum: 10c0/de9cc32be9996fd941e512248338e43407f63f6d497abe8441fa33447d922e927de54d4cc3c1a3c6d652857acd770389d5a3823f311a744132760ce2be15ccbf + languageName: node + linkType: hard + +"minimatch@npm:^9.0.0, minimatch@npm:^9.0.4, minimatch@npm:^9.0.5, minimatch@npm:^9.0.9": + version: 9.0.9 + resolution: "minimatch@npm:9.0.9" + dependencies: + brace-expansion: "npm:^2.0.2" + checksum: 10c0/0b6a58530dbb00361745aa6c8cffaba4c90f551afe7c734830bd95fd88ebf469dd7355a027824ea1d09e37181cfeb0a797fb17df60c15ac174303ac110eb7e86 + languageName: node + linkType: hard + +"minimist@npm:^1.2.0, minimist@npm:^1.2.5": + version: 1.2.8 + resolution: "minimist@npm:1.2.8" + checksum: 10c0/19d3fcdca050087b84c2029841a093691a91259a47def2f18222f41e7645a0b7c44ef4b40e88a1e58a40c84d2ef0ee6047c55594d298146d0eb3f6b737c20ce6 + languageName: node + linkType: hard + +"minipass-collect@npm:^2.0.1": + version: 2.0.1 + resolution: "minipass-collect@npm:2.0.1" + dependencies: + minipass: "npm:^7.0.3" + checksum: 10c0/5167e73f62bb74cc5019594709c77e6a742051a647fe9499abf03c71dca75515b7959d67a764bdc4f8b361cf897fbf25e2d9869ee039203ed45240f48b9aa06e + languageName: node + linkType: hard + +"minipass-fetch@npm:^4.0.0": + version: 4.0.1 + resolution: "minipass-fetch@npm:4.0.1" + dependencies: + encoding: "npm:^0.1.13" + minipass: "npm:^7.0.3" + minipass-sized: "npm:^1.0.3" + minizlib: "npm:^3.0.1" + dependenciesMeta: + encoding: + optional: true + checksum: 10c0/a3147b2efe8e078c9bf9d024a0059339c5a09c5b1dded6900a219c218cc8b1b78510b62dae556b507304af226b18c3f1aeb1d48660283602d5b6586c399eed5c + languageName: node + linkType: hard + +"minipass-flush@npm:^1.0.5": + version: 1.0.5 + resolution: "minipass-flush@npm:1.0.5" + dependencies: + minipass: "npm:^3.0.0" + checksum: 10c0/2a51b63feb799d2bb34669205eee7c0eaf9dce01883261a5b77410c9408aa447e478efd191b4de6fc1101e796ff5892f8443ef20d9544385819093dbb32d36bd + languageName: node + linkType: hard + +"minipass-pipeline@npm:^1.2.4": + version: 1.2.4 + resolution: "minipass-pipeline@npm:1.2.4" + dependencies: + minipass: "npm:^3.0.0" + checksum: 10c0/cbda57cea20b140b797505dc2cac71581a70b3247b84480c1fed5ca5ba46c25ecc25f68bfc9e6dcb1a6e9017dab5c7ada5eab73ad4f0a49d84e35093e0c643f2 + languageName: node + linkType: hard + +"minipass-sized@npm:^1.0.3": + version: 1.0.3 + resolution: "minipass-sized@npm:1.0.3" + dependencies: + minipass: "npm:^3.0.0" + checksum: 10c0/298f124753efdc745cfe0f2bdfdd81ba25b9f4e753ca4a2066eb17c821f25d48acea607dfc997633ee5bf7b6dfffb4eee4f2051eb168663f0b99fad2fa4829cb + languageName: node + linkType: hard + +"minipass@npm:^3.0.0": + version: 3.3.6 + resolution: "minipass@npm:3.3.6" + dependencies: + yallist: "npm:^4.0.0" + checksum: 10c0/a114746943afa1dbbca8249e706d1d38b85ed1298b530f5808ce51f8e9e941962e2a5ad2e00eae7dd21d8a4aae6586a66d4216d1a259385e9d0358f0c1eba16c + languageName: node + linkType: hard + +"minipass@npm:^5.0.0 || ^6.0.2 || ^7.0.0, minipass@npm:^7.0.2, minipass@npm:^7.0.3, minipass@npm:^7.0.4, minipass@npm:^7.1.2, minipass@npm:^7.1.3": + version: 7.1.3 + resolution: "minipass@npm:7.1.3" + checksum: 10c0/539da88daca16533211ea5a9ee98dc62ff5742f531f54640dd34429e621955e91cc280a91a776026264b7f9f6735947629f920944e9c1558369e8bf22eb33fbb + languageName: node + linkType: hard + +"minizlib@npm:^3.0.1, minizlib@npm:^3.1.0": + version: 3.1.0 + resolution: "minizlib@npm:3.1.0" + dependencies: + minipass: "npm:^7.1.2" + checksum: 10c0/5aad75ab0090b8266069c9aabe582c021ae53eb33c6c691054a13a45db3b4f91a7fb1bd79151e6b4e9e9a86727b522527c0a06ec7d45206b745d54cd3097bcec + languageName: node + linkType: hard + +"ms@npm:^2.1.2, ms@npm:^2.1.3": + version: 2.1.3 + resolution: "ms@npm:2.1.3" + checksum: 10c0/d924b57e7312b3b63ad21fc5b3dc0af5e78d61a1fc7cfb5457edaf26326bf62be5307cc87ffb6862ef1c2b33b0233cdb5d4f01c4c958cc0d660948b65a287a48 + languageName: node + linkType: hard + +"mute-stream@npm:^2.0.0": + version: 2.0.0 + resolution: "mute-stream@npm:2.0.0" + checksum: 10c0/2cf48a2087175c60c8dcdbc619908b49c07f7adcfc37d29236b0c5c612d6204f789104c98cc44d38acab7b3c96f4a3ec2cfdc4934d0738d876dbefa2a12c69f4 + languageName: node + linkType: hard + +"mz@npm:^2.4.0": + version: 2.7.0 + resolution: "mz@npm:2.7.0" + dependencies: + any-promise: "npm:^1.0.0" + object-assign: "npm:^4.0.1" + thenify-all: "npm:^1.0.0" + checksum: 10c0/103114e93f87362f0b56ab5b2e7245051ad0276b646e3902c98397d18bb8f4a77f2ea4a2c9d3ad516034ea3a56553b60d3f5f78220001ca4c404bd711bd0af39 + languageName: node + linkType: hard + +"negotiator@npm:^1.0.0": + version: 1.0.0 + resolution: "negotiator@npm:1.0.0" + checksum: 10c0/4c559dd52669ea48e1914f9d634227c561221dd54734070791f999c52ed0ff36e437b2e07d5c1f6e32909fc625fe46491c16e4a8f0572567d4dd15c3a4fda04b + languageName: node + linkType: hard + +"neo-async@npm:^2.6.2": + version: 2.6.2 + resolution: "neo-async@npm:2.6.2" + checksum: 10c0/c2f5a604a54a8ec5438a342e1f356dff4bc33ccccdb6dc668d94fe8e5eccfc9d2c2eea6064b0967a767ba63b33763f51ccf2cd2441b461a7322656c1f06b3f5d + languageName: node + linkType: hard + +"nerf-dart@npm:^1.0.0": + version: 1.0.0 + resolution: "nerf-dart@npm:1.0.0" + checksum: 10c0/e19e17d7bd91dfcb1acd07cbdd8df1f0613f3408227538fe91793c6dfcf58e95b5f18b88b4a13e9b31587e89a119fd76d6df4b8d8c65564dd2c409d787819583 + languageName: node + linkType: hard + +"node-emoji@npm:^2.2.0": + version: 2.2.0 + resolution: "node-emoji@npm:2.2.0" + dependencies: + "@sindresorhus/is": "npm:^4.6.0" + char-regex: "npm:^1.0.2" + emojilib: "npm:^2.4.0" + skin-tone: "npm:^2.0.0" + checksum: 10c0/9525defbd90a82a2131758c2470203fa2a2faa8edd177147a8654a26307fe03594e52847ecbe2746d06cfc5c50acd12bd500f035350a7609e8217c9894c19aad + languageName: node + linkType: hard + +"node-gyp@npm:^11.0.0, node-gyp@npm:^11.5.0": + version: 11.5.0 + resolution: "node-gyp@npm:11.5.0" + dependencies: + env-paths: "npm:^2.2.0" + exponential-backoff: "npm:^3.1.1" + graceful-fs: "npm:^4.2.6" + make-fetch-happen: "npm:^14.0.3" + nopt: "npm:^8.0.0" + proc-log: "npm:^5.0.0" + semver: "npm:^7.3.5" + tar: "npm:^7.4.3" + tinyglobby: "npm:^0.2.12" + which: "npm:^5.0.0" + bin: + node-gyp: bin/node-gyp.js + checksum: 10c0/31ff49586991b38287bb15c3d529dd689cfc32f992eed9e6997b9d712d5d21fe818a8b1bbfe3b76a7e33765c20210c5713212f4aa329306a615b87d8a786da3a + languageName: node + linkType: hard + +"nopt@npm:^8.0.0, nopt@npm:^8.1.0": + version: 8.1.0 + resolution: "nopt@npm:8.1.0" + dependencies: + abbrev: "npm:^3.0.0" + bin: + nopt: bin/nopt.js + checksum: 10c0/62e9ea70c7a3eb91d162d2c706b6606c041e4e7b547cbbb48f8b3695af457dd6479904d7ace600856bf923dd8d1ed0696f06195c8c20f02ac87c1da0e1d315ef + languageName: node + linkType: hard + +"normalize-package-data@npm:^6.0.0": + version: 6.0.2 + resolution: "normalize-package-data@npm:6.0.2" + dependencies: + hosted-git-info: "npm:^7.0.0" + semver: "npm:^7.3.5" + validate-npm-package-license: "npm:^3.0.4" + checksum: 10c0/7e32174e7f5575ede6d3d449593247183880122b4967d4ae6edb28cea5769ca025defda54fc91ec0e3c972fdb5ab11f9284606ba278826171b264cb16a9311ef + languageName: node + linkType: hard + +"normalize-package-data@npm:^7.0.0, normalize-package-data@npm:^7.0.1": + version: 7.0.1 + resolution: "normalize-package-data@npm:7.0.1" + dependencies: + hosted-git-info: "npm:^8.0.0" + semver: "npm:^7.3.5" + validate-npm-package-license: "npm:^3.0.4" + checksum: 10c0/1c30f79c74257a1d4a0b0651683682f3dbcfeb1e0303d31448a08d58350197ca0d2c6f8786e3eb863a8463eedeb0a298cde5834ed64337ecb1b5b52b760f458a + languageName: node + linkType: hard + +"normalize-url@npm:^8.0.0": + version: 8.1.1 + resolution: "normalize-url@npm:8.1.1" + checksum: 10c0/1beb700ce42acb2288f39453cdf8001eead55bbf046d407936a40404af420b8c1c6be97a869884ae9e659d7b1c744e40e905c875ac9290644eec2e3e6fb0b370 + languageName: node + linkType: hard + +"npm-audit-report@npm:^6.0.0": + version: 6.0.0 + resolution: "npm-audit-report@npm:6.0.0" + checksum: 10c0/16307fb0d13e0df74f737b58c76b1741dcc5f997da0349a928155903fe1a50585421a2f7fd926c7c266751a1d0670bf5536e4277b05a641ab36c12343eac771a + languageName: node + linkType: hard + +"npm-bundled@npm:^4.0.0": + version: 4.0.0 + resolution: "npm-bundled@npm:4.0.0" + dependencies: + npm-normalize-package-bin: "npm:^4.0.0" + checksum: 10c0/e6e20caefbc6a41138d3767ec998f6a2cf55f33371c119417a556ff6052390a2ffeb3b465a74aea127fb211ddfcb7db776620faf12b64e48e60e332b25b5b8a0 + languageName: node + linkType: hard + +"npm-install-checks@npm:^7.1.0, npm-install-checks@npm:^7.1.2": + version: 7.1.2 + resolution: "npm-install-checks@npm:7.1.2" + dependencies: + semver: "npm:^7.1.1" + checksum: 10c0/eb490ac637869f6de65af0886f3a96f4d942609f1b3cfe0caf08b73bd76aff35ca4613fd3cbc36f3219727bc3183322051d1468b065911a59dbf87ecdb603bce + languageName: node + linkType: hard + +"npm-normalize-package-bin@npm:^4.0.0": + version: 4.0.0 + resolution: "npm-normalize-package-bin@npm:4.0.0" + checksum: 10c0/1fa546fcae8eaab61ef9b9ec237b6c795008da50e1883eae030e9e38bb04ffa32c5aabcef9a0400eae3dc1f91809bcfa85e437ce80d677c69b419d1d9cacf0ab + languageName: node + linkType: hard + +"npm-package-arg@npm:^12.0.0, npm-package-arg@npm:^12.0.2": + version: 12.0.2 + resolution: "npm-package-arg@npm:12.0.2" + dependencies: + hosted-git-info: "npm:^8.0.0" + proc-log: "npm:^5.0.0" + semver: "npm:^7.3.5" + validate-npm-package-name: "npm:^6.0.0" + checksum: 10c0/a507046ca0999862d6f1a4878d2e22d47a728062b49d670ea7a965b0b555fc84ba4473daf34eb72c711b68aeb02e4f567fdb410d54385535cb7e4d85aaf49544 + languageName: node + linkType: hard + +"npm-packlist@npm:^9.0.0": + version: 9.0.0 + resolution: "npm-packlist@npm:9.0.0" + dependencies: + ignore-walk: "npm:^7.0.0" + checksum: 10c0/3eb9e877fff81ed1f97b86a387a13a7d0136a26c4c21d8fab7e49be653e71d604ba63091ec80e3a0b1d1fd879639eab91ddda1a8df45d7631795b83911f2f9b8 + languageName: node + linkType: hard + +"npm-pick-manifest@npm:^10.0.0": + version: 10.0.0 + resolution: "npm-pick-manifest@npm:10.0.0" + dependencies: + npm-install-checks: "npm:^7.1.0" + npm-normalize-package-bin: "npm:^4.0.0" + npm-package-arg: "npm:^12.0.0" + semver: "npm:^7.3.5" + checksum: 10c0/946e791f6164a04dbc3340749cd7521d4d1f60accb2d0ca901375314b8425c8a12b34b4b70e2850462cc898fba5fa8d1f283221bf788a1d37276f06a85c4562a + languageName: node + linkType: hard + +"npm-profile@npm:^11.0.1": + version: 11.0.1 + resolution: "npm-profile@npm:11.0.1" + dependencies: + npm-registry-fetch: "npm:^18.0.0" + proc-log: "npm:^5.0.0" + checksum: 10c0/4fc6aad91f27bbc122917acd038d5c2b0187519ea149dab6f4f39fe921c0794374f7cf444ea0bf438c49ed6fdc37202cac9bdc107609236c077607dd06f5be4a + languageName: node + linkType: hard + +"npm-registry-fetch@npm:^18.0.0, npm-registry-fetch@npm:^18.0.1, npm-registry-fetch@npm:^18.0.2": + version: 18.0.2 + resolution: "npm-registry-fetch@npm:18.0.2" + dependencies: + "@npmcli/redact": "npm:^3.0.0" + jsonparse: "npm:^1.3.1" + make-fetch-happen: "npm:^14.0.0" + minipass: "npm:^7.0.2" + minipass-fetch: "npm:^4.0.0" + minizlib: "npm:^3.0.1" + npm-package-arg: "npm:^12.0.0" + proc-log: "npm:^5.0.0" + checksum: 10c0/43e02befb393f67d5014d690a96d55f0b5f837a3eb9a79b17738ff0e3a1f081968480f2f280d1ad77a088ebd88c196793d929b0e4d24a8389a324dfd4006bc39 + languageName: node + linkType: hard + +"npm-run-path@npm:^4.0.1": + version: 4.0.1 + resolution: "npm-run-path@npm:4.0.1" + dependencies: + path-key: "npm:^3.0.0" + checksum: 10c0/6f9353a95288f8455cf64cbeb707b28826a7f29690244c1e4bb61ec573256e021b6ad6651b394eb1ccfd00d6ec50147253aba2c5fe58a57ceb111fad62c519ac + languageName: node + linkType: hard + +"npm-run-path@npm:^5.1.0": + version: 5.3.0 + resolution: "npm-run-path@npm:5.3.0" + dependencies: + path-key: "npm:^4.0.0" + checksum: 10c0/124df74820c40c2eb9a8612a254ea1d557ddfab1581c3e751f825e3e366d9f00b0d76a3c94ecd8398e7f3eee193018622677e95816e8491f0797b21e30b2deba + languageName: node + linkType: hard + +"npm-run-path@npm:^6.0.0": + version: 6.0.0 + resolution: "npm-run-path@npm:6.0.0" + dependencies: + path-key: "npm:^4.0.0" + unicorn-magic: "npm:^0.3.0" + checksum: 10c0/b223c8a0dcd608abf95363ea5c3c0ccc3cd877daf0102eaf1b0f2390d6858d8337fbb7c443af2403b067a7d2c116d10691ecd22ab3c5273c44da1ff8d07753bd + languageName: node + linkType: hard + +"npm-user-validate@npm:^3.0.0": + version: 3.0.0 + resolution: "npm-user-validate@npm:3.0.0" + checksum: 10c0/d6aea1188d65ee6dc45adac88300bee3548b0217b14cdc5270c13af123486271cbafe1f140cec1df5f11c484f705f45a59948086dce4eab2040ce0ba3baebb53 + languageName: node + linkType: hard + +"npm@npm:^10.9.3": + version: 10.9.7 + resolution: "npm@npm:10.9.7" + dependencies: + "@isaacs/string-locale-compare": "npm:^1.1.0" + "@npmcli/arborist": "npm:^8.0.4" + "@npmcli/config": "npm:^9.0.0" + "@npmcli/fs": "npm:^4.0.0" + "@npmcli/map-workspaces": "npm:^4.0.2" + "@npmcli/package-json": "npm:^6.2.0" + "@npmcli/promise-spawn": "npm:^8.0.3" + "@npmcli/redact": "npm:^3.2.2" + "@npmcli/run-script": "npm:^9.1.0" + "@sigstore/tuf": "npm:^3.1.1" + abbrev: "npm:^3.0.1" + archy: "npm:~1.0.0" + cacache: "npm:^19.0.1" + chalk: "npm:^5.6.2" + ci-info: "npm:^4.4.0" + cli-columns: "npm:^4.0.0" + fastest-levenshtein: "npm:^1.0.16" + fs-minipass: "npm:^3.0.3" + glob: "npm:^10.5.0" + graceful-fs: "npm:^4.2.11" + hosted-git-info: "npm:^8.1.0" + ini: "npm:^5.0.0" + init-package-json: "npm:^7.0.2" + is-cidr: "npm:^5.1.1" + json-parse-even-better-errors: "npm:^4.0.0" + libnpmaccess: "npm:^9.0.0" + libnpmdiff: "npm:^7.0.4" + libnpmexec: "npm:^9.0.4" + libnpmfund: "npm:^6.0.4" + libnpmhook: "npm:^11.0.0" + libnpmorg: "npm:^7.0.0" + libnpmpack: "npm:^8.0.4" + libnpmpublish: "npm:^10.0.2" + libnpmsearch: "npm:^8.0.0" + libnpmteam: "npm:^7.0.0" + libnpmversion: "npm:^7.0.0" + make-fetch-happen: "npm:^14.0.3" + minimatch: "npm:^9.0.9" + minipass: "npm:^7.1.3" + minipass-pipeline: "npm:^1.2.4" + ms: "npm:^2.1.2" + node-gyp: "npm:^11.5.0" + nopt: "npm:^8.1.0" + normalize-package-data: "npm:^7.0.1" + npm-audit-report: "npm:^6.0.0" + npm-install-checks: "npm:^7.1.2" + npm-package-arg: "npm:^12.0.2" + npm-pick-manifest: "npm:^10.0.0" + npm-profile: "npm:^11.0.1" + npm-registry-fetch: "npm:^18.0.2" + npm-user-validate: "npm:^3.0.0" + p-map: "npm:^7.0.4" + pacote: "npm:^19.0.1" + parse-conflict-json: "npm:^4.0.0" + proc-log: "npm:^5.0.0" + qrcode-terminal: "npm:^0.12.0" + read: "npm:^4.1.0" + semver: "npm:^7.7.4" + spdx-expression-parse: "npm:^4.0.0" + ssri: "npm:^12.0.0" + supports-color: "npm:^9.4.0" + tar: "npm:^7.5.11" + text-table: "npm:~0.2.0" + tiny-relative-date: "npm:^1.3.0" + treeverse: "npm:^3.0.0" + validate-npm-package-name: "npm:^6.0.2" + which: "npm:^5.0.0" + write-file-atomic: "npm:^6.0.0" + bin: + npm: bin/npm-cli.js + npx: bin/npx-cli.js + checksum: 10c0/8b7a10b342581fa7587fe1ad63c570dbfe21fbc067b45811aa9b35efe5b6ebe9798338ac22b8308ee011d088275c1b4feb6164745de1ed3b3d718c6cd60971b4 + languageName: node + linkType: hard + +"object-assign@npm:^4.0.1": + version: 4.1.1 + resolution: "object-assign@npm:4.1.1" + checksum: 10c0/1f4df9945120325d041ccf7b86f31e8bcc14e73d29171e37a7903050e96b81323784ec59f93f102ec635bcf6fa8034ba3ea0a8c7e69fa202b87ae3b6cec5a414 + languageName: node + linkType: hard + +"onetime@npm:^5.1.2": + version: 5.1.2 + resolution: "onetime@npm:5.1.2" + dependencies: + mimic-fn: "npm:^2.1.0" + checksum: 10c0/ffcef6fbb2692c3c40749f31ea2e22677a876daea92959b8a80b521d95cca7a668c884d8b2045d1d8ee7d56796aa405c405462af112a1477594cc63531baeb8f + languageName: node + linkType: hard + +"onetime@npm:^6.0.0": + version: 6.0.0 + resolution: "onetime@npm:6.0.0" + dependencies: + mimic-fn: "npm:^4.0.0" + checksum: 10c0/4eef7c6abfef697dd4479345a4100c382d73c149d2d56170a54a07418c50816937ad09500e1ed1e79d235989d073a9bade8557122aee24f0576ecde0f392bb6c + languageName: node + linkType: hard + +"p-each-series@npm:^3.0.0": + version: 3.0.0 + resolution: "p-each-series@npm:3.0.0" + checksum: 10c0/695acfd295788a9d6fc68e86a0d205e7bffc17e0e577922d9ed3ae1d2c52566b985637f85af79484ce6fa4b3c1214f2bc75e9bc14974d0ea19f61b13e5ea0c4e + languageName: node + linkType: hard + +"p-event@npm:^6.0.0": + version: 6.0.1 + resolution: "p-event@npm:6.0.1" + dependencies: + p-timeout: "npm:^6.1.2" + checksum: 10c0/c2da4d3f445376db2130d740b41309f97e8802d17277590684ca51cdcafcc77a024ccdd6b1a24c275c49c3c4ef57bbfc499e6d2b3b18813c774aaceb81cde7b4 + languageName: node + linkType: hard + +"p-filter@npm:^4.0.0": + version: 4.1.0 + resolution: "p-filter@npm:4.1.0" + dependencies: + p-map: "npm:^7.0.1" + checksum: 10c0/aaa663a74e7d97846377f1b7f7713692f95ca3320f0e6f7f2f06db073926bd8ef7b452d0eefc102c6c23f7482339fc52ea487aec2071dc01cae054665f3f004e + languageName: node + linkType: hard + +"p-is-promise@npm:^3.0.0": + version: 3.0.0 + resolution: "p-is-promise@npm:3.0.0" + checksum: 10c0/17a52c7a59a31a435a4721a7110faeccb7cc9179cf9cd00016b7a9a7156e2c2ed9d8e2efc0142acab74d5064fbb443eaeaf67517cf3668f2a7c93a7effad5bb9 + languageName: node + linkType: hard + +"p-limit@npm:^1.1.0": + version: 1.3.0 + resolution: "p-limit@npm:1.3.0" + dependencies: + p-try: "npm:^1.0.0" + checksum: 10c0/5c1b1d53d180b2c7501efb04b7c817448e10efe1ba46f4783f8951994d5027e4cd88f36ad79af50546682594c4ebd11702ac4b9364c47f8074890e2acad0edee + languageName: node + linkType: hard + +"p-locate@npm:^2.0.0": + version: 2.0.0 + resolution: "p-locate@npm:2.0.0" + dependencies: + p-limit: "npm:^1.1.0" + checksum: 10c0/82da4be88fb02fd29175e66021610c881938d3cc97c813c71c1a605fac05617d57fd5d3b337494a6106c0edb2a37c860241430851411f1b265108cead34aee67 + languageName: node + linkType: hard + +"p-map@npm:^7.0.1, p-map@npm:^7.0.2, p-map@npm:^7.0.4": + version: 7.0.4 + resolution: "p-map@npm:7.0.4" + checksum: 10c0/a5030935d3cb2919d7e89454d1ce82141e6f9955413658b8c9403cfe379283770ed3048146b44cde168aa9e8c716505f196d5689db0ae3ce9a71521a2fef3abd + languageName: node + linkType: hard + +"p-reduce@npm:^2.0.0": + version: 2.1.0 + resolution: "p-reduce@npm:2.1.0" + checksum: 10c0/27b8ff0fb044995507a06cd6357dffba0f2b98862864745972562a21885d7906ce5c794036d2aaa63ef6303158e41e19aed9f19651dfdafb38548ecec7d0de15 + languageName: node + linkType: hard + +"p-reduce@npm:^3.0.0": + version: 3.0.0 + resolution: "p-reduce@npm:3.0.0" + checksum: 10c0/794cd6c98ad246f6f41fa4b925e56c7d8759b92f67712f5f735418dc7b47cd9aadaecbbbedaea2df879fd9c5d7622ed0b22a2c090d2ec349cf0578485a660196 + languageName: node + linkType: hard + +"p-timeout@npm:^6.1.2": + version: 6.1.4 + resolution: "p-timeout@npm:6.1.4" + checksum: 10c0/019edad1c649ab07552aa456e40ce7575c4b8ae863191477f02ac8d283ac8c66cedef0ca93422735130477a051dfe952ba717641673fd3599befdd13f63bcc33 + languageName: node + linkType: hard + +"p-try@npm:^1.0.0": + version: 1.0.0 + resolution: "p-try@npm:1.0.0" + checksum: 10c0/757ba31de5819502b80c447826fac8be5f16d3cb4fbf9bc8bc4971dba0682e84ac33e4b24176ca7058c69e29f64f34d8d9e9b08e873b7b7bb0aa89d620fa224a + languageName: node + linkType: hard + +"package-json-from-dist@npm:^1.0.0": + version: 1.0.1 + resolution: "package-json-from-dist@npm:1.0.1" + checksum: 10c0/62ba2785eb655fec084a257af34dbe24292ab74516d6aecef97ef72d4897310bc6898f6c85b5cd22770eaa1ce60d55a0230e150fb6a966e3ecd6c511e23d164b + languageName: node + linkType: hard + +"pacote@npm:^19.0.0, pacote@npm:^19.0.1": + version: 19.0.2 + resolution: "pacote@npm:19.0.2" + dependencies: + "@npmcli/git": "npm:^6.0.0" + "@npmcli/installed-package-contents": "npm:^3.0.0" + "@npmcli/package-json": "npm:^6.0.0" + "@npmcli/promise-spawn": "npm:^8.0.0" + "@npmcli/run-script": "npm:^9.0.0" + cacache: "npm:^19.0.0" + fs-minipass: "npm:^3.0.0" + minipass: "npm:^7.0.2" + npm-package-arg: "npm:^12.0.0" + npm-packlist: "npm:^9.0.0" + npm-pick-manifest: "npm:^10.0.0" + npm-registry-fetch: "npm:^18.0.0" + proc-log: "npm:^5.0.0" + promise-retry: "npm:^2.0.1" + sigstore: "npm:^3.0.0" + ssri: "npm:^12.0.0" + tar: "npm:^7.5.10" + bin: + pacote: bin/index.js + checksum: 10c0/a6b847944d5ef3ad6b36b240e562899c8a7c95d444e5ac08eab222ccb6873d1cfef2f53917f8f2a603fb3f25c62a61ab56dd12c8195c643ced4b82c88789a15a + languageName: node + linkType: hard + +"pacote@npm:^20.0.0": + version: 20.0.1 + resolution: "pacote@npm:20.0.1" + dependencies: + "@npmcli/git": "npm:^6.0.0" + "@npmcli/installed-package-contents": "npm:^3.0.0" + "@npmcli/package-json": "npm:^6.0.0" + "@npmcli/promise-spawn": "npm:^8.0.0" + "@npmcli/run-script": "npm:^9.0.0" + cacache: "npm:^19.0.0" + fs-minipass: "npm:^3.0.0" + minipass: "npm:^7.0.2" + npm-package-arg: "npm:^12.0.0" + npm-packlist: "npm:^9.0.0" + npm-pick-manifest: "npm:^10.0.0" + npm-registry-fetch: "npm:^18.0.0" + proc-log: "npm:^5.0.0" + promise-retry: "npm:^2.0.1" + sigstore: "npm:^3.0.0" + ssri: "npm:^12.0.0" + tar: "npm:^7.5.10" + bin: + pacote: bin/index.js + checksum: 10c0/4209b52b60565af3a4f43ca85c698f622a8ed711d4fa7783bc0190745594df76ebe51109da75dea445cbb542330a328d8dc8a00a15ea483535f4af12b43e1a9d + languageName: node + linkType: hard + +"parent-module@npm:^1.0.0": + version: 1.0.1 + resolution: "parent-module@npm:1.0.1" + dependencies: + callsites: "npm:^3.0.0" + checksum: 10c0/c63d6e80000d4babd11978e0d3fee386ca7752a02b035fd2435960ffaa7219dc42146f07069fb65e6e8bf1caef89daf9af7535a39bddf354d78bf50d8294f556 + languageName: node + linkType: hard + +"parse-conflict-json@npm:^4.0.0": + version: 4.0.0 + resolution: "parse-conflict-json@npm:4.0.0" + dependencies: + json-parse-even-better-errors: "npm:^4.0.0" + just-diff: "npm:^6.0.0" + just-diff-apply: "npm:^5.2.0" + checksum: 10c0/5e027cdb6c93a283e32e406e829c1d5b30bfb344ab93dd5a0b8fe983f26dab05dd4d8cba3b3106259f32cbea722f383eda2c8132da3a4a9846803d2bdb004feb + languageName: node + linkType: hard + +"parse-json@npm:^4.0.0": + version: 4.0.0 + resolution: "parse-json@npm:4.0.0" + dependencies: + error-ex: "npm:^1.3.1" + json-parse-better-errors: "npm:^1.0.1" + checksum: 10c0/8d80790b772ccb1bcea4e09e2697555e519d83d04a77c2b4237389b813f82898943a93ffff7d0d2406203bdd0c30dcf95b1661e3a53f83d0e417f053957bef32 + languageName: node + linkType: hard + +"parse-json@npm:^5.2.0": + version: 5.2.0 + resolution: "parse-json@npm:5.2.0" + dependencies: + "@babel/code-frame": "npm:^7.0.0" + error-ex: "npm:^1.3.1" + json-parse-even-better-errors: "npm:^2.3.0" + lines-and-columns: "npm:^1.1.6" + checksum: 10c0/77947f2253005be7a12d858aedbafa09c9ae39eb4863adf330f7b416ca4f4a08132e453e08de2db46459256fb66afaac5ee758b44fe6541b7cdaf9d252e59585 + languageName: node + linkType: hard + +"parse-json@npm:^8.0.0": + version: 8.3.0 + resolution: "parse-json@npm:8.3.0" + dependencies: + "@babel/code-frame": "npm:^7.26.2" + index-to-position: "npm:^1.1.0" + type-fest: "npm:^4.39.1" + checksum: 10c0/0eb5a50f88b8428c8f7a9cf021636c16664f0c62190323652d39e7bdf62953e7c50f9957e55e17dc2d74fc05c89c11f5553f381dbc686735b537ea9b101c7153 + languageName: node + linkType: hard + +"parse-ms@npm:^4.0.0": + version: 4.0.0 + resolution: "parse-ms@npm:4.0.0" + checksum: 10c0/a7900f4f1ebac24cbf5e9708c16fb2fd482517fad353aecd7aefb8c2ba2f85ce017913ccb8925d231770404780df46244ea6fec598b3bde6490882358b4d2d16 + languageName: node + linkType: hard + +"parse5-htmlparser2-tree-adapter@npm:^6.0.0": + version: 6.0.1 + resolution: "parse5-htmlparser2-tree-adapter@npm:6.0.1" + dependencies: + parse5: "npm:^6.0.1" + checksum: 10c0/dfa5960e2aaf125707e19a4b1bc333de49232eba5a6ffffb95d313a7d6087c3b7a274b58bee8d3bd41bdf150638815d1d601a42bbf2a0345208c3c35b1279556 + languageName: node + linkType: hard + +"parse5@npm:^5.1.1": + version: 5.1.1 + resolution: "parse5@npm:5.1.1" + checksum: 10c0/b0f87a77a7fea5f242e3d76917c983bbea47703b9371801d51536b78942db6441cbda174bf84eb30e47315ddc6f8a0b57d68e562c790154430270acd76c1fa03 + languageName: node + linkType: hard + +"parse5@npm:^6.0.1": + version: 6.0.1 + resolution: "parse5@npm:6.0.1" + checksum: 10c0/595821edc094ecbcfb9ddcb46a3e1fe3a718540f8320eff08b8cf6742a5114cce2d46d45f95c26191c11b184dcaf4e2960abcd9c5ed9eb9393ac9a37efcfdecb + languageName: node + linkType: hard + +"path-exists@npm:^3.0.0": + version: 3.0.0 + resolution: "path-exists@npm:3.0.0" + checksum: 10c0/17d6a5664bc0a11d48e2b2127d28a0e58822c6740bde30403f08013da599182289c56518bec89407e3f31d3c2b6b296a4220bc3f867f0911fee6952208b04167 + languageName: node + linkType: hard + +"path-key@npm:^3.0.0, path-key@npm:^3.1.0": + version: 3.1.1 + resolution: "path-key@npm:3.1.1" + checksum: 10c0/748c43efd5a569c039d7a00a03b58eecd1d75f3999f5a28303d75f521288df4823bc057d8784eb72358b2895a05f29a070bc9f1f17d28226cc4e62494cc58c4c + languageName: node + linkType: hard + +"path-key@npm:^4.0.0": + version: 4.0.0 + resolution: "path-key@npm:4.0.0" + checksum: 10c0/794efeef32863a65ac312f3c0b0a99f921f3e827ff63afa5cb09a377e202c262b671f7b3832a4e64731003fa94af0263713962d317b9887bd1e0c48a342efba3 + languageName: node + linkType: hard + +"path-scurry@npm:^1.11.1": + version: 1.11.1 + resolution: "path-scurry@npm:1.11.1" + dependencies: + lru-cache: "npm:^10.2.0" + minipass: "npm:^5.0.0 || ^6.0.2 || ^7.0.0" + checksum: 10c0/32a13711a2a505616ae1cc1b5076801e453e7aae6ac40ab55b388bb91b9d0547a52f5aaceff710ea400205f18691120d4431e520afbe4266b836fadede15872d + languageName: node + linkType: hard + +"path-type@npm:^4.0.0": + version: 4.0.0 + resolution: "path-type@npm:4.0.0" + checksum: 10c0/666f6973f332f27581371efaf303fd6c272cc43c2057b37aa99e3643158c7e4b2626549555d88626e99ea9e046f82f32e41bbde5f1508547e9a11b149b52387c + languageName: node + linkType: hard + +"picocolors@npm:^1.1.1": + version: 1.1.1 + resolution: "picocolors@npm:1.1.1" + checksum: 10c0/e2e3e8170ab9d7c7421969adaa7e1b31434f789afb9b3f115f6b96d91945041ac3ceb02e9ec6fe6510ff036bcc0bf91e69a1772edc0b707e12b19c0f2d6bcf58 + languageName: node + linkType: hard + +"picomatch@npm:^2.3.1": + version: 2.3.1 + resolution: "picomatch@npm:2.3.1" + checksum: 10c0/26c02b8d06f03206fc2ab8d16f19960f2ff9e81a658f831ecb656d8f17d9edc799e8364b1f4a7873e89d9702dff96204be0fa26fe4181f6843f040f819dac4be + languageName: node + linkType: hard + +"picomatch@npm:^4.0.3": + version: 4.0.3 + resolution: "picomatch@npm:4.0.3" + checksum: 10c0/9582c951e95eebee5434f59e426cddd228a7b97a0161a375aed4be244bd3fe8e3a31b846808ea14ef2c8a2527a6eeab7b3946a67d5979e81694654f939473ae2 + languageName: node + linkType: hard + +"pify@npm:^3.0.0": + version: 3.0.0 + resolution: "pify@npm:3.0.0" + checksum: 10c0/fead19ed9d801f1b1fcd0638a1ac53eabbb0945bf615f2f8806a8b646565a04a1b0e7ef115c951d225f042cca388fdc1cd3add46d10d1ed6951c20bd2998af10 + languageName: node + linkType: hard + +"pkg-conf@npm:^2.1.0": + version: 2.1.0 + resolution: "pkg-conf@npm:2.1.0" + dependencies: + find-up: "npm:^2.0.0" + load-json-file: "npm:^4.0.0" + checksum: 10c0/e1474a4f7714ee78204b4a7f2316dec9e59887762bdc126ebd0eb701bbde7c6a6da65c4dc9c2a7c1eaeee49914009bf4a4368f5d9894c596ddf812ff982fdb05 + languageName: node + linkType: hard + +"postcss-selector-parser@npm:^7.0.0": + version: 7.1.1 + resolution: "postcss-selector-parser@npm:7.1.1" + dependencies: + cssesc: "npm:^3.0.0" + util-deprecate: "npm:^1.0.2" + checksum: 10c0/02d3b1589ddcddceed4b583b098b95a7266dacd5135f041e5d913ebb48e874fd333a36e564cc9a2ec426a464cb18db11cb192ac76247aced5eba8c951bf59507 + languageName: node + linkType: hard + +"pretty-ms@npm:^9.2.0": + version: 9.3.0 + resolution: "pretty-ms@npm:9.3.0" + dependencies: + parse-ms: "npm:^4.0.0" + checksum: 10c0/555ea39a1de48a30601938aedb76d682871d33b6dee015281c37108921514b11e1792928b1648c2e5589acc73c8ef0fb5e585fb4c718e340a28b86799e90fb34 + languageName: node + linkType: hard + +"proc-log@npm:^5.0.0": + version: 5.0.0 + resolution: "proc-log@npm:5.0.0" + checksum: 10c0/bbe5edb944b0ad63387a1d5b1911ae93e05ce8d0f60de1035b218cdcceedfe39dbd2c697853355b70f1a090f8f58fe90da487c85216bf9671f9499d1a897e9e3 + languageName: node + linkType: hard + +"process-nextick-args@npm:~2.0.0": + version: 2.0.1 + resolution: "process-nextick-args@npm:2.0.1" + checksum: 10c0/bec089239487833d46b59d80327a1605e1c5287eaad770a291add7f45fda1bb5e28b38e0e061add0a1d0ee0984788ce74fa394d345eed1c420cacf392c554367 + languageName: node + linkType: hard + +"proggy@npm:^3.0.0": + version: 3.0.0 + resolution: "proggy@npm:3.0.0" + checksum: 10c0/b4265664405e780edf7a164b2424bb59fc7bd3ab917365c88c6540e5f3bedcbbfb1a534da9c6a4a5570f374a41ef6942e9a4e862dc3ea744798b6c7be63e4351 + languageName: node + linkType: hard + +"promise-all-reject-late@npm:^1.0.0": + version: 1.0.1 + resolution: "promise-all-reject-late@npm:1.0.1" + checksum: 10c0/f1af0c7b0067e84d64751148ee5bb6c3e84f4a4d1316d6fe56261e1d2637cf71b49894bcbd2c6daf7d45afb1bc99efc3749be277c3e0518b70d0c5a29d037011 + languageName: node + linkType: hard + +"promise-call-limit@npm:^3.0.1": + version: 3.0.2 + resolution: "promise-call-limit@npm:3.0.2" + checksum: 10c0/1f984c16025925594d738833f5da7525b755f825a198d5a0cac1c0280b4f38ecc3c32c1f4e5ef614ddcfd6718c1a8c3f98a3290ae6f421342281c9a88c488bf7 + languageName: node + linkType: hard + +"promise-retry@npm:^2.0.1": + version: 2.0.1 + resolution: "promise-retry@npm:2.0.1" + dependencies: + err-code: "npm:^2.0.2" + retry: "npm:^0.12.0" + checksum: 10c0/9c7045a1a2928094b5b9b15336dcd2a7b1c052f674550df63cc3f36cd44028e5080448175b6f6ca32b642de81150f5e7b1a98b728f15cb069f2dd60ac2616b96 + languageName: node + linkType: hard + +"promzard@npm:^2.0.0": + version: 2.0.0 + resolution: "promzard@npm:2.0.0" + dependencies: + read: "npm:^4.0.0" + checksum: 10c0/09d8c8c5d49ebed99686b7bed386f02ef32fc90cef4b2626c46e39d74903735a1ca88788613076561fc5548a76fe5f91897f2afd8025ce77dfa1f603eaaee1cd + languageName: node + linkType: hard + +"proto-list@npm:~1.2.1": + version: 1.2.4 + resolution: "proto-list@npm:1.2.4" + checksum: 10c0/b9179f99394ec8a68b8afc817690185f3b03933f7b46ce2e22c1930dc84b60d09f5ad222beab4e59e58c6c039c7f7fcf620397235ef441a356f31f9744010e12 + languageName: node + linkType: hard + +"qrcode-terminal@npm:^0.12.0": + version: 0.12.0 + resolution: "qrcode-terminal@npm:0.12.0" + bin: + qrcode-terminal: ./bin/qrcode-terminal.js + checksum: 10c0/1d8996a743d6c95e22056bd45fe958c306213adc97d7ef8cf1e03bc1aeeb6f27180a747ec3d761141921351eb1e3ca688f7b673ab54cdae9fa358dffaa49563c + languageName: node + linkType: hard + +"rc@npm:^1.2.8": + version: 1.2.8 + resolution: "rc@npm:1.2.8" + dependencies: + deep-extend: "npm:^0.6.0" + ini: "npm:~1.3.0" + minimist: "npm:^1.2.0" + strip-json-comments: "npm:~2.0.1" + bin: + rc: ./cli.js + checksum: 10c0/24a07653150f0d9ac7168e52943cc3cb4b7a22c0e43c7dff3219977c2fdca5a2760a304a029c20811a0e79d351f57d46c9bde216193a0f73978496afc2b85b15 + languageName: node + linkType: hard + +"read-cmd-shim@npm:^5.0.0": + version: 5.0.0 + resolution: "read-cmd-shim@npm:5.0.0" + checksum: 10c0/5688aea2742d928575a1dd87ee0ce691f57b344935fe87d6460067951e7a3bb3677501513316785e1e9ea43b0bb1635eacba3b00b81ad158f9b23512f1de26d2 + languageName: node + linkType: hard + +"read-package-json-fast@npm:^4.0.0": + version: 4.0.0 + resolution: "read-package-json-fast@npm:4.0.0" + dependencies: + json-parse-even-better-errors: "npm:^4.0.0" + npm-normalize-package-bin: "npm:^4.0.0" + checksum: 10c0/8a03509ae8e852f1abc4b109c1be571dd90ac9ea65d55433b2fe287e409113441a9b00df698288fe48aa786c1a2550569d47b5ab01ed83ada073d691d5aff582 + languageName: node + linkType: hard + +"read-package-up@npm:^11.0.0": + version: 11.0.0 + resolution: "read-package-up@npm:11.0.0" + dependencies: + find-up-simple: "npm:^1.0.0" + read-pkg: "npm:^9.0.0" + type-fest: "npm:^4.6.0" + checksum: 10c0/ffee09613c2b3c3ff7e7b5e838aa01f33cba5c6dfa14f87bf6f64ed27e32678e5550e712fd7e3f3105a05c43aa774d084af04ee86d3044978edb69f30ee4505a + languageName: node + linkType: hard + +"read-pkg@npm:^9.0.0": + version: 9.0.1 + resolution: "read-pkg@npm:9.0.1" + dependencies: + "@types/normalize-package-data": "npm:^2.4.3" + normalize-package-data: "npm:^6.0.0" + parse-json: "npm:^8.0.0" + type-fest: "npm:^4.6.0" + unicorn-magic: "npm:^0.1.0" + checksum: 10c0/f3e27549dcdb18335597f4125a3d093a40ab0a18c16a6929a1575360ed5d8679b709b4a672730d9abf6aa8537a7f02bae0b4b38626f99409255acbd8f72f9964 + languageName: node + linkType: hard + +"read@npm:^4.0.0, read@npm:^4.1.0": + version: 4.1.0 + resolution: "read@npm:4.1.0" + dependencies: + mute-stream: "npm:^2.0.0" + checksum: 10c0/5ad25883d6ffd0e63afe538166e22f1b67108d11fc9f9df65dedf0224b28871b0576f4f941c6f28febe53ca91a0338073c732be3fbd1a2bdad37bd25a9ff5ccf + languageName: node + linkType: hard + +"readable-stream@npm:^2.0.0, readable-stream@npm:^2.0.2, readable-stream@npm:~2.3.6": + version: 2.3.8 + resolution: "readable-stream@npm:2.3.8" + dependencies: + core-util-is: "npm:~1.0.0" + inherits: "npm:~2.0.3" + isarray: "npm:~1.0.0" + process-nextick-args: "npm:~2.0.0" + safe-buffer: "npm:~5.1.1" + string_decoder: "npm:~1.1.1" + util-deprecate: "npm:~1.0.1" + checksum: 10c0/7efdb01f3853bc35ac62ea25493567bf588773213f5f4a79f9c365e1ad13bab845ac0dae7bc946270dc40c3929483228415e92a3fc600cc7e4548992f41ee3fa + languageName: node + linkType: hard + +"registry-auth-token@npm:^5.0.0": + version: 5.1.1 + resolution: "registry-auth-token@npm:5.1.1" + dependencies: + "@pnpm/npm-conf": "npm:^3.0.2" + checksum: 10c0/86b0f7fd87d327cb4177fee69bcf96563147ea72e206bc9c7a6a50a51c785a31b83a6c45956a489ed292d23b908b2755a075d0b2f7fec1ba91b1fb800b24cee3 + languageName: node + linkType: hard + +"require-directory@npm:^2.1.1": + version: 2.1.1 + resolution: "require-directory@npm:2.1.1" + checksum: 10c0/83aa76a7bc1531f68d92c75a2ca2f54f1b01463cb566cf3fbc787d0de8be30c9dbc211d1d46be3497dac5785fe296f2dd11d531945ac29730643357978966e99 + languageName: node + linkType: hard + +"resolve-from@npm:^4.0.0": + version: 4.0.0 + resolution: "resolve-from@npm:4.0.0" + checksum: 10c0/8408eec31a3112ef96e3746c37be7d64020cda07c03a920f5024e77290a218ea758b26ca9529fd7b1ad283947f34b2291c1c0f6aa0ed34acfdda9c6014c8d190 + languageName: node + linkType: hard + +"resolve-from@npm:^5.0.0": + version: 5.0.0 + resolution: "resolve-from@npm:5.0.0" + checksum: 10c0/b21cb7f1fb746de8107b9febab60095187781137fd803e6a59a76d421444b1531b641bba5857f5dc011974d8a5c635d61cec49e6bd3b7fc20e01f0fafc4efbf2 + languageName: node + linkType: hard + +"retry@npm:^0.12.0": + version: 0.12.0 + resolution: "retry@npm:0.12.0" + checksum: 10c0/59933e8501727ba13ad73ef4a04d5280b3717fd650408460c987392efe9d7be2040778ed8ebe933c5cbd63da3dcc37919c141ef8af0a54a6e4fca5a2af177bfe + languageName: node + linkType: hard + +"safe-buffer@npm:~5.1.0, safe-buffer@npm:~5.1.1": + version: 5.1.2 + resolution: "safe-buffer@npm:5.1.2" + checksum: 10c0/780ba6b5d99cc9a40f7b951d47152297d0e260f0df01472a1b99d4889679a4b94a13d644f7dbc4f022572f09ae9005fa2fbb93bbbd83643316f365a3e9a45b21 + languageName: node + linkType: hard + +"safer-buffer@npm:>= 2.1.2 < 3.0.0": + version: 2.1.2 + resolution: "safer-buffer@npm:2.1.2" + checksum: 10c0/7e3c8b2e88a1841c9671094bbaeebd94448111dd90a81a1f606f3f67708a6ec57763b3b47f06da09fc6054193e0e6709e77325415dc8422b04497a8070fa02d4 + languageName: node + linkType: hard + +"semantic-release@npm:^24.0.0": + version: 24.2.9 + resolution: "semantic-release@npm:24.2.9" + dependencies: + "@semantic-release/commit-analyzer": "npm:^13.0.0-beta.1" + "@semantic-release/error": "npm:^4.0.0" + "@semantic-release/github": "npm:^11.0.0" + "@semantic-release/npm": "npm:^12.0.2" + "@semantic-release/release-notes-generator": "npm:^14.0.0-beta.1" + aggregate-error: "npm:^5.0.0" + cosmiconfig: "npm:^9.0.0" + debug: "npm:^4.0.0" + env-ci: "npm:^11.0.0" + execa: "npm:^9.0.0" + figures: "npm:^6.0.0" + find-versions: "npm:^6.0.0" + get-stream: "npm:^6.0.0" + git-log-parser: "npm:^1.2.0" + hook-std: "npm:^4.0.0" + hosted-git-info: "npm:^8.0.0" + import-from-esm: "npm:^2.0.0" + lodash-es: "npm:^4.17.21" + marked: "npm:^15.0.0" + marked-terminal: "npm:^7.3.0" + micromatch: "npm:^4.0.2" + p-each-series: "npm:^3.0.0" + p-reduce: "npm:^3.0.0" + read-package-up: "npm:^11.0.0" + resolve-from: "npm:^5.0.0" + semver: "npm:^7.3.2" + semver-diff: "npm:^5.0.0" + signale: "npm:^1.2.1" + yargs: "npm:^17.5.1" + bin: + semantic-release: bin/semantic-release.js + checksum: 10c0/b87dcc640c3af33a3e511a8ee1cf345a54d83f7355fb87b4a4297419daa51ff30ec7c2dcd4a8a2525505018d32f3cdff63e3dd722824d5493c4a8f0c171cb254 + languageName: node + linkType: hard + +"semver-diff@npm:^5.0.0": + version: 5.0.0 + resolution: "semver-diff@npm:5.0.0" + dependencies: + semver: "npm:^7.3.5" + checksum: 10c0/8d534586074e54773c6dc6ec952409b21c97cc8f965e9e397ab447e3b1834ae64d6a2990dc9421a9ebee41c5bc7c1d0786047df24121e43640f8213b0143ea54 + languageName: node + linkType: hard + +"semver-regex@npm:^4.0.5": + version: 4.0.5 + resolution: "semver-regex@npm:4.0.5" + checksum: 10c0/c270eda133691dfaab90318df995e96222e4c26c47b17f7c8bd5e5fe88b81ed67b59695fe27546e0314b0f0423c7faed1f93379ad9db47c816df2ddf770918ff + languageName: node + linkType: hard + +"semver@npm:^7.1.1, semver@npm:^7.1.2, semver@npm:^7.3.2, semver@npm:^7.3.5, semver@npm:^7.3.7, semver@npm:^7.5.2, semver@npm:^7.5.3, semver@npm:^7.7.4": + version: 7.7.4 + resolution: "semver@npm:7.7.4" + bin: + semver: bin/semver.js + checksum: 10c0/5215ad0234e2845d4ea5bb9d836d42b03499546ddafb12075566899fc617f68794bb6f146076b6881d755de17d6c6cc73372555879ec7dce2c2feee947866ad2 + languageName: node + linkType: hard + +"shebang-command@npm:^2.0.0": + version: 2.0.0 + resolution: "shebang-command@npm:2.0.0" + dependencies: + shebang-regex: "npm:^3.0.0" + checksum: 10c0/a41692e7d89a553ef21d324a5cceb5f686d1f3c040759c50aab69688634688c5c327f26f3ecf7001ebfd78c01f3c7c0a11a7c8bfd0a8bc9f6240d4f40b224e4e + languageName: node + linkType: hard + +"shebang-regex@npm:^3.0.0": + version: 3.0.0 + resolution: "shebang-regex@npm:3.0.0" + checksum: 10c0/1dbed0726dd0e1152a92696c76c7f06084eb32a90f0528d11acd764043aacf76994b2fb30aa1291a21bd019d6699164d048286309a278855ee7bec06cf6fb690 + languageName: node + linkType: hard + +"signal-exit@npm:^3.0.3": + version: 3.0.7 + resolution: "signal-exit@npm:3.0.7" + checksum: 10c0/25d272fa73e146048565e08f3309d5b942c1979a6f4a58a8c59d5fa299728e9c2fcd1a759ec870863b1fd38653670240cd420dad2ad9330c71f36608a6a1c912 + languageName: node + linkType: hard + +"signal-exit@npm:^4.0.1, signal-exit@npm:^4.1.0": + version: 4.1.0 + resolution: "signal-exit@npm:4.1.0" + checksum: 10c0/41602dce540e46d599edba9d9860193398d135f7ff72cab629db5171516cfae628d21e7bfccde1bbfdf11c48726bc2a6d1a8fb8701125852fbfda7cf19c6aa83 + languageName: node + linkType: hard + +"signale@npm:^1.2.1": + version: 1.4.0 + resolution: "signale@npm:1.4.0" + dependencies: + chalk: "npm:^2.3.2" + figures: "npm:^2.0.0" + pkg-conf: "npm:^2.1.0" + checksum: 10c0/3b637421368a30805da3948f82350cb9959ddfb19073f44609495384b98baba1c62b1c5c094db57000836c8bc84c6c05c979aa7e072ceeaaf0032d7991b329c7 + languageName: node + linkType: hard + +"sigstore@npm:^3.0.0": + version: 3.1.0 + resolution: "sigstore@npm:3.1.0" + dependencies: + "@sigstore/bundle": "npm:^3.1.0" + "@sigstore/core": "npm:^2.0.0" + "@sigstore/protobuf-specs": "npm:^0.4.0" + "@sigstore/sign": "npm:^3.1.0" + "@sigstore/tuf": "npm:^3.1.0" + "@sigstore/verify": "npm:^2.1.0" + checksum: 10c0/c037f5526e698ec6de8654f6be6b6fa52bf52f2ffcd78109cdefc6d824bbb8390324522dcb0f84d57a674948ac53aef34dd77f9de66c91bcd91d0af56bb91c7e + languageName: node + linkType: hard + +"skin-tone@npm:^2.0.0": + version: 2.0.0 + resolution: "skin-tone@npm:2.0.0" + dependencies: + unicode-emoji-modifier-base: "npm:^1.0.0" + checksum: 10c0/82d4c2527864f9cbd6cb7f3c4abb31e2224752234d5013b881d3e34e9ab543545b05206df5a17d14b515459fcb265ce409f9cfe443903176b0360cd20e4e4ba5 + languageName: node + linkType: hard + +"smart-buffer@npm:^4.2.0": + version: 4.2.0 + resolution: "smart-buffer@npm:4.2.0" + checksum: 10c0/a16775323e1404dd43fabafe7460be13a471e021637bc7889468eb45ce6a6b207261f454e4e530a19500cc962c4cc5348583520843b363f4193cee5c00e1e539 + languageName: node + linkType: hard + +"socks-proxy-agent@npm:^8.0.3": + version: 8.0.5 + resolution: "socks-proxy-agent@npm:8.0.5" + dependencies: + agent-base: "npm:^7.1.2" + debug: "npm:^4.3.4" + socks: "npm:^2.8.3" + checksum: 10c0/5d2c6cecba6821389aabf18728325730504bf9bb1d9e342e7987a5d13badd7a98838cc9a55b8ed3cb866ad37cc23e1086f09c4d72d93105ce9dfe76330e9d2a6 + languageName: node + linkType: hard + +"socks@npm:^2.8.3": + version: 2.8.7 + resolution: "socks@npm:2.8.7" + dependencies: + ip-address: "npm:^10.0.1" + smart-buffer: "npm:^4.2.0" + checksum: 10c0/2805a43a1c4bcf9ebf6e018268d87b32b32b06fbbc1f9282573583acc155860dc361500f89c73bfbb157caa1b4ac78059eac0ef15d1811eb0ca75e0bdadbc9d2 + languageName: node + linkType: hard + +"source-map@npm:^0.6.1": + version: 0.6.1 + resolution: "source-map@npm:0.6.1" + checksum: 10c0/ab55398007c5e5532957cb0beee2368529618ac0ab372d789806f5718123cc4367d57de3904b4e6a4170eb5a0b0f41373066d02ca0735a0c4d75c7d328d3e011 + languageName: node + linkType: hard + +"spawn-error-forwarder@npm:~1.0.0": + version: 1.0.0 + resolution: "spawn-error-forwarder@npm:1.0.0" + checksum: 10c0/531cb73404af88b5400f9b7a976836b9f09cb48e4c0c79784ad80001ea942eb256e311f14cc7d171539cd1a86297c1c5461177c3fa736ac30627f5f8a6b06db6 + languageName: node + linkType: hard + +"spdx-correct@npm:^3.0.0": + version: 3.2.0 + resolution: "spdx-correct@npm:3.2.0" + dependencies: + spdx-expression-parse: "npm:^3.0.0" + spdx-license-ids: "npm:^3.0.0" + checksum: 10c0/49208f008618b9119208b0dadc9208a3a55053f4fd6a0ae8116861bd22696fc50f4142a35ebfdb389e05ccf2de8ad142573fefc9e26f670522d899f7b2fe7386 + languageName: node + linkType: hard + +"spdx-exceptions@npm:^2.1.0": + version: 2.5.0 + resolution: "spdx-exceptions@npm:2.5.0" + checksum: 10c0/37217b7762ee0ea0d8b7d0c29fd48b7e4dfb94096b109d6255b589c561f57da93bf4e328c0290046115961b9209a8051ad9f525e48d433082fc79f496a4ea940 + languageName: node + linkType: hard + +"spdx-expression-parse@npm:^3.0.0": + version: 3.0.1 + resolution: "spdx-expression-parse@npm:3.0.1" + dependencies: + spdx-exceptions: "npm:^2.1.0" + spdx-license-ids: "npm:^3.0.0" + checksum: 10c0/6f8a41c87759fa184a58713b86c6a8b028250f158159f1d03ed9d1b6ee4d9eefdc74181c8ddc581a341aa971c3e7b79e30b59c23b05d2436d5de1c30bdef7171 + languageName: node + linkType: hard + +"spdx-expression-parse@npm:^4.0.0": + version: 4.0.0 + resolution: "spdx-expression-parse@npm:4.0.0" + dependencies: + spdx-exceptions: "npm:^2.1.0" + spdx-license-ids: "npm:^3.0.0" + checksum: 10c0/965c487e77f4fb173f1c471f3eef4eb44b9f0321adc7f93d95e7620da31faa67d29356eb02523cd7df8a7fc1ec8238773cdbf9e45bd050329d2b26492771b736 + languageName: node + linkType: hard + +"spdx-license-ids@npm:^3.0.0": + version: 3.0.23 + resolution: "spdx-license-ids@npm:3.0.23" + checksum: 10c0/8495620f6f2a237749cce922ea2d593a66f7885c301b1a0f5542183e7041182f27f616a8f13345cefdea0c9b3e0899328e0aa8cec100cf4f3fac4bb3bd975515 + languageName: node + linkType: hard + +"split2@npm:~1.0.0": + version: 1.0.0 + resolution: "split2@npm:1.0.0" + dependencies: + through2: "npm:~2.0.0" + checksum: 10c0/5923936c492ebbdfed66705a25a1d53eb98d2cff740421f4b558842fdf731f108872c24fe13fa091feef8b564543bdf25c967c03fce6ea09b7119b9d3ed07eda + languageName: node + linkType: hard + +"ssri@npm:^12.0.0": + version: 12.0.0 + resolution: "ssri@npm:12.0.0" + dependencies: + minipass: "npm:^7.0.3" + checksum: 10c0/caddd5f544b2006e88fa6b0124d8d7b28208b83c72d7672d5ade44d794525d23b540f3396108c4eb9280dcb7c01f0bef50682f5b4b2c34291f7c5e211fd1417d + languageName: node + linkType: hard + +"stream-combiner2@npm:~1.1.1": + version: 1.1.1 + resolution: "stream-combiner2@npm:1.1.1" + dependencies: + duplexer2: "npm:~0.1.0" + readable-stream: "npm:^2.0.2" + checksum: 10c0/96a14ae94493aad307176d0c0a795446cedf6c49d11d08e5d0a56bcf9f22352b0dd148b0497c8456f08b00da0867288e9750bf0286b71f6b621c0f2ba6768758 + languageName: node + linkType: hard + +"string-width-cjs@npm:string-width@^4.2.0, string-width@npm:^4.1.0, string-width@npm:^4.2.0, string-width@npm:^4.2.3": + version: 4.2.3 + resolution: "string-width@npm:4.2.3" + dependencies: + emoji-regex: "npm:^8.0.0" + is-fullwidth-code-point: "npm:^3.0.0" + strip-ansi: "npm:^6.0.1" + checksum: 10c0/1e525e92e5eae0afd7454086eed9c818ee84374bb80328fc41217ae72ff5f065ef1c9d7f72da41de40c75fa8bb3dee63d92373fd492c84260a552c636392a47b + languageName: node + linkType: hard + +"string-width@npm:^5.0.1, string-width@npm:^5.1.2": + version: 5.1.2 + resolution: "string-width@npm:5.1.2" + dependencies: + eastasianwidth: "npm:^0.2.0" + emoji-regex: "npm:^9.2.2" + strip-ansi: "npm:^7.0.1" + checksum: 10c0/ab9c4264443d35b8b923cbdd513a089a60de339216d3b0ed3be3ba57d6880e1a192b70ae17225f764d7adbf5994e9bb8df253a944736c15a0240eff553c678ca + languageName: node + linkType: hard + +"string_decoder@npm:~1.1.1": + version: 1.1.1 + resolution: "string_decoder@npm:1.1.1" + dependencies: + safe-buffer: "npm:~5.1.0" + checksum: 10c0/b4f89f3a92fd101b5653ca3c99550e07bdf9e13b35037e9e2a1c7b47cec4e55e06ff3fc468e314a0b5e80bfbaf65c1ca5a84978764884ae9413bec1fc6ca924e + languageName: node + linkType: hard + +"strip-ansi-cjs@npm:strip-ansi@^6.0.1, strip-ansi@npm:^6.0.0, strip-ansi@npm:^6.0.1": + version: 6.0.1 + resolution: "strip-ansi@npm:6.0.1" + dependencies: + ansi-regex: "npm:^5.0.1" + checksum: 10c0/1ae5f212a126fe5b167707f716942490e3933085a5ff6c008ab97ab2f272c8025d3aa218b7bd6ab25729ca20cc81cddb252102f8751e13482a5199e873680952 + languageName: node + linkType: hard + +"strip-ansi@npm:^7.0.1": + version: 7.2.0 + resolution: "strip-ansi@npm:7.2.0" + dependencies: + ansi-regex: "npm:^6.2.2" + checksum: 10c0/544d13b7582f8254811ea97db202f519e189e59d35740c46095897e254e4f1aa9fe1524a83ad6bc5ad67d4dd6c0281d2e0219ed62b880a6238a16a17d375f221 + languageName: node + linkType: hard + +"strip-bom@npm:^3.0.0": + version: 3.0.0 + resolution: "strip-bom@npm:3.0.0" + checksum: 10c0/51201f50e021ef16672593d7434ca239441b7b760e905d9f33df6e4f3954ff54ec0e0a06f100d028af0982d6f25c35cd5cda2ce34eaebccd0250b8befb90d8f1 + languageName: node + linkType: hard + +"strip-final-newline@npm:^2.0.0": + version: 2.0.0 + resolution: "strip-final-newline@npm:2.0.0" + checksum: 10c0/bddf8ccd47acd85c0e09ad7375409d81653f645fda13227a9d459642277c253d877b68f2e5e4d819fe75733b0e626bac7e954c04f3236f6d196f79c94fa4a96f + languageName: node + linkType: hard + +"strip-final-newline@npm:^3.0.0": + version: 3.0.0 + resolution: "strip-final-newline@npm:3.0.0" + checksum: 10c0/a771a17901427bac6293fd416db7577e2bc1c34a19d38351e9d5478c3c415f523f391003b42ed475f27e33a78233035df183525395f731d3bfb8cdcbd4da08ce + languageName: node + linkType: hard + +"strip-final-newline@npm:^4.0.0": + version: 4.0.0 + resolution: "strip-final-newline@npm:4.0.0" + checksum: 10c0/b0cf2b62d597a1b0e3ebc42b88767f0a0d45601f89fd379a928a1812c8779440c81abba708082c946445af1d6b62d5f16e2a7cf4f30d9d6587b89425fae801ff + languageName: node + linkType: hard + +"strip-json-comments@npm:~2.0.1": + version: 2.0.1 + resolution: "strip-json-comments@npm:2.0.1" + checksum: 10c0/b509231cbdee45064ff4f9fd73609e2bcc4e84a4d508e9dd0f31f70356473fde18abfb5838c17d56fb236f5a06b102ef115438de0600b749e818a35fbbc48c43 + languageName: node + linkType: hard + +"super-regex@npm:^1.0.0": + version: 1.1.0 + resolution: "super-regex@npm:1.1.0" + dependencies: + function-timeout: "npm:^1.0.1" + make-asynchronous: "npm:^1.0.1" + time-span: "npm:^5.1.0" + checksum: 10c0/8135ed40e4e3c5ee7305ee8545e8ab99722e671e71546ef877bc25a5980e04bafe9abef44dd28abd801160340a331280b1d91b24ce97c67674931bb20d798eda + languageName: node + linkType: hard + +"supports-color@npm:^5.3.0": + version: 5.5.0 + resolution: "supports-color@npm:5.5.0" + dependencies: + has-flag: "npm:^3.0.0" + checksum: 10c0/6ae5ff319bfbb021f8a86da8ea1f8db52fac8bd4d499492e30ec17095b58af11f0c55f8577390a749b1c4dde691b6a0315dab78f5f54c9b3d83f8fb5905c1c05 + languageName: node + linkType: hard + +"supports-color@npm:^7.0.0, supports-color@npm:^7.1.0": + version: 7.2.0 + resolution: "supports-color@npm:7.2.0" + dependencies: + has-flag: "npm:^4.0.0" + checksum: 10c0/afb4c88521b8b136b5f5f95160c98dee7243dc79d5432db7efc27efb219385bbc7d9427398e43dd6cc730a0f87d5085ce1652af7efbe391327bc0a7d0f7fc124 + languageName: node + linkType: hard + +"supports-color@npm:^9.4.0": + version: 9.4.0 + resolution: "supports-color@npm:9.4.0" + checksum: 10c0/6c24e6b2b64c6a60e5248490cfa50de5924da32cf09ae357ad8ebbf305cc5d2717ba705a9d4cb397d80bbf39417e8fdc8d7a0ce18bd0041bf7b5b456229164e4 + languageName: node + linkType: hard + +"supports-hyperlinks@npm:^3.1.0": + version: 3.2.0 + resolution: "supports-hyperlinks@npm:3.2.0" + dependencies: + has-flag: "npm:^4.0.0" + supports-color: "npm:^7.0.0" + checksum: 10c0/bca527f38d4c45bc95d6a24225944675746c515ddb91e2456d00ae0b5c537658e9dd8155b996b191941b0c19036195a098251304b9082bbe00cd1781f3cd838e + languageName: node + linkType: hard + +"tar@npm:^7.4.3, tar@npm:^7.5.10, tar@npm:^7.5.11": + version: 7.5.12 + resolution: "tar@npm:7.5.12" + dependencies: + "@isaacs/fs-minipass": "npm:^4.0.0" + chownr: "npm:^3.0.0" + minipass: "npm:^7.1.2" + minizlib: "npm:^3.1.0" + yallist: "npm:^5.0.0" + checksum: 10c0/3825c5974f5fde792981f47ee9ffea021ee7f4b552b7ab95eeb98e5dfadfd5a5d5861f01fb772e2e5637a41980d3c019fd6cdad1be48b462b886abd7fe0fa17c + languageName: node + linkType: hard + +"temp-dir@npm:^3.0.0": + version: 3.0.0 + resolution: "temp-dir@npm:3.0.0" + checksum: 10c0/a86978a400984cd5f315b77ebf3fe53bb58c61f192278cafcb1f3fb32d584a21dc8e08b93171d7874b7cc972234d3455c467306cc1bfc4524b622e5ad3bfd671 + languageName: node + linkType: hard + +"tempy@npm:^3.0.0": + version: 3.2.0 + resolution: "tempy@npm:3.2.0" + dependencies: + is-stream: "npm:^3.0.0" + temp-dir: "npm:^3.0.0" + type-fest: "npm:^2.12.2" + unique-string: "npm:^3.0.0" + checksum: 10c0/0653c9b36323d2f25e8d24ba32f59e8dd2a9cb49740413516d8a890bb3a4d5885b56652b7231b7cebe4a5441076e8432bd5a03a76ee038c3c1f5fbb24f8cc771 + languageName: node + linkType: hard + +"text-table@npm:~0.2.0": + version: 0.2.0 + resolution: "text-table@npm:0.2.0" + checksum: 10c0/02805740c12851ea5982686810702e2f14369a5f4c5c40a836821e3eefc65ffeec3131ba324692a37608294b0fd8c1e55a2dd571ffed4909822787668ddbee5c + languageName: node + linkType: hard + +"thenify-all@npm:^1.0.0": + version: 1.6.0 + resolution: "thenify-all@npm:1.6.0" + dependencies: + thenify: "npm:>= 3.1.0 < 4" + checksum: 10c0/9b896a22735e8122754fe70f1d65f7ee691c1d70b1f116fda04fea103d0f9b356e3676cb789506e3909ae0486a79a476e4914b0f92472c2e093d206aed4b7d6b + languageName: node + linkType: hard + +"thenify@npm:>= 3.1.0 < 4": + version: 3.3.1 + resolution: "thenify@npm:3.3.1" + dependencies: + any-promise: "npm:^1.0.0" + checksum: 10c0/f375aeb2b05c100a456a30bc3ed07ef03a39cbdefe02e0403fb714b8c7e57eeaad1a2f5c4ecfb9ce554ce3db9c2b024eba144843cd9e344566d9fcee73b04767 + languageName: node + linkType: hard + +"through2@npm:~2.0.0": + version: 2.0.5 + resolution: "through2@npm:2.0.5" + dependencies: + readable-stream: "npm:~2.3.6" + xtend: "npm:~4.0.1" + checksum: 10c0/cbfe5b57943fa12b4f8c043658c2a00476216d79c014895cef1ac7a1d9a8b31f6b438d0e53eecbb81054b93128324a82ecd59ec1a4f91f01f7ac113dcb14eade + languageName: node + linkType: hard + +"time-span@npm:^5.1.0": + version: 5.1.0 + resolution: "time-span@npm:5.1.0" + dependencies: + convert-hrtime: "npm:^5.0.0" + checksum: 10c0/37b8284c53f4ee320377512ac19e3a034f2b025f5abd6959b8c1d0f69e0f06ab03681df209f2e452d30129e7b1f25bf573fb0f29d57e71f9b4a6b5b99f4c4b9e + languageName: node + linkType: hard + +"tiny-relative-date@npm:^1.3.0": + version: 1.3.0 + resolution: "tiny-relative-date@npm:1.3.0" + checksum: 10c0/70a0818793bd00345771a4ddfa9e339c102f891766c5ebce6a011905a1a20e30212851c9ffb11b52b79e2445be32bc21d164c4c6d317aef730766b2a61008f30 + languageName: node + linkType: hard + +"tinyglobby@npm:^0.2.12, tinyglobby@npm:^0.2.14": + version: 0.2.15 + resolution: "tinyglobby@npm:0.2.15" + dependencies: + fdir: "npm:^6.5.0" + picomatch: "npm:^4.0.3" + checksum: 10c0/869c31490d0d88eedb8305d178d4c75e7463e820df5a9b9d388291daf93e8b1eb5de1dad1c1e139767e4269fe75f3b10d5009b2cc14db96ff98986920a186844 + languageName: node + linkType: hard + +"to-regex-range@npm:^5.0.1": + version: 5.0.1 + resolution: "to-regex-range@npm:5.0.1" + dependencies: + is-number: "npm:^7.0.0" + checksum: 10c0/487988b0a19c654ff3e1961b87f471702e708fa8a8dd02a298ef16da7206692e8552a0250e8b3e8759270f62e9d8314616f6da274734d3b558b1fc7b7724e892 + languageName: node + linkType: hard + +"traverse@npm:0.6.8": + version: 0.6.8 + resolution: "traverse@npm:0.6.8" + checksum: 10c0/d97a71be2ca895ff6b813840db37f9b5d88e30f7c4c4bd5b22c5c68ebc22d4a10c4599e02c51414523cc7ada3432e118ea62ebd53cf6f3a4f3aa951bd45072a9 + languageName: node + linkType: hard + +"treeverse@npm:^3.0.0": + version: 3.0.0 + resolution: "treeverse@npm:3.0.0" + checksum: 10c0/286479b9c05a8fb0538ee7d67a5502cea7704f258057c784c9c1118a2f598788b2c0f7a8d89e74648af88af0225b31766acecd78e6060736f09b21dd3fa255db + languageName: node + linkType: hard + +"tuf-js@npm:^3.0.1": + version: 3.1.0 + resolution: "tuf-js@npm:3.1.0" + dependencies: + "@tufjs/models": "npm:3.0.1" + debug: "npm:^4.4.1" + make-fetch-happen: "npm:^14.0.3" + checksum: 10c0/90d5dbdd0ecf2e42826c6253296aae27db5070d67da6374ac5f69eb0d0244f4043b67e3a84fb12a9a256d5b23d7143127e52fb096264eaacc3027c1d08b172ec + languageName: node + linkType: hard + +"type-fest@npm:^1.0.1": + version: 1.4.0 + resolution: "type-fest@npm:1.4.0" + checksum: 10c0/a3c0f4ee28ff6ddf800d769eafafcdeab32efa38763c1a1b8daeae681920f6e345d7920bf277245235561d8117dab765cb5f829c76b713b4c9de0998a5397141 + languageName: node + linkType: hard + +"type-fest@npm:^2.12.2": + version: 2.19.0 + resolution: "type-fest@npm:2.19.0" + checksum: 10c0/a5a7ecf2e654251613218c215c7493574594951c08e52ab9881c9df6a6da0aeca7528c213c622bc374b4e0cb5c443aa3ab758da4e3c959783ce884c3194e12cb + languageName: node + linkType: hard + +"type-fest@npm:^4.39.1, type-fest@npm:^4.6.0": + version: 4.41.0 + resolution: "type-fest@npm:4.41.0" + checksum: 10c0/f5ca697797ed5e88d33ac8f1fec21921839871f808dc59345c9cf67345bfb958ce41bd821165dbf3ae591cedec2bf6fe8882098dfdd8dc54320b859711a2c1e4 + languageName: node + linkType: hard + +"uglify-js@npm:^3.1.4": + version: 3.19.3 + resolution: "uglify-js@npm:3.19.3" + bin: + uglifyjs: bin/uglifyjs + checksum: 10c0/83b0a90eca35f778e07cad9622b80c448b6aad457c9ff8e568afed978212b42930a95f9e1be943a1ffa4258a3340fbb899f41461131c05bb1d0a9c303aed8479 + languageName: node + linkType: hard + +"unicode-emoji-modifier-base@npm:^1.0.0": + version: 1.0.0 + resolution: "unicode-emoji-modifier-base@npm:1.0.0" + checksum: 10c0/b37623fcf0162186debd20f116483e035a2d5b905b932a2c472459d9143d446ebcbefb2a494e2fe4fa7434355396e2a95ec3fc1f0c29a3bc8f2c827220e79c66 + languageName: node + linkType: hard + +"unicorn-magic@npm:^0.1.0": + version: 0.1.0 + resolution: "unicorn-magic@npm:0.1.0" + checksum: 10c0/e4ed0de05b0a05e735c7d8a2930881e5efcfc3ec897204d5d33e7e6247f4c31eac92e383a15d9a6bccb7319b4271ee4bea946e211bf14951fec6ff2cbbb66a92 + languageName: node + linkType: hard + +"unicorn-magic@npm:^0.3.0": + version: 0.3.0 + resolution: "unicorn-magic@npm:0.3.0" + checksum: 10c0/0a32a997d6c15f1c2a077a15b1c4ca6f268d574cf5b8975e778bb98e6f8db4ef4e86dfcae4e158cd4c7e38fb4dd383b93b13eefddc7f178dea13d3ac8a603271 + languageName: node + linkType: hard + +"unique-filename@npm:^4.0.0": + version: 4.0.0 + resolution: "unique-filename@npm:4.0.0" + dependencies: + unique-slug: "npm:^5.0.0" + checksum: 10c0/38ae681cceb1408ea0587b6b01e29b00eee3c84baee1e41fd5c16b9ed443b80fba90c40e0ba69627e30855570a34ba8b06702d4a35035d4b5e198bf5a64c9ddc + languageName: node + linkType: hard + +"unique-slug@npm:^5.0.0": + version: 5.0.0 + resolution: "unique-slug@npm:5.0.0" + dependencies: + imurmurhash: "npm:^0.1.4" + checksum: 10c0/d324c5a44887bd7e105ce800fcf7533d43f29c48757ac410afd42975de82cc38ea2035c0483f4de82d186691bf3208ef35c644f73aa2b1b20b8e651be5afd293 + languageName: node + linkType: hard + +"unique-string@npm:^3.0.0": + version: 3.0.0 + resolution: "unique-string@npm:3.0.0" + dependencies: + crypto-random-string: "npm:^4.0.0" + checksum: 10c0/b35ea034b161b2a573666ec16c93076b4b6106b8b16c2415808d747ab3a0566b5db0c4be231d4b11cfbc16d7fd915c9d8a45884bff0e2db11b799775b2e1e017 + languageName: node + linkType: hard + +"universal-user-agent@npm:^7.0.0, universal-user-agent@npm:^7.0.2": + version: 7.0.3 + resolution: "universal-user-agent@npm:7.0.3" + checksum: 10c0/6043be466a9bb96c0ce82392842d9fddf4c37e296f7bacc2cb25f47123990eb436c82df824644f9c5070a94dbdb117be17f66d54599ab143648ec57ef93dbcc8 + languageName: node + linkType: hard + +"universalify@npm:^2.0.0": + version: 2.0.1 + resolution: "universalify@npm:2.0.1" + checksum: 10c0/73e8ee3809041ca8b818efb141801a1004e3fc0002727f1531f4de613ea281b494a40909596dae4a042a4fb6cd385af5d4db2e137b1362e0e91384b828effd3a + languageName: node + linkType: hard + +"url-join@npm:^5.0.0": + version: 5.0.0 + resolution: "url-join@npm:5.0.0" + checksum: 10c0/ed2b166b4b5a98adcf6828a48b6bd6df1dac4c8a464a73cf4d8e2457ed410dd8da6be0d24855b86026cd7f5c5a3657c1b7b2c7a7c5b8870af17635a41387b04c + languageName: node + linkType: hard + +"util-deprecate@npm:^1.0.2, util-deprecate@npm:~1.0.1": + version: 1.0.2 + resolution: "util-deprecate@npm:1.0.2" + checksum: 10c0/41a5bdd214df2f6c3ecf8622745e4a366c4adced864bc3c833739791aeeeb1838119af7daed4ba36428114b5c67dcda034a79c882e97e43c03e66a4dd7389942 + languageName: node + linkType: hard + +"validate-npm-package-license@npm:^3.0.4": + version: 3.0.4 + resolution: "validate-npm-package-license@npm:3.0.4" + dependencies: + spdx-correct: "npm:^3.0.0" + spdx-expression-parse: "npm:^3.0.0" + checksum: 10c0/7b91e455a8de9a0beaa9fe961e536b677da7f48c9a493edf4d4d4a87fd80a7a10267d438723364e432c2fcd00b5650b5378275cded362383ef570276e6312f4f + languageName: node + linkType: hard + +"validate-npm-package-name@npm:^6.0.0, validate-npm-package-name@npm:^6.0.2": + version: 6.0.2 + resolution: "validate-npm-package-name@npm:6.0.2" + checksum: 10c0/c4c23a8b9fa8deee11eea421d94fbe39f742146c06571b62247212579298186b724ebc5152240a415753bdaf9b8849a487e675ec2968d44660f8a65de6cdef9e + languageName: node + linkType: hard + +"walk-up-path@npm:^3.0.1": + version: 3.0.1 + resolution: "walk-up-path@npm:3.0.1" + checksum: 10c0/3184738e0cf33698dd58b0ee4418285b9c811e58698f52c1f025435a85c25cbc5a63fee599f1a79cb29ca7ef09a44ec9417b16bfd906b1a37c305f7aa20ee5bc + languageName: node + linkType: hard + +"web-worker@npm:^1.5.0": + version: 1.5.0 + resolution: "web-worker@npm:1.5.0" + checksum: 10c0/d42744757422803c73ca64fa51e1ce994354ace4b8438b3f740425a05afeb8df12dd5dadbf6b0839a08dbda56c470d7943c0383854c4fb1ae40ab874eb10427a + languageName: node + linkType: hard + +"which@npm:^2.0.1": + version: 2.0.2 + resolution: "which@npm:2.0.2" + dependencies: + isexe: "npm:^2.0.0" + bin: + node-which: ./bin/node-which + checksum: 10c0/66522872a768b60c2a65a57e8ad184e5372f5b6a9ca6d5f033d4b0dc98aff63995655a7503b9c0a2598936f532120e81dd8cc155e2e92ed662a2b9377cc4374f + languageName: node + linkType: hard + +"which@npm:^5.0.0": + version: 5.0.0 + resolution: "which@npm:5.0.0" + dependencies: + isexe: "npm:^3.1.1" + bin: + node-which: bin/which.js + checksum: 10c0/e556e4cd8b7dbf5df52408c9a9dd5ac6518c8c5267c8953f5b0564073c66ed5bf9503b14d876d0e9c7844d4db9725fb0dcf45d6e911e17e26ab363dc3965ae7b + languageName: node + linkType: hard + +"wordwrap@npm:^1.0.0": + version: 1.0.0 + resolution: "wordwrap@npm:1.0.0" + checksum: 10c0/7ed2e44f3c33c5c3e3771134d2b0aee4314c9e49c749e37f464bf69f2bcdf0cbf9419ca638098e2717cff4875c47f56a007532f6111c3319f557a2ca91278e92 + languageName: node + linkType: hard + +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0, wrap-ansi@npm:^7.0.0": + version: 7.0.0 + resolution: "wrap-ansi@npm:7.0.0" + dependencies: + ansi-styles: "npm:^4.0.0" + string-width: "npm:^4.1.0" + strip-ansi: "npm:^6.0.0" + checksum: 10c0/d15fc12c11e4cbc4044a552129ebc75ee3f57aa9c1958373a4db0292d72282f54373b536103987a4a7594db1ef6a4f10acf92978f79b98c49306a4b58c77d4da + languageName: node + linkType: hard + +"wrap-ansi@npm:^8.1.0": + version: 8.1.0 + resolution: "wrap-ansi@npm:8.1.0" + dependencies: + ansi-styles: "npm:^6.1.0" + string-width: "npm:^5.0.1" + strip-ansi: "npm:^7.0.1" + checksum: 10c0/138ff58a41d2f877eae87e3282c0630fc2789012fc1af4d6bd626eeb9a2f9a65ca92005e6e69a75c7b85a68479fe7443c7dbe1eb8fbaa681a4491364b7c55c60 + languageName: node + linkType: hard + +"write-file-atomic@npm:^6.0.0": + version: 6.0.0 + resolution: "write-file-atomic@npm:6.0.0" + dependencies: + imurmurhash: "npm:^0.1.4" + signal-exit: "npm:^4.0.1" + checksum: 10c0/ae2f1c27474758a9aca92037df6c1dd9cb94c4e4983451210bd686bfe341f142662f6aa5913095e572ab037df66b1bfe661ed4ce4c0369ed0e8219e28e141786 + languageName: node + linkType: hard + +"xtend@npm:~4.0.1": + version: 4.0.2 + resolution: "xtend@npm:4.0.2" + checksum: 10c0/366ae4783eec6100f8a02dff02ac907bf29f9a00b82ac0264b4d8b832ead18306797e283cf19de776538babfdcb2101375ec5646b59f08c52128ac4ab812ed0e + languageName: node + linkType: hard + +"y18n@npm:^5.0.5": + version: 5.0.8 + resolution: "y18n@npm:5.0.8" + checksum: 10c0/4df2842c36e468590c3691c894bc9cdbac41f520566e76e24f59401ba7d8b4811eb1e34524d57e54bc6d864bcb66baab7ffd9ca42bf1eda596618f9162b91249 + languageName: node + linkType: hard + +"yallist@npm:^4.0.0": + version: 4.0.0 + resolution: "yallist@npm:4.0.0" + checksum: 10c0/2286b5e8dbfe22204ab66e2ef5cc9bbb1e55dfc873bbe0d568aa943eb255d131890dfd5bf243637273d31119b870f49c18fcde2c6ffbb7a7a092b870dc90625a + languageName: node + linkType: hard + +"yallist@npm:^5.0.0": + version: 5.0.0 + resolution: "yallist@npm:5.0.0" + checksum: 10c0/a499c81ce6d4a1d260d4ea0f6d49ab4da09681e32c3f0472dee16667ed69d01dae63a3b81745a24bd78476ec4fcf856114cb4896ace738e01da34b2c42235416 + languageName: node + linkType: hard + +"yargs-parser@npm:^20.2.2": + version: 20.2.9 + resolution: "yargs-parser@npm:20.2.9" + checksum: 10c0/0685a8e58bbfb57fab6aefe03c6da904a59769bd803a722bb098bd5b0f29d274a1357762c7258fb487512811b8063fb5d2824a3415a0a4540598335b3b086c72 + languageName: node + linkType: hard + +"yargs-parser@npm:^21.1.1": + version: 21.1.1 + resolution: "yargs-parser@npm:21.1.1" + checksum: 10c0/f84b5e48169479d2f402239c59f084cfd1c3acc197a05c59b98bab067452e6b3ea46d4dd8ba2985ba7b3d32a343d77df0debd6b343e5dae3da2aab2cdf5886b2 + languageName: node + linkType: hard + +"yargs@npm:^16.0.0": + version: 16.2.0 + resolution: "yargs@npm:16.2.0" + dependencies: + cliui: "npm:^7.0.2" + escalade: "npm:^3.1.1" + get-caller-file: "npm:^2.0.5" + require-directory: "npm:^2.1.1" + string-width: "npm:^4.2.0" + y18n: "npm:^5.0.5" + yargs-parser: "npm:^20.2.2" + checksum: 10c0/b1dbfefa679848442454b60053a6c95d62f2d2e21dd28def92b647587f415969173c6e99a0f3bab4f1b67ee8283bf735ebe3544013f09491186ba9e8a9a2b651 + languageName: node + linkType: hard + +"yargs@npm:^17.5.1": + version: 17.7.2 + resolution: "yargs@npm:17.7.2" + dependencies: + cliui: "npm:^8.0.1" + escalade: "npm:^3.1.1" + get-caller-file: "npm:^2.0.5" + require-directory: "npm:^2.1.1" + string-width: "npm:^4.2.3" + y18n: "npm:^5.0.5" + yargs-parser: "npm:^21.1.1" + checksum: 10c0/ccd7e723e61ad5965fffbb791366db689572b80cca80e0f96aad968dfff4156cd7cd1ad18607afe1046d8241e6fb2d6c08bf7fa7bfb5eaec818735d8feac8f05 + languageName: node + linkType: hard + +"yoctocolors@npm:^2.1.1": + version: 2.1.2 + resolution: "yoctocolors@npm:2.1.2" + checksum: 10c0/b220f30f53ebc2167330c3adc86a3c7f158bcba0236f6c67e25644c3188e2571a6014ffc1321943bb619460259d3d27eb4c9cc58c2d884c1b195805883ec7066 + languageName: node + linkType: hard