Skip to content

Commit 1d8650a

Browse files
authored
Merge pull request #9 from sentdm/release-please--branches--main--changes--next
release: 0.6.0
2 parents 84f662c + 5a83bc2 commit 1d8650a

File tree

182 files changed

+19693
-2326
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

182 files changed

+19693
-2326
lines changed

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "0.5.0"
2+
".": "0.6.0"
33
}

.stats.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 12
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/sent%2Fsent-dm-a02f66b4c3837ff1b6d38b924856b9afad2b3bfbc3152c1b4dfbe1ee895008a5.yml
3-
openapi_spec_hash: 30e666a2b17c0768213eaa74e0aec11b
4-
config_hash: 804a43c36c8e58c8d0ff2e57dd6545ec
1+
configured_endpoints: 44
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/sent%2Fsent-dm-433bfd8c688a6b6d2d4f964bb59121d692798f4e2bb6cb47f6110c4f0e1f638d.yml
3+
openapi_spec_hash: 5378295d401c8c1152c1946cc7dbd69f
4+
config_hash: 43a0daa5b05d44a1620e3da0ea6f4fdc

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# Changelog
22

3+
## 0.6.0 (2026-02-18)
4+
5+
Full Changelog: [v0.5.0...v0.6.0](https://github.com/sentdm/sent-dm-php/compare/v0.5.0...v0.6.0)
6+
7+
### Features
8+
9+
* **api:** manual updates ([9323427](https://github.com/sentdm/sent-dm-php/commit/932342749a404a578e33197f96db275c5f033566))
10+
* **api:** manual updates ([4431f76](https://github.com/sentdm/sent-dm-php/commit/4431f7632e01a09c30a070855f9637c38d4aba9c))
11+
* **api:** manual updates ([e311a74](https://github.com/sentdm/sent-dm-php/commit/e311a7442015709e9119ae978af47fdc1bc5f4c7))
12+
313
## 0.5.0 (2026-02-16)
414

515
Full Changelog: [v0.4.0...v0.5.0](https://github.com/sentdm/sent-dm-php/compare/v0.4.0...v0.5.0)

README.md

Lines changed: 28 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ The REST API documentation can be found on [docs.sent.dm](https://docs.sent.dm).
1313
<!-- x-release-please-start-version -->
1414

1515
```
16-
composer require "sentdm/sent-dm-php 0.5.0"
16+
composer require "sentdm/sent-dm-php 0.6.0"
1717
```
1818

1919
<!-- x-release-please-end -->
@@ -28,18 +28,19 @@ Parameters with a default value must be set by name.
2828

2929
use SentDm\Client;
3030

31-
$client = new Client(
32-
apiKey: getenv('SENT_DM_API_KEY') ?: 'My API Key',
33-
senderID: getenv('SENT_DM_SENDER_ID') ?: 'My Sender ID',
34-
);
31+
$client = new Client(apiKey: getenv('SENT_DM_API_KEY') ?: 'My API Key');
3532

36-
$result = $client->messages->sendToPhone(
37-
phoneNumber: '+1234567890',
38-
templateID: '7ba7b820-9dad-11d1-80b4-00c04fd430c8',
39-
templateVariables: ['name' => 'John Doe', 'order_id' => '12345'],
33+
$response = $client->messages->send(
34+
channel: ['sms', 'whatsapp'],
35+
template: [
36+
'id' => '7ba7b820-9dad-11d1-80b4-00c04fd430c8',
37+
'name' => 'order_confirmation',
38+
'parameters' => ['name' => 'John Doe', 'order_id' => '12345'],
39+
],
40+
to: ['+14155551234', '+14155555678'],
4041
);
4142

42-
var_dump($result);
43+
var_dump($response->data);
4344
```
4445

4546
### Value Objects
@@ -61,10 +62,7 @@ use SentDm\Core\Exceptions\RateLimitException;
6162
use SentDm\Core\Exceptions\APIStatusException;
6263

6364
try {
64-
$result = $client->messages->sendToPhone(
65-
phoneNumber: '+1234567890',
66-
templateID: '7ba7b820-9dad-11d1-80b4-00c04fd430c8',
67-
);
65+
$response = $client->messages->send();
6866
} catch (APIConnectionException $e) {
6967
echo "The server could not be reached", PHP_EOL;
7068
var_dump($e->getPrevious());
@@ -109,10 +107,14 @@ use SentDm\Client;
109107
$client = new Client(requestOptions: ['maxRetries' => 0]);
110108

111109
// Or, configure per-request:
112-
$result = $client->messages->sendToPhone(
113-
phoneNumber: '+1234567890',
114-
templateID: '7ba7b820-9dad-11d1-80b4-00c04fd430c8',
115-
templateVariables: ['name' => 'John Doe', 'order_id' => '12345'],
110+
$result = $client->messages->send(
111+
channel: ['sms'],
112+
template: [
113+
'id' => '7ba7b820-9dad-11d1-80b4-00c04fd430c8',
114+
'name' => 'order_confirmation',
115+
'parameters' => ['name' => 'John Doe', 'order_id' => '12345'],
116+
],
117+
to: ['+14155551234'],
116118
requestOptions: ['maxRetries' => 5],
117119
);
118120
```
@@ -130,10 +132,14 @@ Note: the `extra*` parameters of the same name overrides the documented paramete
130132
```php
131133
<?php
132134

133-
$result = $client->messages->sendToPhone(
134-
phoneNumber: '+1234567890',
135-
templateID: '7ba7b820-9dad-11d1-80b4-00c04fd430c8',
136-
templateVariables: ['name' => 'John Doe', 'order_id' => '12345'],
135+
$response = $client->messages->send(
136+
channel: ['sms'],
137+
template: [
138+
'id' => '7ba7b820-9dad-11d1-80b4-00c04fd430c8',
139+
'name' => 'order_confirmation',
140+
'parameters' => ['name' => 'John Doe', 'order_id' => '12345'],
141+
],
142+
to: ['+14155551234'],
137143
requestOptions: [
138144
'extraQueryParams' => ['my_query_parameter' => 'value'],
139145
'extraBodyParams' => ['my_body_parameter' => 'value'],
Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace SentDm\Brands;
6+
7+
use SentDm\Core\Attributes\Optional;
8+
use SentDm\Core\Concerns\SdkModel;
9+
use SentDm\Core\Contracts\BaseModel;
10+
use SentDm\Webhooks\APIError;
11+
use SentDm\Webhooks\APIMeta;
12+
13+
/**
14+
* Standard API response envelope for all v3 endpoints.
15+
*
16+
* @phpstan-import-type BrandWithKYCShape from \SentDm\Brands\BrandWithKYC
17+
* @phpstan-import-type APIErrorShape from \SentDm\Webhooks\APIError
18+
* @phpstan-import-type APIMetaShape from \SentDm\Webhooks\APIMeta
19+
*
20+
* @phpstan-type APIResponseBrandWithKYCShape = array{
21+
* data?: null|BrandWithKYC|BrandWithKYCShape,
22+
* error?: null|APIError|APIErrorShape,
23+
* meta?: null|APIMeta|APIMetaShape,
24+
* success?: bool|null,
25+
* }
26+
*/
27+
final class APIResponseBrandWithKYC implements BaseModel
28+
{
29+
/** @use SdkModel<APIResponseBrandWithKYCShape> */
30+
use SdkModel;
31+
32+
/**
33+
* The response data (null if error).
34+
*/
35+
#[Optional(nullable: true)]
36+
public ?BrandWithKYC $data;
37+
38+
/**
39+
* Error details (null if successful).
40+
*/
41+
#[Optional(nullable: true)]
42+
public ?APIError $error;
43+
44+
/**
45+
* Metadata about the request and response.
46+
*/
47+
#[Optional]
48+
public ?APIMeta $meta;
49+
50+
/**
51+
* Indicates whether the request was successful.
52+
*/
53+
#[Optional]
54+
public ?bool $success;
55+
56+
public function __construct()
57+
{
58+
$this->initialize();
59+
}
60+
61+
/**
62+
* Construct an instance from the required parameters.
63+
*
64+
* You must use named parameters to construct any parameters with a default value.
65+
*
66+
* @param BrandWithKYC|BrandWithKYCShape|null $data
67+
* @param APIError|APIErrorShape|null $error
68+
* @param APIMeta|APIMetaShape|null $meta
69+
*/
70+
public static function with(
71+
BrandWithKYC|array|null $data = null,
72+
APIError|array|null $error = null,
73+
APIMeta|array|null $meta = null,
74+
?bool $success = null,
75+
): self {
76+
$self = new self;
77+
78+
null !== $data && $self['data'] = $data;
79+
null !== $error && $self['error'] = $error;
80+
null !== $meta && $self['meta'] = $meta;
81+
null !== $success && $self['success'] = $success;
82+
83+
return $self;
84+
}
85+
86+
/**
87+
* The response data (null if error).
88+
*
89+
* @param BrandWithKYC|BrandWithKYCShape|null $data
90+
*/
91+
public function withData(BrandWithKYC|array|null $data): self
92+
{
93+
$self = clone $this;
94+
$self['data'] = $data;
95+
96+
return $self;
97+
}
98+
99+
/**
100+
* Error details (null if successful).
101+
*
102+
* @param APIError|APIErrorShape|null $error
103+
*/
104+
public function withError(APIError|array|null $error): self
105+
{
106+
$self = clone $this;
107+
$self['error'] = $error;
108+
109+
return $self;
110+
}
111+
112+
/**
113+
* Metadata about the request and response.
114+
*
115+
* @param APIMeta|APIMetaShape $meta
116+
*/
117+
public function withMeta(APIMeta|array $meta): self
118+
{
119+
$self = clone $this;
120+
$self['meta'] = $meta;
121+
122+
return $self;
123+
}
124+
125+
/**
126+
* Indicates whether the request was successful.
127+
*/
128+
public function withSuccess(bool $success): self
129+
{
130+
$self = clone $this;
131+
$self['success'] = $success;
132+
133+
return $self;
134+
}
135+
}

src/Brands/BrandCreateParams.php

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace SentDm\Brands;
6+
7+
use SentDm\Core\Attributes\Optional;
8+
use SentDm\Core\Attributes\Required;
9+
use SentDm\Core\Concerns\SdkModel;
10+
use SentDm\Core\Concerns\SdkParams;
11+
use SentDm\Core\Contracts\BaseModel;
12+
13+
/**
14+
* Creates a new brand and associated information. This endpoint automatically sets inheritTcrBrand=false when a brand is created.
15+
*
16+
* @see SentDm\Services\BrandsService::create()
17+
*
18+
* @phpstan-import-type BrandDataShape from \SentDm\Brands\BrandData
19+
*
20+
* @phpstan-type BrandCreateParamsShape = array{
21+
* brand: BrandData|BrandDataShape,
22+
* testMode?: bool|null,
23+
* idempotencyKey?: string|null,
24+
* }
25+
*/
26+
final class BrandCreateParams implements BaseModel
27+
{
28+
/** @use SdkModel<BrandCreateParamsShape> */
29+
use SdkModel;
30+
use SdkParams;
31+
32+
/**
33+
* Brand and KYC information.
34+
*/
35+
#[Required]
36+
public BrandData $brand;
37+
38+
/**
39+
* Test mode flag - when true, the operation is simulated without side effects
40+
* Useful for testing integrations without actual execution.
41+
*/
42+
#[Optional('test_mode')]
43+
public ?bool $testMode;
44+
45+
#[Optional]
46+
public ?string $idempotencyKey;
47+
48+
/**
49+
* `new BrandCreateParams()` is missing required properties by the API.
50+
*
51+
* To enforce required parameters use
52+
* ```
53+
* BrandCreateParams::with(brand: ...)
54+
* ```
55+
*
56+
* Otherwise ensure the following setters are called
57+
*
58+
* ```
59+
* (new BrandCreateParams)->withBrand(...)
60+
* ```
61+
*/
62+
public function __construct()
63+
{
64+
$this->initialize();
65+
}
66+
67+
/**
68+
* Construct an instance from the required parameters.
69+
*
70+
* You must use named parameters to construct any parameters with a default value.
71+
*
72+
* @param BrandData|BrandDataShape $brand
73+
*/
74+
public static function with(
75+
BrandData|array $brand,
76+
?bool $testMode = null,
77+
?string $idempotencyKey = null
78+
): self {
79+
$self = new self;
80+
81+
$self['brand'] = $brand;
82+
83+
null !== $testMode && $self['testMode'] = $testMode;
84+
null !== $idempotencyKey && $self['idempotencyKey'] = $idempotencyKey;
85+
86+
return $self;
87+
}
88+
89+
/**
90+
* Brand and KYC information.
91+
*
92+
* @param BrandData|BrandDataShape $brand
93+
*/
94+
public function withBrand(BrandData|array $brand): self
95+
{
96+
$self = clone $this;
97+
$self['brand'] = $brand;
98+
99+
return $self;
100+
}
101+
102+
/**
103+
* Test mode flag - when true, the operation is simulated without side effects
104+
* Useful for testing integrations without actual execution.
105+
*/
106+
public function withTestMode(bool $testMode): self
107+
{
108+
$self = clone $this;
109+
$self['testMode'] = $testMode;
110+
111+
return $self;
112+
}
113+
114+
public function withIdempotencyKey(string $idempotencyKey): self
115+
{
116+
$self = clone $this;
117+
$self['idempotencyKey'] = $idempotencyKey;
118+
119+
return $self;
120+
}
121+
}

0 commit comments

Comments
 (0)