diff --git a/TwitchLib.Api.Helix.Models/Ads/StartCommercialRequest.cs b/TwitchLib.Api.Helix.Models/Channels/StartCommercial/StartCommercialRequest.cs similarity index 93% rename from TwitchLib.Api.Helix.Models/Ads/StartCommercialRequest.cs rename to TwitchLib.Api.Helix.Models/Channels/StartCommercial/StartCommercialRequest.cs index dc53cb9c..c3f8bcb7 100644 --- a/TwitchLib.Api.Helix.Models/Ads/StartCommercialRequest.cs +++ b/TwitchLib.Api.Helix.Models/Channels/StartCommercial/StartCommercialRequest.cs @@ -1,6 +1,6 @@ using Newtonsoft.Json; -namespace TwitchLib.Api.Helix.Models.Ads +namespace TwitchLib.Api.Helix.Models.Channels.StartCommercial { /// /// Request Body for StartCommercial diff --git a/TwitchLib.Api.Helix.Models/Ads/StartCommercialResponse.cs b/TwitchLib.Api.Helix.Models/Channels/StartCommercial/StartCommercialResponse.cs similarity index 93% rename from TwitchLib.Api.Helix.Models/Ads/StartCommercialResponse.cs rename to TwitchLib.Api.Helix.Models/Channels/StartCommercial/StartCommercialResponse.cs index 582b1b42..91e307d7 100644 --- a/TwitchLib.Api.Helix.Models/Ads/StartCommercialResponse.cs +++ b/TwitchLib.Api.Helix.Models/Channels/StartCommercial/StartCommercialResponse.cs @@ -1,6 +1,6 @@ using Newtonsoft.Json; -namespace TwitchLib.Api.Helix.Models.Ads +namespace TwitchLib.Api.Helix.Models.Channels.StartCommercial { /// /// The response for starting a commercial on a specified channel. diff --git a/TwitchLib.Api.Helix/Ads.cs b/TwitchLib.Api.Helix/Ads.cs deleted file mode 100644 index 9844a7c9..00000000 --- a/TwitchLib.Api.Helix/Ads.cs +++ /dev/null @@ -1,39 +0,0 @@ -using Newtonsoft.Json; -using System.Threading.Tasks; -using TwitchLib.Api.Core; -using TwitchLib.Api.Core.Enums; -using TwitchLib.Api.Core.Interfaces; -using TwitchLib.Api.Helix.Models.Ads; - -namespace TwitchLib.Api.Helix -{ - /// - /// Ads related APIs - /// - public class Ads : ApiBase - { - public Ads(IApiSettings settings, IRateLimiter rateLimiter, IHttpCallHandler http) : base(settings, rateLimiter, http) - { - } - - #region StartCommercial - - /// - /// - /// Twitch Docs: Start Commercial - /// Starts a commercial on the specified channel. - /// Only partners and affiliates may run commercials and they must be streaming live at the time. - /// Only the broadcaster may start a commercial - the broadcaster’s editors and moderators may not start commercials on behalf of the broadcaster. - /// Requires a user access token that includes the channel:edit:commercial scope. - /// - /// - /// Optional access token to override the use of the stored one in the TwitchAPI instance. - /// - public Task StartCommercialAsync(StartCommercialRequest request, string accessToken = null) - { - return TwitchPostGenericAsync("/channels/commercial", ApiVersion.Helix, JsonConvert.SerializeObject(request), null, accessToken); - } - - #endregion - } -} diff --git a/TwitchLib.Api.Helix/Channels.cs b/TwitchLib.Api.Helix/Channels.cs index 971b5fd8..fac8fe87 100644 --- a/TwitchLib.Api.Helix/Channels.cs +++ b/TwitchLib.Api.Helix/Channels.cs @@ -14,6 +14,7 @@ using TwitchLib.Api.Helix.Models.Channels.GetFollowedChannels; using TwitchLib.Api.Helix.Models.Channels.ModifyChannelInformation; using TwitchLib.Api.Helix.Models.Channels.SnoozeNextAd; +using TwitchLib.Api.Helix.Models.Channels.StartCommercial; namespace TwitchLib.Api.Helix { @@ -327,5 +328,25 @@ public Task SnoozeNextAd(string broadcasterId, string acce } #endregion + + #region StartCommercial + + /// + /// + /// Twitch Docs: Start Commercial + /// Starts a commercial on the specified channel. + /// Only partners and affiliates may run commercials and they must be streaming live at the time. + /// Only the broadcaster may start a commercial - the broadcaster’s editors and moderators may not start commercials on behalf of the broadcaster. + /// Requires a user access token that includes the channel:edit:commercial scope. + /// + /// + /// Optional access token to override the use of the stored one in the TwitchAPI instance. + /// + public Task StartCommercialAsync(StartCommercialRequest request, string accessToken = null) + { + return TwitchPostGenericAsync("/channels/commercial", ApiVersion.Helix, JsonConvert.SerializeObject(request), null, accessToken); + } + + #endregion } } diff --git a/TwitchLib.Api.Helix/Helix.cs b/TwitchLib.Api.Helix/Helix.cs index 516d9390..b778a8b8 100644 --- a/TwitchLib.Api.Helix/Helix.cs +++ b/TwitchLib.Api.Helix/Helix.cs @@ -21,10 +21,6 @@ public class Helix /// public Analytics Analytics { get; } /// - /// Ads related Helix APIs - /// - public Ads Ads { get; } - /// /// Bits related Helix APIs /// public Bits Bits { get; } @@ -148,7 +144,6 @@ public Helix(ILoggerFactory loggerFactory = null, IRateLimiter rateLimiter = nul Settings = settings ?? new ApiSettings(); Analytics = new Analytics(Settings, rateLimiter, http); - Ads = new Ads(Settings, rateLimiter, http); Bits = new Bits(Settings, rateLimiter, http); Chat = new Chat(Settings, rateLimiter, http); Channels = new Channels(Settings, rateLimiter, http);