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.8.0"
".": "2.9.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: 38
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-155e4761d62255841349c0f8a01b0a9c463ea1d1f2d6c4fd8d1a75c8bef6f226.yml
openapi_spec_hash: ab91f77e7c9d992400cbc7fc8a9e76c1
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-3ecc6285243f60f7619d543cac59991015fbb0a156648741e7e42e619e0cbc5c.yml
openapi_spec_hash: 0130f29a501366c63cbd3a446c5eb109
config_hash: bff282047fafdad771fb7ec685f56944
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# Changelog

## 2.9.0 (2026-08-06)

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

### Features

* **api:** api update ([5932741](https://github.com/context-dot-dev/context-php-sdk/commit/5932741da1376f8eba94cb6736f356efc8d9e455))
* **api:** api update ([985cbbd](https://github.com/context-dot-dev/context-php-sdk/commit/985cbbd5032c78418d6235faf14641dfe3782cb4))
* **api:** api update ([dd60dca](https://github.com/context-dot-dev/context-php-sdk/commit/dd60dca30260506e86c70a674f10e9892788109b))
* **api:** api update ([841bd43](https://github.com/context-dot-dev/context-php-sdk/commit/841bd435edb55d3539afb1162993ac28c427fcd0))
* **api:** api update ([3797497](https://github.com/context-dot-dev/context-php-sdk/commit/3797497dd171a1b3b6ca8260ea34c0e6bccda217))

## 2.8.0 (2026-08-05)

Full Changelog: [v2.7.0...v2.8.0](https://github.com/context-dot-dev/context-php-sdk/compare/v2.7.0...v2.8.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.8.0"
composer require "context-dev/context-dev-php 2.9.0"
```

<!-- x-release-please-end -->
Expand Down
42 changes: 35 additions & 7 deletions src/Batch/BatchGetResponse/Credits.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,27 @@
/**
* What this batch has done to your credit balance.
*
* @phpstan-type CreditsShape = array{net: int, refunded: int, reserved: int}
* @phpstan-type CreditsShape = array{
* net: int, ocrCharged: int, refunded: int, reserved: int
* }
*/
final class Credits implements BaseModel
{
/** @use SdkModel<CreditsShape> */
use SdkModel;

/**
* `reserved` minus `refunded` — what the batch has cost so far. Equal to `reserved` until the batch settles.
* `reserved` minus `refunded` plus `ocr_charged` — what the batch has cost so far. Equal to `reserved` until the batch settles.
*/
#[Required]
public int $net;

/**
* Credits charged for PDF pages recovered by OCR (pdf.ocr=true), 1 per recovered page, on top of `reserved`. Stays 0 until the batch settles.
*/
#[Required('ocr_charged')]
public int $ocrCharged;

/**
* Credits returned for pages that did not succeed. Stays 0 until the batch reaches a final status, then settles in one movement.
*/
Expand All @@ -41,13 +49,17 @@ final class Credits implements BaseModel
*
* To enforce required parameters use
* ```
* Credits::with(net: ..., refunded: ..., reserved: ...)
* Credits::with(net: ..., ocrCharged: ..., refunded: ..., reserved: ...)
* ```
*
* Otherwise ensure the following setters are called
*
* ```
* (new Credits)->withNet(...)->withRefunded(...)->withReserved(...)
* (new Credits)
* ->withNet(...)
* ->withOcrCharged(...)
* ->withRefunded(...)
* ->withReserved(...)
* ```
*/
public function __construct()
Expand All @@ -60,19 +72,24 @@ public function __construct()
*
* You must use named parameters to construct any parameters with a default value.
*/
public static function with(int $net, int $refunded, int $reserved): self
{
public static function with(
int $net,
int $ocrCharged,
int $refunded,
int $reserved
): self {
$self = new self;

$self['net'] = $net;
$self['ocrCharged'] = $ocrCharged;
$self['refunded'] = $refunded;
$self['reserved'] = $reserved;

return $self;
}

/**
* `reserved` minus `refunded` — what the batch has cost so far. Equal to `reserved` until the batch settles.
* `reserved` minus `refunded` plus `ocr_charged` — what the batch has cost so far. Equal to `reserved` until the batch settles.
*/
public function withNet(int $net): self
{
Expand All @@ -82,6 +99,17 @@ public function withNet(int $net): self
return $self;
}

/**
* Credits charged for PDF pages recovered by OCR (pdf.ocr=true), 1 per recovered page, on top of `reserved`. Stays 0 until the batch settles.
*/
public function withOcrCharged(int $ocrCharged): self
{
$self = clone $this;
$self['ocrCharged'] = $ocrCharged;

return $self;
}

/**
* Credits returned for pages that did not succeed. Stays 0 until the batch reaches a final status, then settles in one movement.
*/
Expand Down
20 changes: 20 additions & 0 deletions src/Batch/BatchGetResultsResponse/Data/ScrapedPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
* itemID?: string|null,
* markdown?: string|null,
* meta?: array<string,mixed>|null,
* ocrPages?: int|null,
* }
*/
final class ScrapedPage implements BaseModel
Expand Down Expand Up @@ -90,6 +91,12 @@ final class ScrapedPage implements BaseModel
#[Optional(map: 'mixed')]
public ?array $meta;

/**
* PDF pages of this document recovered by OCR (pdf.ocr=true). Each recovered page bills 1 credit on top of the page base credit; absent when no OCR ran.
*/
#[Optional('ocr_pages')]
public ?int $ocrPages;

/**
* `new ScrapedPage()` is missing required properties by the API.
*
Expand Down Expand Up @@ -130,6 +137,7 @@ public static function with(
?string $itemID = null,
?string $markdown = null,
?array $meta = null,
?int $ocrPages = null,
): self {
$self = new self;

Expand All @@ -142,6 +150,7 @@ public static function with(
null !== $itemID && $self['itemID'] = $itemID;
null !== $markdown && $self['markdown'] = $markdown;
null !== $meta && $self['meta'] = $meta;
null !== $ocrPages && $self['ocrPages'] = $ocrPages;

return $self;
}
Expand Down Expand Up @@ -250,4 +259,15 @@ public function withMeta(array $meta): self

return $self;
}

/**
* PDF pages of this document recovered by OCR (pdf.ocr=true). Each recovered page bills 1 credit on top of the page base credit; absent when no OCR ran.
*/
public function withOcrPages(int $ocrPages): self
{
$self = clone $this;
$self['ocrPages'] = $ocrPages;

return $self;
}
}
42 changes: 35 additions & 7 deletions src/Batch/BatchListResponse/Data/Credits.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,27 @@
/**
* What this batch has done to your credit balance.
*
* @phpstan-type CreditsShape = array{net: int, refunded: int, reserved: int}
* @phpstan-type CreditsShape = array{
* net: int, ocrCharged: int, refunded: int, reserved: int
* }
*/
final class Credits implements BaseModel
{
/** @use SdkModel<CreditsShape> */
use SdkModel;

/**
* `reserved` minus `refunded` — what the batch has cost so far. Equal to `reserved` until the batch settles.
* `reserved` minus `refunded` plus `ocr_charged` — what the batch has cost so far. Equal to `reserved` until the batch settles.
*/
#[Required]
public int $net;

/**
* Credits charged for PDF pages recovered by OCR (pdf.ocr=true), 1 per recovered page, on top of `reserved`. Stays 0 until the batch settles.
*/
#[Required('ocr_charged')]
public int $ocrCharged;

/**
* Credits returned for pages that did not succeed. Stays 0 until the batch reaches a final status, then settles in one movement.
*/
Expand All @@ -41,13 +49,17 @@ final class Credits implements BaseModel
*
* To enforce required parameters use
* ```
* Credits::with(net: ..., refunded: ..., reserved: ...)
* Credits::with(net: ..., ocrCharged: ..., refunded: ..., reserved: ...)
* ```
*
* Otherwise ensure the following setters are called
*
* ```
* (new Credits)->withNet(...)->withRefunded(...)->withReserved(...)
* (new Credits)
* ->withNet(...)
* ->withOcrCharged(...)
* ->withRefunded(...)
* ->withReserved(...)
* ```
*/
public function __construct()
Expand All @@ -60,19 +72,24 @@ public function __construct()
*
* You must use named parameters to construct any parameters with a default value.
*/
public static function with(int $net, int $refunded, int $reserved): self
{
public static function with(
int $net,
int $ocrCharged,
int $refunded,
int $reserved
): self {
$self = new self;

$self['net'] = $net;
$self['ocrCharged'] = $ocrCharged;
$self['refunded'] = $refunded;
$self['reserved'] = $reserved;

return $self;
}

/**
* `reserved` minus `refunded` — what the batch has cost so far. Equal to `reserved` until the batch settles.
* `reserved` minus `refunded` plus `ocr_charged` — what the batch has cost so far. Equal to `reserved` until the batch settles.
*/
public function withNet(int $net): self
{
Expand All @@ -82,6 +99,17 @@ public function withNet(int $net): self
return $self;
}

/**
* Credits charged for PDF pages recovered by OCR (pdf.ocr=true), 1 per recovered page, on top of `reserved`. Stays 0 until the batch settles.
*/
public function withOcrCharged(int $ocrCharged): self
{
$self = clone $this;
$self['ocrCharged'] = $ocrCharged;

return $self;
}

/**
* Credits returned for pages that did not succeed. Stays 0 until the batch reaches a final status, then settles in one movement.
*/
Expand Down
25 changes: 25 additions & 0 deletions src/Brand/BrandGetResponse/Brand.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use ContextDev\Brand\BrandGetResponse\Brand\Address;
use ContextDev\Brand\BrandGetResponse\Brand\Backdrop;
use ContextDev\Brand\BrandGetResponse\Brand\Color;
use ContextDev\Brand\BrandGetResponse\Brand\Employees;
use ContextDev\Brand\BrandGetResponse\Brand\Industries;
use ContextDev\Brand\BrandGetResponse\Brand\Links;
use ContextDev\Brand\BrandGetResponse\Brand\Logo;
Expand All @@ -23,6 +24,7 @@
* @phpstan-import-type AddressShape from \ContextDev\Brand\BrandGetResponse\Brand\Address
* @phpstan-import-type BackdropShape from \ContextDev\Brand\BrandGetResponse\Brand\Backdrop
* @phpstan-import-type ColorShape from \ContextDev\Brand\BrandGetResponse\Brand\Color
* @phpstan-import-type EmployeesShape from \ContextDev\Brand\BrandGetResponse\Brand\Employees
* @phpstan-import-type IndustriesShape from \ContextDev\Brand\BrandGetResponse\Brand\Industries
* @phpstan-import-type LinksShape from \ContextDev\Brand\BrandGetResponse\Brand\Links
* @phpstan-import-type LogoShape from \ContextDev\Brand\BrandGetResponse\Brand\Logo
Expand All @@ -36,6 +38,7 @@
* description?: string|null,
* domain?: string|null,
* email?: string|null,
* employees?: null|Employees|EmployeesShape,
* industries?: null|Industries|IndustriesShape,
* isNsfw?: bool|null,
* links?: null|Links|LinksShape,
Expand Down Expand Up @@ -93,6 +96,12 @@ final class Brand implements BaseModel
#[Optional]
public ?string $email;

/**
* Employee headcount information for the brand (will be null if unknown).
*/
#[Optional]
public ?Employees $employees;

/**
* Industry classification information for the brand.
*/
Expand Down Expand Up @@ -172,6 +181,7 @@ public function __construct()
* @param Address|AddressShape|null $address
* @param list<Backdrop|BackdropShape>|null $backdrops
* @param list<Color|ColorShape>|null $colors
* @param Employees|EmployeesShape|null $employees
* @param Industries|IndustriesShape|null $industries
* @param Links|LinksShape|null $links
* @param list<Logo|LogoShape>|null $logos
Expand All @@ -186,6 +196,7 @@ public static function with(
?string $description = null,
?string $domain = null,
?string $email = null,
Employees|array|null $employees = null,
Industries|array|null $industries = null,
?bool $isNsfw = null,
Links|array|null $links = null,
Expand All @@ -205,6 +216,7 @@ public static function with(
null !== $description && $self['description'] = $description;
null !== $domain && $self['domain'] = $domain;
null !== $email && $self['email'] = $email;
null !== $employees && $self['employees'] = $employees;
null !== $industries && $self['industries'] = $industries;
null !== $isNsfw && $self['isNsfw'] = $isNsfw;
null !== $links && $self['links'] = $links;
Expand Down Expand Up @@ -291,6 +303,19 @@ public function withEmail(string $email): self
return $self;
}

/**
* Employee headcount information for the brand (will be null if unknown).
*
* @param Employees|EmployeesShape $employees
*/
public function withEmployees(Employees|array $employees): self
{
$self = clone $this;
$self['employees'] = $employees;

return $self;
}

/**
* Industry classification information for the brand.
*
Expand Down
Loading