Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "2.11.0"
".": "2.12.0"
}
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 41
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-b0c72d2fe5911c9ce155275b954198bf2152e915a7e5b9f719aad50e222b9ef8.yml
openapi_spec_hash: 5cf943ea5718059b7975417b012cee28
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-bf7ffa610bd4a02ea5bcb157521d17a041a48f78d87bf8fe8d812d3cbb87b489.yml
openapi_spec_hash: 90142d96969dea44c46a01abb683c426
config_hash: 0fb0ceca5946298c416cec0cca5260c7
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Changelog

## 2.12.0 (2026-08-21)

Full Changelog: [v2.11.0...v2.12.0](https://github.com/context-dot-dev/context-php-sdk/compare/v2.11.0...v2.12.0)

### Features

* **api:** api update ([251478e](https://github.com/context-dot-dev/context-php-sdk/commit/251478ecc8e0ea5db2ce136aa9c78b84b775543c))
* **api:** api update ([84e2387](https://github.com/context-dot-dev/context-php-sdk/commit/84e23875b946b62c378ddd8f4f3c70c76e3bba47))
* **api:** api update ([3dbbac2](https://github.com/context-dot-dev/context-php-sdk/commit/3dbbac273b81d666b1dc7584e125bd5ce0ba3d9a))

## 2.11.0 (2026-08-18)

Full Changelog: [v2.10.0...v2.11.0](https://github.com/context-dot-dev/context-php-sdk/compare/v2.10.0...v2.11.0)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ The REST API documentation can be found on [docs.context.dev](https://docs.conte
<!-- x-release-please-start-version -->

```
composer require "context-dev/context-dev-php 2.11.0"
composer require "context-dev/context-dev-php 2.12.0"
```

<!-- x-release-please-end -->
Expand Down
72 changes: 72 additions & 0 deletions src/AI/AIExtractProductResponse/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace ContextDev\AI\AIExtractProductResponse;

use ContextDev\AI\AIExtractProductResponse\Product\Availability;
use ContextDev\AI\AIExtractProductResponse\Product\BillingFrequency;
use ContextDev\AI\AIExtractProductResponse\Product\PricingModel;
use ContextDev\Core\Attributes\Optional;
Expand All @@ -22,12 +23,15 @@
* sku: string|null,
* tags: list<string>,
* targetAudience: list<string>,
* availability?: null|Availability|value-of<Availability>,
* billingFrequency?: null|BillingFrequency|value-of<BillingFrequency>,
* category?: string|null,
* currency?: string|null,
* dimensions?: list<string>|null,
* imageURL?: string|null,
* price?: float|null,
* pricingModel?: null|PricingModel|value-of<PricingModel>,
* regularPrice?: float|null,
* url?: string|null,
* }
*/
Expand Down Expand Up @@ -86,6 +90,14 @@ final class Product implements BaseModel
#[Required('target_audience', list: 'string')]
public array $targetAudience;

/**
* Normalized stock or ordering availability.
*
* @var value-of<Availability>|null $availability
*/
#[Optional(enum: Availability::class, nullable: true)]
public ?string $availability;

/**
* Billing frequency for the product.
*
Expand All @@ -110,6 +122,14 @@ enum: BillingFrequency::class,
#[Optional(nullable: true)]
public ?string $currency;

/**
* Dimension statements shown for the product, preserving labels, values, and units.
*
* @var list<string>|null $dimensions
*/
#[Optional(list: 'string')]
public ?array $dimensions;

/**
* URL to the product image.
*/
Expand All @@ -130,6 +150,12 @@ enum: BillingFrequency::class,
#[Optional('pricing_model', enum: PricingModel::class, nullable: true)]
public ?string $pricingModel;

/**
* Original or regular price before a displayed discount.
*/
#[Optional('regular_price', nullable: true)]
public ?float $regularPrice;

/**
* URL to the product page.
*/
Expand Down Expand Up @@ -179,7 +205,9 @@ public function __construct()
* @param list<string> $images
* @param list<string> $tags
* @param list<string> $targetAudience
* @param Availability|value-of<Availability>|null $availability
* @param BillingFrequency|value-of<BillingFrequency>|null $billingFrequency
* @param list<string>|null $dimensions
* @param PricingModel|value-of<PricingModel>|null $pricingModel
*/
public static function with(
Expand All @@ -190,12 +218,15 @@ public static function with(
?string $sku,
array $tags,
array $targetAudience,
Availability|string|null $availability = null,
BillingFrequency|string|null $billingFrequency = null,
?string $category = null,
?string $currency = null,
?array $dimensions = null,
?string $imageURL = null,
?float $price = null,
PricingModel|string|null $pricingModel = null,
?float $regularPrice = null,
?string $url = null,
): self {
$self = new self;
Expand All @@ -208,12 +239,15 @@ public static function with(
$self['tags'] = $tags;
$self['targetAudience'] = $targetAudience;

null !== $availability && $self['availability'] = $availability;
null !== $billingFrequency && $self['billingFrequency'] = $billingFrequency;
null !== $category && $self['category'] = $category;
null !== $currency && $self['currency'] = $currency;
null !== $dimensions && $self['dimensions'] = $dimensions;
null !== $imageURL && $self['imageURL'] = $imageURL;
null !== $price && $self['price'] = $price;
null !== $pricingModel && $self['pricingModel'] = $pricingModel;
null !== $regularPrice && $self['regularPrice'] = $regularPrice;
null !== $url && $self['url'] = $url;

return $self;
Expand Down Expand Up @@ -304,6 +338,20 @@ public function withTargetAudience(array $targetAudience): self
return $self;
}

/**
* Normalized stock or ordering availability.
*
* @param Availability|value-of<Availability>|null $availability
*/
public function withAvailability(
Availability|string|null $availability
): self {
$self = clone $this;
$self['availability'] = $availability;

return $self;
}

/**
* Billing frequency for the product.
*
Expand Down Expand Up @@ -340,6 +388,19 @@ public function withCurrency(?string $currency): self
return $self;
}

/**
* Dimension statements shown for the product, preserving labels, values, and units.
*
* @param list<string> $dimensions
*/
public function withDimensions(array $dimensions): self
{
$self = clone $this;
$self['dimensions'] = $dimensions;

return $self;
}

/**
* URL to the product image.
*/
Expand Down Expand Up @@ -376,6 +437,17 @@ public function withPricingModel(
return $self;
}

/**
* Original or regular price before a displayed discount.
*/
public function withRegularPrice(?float $regularPrice): self
{
$self = clone $this;
$self['regularPrice'] = $regularPrice;

return $self;
}

/**
* URL to the product page.
*/
Expand Down
25 changes: 25 additions & 0 deletions src/AI/AIExtractProductResponse/Product/Availability.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php

declare(strict_types=1);

namespace ContextDev\AI\AIExtractProductResponse\Product;

/**
* Normalized stock or ordering availability.
*/
enum Availability: string
{
case IN_STOCK = 'in_stock';

case OUT_OF_STOCK = 'out_of_stock';

case LIMITED_AVAILABILITY = 'limited_availability';

case PREORDER = 'preorder';

case BACKORDER = 'backorder';

case MADE_TO_ORDER = 'made_to_order';

case DISCONTINUED = 'discontinued';
}
72 changes: 72 additions & 0 deletions src/AI/AIExtractProductsResponse/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace ContextDev\AI\AIExtractProductsResponse;

use ContextDev\AI\AIExtractProductsResponse\Product\Availability;
use ContextDev\AI\AIExtractProductsResponse\Product\BillingFrequency;
use ContextDev\AI\AIExtractProductsResponse\Product\PricingModel;
use ContextDev\Core\Attributes\Optional;
Expand All @@ -20,12 +21,15 @@
* sku: string|null,
* tags: list<string>,
* targetAudience: list<string>,
* availability?: null|Availability|value-of<Availability>,
* billingFrequency?: null|BillingFrequency|value-of<BillingFrequency>,
* category?: string|null,
* currency?: string|null,
* dimensions?: list<string>|null,
* imageURL?: string|null,
* price?: float|null,
* pricingModel?: null|PricingModel|value-of<PricingModel>,
* regularPrice?: float|null,
* url?: string|null,
* }
*/
Expand Down Expand Up @@ -84,6 +88,14 @@ final class Product implements BaseModel
#[Required('target_audience', list: 'string')]
public array $targetAudience;

/**
* Normalized stock or ordering availability.
*
* @var value-of<Availability>|null $availability
*/
#[Optional(enum: Availability::class, nullable: true)]
public ?string $availability;

/**
* Billing frequency for the product.
*
Expand All @@ -108,6 +120,14 @@ enum: BillingFrequency::class,
#[Optional(nullable: true)]
public ?string $currency;

/**
* Dimension statements shown for the product, preserving labels, values, and units.
*
* @var list<string>|null $dimensions
*/
#[Optional(list: 'string')]
public ?array $dimensions;

/**
* URL to the product image.
*/
Expand All @@ -128,6 +148,12 @@ enum: BillingFrequency::class,
#[Optional('pricing_model', enum: PricingModel::class, nullable: true)]
public ?string $pricingModel;

/**
* Original or regular price before a displayed discount.
*/
#[Optional('regular_price', nullable: true)]
public ?float $regularPrice;

/**
* URL to the product page.
*/
Expand Down Expand Up @@ -177,7 +203,9 @@ public function __construct()
* @param list<string> $images
* @param list<string> $tags
* @param list<string> $targetAudience
* @param Availability|value-of<Availability>|null $availability
* @param BillingFrequency|value-of<BillingFrequency>|null $billingFrequency
* @param list<string>|null $dimensions
* @param PricingModel|value-of<PricingModel>|null $pricingModel
*/
public static function with(
Expand All @@ -188,12 +216,15 @@ public static function with(
?string $sku,
array $tags,
array $targetAudience,
Availability|string|null $availability = null,
BillingFrequency|string|null $billingFrequency = null,
?string $category = null,
?string $currency = null,
?array $dimensions = null,
?string $imageURL = null,
?float $price = null,
PricingModel|string|null $pricingModel = null,
?float $regularPrice = null,
?string $url = null,
): self {
$self = new self;
Expand All @@ -206,12 +237,15 @@ public static function with(
$self['tags'] = $tags;
$self['targetAudience'] = $targetAudience;

null !== $availability && $self['availability'] = $availability;
null !== $billingFrequency && $self['billingFrequency'] = $billingFrequency;
null !== $category && $self['category'] = $category;
null !== $currency && $self['currency'] = $currency;
null !== $dimensions && $self['dimensions'] = $dimensions;
null !== $imageURL && $self['imageURL'] = $imageURL;
null !== $price && $self['price'] = $price;
null !== $pricingModel && $self['pricingModel'] = $pricingModel;
null !== $regularPrice && $self['regularPrice'] = $regularPrice;
null !== $url && $self['url'] = $url;

return $self;
Expand Down Expand Up @@ -302,6 +336,20 @@ public function withTargetAudience(array $targetAudience): self
return $self;
}

/**
* Normalized stock or ordering availability.
*
* @param Availability|value-of<Availability>|null $availability
*/
public function withAvailability(
Availability|string|null $availability
): self {
$self = clone $this;
$self['availability'] = $availability;

return $self;
}

/**
* Billing frequency for the product.
*
Expand Down Expand Up @@ -338,6 +386,19 @@ public function withCurrency(?string $currency): self
return $self;
}

/**
* Dimension statements shown for the product, preserving labels, values, and units.
*
* @param list<string> $dimensions
*/
public function withDimensions(array $dimensions): self
{
$self = clone $this;
$self['dimensions'] = $dimensions;

return $self;
}

/**
* URL to the product image.
*/
Expand Down Expand Up @@ -374,6 +435,17 @@ public function withPricingModel(
return $self;
}

/**
* Original or regular price before a displayed discount.
*/
public function withRegularPrice(?float $regularPrice): self
{
$self = clone $this;
$self['regularPrice'] = $regularPrice;

return $self;
}

/**
* URL to the product page.
*/
Expand Down
Loading
Loading