diff --git a/TwitchLib.Api.Core.Enums/ContentClassificationLabelEnum.cs b/TwitchLib.Api.Core.Enums/ContentClassificationLabelEnum.cs index 0bbe4efd..17ef3f19 100644 --- a/TwitchLib.Api.Core.Enums/ContentClassificationLabelEnum.cs +++ b/TwitchLib.Api.Core.Enums/ContentClassificationLabelEnum.cs @@ -5,6 +5,12 @@ /// public enum ContentClassificationLabelEnum { + /// + /// Content Classification Label for broadcasts with discussions or debates about politics + /// or sensitive social issues such as elections, civic integrity, military conflict, and civil rights. + /// + DebatedSocialIssuesAndPolitics, + /// /// Content Classification Label for broadcasts with excessive tobacco glorification or promotion, /// any marijuana consumption/use, legal drug and alcohol induced intoxication, discussions of illegal drugs. diff --git a/TwitchLib.Api.Helix.Models/SharedChat/GetSharedChatSession/GetSharedChatSessionResponse.cs b/TwitchLib.Api.Helix.Models/SharedChat/GetSharedChatSession/GetSharedChatSessionResponse.cs new file mode 100644 index 00000000..fa3abc82 --- /dev/null +++ b/TwitchLib.Api.Helix.Models/SharedChat/GetSharedChatSession/GetSharedChatSessionResponse.cs @@ -0,0 +1,16 @@ +using Newtonsoft.Json; +using TwitchLib.Api.Helix.Models.GuestStar; + +namespace TwitchLib.Api.Helix.Models.SharedChat.GetSharedChatSession; + +/// +/// Get shared chat session response object. +/// +public class GetSharedChatSessionResponse +{ + /// + /// A list that contains the channels shared chat sessions + /// + [JsonProperty(PropertyName = "data")] + public SharedChatSession[] Data { get; protected set; } +} \ No newline at end of file diff --git a/TwitchLib.Api.Helix.Models/SharedChat/SharedChatParticipant.cs b/TwitchLib.Api.Helix.Models/SharedChat/SharedChatParticipant.cs new file mode 100644 index 00000000..d1cb54bd --- /dev/null +++ b/TwitchLib.Api.Helix.Models/SharedChat/SharedChatParticipant.cs @@ -0,0 +1,15 @@ +using Newtonsoft.Json; + +namespace TwitchLib.Api.Helix.Models.SharedChat; + +/// +/// A participant in the shared chat session. +/// +public class SharedChatParticipant +{ + /// + /// The User ID of the participant's channel. + /// + [JsonProperty(PropertyName = "broadcaster_id")] + public string BroadcasterId { get; protected set; } +} \ No newline at end of file diff --git a/TwitchLib.Api.Helix.Models/SharedChat/SharedChatSession.cs b/TwitchLib.Api.Helix.Models/SharedChat/SharedChatSession.cs new file mode 100644 index 00000000..1e985886 --- /dev/null +++ b/TwitchLib.Api.Helix.Models/SharedChat/SharedChatSession.cs @@ -0,0 +1,39 @@ +using Newtonsoft.Json; + +namespace TwitchLib.Api.Helix.Models.SharedChat; + +/// +/// The shared chat session details +/// +public class SharedChatSession +{ + /// + /// The unique identifier for the shared chat session. + /// + [JsonProperty(PropertyName = "session_id")] + public string SessionId { get; protected set; } + + /// + /// The User ID of the host channel. + /// + [JsonProperty(PropertyName = "host_broadcaster_id")] + public string HostBroadcasterId { get; protected set; } + + /// + /// The list of participants in the session. + /// + [JsonProperty(PropertyName = "participants")] + public SharedChatParticipant[] Participants { get; protected set; } + + /// + /// The UTC date and time (in RFC3339 format) for when the session was created. + /// + [JsonProperty(PropertyName = "created_at")] + public string CreatedAt { get; protected set; } + + /// + /// The UTC date and time (in RFC3339 format) for when the session was last updated. + /// + [JsonProperty(PropertyName = "updated_at")] + public string UpdatedAt { get; protected set; } +} \ No newline at end of file diff --git a/TwitchLib.Api.Helix/SharedChat.cs b/TwitchLib.Api.Helix/SharedChat.cs new file mode 100644 index 00000000..558168f5 --- /dev/null +++ b/TwitchLib.Api.Helix/SharedChat.cs @@ -0,0 +1,51 @@ +using System.Collections.Generic; +using System.Threading.Tasks; +using Newtonsoft.Json; +using TwitchLib.Api.Core; +using TwitchLib.Api.Core.Enums; +using TwitchLib.Api.Core.Exceptions; +using TwitchLib.Api.Core.Interfaces; +using TwitchLib.Api.Helix.Models.GuestStar.CreateGuestStarSession; +using TwitchLib.Api.Helix.Models.GuestStar.GetChannelGuestStarSettings; +using TwitchLib.Api.Helix.Models.GuestStar.GetGuestStarInvites; +using TwitchLib.Api.Helix.Models.GuestStar.GetGuestStarSession; +using TwitchLib.Api.Helix.Models.GuestStar.UpdateChannelGuestStarSettings; +using TwitchLib.Api.Helix.Models.SharedChat.GetSharedChatSession; + +namespace TwitchLib.Api.Helix; + +/// +/// Shared Chat related APIs +/// +public class SharedChat : ApiBase +{ + public SharedChat(IApiSettings settings, IRateLimiter rateLimiter, IHttpCallHandler http) : base(settings, + rateLimiter, http) + {} + + #region GetSharedChatSession + + /// + /// + /// Twitch Docs: Get Shared Chat Session + /// Retrieves the active shared chat session for a channel. + /// + /// The User ID of the channel broadcaster. + /// Optional access token to override the use of the stored one in the TwitchAPI instance + /// + /// + public Task GetSharedChatSessionAsync(string broadcasterId, string accessToken = null) + { + if (string.IsNullOrWhiteSpace(broadcasterId)) + throw new BadParameterException("broadcasterId must be set"); + + var getParams = new List> + { + new("broadcaster_id", broadcasterId) + }; + + return TwitchGetGenericAsync("/shared_chat/session", ApiVersion.Helix, getParams, accessToken); + } + + #endregion +} \ No newline at end of file