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
46 changes: 46 additions & 0 deletions src/Generated/ChatTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -1456,6 +1456,20 @@ public function search(GeneratedModels\SearchPayload $payload): StreamResponse {
$requestData = null;
return StreamResponse::fromJson($this->makeRequest('GET', $path, $queryParams, $requestData), GeneratedModels\SearchResponse::class);
}
/**
* Create a segment
*
* @param GeneratedModels\CreateSegmentRequest $requestData
* @return StreamResponse<GeneratedModels\CreateSegmentResponse>
* @throws StreamException
*/
public function createSegment(GeneratedModels\CreateSegmentRequest $requestData): StreamResponse {
$path = '/api/v2/chat/segments';

$queryParams = [];
// Use the provided request data array directly
return StreamResponse::fromJson($this->makeRequest('POST', $path, $queryParams, $requestData), GeneratedModels\CreateSegmentResponse::class);
}
/**
* Query segments
*
Expand Down Expand Up @@ -1500,6 +1514,38 @@ public function getSegment(string $id): StreamResponse {
$requestData = null;
return StreamResponse::fromJson($this->makeRequest('GET', $path, $queryParams, $requestData), GeneratedModels\GetSegmentResponse::class);
}
/**
* Update an existing segment
*
* @param string $id
* @param GeneratedModels\UpdateSegmentRequest $requestData
* @return StreamResponse<GeneratedModels\UpdateSegmentResponse>
* @throws StreamException
*/
public function updateSegment(string $id, GeneratedModels\UpdateSegmentRequest $requestData): StreamResponse {
$path = '/api/v2/chat/segments/{id}';
$path = str_replace('{id}', (string) $id, $path);

$queryParams = [];
// Use the provided request data array directly
return StreamResponse::fromJson($this->makeRequest('PUT', $path, $queryParams, $requestData), GeneratedModels\UpdateSegmentResponse::class);
}
/**
* Add targets to a segment
*
* @param string $id
* @param GeneratedModels\AddSegmentTargetsRequest $requestData
* @return StreamResponse<GeneratedModels\Response>
* @throws StreamException
*/
public function addSegmentTargets(string $id, GeneratedModels\AddSegmentTargetsRequest $requestData): StreamResponse {
$path = '/api/v2/chat/segments/{id}/addtargets';
$path = str_replace('{id}', (string) $id, $path);

$queryParams = [];
// Use the provided request data array directly
return StreamResponse::fromJson($this->makeRequest('POST', $path, $queryParams, $requestData), GeneratedModels\Response::class);
}
/**
* Delete targets from a segment
*
Expand Down
15 changes: 15 additions & 0 deletions src/Generated/CommonTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,21 @@ public function getImportV2Task(string $id): StreamResponse {
$requestData = null;
return StreamResponse::fromJson($this->makeRequest('GET', $path, $queryParams, $requestData), GeneratedModels\GetImportV2TaskResponse::class);
}
/**
* Requests a controlled stop of an import v2 task. Allowed only for tasks in queued or processing state; a processing import stops cleanly on its next progress tick.
*
* @param string $id
* @return StreamResponse<GeneratedModels\CancelImportV2TaskResponse>
* @throws StreamException
*/
public function cancelImportV2Task(string $id): StreamResponse {
$path = '/api/v2/imports/v2/{id}/cancel';
$path = str_replace('{id}', (string) $id, $path);

$queryParams = [];
$requestData = null;
return StreamResponse::fromJson($this->makeRequest('POST', $path, $queryParams, $requestData), GeneratedModels\CancelImportV2TaskResponse::class);
}
/**
* Gets an import
*
Expand Down
47 changes: 47 additions & 0 deletions src/Generated/FeedsTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -1579,6 +1579,20 @@ public function rejectFollow(GeneratedModels\RejectFollowRequest $requestData):
// Use the provided request data array directly
return StreamResponse::fromJson($this->makeRequest('POST', $path, $queryParams, $requestData), GeneratedModels\RejectFollowResponse::class);
}
/**
* Creates a follow if it does not exist, or returns the existing one. Broadcasts feeds.follow.created (FollowCreatedEvent) only when the follow is newly created.
*
* @param GeneratedModels\FollowRequest $requestData
* @return StreamResponse<GeneratedModels\GetOrCreateFollowResponse>
* @throws StreamException
*/
public function getOrCreateFollow(GeneratedModels\FollowRequest $requestData): StreamResponse {
$path = '/api/v2/feeds/follows/upsert';

$queryParams = [];
// Use the provided request data array directly
return StreamResponse::fromJson($this->makeRequest('POST', $path, $queryParams, $requestData), GeneratedModels\GetOrCreateFollowResponse::class);
}
/**
* Removes a follow and broadcasts FollowRemovedEvent
*
Expand Down Expand Up @@ -1725,6 +1739,20 @@ public function getOrCreateUnfollows(GeneratedModels\UnfollowBatchRequest $reque
// Use the provided request data array directly
return StreamResponse::fromJson($this->makeRequest('POST', $path, $queryParams, $requestData), GeneratedModels\UnfollowBatchResponse::class);
}
/**
* Removes a follow and broadcasts feeds.follow.deleted (FollowDeletedEvent). Does not return an error if the follow does not exist.
*
* @param GeneratedModels\GetOrCreateUnfollowRequest $requestData
* @return StreamResponse<GeneratedModels\GetOrCreateUnfollowResponse>
* @throws StreamException
*/
public function getOrCreateUnfollow(GeneratedModels\GetOrCreateUnfollowRequest $requestData): StreamResponse {
$path = '/api/v2/feeds/unfollow/upsert';

$queryParams = [];
// Use the provided request data array directly
return StreamResponse::fromJson($this->makeRequest('POST', $path, $queryParams, $requestData), GeneratedModels\GetOrCreateUnfollowResponse::class);
}
/**
* Delete all feed data for a user including: feeds, activities, follows, comments, feed reactions, bookmark folders, bookmarks, and collections owned by the user
*
Expand Down Expand Up @@ -1756,4 +1784,23 @@ public function exportFeedUserData(string $userID): StreamResponse {
$requestData = null;
return StreamResponse::fromJson($this->makeRequest('POST', $path, $queryParams, $requestData), GeneratedModels\ExportFeedUserDataResponse::class);
}
/**
* 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
* @return StreamResponse<GeneratedModels\GetUserInterestsResponse>
* @throws StreamException
*/
public function getUserInterests(string $userID, int $limit): StreamResponse {
$path = '/api/v2/feeds/users/{user_id}/interests';
$path = str_replace('{user_id}', (string) $userID, $path);

$queryParams = [];
if ($limit !== null) {
$queryParams['limit'] = $limit;
}
$requestData = null;
return StreamResponse::fromJson($this->makeRequest('GET', $path, $queryParams, $requestData), GeneratedModels\GetUserInterestsResponse::class);
}
}
55 changes: 55 additions & 0 deletions src/Generated/ModerationTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,20 @@ public function insertActionLog(GeneratedModels\InsertActionLogRequest $requestD
// Use the provided request data array directly
return StreamResponse::fromJson($this->makeRequest('POST', $path, $queryParams, $requestData), GeneratedModels\InsertActionLogResponse::class);
}
/**
* Moderate named text fields and raw image bytes via multipart/form-data. Returns a per-field lightweight verdict.
*
* @param GeneratedModels\AnalyzeRequest $requestData
* @return StreamResponse<GeneratedModels\AnalyzeResponse>
* @throws StreamException
*/
public function analyze(GeneratedModels\AnalyzeRequest $requestData): StreamResponse {
$path = '/api/v2/moderation/analyze';

$queryParams = [];
// Use the provided request data array directly
return StreamResponse::fromJson($this->makeRequest('POST', $path, $queryParams, $requestData), GeneratedModels\AnalyzeResponse::class);
}
/**
* Appeal against the moderation decision
*
Expand Down Expand Up @@ -165,6 +179,20 @@ public function queryAppeals(GeneratedModels\QueryAppealsRequest $requestData):
// Use the provided request data array directly
return StreamResponse::fromJson($this->makeRequest('POST', $path, $queryParams, $requestData), GeneratedModels\QueryAppealsResponse::class);
}
/**
* Process multiple appeals in a single request by applying the specified action to each. Supported actions: unban, restore, unblock, mark_reviewed, reject_appeal. Each appeal goes through the same path as a single submit_action call.
*
* @param GeneratedModels\BulkActionAppealsRequest $requestData
* @return StreamResponse<GeneratedModels\BulkActionAppealsResponse>
* @throws StreamException
*/
public function bulkActionAppeals(GeneratedModels\BulkActionAppealsRequest $requestData): StreamResponse {
$path = '/api/v2/moderation/appeals/bulk_action';

$queryParams = [];
// Use the provided request data array directly
return StreamResponse::fromJson($this->makeRequest('POST', $path, $queryParams, $requestData), GeneratedModels\BulkActionAppealsResponse::class);
}
/**
* Ban a user from a channel or the entire app
*
Expand Down Expand Up @@ -544,6 +572,33 @@ public function getReviewQueueItem(string $id): StreamResponse {
$requestData = null;
return StreamResponse::fromJson($this->makeRequest('GET', $path, $queryParams, $requestData), GeneratedModels\GetReviewQueueItemResponse::class);
}
/**
* Retrieve a setup session for an app
*
* @return StreamResponse<GeneratedModels\GetSetupSessionResponse>
* @throws StreamException
*/
public function getSetupSession(): StreamResponse {
$path = '/api/v2/moderation/setup';

$queryParams = [];
$requestData = null;
return StreamResponse::fromJson($this->makeRequest('GET', $path, $queryParams, $requestData), GeneratedModels\GetSetupSessionResponse::class);
}
/**
* Update a setup session for an app
*
* @param GeneratedModels\UpsertSetupSessionRequest $requestData
* @return StreamResponse<GeneratedModels\UpsertSetupSessionResponse>
* @throws StreamException
*/
public function upsertSetupSession(GeneratedModels\UpsertSetupSessionRequest $requestData): StreamResponse {
$path = '/api/v2/moderation/setup';

$queryParams = [];
// Use the provided request data array directly
return StreamResponse::fromJson($this->makeRequest('POST', $path, $queryParams, $requestData), GeneratedModels\UpsertSetupSessionResponse::class);
}
/**
* Take action on flagged content, such as marking content as safe, deleting content, banning users, or executing custom moderation actions. Supports various action types with configurable parameters.
*
Expand Down
14 changes: 14 additions & 0 deletions src/Generated/VideoTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -872,6 +872,20 @@ public function deleteTranscription(string $type, string $id, string $session, s
$requestData = null;
return StreamResponse::fromJson($this->makeRequest('DELETE', $path, $queryParams, $requestData), GeneratedModels\DeleteTranscriptionResponse::class);
}
/**
* Reports a batch of client-side telemetry events. Events are processed independently; one invalid event does not block the rest of the batch, but the request fails if any event is invalid.
*
* @param GeneratedModels\ReportClientEventRequest $requestData
* @return StreamResponse<GeneratedModels\ReportClientEventResponse>
* @throws StreamException
*/
public function reportClientCallEvent(GeneratedModels\ReportClientEventRequest $requestData): StreamResponse {
$path = '/api/v2/video/call_client_event';

$queryParams = [];
// Use the provided request data array directly
return StreamResponse::fromJson($this->makeRequest('POST', $path, $queryParams, $requestData), GeneratedModels\ReportClientEventResponse::class);
}
/**
*
* @param GeneratedModels\QueryCallSessionStatsRequest $requestData
Expand Down
6 changes: 6 additions & 0 deletions src/Generated/Webhook.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,10 @@
use GetStream\GeneratedModels\ModerationCheckCompletedEvent;
use GetStream\GeneratedModels\ModerationCustomActionEvent;
use GetStream\GeneratedModels\ModerationFlaggedEvent;
use GetStream\GeneratedModels\ModerationImageAnalysisCompleteEvent;
use GetStream\GeneratedModels\ModerationMarkReviewedEvent;
use GetStream\GeneratedModels\ModerationRulesTriggeredEvent;
use GetStream\GeneratedModels\ModerationTextAnalysisCompleteEvent;
use GetStream\GeneratedModels\NotificationFeedUpdatedEvent;
use GetStream\GeneratedModels\NotificationMarkUnreadEvent;
use GetStream\GeneratedModels\NotificationThreadMessageNewEvent;
Expand Down Expand Up @@ -318,7 +320,9 @@ class Webhook
public const EVENT_TYPE_MESSAGE_UPDATED = 'message.updated';
public const EVENT_TYPE_MODERATION_CUSTOM_ACTION = 'moderation.custom_action';
public const EVENT_TYPE_MODERATION_FLAGGED = 'moderation.flagged';
public const EVENT_TYPE_MODERATION_IMAGE_ANALYSIS_COMPLETE = 'moderation.image_analysis.complete';
public const EVENT_TYPE_MODERATION_MARK_REVIEWED = 'moderation.mark_reviewed';
public const EVENT_TYPE_MODERATION_TEXT_ANALYSIS_COMPLETE = 'moderation.text_analysis.complete';
public const EVENT_TYPE_MODERATION_CHECK_COMPLETED = 'moderation_check.completed';
public const EVENT_TYPE_MODERATION_RULE_TRIGGERED = 'moderation_rule.triggered';
public const EVENT_TYPE_NOTIFICATION_MARK_UNREAD = 'notification.mark_unread';
Expand Down Expand Up @@ -555,7 +559,9 @@ private static function getEventClass(string $eventType): ?string
'message.updated' => MessageUpdatedEvent::class,
'moderation.custom_action' => ModerationCustomActionEvent::class,
'moderation.flagged' => ModerationFlaggedEvent::class,
'moderation.image_analysis.complete' => ModerationImageAnalysisCompleteEvent::class,
'moderation.mark_reviewed' => ModerationMarkReviewedEvent::class,
'moderation.text_analysis.complete' => ModerationTextAnalysisCompleteEvent::class,
'moderation_check.completed' => ModerationCheckCompletedEvent::class,
'moderation_rule.triggered' => ModerationRulesTriggeredEvent::class,
'notification.mark_unread' => NotificationMarkUnreadEvent::class,
Expand Down
15 changes: 15 additions & 0 deletions src/GeneratedModels/AddSegmentTargetsRequest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

declare(strict_types=1);

namespace GetStream\GeneratedModels;
class AddSegmentTargetsRequest extends BaseModel
{
public function __construct(
public ?array $targetIds = null, // Target IDs
) {
}

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

declare(strict_types=1);

namespace GetStream\GeneratedModels;
class AnalyzeImageField extends BaseModel
{
public function __construct(
public ?string $id = null, // Echo of `content_ids[label]` when supplied on the request; omitted otherwise.
public ?string $action = null, // Per-image action: keep | flag | remove.
public ?float $confidence = null, // Highest confidence (0–1) across detected classifications + sub-classifications. Convenience aggregate over the nested values in `classifications`.
/** @var array<Classification>|null */
#[ArrayOf(Classification::class)]
public ?array $classifications = null, // Hierarchical list of L1 (parent) classifications. Each entry: `name`, `confidence` (0–1), and nested `subclassifications` (L2 leaves with their own confidence). Resolved against the app's effective taxonomy (custom taxonomy when configured, otherwise the standard Bodyguard catalogue).
/** @var array<Classification>|null */
#[ArrayOf(Classification::class)]
public ?array $ocrClassifications = null, // Flat list of Bodyguard OCR text-moderation labels on the image's extracted text (e.g. VULGARITY, PII). Each entry: `name` + `severity`. Populated when BG's OCR pipeline returned non-empty results for this image.
public ?string $error = null, // Set when moderation couldn't be determined for this image — action is absent.
) {
}

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

declare(strict_types=1);

namespace GetStream\GeneratedModels;
class AnalyzeRequest extends BaseModel
{
public function __construct(
public ?string $entityType = null, // Caller-defined entity type. Required with entity_id + entity_creator_id; omit all three for stateless mode.
public ?string $entityID = null, // Caller-supplied content identifier. Required with entity_type + entity_creator_id; omit all three for stateless mode.
public ?string $entityCreatorID = null, // ID of the user who created the content. Required with entity_type + entity_id; omit all three for stateless mode.
public ?string $configKey = null, // Moderation policy key. Optional in stateful mode, required in stateless mode.
public ?array $texts = null, // Named text fields to moderate, keyed by caller label (e.g. title, description).
public ?object $custom = null, // Arbitrary metadata surfaced in the dashboard.
public ?\DateTime $contentPublishedAt = null, // Original timestamp when the content was produced. Used as the `published_at` timestamp on per-content log entries that surface in `matched_contents` on aggregation-rule webhooks.
public ?array $contentIds = null, // Optional map from a content label (either a `texts` key or an `image:<key>` multipart label) to a caller-supplied per-instance identifier. Echoed on per-field verdicts and surfaced in `matched_contents` when an aggregation rule fires.
public ?bool $asyncResponse = null, // When true, the response carries no verdicts (status `pending`) and per-modality results arrive via `moderation.text_analysis.complete` and `moderation.image_analysis.complete` webhooks. Image moderation runs on a background worker; text moderation runs synchronously and is then delivered via webhook.
public ?string $userID = null,
public ?UserRequest $user = null,
) {
}

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

declare(strict_types=1);

namespace GetStream\GeneratedModels;
class AnalyzeResponse extends BaseModel
{
public function __construct(
public ?string $status = null, // Always `complete` — /analyze is sync-only and the full verdict is in the response.
/** @var array<string, AnalyzeTextField>|null */
#[MapOf(AnalyzeTextField::class)]
public ?array $texts = null, // Per-text-field moderation verdicts keyed by caller label.
/** @var array<string, AnalyzeImageField>|null */
#[MapOf(AnalyzeImageField::class)]
public ?array $images = null, // Per-image moderation verdicts keyed by caller label.
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
Loading