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 @@
{
".": "5.13.0"
".": "5.13.1"
}
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 134
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/courier/courier-b053468fefe6d757f86f3233ebbc52d80329ed2a6e7a6740fee01e4028a4c3b9.yml
openapi_spec_hash: 416835e693de0fe19945be90a787d3f3
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/courier/courier-0630b37ff5ba795185e1e189b0f24d233ecd51681b6ebb7748cad8f0e8c4fcc0.yml
openapi_spec_hash: b9a8c66633e914c9a2f7b3bf275c7349
config_hash: 8d28dbeabe9d4dcc7d5b8c021a4cbbd7
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 5.13.1 (2026-07-23)

Full Changelog: [v5.13.0...v5.13.1](https://github.com/trycourier/courier-php/compare/v5.13.0...v5.13.1)

### Documentation

* **openapi:** describe user topic-preference fields explicitly ([#172](https://github.com/trycourier/courier-php/issues/172)) ([118ad39](https://github.com/trycourier/courier-php/commit/118ad3932b1feb9950ee303995db021ff183bc29))

## 5.13.0 (2026-07-23)

Full Changelog: [v5.12.0...v5.13.0](https://github.com/trycourier/courier-php/compare/v5.12.0...v5.13.0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,16 @@ final class Topic implements BaseModel
/** @use SdkModel<TopicShape> */
use SdkModel;

/** @var value-of<PreferenceStatus> $status */
/**
* The subscription status to set: OPTED_IN or OPTED_OUT. REQUIRED is a topic-level default, not a user choice; the API rejects opting a user out of a REQUIRED topic.
*
* @var value-of<PreferenceStatus> $status
*/
#[Required(enum: PreferenceStatus::class)]
public string $status;

/**
* The Channels a user has chosen to receive notifications through for this topic.
* The channels to deliver this topic on when has_custom_routing is true. One or more of: direct_message, email, push, sms, webhook, inbox.
*
* @var list<value-of<ChannelClassification>>|null $customRouting
*/
Expand All @@ -39,6 +43,9 @@ final class Topic implements BaseModel
)]
public ?array $customRouting;

/**
* Set to true to route this topic to the channels in custom_routing instead of the topic's default routing.
*/
#[Optional('has_custom_routing', nullable: true)]
public ?bool $hasCustomRouting;

Expand Down Expand Up @@ -85,6 +92,8 @@ public static function with(
}

/**
* The subscription status to set: OPTED_IN or OPTED_OUT. REQUIRED is a topic-level default, not a user choice; the API rejects opting a user out of a REQUIRED topic.
*
* @param PreferenceStatus|value-of<PreferenceStatus> $status
*/
public function withStatus(PreferenceStatus|string $status): self
Expand All @@ -96,7 +105,7 @@ public function withStatus(PreferenceStatus|string $status): self
}

/**
* The Channels a user has chosen to receive notifications through for this topic.
* The channels to deliver this topic on when has_custom_routing is true. One or more of: direct_message, email, push, sms, webhook, inbox.
*
* @param list<ChannelClassification|value-of<ChannelClassification>>|null $customRouting
*/
Expand All @@ -108,6 +117,9 @@ public function withCustomRouting(?array $customRouting): self
return $self;
}

/**
* Set to true to route this topic to the channels in custom_routing instead of the topic's default routing.
*/
public function withHasCustomRouting(?bool $hasCustomRouting): self
{
$self = clone $this;
Expand Down
38 changes: 34 additions & 4 deletions src/Users/Preferences/TopicPreference.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,36 @@ final class TopicPreference implements BaseModel
/** @use SdkModel<TopicPreferenceShape> */
use SdkModel;

/** @var value-of<PreferenceStatus> $defaultStatus */
/**
* The topic's default status, returned on reads. It applies whenever the user has no override of their own (status equals this value).
*
* @var value-of<PreferenceStatus> $defaultStatus
*/
#[Required('default_status', enum: PreferenceStatus::class)]
public string $defaultStatus;

/** @var value-of<PreferenceStatus> $status */
/**
* The user's subscription status for this topic. OPTED_IN or OPTED_OUT reflect the user's own choice; REQUIRED is a topic-level default set in the preferences editor, not a user choice.
*
* @var value-of<PreferenceStatus> $status
*/
#[Required(enum: PreferenceStatus::class)]
public string $status;

/**
* The unique identifier of the subscription topic this preference applies to.
*/
#[Required('topic_id')]
public string $topicID;

/**
* The display name of the subscription topic, returned on reads.
*/
#[Required('topic_name')]
public string $topicName;

/**
* The Channels a user has chosen to receive notifications through for this topic.
* The channels the user has chosen to receive this topic on, present only when has_custom_routing is true. One or more of: direct_message, email, push, sms, webhook, inbox.
*
* @var list<value-of<ChannelClassification>>|null $customRouting
*/
Expand All @@ -52,6 +66,9 @@ final class TopicPreference implements BaseModel
)]
public ?array $customRouting;

/**
* Whether the user has chosen specific delivery channels for this topic (listed in custom_routing) rather than the topic's default routing.
*/
#[Optional('has_custom_routing', nullable: true)]
public ?bool $hasCustomRouting;

Expand Down Expand Up @@ -111,6 +128,8 @@ public static function with(
}

/**
* The topic's default status, returned on reads. It applies whenever the user has no override of their own (status equals this value).
*
* @param PreferenceStatus|value-of<PreferenceStatus> $defaultStatus
*/
public function withDefaultStatus(
Expand All @@ -123,6 +142,8 @@ public function withDefaultStatus(
}

/**
* The user's subscription status for this topic. OPTED_IN or OPTED_OUT reflect the user's own choice; REQUIRED is a topic-level default set in the preferences editor, not a user choice.
*
* @param PreferenceStatus|value-of<PreferenceStatus> $status
*/
public function withStatus(PreferenceStatus|string $status): self
Expand All @@ -133,6 +154,9 @@ public function withStatus(PreferenceStatus|string $status): self
return $self;
}

/**
* The unique identifier of the subscription topic this preference applies to.
*/
public function withTopicID(string $topicID): self
{
$self = clone $this;
Expand All @@ -141,6 +165,9 @@ public function withTopicID(string $topicID): self
return $self;
}

/**
* The display name of the subscription topic, returned on reads.
*/
public function withTopicName(string $topicName): self
{
$self = clone $this;
Expand All @@ -150,7 +177,7 @@ public function withTopicName(string $topicName): self
}

/**
* The Channels a user has chosen to receive notifications through for this topic.
* The channels the user has chosen to receive this topic on, present only when has_custom_routing is true. One or more of: direct_message, email, push, sms, webhook, inbox.
*
* @param list<ChannelClassification|value-of<ChannelClassification>>|null $customRouting
*/
Expand All @@ -162,6 +189,9 @@ public function withCustomRouting(?array $customRouting): self
return $self;
}

/**
* Whether the user has chosen specific delivery channels for this topic (listed in custom_routing) rather than the topic's default routing.
*/
public function withHasCustomRouting(?bool $hasCustomRouting): self
{
$self = clone $this;
Expand Down
2 changes: 1 addition & 1 deletion src/Version.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
namespace Courier;

// x-release-please-start-version
const VERSION = '5.13.0';
const VERSION = '5.13.1';
// x-release-please-end