Skip to content

Commit 00c0625

Browse files
authored
Merge pull request #75 from trycourier/release-please--branches--main--changes--next
release: 5.4.0
2 parents bb1baa1 + 975a073 commit 00c0625

39 files changed

Lines changed: 2650 additions & 219 deletions

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "5.3.0"
2+
".": "5.4.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: 100
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/courier%2Fcourier-b3dde937486812f8db805a423a30ba5d3f80cc95803e13ab66958589366a5f06.yml
3-
openapi_spec_hash: a249df035d7f5bf57c66084cd94e8841
4-
config_hash: c51fa2bafdf96f2c1e409ccc295b7359
1+
configured_endpoints: 103
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/courier%2Fcourier-d891c800ffe6b7eddce179c225367cedcb49dab758ebc03e352d945240918d96.yml
3+
openapi_spec_hash: 852d55192b8d7ad96c1f85cd9070ef64
4+
config_hash: a730d0e598dc108e89c016802008c9b3

CHANGELOG.md

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

3+
## 5.4.0 (2026-04-08)
4+
5+
Full Changelog: [v5.3.0...v5.4.0](https://github.com/trycourier/courier-php/compare/v5.3.0...v5.4.0)
6+
7+
### Features
8+
9+
* **api:** add listNotifications method to routing_strategies ([5567b9e](https://github.com/trycourier/courier-php/commit/5567b9e7b905b979a6d19ec6cf5830f16d35f632))
10+
* **api:** add putContent/putElement/putLocale, remove draft service, update types ([68f068e](https://github.com/trycourier/courier-php/commit/68f068e8a46edb908ce1ed1133bf0ec62afcd43d))
11+
312
## 5.3.0 (2026-04-01)
413

514
Full Changelog: [v5.2.0...v5.3.0](https://github.com/trycourier/courier-php/compare/v5.2.0...v5.3.0)
Lines changed: 163 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,163 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Courier\Notifications;
6+
7+
use Courier\Core\Attributes\Optional;
8+
use Courier\Core\Attributes\Required;
9+
use Courier\Core\Concerns\SdkModel;
10+
use Courier\Core\Contracts\BaseModel;
11+
use Courier\Notifications\ElementWithChecksums\Locale;
12+
13+
/**
14+
* An element with its content checksum and optional nested elements and locale checksums.
15+
*
16+
* @phpstan-import-type LocaleShape from \Courier\Notifications\ElementWithChecksums\Locale
17+
*
18+
* @phpstan-type ElementWithChecksumsShape = array{
19+
* checksum: string,
20+
* type: string,
21+
* id?: string|null,
22+
* elements?: list<mixed>|null,
23+
* locales?: array<string,Locale|LocaleShape>|null,
24+
* }
25+
*/
26+
final class ElementWithChecksums implements BaseModel
27+
{
28+
/** @use SdkModel<ElementWithChecksumsShape> */
29+
use SdkModel;
30+
31+
/**
32+
* MD5 hash of translatable content.
33+
*/
34+
#[Required]
35+
public string $checksum;
36+
37+
/**
38+
* Element type (text, meta, action, etc.).
39+
*/
40+
#[Required]
41+
public string $type;
42+
43+
#[Optional]
44+
public ?string $id;
45+
46+
/**
47+
* Nested child elements (for group-type elements).
48+
*
49+
* @var list<mixed>|null $elements
50+
*/
51+
#[Optional(list: ElementWithChecksums::class)]
52+
public ?array $elements;
53+
54+
/**
55+
* Locale-specific content with checksums.
56+
*
57+
* @var array<string,Locale>|null $locales
58+
*/
59+
#[Optional(map: Locale::class)]
60+
public ?array $locales;
61+
62+
/**
63+
* `new ElementWithChecksums()` is missing required properties by the API.
64+
*
65+
* To enforce required parameters use
66+
* ```
67+
* ElementWithChecksums::with(checksum: ..., type: ...)
68+
* ```
69+
*
70+
* Otherwise ensure the following setters are called
71+
*
72+
* ```
73+
* (new ElementWithChecksums)->withChecksum(...)->withType(...)
74+
* ```
75+
*/
76+
public function __construct()
77+
{
78+
$this->initialize();
79+
}
80+
81+
/**
82+
* Construct an instance from the required parameters.
83+
*
84+
* You must use named parameters to construct any parameters with a default value.
85+
*
86+
* @param list<mixed>|null $elements
87+
* @param array<string,Locale|LocaleShape>|null $locales
88+
*/
89+
public static function with(
90+
string $checksum,
91+
string $type,
92+
?string $id = null,
93+
?array $elements = null,
94+
?array $locales = null,
95+
): self {
96+
$self = new self;
97+
98+
$self['checksum'] = $checksum;
99+
$self['type'] = $type;
100+
101+
null !== $id && $self['id'] = $id;
102+
null !== $elements && $self['elements'] = $elements;
103+
null !== $locales && $self['locales'] = $locales;
104+
105+
return $self;
106+
}
107+
108+
/**
109+
* MD5 hash of translatable content.
110+
*/
111+
public function withChecksum(string $checksum): self
112+
{
113+
$self = clone $this;
114+
$self['checksum'] = $checksum;
115+
116+
return $self;
117+
}
118+
119+
/**
120+
* Element type (text, meta, action, etc.).
121+
*/
122+
public function withType(string $type): self
123+
{
124+
$self = clone $this;
125+
$self['type'] = $type;
126+
127+
return $self;
128+
}
129+
130+
public function withID(string $id): self
131+
{
132+
$self = clone $this;
133+
$self['id'] = $id;
134+
135+
return $self;
136+
}
137+
138+
/**
139+
* Nested child elements (for group-type elements).
140+
*
141+
* @param list<mixed> $elements
142+
*/
143+
public function withElements(array $elements): self
144+
{
145+
$self = clone $this;
146+
$self['elements'] = $elements;
147+
148+
return $self;
149+
}
150+
151+
/**
152+
* Locale-specific content with checksums.
153+
*
154+
* @param array<string,Locale|LocaleShape> $locales
155+
*/
156+
public function withLocales(array $locales): self
157+
{
158+
$self = clone $this;
159+
$self['locales'] = $locales;
160+
161+
return $self;
162+
}
163+
}
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Courier\Notifications\ElementWithChecksums;
6+
7+
use Courier\Core\Attributes\Required;
8+
use Courier\Core\Concerns\SdkModel;
9+
use Courier\Core\Contracts\BaseModel;
10+
11+
/**
12+
* @phpstan-type LocaleShape = array{checksum: string}
13+
*/
14+
final class Locale implements BaseModel
15+
{
16+
/** @use SdkModel<LocaleShape> */
17+
use SdkModel;
18+
19+
#[Required]
20+
public string $checksum;
21+
22+
/**
23+
* `new Locale()` is missing required properties by the API.
24+
*
25+
* To enforce required parameters use
26+
* ```
27+
* Locale::with(checksum: ...)
28+
* ```
29+
*
30+
* Otherwise ensure the following setters are called
31+
*
32+
* ```
33+
* (new Locale)->withChecksum(...)
34+
* ```
35+
*/
36+
public function __construct()
37+
{
38+
$this->initialize();
39+
}
40+
41+
/**
42+
* Construct an instance from the required parameters.
43+
*
44+
* You must use named parameters to construct any parameters with a default value.
45+
*/
46+
public static function with(string $checksum): self
47+
{
48+
$self = new self;
49+
50+
$self['checksum'] = $checksum;
51+
52+
return $self;
53+
}
54+
55+
public function withChecksum(string $checksum): self
56+
{
57+
$self = clone $this;
58+
$self['checksum'] = $checksum;
59+
60+
return $self;
61+
}
62+
}
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Courier\Notifications;
6+
7+
use Courier\Core\Attributes\Required;
8+
use Courier\Core\Concerns\SdkModel;
9+
use Courier\Core\Contracts\BaseModel;
10+
11+
/**
12+
* Elemental content response for V2 templates. Contains versioned elements with content checksums.
13+
*
14+
* @phpstan-type NotificationContentGetResponseShape = array{
15+
* elements: list<mixed>, version: string
16+
* }
17+
*/
18+
final class NotificationContentGetResponse implements BaseModel
19+
{
20+
/** @use SdkModel<NotificationContentGetResponseShape> */
21+
use SdkModel;
22+
23+
/** @var list<mixed> $elements */
24+
#[Required(list: ElementWithChecksums::class)]
25+
public array $elements;
26+
27+
/**
28+
* Content version identifier.
29+
*/
30+
#[Required]
31+
public string $version;
32+
33+
/**
34+
* `new NotificationContentGetResponse()` is missing required properties by the API.
35+
*
36+
* To enforce required parameters use
37+
* ```
38+
* NotificationContentGetResponse::with(elements: ..., version: ...)
39+
* ```
40+
*
41+
* Otherwise ensure the following setters are called
42+
*
43+
* ```
44+
* (new NotificationContentGetResponse)->withElements(...)->withVersion(...)
45+
* ```
46+
*/
47+
public function __construct()
48+
{
49+
$this->initialize();
50+
}
51+
52+
/**
53+
* Construct an instance from the required parameters.
54+
*
55+
* You must use named parameters to construct any parameters with a default value.
56+
*
57+
* @param list<mixed> $elements
58+
*/
59+
public static function with(array $elements, string $version): self
60+
{
61+
$self = new self;
62+
63+
$self['elements'] = $elements;
64+
$self['version'] = $version;
65+
66+
return $self;
67+
}
68+
69+
/**
70+
* @param list<mixed> $elements
71+
*/
72+
public function withElements(array $elements): self
73+
{
74+
$self = clone $this;
75+
$self['elements'] = $elements;
76+
77+
return $self;
78+
}
79+
80+
/**
81+
* Content version identifier.
82+
*/
83+
public function withVersion(string $version): self
84+
{
85+
$self = clone $this;
86+
$self['version'] = $version;
87+
88+
return $self;
89+
}
90+
}

0 commit comments

Comments
 (0)