Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .spec-version
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
spec: openapi-v241.26.0
generator: chat v241.26.0
spec: openapi-v241.26.1
generator: chat v241.26.1
20 changes: 19 additions & 1 deletion src/Generated/FeedsTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -2025,7 +2025,7 @@ public function feedsGetRetentionPolicy(): StreamResponse {
return StreamResponse::fromJson($this->makeRequest('GET', $path, $queryParams, $requestData), GeneratedModels\GetFeedsRetentionPolicyResponse::class);
}
/**
* Creates or updates a feeds retention policy for the app (an app may have multiple, each scoped to feed groups). Server-side only.
* Creates or updates a feeds retention policy for the app (an app may have multiple, each scoped to feed groups and, except old-activities, optionally narrowed by filter_conditions). Server-side only.
*
* @param GeneratedModels\SetFeedsRetentionPolicyRequest $requestData
* @return StreamResponse<GeneratedModels\SetFeedsRetentionPolicyResponse>
Expand Down Expand Up @@ -2165,6 +2165,24 @@ public function publishScheduledActivityNow(string $id): StreamResponse {
$requestData = null;
return StreamResponse::fromJson($this->makeRequest('POST', $path, $queryParams, $requestData), GeneratedModels\PublishScheduledActivityNowResponse::class);
}
/**
* Retrieve For You engagement statistics (reads, users, impressions, clicks, dwell, hides) per view and experiment, aggregated by day.
* users.total counts user-days.
* Requires a paid Feeds plan (403 otherwise).
* limit is the maximum number of series (one per group, view and experiment), not rows; it never cuts a series. A metric's days with no events are omitted from its daily values.
* This endpoint is not paginated: it is a bounded report over one group's views and experiments for at most 396 days, and limit x days must not exceed 10,000 (the default limit always fits).
* This endpoint is server-side only.
*
* @param GeneratedModels\QueryFeedsEngagementStatsRequest $requestData
* @return StreamResponse<GeneratedModels\QueryFeedsEngagementStatsResponse>
* @throws StreamException
*/
public function queryFeedsEngagementStats(GeneratedModels\QueryFeedsEngagementStatsRequest $requestData): StreamResponse {
$path = '/api/v2/feeds/stats/engagement';

$queryParams = [];
return StreamResponse::fromJson($this->makeRequest('POST', $path, $queryParams, $requestData), GeneratedModels\QueryFeedsEngagementStatsResponse::class);
}
/**
* Retrieve usage statistics for feeds including activity count, follow count, and API request count.
* Returns data aggregated by day with pagination support via from/to date parameters.
Expand Down
1 change: 1 addition & 0 deletions src/GeneratedModels/ActivityFeedbackRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ public function __construct(
public ?bool $showLess = null, // Whether to show less content like this
public ?bool $hide = null, // Whether to hide this activity
public ?bool $showMore = null, // Whether to show more content like this
public ?string $requestID = null, // From the feed response; attributes the hide to the feed's view
public ?string $userID = null,
public ?UserRequest $user = null, // User request object
) {
Expand Down
1 change: 1 addition & 0 deletions src/GeneratedModels/AppResponseFields.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ public function __construct(
public ?AgentReviewSettingsPayload $agentReview = null, // Settings for the moderation agent reviewer, which reviews moderation outcomes and proposes or applies an action.
public ?AgentReviewSettingsPayload $effectiveAgentReview = null, // Settings for the moderation agent reviewer, which reviews moderation outcomes and proposes or applies an action.
public ?MessageMarksConfig $messageMarks = null, // The app's message marks policy: the mark types it defines or overrides, and the privacy switch. The channel type's mark_types says which of them are on in its channels.
public ?MessageSchemaSettings $messageSchema = null, // The app's message schema settings: how strictly messages and reactions are checked, and the JSON Schemas they are checked against.
) {
}

Expand Down
19 changes: 19 additions & 0 deletions src/GeneratedModels/EngagementRates.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

declare(strict_types=1);

namespace GetStream\GeneratedModels;
class EngagementRates extends BaseModel
{
public function __construct(
public ?float $ctr = null, // clicks / impressions
public ?float $avgDwellMs = null, // dwell_ms / dwell_count, in milliseconds
public ?float $hideRate = null, // hides / impressions
public ?float $impressionsPerUser = null, // impressions / users (user-days)
public ?float $clicksPerUser = null, // clicks / users (user-days)
) {
}

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

declare(strict_types=1);

namespace GetStream\GeneratedModels;
class EngagementStatsResult extends BaseModel
{
public function __construct(
public ?string $groupID = null,
public ?string $viewID = null,
public ?string $experimentID = null, // Empty outside an experiment
/** @var array<string, DailyMetricStatsResponse>|null */
#[MapOf(DailyMetricStatsResponse::class)]
public ?array $metrics = null, // Daily values and total per metric: reads, users, impressions, clicks, dwell_ms, dwell_count, hides. users.total counts user-days
public ?EngagementRates $rates = null,
) {
}

// BaseModel automatically handles jsonSerialize(), toArray(), and fromJson() using constructor types!
// Use #[JsonKey('user_id')] to override field names if needed.
}
1 change: 1 addition & 0 deletions src/GeneratedModels/FeedsPolicyConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ class FeedsPolicyConfig extends BaseModel
public function __construct(
public ?int $maxAgeHours = null,
public ?array $feedGroups = null,
public ?object $filterConditions = null, // Activities must match every condition to be deleted.
) {
}

Expand Down
2 changes: 2 additions & 0 deletions src/GeneratedModels/ForYouConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ public function __construct(
public ?ForYouExplorationConfig $exploration = null,
public ?ForYouDwellConfig $dwell = null,
public ?bool $trending = null, // Tracks trending tags and turns on the topic_trend ranking variable (0-1, the highest trend over a post's interest tags). Requires enabled
public ?bool $analytics = null, // Counts engagement per feed view and experiment. Requires enabled and a plan with activity metrics
public ?ForYouExperimentConfig $experiment = null,
) {
}

Expand Down
18 changes: 18 additions & 0 deletions src/GeneratedModels/ForYouExperimentConfig.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

declare(strict_types=1);

namespace GetStream\GeneratedModels;
class ForYouExperimentConfig extends BaseModel
{
public function __construct(
public ?string $id = null, // Experiment identifier, 1 to 64 letters, digits, dashes or underscores
/** @var array<ForYouExperimentVariant>|null */
#[ArrayOf(ForYouExperimentVariant::class)]
public ?array $variants = null, // 2 to 4 feed views with distinct ids; weights are percents summing to 100
) {
}

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

declare(strict_types=1);

namespace GetStream\GeneratedModels;
class ForYouExperimentVariant extends BaseModel
{
public function __construct(
public ?string $view = null, // ID of an existing feed view
public ?int $weight = null, // Share of users in percent, 1 to 100
) {
}

// BaseModel automatically handles jsonSerialize(), toArray(), and fromJson() using constructor types!
// Use #[JsonKey('user_id')] to override field names if needed.
}
2 changes: 1 addition & 1 deletion src/GeneratedModels/GetOrCreateFeedResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function __construct(
public ?NotificationStatusResponse $notificationStatus = null,
public ?array $degradedSelectors = null, // Activity selectors dropped from this read because they exceeded their time budget (see the time_budget_ms selector setting). Their activities are missing from this page, and they stay out for the rest of this pagination session. Omitted when every selector completed
public ?RankingConfig $rankingConfig = null,
public ?string $requestID = null, // Signed token identifying this read. Pass it with activity metrics events to attribute them to this read. Only set on feed reads for paid plans with an authenticated user, when the app uses feed impressions (For You exploration, or a For You ranking that uses impressions_bucket)
public ?string $requestID = null, // Signed token identifying this read. Pass it with activity metrics events to attribute them to this read. Only set on feed reads for paid plans with an authenticated user, when the app uses feed impressions (For You exploration, or a For You ranking that uses impressions_bucket) or For You engagement analytics
public ?bool $created = null,
public ?string $next = null,
public ?string $prev = null,
Expand Down
21 changes: 21 additions & 0 deletions src/GeneratedModels/MessageSchemaSettings.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

declare(strict_types=1);

namespace GetStream\GeneratedModels;
/**
* The app's message schema settings: how strictly messages and reactions are checked, and the JSON Schemas they are checked against.
*/
class MessageSchemaSettings extends BaseModel
{
public function __construct(
public ?string $mode = null, // How violations are handled: off does not check, report checks and records violations without rejecting the write, enforce rejects writes that violate the schema. Defaults to off
public ?int $documentVersion = null, // The settings document version to use. When omitted, the latest version is used; an unknown version is rejected
public ?MessageValidation $message = null, // The rules a message is checked against.
public ?ReactionValidation $reaction = null, // The rules a reaction is checked against.
) {
}

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

declare(strict_types=1);

namespace GetStream\GeneratedModels;
/**
* The rules a message is checked against.
*/
class MessageValidation extends BaseModel
{
public function __construct(
public ?object $schema = null, // A JSON Schema 2020-12 object validating {message, user}
public ?array $frozenFields = null, // Message document paths that cannot change after the message is created
) {
}

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

declare(strict_types=1);

namespace GetStream\GeneratedModels;
class QueryFeedsEngagementStatsRequest extends BaseModel
{
public function __construct(
public ?string $groupID = null, // Feed group to report on
public ?string $from = null, // Start date in YYYY-MM-DD format (optional, defaults to 29 days before to, so a 30-day range)
public ?string $to = null, // End date in YYYY-MM-DD format (optional, defaults to today UTC). The range is at most 396 days
public ?string $viewID = null, // Only this view (optional)
public ?string $experimentID = null, // Only this experiment (optional)
public ?int $limit = null, // Maximum number of series (one per group, view and experiment), not rows, 1 to 100 (optional, defaults to 100, or 10,000 / days for ranges over 100 days). The limit never cuts a series; a metric's days with no events are omitted from its daily values. limit x days must not exceed 10,000
) {
}

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

declare(strict_types=1);

namespace GetStream\GeneratedModels;
class QueryFeedsEngagementStatsResponse extends BaseModel
{
public function __construct(
public ?string $duration = null,
/** @var array<EngagementStatsResult>|null */
#[ArrayOf(EngagementStatsResult::class)]
public ?array $results = null, // One series per (group, view, experiment), in byte order of experiment, view, then group
) {
}

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

declare(strict_types=1);

namespace GetStream\GeneratedModels;
/**
* The rules a reaction is checked against.
*/
class ReactionValidation extends BaseModel
{
public function __construct(
public ?object $schema = null, // A JSON Schema 2020-12 object validating {reaction, user}
) {
}

// BaseModel automatically handles jsonSerialize(), toArray(), and fromJson() using constructor types!
// Use #[JsonKey('user_id')] to override field names if needed.
}
1 change: 1 addition & 0 deletions src/GeneratedModels/SetFeedsRetentionPolicyRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ public function __construct(
public ?string $policy = null,
public ?int $maxAgeHours = null,
public ?array $feedGroups = null,
public ?object $filterConditions = null, // Limits deletion to activities matching every condition; expires_at supports only $exists: true. Not allowed on old-activities. Omitted or null keeps the stored filter; {} removes it.
public ?bool $enabled = null,
) {
}
Expand Down
2 changes: 1 addition & 1 deletion src/GeneratedModels/TrackActivityMetricsEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public function __construct(
public ?string $activityID = null, // The ID of the activity to track the metric for
public ?string $metric = null, // The metric name (e.g. views, clicks, impressions, dwell). Alphanumeric and underscores only. dwell requires dwell_ms.
public ?int $delta = null, // The amount to increment (positive) or decrement (negative). Defaults to 1. The absolute value counts against rate limits.
public ?string $requestID = null, // The request_id returned by the feed read that showed the activity. An invalid, expired (older than 48h) or future-dated (more than 5 minutes ahead) value fails only this event. Impressions sent with a valid request_id feed ranking, are not added to the activity's metrics.impressions, and must use a delta of 1.
public ?string $requestID = null, // The request_id returned by the feed read that showed the activity. An invalid, expired (older than 48h) or future-dated (more than 5 minutes ahead) value fails only this event. Impressions sent with a valid request_id must use a delta of 1 and feed For You engagement analytics. In apps that use feed impressions (exploration or impressions_bucket) they feed ranking and are not added to the activity's metrics.impressions; with For You analytics on and no feed impressions they are added as without a request_id.
public ?int $position = null, // 1-based position of the activity in that feed read. A value below 1 fails only this event. Accepted but not stored yet.
public ?int $dwellMs = null, // Milliseconds the activity was in view. Required for the built-in dwell metric; apps with a custom dwell metric keep their own behavior.
) {
Expand Down
1 change: 1 addition & 0 deletions src/GeneratedModels/UpdateAppRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ public function __construct(
public ?bool $twoWayBlockEffectEnabled = null,
public ?AgentReviewSettingsPayload $agentReview = null, // Settings for the moderation agent reviewer, which reviews moderation outcomes and proposes or applies an action.
public ?MessageMarksConfig $messageMarks = null, // The app's message marks policy: the mark types it defines or overrides, and the privacy switch. The channel type's mark_types says which of them are on in its channels.
public ?MessageSchemaSettings $messageSchema = null, // The app's message schema settings: how strictly messages and reactions are checked, and the JSON Schemas they are checked against.
) {
}

Expand Down
Loading