diff --git a/.spec-version b/.spec-version index dd127fd..d305fa7 100644 --- a/.spec-version +++ b/.spec-version @@ -1,2 +1,2 @@ -spec: openapi-v241.26.0 -generator: chat v241.26.0 +spec: openapi-v241.26.1 +generator: chat v241.26.1 diff --git a/src/Generated/FeedsTrait.php b/src/Generated/FeedsTrait.php index 8af27f8..6356ed7 100644 --- a/src/Generated/FeedsTrait.php +++ b/src/Generated/FeedsTrait.php @@ -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 @@ -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 + * @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. diff --git a/src/GeneratedModels/ActivityFeedbackRequest.php b/src/GeneratedModels/ActivityFeedbackRequest.php index 9ef5897..4c55ff1 100644 --- a/src/GeneratedModels/ActivityFeedbackRequest.php +++ b/src/GeneratedModels/ActivityFeedbackRequest.php @@ -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 ) { diff --git a/src/GeneratedModels/AppResponseFields.php b/src/GeneratedModels/AppResponseFields.php index fc89054..5ab0924 100644 --- a/src/GeneratedModels/AppResponseFields.php +++ b/src/GeneratedModels/AppResponseFields.php @@ -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. ) { } diff --git a/src/GeneratedModels/EngagementRates.php b/src/GeneratedModels/EngagementRates.php new file mode 100644 index 0000000..00507c6 --- /dev/null +++ b/src/GeneratedModels/EngagementRates.php @@ -0,0 +1,19 @@ +|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. +} diff --git a/src/GeneratedModels/FeedsPolicyConfig.php b/src/GeneratedModels/FeedsPolicyConfig.php index 39fe122..4845c17 100644 --- a/src/GeneratedModels/FeedsPolicyConfig.php +++ b/src/GeneratedModels/FeedsPolicyConfig.php @@ -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. ) { } diff --git a/src/GeneratedModels/ForYouConfig.php b/src/GeneratedModels/ForYouConfig.php index 838c0bc..e0fef82 100644 --- a/src/GeneratedModels/ForYouConfig.php +++ b/src/GeneratedModels/ForYouConfig.php @@ -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, ) { } diff --git a/src/GeneratedModels/ForYouExperimentConfig.php b/src/GeneratedModels/ForYouExperimentConfig.php new file mode 100644 index 0000000..7f54270 --- /dev/null +++ b/src/GeneratedModels/ForYouExperimentConfig.php @@ -0,0 +1,18 @@ +|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. +} diff --git a/src/GeneratedModels/ForYouExperimentVariant.php b/src/GeneratedModels/ForYouExperimentVariant.php new file mode 100644 index 0000000..80cbda4 --- /dev/null +++ b/src/GeneratedModels/ForYouExperimentVariant.php @@ -0,0 +1,16 @@ +|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. +} diff --git a/src/GeneratedModels/ReactionValidation.php b/src/GeneratedModels/ReactionValidation.php new file mode 100644 index 0000000..d6cc157 --- /dev/null +++ b/src/GeneratedModels/ReactionValidation.php @@ -0,0 +1,18 @@ +