From 13db111e19f718a1cebe154123775cb9980a2bbf Mon Sep 17 00:00:00 2001 From: Syzuna Date: Mon, 30 Oct 2023 23:34:28 +0100 Subject: [PATCH] Added is_featured to response model and as optional query param for GetClips (#375) --- TwitchLib.Api.Helix.Models/Clips/GetClips/Clip.cs | 6 ++++++ TwitchLib.Api.Helix/Clips.cs | 9 ++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/TwitchLib.Api.Helix.Models/Clips/GetClips/Clip.cs b/TwitchLib.Api.Helix.Models/Clips/GetClips/Clip.cs index 3fbc9569..c793f412 100644 --- a/TwitchLib.Api.Helix.Models/Clips/GetClips/Clip.cs +++ b/TwitchLib.Api.Helix.Models/Clips/GetClips/Clip.cs @@ -106,5 +106,11 @@ public class Clip /// [JsonProperty(PropertyName = "vod_offset")] public int VodOffset { get; protected set; } + + /// + /// A Boolean value that indicates if the clip is featured or not. + /// + [JsonProperty(PropertyName = "is_featured")] + public bool IsFeatured { get; protected set; } } } diff --git a/TwitchLib.Api.Helix/Clips.cs b/TwitchLib.Api.Helix/Clips.cs index 8c45a543..ed38a881 100644 --- a/TwitchLib.Api.Helix/Clips.cs +++ b/TwitchLib.Api.Helix/Clips.cs @@ -52,11 +52,15 @@ public Clips(IApiSettings settings, IRateLimiter rateLimiter, IHttpCallHandler h /// Ending date/time for returned clips, in RFC3339 format. (Note that the seconds value is ignored.) /// If this is specified, started_at also must be specified; otherwise, the time period is ignored. /// + /// + /// A Boolean value that determines whether the response includes featured clips. + /// If true, returns only clips that are featured. If false, returns only clips that aren’t featured. All clips are returned if this parameter is not present. + /// /// Maximum number of objects to return. Maximum: 100. Default: 20. /// optional access token to override the use of the stored one in the TwitchAPI instance /// /// - public Task GetClipsAsync(List clipIds = null, string gameId = null, string broadcasterId = null, string before = null, string after = null, DateTime? startedAt = null, DateTime? endedAt = null, int first = 20, string accessToken = null) + public Task GetClipsAsync(List clipIds = null, string gameId = null, string broadcasterId = null, string before = null, string after = null, DateTime? startedAt = null, DateTime? endedAt = null, bool? isFeatured = null, int first = 20, string accessToken = null) { if (first < 0 || first > 100) throw new BadParameterException("'first' must between 0 (inclusive) and 100 (inclusive)."); @@ -91,6 +95,9 @@ public Task GetClipsAsync(List clipIds = null, string if (!string.IsNullOrWhiteSpace(after)) getParams.Add(new KeyValuePair("after", after)); + + if (isFeatured.HasValue) + getParams.Add(new KeyValuePair("is_featured", isFeatured.Value.ToString())); getParams.Add(new KeyValuePair("first", first.ToString()));