diff --git a/src/Generated/ChatTrait.php b/src/Generated/ChatTrait.php index 9cd68bf..3908f3c 100644 --- a/src/Generated/ChatTrait.php +++ b/src/Generated/ChatTrait.php @@ -615,6 +615,83 @@ public function getManyMessages(string $type, string $id, array $ids, ?array $me $requestData = null; return StreamResponse::fromJson($this->makeRequest('GET', $path, $queryParams, $requestData), GeneratedModels\GetManyMessagesResponse::class); } + /** + * Returns pinned messages for the channel + * + * @param string $type + * @param string $id + * @param ?int $limit + * @param ?int $offset + * @param ?string $idGte + * @param ?string $idGt + * @param ?string $idLte + * @param ?string $idLt + * @param ?\DateTime $pinnedAtAfterOrEqual + * @param ?\DateTime $pinnedAtAfter + * @param ?\DateTime $pinnedAtBeforeOrEqual + * @param ?\DateTime $pinnedAtBefore + * @param ?string $idAround + * @param ?\DateTime $pinnedAtAround + * @param ?string $userID + * @param ?array $sort + * @param ?array $memberCustomInclude + * @return StreamResponse + * @throws StreamException + */ + public function getPinnedMessages(string $type, string $id, ?int $limit = null, ?int $offset = null, ?string $idGte = null, ?string $idGt = null, ?string $idLte = null, ?string $idLt = null, ?\DateTime $pinnedAtAfterOrEqual = null, ?\DateTime $pinnedAtAfter = null, ?\DateTime $pinnedAtBeforeOrEqual = null, ?\DateTime $pinnedAtBefore = null, ?string $idAround = null, ?\DateTime $pinnedAtAround = null, ?string $userID = null, ?array $sort = null, ?array $memberCustomInclude = null): StreamResponse { + $path = '/api/v2/chat/channels/{type}/{id}/pinned_messages'; + $path = str_replace('{type}', (string) $type, $path); + $path = str_replace('{id}', (string) $id, $path); + + $queryParams = []; + if ($limit !== null) { + $queryParams['limit'] = $limit; + } + if ($offset !== null) { + $queryParams['offset'] = $offset; + } + if ($idGte !== null) { + $queryParams['id_gte'] = $idGte; + } + if ($idGt !== null) { + $queryParams['id_gt'] = $idGt; + } + if ($idLte !== null) { + $queryParams['id_lte'] = $idLte; + } + if ($idLt !== null) { + $queryParams['id_lt'] = $idLt; + } + if ($pinnedAtAfterOrEqual !== null) { + $queryParams['pinned_at_after_or_equal'] = $pinnedAtAfterOrEqual; + } + if ($pinnedAtAfter !== null) { + $queryParams['pinned_at_after'] = $pinnedAtAfter; + } + if ($pinnedAtBeforeOrEqual !== null) { + $queryParams['pinned_at_before_or_equal'] = $pinnedAtBeforeOrEqual; + } + if ($pinnedAtBefore !== null) { + $queryParams['pinned_at_before'] = $pinnedAtBefore; + } + if ($idAround !== null) { + $queryParams['id_around'] = $idAround; + } + if ($pinnedAtAround !== null) { + $queryParams['pinned_at_around'] = $pinnedAtAround; + } + if ($userID !== null) { + $queryParams['user_id'] = $userID; + } + if ($sort !== null) { + $queryParams['sort'] = $sort; + } + if ($memberCustomInclude !== null) { + $queryParams['member_custom_include'] = $memberCustomInclude; + } + $requestData = null; + return StreamResponse::fromJson($this->makeRequest('GET', $path, $queryParams, $requestData), GeneratedModels\GetPinnedMessagesResponse::class); + } /** * This Method creates a channel or returns an existing one with matching attributes * Sends events: @@ -1390,6 +1467,87 @@ public function unmuteChannel(GeneratedModels\UnmuteChannelRequest $requestData) // Use the provided request data array directly return StreamResponse::fromJson($this->makeRequest('POST', $path, $queryParams, $requestData), GeneratedModels\UnmuteResponse::class); } + /** + * Get all predefined filters with optional sorting by created_at, updated_at, name, or operation + * + * @param ?bool $includeStats + * @param ?array $sort + * @return StreamResponse + * @throws StreamException + */ + public function getPredefinedFilters(?bool $includeStats = null, ?array $sort = null): StreamResponse { + $path = '/api/v2/chat/predefined_filters'; + + $queryParams = []; + if ($includeStats !== null) { + $queryParams['include_stats'] = $includeStats; + } + if ($sort !== null) { + $queryParams['sort'] = $sort; + } + $requestData = null; + return StreamResponse::fromJson($this->makeRequest('GET', $path, $queryParams, $requestData), GeneratedModels\QueryPredefinedFiltersResponse::class); + } + /** + * Create a predefined filter that can be used in Query endpoints + * + * @param GeneratedModels\CreatePredefinedFilterRequest $requestData + * @return StreamResponse + * @throws StreamException + */ + public function createPredefinedFilter(GeneratedModels\CreatePredefinedFilterRequest $requestData): StreamResponse { + $path = '/api/v2/chat/predefined_filters'; + + $queryParams = []; + // Use the provided request data array directly + return StreamResponse::fromJson($this->makeRequest('POST', $path, $queryParams, $requestData), GeneratedModels\CreatePredefinedFilterResponse::class); + } + /** + * Delete a predefined filter by name + * + * @param string $name + * @return StreamResponse + * @throws StreamException + */ + public function deletePredefinedFilter(string $name): StreamResponse { + $path = '/api/v2/chat/predefined_filters/{name}'; + $path = str_replace('{name}', (string) $name, $path); + + $queryParams = []; + $requestData = null; + return StreamResponse::fromJson($this->makeRequest('DELETE', $path, $queryParams, $requestData), GeneratedModels\Response::class); + } + /** + * Get a predefined filter by name + * + * @param string $name + * @return StreamResponse + * @throws StreamException + */ + public function getPredefinedFilter(string $name): StreamResponse { + $path = '/api/v2/chat/predefined_filters/{name}'; + $path = str_replace('{name}', (string) $name, $path); + + $queryParams = []; + $requestData = null; + return StreamResponse::fromJson($this->makeRequest('GET', $path, $queryParams, $requestData), GeneratedModels\GetPredefinedFilterResponse::class); + } + /** + * Update a predefined filter by name + * + * @param string $name + * @param GeneratedModels\UpdatePredefinedFilterRequest $requestData + * @return StreamResponse + * @throws StreamException + */ + public function updatePredefinedFilter(string $name, GeneratedModels\UpdatePredefinedFilterRequest $requestData): StreamResponse { + $path = '/api/v2/chat/predefined_filters/{name}'; + $path = str_replace('{name}', (string) $name, $path); + + $queryParams = []; + // Use the provided request data array directly + return StreamResponse::fromJson($this->makeRequest('PUT', $path, $queryParams, $requestData), GeneratedModels\UpdatePredefinedFilterResponse::class); + } /** * Find and filter channel scoped or global user bans * @@ -1668,6 +1826,9 @@ public function querySegmentTargets(string $id, GeneratedModels\QuerySegmentTarg * - Use 'month' parameter (YYYY-MM format) for monthly aggregated values * - Use 'start_date'/'end_date' parameters (YYYY-MM-DD format) for daily breakdown * - If neither provided, defaults to current month (monthly mode) + * **Team Filter:** + * - Use 'team' to return a single team's stats (empty string selects users not assigned to any team) + * - Mutually exclusive with the 'next' pagination cursor * This endpoint is server-side only. * * @param GeneratedModels\QueryTeamUsageStatsRequest $requestData diff --git a/src/Generated/CommonTrait.php b/src/Generated/CommonTrait.php index 4f62127..2e34e69 100644 --- a/src/Generated/CommonTrait.php +++ b/src/Generated/CommonTrait.php @@ -565,6 +565,35 @@ public function listPermissions(): StreamResponse { $requestData = null; return StreamResponse::fromJson($this->makeRequest('GET', $path, $queryParams, $requestData), GeneratedModels\ListPermissionsResponse::class); } + /** + * Creates permission + * + * @param GeneratedModels\CreatePermissionRequest $requestData + * @return StreamResponse + * @throws StreamException + */ + public function createPermission(GeneratedModels\CreatePermissionRequest $requestData): StreamResponse { + $path = '/api/v2/permissions'; + + $queryParams = []; + // Use the provided request data array directly + return StreamResponse::fromJson($this->makeRequest('POST', $path, $queryParams, $requestData), GeneratedModels\Response::class); + } + /** + * Deletes custom permission + * + * @param string $id + * @return StreamResponse + * @throws StreamException + */ + public function deletePermission(string $id): StreamResponse { + $path = '/api/v2/permissions/{id}'; + $path = str_replace('{id}', (string) $id, $path); + + $queryParams = []; + $requestData = null; + return StreamResponse::fromJson($this->makeRequest('DELETE', $path, $queryParams, $requestData), GeneratedModels\Response::class); + } /** * Gets custom permission * @@ -580,6 +609,22 @@ public function getPermission(string $id): StreamResponse { $requestData = null; return StreamResponse::fromJson($this->makeRequest('GET', $path, $queryParams, $requestData), GeneratedModels\GetCustomPermissionResponse::class); } + /** + * Updates custom permission + * + * @param string $id + * @param GeneratedModels\PermissionRequest $requestData + * @return StreamResponse + * @throws StreamException + */ + public function updatePermission(string $id, GeneratedModels\PermissionRequest $requestData): StreamResponse { + $path = '/api/v2/permissions/{id}'; + $path = str_replace('{id}', (string) $id, $path); + + $queryParams = []; + // Use the provided request data array directly + return StreamResponse::fromJson($this->makeRequest('PUT', $path, $queryParams, $requestData), GeneratedModels\Response::class); + } /** * Creates a new poll * diff --git a/src/Generated/FeedMethods.php b/src/Generated/FeedMethods.php index aae6df5..0cfdd9b 100644 --- a/src/Generated/FeedMethods.php +++ b/src/Generated/FeedMethods.php @@ -97,6 +97,16 @@ public function changeFeedVisibility( GeneratedModels\ChangeFeedVisibilityRequest $requestData): StreamResponse { return $this->feedsV3Client->changeFeedVisibility($this->feedGroup, $this->feedId, $requestData); } + /** + * Returns the number of activities in a feed, the total number of comments on those activities (including nested replies), and the sum of both. The comment total is cached for a few seconds on large feeds. + * + * @return StreamResponse + * @throws StreamException + */ + public function getFeedCounts( + ): StreamResponse { + return $this->feedsV3Client->getFeedCounts($this->feedGroup, $this->feedId); + } /** * Add, remove, or set members for a feed * diff --git a/src/Generated/FeedsTrait.php b/src/Generated/FeedsTrait.php index 7a82259..417632d 100644 --- a/src/Generated/FeedsTrait.php +++ b/src/Generated/FeedsTrait.php @@ -1215,6 +1215,23 @@ public function changeFeedVisibility(string $feedGroupID, string $feedID, Genera // Use the provided request data array directly return StreamResponse::fromJson($this->makeRequest('POST', $path, $queryParams, $requestData), GeneratedModels\ChangeFeedVisibilityResponse::class); } + /** + * Returns the number of activities in a feed, the total number of comments on those activities (including nested replies), and the sum of both. The comment total is cached for a few seconds on large feeds. + * + * @param string $feedGroupID + * @param string $feedID + * @return StreamResponse + * @throws StreamException + */ + public function getFeedCounts(string $feedGroupID, string $feedID): StreamResponse { + $path = '/api/v2/feeds/feed_groups/{feed_group_id}/feeds/{feed_id}/counts'; + $path = str_replace('{feed_group_id}', (string) $feedGroupID, $path); + $path = str_replace('{feed_id}', (string) $feedID, $path); + + $queryParams = []; + $requestData = null; + return StreamResponse::fromJson($this->makeRequest('GET', $path, $queryParams, $requestData), GeneratedModels\GetFeedCountsResponse::class); + } /** * Add, remove, or set members for a feed * diff --git a/src/GeneratedModels/ActivityProcessorConfig.php b/src/GeneratedModels/ActivityProcessorConfig.php index 276470b..626784a 100644 --- a/src/GeneratedModels/ActivityProcessorConfig.php +++ b/src/GeneratedModels/ActivityProcessorConfig.php @@ -7,6 +7,8 @@ class ActivityProcessorConfig extends BaseModel { public function __construct( public ?string $type = null, // Type of activity processor (required) + public ?int $minTextLength = null, // Minimum number of characters the activity text must have before this processor runs. 0 (the default) disables the check. Only applies to text_interest_tags. + public ?int $minWordCount = null, // Minimum number of words the activity text must have before this processor runs. 0 (the default) disables the check. Only applies to text_interest_tags. Words are whitespace-separated, so scripts written without word spacing (Chinese, Japanese, Thai) always count as 1 word regardless of length — use min_text_length for those. ) { } diff --git a/src/GeneratedModels/BulkActionAppealsRequest.php b/src/GeneratedModels/BulkActionAppealsRequest.php index f06b108..0db5f10 100644 --- a/src/GeneratedModels/BulkActionAppealsRequest.php +++ b/src/GeneratedModels/BulkActionAppealsRequest.php @@ -9,8 +9,8 @@ public function __construct( public ?array $appealIds = null, // List of appeal UUIDs to process public ?string $actionType = null, // Action to apply: unban, restore, unblock, mark_reviewed, or reject_appeal public ?UnbanActionRequestPayload $unban = null, // Configuration for unban moderation action - public ?RestoreActionRequestPayload $restore = null, // Configuration for restore action - public ?UnblockActionRequestPayload $unblock = null, // Configuration for unblock action + public ?RestoreActionRequestPayload $restore = null, // Configuration for restore action. State-aware: reverses whichever of a delete, a block, or a shadow block currently applies to the content (including both a delete and a block/shadow block at once). + public ?UnblockActionRequestPayload $unblock = null, // Deprecated: use restore instead — it now also reverses a block or shadow block. Configuration for unblock action. public ?MarkReviewedRequestPayload $markReviewed = null, // Configuration for mark reviewed action public ?RejectAppealRequestPayload $rejectAppeal = null, // Configuration for rejecting an appeal public ?string $userID = null, diff --git a/src/GeneratedModels/ChannelConfig.php b/src/GeneratedModels/ChannelConfig.php index 084353d..0304e12 100644 --- a/src/GeneratedModels/ChannelConfig.php +++ b/src/GeneratedModels/ChannelConfig.php @@ -26,6 +26,7 @@ public function __construct( public ?bool $userMessageReminders = null, public ?bool $sharedLocations = null, public ?bool $countMessages = null, + public ?string $messageRetention = null, public ?int $maxMessageLength = null, public ?string $automod = null, public ?string $automodBehavior = null, diff --git a/src/GeneratedModels/ChannelConfigWithInfo.php b/src/GeneratedModels/ChannelConfigWithInfo.php index e4ce7b0..4761f7b 100644 --- a/src/GeneratedModels/ChannelConfigWithInfo.php +++ b/src/GeneratedModels/ChannelConfigWithInfo.php @@ -28,6 +28,7 @@ public function __construct( public ?bool $userMessageReminders = null, public ?bool $sharedLocations = null, public ?bool $countMessages = null, + public ?string $messageRetention = null, public ?int $maxMessageLength = null, public ?string $automod = null, public ?string $automodBehavior = null, diff --git a/src/GeneratedModels/ChannelTypeConfig.php b/src/GeneratedModels/ChannelTypeConfig.php index c307f05..ccf29c1 100644 --- a/src/GeneratedModels/ChannelTypeConfig.php +++ b/src/GeneratedModels/ChannelTypeConfig.php @@ -32,6 +32,7 @@ public function __construct( public ?bool $userMessageReminders = null, public ?bool $sharedLocations = null, public ?bool $countMessages = null, + public ?string $messageRetention = null, public ?int $maxMessageLength = null, public ?string $automod = null, public ?string $automodBehavior = null, diff --git a/src/GeneratedModels/Classification.php b/src/GeneratedModels/Classification.php index 7b67d8b..bbae9bf 100644 --- a/src/GeneratedModels/Classification.php +++ b/src/GeneratedModels/Classification.php @@ -12,6 +12,7 @@ public function __construct( /** @var array|null */ #[ArrayOf(Classification::class)] public ?array $subclassifications = null, + public ?array $matchedContributors = null, ) { } diff --git a/src/GeneratedModels/CreateChannelTypeResponse.php b/src/GeneratedModels/CreateChannelTypeResponse.php index 0d43ce8..ccc823e 100644 --- a/src/GeneratedModels/CreateChannelTypeResponse.php +++ b/src/GeneratedModels/CreateChannelTypeResponse.php @@ -26,6 +26,7 @@ public function __construct( public ?bool $userMessageReminders = null, public ?bool $sharedLocations = null, public ?bool $countMessages = null, + public ?string $messageRetention = null, public ?int $maxMessageLength = null, public ?string $automod = null, public ?string $automodBehavior = null, diff --git a/src/GeneratedModels/CreatePermissionRequest.php b/src/GeneratedModels/CreatePermissionRequest.php new file mode 100644 index 0000000..61287c3 --- /dev/null +++ b/src/GeneratedModels/CreatePermissionRequest.php @@ -0,0 +1,21 @@ +|null */ + #[ArrayOf(MessageResponse::class)] + public ?array $messages = null, // Messages + public ?string $duration = null, // Duration of the request in milliseconds + ) { + } + + // BaseModel automatically handles jsonSerialize(), toArray(), and fromJson() using constructor types! + // Use #[JsonKey('user_id')] to override field names if needed. +} diff --git a/src/GeneratedModels/GetPredefinedFilterResponse.php b/src/GeneratedModels/GetPredefinedFilterResponse.php new file mode 100644 index 0000000..a39ce5c --- /dev/null +++ b/src/GeneratedModels/GetPredefinedFilterResponse.php @@ -0,0 +1,16 @@ +|null */ + #[ArrayOf(SortParam::class)] + public ?array $sort = null, + public ?int $queryID = null, + public ?\DateTime $createdAt = null, + public ?\DateTime $updatedAt = null, + public ?PredefinedFilterStatsResponse $stats = null, + public ?PerformanceAnalysisResponse $performance = null, + ) { + } + + // BaseModel automatically handles jsonSerialize(), toArray(), and fromJson() using constructor types! + // Use #[JsonKey('user_id')] to override field names if needed. +} diff --git a/src/GeneratedModels/PredefinedFilterStatsResponse.php b/src/GeneratedModels/PredefinedFilterStatsResponse.php new file mode 100644 index 0000000..d25b542 --- /dev/null +++ b/src/GeneratedModels/PredefinedFilterStatsResponse.php @@ -0,0 +1,17 @@ +|null */ + #[ArrayOf(PredefinedFilterResponse::class)] + public ?array $predefinedFilters = null, // Predefined filters + public ?string $next = null, + public ?string $prev = null, + public ?string $duration = null, // Duration of the request in milliseconds + ) { + } + + // BaseModel automatically handles jsonSerialize(), toArray(), and fromJson() using constructor types! + // Use #[JsonKey('user_id')] to override field names if needed. +} diff --git a/src/GeneratedModels/QueryTeamUsageStatsRequest.php b/src/GeneratedModels/QueryTeamUsageStatsRequest.php index 03a4a37..a751769 100644 --- a/src/GeneratedModels/QueryTeamUsageStatsRequest.php +++ b/src/GeneratedModels/QueryTeamUsageStatsRequest.php @@ -14,6 +14,7 @@ public function __construct( public ?string $endDate = null, // End date in YYYY-MM-DD format. Used with start_date for custom date range. Returns daily breakdown. public ?int $limit = null, // Maximum number of teams to return per page (default: 30, max: 30) public ?string $next = null, // Cursor for pagination to fetch next page of teams + public ?string $team = null, // Filter results to a single team ID. Empty string selects users not assigned to any team. Mutually exclusive with 'next'. ) { } diff --git a/src/GeneratedModels/RestoreActionRequestPayload.php b/src/GeneratedModels/RestoreActionRequestPayload.php index 855d667..d3ba64b 100644 --- a/src/GeneratedModels/RestoreActionRequestPayload.php +++ b/src/GeneratedModels/RestoreActionRequestPayload.php @@ -4,7 +4,7 @@ namespace GetStream\GeneratedModels; /** - * Configuration for restore action + * Configuration for restore action. State-aware: reverses whichever of a delete, a block, or a shadow block currently applies to the content (including both a delete and a block/shadow block at once). */ class RestoreActionRequestPayload extends BaseModel { diff --git a/src/GeneratedModels/SortParam.php b/src/GeneratedModels/SortParam.php index 7e4b5a7..ef177cb 100644 --- a/src/GeneratedModels/SortParam.php +++ b/src/GeneratedModels/SortParam.php @@ -3,19 +3,12 @@ declare(strict_types=1); namespace GetStream\GeneratedModels; -/** - * - * - * @property int|null $direction - * @property string|null $field - * @property string|null $type - */ class SortParam extends BaseModel { public function __construct( - public ?int $direction = null, public ?string $field = null, public ?string $type = null, + public ?int $direction = null, ) { } diff --git a/src/GeneratedModels/SubmitActionRequest.php b/src/GeneratedModels/SubmitActionRequest.php index 1b6b795..016fb02 100644 --- a/src/GeneratedModels/SubmitActionRequest.php +++ b/src/GeneratedModels/SubmitActionRequest.php @@ -19,8 +19,8 @@ public function __construct( public ?BanActionRequestPayload $ban = null, // Configuration for ban moderation action public ?CustomActionRequestPayload $custom = null, // Configuration for custom moderation action public ?UnbanActionRequestPayload $unban = null, // Configuration for unban moderation action - public ?RestoreActionRequestPayload $restore = null, // Configuration for restore action - public ?UnblockActionRequestPayload $unblock = null, // Configuration for unblock action + public ?RestoreActionRequestPayload $restore = null, // Configuration for restore action. State-aware: reverses whichever of a delete, a block, or a shadow block currently applies to the content (including both a delete and a block/shadow block at once). + public ?UnblockActionRequestPayload $unblock = null, // Deprecated: use restore instead — it now also reverses a block or shadow block. Configuration for unblock action. public ?BlockActionRequestPayload $block = null, // Configuration for block action public ?ShadowBlockActionRequestPayload $shadowBlock = null, // Configuration for shadow block action public ?BypassActionRequest $bypass = null, diff --git a/src/GeneratedModels/UnblockActionRequestPayload.php b/src/GeneratedModels/UnblockActionRequestPayload.php index 1f41a71..d5ec0df 100644 --- a/src/GeneratedModels/UnblockActionRequestPayload.php +++ b/src/GeneratedModels/UnblockActionRequestPayload.php @@ -4,7 +4,7 @@ namespace GetStream\GeneratedModels; /** - * Configuration for unblock action + * Deprecated: use restore instead — it now also reverses a block or shadow block. Configuration for unblock action. */ class UnblockActionRequestPayload extends BaseModel { diff --git a/src/GeneratedModels/UpdateChannelTypeRequest.php b/src/GeneratedModels/UpdateChannelTypeRequest.php index e69c015..c19ad14 100644 --- a/src/GeneratedModels/UpdateChannelTypeRequest.php +++ b/src/GeneratedModels/UpdateChannelTypeRequest.php @@ -31,6 +31,7 @@ public function __construct( public ?bool $userMessageReminders = null, public ?bool $sharedLocations = null, public ?bool $countMessages = null, + public ?string $messageRetention = null, public ?int $maxMessageLength = null, public ?string $automod = null, public ?string $automodBehavior = null, diff --git a/src/GeneratedModels/UpdateChannelTypeResponse.php b/src/GeneratedModels/UpdateChannelTypeResponse.php index 4fa22c1..e38b457 100644 --- a/src/GeneratedModels/UpdateChannelTypeResponse.php +++ b/src/GeneratedModels/UpdateChannelTypeResponse.php @@ -30,6 +30,7 @@ public function __construct( public ?bool $userMessageReminders = null, public ?bool $sharedLocations = null, public ?bool $countMessages = null, + public ?string $messageRetention = null, public ?int $maxMessageLength = null, public ?string $automod = null, public ?string $automodBehavior = null, diff --git a/src/GeneratedModels/UpdatePredefinedFilterRequest.php b/src/GeneratedModels/UpdatePredefinedFilterRequest.php new file mode 100644 index 0000000..e51c6fc --- /dev/null +++ b/src/GeneratedModels/UpdatePredefinedFilterRequest.php @@ -0,0 +1,18 @@ +