Skip to content
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.7.0"
".": "0.8.0"
}
8 changes: 4 additions & 4 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 77
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/zavu%2Fzavudev-8bebbc269d62102c587a3a2ed99f065e0336599697b55d21e30080aa9c160672.yml
openapi_spec_hash: 1e701bc39fb0673ddef95c579da4a54b
config_hash: 866b537cf536cf8cb91b44e437fa812d
configured_endpoints: 129
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/zavu%2Fzavudev-77943605e8ccf7c6c70bfe2fcd14e41b45f018747af93fbd3b54c92187fc6d18.yml
openapi_spec_hash: d831e4cd9855111c1f9a1ee04a508564
config_hash: 280cf643b641e9d1b21852c7e2926d54
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
# Changelog

## 0.8.0 (2026-04-28)

Full Changelog: [v0.7.0...v0.8.0](https://github.com/zavudev/sdk-php/compare/v0.7.0...v0.8.0)

### Features

* **api:** api update ([d0c5123](https://github.com/zavudev/sdk-php/commit/d0c5123b8267fefac5956b82b713bb5a0f5462de))
* **api:** api update ([808bd81](https://github.com/zavudev/sdk-php/commit/808bd812e9eaa946fa56a19611efa8c76f410cb7))
* **api:** api update ([4eb815e](https://github.com/zavudev/sdk-php/commit/4eb815e9b0b43449c32e234f9412d943561fa9f1))
* **api:** api update ([fcb8c55](https://github.com/zavudev/sdk-php/commit/fcb8c557a21f6400fef4ca2b7c334ae69769d35b))
* **api:** api update ([ba76c2d](https://github.com/zavudev/sdk-php/commit/ba76c2dc26ee2da1c46fcb506f18d6981216c0be))
* **api:** api update ([7722e7c](https://github.com/zavudev/sdk-php/commit/7722e7c02702cc6d81e96d0a30aad73366cca343))
* **api:** manual updates ([17eb562](https://github.com/zavudev/sdk-php/commit/17eb56286fe646c46e0f403a08be4412bd32b61b))


### Bug Fixes

* **client:** resolve serialization issue with unions and enums ([9dd15a4](https://github.com/zavudev/sdk-php/commit/9dd15a4da36f4b3ed629e120aebf31de677361dc))
* populate enum-typed properties with enum instances ([30f86a8](https://github.com/zavudev/sdk-php/commit/30f86a82d26eba9c82c0c18c3f9cf2bd4abc23f1))

## 0.7.0 (2026-04-14)

Full Changelog: [v0.6.0...v0.7.0](https://github.com/zavudev/sdk-php/compare/v0.6.0...v0.7.0)
Expand Down
147 changes: 147 additions & 0 deletions src/Balance/BalanceGetResponse.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
<?php

declare(strict_types=1);

namespace Zavudev\Balance;

use Zavudev\Core\Attributes\Optional;
use Zavudev\Core\Attributes\Required;
use Zavudev\Core\Concerns\SdkModel;
use Zavudev\Core\Contracts\BaseModel;

/**
* @phpstan-type BalanceGetResponseShape = array{
* balance: int,
* currency: string,
* creditLimit?: int|null,
* isSubAccount?: bool|null,
* totalSpent?: int|null,
* }
*/
final class BalanceGetResponse implements BaseModel
{
/** @use SdkModel<BalanceGetResponseShape> */
use SdkModel;

/**
* Team balance in cents. All charges are billed to the parent team.
*/
#[Required]
public int $balance;

#[Required]
public string $currency;

/**
* Spending cap in cents (only for sub-accounts).
*/
#[Optional(nullable: true)]
public ?int $creditLimit;

/**
* Whether this API key belongs to a sub-account.
*/
#[Optional]
public ?bool $isSubAccount;

/**
* Total amount spent by this sub-account in cents (only for sub-accounts).
*/
#[Optional(nullable: true)]
public ?int $totalSpent;

/**
* `new BalanceGetResponse()` is missing required properties by the API.
*
* To enforce required parameters use
* ```
* BalanceGetResponse::with(balance: ..., currency: ...)
* ```
*
* Otherwise ensure the following setters are called
*
* ```
* (new BalanceGetResponse)->withBalance(...)->withCurrency(...)
* ```
*/
public function __construct()
{
$this->initialize();
}

/**
* Construct an instance from the required parameters.
*
* You must use named parameters to construct any parameters with a default value.
*/
public static function with(
int $balance,
string $currency,
?int $creditLimit = null,
?bool $isSubAccount = null,
?int $totalSpent = null,
): self {
$self = new self;

$self['balance'] = $balance;
$self['currency'] = $currency;

null !== $creditLimit && $self['creditLimit'] = $creditLimit;
null !== $isSubAccount && $self['isSubAccount'] = $isSubAccount;
null !== $totalSpent && $self['totalSpent'] = $totalSpent;

return $self;
}

/**
* Team balance in cents. All charges are billed to the parent team.
*/
public function withBalance(int $balance): self
{
$self = clone $this;
$self['balance'] = $balance;

return $self;
}

public function withCurrency(string $currency): self
{
$self = clone $this;
$self['currency'] = $currency;

return $self;
}

/**
* Spending cap in cents (only for sub-accounts).
*/
public function withCreditLimit(?int $creditLimit): self
{
$self = clone $this;
$self['creditLimit'] = $creditLimit;

return $self;
}

/**
* Whether this API key belongs to a sub-account.
*/
public function withIsSubAccount(bool $isSubAccount): self
{
$self = clone $this;
$self['isSubAccount'] = $isSubAccount;

return $self;
}

/**
* Total amount spent by this sub-account in cents (only for sub-accounts).
*/
public function withTotalSpent(?int $totalSpent): self
{
$self = clone $this;
$self['totalSpent'] = $totalSpent;

return $self;
}
}
20 changes: 20 additions & 0 deletions src/Broadcasts/BroadcastContact.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
* errorMessage?: string|null,
* messageID?: string|null,
* processedAt?: \DateTimeInterface|null,
* templateButtonVariables?: array<string,string>|null,
* templateVariables?: array<string,string>|null,
* }
*/
Expand Down Expand Up @@ -69,6 +70,10 @@ final class BroadcastContact implements BaseModel
#[Optional]
public ?\DateTimeInterface $processedAt;

/** @var array<string,string>|null $templateButtonVariables */
#[Optional(map: 'string')]
public ?array $templateButtonVariables;

/** @var array<string,string>|null $templateVariables */
#[Optional(map: 'string')]
public ?array $templateVariables;
Expand Down Expand Up @@ -106,6 +111,7 @@ public function __construct()
*
* @param RecipientType|value-of<RecipientType> $recipientType
* @param BroadcastContactStatus|value-of<BroadcastContactStatus> $status
* @param array<string,string>|null $templateButtonVariables
* @param array<string,string>|null $templateVariables
*/
public static function with(
Expand All @@ -119,6 +125,7 @@ public static function with(
?string $errorMessage = null,
?string $messageID = null,
?\DateTimeInterface $processedAt = null,
?array $templateButtonVariables = null,
?array $templateVariables = null,
): self {
$self = new self;
Expand All @@ -134,6 +141,7 @@ public static function with(
null !== $errorMessage && $self['errorMessage'] = $errorMessage;
null !== $messageID && $self['messageID'] = $messageID;
null !== $processedAt && $self['processedAt'] = $processedAt;
null !== $templateButtonVariables && $self['templateButtonVariables'] = $templateButtonVariables;
null !== $templateVariables && $self['templateVariables'] = $templateVariables;

return $self;
Expand Down Expand Up @@ -230,6 +238,18 @@ public function withProcessedAt(\DateTimeInterface $processedAt): self
return $self;
}

/**
* @param array<string,string> $templateButtonVariables
*/
public function withTemplateButtonVariables(
array $templateButtonVariables
): self {
$self = clone $this;
$self['templateButtonVariables'] = $templateButtonVariables;

return $self;
}

/**
* @param array<string,string> $templateVariables
*/
Expand Down
30 changes: 28 additions & 2 deletions src/Broadcasts/BroadcastContent.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
* mediaID?: string|null,
* mediaURL?: string|null,
* mimeType?: string|null,
* templateButtonVariables?: array<string,string>|null,
* templateID?: string|null,
* templateVariables?: array<string,string>|null,
* }
Expand Down Expand Up @@ -49,14 +50,22 @@ final class BroadcastContent implements BaseModel
#[Optional]
public ?string $mimeType;

/**
* Default button variables for dynamic URL/OTP buttons. Keys are the button index (0, 1, 2). Per-contact values override these.
*
* @var array<string,string>|null $templateButtonVariables
*/
#[Optional(map: 'string')]
public ?array $templateButtonVariables;

/**
* Template ID for template messages.
*/
#[Optional('templateId')]
public ?string $templateID;

/**
* Default template variables (can be overridden per contact).
* Default body variables (can be overridden per contact). Keys are positions (1, 2, ...).
*
* @var array<string,string>|null $templateVariables
*/
Expand All @@ -73,13 +82,15 @@ public function __construct()
*
* You must use named parameters to construct any parameters with a default value.
*
* @param array<string,string>|null $templateButtonVariables
* @param array<string,string>|null $templateVariables
*/
public static function with(
?string $filename = null,
?string $mediaID = null,
?string $mediaURL = null,
?string $mimeType = null,
?array $templateButtonVariables = null,
?string $templateID = null,
?array $templateVariables = null,
): self {
Expand All @@ -89,6 +100,7 @@ public static function with(
null !== $mediaID && $self['mediaID'] = $mediaID;
null !== $mediaURL && $self['mediaURL'] = $mediaURL;
null !== $mimeType && $self['mimeType'] = $mimeType;
null !== $templateButtonVariables && $self['templateButtonVariables'] = $templateButtonVariables;
null !== $templateID && $self['templateID'] = $templateID;
null !== $templateVariables && $self['templateVariables'] = $templateVariables;

Expand Down Expand Up @@ -139,6 +151,20 @@ public function withMimeType(string $mimeType): self
return $self;
}

/**
* Default button variables for dynamic URL/OTP buttons. Keys are the button index (0, 1, 2). Per-contact values override these.
*
* @param array<string,string> $templateButtonVariables
*/
public function withTemplateButtonVariables(
array $templateButtonVariables
): self {
$self = clone $this;
$self['templateButtonVariables'] = $templateButtonVariables;

return $self;
}

/**
* Template ID for template messages.
*/
Expand All @@ -151,7 +177,7 @@ public function withTemplateID(string $templateID): self
}

/**
* Default template variables (can be overridden per contact).
* Default body variables (can be overridden per contact). Keys are positions (1, 2, ...).
*
* @param array<string,string> $templateVariables
*/
Expand Down
Loading
Loading