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.4.0"
".": "2.5.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: 30
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-fb56935a194e69348fecd985f7cf8b249795b46af2fb32f6c5c8ef648cf10c15.yml
openapi_spec_hash: 7260a560474283b7ad6ac5d426058ac9
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-d49b84cf1125618f171698ff1ee4ff9a8d04151619cb4a56d650103869834465.yml
openapi_spec_hash: 49b7a6f59dcdff1e2bf88feb6474a562
config_hash: daabb160675d86b354711da1e77e5129
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog

## 2.5.0 (2026-07-14)

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

### Features

* **api:** api update ([ea009c4](https://github.com/context-dot-dev/context-php-sdk/commit/ea009c4ebae36d4f2fbe2bf2bccce55f0148dfe8))
* **api:** api update ([8e18458](https://github.com/context-dot-dev/context-php-sdk/commit/8e18458a35402f1b085547b472601a563c77ae5b))

## 2.4.0 (2026-07-12)

Full Changelog: [v2.3.0...v2.4.0](https://github.com/context-dot-dev/context-php-sdk/compare/v2.3.0...v2.4.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.4.0"
composer require "context-dev/context-dev-php 2.5.0"
```

<!-- x-release-please-end -->
Expand Down
30 changes: 29 additions & 1 deletion src/AI/AIExtractProductParams.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@
* @see ContextDev\Services\AIService::extractProduct()
*
* @phpstan-type AIExtractProductParamsShape = array{
* url: string, maxAgeMs?: int|null, timeoutMs?: int|null
* url: string,
* maxAgeMs?: int|null,
* tags?: list<string>|null,
* timeoutMs?: int|null,
* }
*/
final class AIExtractProductParams implements BaseModel
Expand All @@ -37,6 +40,14 @@ final class AIExtractProductParams implements BaseModel
#[Optional]
public ?int $maxAgeMs;

/**
* Optional caller-defined tags for tracking this request. Tags are recorded on the request's usage log and can be used to filter usage on the dashboard usage page. Up to 20 tags, each 1-50 characters.
*
* @var list<string>|null $tags
*/
#[Optional(list: 'string')]
public ?array $tags;

/**
* Optional timeout in milliseconds for the request. If the request takes longer than this value, it will be aborted with a 408 status code. Maximum allowed value is 300000ms (5 minutes).
*/
Expand Down Expand Up @@ -66,17 +77,21 @@ public function __construct()
* Construct an instance from the required parameters.
*
* You must use named parameters to construct any parameters with a default value.
*
* @param list<string>|null $tags
*/
public static function with(
string $url,
?int $maxAgeMs = null,
?array $tags = null,
?int $timeoutMs = null
): self {
$self = new self;

$self['url'] = $url;

null !== $maxAgeMs && $self['maxAgeMs'] = $maxAgeMs;
null !== $tags && $self['tags'] = $tags;
null !== $timeoutMs && $self['timeoutMs'] = $timeoutMs;

return $self;
Expand Down Expand Up @@ -104,6 +119,19 @@ public function withMaxAgeMs(int $maxAgeMs): self
return $self;
}

/**
* Optional caller-defined tags for tracking this request. Tags are recorded on the request's usage log and can be used to filter usage on the dashboard usage page. Up to 20 tags, each 1-50 characters.
*
* @param list<string> $tags
*/
public function withTags(array $tags): self
{
$self = clone $this;
$self['tags'] = $tags;

return $self;
}

/**
* Optional timeout in milliseconds for the request. If the request takes longer than this value, it will be aborted with a 408 status code. Maximum allowed value is 300000ms (5 minutes).
*/
Expand Down
26 changes: 26 additions & 0 deletions src/AI/AIExtractProductsParams.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
* domain: string,
* maxAgeMs?: int|null,
* maxProducts?: int|null,
* tags?: list<string>|null,
* timeoutMs?: int|null,
* directURL: string,
* }
Expand Down Expand Up @@ -47,6 +48,14 @@ final class AIExtractProductsParams implements BaseModel
#[Optional]
public ?int $maxProducts;

/**
* Optional caller-defined tags for tracking this request. Tags are recorded on the request's usage log and can be used to filter usage on the dashboard usage page. Up to 20 tags, each 1-50 characters.
*
* @var list<string>|null $tags
*/
#[Optional(list: 'string')]
public ?array $tags;

/**
* Optional timeout in milliseconds for the request. If the request takes longer than this value, it will be aborted with a 408 status code. Maximum allowed value is 300000ms (5 minutes).
*/
Expand Down Expand Up @@ -82,12 +91,15 @@ public function __construct()
* Construct an instance from the required parameters.
*
* You must use named parameters to construct any parameters with a default value.
*
* @param list<string>|null $tags
*/
public static function with(
string $domain,
string $directURL,
?int $maxAgeMs = null,
?int $maxProducts = null,
?array $tags = null,
?int $timeoutMs = null,
): self {
$self = new self;
Expand All @@ -97,6 +109,7 @@ public static function with(

null !== $maxAgeMs && $self['maxAgeMs'] = $maxAgeMs;
null !== $maxProducts && $self['maxProducts'] = $maxProducts;
null !== $tags && $self['tags'] = $tags;
null !== $timeoutMs && $self['timeoutMs'] = $timeoutMs;

return $self;
Expand Down Expand Up @@ -135,6 +148,19 @@ public function withMaxProducts(int $maxProducts): self
return $self;
}

/**
* Optional caller-defined tags for tracking this request. Tags are recorded on the request's usage log and can be used to filter usage on the dashboard usage page. Up to 20 tags, each 1-50 characters.
*
* @param list<string> $tags
*/
public function withTags(array $tags): self
{
$self = clone $this;
$self['tags'] = $tags;

return $self;
}

/**
* Optional timeout in milliseconds for the request. If the request takes longer than this value, it will be aborted with a 408 status code. Maximum allowed value is 300000ms (5 minutes).
*/
Expand Down
4 changes: 2 additions & 2 deletions src/Brand/BrandGetResponse/Brand.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ final class Brand implements BaseModel
public ?string $phone;

/**
* The primary language of the brand's website content. Detected from the HTML lang tag, page content analysis, or social media descriptions.
* Language to force for the retrieved brand data.
*
* @var value-of<PrimaryLanguage>|null $primaryLanguage
*/
Expand Down Expand Up @@ -353,7 +353,7 @@ public function withPhone(string $phone): self
}

/**
* The primary language of the brand's website content. Detected from the HTML lang tag, page content analysis, or social media descriptions.
* Language to force for the retrieved brand data.
*
* @param PrimaryLanguage|value-of<PrimaryLanguage>|null $primaryLanguage
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,6 @@ enum Subindustry: string

case CREATOR_ECONOMY_INFLUENCER_PLATFORMS = 'Creator Economy & Influencer Platforms';

case ADVERTISING_ADTECH_MEDIA_BUYING = 'Advertising, Adtech & Media Buying';

case FILM_TV_PRODUCTION_STUDIOS = 'Film, TV & Production Studios';

case EVENTS_VENUES_LIVE_ENTERTAINMENT = 'Events, Venues & Live Entertainment';
Expand Down Expand Up @@ -231,6 +229,8 @@ enum Subindustry: string

case NEWS_PUBLISHING_JOURNALISM = 'News Publishing & Journalism';

case ADVERTISING_ADTECH_MEDIA_BUYING = 'Advertising, Adtech & Media Buying';

case DIGITAL_MEDIA_CONTENT_PLATFORMS = 'Digital Media & Content Platforms';

case BROADCASTING_TV_RADIO = 'Broadcasting (TV & Radio)';
Expand Down
2 changes: 1 addition & 1 deletion src/Brand/BrandGetResponse/Brand/PrimaryLanguage.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
namespace ContextDev\Brand\BrandGetResponse\Brand;

/**
* The primary language of the brand's website content. Detected from the HTML lang tag, page content analysis, or social media descriptions.
* Language to force for the retrieved brand data.
*/
enum PrimaryLanguage: string
{
Expand Down
65 changes: 53 additions & 12 deletions src/Brand/BrandRetrieveParams.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,18 @@
*
* @see ContextDev\Services\BrandService::retrieve()
*
* @phpstan-import-type MccVariants from \ContextDev\Brand\BrandRetrieveParams\Mcc
* @phpstan-import-type PhoneVariants from \ContextDev\Brand\BrandRetrieveParams\Phone
* @phpstan-import-type MccShape from \ContextDev\Brand\BrandRetrieveParams\Mcc
* @phpstan-import-type PhoneShape from \ContextDev\Brand\BrandRetrieveParams\Phone
*
* @phpstan-type BrandRetrieveParamsShape = array{
* domain: string,
* type: Type|value-of<Type>,
* forceLanguage?: null|ForceLanguage|value-of<ForceLanguage>,
* maxAgeMs?: int|null,
* maxSpeed?: bool|null,
* tags?: list<string>|null,
* timeoutMs?: int|null,
* name: string,
* countryGl?: string|null,
Expand All @@ -33,8 +39,8 @@
* transactionInfo: string,
* city?: string|null,
* highConfidenceOnly?: bool|null,
* mcc?: int|null,
* phone?: float|null,
* mcc?: MccShape|null,
* phone?: PhoneShape|null,
* }
*/
final class BrandRetrieveParams implements BaseModel
Expand All @@ -58,7 +64,7 @@ final class BrandRetrieveParams implements BaseModel
public string $type;

/** @var value-of<ForceLanguage>|null $forceLanguage */
#[Optional('force_language', enum: ForceLanguage::class)]
#[Optional('force_language', enum: ForceLanguage::class, nullable: true)]
public ?string $forceLanguage;

/**
Expand All @@ -73,6 +79,14 @@ final class BrandRetrieveParams implements BaseModel
#[Optional]
public ?bool $maxSpeed;

/**
* Optional caller-defined tags for tracking this request. Tags are recorded on the request's usage log and can be used to filter usage on the dashboard usage page. Up to 20 tags, each 1-50 characters.
*
* @var list<string>|null $tags
*/
#[Optional(list: 'string')]
public ?array $tags;

/**
* Optional timeout in milliseconds for the request. If the request takes longer than this value, it will be aborted with a 408 status code. Maximum allowed value is 300000ms (5 minutes).
*/
Expand Down Expand Up @@ -135,15 +149,19 @@ final class BrandRetrieveParams implements BaseModel

/**
* Optional Merchant Category Code (MCC) to help identify the business category or industry.
*
* @var MccVariants|null $mcc
*/
#[Optional]
public ?int $mcc;
public string|float|null $mcc;

/**
* Optional phone number from the transaction to help verify brand match.
*
* @var PhoneVariants|null $phone
*/
#[Optional]
public ?float $phone;
public string|float|null $phone;

/**
* `new BrandRetrieveParams()` is missing required properties by the API.
Expand Down Expand Up @@ -186,6 +204,9 @@ public function __construct()
*
* @param Type|value-of<Type> $type
* @param ForceLanguage|value-of<ForceLanguage>|null $forceLanguage
* @param list<string>|null $tags
* @param MccShape|null $mcc
* @param PhoneShape|null $phone
*/
public static function with(
string $domain,
Expand All @@ -198,13 +219,14 @@ public static function with(
ForceLanguage|string|null $forceLanguage = null,
?int $maxAgeMs = null,
?bool $maxSpeed = null,
?array $tags = null,
?int $timeoutMs = null,
?string $countryGl = null,
?string $tickerExchange = null,
?string $city = null,
?bool $highConfidenceOnly = null,
?int $mcc = null,
?float $phone = null,
string|float|null $mcc = null,
string|float|null $phone = null,
): self {
$self = new self;

Expand All @@ -219,6 +241,7 @@ public static function with(
null !== $forceLanguage && $self['forceLanguage'] = $forceLanguage;
null !== $maxAgeMs && $self['maxAgeMs'] = $maxAgeMs;
null !== $maxSpeed && $self['maxSpeed'] = $maxSpeed;
null !== $tags && $self['tags'] = $tags;
null !== $timeoutMs && $self['timeoutMs'] = $timeoutMs;
null !== $countryGl && $self['countryGl'] = $countryGl;
null !== $tickerExchange && $self['tickerExchange'] = $tickerExchange;
Expand Down Expand Up @@ -255,10 +278,11 @@ public function withType(Type|string $type): self
}

/**
* @param ForceLanguage|value-of<ForceLanguage> $forceLanguage
* @param ForceLanguage|value-of<ForceLanguage>|null $forceLanguage
*/
public function withForceLanguage(ForceLanguage|string $forceLanguage): self
{
public function withForceLanguage(
ForceLanguage|string|null $forceLanguage
): self {
$self = clone $this;
$self['forceLanguage'] = $forceLanguage;

Expand Down Expand Up @@ -287,6 +311,19 @@ public function withMaxSpeed(bool $maxSpeed): self
return $self;
}

/**
* Optional caller-defined tags for tracking this request. Tags are recorded on the request's usage log and can be used to filter usage on the dashboard usage page. Up to 20 tags, each 1-50 characters.
*
* @param list<string> $tags
*/
public function withTags(array $tags): self
{
$self = clone $this;
$self['tags'] = $tags;

return $self;
}

/**
* Optional timeout in milliseconds for the request. If the request takes longer than this value, it will be aborted with a 408 status code. Maximum allowed value is 300000ms (5 minutes).
*/
Expand Down Expand Up @@ -399,8 +436,10 @@ public function withHighConfidenceOnly(bool $highConfidenceOnly): self

/**
* Optional Merchant Category Code (MCC) to help identify the business category or industry.
*
* @param MccShape $mcc
*/
public function withMcc(int $mcc): self
public function withMcc(string|float $mcc): self
{
$self = clone $this;
$self['mcc'] = $mcc;
Expand All @@ -410,8 +449,10 @@ public function withMcc(int $mcc): self

/**
* Optional phone number from the transaction to help verify brand match.
*
* @param PhoneShape $phone
*/
public function withPhone(float $phone): self
public function withPhone(string|float $phone): self
{
$self = clone $this;
$self['phone'] = $phone;
Expand Down
Loading
Loading