diff --git a/src/Generated/ChatTrait.php b/src/Generated/ChatTrait.php index 821b346..14769ca 100644 --- a/src/Generated/ChatTrait.php +++ b/src/Generated/ChatTrait.php @@ -61,13 +61,13 @@ public function deleteCampaign(string $id): StreamResponse { * Get campaign by ID. * * @param string $id - * @param string $prev - * @param string $next - * @param int $limit + * @param ?string $prev + * @param ?string $next + * @param ?int $limit * @return StreamResponse * @throws StreamException */ - public function getCampaign(string $id, string $prev, string $next, int $limit): StreamResponse { + public function getCampaign(string $id, ?string $prev = null, ?string $next = null, ?int $limit = null): StreamResponse { $path = '/api/v2/chat/campaigns/{id}'; $path = str_replace('{id}', (string) $id, $path); @@ -188,12 +188,12 @@ public function deleteChannels(GeneratedModels\DeleteChannelsRequest $requestDat /** * Mark the status of a channel message delivered. * - * @param string $userID * @param GeneratedModels\MarkDeliveredRequest $requestData + * @param ?string $userID * @return StreamResponse * @throws StreamException */ - public function markDelivered(string $userID, GeneratedModels\MarkDeliveredRequest $requestData): StreamResponse { + public function markDelivered(GeneratedModels\MarkDeliveredRequest $requestData, ?string $userID = null): StreamResponse { $path = '/api/v2/chat/channels/delivered'; $queryParams = []; @@ -262,11 +262,11 @@ public function getOrCreateDistinctChannel(string $type, GeneratedModels\Channel * * @param string $type * @param string $id - * @param bool $hardDelete + * @param ?bool $hardDelete * @return StreamResponse * @throws StreamException */ - public function deleteChannel(string $type, string $id, bool $hardDelete): StreamResponse { + public function deleteChannel(string $type, string $id, ?bool $hardDelete = null): StreamResponse { $path = '/api/v2/chat/channels/{type}/{id}'; $path = str_replace('{type}', (string) $type, $path); $path = str_replace('{id}', (string) $id, $path); @@ -283,14 +283,14 @@ public function deleteChannel(string $type, string $id, bool $hardDelete): Strea * * @param string $type * @param string $id - * @param bool $state - * @param int $messagesLimit - * @param int $membersLimit - * @param int $watchersLimit + * @param ?bool $state + * @param ?int $messagesLimit + * @param ?int $membersLimit + * @param ?int $watchersLimit * @return StreamResponse * @throws StreamException */ - public function getChannel(string $type, string $id, bool $state, int $messagesLimit, int $membersLimit, int $watchersLimit): StreamResponse { + public function getChannel(string $type, string $id, ?bool $state = null, ?int $messagesLimit = null, ?int $membersLimit = null, ?int $watchersLimit = null): StreamResponse { $path = '/api/v2/chat/channels/{type}/{id}'; $path = str_replace('{type}', (string) $type, $path); $path = str_replace('{id}', (string) $id, $path); @@ -362,12 +362,12 @@ public function updateChannel(string $type, string $id, GeneratedModels\UpdateCh * * @param string $type * @param string $id - * @param string $parentID - * @param string $userID + * @param ?string $parentID + * @param ?string $userID * @return StreamResponse * @throws StreamException */ - public function deleteDraft(string $type, string $id, string $parentID, string $userID): StreamResponse { + public function deleteDraft(string $type, string $id, ?string $parentID = null, ?string $userID = null): StreamResponse { $path = '/api/v2/chat/channels/{type}/{id}/draft'; $path = str_replace('{type}', (string) $type, $path); $path = str_replace('{id}', (string) $id, $path); @@ -387,12 +387,12 @@ public function deleteDraft(string $type, string $id, string $parentID, string $ * * @param string $type * @param string $id - * @param string $parentID - * @param string $userID + * @param ?string $parentID + * @param ?string $userID * @return StreamResponse * @throws StreamException */ - public function getDraft(string $type, string $id, string $parentID, string $userID): StreamResponse { + public function getDraft(string $type, string $id, ?string $parentID = null, ?string $userID = null): StreamResponse { $path = '/api/v2/chat/channels/{type}/{id}/draft'; $path = str_replace('{type}', (string) $type, $path); $path = str_replace('{id}', (string) $id, $path); @@ -430,11 +430,11 @@ public function sendEvent(string $type, string $id, GeneratedModels\SendEventReq * * @param string $type * @param string $id - * @param string $url + * @param ?string $url * @return StreamResponse * @throws StreamException */ - public function deleteChannelFile(string $type, string $id, string $url): StreamResponse { + public function deleteChannelFile(string $type, string $id, ?string $url = null): StreamResponse { $path = '/api/v2/chat/channels/{type}/{id}/file'; $path = str_replace('{type}', (string) $type, $path); $path = str_replace('{id}', (string) $id, $path); @@ -489,11 +489,11 @@ public function hideChannel(string $type, string $id, GeneratedModels\HideChanne * * @param string $type * @param string $id - * @param string $url + * @param ?string $url * @return StreamResponse * @throws StreamException */ - public function deleteChannelImage(string $type, string $id, string $url): StreamResponse { + public function deleteChannelImage(string $type, string $id, ?string $url = null): StreamResponse { $path = '/api/v2/chat/channels/{type}/{id}/image'; $path = str_replace('{type}', (string) $type, $path); $path = str_replace('{id}', (string) $id, $path); @@ -527,12 +527,12 @@ public function uploadChannelImage(string $type, string $id, GeneratedModels\Upl * * @param string $type * @param string $id - * @param string $userID * @param GeneratedModels\UpdateMemberPartialRequest $requestData + * @param ?string $userID * @return StreamResponse * @throws StreamException */ - public function updateMemberPartial(string $type, string $id, string $userID, GeneratedModels\UpdateMemberPartialRequest $requestData): StreamResponse { + public function updateMemberPartial(string $type, string $id, GeneratedModels\UpdateMemberPartialRequest $requestData, ?string $userID = null): StreamResponse { $path = '/api/v2/chat/channels/{type}/{id}/member'; $path = str_replace('{type}', (string) $type, $path); $path = str_replace('{id}', (string) $id, $path); @@ -865,11 +865,11 @@ public function exportChannels(GeneratedModels\ExportChannelsRequest $requestDat /** * Find and filter channel members * - * @param GeneratedModels\QueryMembersPayload $payload + * @param ?GeneratedModels\QueryMembersPayload $payload * @return StreamResponse * @throws StreamException */ - public function queryMembers(GeneratedModels\QueryMembersPayload $payload): StreamResponse { + public function queryMembers(?GeneratedModels\QueryMembersPayload $payload = null): StreamResponse { $path = '/api/v2/chat/members'; $queryParams = []; @@ -903,13 +903,13 @@ public function queryMessageHistory(GeneratedModels\QueryMessageHistoryRequest $ * - message.deleted * * @param string $id - * @param bool $hard - * @param string $deletedBy - * @param bool $deleteForMe + * @param ?bool $hard + * @param ?string $deletedBy + * @param ?bool $deleteForMe * @return StreamResponse * @throws StreamException */ - public function deleteMessage(string $id, bool $hard, string $deletedBy, bool $deleteForMe): StreamResponse { + public function deleteMessage(string $id, ?bool $hard = null, ?string $deletedBy = null, ?bool $deleteForMe = null): StreamResponse { $path = '/api/v2/chat/messages/{id}'; $path = str_replace('{id}', (string) $id, $path); @@ -930,11 +930,11 @@ public function deleteMessage(string $id, bool $hard, string $deletedBy, bool $d * Returns message by ID * * @param string $id - * @param bool $showDeletedMessage + * @param ?bool $showDeletedMessage * @return StreamResponse * @throws StreamException */ - public function getMessage(string $id, bool $showDeletedMessage): StreamResponse { + public function getMessage(string $id, ?bool $showDeletedMessage = null): StreamResponse { $path = '/api/v2/chat/messages/{id}'; $path = str_replace('{id}', (string) $id, $path); @@ -1062,11 +1062,11 @@ public function sendReaction(string $id, GeneratedModels\SendReactionRequest $re * * @param string $id * @param string $type - * @param string $userID + * @param ?string $userID * @return StreamResponse * @throws StreamException */ - public function deleteReaction(string $id, string $type, string $userID): StreamResponse { + public function deleteReaction(string $id, string $type, ?string $userID = null): StreamResponse { $path = '/api/v2/chat/messages/{id}/reaction/{type}'; $path = str_replace('{id}', (string) $id, $path); $path = str_replace('{type}', (string) $type, $path); @@ -1082,12 +1082,12 @@ public function deleteReaction(string $id, string $type, string $userID): Stream * Returns list of reactions of specific message * * @param string $id - * @param int $limit - * @param int $offset + * @param ?int $limit + * @param ?int $offset * @return StreamResponse * @throws StreamException */ - public function getReactions(string $id, int $limit, int $offset): StreamResponse { + public function getReactions(string $id, ?int $limit = null, ?int $offset = null): StreamResponse { $path = '/api/v2/chat/messages/{id}/reactions'; $path = str_replace('{id}', (string) $id, $path); @@ -1187,11 +1187,11 @@ public function castPollVote(string $messageID, string $pollID, GeneratedModels\ * @param string $messageID * @param string $pollID * @param string $voteID - * @param string $userID + * @param ?string $userID * @return StreamResponse * @throws StreamException */ - public function deletePollVote(string $messageID, string $pollID, string $voteID, string $userID): StreamResponse { + public function deletePollVote(string $messageID, string $pollID, string $voteID, ?string $userID = null): StreamResponse { $path = '/api/v2/chat/messages/{message_id}/polls/{poll_id}/vote/{vote_id}'; $path = str_replace('{message_id}', (string) $messageID, $path); $path = str_replace('{poll_id}', (string) $pollID, $path); @@ -1210,11 +1210,11 @@ public function deletePollVote(string $messageID, string $pollID, string $voteID * - reminder.deleted * * @param string $messageID - * @param string $userID + * @param ?string $userID * @return StreamResponse * @throws StreamException */ - public function deleteReminder(string $messageID, string $userID): StreamResponse { + public function deleteReminder(string $messageID, ?string $userID = null): StreamResponse { $path = '/api/v2/chat/messages/{message_id}/reminders'; $path = str_replace('{message_id}', (string) $messageID, $path); @@ -1265,17 +1265,17 @@ public function createReminder(string $messageID, GeneratedModels\CreateReminder * Returns replies (thread) of the message * * @param string $parentID - * @param int $limit - * @param string $idGte - * @param string $idGt - * @param string $idLte - * @param string $idLt - * @param string $idAround - * @param array $sort + * @param ?int $limit + * @param ?string $idGte + * @param ?string $idGt + * @param ?string $idLte + * @param ?string $idLt + * @param ?string $idAround + * @param ?array $sort * @return StreamResponse * @throws StreamException */ - public function getReplies(string $parentID, int $limit, string $idGte, string $idGt, string $idLte, string $idLt, string $idAround, array $sort): StreamResponse { + public function getReplies(string $parentID, ?int $limit = null, ?string $idGte = null, ?string $idGt = null, ?string $idLte = null, ?string $idLt = null, ?string $idAround = null, ?array $sort = null): StreamResponse { $path = '/api/v2/chat/messages/{parent_id}/replies'; $path = str_replace('{parent_id}', (string) $parentID, $path); @@ -1307,11 +1307,11 @@ public function getReplies(string $parentID, int $limit, string $idGte, string $ /** * Find and filter message flags * - * @param GeneratedModels\QueryMessageFlagsPayload $payload + * @param ?GeneratedModels\QueryMessageFlagsPayload $payload * @return StreamResponse * @throws StreamException */ - public function queryMessageFlags(GeneratedModels\QueryMessageFlagsPayload $payload): StreamResponse { + public function queryMessageFlags(?GeneratedModels\QueryMessageFlagsPayload $payload = null): StreamResponse { $path = '/api/v2/chat/moderation/flags/message'; $queryParams = []; @@ -1360,11 +1360,11 @@ public function unmuteChannel(GeneratedModels\UnmuteChannelRequest $requestData) /** * Find and filter channel scoped or global user bans * - * @param GeneratedModels\QueryBannedUsersPayload $payload + * @param ?GeneratedModels\QueryBannedUsersPayload $payload * @return StreamResponse * @throws StreamException */ - public function queryBannedUsers(GeneratedModels\QueryBannedUsersPayload $payload): StreamResponse { + public function queryBannedUsers(?GeneratedModels\QueryBannedUsersPayload $payload = null): StreamResponse { $path = '/api/v2/chat/query_banned_users'; $queryParams = []; @@ -1381,11 +1381,11 @@ public function queryBannedUsers(GeneratedModels\QueryBannedUsersPayload $payloa /** * Find and filter future channel bans created by the authenticated user * - * @param GeneratedModels\QueryFutureChannelBansPayload $payload + * @param ?GeneratedModels\QueryFutureChannelBansPayload $payload * @return StreamResponse * @throws StreamException */ - public function queryFutureChannelBans(GeneratedModels\QueryFutureChannelBansPayload $payload): StreamResponse { + public function queryFutureChannelBans(?GeneratedModels\QueryFutureChannelBansPayload $payload = null): StreamResponse { $path = '/api/v2/chat/query_future_channel_bans'; $queryParams = []; @@ -1471,11 +1471,11 @@ public function getRetentionPolicyRuns(GeneratedModels\GetRetentionPolicyRunsReq /** * Search messages across channels * - * @param GeneratedModels\SearchPayload $payload + * @param ?GeneratedModels\SearchPayload $payload * @return StreamResponse * @throws StreamException */ - public function search(GeneratedModels\SearchPayload $payload): StreamResponse { + public function search(?GeneratedModels\SearchPayload $payload = null): StreamResponse { $path = '/api/v2/chat/search'; $queryParams = []; @@ -1666,13 +1666,13 @@ public function queryThreads(GeneratedModels\QueryThreadsRequest $requestData): * Return a specific thread * * @param string $messageID - * @param int $replyLimit - * @param int $participantLimit - * @param int $memberLimit + * @param ?int $replyLimit + * @param ?int $participantLimit + * @param ?int $memberLimit * @return StreamResponse * @throws StreamException */ - public function getThread(string $messageID, int $replyLimit, int $participantLimit, int $memberLimit): StreamResponse { + public function getThread(string $messageID, ?int $replyLimit = null, ?int $participantLimit = null, ?int $memberLimit = null): StreamResponse { $path = '/api/v2/chat/threads/{message_id}'; $path = str_replace('{message_id}', (string) $messageID, $path); @@ -1710,11 +1710,11 @@ public function updateThreadPartial(string $messageID, GeneratedModels\UpdateThr /** * Fetch unread counts for a single user * - * @param string $userID + * @param ?string $userID * @return StreamResponse * @throws StreamException */ - public function unreadCounts(string $userID): StreamResponse { + public function unreadCounts(?string $userID = null): StreamResponse { $path = '/api/v2/chat/unread'; $queryParams = []; diff --git a/src/Generated/CommonTrait.php b/src/Generated/CommonTrait.php index c2a7db6..7bf7128 100644 --- a/src/Generated/CommonTrait.php +++ b/src/Generated/CommonTrait.php @@ -44,17 +44,29 @@ public function updateApp(GeneratedModels\UpdateAppRequest $requestData): Stream /** * Returns all available block lists * - * @param string $team + * @param ?string $team + * @param ?string $ownerUserID + * @param ?string $cursor + * @param ?int $limit * @return StreamResponse * @throws StreamException */ - public function listBlockLists(string $team): StreamResponse { + public function listBlockLists(?string $team = null, ?string $ownerUserID = null, ?string $cursor = null, ?int $limit = null): StreamResponse { $path = '/api/v2/blocklists'; $queryParams = []; if ($team !== null) { $queryParams['team'] = $team; } + if ($ownerUserID !== null) { + $queryParams['owner_user_id'] = $ownerUserID; + } + if ($cursor !== null) { + $queryParams['cursor'] = $cursor; + } + if ($limit !== null) { + $queryParams['limit'] = $limit; + } $requestData = null; return StreamResponse::fromJson($this->makeRequest('GET', $path, $queryParams, $requestData), GeneratedModels\ListBlockListResponse::class); } @@ -72,15 +84,34 @@ public function createBlockList(GeneratedModels\CreateBlockListRequest $requestD // Use the provided request data array directly return StreamResponse::fromJson($this->makeRequest('POST', $path, $queryParams, $requestData), GeneratedModels\CreateBlockListResponse::class); } + /** + * Enqueues an asynchronous bulk import of items into an existing blocklist. + * Returns a task ID that can be polled via GET /tasks/{id} to observe progress. + * AddItems is idempotent: items already present are skipped without error. + * For lists exceeding the HTTP request-body cap, issue repeated import calls each + * carrying a bounded slice of items — the task result accumulates correctly. + * + * @param GeneratedModels\ImportBlockListRequest $requestData + * @return StreamResponse + * @throws StreamException + */ + public function importBlockList(GeneratedModels\ImportBlockListRequest $requestData): StreamResponse { + $path = '/api/v2/blocklists/{id}/import'; + + $queryParams = []; + // Use the provided request data array directly + return StreamResponse::fromJson($this->makeRequest('POST', $path, $queryParams, $requestData), GeneratedModels\ImportBlockListResponse::class); + } /** * Deletes previously created application blocklist * * @param string $name - * @param string $team + * @param ?string $team + * @param ?string $ownerUserID * @return StreamResponse * @throws StreamException */ - public function deleteBlockList(string $name, string $team): StreamResponse { + public function deleteBlockList(string $name, ?string $team = null, ?string $ownerUserID = null): StreamResponse { $path = '/api/v2/blocklists/{name}'; $path = str_replace('{name}', (string) $name, $path); @@ -88,6 +119,9 @@ public function deleteBlockList(string $name, string $team): StreamResponse { if ($team !== null) { $queryParams['team'] = $team; } + if ($ownerUserID !== null) { + $queryParams['owner_user_id'] = $ownerUserID; + } $requestData = null; return StreamResponse::fromJson($this->makeRequest('DELETE', $path, $queryParams, $requestData), GeneratedModels\Response::class); } @@ -95,11 +129,11 @@ public function deleteBlockList(string $name, string $team): StreamResponse { * Returns block list by given name * * @param string $name - * @param string $team + * @param ?string $team * @return StreamResponse * @throws StreamException */ - public function getBlockList(string $name, string $team): StreamResponse { + public function getBlockList(string $name, ?string $team = null): StreamResponse { $path = '/api/v2/blocklists/{name}'; $path = str_replace('{name}', (string) $name, $path); @@ -172,11 +206,11 @@ public function checkSQS(GeneratedModels\CheckSQSRequest $requestData): StreamRe * Deletes one device * * @param string $id - * @param string $userID + * @param ?string $userID * @return StreamResponse * @throws StreamException */ - public function deleteDevice(string $id, string $userID): StreamResponse { + public function deleteDevice(string $id, ?string $userID = null): StreamResponse { $path = '/api/v2/devices'; $queryParams = []; @@ -192,11 +226,11 @@ public function deleteDevice(string $id, string $userID): StreamResponse { /** * Returns all available devices * - * @param string $userID + * @param ?string $userID * @return StreamResponse * @throws StreamException */ - public function listDevices(string $userID): StreamResponse { + public function listDevices(?string $userID = null): StreamResponse { $path = '/api/v2/devices'; $queryParams = []; @@ -362,11 +396,11 @@ public function createImport(GeneratedModels\CreateImportRequest $requestData): /** * Lists all import v2 tasks for the app * - * @param int $state + * @param ?int $state * @return StreamResponse * @throws StreamException */ - public function listImportV2Tasks(int $state): StreamResponse { + public function listImportV2Tasks(?int $state = null): StreamResponse { $path = '/api/v2/imports/v2'; $queryParams = []; @@ -584,12 +618,12 @@ public function updatePoll(GeneratedModels\UpdatePollRequest $requestData): Stre /** * Queries polls * - * @param string $userID * @param GeneratedModels\QueryPollsRequest $requestData + * @param ?string $userID * @return StreamResponse * @throws StreamException */ - public function queryPolls(string $userID, GeneratedModels\QueryPollsRequest $requestData): StreamResponse { + public function queryPolls(GeneratedModels\QueryPollsRequest $requestData, ?string $userID = null): StreamResponse { $path = '/api/v2/polls/query'; $queryParams = []; @@ -606,11 +640,11 @@ public function queryPolls(string $userID, GeneratedModels\QueryPollsRequest $re * - poll.deleted * * @param string $pollID - * @param string $userID + * @param ?string $userID * @return StreamResponse * @throws StreamException */ - public function deletePoll(string $pollID, string $userID): StreamResponse { + public function deletePoll(string $pollID, ?string $userID = null): StreamResponse { $path = '/api/v2/polls/{poll_id}'; $path = str_replace('{poll_id}', (string) $pollID, $path); @@ -625,11 +659,11 @@ public function deletePoll(string $pollID, string $userID): StreamResponse { * Retrieves a poll * * @param string $pollID - * @param string $userID + * @param ?string $userID * @return StreamResponse * @throws StreamException */ - public function getPoll(string $pollID, string $userID): StreamResponse { + public function getPoll(string $pollID, ?string $userID = null): StreamResponse { $path = '/api/v2/polls/{poll_id}'; $path = str_replace('{poll_id}', (string) $pollID, $path); @@ -707,11 +741,11 @@ public function updatePollOption(string $pollID, GeneratedModels\UpdatePollOptio * * @param string $pollID * @param string $optionID - * @param string $userID + * @param ?string $userID * @return StreamResponse * @throws StreamException */ - public function deletePollOption(string $pollID, string $optionID, string $userID): StreamResponse { + public function deletePollOption(string $pollID, string $optionID, ?string $userID = null): StreamResponse { $path = '/api/v2/polls/{poll_id}/options/{option_id}'; $path = str_replace('{poll_id}', (string) $pollID, $path); $path = str_replace('{option_id}', (string) $optionID, $path); @@ -728,11 +762,11 @@ public function deletePollOption(string $pollID, string $optionID, string $userI * * @param string $pollID * @param string $optionID - * @param string $userID + * @param ?string $userID * @return StreamResponse * @throws StreamException */ - public function getPollOption(string $pollID, string $optionID, string $userID): StreamResponse { + public function getPollOption(string $pollID, string $optionID, ?string $userID = null): StreamResponse { $path = '/api/v2/polls/{poll_id}/options/{option_id}'; $path = str_replace('{poll_id}', (string) $pollID, $path); $path = str_replace('{option_id}', (string) $optionID, $path); @@ -748,12 +782,12 @@ public function getPollOption(string $pollID, string $optionID, string $userID): * Queries votes * * @param string $pollID - * @param string $userID * @param GeneratedModels\QueryPollVotesRequest $requestData + * @param ?string $userID * @return StreamResponse * @throws StreamException */ - public function queryPollVotes(string $pollID, string $userID, GeneratedModels\QueryPollVotesRequest $requestData): StreamResponse { + public function queryPollVotes(string $pollID, GeneratedModels\QueryPollVotesRequest $requestData, ?string $userID = null): StreamResponse { $path = '/api/v2/polls/{poll_id}/votes'; $path = str_replace('{poll_id}', (string) $pollID, $path); @@ -826,11 +860,11 @@ public function deletePushProvider(string $type, string $name): StreamResponse { * Retrieve push notification templates for Chat. * * @param string $pushProviderType - * @param string $pushProviderName + * @param ?string $pushProviderName * @return StreamResponse * @throws StreamException */ - public function getPushTemplates(string $pushProviderType, string $pushProviderName): StreamResponse { + public function getPushTemplates(string $pushProviderType, ?string $pushProviderName = null): StreamResponse { $path = '/api/v2/push_templates'; $queryParams = []; @@ -860,15 +894,15 @@ public function upsertPushTemplate(GeneratedModels\UpsertPushTemplateRequest $re /** * Get rate limits usage and quotas * - * @param bool $serverSide - * @param bool $android - * @param bool $ios - * @param bool $web - * @param string $endpoints + * @param ?bool $serverSide + * @param ?bool $android + * @param ?bool $ios + * @param ?bool $web + * @param ?string $endpoints * @return StreamResponse * @throws StreamException */ - public function getRateLimits(bool $serverSide, bool $android, bool $ios, bool $web, string $endpoints): StreamResponse { + public function getRateLimits(?bool $serverSide = null, ?bool $android = null, ?bool $ios = null, ?bool $web = null, ?string $endpoints = null): StreamResponse { $path = '/api/v2/rate_limits'; $queryParams = []; @@ -921,14 +955,14 @@ public function createRole(GeneratedModels\CreateRoleRequest $requestData): Stre * Searches mentionable roles (user-assignable + channel-assignable, built-in and custom) by name prefix for autocomplete * * @param string $query - * @param int $limit - * @param string $nameGt - * @param string $roleType - * @param bool $includeGlobalRoles + * @param ?int $limit + * @param ?string $nameGt + * @param ?string $roleType + * @param ?bool $includeGlobalRoles * @return StreamResponse * @throws StreamException */ - public function searchRoles(string $query, int $limit, string $nameGt, string $roleType, bool $includeGlobalRoles): StreamResponse { + public function searchRoles(string $query, ?int $limit = null, ?string $nameGt = null, ?string $roleType = null, ?bool $includeGlobalRoles = null): StreamResponse { $path = '/api/v2/roles/search'; $queryParams = []; @@ -983,11 +1017,11 @@ public function getTask(string $id): StreamResponse { /** * Deletes previously uploaded file * - * @param string $url + * @param ?string $url * @return StreamResponse * @throws StreamException */ - public function deleteFile(string $url): StreamResponse { + public function deleteFile(?string $url = null): StreamResponse { $path = '/api/v2/uploads/file'; $queryParams = []; @@ -1014,11 +1048,11 @@ public function uploadFile(GeneratedModels\FileUploadRequest $requestData): Stre /** * Deletes previously uploaded image * - * @param string $url + * @param ?string $url * @return StreamResponse * @throws StreamException */ - public function deleteImage(string $url): StreamResponse { + public function deleteImage(?string $url = null): StreamResponse { $path = '/api/v2/uploads/image'; $queryParams = []; @@ -1045,14 +1079,14 @@ public function uploadImage(GeneratedModels\ImageUploadRequest $requestData): St /** * Lists user groups with cursor-based pagination * - * @param int $limit - * @param string $idGt - * @param string $createdAtGt - * @param string $teamID + * @param ?int $limit + * @param ?string $idGt + * @param ?string $createdAtGt + * @param ?string $teamID * @return StreamResponse * @throws StreamException */ - public function listUserGroups(int $limit, string $idGt, string $createdAtGt, string $teamID): StreamResponse { + public function listUserGroups(?int $limit = null, ?string $idGt = null, ?string $createdAtGt = null, ?string $teamID = null): StreamResponse { $path = '/api/v2/usergroups'; $queryParams = []; @@ -1089,14 +1123,14 @@ public function createUserGroup(GeneratedModels\CreateUserGroupRequest $requestD * Searches user groups by name prefix for autocomplete * * @param string $query - * @param int $limit - * @param string $nameGt - * @param string $idGt - * @param string $teamID + * @param ?int $limit + * @param ?string $nameGt + * @param ?string $idGt + * @param ?string $teamID * @return StreamResponse * @throws StreamException */ - public function searchUserGroups(string $query, int $limit, string $nameGt, string $idGt, string $teamID): StreamResponse { + public function searchUserGroups(string $query, ?int $limit = null, ?string $nameGt = null, ?string $idGt = null, ?string $teamID = null): StreamResponse { $path = '/api/v2/usergroups/search'; $queryParams = []; @@ -1122,11 +1156,11 @@ public function searchUserGroups(string $query, int $limit, string $nameGt, stri * Deletes a user group and all its members * * @param string $id - * @param string $teamID + * @param ?string $teamID * @return StreamResponse * @throws StreamException */ - public function deleteUserGroup(string $id, string $teamID): StreamResponse { + public function deleteUserGroup(string $id, ?string $teamID = null): StreamResponse { $path = '/api/v2/usergroups/{id}'; $path = str_replace('{id}', (string) $id, $path); @@ -1141,11 +1175,11 @@ public function deleteUserGroup(string $id, string $teamID): StreamResponse { * Gets a user group by ID, including its members * * @param string $id - * @param string $teamID + * @param ?string $teamID * @return StreamResponse * @throws StreamException */ - public function getUserGroup(string $id, string $teamID): StreamResponse { + public function getUserGroup(string $id, ?string $teamID = null): StreamResponse { $path = '/api/v2/usergroups/{id}'; $path = str_replace('{id}', (string) $id, $path); @@ -1207,11 +1241,11 @@ public function removeUserGroupMembers(string $id, GeneratedModels\RemoveUserGro /** * Find and filter users * - * @param GeneratedModels\QueryUsersPayload $payload + * @param ?GeneratedModels\QueryUsersPayload $payload * @return StreamResponse * @throws StreamException */ - public function queryUsers(GeneratedModels\QueryUsersPayload $payload): StreamResponse { + public function queryUsers(?GeneratedModels\QueryUsersPayload $payload = null): StreamResponse { $path = '/api/v2/users'; $queryParams = []; @@ -1261,11 +1295,11 @@ public function updateUsers(GeneratedModels\UpdateUsersRequest $requestData): St /** * Get list of blocked Users * - * @param string $userID + * @param ?string $userID * @return StreamResponse * @throws StreamException */ - public function getBlockedUsers(string $userID): StreamResponse { + public function getBlockedUsers(?string $userID = null): StreamResponse { $path = '/api/v2/users/block'; $queryParams = []; @@ -1325,11 +1359,11 @@ public function deleteUsers(GeneratedModels\DeleteUsersRequest $requestData): St /** * Retrieves all active live locations for a user * - * @param string $userID + * @param ?string $userID * @return StreamResponse * @throws StreamException */ - public function getUserLiveLocations(string $userID): StreamResponse { + public function getUserLiveLocations(?string $userID = null): StreamResponse { $path = '/api/v2/users/live_locations'; $queryParams = []; @@ -1342,12 +1376,12 @@ public function getUserLiveLocations(string $userID): StreamResponse { /** * Updates an existing live location with new coordinates or expiration time * - * @param string $userID * @param GeneratedModels\UpdateLiveLocationRequest $requestData + * @param ?string $userID * @return StreamResponse * @throws StreamException */ - public function updateLiveLocation(string $userID, GeneratedModels\UpdateLiveLocationRequest $requestData): StreamResponse { + public function updateLiveLocation(GeneratedModels\UpdateLiveLocationRequest $requestData, ?string $userID = null): StreamResponse { $path = '/api/v2/users/live_locations'; $queryParams = []; diff --git a/src/Generated/FeedMethods.php b/src/Generated/FeedMethods.php index 7c8920d..aae6df5 100644 --- a/src/Generated/FeedMethods.php +++ b/src/Generated/FeedMethods.php @@ -17,27 +17,27 @@ trait FeedMethods /** * Delete a single feed by its ID * - * @param bool $hardDelete - * @param bool $purgeUserActivities + * @param ?bool $hardDelete + * @param ?bool $purgeUserActivities * @return StreamResponse * @throws StreamException */ public function deleteFeed( - bool $hardDelete, bool $purgeUserActivities, ): StreamResponse { + ?bool $hardDelete = null, ?bool $purgeUserActivities = null): StreamResponse { return $this->feedsV3Client->deleteFeed($this->feedGroup, $this->feedId,$hardDelete, $purgeUserActivities); } /** * Create a single feed for a given feed group * - * @param string $language - * @param bool $translateText * @param GeneratedModels\GetOrCreateFeedRequest $requestData + * @param ?string $language + * @param ?bool $translateText * @return StreamResponse * @throws StreamException */ public function getOrCreateFeed( - string $language, bool $translateText, GeneratedModels\GetOrCreateFeedRequest $requestData): StreamResponse { - return $this->feedsV3Client->getOrCreateFeed($this->feedGroup, $this->feedId,$language, $translateText, $requestData); + GeneratedModels\GetOrCreateFeedRequest $requestData, ?string $language = null, ?bool $translateText = null): StreamResponse { + return $this->feedsV3Client->getOrCreateFeed($this->feedGroup, $this->feedId, $requestData,$language, $translateText); } /** * Update an existing feed @@ -65,13 +65,13 @@ public function markActivity( * Unpin an activity from a feed. This removes the pin, so the activity will no longer be displayed at the top of the feed. * * @param string $activityID - * @param bool $enrichOwnFields - * @param string $userID + * @param ?bool $enrichOwnFields + * @param ?string $userID * @return StreamResponse * @throws StreamException */ public function unpinActivity( - string $activityID, bool $enrichOwnFields, string $userID, ): StreamResponse { + string $activityID, ?bool $enrichOwnFields = null, ?string $userID = null): StreamResponse { return $this->feedsV3Client->unpinActivity($this->feedGroup, $this->feedId, $activityID,$enrichOwnFields, $userID); } /** @@ -144,19 +144,18 @@ public function rejectFeedMemberInvite( /** * Query pinned activities for a feed with filter query * - * @param string $language - * @param bool $translateText * @param GeneratedModels\QueryPinnedActivitiesRequest $requestData + * @param ?string $language + * @param ?bool $translateText * @return StreamResponse * @throws StreamException */ public function queryPinnedActivities( - string $language, bool $translateText, GeneratedModels\QueryPinnedActivitiesRequest $requestData): StreamResponse { - return $this->feedsV3Client->queryPinnedActivities($this->feedGroup, $this->feedId,$language, $translateText, $requestData); + GeneratedModels\QueryPinnedActivitiesRequest $requestData, ?string $language = null, ?bool $translateText = null): StreamResponse { + return $this->feedsV3Client->queryPinnedActivities($this->feedGroup, $this->feedId, $requestData,$language, $translateText); } } // Helper templates for parameter signatures and calls in php - diff --git a/src/Generated/FeedsTrait.php b/src/Generated/FeedsTrait.php index ff1a76e..ef76daa 100644 --- a/src/Generated/FeedsTrait.php +++ b/src/Generated/FeedsTrait.php @@ -89,13 +89,13 @@ public function trackActivityMetrics(GeneratedModels\TrackActivityMetricsRequest /** * Query activities based on filters with pagination and sorting options * - * @param string $language - * @param bool $translateText * @param GeneratedModels\QueryActivitiesRequest $requestData + * @param ?string $language + * @param ?bool $translateText * @return StreamResponse * @throws StreamException */ - public function queryActivities(string $language, bool $translateText, GeneratedModels\QueryActivitiesRequest $requestData): StreamResponse { + public function queryActivities(GeneratedModels\QueryActivitiesRequest $requestData, ?string $language = null, ?bool $translateText = null): StreamResponse { $path = '/api/v2/feeds/activities/query'; $queryParams = []; @@ -126,12 +126,12 @@ public function batchQueryActivityReactions(GeneratedModels\BatchQueryActivityRe * Deletes a bookmark from an activity * * @param string $activityID - * @param string $folderID - * @param string $userID + * @param ?string $folderID + * @param ?string $userID * @return StreamResponse * @throws StreamException */ - public function deleteBookmark(string $activityID, string $folderID, string $userID): StreamResponse { + public function deleteBookmark(string $activityID, ?string $folderID = null, ?string $userID = null): StreamResponse { $path = '/api/v2/feeds/activities/{activity_id}/bookmarks'; $path = str_replace('{activity_id}', (string) $activityID, $path); @@ -227,11 +227,11 @@ public function castPollVote(string $activityID, string $pollID, GeneratedModels * @param string $activityID * @param string $pollID * @param string $voteID - * @param string $userID + * @param ?string $userID * @return StreamResponse * @throws StreamException */ - public function deletePollVote(string $activityID, string $pollID, string $voteID, string $userID): StreamResponse { + public function deletePollVote(string $activityID, string $pollID, string $voteID, ?string $userID = null): StreamResponse { $path = '/api/v2/feeds/activities/{activity_id}/polls/{poll_id}/vote/{vote_id}'; $path = str_replace('{activity_id}', (string) $activityID, $path); $path = str_replace('{poll_id}', (string) $pollID, $path); @@ -281,12 +281,12 @@ public function queryActivityReactions(string $activityID, GeneratedModels\Query * * @param string $activityID * @param string $type - * @param bool $deleteNotificationActivity - * @param string $userID + * @param ?bool $deleteNotificationActivity + * @param ?string $userID * @return StreamResponse * @throws StreamException */ - public function deleteActivityReaction(string $activityID, string $type, bool $deleteNotificationActivity, string $userID): StreamResponse { + public function deleteActivityReaction(string $activityID, string $type, ?bool $deleteNotificationActivity = null, ?string $userID = null): StreamResponse { $path = '/api/v2/feeds/activities/{activity_id}/reactions/{type}'; $path = str_replace('{activity_id}', (string) $activityID, $path); $path = str_replace('{type}', (string) $type, $path); @@ -305,13 +305,13 @@ public function deleteActivityReaction(string $activityID, string $type, bool $d * List the shares recorded for an activity, newest-first * * @param string $activityID - * @param int $limit - * @param string $prev - * @param string $next + * @param ?int $limit + * @param ?string $prev + * @param ?string $next * @return StreamResponse * @throws StreamException */ - public function queryActivityShares(string $activityID, int $limit, string $prev, string $next): StreamResponse { + public function queryActivityShares(string $activityID, ?int $limit = null, ?string $prev = null, ?string $next = null): StreamResponse { $path = '/api/v2/feeds/activities/{activity_id}/shares'; $path = str_replace('{activity_id}', (string) $activityID, $path); @@ -332,12 +332,12 @@ public function queryActivityShares(string $activityID, int $limit, string $prev * Delete a single activity by its ID * * @param string $id - * @param bool $hardDelete - * @param bool $deleteNotificationActivity + * @param ?bool $hardDelete + * @param ?bool $deleteNotificationActivity * @return StreamResponse * @throws StreamException */ - public function deleteActivity(string $id, bool $hardDelete, bool $deleteNotificationActivity): StreamResponse { + public function deleteActivity(string $id, ?bool $hardDelete = null, ?bool $deleteNotificationActivity = null): StreamResponse { $path = '/api/v2/feeds/activities/{id}'; $path = str_replace('{id}', (string) $id, $path); @@ -355,25 +355,19 @@ public function deleteActivity(string $id, bool $hardDelete, bool $deleteNotific * Returns activity by ID * * @param string $id - * @param string $language - * @param bool $translateText - * @param string $commentSort - * @param int $commentLimit - * @param string $userID + * @param ?string $commentSort + * @param ?int $commentLimit + * @param ?string $userID + * @param ?string $language + * @param ?bool $translateText * @return StreamResponse * @throws StreamException */ - public function getActivity(string $id, string $language, bool $translateText, string $commentSort, int $commentLimit, string $userID): StreamResponse { + public function getActivity(string $id, ?string $commentSort = null, ?int $commentLimit = null, ?string $userID = null, ?string $language = null, ?bool $translateText = null): StreamResponse { $path = '/api/v2/feeds/activities/{id}'; $path = str_replace('{id}', (string) $id, $path); $queryParams = []; - if ($language !== null) { - $queryParams['language'] = $language; - } - if ($translateText !== null) { - $queryParams['translate_text'] = $translateText; - } if ($commentSort !== null) { $queryParams['comment_sort'] = $commentSort; } @@ -383,6 +377,12 @@ public function getActivity(string $id, string $language, bool $translateText, s if ($userID !== null) { $queryParams['user_id'] = $userID; } + if ($language !== null) { + $queryParams['language'] = $language; + } + if ($translateText !== null) { + $queryParams['translate_text'] = $translateText; + } $requestData = null; return StreamResponse::fromJson($this->makeRequest('GET', $path, $queryParams, $requestData), GeneratedModels\GetActivityResponse::class); } @@ -426,12 +426,12 @@ public function updateActivity(string $id, GeneratedModels\UpdateActivityRequest * Restores a soft-deleted, moderation-removed, or shadow-blocked activity by its ID. Deleted activities can be restored by the owner (client-side). Moderation-blocked activities can only be restored server-side. * * @param string $id - * @param bool $enrichOwnFields * @param GeneratedModels\RestoreActivityRequest $requestData + * @param ?bool $enrichOwnFields * @return StreamResponse * @throws StreamException */ - public function restoreActivity(string $id, bool $enrichOwnFields, GeneratedModels\RestoreActivityRequest $requestData): StreamResponse { + public function restoreActivity(string $id, GeneratedModels\RestoreActivityRequest $requestData, ?bool $enrichOwnFields = null): StreamResponse { $path = '/api/v2/feeds/activities/{id}/restore'; $path = str_replace('{id}', (string) $id, $path); @@ -508,13 +508,13 @@ public function updateBookmarkFolder(string $folderID, GeneratedModels\UpdateBoo /** * Query bookmarks with filter query * - * @param string $language - * @param bool $translateText * @param GeneratedModels\QueryBookmarksRequest $requestData + * @param ?string $language + * @param ?bool $translateText * @return StreamResponse * @throws StreamException */ - public function queryBookmarks(string $language, bool $translateText, GeneratedModels\QueryBookmarksRequest $requestData): StreamResponse { + public function queryBookmarks(GeneratedModels\QueryBookmarksRequest $requestData, ?string $language = null, ?bool $translateText = null): StreamResponse { $path = '/api/v2/feeds/bookmarks/query'; $queryParams = []; @@ -547,12 +547,12 @@ public function deleteCollections(array $collectionRefs): StreamResponse { /** * Read collections by their references. By default, users can only read their own collections. * - * @param string $userID - * @param array $collectionRefs + * @param ?string $userID + * @param ?array $collectionRefs * @return StreamResponse * @throws StreamException */ - public function readCollections(string $userID, array $collectionRefs): StreamResponse { + public function readCollections(?string $userID = null, ?array $collectionRefs = null): StreamResponse { $path = '/api/v2/feeds/collections'; $queryParams = []; @@ -626,20 +626,20 @@ public function queryCollections(GeneratedModels\QueryCollectionsRequest $reques * * @param string $objectID * @param string $objectType - * @param int $depth - * @param string $sort - * @param int $repliesLimit - * @param string $idAround - * @param string $language - * @param bool $translateText - * @param string $userID - * @param int $limit - * @param string $prev - * @param string $next + * @param ?int $depth + * @param ?string $sort + * @param ?int $repliesLimit + * @param ?string $idAround + * @param ?string $language + * @param ?bool $translateText + * @param ?string $userID + * @param ?int $limit + * @param ?string $prev + * @param ?string $next * @return StreamResponse * @throws StreamException */ - public function getComments(string $objectID, string $objectType, int $depth, string $sort, int $repliesLimit, string $idAround, string $language, bool $translateText, string $userID, int $limit, string $prev, string $next): StreamResponse { + public function getComments(string $objectID, string $objectType, ?int $depth = null, ?string $sort = null, ?int $repliesLimit = null, ?string $idAround = null, ?string $language = null, ?bool $translateText = null, ?string $userID = null, ?int $limit = null, ?string $prev = null, ?string $next = null): StreamResponse { $path = '/api/v2/feeds/comments'; $queryParams = []; @@ -713,13 +713,13 @@ public function addCommentsBatch(GeneratedModels\AddCommentsBatchRequest $reques /** * Query comments using MongoDB-style filters with pagination and sorting options * - * @param string $language - * @param bool $translateText * @param GeneratedModels\QueryCommentsRequest $requestData + * @param ?string $language + * @param ?bool $translateText * @return StreamResponse * @throws StreamException */ - public function queryComments(string $language, bool $translateText, GeneratedModels\QueryCommentsRequest $requestData): StreamResponse { + public function queryComments(GeneratedModels\QueryCommentsRequest $requestData, ?string $language = null, ?bool $translateText = null): StreamResponse { $path = '/api/v2/feeds/comments/query'; $queryParams = []; @@ -750,12 +750,12 @@ public function batchQueryCommentReactions(GeneratedModels\BatchQueryCommentReac * Deletes a bookmark from a comment * * @param string $commentID - * @param string $folderID - * @param string $userID + * @param ?string $folderID + * @param ?string $userID * @return StreamResponse * @throws StreamException */ - public function deleteCommentBookmark(string $commentID, string $folderID, string $userID): StreamResponse { + public function deleteCommentBookmark(string $commentID, ?string $folderID = null, ?string $userID = null): StreamResponse { $path = '/api/v2/feeds/comments/{comment_id}/bookmarks'; $path = str_replace('{comment_id}', (string) $commentID, $path); @@ -805,12 +805,12 @@ public function addCommentBookmark(string $commentID, GeneratedModels\AddComment * Deletes a comment from an object (e.g., activity) and broadcasts appropriate events * * @param string $id - * @param bool $hardDelete - * @param bool $deleteNotificationActivity + * @param ?bool $hardDelete + * @param ?bool $deleteNotificationActivity * @return StreamResponse * @throws StreamException */ - public function deleteComment(string $id, bool $hardDelete, bool $deleteNotificationActivity): StreamResponse { + public function deleteComment(string $id, ?bool $hardDelete = null, ?bool $deleteNotificationActivity = null): StreamResponse { $path = '/api/v2/feeds/comments/{id}'; $path = str_replace('{id}', (string) $id, $path); @@ -828,26 +828,26 @@ public function deleteComment(string $id, bool $hardDelete, bool $deleteNotifica * Get a comment by ID * * @param string $id - * @param string $language - * @param bool $translateText - * @param string $userID + * @param ?string $userID + * @param ?string $language + * @param ?bool $translateText * @return StreamResponse * @throws StreamException */ - public function getComment(string $id, string $language, bool $translateText, string $userID): StreamResponse { + public function getComment(string $id, ?string $userID = null, ?string $language = null, ?bool $translateText = null): StreamResponse { $path = '/api/v2/feeds/comments/{id}'; $path = str_replace('{id}', (string) $id, $path); $queryParams = []; + if ($userID !== null) { + $queryParams['user_id'] = $userID; + } if ($language !== null) { $queryParams['language'] = $language; } if ($translateText !== null) { $queryParams['translate_text'] = $translateText; } - if ($userID !== null) { - $queryParams['user_id'] = $userID; - } $requestData = null; return StreamResponse::fromJson($this->makeRequest('GET', $path, $queryParams, $requestData), GeneratedModels\GetCommentResponse::class); } @@ -923,12 +923,12 @@ public function queryCommentReactions(string $id, GeneratedModels\QueryCommentRe * * @param string $id * @param string $type - * @param bool $deleteNotificationActivity - * @param string $userID + * @param ?bool $deleteNotificationActivity + * @param ?string $userID * @return StreamResponse * @throws StreamException */ - public function deleteCommentReaction(string $id, string $type, bool $deleteNotificationActivity, string $userID): StreamResponse { + public function deleteCommentReaction(string $id, string $type, ?bool $deleteNotificationActivity = null, ?string $userID = null): StreamResponse { $path = '/api/v2/feeds/comments/{id}/reactions/{type}'; $path = str_replace('{id}', (string) $id, $path); $path = str_replace('{type}', (string) $type, $path); @@ -947,20 +947,20 @@ public function deleteCommentReaction(string $id, string $type, bool $deleteNoti * Retrieve a threaded list of replies for a single comment, with configurable depth, sorting, and pagination * * @param string $id - * @param int $depth - * @param string $sort - * @param int $repliesLimit - * @param string $idAround - * @param string $language - * @param bool $translateText - * @param string $userID - * @param int $limit - * @param string $prev - * @param string $next + * @param ?int $depth + * @param ?string $sort + * @param ?int $repliesLimit + * @param ?string $idAround + * @param ?string $language + * @param ?bool $translateText + * @param ?string $userID + * @param ?int $limit + * @param ?string $prev + * @param ?string $next * @return StreamResponse * @throws StreamException */ - public function getCommentReplies(string $id, int $depth, string $sort, int $repliesLimit, string $idAround, string $language, bool $translateText, string $userID, int $limit, string $prev, string $next): StreamResponse { + public function getCommentReplies(string $id, ?int $depth = null, ?string $sort = null, ?int $repliesLimit = null, ?string $idAround = null, ?string $language = null, ?bool $translateText = null, ?string $userID = null, ?int $limit = null, ?string $prev = null, ?string $next = null): StreamResponse { $path = '/api/v2/feeds/comments/{id}/replies'; $path = str_replace('{id}', (string) $id, $path); @@ -1035,11 +1035,11 @@ public function translateComment(string $id, GeneratedModels\TranslateCommentReq /** * List all feed groups for the application * - * @param bool $includeSoftDeleted + * @param ?bool $includeSoftDeleted * @return StreamResponse * @throws StreamException */ - public function listFeedGroups(bool $includeSoftDeleted): StreamResponse { + public function listFeedGroups(?bool $includeSoftDeleted = null): StreamResponse { $path = '/api/v2/feeds/feed_groups'; $queryParams = []; @@ -1068,12 +1068,12 @@ public function createFeedGroup(GeneratedModels\CreateFeedGroupRequest $requestD * * @param string $feedGroupID * @param string $feedID - * @param bool $hardDelete - * @param bool $purgeUserActivities + * @param ?bool $hardDelete + * @param ?bool $purgeUserActivities * @return StreamResponse * @throws StreamException */ - public function deleteFeed(string $feedGroupID, string $feedID, bool $hardDelete, bool $purgeUserActivities): StreamResponse { + public function deleteFeed(string $feedGroupID, string $feedID, ?bool $hardDelete = null, ?bool $purgeUserActivities = null): StreamResponse { $path = '/api/v2/feeds/feed_groups/{feed_group_id}/feeds/{feed_id}'; $path = str_replace('{feed_group_id}', (string) $feedGroupID, $path); $path = str_replace('{feed_id}', (string) $feedID, $path); @@ -1093,13 +1093,13 @@ public function deleteFeed(string $feedGroupID, string $feedID, bool $hardDelete * * @param string $feedGroupID * @param string $feedID - * @param string $language - * @param bool $translateText * @param GeneratedModels\GetOrCreateFeedRequest $requestData + * @param ?string $language + * @param ?bool $translateText * @return StreamResponse * @throws StreamException */ - public function getOrCreateFeed(string $feedGroupID, string $feedID, string $language, bool $translateText, GeneratedModels\GetOrCreateFeedRequest $requestData): StreamResponse { + public function getOrCreateFeed(string $feedGroupID, string $feedID, GeneratedModels\GetOrCreateFeedRequest $requestData, ?string $language = null, ?bool $translateText = null): StreamResponse { $path = '/api/v2/feeds/feed_groups/{feed_group_id}/feeds/{feed_id}'; $path = str_replace('{feed_group_id}', (string) $feedGroupID, $path); $path = str_replace('{feed_id}', (string) $feedID, $path); @@ -1156,12 +1156,12 @@ public function markActivity(string $feedGroupID, string $feedID, GeneratedModel * @param string $feedGroupID * @param string $feedID * @param string $activityID - * @param bool $enrichOwnFields - * @param string $userID + * @param ?bool $enrichOwnFields + * @param ?string $userID * @return StreamResponse * @throws StreamException */ - public function unpinActivity(string $feedGroupID, string $feedID, string $activityID, bool $enrichOwnFields, string $userID): StreamResponse { + public function unpinActivity(string $feedGroupID, string $feedID, string $activityID, ?bool $enrichOwnFields = null, ?string $userID = null): StreamResponse { $path = '/api/v2/feeds/feed_groups/{feed_group_id}/feeds/{feed_id}/activities/{activity_id}/pin'; $path = str_replace('{feed_group_id}', (string) $feedGroupID, $path); $path = str_replace('{feed_id}', (string) $feedID, $path); @@ -1292,13 +1292,13 @@ public function rejectFeedMemberInvite(string $feedGroupID, string $feedID, Gene * * @param string $feedGroupID * @param string $feedID - * @param string $language - * @param bool $translateText * @param GeneratedModels\QueryPinnedActivitiesRequest $requestData + * @param ?string $language + * @param ?bool $translateText * @return StreamResponse * @throws StreamException */ - public function queryPinnedActivities(string $feedGroupID, string $feedID, string $language, bool $translateText, GeneratedModels\QueryPinnedActivitiesRequest $requestData): StreamResponse { + public function queryPinnedActivities(string $feedGroupID, string $feedID, GeneratedModels\QueryPinnedActivitiesRequest $requestData, ?string $language = null, ?bool $translateText = null): StreamResponse { $path = '/api/v2/feeds/feed_groups/{feed_group_id}/feeds/{feed_id}/pinned_activities/query'; $path = str_replace('{feed_group_id}', (string) $feedGroupID, $path); $path = str_replace('{feed_id}', (string) $feedID, $path); @@ -1317,12 +1317,12 @@ public function queryPinnedActivities(string $feedGroupID, string $feedID, strin * Get follow suggestions for a feed group * * @param string $feedGroupID - * @param int $limit - * @param string $userID + * @param ?int $limit + * @param ?string $userID * @return StreamResponse * @throws StreamException */ - public function getFollowSuggestions(string $feedGroupID, int $limit, string $userID): StreamResponse { + public function getFollowSuggestions(string $feedGroupID, ?int $limit = null, ?string $userID = null): StreamResponse { $path = '/api/v2/feeds/feed_groups/{feed_group_id}/follow_suggestions'; $path = str_replace('{feed_group_id}', (string) $feedGroupID, $path); @@ -1355,11 +1355,11 @@ public function restoreFeedGroup(string $feedGroupID): StreamResponse { * Delete a feed group by its ID. Can perform a soft delete (default) or hard delete. * * @param string $id - * @param bool $hardDelete + * @param ?bool $hardDelete * @return StreamResponse * @throws StreamException */ - public function deleteFeedGroup(string $id, bool $hardDelete): StreamResponse { + public function deleteFeedGroup(string $id, ?bool $hardDelete = null): StreamResponse { $path = '/api/v2/feeds/feed_groups/{id}'; $path = str_replace('{id}', (string) $id, $path); @@ -1374,11 +1374,11 @@ public function deleteFeedGroup(string $id, bool $hardDelete): StreamResponse { * Get a feed group by ID * * @param string $id - * @param bool $includeSoftDeleted + * @param ?bool $includeSoftDeleted * @return StreamResponse * @throws StreamException */ - public function getFeedGroup(string $id, bool $includeSoftDeleted): StreamResponse { + public function getFeedGroup(string $id, ?bool $includeSoftDeleted = null): StreamResponse { $path = '/api/v2/feeds/feed_groups/{id}'; $path = str_replace('{id}', (string) $id, $path); @@ -1614,15 +1614,15 @@ public function queryFeeds(GeneratedModels\QueryFeedsRequest $requestData): Stre * Retrieve current rate limit status for feeds operations. * Returns information about limits, usage, and remaining quota for various feed operations. * - * @param string $endpoints - * @param bool $android - * @param bool $ios - * @param bool $web - * @param bool $serverSide + * @param ?string $endpoints + * @param ?bool $android + * @param ?bool $ios + * @param ?bool $web + * @param ?bool $serverSide * @return StreamResponse * @throws StreamException */ - public function getFeedsRateLimits(string $endpoints, bool $android, bool $ios, bool $web, bool $serverSide): StreamResponse { + public function getFeedsRateLimits(?string $endpoints = null, ?bool $android = null, ?bool $ios = null, ?bool $web = null, ?bool $serverSide = null): StreamResponse { $path = '/api/v2/feeds/feeds/rate_limits'; $queryParams = []; @@ -1761,13 +1761,13 @@ public function getOrCreateFollow(GeneratedModels\FollowRequest $requestData): S * * @param string $source * @param string $target - * @param bool $deleteNotificationActivity - * @param bool $keepHistory - * @param bool $enrichOwnFields + * @param ?bool $deleteNotificationActivity + * @param ?bool $keepHistory + * @param ?bool $enrichOwnFields * @return StreamResponse * @throws StreamException */ - public function unfollow(string $source, string $target, bool $deleteNotificationActivity, bool $keepHistory, bool $enrichOwnFields): StreamResponse { + public function unfollow(string $source, string $target, ?bool $deleteNotificationActivity = null, ?bool $keepHistory = null, ?bool $enrichOwnFields = null): StreamResponse { $path = '/api/v2/feeds/follows/{source}/{target}'; $path = str_replace('{source}', (string) $source, $path); $path = str_replace('{target}', (string) $target, $path); @@ -1951,11 +1951,11 @@ public function exportFeedUserData(string $userID): StreamResponse { * Returns the user's most common interest tags ranked by the number of distinct activities they reacted to that carried each tag. Client-side callers may only read their own interests; server-side callers may fetch any user. Results are sorted by descending count, then alphabetically by tag. * * @param string $userID - * @param int $limit + * @param ?int $limit * @return StreamResponse * @throws StreamException */ - public function getUserInterests(string $userID, int $limit): StreamResponse { + public function getUserInterests(string $userID, ?int $limit = null): StreamResponse { $path = '/api/v2/feeds/users/{user_id}/interests'; $path = str_replace('{user_id}', (string) $userID, $path); diff --git a/src/Generated/ModerationTrait.php b/src/Generated/ModerationTrait.php index c00ddcd..0dfea8d 100644 --- a/src/Generated/ModerationTrait.php +++ b/src/Generated/ModerationTrait.php @@ -17,15 +17,15 @@ trait ModerationTrait /** * Returns moderation action configs grouped by entity type, sorted by order ascending. Supports fetching DB-configured actions, hardcoded defaults, or both. * - * @param string $queueType - * @param string $entityType - * @param bool $excludeDefaults - * @param bool $onlyDefaults - * @param string $userID + * @param ?string $queueType + * @param ?string $entityType + * @param ?bool $excludeDefaults + * @param ?bool $onlyDefaults + * @param ?string $userID * @return StreamResponse * @throws StreamException */ - public function getActionConfig(string $queueType, string $entityType, bool $excludeDefaults, bool $onlyDefaults, string $userID): StreamResponse { + public function getActionConfig(?string $queueType = null, ?string $entityType = null, ?bool $excludeDefaults = null, ?bool $onlyDefaults = null, ?string $userID = null): StreamResponse { $path = '/api/v2/moderation/action_config'; $queryParams = []; @@ -93,11 +93,11 @@ public function bulkDeleteActionConfig(GeneratedModels\BulkDeleteActionConfigReq * Delete a specific moderation action config entry by its UUID. * * @param string $id - * @param string $userID + * @param ?string $userID * @return StreamResponse * @throws StreamException */ - public function deleteActionConfig(string $id, string $userID): StreamResponse { + public function deleteActionConfig(string $id, ?string $userID = null): StreamResponse { $path = '/api/v2/moderation/action_config/{id}'; $path = str_replace('{id}', (string) $id, $path); @@ -281,12 +281,12 @@ public function upsertConfig(GeneratedModels\UpsertConfigRequest $requestData): * Delete a specific moderation policy by its name * * @param string $key - * @param string $team - * @param string $userID + * @param ?string $team + * @param ?string $userID * @return StreamResponse * @throws StreamException */ - public function deleteConfig(string $key, string $team, string $userID): StreamResponse { + public function deleteConfig(string $key, ?string $team = null, ?string $userID = null): StreamResponse { $path = '/api/v2/moderation/config/{key}'; $path = str_replace('{key}', (string) $key, $path); @@ -304,11 +304,11 @@ public function deleteConfig(string $key, string $team, string $userID): StreamR * Retrieve a specific moderation configuration by its key and team. This configuration contains settings for various moderation features like toxicity detection, AI analysis, and filtering rules. * * @param string $key - * @param string $team + * @param ?string $team * @return StreamResponse * @throws StreamException */ - public function getConfig(string $key, string $team): StreamResponse { + public function getConfig(string $key, ?string $team = null): StreamResponse { $path = '/api/v2/moderation/config/{key}'; $path = str_replace('{key}', (string) $key, $path); @@ -488,11 +488,11 @@ public function upsertModerationRule(GeneratedModels\UpsertModerationRuleRequest /** * Delete an existing moderation rule * - * @param string $userID + * @param ?string $userID * @return StreamResponse * @throws StreamException */ - public function deleteModerationRule(string $userID): StreamResponse { + public function deleteModerationRule(?string $userID = null): StreamResponse { $path = '/api/v2/moderation/moderation_rule/{id}'; $queryParams = []; @@ -571,11 +571,11 @@ public function createQueue(GeneratedModels\CreateQueueRequest $requestData): St /** * * @param string $id - * @param string $userID + * @param ?string $userID * @return StreamResponse * @throws StreamException */ - public function getQueue(string $id, string $userID): StreamResponse { + public function getQueue(string $id, ?string $userID = null): StreamResponse { $path = '/api/v2/moderation/queues/{id}'; $path = str_replace('{id}', (string) $id, $path); @@ -703,14 +703,14 @@ public function submitModerationFeedback(GeneratedModels\SubmitModerationFeedbac /** * Unban a user from a channel or globally. * - * @param string $targetUserID - * @param string $channelCid - * @param string $createdBy * @param GeneratedModels\UnbanRequest $requestData + * @param string $targetUserID + * @param ?string $channelCid + * @param ?string $createdBy * @return StreamResponse * @throws StreamException */ - public function unban(string $targetUserID, string $channelCid, string $createdBy, GeneratedModels\UnbanRequest $requestData): StreamResponse { + public function unban(GeneratedModels\UnbanRequest $requestData, string $targetUserID, ?string $channelCid = null, ?string $createdBy = null): StreamResponse { $path = '/api/v2/moderation/unban'; $queryParams = []; diff --git a/src/Generated/VideoTrait.php b/src/Generated/VideoTrait.php index bc368af..eadfec8 100644 --- a/src/Generated/VideoTrait.php +++ b/src/Generated/VideoTrait.php @@ -29,12 +29,12 @@ public function getActiveCallsStatus(): StreamResponse { } /** * - * @param bool $full * @param GeneratedModels\QueryUserFeedbackRequest $requestData + * @param ?bool $full * @return StreamResponse * @throws StreamException */ - public function queryUserFeedback(bool $full, GeneratedModels\QueryUserFeedbackRequest $requestData): StreamResponse { + public function queryUserFeedback(GeneratedModels\QueryUserFeedbackRequest $requestData, ?bool $full = null): StreamResponse { $path = '/api/v2/video/call/feedback'; $queryParams = []; @@ -75,14 +75,14 @@ public function queryCallStats(GeneratedModels\QueryCallStatsRequest $requestDat * * @param string $type * @param string $id - * @param int $membersLimit - * @param bool $ring - * @param bool $notify - * @param bool $video + * @param ?int $membersLimit + * @param ?bool $ring + * @param ?bool $notify + * @param ?bool $video * @return StreamResponse * @throws StreamException */ - public function getCall(string $type, string $id, int $membersLimit, bool $ring, bool $notify, bool $video): StreamResponse { + public function getCall(string $type, string $id, ?int $membersLimit = null, ?bool $ring = null, ?bool $notify = null, ?bool $video = null): StreamResponse { $path = '/api/v2/video/call/{type}/{id}'; $path = str_replace('{type}', (string) $type, $path); $path = str_replace('{id}', (string) $id, $path); @@ -330,12 +330,12 @@ public function muteUsers(string $type, string $id, GeneratedModels\MuteUsersReq * * @param string $id * @param string $type - * @param int $limit * @param GeneratedModels\QueryCallParticipantsRequest $requestData + * @param ?int $limit * @return StreamResponse * @throws StreamException */ - public function queryCallParticipants(string $id, string $type, int $limit, GeneratedModels\QueryCallParticipantsRequest $requestData): StreamResponse { + public function queryCallParticipants(string $id, string $type, GeneratedModels\QueryCallParticipantsRequest $requestData, ?int $limit = null): StreamResponse { $path = '/api/v2/video/call/{type}/{id}/participants'; $path = str_replace('{id}', (string) $id, $path); $path = str_replace('{type}', (string) $type, $path); @@ -430,11 +430,11 @@ public function stopRecording(string $type, string $id, string $recordingType, G * * @param string $type * @param string $id - * @param string $sessionID + * @param ?string $sessionID * @return StreamResponse * @throws StreamException */ - public function getCallReport(string $type, string $id, string $sessionID): StreamResponse { + public function getCallReport(string $type, string $id, ?string $sessionID = null): StreamResponse { $path = '/api/v2/video/call/{type}/{id}/report'; $path = str_replace('{type}', (string) $type, $path); $path = str_replace('{id}', (string) $id, $path); @@ -528,12 +528,12 @@ public function stopRTMPBroadcast(string $type, string $id, string $name, Genera * @param string $session * @param string $user * @param string $userSession - * @param \DateTime $since - * @param \DateTime $until + * @param ?\DateTime $since + * @param ?\DateTime $until * @return StreamResponse * @throws StreamException */ - public function getCallParticipantSessionMetrics(string $type, string $id, string $session, string $user, string $userSession, \DateTime $since, \DateTime $until): StreamResponse { + public function getCallParticipantSessionMetrics(string $type, string $id, string $session, string $user, string $userSession, ?\DateTime $since = null, ?\DateTime $until = null): StreamResponse { $path = '/api/v2/video/call/{type}/{id}/session/{session}/participant/{user}/{user_session}/details/track'; $path = str_replace('{type}', (string) $type, $path); $path = str_replace('{id}', (string) $id, $path); @@ -556,14 +556,14 @@ public function getCallParticipantSessionMetrics(string $type, string $id, strin * @param string $type * @param string $id * @param string $session - * @param int $limit - * @param string $prev - * @param string $next - * @param object $filterConditions + * @param ?int $limit + * @param ?string $prev + * @param ?string $next + * @param ?object $filterConditions * @return StreamResponse * @throws StreamException */ - public function queryCallParticipantSessions(string $type, string $id, string $session, int $limit, string $prev, string $next, object $filterConditions): StreamResponse { + public function queryCallParticipantSessions(string $type, string $id, string $session, ?int $limit = null, ?string $prev = null, ?string $next = null, ?object $filterConditions = null): StreamResponse { $path = '/api/v2/video/call/{type}/{id}/session/{session}/participant_sessions'; $path = str_replace('{type}', (string) $type, $path); $path = str_replace('{id}', (string) $id, $path); @@ -904,15 +904,15 @@ public function queryCallSessionStats(GeneratedModels\QueryCallSessionStatsReque * @param string $callType * @param string $callID * @param string $session - * @param \DateTime $startTime - * @param \DateTime $endTime - * @param bool $excludePublishers - * @param bool $excludeSubscribers - * @param bool $excludeSfus + * @param ?\DateTime $startTime + * @param ?\DateTime $endTime + * @param ?bool $excludePublishers + * @param ?bool $excludeSubscribers + * @param ?bool $excludeSfus * @return StreamResponse * @throws StreamException */ - public function getCallStatsMap(string $callType, string $callID, string $session, \DateTime $startTime, \DateTime $endTime, bool $excludePublishers, bool $excludeSubscribers, bool $excludeSfus): StreamResponse { + public function getCallStatsMap(string $callType, string $callID, string $session, ?\DateTime $startTime = null, ?\DateTime $endTime = null, ?bool $excludePublishers = null, ?bool $excludeSubscribers = null, ?bool $excludeSfus = null): StreamResponse { $path = '/api/v2/video/call_stats/{call_type}/{call_id}/{session}/map'; $path = str_replace('{call_type}', (string) $callType, $path); $path = str_replace('{call_id}', (string) $callID, $path); @@ -944,13 +944,13 @@ public function getCallStatsMap(string $callType, string $callID, string $sessio * @param string $session * @param string $user * @param string $userSession - * @param string $since - * @param string $until - * @param int $maxPoints + * @param ?string $since + * @param ?string $until + * @param ?int $maxPoints * @return StreamResponse * @throws StreamException */ - public function getCallSessionParticipantStatsDetails(string $callType, string $callID, string $session, string $user, string $userSession, string $since, string $until, int $maxPoints): StreamResponse { + public function getCallSessionParticipantStatsDetails(string $callType, string $callID, string $session, string $user, string $userSession, ?string $since = null, ?string $until = null, ?int $maxPoints = null): StreamResponse { $path = '/api/v2/video/call_stats/{call_type}/{call_id}/{session}/participant/{user}/{user_session}/details'; $path = str_replace('{call_type}', (string) $callType, $path); $path = str_replace('{call_id}', (string) $callID, $path); @@ -976,15 +976,15 @@ public function getCallSessionParticipantStatsDetails(string $callType, string $ * @param string $callType * @param string $callID * @param string $session - * @param int $limit - * @param string $prev - * @param string $next - * @param array $sort - * @param object $filterConditions + * @param ?int $limit + * @param ?string $prev + * @param ?string $next + * @param ?array $sort + * @param ?object $filterConditions * @return StreamResponse * @throws StreamException */ - public function queryCallSessionParticipantStats(string $callType, string $callID, string $session, int $limit, string $prev, string $next, array $sort, object $filterConditions): StreamResponse { + public function queryCallSessionParticipantStats(string $callType, string $callID, string $session, ?int $limit = null, ?string $prev = null, ?string $next = null, ?array $sort = null, ?object $filterConditions = null): StreamResponse { $path = '/api/v2/video/call_stats/{call_type}/{call_id}/{session}/participants'; $path = str_replace('{call_type}', (string) $callType, $path); $path = str_replace('{call_id}', (string) $callID, $path); @@ -1020,13 +1020,13 @@ public function queryCallSessionParticipantStats(string $callType, string $callI * @param string $session * @param string $user * @param string $userSession - * @param string $startTime - * @param string $endTime - * @param array $severity + * @param ?string $startTime + * @param ?string $endTime + * @param ?array $severity * @return StreamResponse * @throws StreamException */ - public function getCallSessionParticipantStatsTimeline(string $callType, string $callID, string $session, string $user, string $userSession, string $startTime, string $endTime, array $severity): StreamResponse { + public function getCallSessionParticipantStatsTimeline(string $callType, string $callID, string $session, string $user, string $userSession, ?string $startTime = null, ?string $endTime = null, ?array $severity = null): StreamResponse { $path = '/api/v2/video/call_stats/{call_type}/{call_id}/{session}/participants/{user}/{user_session}/timeline'; $path = str_replace('{call_type}', (string) $callType, $path); $path = str_replace('{call_id}', (string) $callID, $path); diff --git a/src/GeneratedModels/BlockListResponse.php b/src/GeneratedModels/BlockListResponse.php index 32c479a..36b805e 100644 --- a/src/GeneratedModels/BlockListResponse.php +++ b/src/GeneratedModels/BlockListResponse.php @@ -16,6 +16,7 @@ public function __construct( public ?string $type = null, // Block list type. One of: regex, domain, domain_allowlist, email, email_allowlist, word public ?array $words = null, // List of words to block public ?string $team = null, + public ?string $ownerUserID = null, public ?bool $isLeetCheckEnabled = null, public ?bool $isPluralCheckEnabled = null, public ?bool $isConfusableFoldingEnabled = null, diff --git a/src/GeneratedModels/BlockListRule.php b/src/GeneratedModels/BlockListRule.php index c23cbbc..d621829 100644 --- a/src/GeneratedModels/BlockListRule.php +++ b/src/GeneratedModels/BlockListRule.php @@ -8,6 +8,7 @@ class BlockListRule extends BaseModel public function __construct( public ?string $name = null, public ?string $team = null, + public ?bool $ownerScope = null, public ?string $action = null, ) { } diff --git a/src/GeneratedModels/CreateBlockListRequest.php b/src/GeneratedModels/CreateBlockListRequest.php index 227ffcf..d161a97 100644 --- a/src/GeneratedModels/CreateBlockListRequest.php +++ b/src/GeneratedModels/CreateBlockListRequest.php @@ -17,6 +17,7 @@ public function __construct( public ?array $words = null, // List of words to block public ?string $type = null, // Block list type. One of: regex, domain, domain_allowlist, email, email_allowlist, word public ?string $team = null, + public ?string $ownerUserID = null, ) { } diff --git a/src/GeneratedModels/ImportBlockListRequest.php b/src/GeneratedModels/ImportBlockListRequest.php new file mode 100644 index 0000000..6430092 --- /dev/null +++ b/src/GeneratedModels/ImportBlockListRequest.php @@ -0,0 +1,16 @@ +|null */ #[ArrayOf(BlockListResponse::class)] public ?array $blocklists = null, + public ?string $nextCursor = null, public ?string $duration = null, // Duration of the request in milliseconds ) { } diff --git a/src/GeneratedModels/UpdateBlockListRequest.php b/src/GeneratedModels/UpdateBlockListRequest.php index 9221e6b..c8a8951 100644 --- a/src/GeneratedModels/UpdateBlockListRequest.php +++ b/src/GeneratedModels/UpdateBlockListRequest.php @@ -7,6 +7,7 @@ class UpdateBlockListRequest extends BaseModel { public function __construct( public ?string $team = null, + public ?string $ownerUserID = null, public ?array $words = null, // List of words to block public ?bool $isLeetCheckEnabled = null, public ?bool $isPluralCheckEnabled = null, diff --git a/tests/Integration/ChatChannelIntegrationTest.php b/tests/Integration/ChatChannelIntegrationTest.php index 64209d4..478c9d6 100644 --- a/tests/Integration/ChatChannelIntegrationTest.php +++ b/tests/Integration/ChatChannelIntegrationTest.php @@ -151,16 +151,20 @@ public function testPartialUpdateChannel(): void ], )); $this->assertResponseSuccess($resp, 'partial update channel (set)'); - self::assertNotNull($resp->getData()->channel); - self::assertSame('red', $resp->getData()->channel->custom->color ?? null); + + $stateResp = $this->getOrCreateChannel($type, $channelID, new GeneratedModels\ChannelGetOrCreateRequest()); + $this->assertResponseSuccess($stateResp, 'get channel after partial update (set)'); + self::assertSame('red', $stateResp->getData()->channel->custom->color ?? null); // Unset fields $resp = $this->updateChannelPartial($type, $channelID, new GeneratedModels\UpdateChannelPartialRequest( unset: ['color'], )); $this->assertResponseSuccess($resp, 'partial update channel (unset)'); - self::assertNotNull($resp->getData()->channel); - $custom = $resp->getData()->channel->custom; + + $stateResp = $this->getOrCreateChannel($type, $channelID, new GeneratedModels\ChannelGetOrCreateRequest()); + $this->assertResponseSuccess($stateResp, 'get channel after partial update (unset)'); + $custom = $stateResp->getData()->channel->custom; self::assertTrue( $custom === null || !isset($custom->color), 'color should be unset', diff --git a/tests/Integration/ChatTestCase.php b/tests/Integration/ChatTestCase.php index 9403085..11c1177 100644 --- a/tests/Integration/ChatTestCase.php +++ b/tests/Integration/ChatTestCase.php @@ -294,11 +294,11 @@ protected function deleteUsersWithRetry(array $userIDs): void /** * Poll an async task until completed or failed. - * Uses adaptive backoff: 100ms → 200ms → 400ms → 800ms → 1s (cap), up to 60 attempts (~60s max). + * Uses adaptive backoff: 100ms → 200ms → 400ms → 800ms → 1s (cap), up to 120 attempts (~120s max). */ protected function waitForTask(string $taskID): GeneratedModels\GetTaskResponse { - $maxAttempts = 60; + $maxAttempts = 120; for ($i = 0; $i < $maxAttempts; $i++) { $response = $this->client->getTask($taskID); $this->assertResponseSuccess($response, 'get task status'); diff --git a/tests/Integration/FeedActivityIntegrationTest.php b/tests/Integration/FeedActivityIntegrationTest.php index 61f8961..f87e386 100644 --- a/tests/Integration/FeedActivityIntegrationTest.php +++ b/tests/Integration/FeedActivityIntegrationTest.php @@ -54,10 +54,10 @@ public static function setUpBeforeClass(): void )); $feedsClient->feed('user', self::$sharedUserId)->getOrCreateFeed( - '', false, new GeneratedModels\GetOrCreateFeedRequest(userID: self::$sharedUserId) + new GeneratedModels\GetOrCreateFeedRequest(userID: self::$sharedUserId) ); $feedsClient->feed('user', self::$sharedUserId2)->getOrCreateFeed( - '', false, new GeneratedModels\GetOrCreateFeedRequest(userID: self::$sharedUserId2) + new GeneratedModels\GetOrCreateFeedRequest(userID: self::$sharedUserId2) ); } @@ -327,7 +327,7 @@ public function testGetSingleActivity(): void $this->createdActivityIds[] = $activityId; // snippet-start: GetActivity - $response = $this->feedsV3Client->getActivity($activityId, 'last', 10, $this->testUserId); + $response = $this->feedsV3Client->getActivity($activityId, commentSort: 'last', commentLimit: 10, userID: $this->testUserId); // snippet-end: GetActivity $this->assertResponseSuccess($response, 'get activity'); diff --git a/tests/Integration/FeedAdvancedIntegrationTest.php b/tests/Integration/FeedAdvancedIntegrationTest.php index 8a7ac23..69af765 100644 --- a/tests/Integration/FeedAdvancedIntegrationTest.php +++ b/tests/Integration/FeedAdvancedIntegrationTest.php @@ -59,10 +59,10 @@ public static function setUpBeforeClass(): void )); $feedsClient->feed('user', self::$sharedUserId)->getOrCreateFeed( - '', false, new GeneratedModels\GetOrCreateFeedRequest(userID: self::$sharedUserId) + new GeneratedModels\GetOrCreateFeedRequest(userID: self::$sharedUserId) ); $feedsClient->feed('user', self::$sharedUserId2)->getOrCreateFeed( - '', false, new GeneratedModels\GetOrCreateFeedRequest(userID: self::$sharedUserId2) + new GeneratedModels\GetOrCreateFeedRequest(userID: self::$sharedUserId2) ); } @@ -539,7 +539,7 @@ public function testErrorHandlingScenarios(): void try { // snippet-start: HandleInvalidActivityId $response = - $this->feedsV3Client->getActivity('invalid-activity-id-12345', 'last', 10, $this->testUserId); + $this->feedsV3Client->getActivity('invalid-activity-id-12345', commentSort: 'last', commentLimit: 10, userID: $this->testUserId); // snippet-end: HandleInvalidActivityId if (!$response->isSuccessful()) { self::assertTrue(true); @@ -656,7 +656,7 @@ public function testRealWorldUsageDemo(): void // Bookmark may not be supported } - $enrichedResponse = $this->feedsV3Client->getActivity($postId, 'last', 10, $this->testUserId); + $enrichedResponse = $this->feedsV3Client->getActivity($postId, commentSort: 'last', commentLimit: 10, userID: $this->testUserId); $this->assertResponseSuccess($enrichedResponse, 'get enriched activity'); // snippet-end: RealWorldScenario } diff --git a/tests/Integration/FeedBookmarkFollowIntegrationTest.php b/tests/Integration/FeedBookmarkFollowIntegrationTest.php index 1037454..a49a9ff 100644 --- a/tests/Integration/FeedBookmarkFollowIntegrationTest.php +++ b/tests/Integration/FeedBookmarkFollowIntegrationTest.php @@ -54,10 +54,10 @@ public static function setUpBeforeClass(): void )); $feedsClient->feed('user', self::$sharedUserId)->getOrCreateFeed( - '', false, new GeneratedModels\GetOrCreateFeedRequest(userID: self::$sharedUserId) + new GeneratedModels\GetOrCreateFeedRequest(userID: self::$sharedUserId) ); $feedsClient->feed('user', self::$sharedUserId2)->getOrCreateFeed( - '', false, new GeneratedModels\GetOrCreateFeedRequest(userID: self::$sharedUserId2) + new GeneratedModels\GetOrCreateFeedRequest(userID: self::$sharedUserId2) ); } @@ -235,7 +235,7 @@ public function testGetOrCreateFeedWithActivitiesAndFollow(): void { // snippet-start: GetOrCreateFeed $feedResponse1 = $this->testFeed->getOrCreateFeed( - '', false, new GeneratedModels\GetOrCreateFeedRequest(userID: $this->testUserId) + new GeneratedModels\GetOrCreateFeedRequest(userID: $this->testUserId) ); // snippet-end: GetOrCreateFeed @@ -254,7 +254,7 @@ public function testGetOrCreateFeedWithActivitiesAndFollow(): void $this->createdActivityIds[] = $activityResponse1->getData()->activity->id; $feedResponse2 = $this->testFeed2->getOrCreateFeed( - '', false, new GeneratedModels\GetOrCreateFeedRequest(userID: $this->testUserId2) + new GeneratedModels\GetOrCreateFeedRequest(userID: $this->testUserId2) ); $this->assertResponseSuccess($feedResponse2, 'get or create feed 2'); @@ -281,7 +281,7 @@ public function testGetOrCreateFeedWithActivitiesAndFollow(): void } $verifyFeedResponse = $this->testFeed2->getOrCreateFeed( - '', false, new GeneratedModels\GetOrCreateFeedRequest(userID: $this->testUserId2) + new GeneratedModels\GetOrCreateFeedRequest(userID: $this->testUserId2) ); $this->assertResponseSuccess($verifyFeedResponse, 'verify feed 2 exists'); $verifyFeedData = $verifyFeedResponse->getData(); diff --git a/tests/Integration/FeedReactionCommentIntegrationTest.php b/tests/Integration/FeedReactionCommentIntegrationTest.php index d6904bf..154b3da 100644 --- a/tests/Integration/FeedReactionCommentIntegrationTest.php +++ b/tests/Integration/FeedReactionCommentIntegrationTest.php @@ -55,10 +55,10 @@ public static function setUpBeforeClass(): void )); $feedsClient->feed('user', self::$sharedUserId)->getOrCreateFeed( - '', false, new GeneratedModels\GetOrCreateFeedRequest(userID: self::$sharedUserId) + new GeneratedModels\GetOrCreateFeedRequest(userID: self::$sharedUserId) ); $feedsClient->feed('user', self::$sharedUserId2)->getOrCreateFeed( - '', false, new GeneratedModels\GetOrCreateFeedRequest(userID: self::$sharedUserId2) + new GeneratedModels\GetOrCreateFeedRequest(userID: self::$sharedUserId2) ); } diff --git a/tests/Integration/ModerationIntegrationTest.php b/tests/Integration/ModerationIntegrationTest.php index 96aff56..f4e761c 100644 --- a/tests/Integration/ModerationIntegrationTest.php +++ b/tests/Integration/ModerationIntegrationTest.php @@ -187,7 +187,7 @@ public function test04UnbanUser(): void unbannedByID: $this->moderatorUserId ); - $response = $this->moderationClient->unban($this->testUserId, '', '', $request); + $response = $this->moderationClient->unban($request, $this->testUserId); // snippet-stop: UnbanUser $this->assertResponseSuccess($response, 'unban user'); @@ -405,7 +405,7 @@ private function cleanupResources(): void $request = new GeneratedModels\UnbanRequest( unbannedByID: $this->moderatorUserId ); - $this->moderationClient->unban($userId, '', '', $request); + $this->moderationClient->unban($request, $userId); echo "✅ Cleaned up ban for user: {$userId}\n"; } catch (StreamApiException $e) { echo "Warning: Failed to unban user {$userId}: " . $e->getMessage() . "\n";