Skip to content
Merged
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
4 changes: 2 additions & 2 deletions .spec-version
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
spec: openapi-v241.37.3
generator: chat v241.37.3
spec: openapi-v241.37.4
generator: chat v241.37.4
11 changes: 11 additions & 0 deletions src/Generated/FeedMethods.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,17 @@ public function pinActivity(
string $activityID, ?GeneratedModels\PinActivityRequest $requestData = null): StreamResponse {
return $this->feedsV3Client->pinActivity($this->feedGroup, $this->feedId, $activityID, $requestData);
}
/**
* Query the current bans for one feed, newest first. Requires feed moderation permission. Active bans are returned by default.
*
* @param ?GeneratedModels\QueryFeedBansRequest $requestData
* @return StreamResponse<GeneratedModels\QueryFeedBansResponse>
* @throws StreamException
*/
public function queryFeedBans(
?GeneratedModels\QueryFeedBansRequest $requestData = null): StreamResponse {
return $this->feedsV3Client->queryFeedBans($this->feedGroup, $this->feedId, $requestData);
}
/**
* Changes the visibility of an existing feed. Follow reconciliation (rewriting pending follows on loosening, or removing disallowed follows/members on tightening) runs asynchronously in the background; the response returns optimistically with the intended visibility.
*
Expand Down
18 changes: 18 additions & 0 deletions src/Generated/FeedsTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -1269,6 +1269,24 @@ public function pinActivity(string $feedGroupID, string $feedID, string $activit
$requestData ??= new GeneratedModels\PinActivityRequest();
return StreamResponse::fromJson($this->makeRequest('POST', $path, $queryParams, $requestData), GeneratedModels\PinActivityResponse::class);
}
/**
* Query the current bans for one feed, newest first. Requires feed moderation permission. Active bans are returned by default.
*
* @param string $feedGroupID
* @param string $feedID
* @param ?GeneratedModels\QueryFeedBansRequest $requestData
* @return StreamResponse<GeneratedModels\QueryFeedBansResponse>
* @throws StreamException
*/
public function queryFeedBans(string $feedGroupID, string $feedID, ?GeneratedModels\QueryFeedBansRequest $requestData = null): StreamResponse {
$path = '/api/v2/feeds/feed_groups/{feed_group_id}/feeds/{feed_id}/bans/query';
$path = str_replace('{feed_group_id}', (string) $feedGroupID, $path);
$path = str_replace('{feed_id}', (string) $feedID, $path);

$queryParams = [];
$requestData ??= new GeneratedModels\QueryFeedBansRequest();
return StreamResponse::fromJson($this->makeRequest('POST', $path, $queryParams, $requestData), GeneratedModels\QueryFeedBansResponse::class);
}
/**
* Changes the visibility of an existing feed. Follow reconciliation (rewriting pending follows on loosening, or removing disallowed follows/members on tightening) runs asynchronously in the background; the response returns optimistically with the intended visibility.
*
Expand Down
10 changes: 7 additions & 3 deletions src/Generated/ModerationTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ public function bulkActionAppeals(GeneratedModels\BulkActionAppealsRequest $requ
return StreamResponse::fromJson($this->makeRequest('POST', $path, $queryParams, $requestData), GeneratedModels\BulkActionAppealsResponse::class);
}
/**
* Ban a user from a channel or the entire app
* Ban a user from a feed, channel or the entire app
*
* @param GeneratedModels\BanRequest $requestData
* @return StreamResponse<GeneratedModels\ModerationBanResponse>
Expand Down Expand Up @@ -941,18 +941,19 @@ public function submitModerationFeedback(?GeneratedModels\SubmitModerationFeedba
return StreamResponse::fromJson($this->makeRequest('POST', $path, $queryParams, $requestData), GeneratedModels\SubmitModerationFeedbackResponse::class);
}
/**
* Unban a user from a channel or globally.
* Unban a user from a feed, channel or globally.
*
* @param GeneratedModels\UnbanRequest $requestData
* @param string $targetUserID
* @param ?string $channelCid
* @param ?string $createdBy
* @param ?bool $removeFutureChannelsBan
* @param ?string $channelType
* @param ?string $feedFid
* @return StreamResponse<GeneratedModels\UnbanResponse>
* @throws StreamException
*/
public function unban(GeneratedModels\UnbanRequest $requestData, string $targetUserID, ?string $channelCid = null, ?string $createdBy = null, ?bool $removeFutureChannelsBan = null, ?string $channelType = null): StreamResponse {
public function unban(GeneratedModels\UnbanRequest $requestData, string $targetUserID, ?string $channelCid = null, ?string $createdBy = null, ?bool $removeFutureChannelsBan = null, ?string $channelType = null, ?string $feedFid = null): StreamResponse {
$path = '/api/v2/moderation/unban';

$queryParams = [];
Expand All @@ -971,6 +972,9 @@ public function unban(GeneratedModels\UnbanRequest $requestData, string $targetU
if ($channelType !== null) {
$queryParams['channel_type'] = $channelType;
}
if ($feedFid !== null) {
$queryParams['feed_fid'] = $feedFid;
}
return StreamResponse::fromJson($this->makeRequest('POST', $path, $queryParams, $requestData), GeneratedModels\UnbanResponse::class);
}
/**
Expand Down
1 change: 1 addition & 0 deletions src/GeneratedModels/BanRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ public function __construct(
public ?int $timeout = null, // Duration of the ban in minutes
public ?string $reason = null, // Optional explanation for the ban
public ?string $channelCid = null, // Channel where the ban applies
public ?string $feedFid = null, // Feed where the ban applies, in group:id format. Cannot be combined with channel scope, shadow, IP bans or message/reaction deletion.
public ?bool $shadow = null, // Whether this is a shadow ban
public ?bool $ipBan = null, // Whether to ban the user's IP address
public ?string $bannedByID = null, // ID of the user performing the ban
Expand Down
22 changes: 22 additions & 0 deletions src/GeneratedModels/FeedBanResponse.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php

declare(strict_types=1);

namespace GetStream\GeneratedModels;
class FeedBanResponse extends BaseModel
{
public function __construct(
public ?string $targetUserID = null, // ID of the banned user
public ?string $feedFid = null, // Feed where the ban applies, in group:id format
public ?string $createdByID = null, // ID of the moderator who issued the ban, when available
public ?string $reason = null, // Explanation for the ban
public ?\DateTime $createdAt = null, // Time the ban was first created
public ?\DateTime $expires = null, // Ban expiry time. Absent for permanent bans.
public ?UserResponse $user = null, // User response object
public ?UserResponse $createdBy = null, // User response object
) {
}

// BaseModel automatically handles jsonSerialize(), toArray(), and fromJson() using constructor types!
// Use #[JsonKey('user_id')] to override field names if needed.
}
1 change: 1 addition & 0 deletions src/GeneratedModels/FeedOwnCapability.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class FeedOwnCapability
public const ADD_ACTIVITY_REACTION = 'add-activity-reaction';
public const ADD_COMMENT = 'add-comment';
public const ADD_COMMENT_REACTION = 'add-comment-reaction';
public const BAN_FEED_MEMBER = 'ban-feed-member';
public const CREATE_FEED = 'create-feed';
public const DELETE_ANY_ACTIVITY = 'delete-any-activity';
public const DELETE_ANY_COMMENT = 'delete-any-comment';
Expand Down
22 changes: 22 additions & 0 deletions src/GeneratedModels/QueryFeedBansRequest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php

declare(strict_types=1);

namespace GetStream\GeneratedModels;
/**
* Query a feed's current bans, ordered by creation time descending and target user ID descending. Returns active bans by default; unbanned records are not retained.
*/
class QueryFeedBansRequest extends BaseModel
{
public function __construct(
public ?string $targetUserID = null, // Optionally restrict results to this exact user ID
public ?bool $includeExpired = null, // Include expired bans in addition to active bans. Defaults to false.
public ?int $limit = null, // Page size. Defaults to 25; maximum 100.
public ?string $next = null, // Cursor for the next page
public ?string $prev = null, // Cursor for the previous page
) {
}

// BaseModel automatically handles jsonSerialize(), toArray(), and fromJson() using constructor types!
// Use #[JsonKey('user_id')] to override field names if needed.
}
20 changes: 20 additions & 0 deletions src/GeneratedModels/QueryFeedBansResponse.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php

declare(strict_types=1);

namespace GetStream\GeneratedModels;
class QueryFeedBansResponse extends BaseModel
{
public function __construct(
/** @var array<FeedBanResponse>|null */
#[ArrayOf(FeedBanResponse::class)]
public ?array $bans = null, // Feed bans matching the query
public ?string $next = null, // Cursor for the next page
public ?string $prev = null, // Cursor for the previous page
public ?string $duration = null,
) {
}

// BaseModel automatically handles jsonSerialize(), toArray(), and fromJson() using constructor types!
// Use #[JsonKey('user_id')] to override field names if needed.
}
Loading