diff --git a/TwitchLib.Api.Core.Enums/ContentClassificationLabelEnum.cs b/TwitchLib.Api.Core.Enums/ContentClassificationLabelEnum.cs new file mode 100644 index 00000000..0bbe4efd --- /dev/null +++ b/TwitchLib.Api.Core.Enums/ContentClassificationLabelEnum.cs @@ -0,0 +1,38 @@ +namespace TwitchLib.Api.Core.Enums +{ + /// + /// Enum representing the Content Classification Labels. + /// + public enum ContentClassificationLabelEnum + { + /// + /// 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. + /// + DrugsIntoxication, + + /// + /// Content Classification Label for broadcasts with content that focuses on + /// sexualized physical attributes and activities, sexual topics, or experiences. + /// + SexualThemes, + + /// + /// Content Classification Label for broadcasts with simulations and/or depictions + /// of realistic violence, gore, extreme injury, or death. + /// + ViolentGraphic, + + /// + /// Content Classification Label for broadcasts that participate in online or + /// in-person gambling, poker or fantasy sports, that involve the exchange of real money. + /// + Gambling, + + /// + /// Content Classification Label for broadcasts with prolonged, and repeated use + /// of obscenities, profanities, and vulgarities, especially as a regular part of speech. + /// + ProfanityVulgarity + } +} diff --git a/TwitchLib.Api.Helix.Models/Ads/StartCommercialRequest.cs b/TwitchLib.Api.Helix.Models/Ads/StartCommercialRequest.cs index 054e4d36..dc53cb9c 100644 --- a/TwitchLib.Api.Helix.Models/Ads/StartCommercialRequest.cs +++ b/TwitchLib.Api.Helix.Models/Ads/StartCommercialRequest.cs @@ -2,11 +2,24 @@ namespace TwitchLib.Api.Helix.Models.Ads { - public class StartCommercialRequest - { - [JsonProperty(PropertyName = "broadcaster_id")] - public string BroadcasterId { get; set; } - [JsonProperty(PropertyName = "length")] - public int Length { get; set; } - } -} + /// + /// Request Body for StartCommercial + /// + public class StartCommercialRequest + { + /// + /// The ID of the partner or affiliate broadcaster that wants to run the commercial. + /// This ID must match the user ID found in the OAuth token. + /// + [JsonProperty(PropertyName = "broadcaster_id")] + public string BroadcasterId { get; set; } + + /// + /// The length of the commercial to run, in seconds. + /// Twitch tries to serve a commercial that’s the requested length, but it may be shorter or longer. + /// The maximum length you should request is 180 seconds. + /// + [JsonProperty(PropertyName = "length")] + public int Length { get; set; } + } +} \ No newline at end of file diff --git a/TwitchLib.Api.Helix.Models/Ads/StartCommercialResponse.cs b/TwitchLib.Api.Helix.Models/Ads/StartCommercialResponse.cs index c456649f..582b1b42 100644 --- a/TwitchLib.Api.Helix.Models/Ads/StartCommercialResponse.cs +++ b/TwitchLib.Api.Helix.Models/Ads/StartCommercialResponse.cs @@ -2,13 +2,28 @@ namespace TwitchLib.Api.Helix.Models.Ads { - public class StartCommercialResponse - { - [JsonProperty(PropertyName = "length")] - public int Length { get; protected set; } - [JsonProperty(PropertyName = "message")] - public string Message { get; protected set; } - [JsonProperty(PropertyName = "retry_after")] - public int RetryAfter { get; protected set; } - } + /// + /// The response for starting a commercial on a specified channel. + /// + public class StartCommercialResponse + { + /// + /// The length of the commercial you requested. + /// If you request a commercial that’s longer than 180 seconds, the API uses 180 seconds. + /// + [JsonProperty(PropertyName = "length")] + public int Length { get; protected set; } + + /// + /// A message that indicates whether Twitch was able to serve an ad. + /// + [JsonProperty(PropertyName = "message")] + public string Message { get; protected set; } + + /// + /// The number of seconds you must wait before running another commercial. + /// + [JsonProperty(PropertyName = "retry_after")] + public int RetryAfter { get; protected set; } + } } diff --git a/TwitchLib.Api.Helix.Models/Analytics/ExtensionAnalytics.cs b/TwitchLib.Api.Helix.Models/Analytics/ExtensionAnalytics.cs index 446a426b..87100e74 100644 --- a/TwitchLib.Api.Helix.Models/Analytics/ExtensionAnalytics.cs +++ b/TwitchLib.Api.Helix.Models/Analytics/ExtensionAnalytics.cs @@ -3,15 +3,34 @@ namespace TwitchLib.Api.Helix.Models.Analytics { - public class ExtensionAnalytics - { - [JsonProperty(PropertyName = "extension_id")] - public string ExtensionId { get; protected set; } - [JsonProperty(PropertyName = "URL")] - public string Url { get; protected set; } - [JsonProperty(PropertyName = "type")] - public string Type { get; protected set; } - [JsonProperty(PropertyName = "date_range")] - public DateRange DateRange { get; protected set; } - } + /// + /// A analytic report for an extension. + /// + public class ExtensionAnalytics + { + /// + /// An ID that identifies the extension that the analytic report was generated for. + /// + [JsonProperty(PropertyName = "extension_id")] + public string ExtensionId { get; protected set; } + + /// + /// The URL that you use to download the analytic report. + /// The URL is valid for 5 minutes. + /// + [JsonProperty(PropertyName = "URL")] + public string Url { get; protected set; } + + /// + /// The type of analytic report. + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; protected set; } + + /// + /// The reporting periods start and end dates. + /// + [JsonProperty(PropertyName = "date_range")] + public DateRange DateRange { get; protected set; } + } } diff --git a/TwitchLib.Api.Helix.Models/Analytics/GameAnalytics.cs b/TwitchLib.Api.Helix.Models/Analytics/GameAnalytics.cs index 38d01984..963311aa 100644 --- a/TwitchLib.Api.Helix.Models/Analytics/GameAnalytics.cs +++ b/TwitchLib.Api.Helix.Models/Analytics/GameAnalytics.cs @@ -3,15 +3,34 @@ namespace TwitchLib.Api.Helix.Models.Analytics { - public class GameAnalytics - { - [JsonProperty(PropertyName = "game_id")] - public string GameId { get; protected set; } - [JsonProperty(PropertyName = "URL")] - public string Url { get; protected set; } - [JsonProperty(PropertyName = "type")] - public string Type { get; protected set; } - [JsonProperty(PropertyName = "date_range")] - public DateRange DateRange { get; protected set; } - } + /// + /// + /// + public class GameAnalytics + { + /// + /// An ID that identifies the game that the analytic report was generated for. + /// + [JsonProperty(PropertyName = "game_id")] + public string GameId { get; protected set; } + + /// + /// The URL that you use to download the analytic report. + /// The URL is valid for 5 minutes. + /// + [JsonProperty(PropertyName = "URL")] + public string Url { get; protected set; } + + /// + /// The type of analytic report. + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; protected set; } + + /// + /// The reporting period’s start and end dates. + /// + [JsonProperty(PropertyName = "date_range")] + public DateRange DateRange { get; protected set; } + } } diff --git a/TwitchLib.Api.Helix.Models/Analytics/GetExtensionAnalyticsResponse.cs b/TwitchLib.Api.Helix.Models/Analytics/GetExtensionAnalyticsResponse.cs index a34bd995..0c4d524b 100644 --- a/TwitchLib.Api.Helix.Models/Analytics/GetExtensionAnalyticsResponse.cs +++ b/TwitchLib.Api.Helix.Models/Analytics/GetExtensionAnalyticsResponse.cs @@ -1,10 +1,29 @@ using Newtonsoft.Json; +using TwitchLib.Api.Helix.Models.Common; namespace TwitchLib.Api.Helix.Models.Analytics { - public class GetExtensionAnalyticsResponse - { - [JsonProperty(PropertyName = "data")] - public ExtensionAnalytics[] Data { get; protected set; } - } + /// + /// The response for GetExtensionAnalytics that gets a list of analytic reports for one or more extensions. + /// The response contains the URLs used to download the reports (CSV files) and the URLs are only valid for 5 minutes. + /// + public class GetExtensionAnalyticsResponse + { + /// + /// A list of analytic reports for the extensions. + /// The reports are returned in no particular order; however, the data within each report is in ascending order by date (newest first). + /// The report contains one row of data per day of the reporting window and only contains rows for the days that the extension was used. + /// The array is empty if there are no reports. + /// + [JsonProperty(PropertyName = "data")] + public ExtensionAnalytics[] Data { get; protected set; } + + /// + /// Contains the information used to page through the list of results. + /// The object is empty if there are no more pages left to page through. + /// Use the cursor to set the GetExtensionAnalytics request’s after query parameter. + /// + [JsonProperty(PropertyName = "pagination")] + public Pagination Pagination { get; protected set; } + } } diff --git a/TwitchLib.Api.Helix.Models/Analytics/GetGameAnalyticsResponse.cs b/TwitchLib.Api.Helix.Models/Analytics/GetGameAnalyticsResponse.cs index 1bb03bfd..9781ff30 100644 --- a/TwitchLib.Api.Helix.Models/Analytics/GetGameAnalyticsResponse.cs +++ b/TwitchLib.Api.Helix.Models/Analytics/GetGameAnalyticsResponse.cs @@ -3,11 +3,28 @@ namespace TwitchLib.Api.Helix.Models.Analytics { - public class GetGameAnalyticsResponse - { - [JsonProperty(PropertyName = "data")] - public GameAnalytics[] Data { get; protected set; } - [JsonProperty(PropertyName = "pagination")] - public Pagination Pagination { get; protected set; } - } + /// + /// Response for GetGameAnalytics which gets gets a list of analytic reports for one or more games. + /// The response contains the URLs used to download the reports (CSV files) and the URLs are only valid for 5 minutes. + /// + public class GetGameAnalyticsResponse + { + /// + /// A list of game analytics reports. + /// The reports are returned in no particular order; however, the data within each report is in ascending order by date (newest first). + /// The report contains one row of data per day of the reporting window and only contains rows the days that the game was used. + /// A report is available only if the game was broadcast for at least 5 hours over the reporting period. + /// The array is empty if there are no reports. + /// + [JsonProperty(PropertyName = "data")] + public GameAnalytics[] Data { get; protected set; } + + /// + /// Contains the information used to page through the list of results. + /// The object is empty if there are no more pages left to page through. + /// Use the cursor to set the GetGameAnalytics request’s after query parameter. + /// + [JsonProperty(PropertyName = "pagination")] + public Pagination Pagination { get; protected set; } + } } diff --git a/TwitchLib.Api.Helix.Models/Bits/Cheermote.cs b/TwitchLib.Api.Helix.Models/Bits/Cheermote.cs index 01b9939d..ef7397fc 100644 --- a/TwitchLib.Api.Helix.Models/Bits/Cheermote.cs +++ b/TwitchLib.Api.Helix.Models/Bits/Cheermote.cs @@ -1,21 +1,61 @@ -using System; -using Newtonsoft.Json; +using Newtonsoft.Json; +using System; namespace TwitchLib.Api.Helix.Models.Bits -{ - public class Cheermote - { - [JsonProperty(PropertyName = "prefix")] - public string Prefix { get; protected set; } - [JsonProperty(PropertyName = "tiers")] - public Tier[] Tiers { get; protected set; } - [JsonProperty(PropertyName = "type")] - public string Type { get; protected set; } - [JsonProperty(PropertyName = "order")] - public int Order { get; protected set; } - [JsonProperty(PropertyName = "last_updated")] - public DateTime LastUpdated { get; protected set; } - [JsonProperty(PropertyName = "is_charitable")] - public bool IsCharitable { get; protected set; } - } +{ /// + /// Cheermotes are animated emotes that viewers can assign Bits to and can be used in any Bits-enabled channel’s chat room. + /// + public class Cheermote + { + /// + /// The name portion of the Cheermote string that you use in chat to cheer Bits. + /// The full Cheermote string is the concatenation of {prefix} + {number of Bits}. + /// For example, if the prefix is “Cheer” and you want to cheer 100 Bits, the full Cheermote string is Cheer100. + /// When the Cheermote string is entered in chat, Twitch converts it to the image associated with the Bits tier that was cheered. + /// + [JsonProperty(PropertyName = "prefix")] + public string Prefix { get; protected set; } + + /// + /// A list of tier levels that the Cheermote supports. + /// Each tier identifies the range of Bits that you can cheer at that tier level and an image that graphically identifies the tier level. + /// + [JsonProperty(PropertyName = "tiers")] + public Tier[] Tiers { get; protected set; } + + /// + /// The type of Cheermote. Possible values are: + /// global_first_party - A Twitch-defined Cheermote that is shown in the Bits card. + /// global_third_party - A Twitch-defined Cheermote that is not shown in the Bits card. + /// channel_custom - A broadcaster-defined Cheermote. + /// display_only - Do not use; for internal use only. + /// sponsored - A sponsor-defined Cheermote. + /// When used, the sponsor adds additional Bits to the amount that the user cheered. + /// For example, if the user cheered Terminator100, the broadcaster might receive 110 Bits, which includes the sponsor's 10 Bits contribution. + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; protected set; } + + /// + /// The order that the Cheermotes are shown in the Bits card. + /// The numbers may not be consecutive. + /// For example, the numbers may jump from 1 to 7 to 13. + /// The order numbers are unique within a Cheermote type (for example, global_first_party) + /// but may not be unique amongst all Cheermotes in the response. + /// + [JsonProperty(PropertyName = "order")] + public int Order { get; protected set; } + + /// + /// The date and time when this Cheermote was last updated. + /// + [JsonProperty(PropertyName = "last_updated")] + public DateTime LastUpdated { get; protected set; } + + /// + /// A Boolean value that indicates whether this Cheermote provides a charitable contribution match during charity campaigns. + /// + [JsonProperty(PropertyName = "is_charitable")] + public bool IsCharitable { get; protected set; } + } } diff --git a/TwitchLib.Api.Helix.Models/Bits/GetCheermotesResponse.cs b/TwitchLib.Api.Helix.Models/Bits/GetCheermotesResponse.cs index 359eac82..6aeb4165 100644 --- a/TwitchLib.Api.Helix.Models/Bits/GetCheermotesResponse.cs +++ b/TwitchLib.Api.Helix.Models/Bits/GetCheermotesResponse.cs @@ -2,9 +2,15 @@ namespace TwitchLib.Api.Helix.Models.Bits { - public class GetCheermotesResponse - { - [JsonProperty(PropertyName = "data")] - public Cheermote[] Listings { get; protected set; } - } + /// + /// Response from GetCheermotes which gets a list of Cheermotes that users can use to cheer Bits in any Bits-enabled channel’s chat room. + /// + public class GetCheermotesResponse + { + /// + /// The list of Cheermotes. The list is in ascending order by the order field’s value. + /// + [JsonProperty(PropertyName = "data")] + public Cheermote[] Listings { get; protected set; } + } } diff --git a/TwitchLib.Api.Helix.Models/Bits/ImageList.cs b/TwitchLib.Api.Helix.Models/Bits/ImageList.cs index 62106014..7bd634bb 100644 --- a/TwitchLib.Api.Helix.Models/Bits/ImageList.cs +++ b/TwitchLib.Api.Helix.Models/Bits/ImageList.cs @@ -1,13 +1,27 @@ -using System.Collections.Generic; using Newtonsoft.Json; +using System.Collections.Generic; namespace TwitchLib.Api.Helix.Models.Bits { - public class ImageList - { - [JsonProperty(PropertyName = "animated")] - public Dictionary Animated { get; protected set; } - [JsonProperty(PropertyName = "static")] - public Dictionary Static { get; protected set; } - } + /// + /// Animated and static image sets for a Cheermote. + /// Each set is a dictionary with the following sizes: 1, 1.5, 2, 3, and 4. + /// The value of each size contains the URL to the image. + /// + public class ImageList + { + /// + /// Animated image set for a Cheermote and include the following sizes: 1, 1.5, 2, 3, and 4 + /// The value of each size contains the URL to the image. + /// + [JsonProperty(PropertyName = "animated")] + public Dictionary Animated { get; protected set; } + + /// + /// Static image set for a Cheermote and include the following sizes: 1, 1.5, 2, 3, and 4 + /// The value of each size contains the URL to the image. + /// + [JsonProperty(PropertyName = "static")] + public Dictionary Static { get; protected set; } + } } diff --git a/TwitchLib.Api.Helix.Models/Bits/Images.cs b/TwitchLib.Api.Helix.Models/Bits/Images.cs index 54e8f017..1ac2feb2 100644 --- a/TwitchLib.Api.Helix.Models/Bits/Images.cs +++ b/TwitchLib.Api.Helix.Models/Bits/Images.cs @@ -2,11 +2,27 @@ namespace TwitchLib.Api.Helix.Models.Bits { - public class Images - { - [JsonProperty(PropertyName = "dark")] - public ImageList Dark { get; protected set; } - [JsonProperty(PropertyName = "light")] - public ImageList Light { get; protected set; } - } + /// + /// The dark and light themes of a Cheermote. + /// Each theme has static and animated formats of the Cheermote. Each format has a dictionary + /// containing multiple image sizes and associated image URLs. + /// + public class Images + { + /// + /// Dark theme key for a Cheermote. + /// Contains the static and animated formats for the Cheermote. + /// Each format has a dictionary containing multiple image sizes and associated image URLs. + /// + [JsonProperty(PropertyName = "dark")] + public ImageList Dark { get; protected set; } + + /// + /// Light theme key for a Cheermote. + /// Contains the static and animated formats for the Cheermote. + /// Each format has a dictionary containing multiple image sizes and associated image URLs. + /// + [JsonProperty(PropertyName = "light")] + public ImageList Light { get; protected set; } + } } diff --git a/TwitchLib.Api.Helix.Models/Bits/Tier.cs b/TwitchLib.Api.Helix.Models/Bits/Tier.cs index 362ff5c7..52ba82d2 100644 --- a/TwitchLib.Api.Helix.Models/Bits/Tier.cs +++ b/TwitchLib.Api.Helix.Models/Bits/Tier.cs @@ -2,19 +2,55 @@ namespace TwitchLib.Api.Helix.Models.Bits { - public class Tier - { - [JsonProperty(PropertyName = "min_bits")] - public int MinBits { get; protected set; } - [JsonProperty(PropertyName = "id")] - public string Id { get; protected set; } - [JsonProperty(PropertyName = "color")] - public string Color { get; protected set; } - [JsonProperty(PropertyName = "images")] - public Images Images { get; protected set; } - [JsonProperty(PropertyName = "can_cheer")] - public bool CanCheer { get; protected set; } - [JsonProperty(PropertyName = "show_in_bits_card")] - public bool ShowInBitsCard { get; protected set; } - } + /// + /// A list of tier levels that the Cheermote supports. + /// Each tier identifies the range of Bits that you can cheer at that tier level and an image that graphically identifies the tier level. + /// + public class Tier + { + /// + /// The minimum number of Bits that you must cheer at this tier level. + /// The maximum number of Bits that you can cheer at this level is determined by the required minimum Bits of the next tier level minus 1. + /// For example, if min_bits is 1 and min_bits for the next tier is 100, the Bits range for this tier level is 1 through 99. + /// The minimum Bits value of the last tier is the maximum number of Bits you can cheer using this Cheermote. For example, 10000. + /// + [JsonProperty(PropertyName = "min_bits")] + public int MinBits { get; protected set; } + + /// + /// The tier level. Possible tiers are:
+ /// 1 | 100 | 500 | 1,000 | 5,000 | 10,000 | 100,000 + ///
+ [JsonProperty(PropertyName = "id")] + public string Id { get; protected set; } + + /// + /// The hex code of the color associated with this tier level (for example, #979797). + /// + [JsonProperty(PropertyName = "color")] + public string Color { get; protected set; } + + /// + /// The animated and static image sets for the Cheermote - organized by theme, format, and size. + /// The theme keys are dark and light.
+ /// Each theme is a dictionary of formats: animated and static.
+ /// Each format is a dictionary with the following sizes: 1, 1.5, 2, 3, and 4.
+ /// The value of each size contains the URL to the image. + ///
+ [JsonProperty(PropertyName = "images")] + public Images Images { get; protected set; } + + /// + /// A Boolean value that determines whether users can cheer at this tier level. + /// + [JsonProperty(PropertyName = "can_cheer")] + public bool CanCheer { get; protected set; } + + /// + /// A Boolean value that determines whether this tier level is shown in the Bits card. + /// Is true if this tier level is shown in the Bits card. + /// + [JsonProperty(PropertyName = "show_in_bits_card")] + public bool ShowInBitsCard { get; protected set; } + } } diff --git a/TwitchLib.Api.Helix.Models/Channels/GetChannelEditors/ChannelEditor.cs b/TwitchLib.Api.Helix.Models/Channels/GetChannelEditors/ChannelEditor.cs index 6db60aee..d27815cf 100644 --- a/TwitchLib.Api.Helix.Models/Channels/GetChannelEditors/ChannelEditor.cs +++ b/TwitchLib.Api.Helix.Models/Channels/GetChannelEditors/ChannelEditor.cs @@ -1,15 +1,29 @@ -using System; -using Newtonsoft.Json; +using Newtonsoft.Json; +using System; namespace TwitchLib.Api.Helix.Models.Channels.GetChannelEditors { - public class ChannelEditor - { - [JsonProperty(PropertyName = "user_id")] - public string UserId { get; protected set; } - [JsonProperty(PropertyName = "user_name")] - public string UserName { get; protected set; } - [JsonProperty(PropertyName = "created_at")] - public DateTime CreatedAt { get; protected set; } - } + /// + /// A user that is a channel editor for the broadcaster. + /// + public class ChannelEditor + { + /// + /// An ID that uniquely identifies a user with editor permissions. + /// + [JsonProperty(PropertyName = "user_id")] + public string UserId { get; protected set; } + + /// + /// The user’s display name. + /// + [JsonProperty(PropertyName = "user_name")] + public string UserName { get; protected set; } + + /// + /// The date and time when the user became one of the broadcaster’s editors. + /// + [JsonProperty(PropertyName = "created_at")] + public DateTime CreatedAt { get; protected set; } + } } diff --git a/TwitchLib.Api.Helix.Models/Channels/GetChannelEditors/GetChannelEditorsResponse.cs b/TwitchLib.Api.Helix.Models/Channels/GetChannelEditors/GetChannelEditorsResponse.cs index e646e532..ac9d9654 100644 --- a/TwitchLib.Api.Helix.Models/Channels/GetChannelEditors/GetChannelEditorsResponse.cs +++ b/TwitchLib.Api.Helix.Models/Channels/GetChannelEditors/GetChannelEditorsResponse.cs @@ -2,9 +2,16 @@ namespace TwitchLib.Api.Helix.Models.Channels.GetChannelEditors { - public class GetChannelEditorsResponse - { - [JsonProperty(PropertyName = "data")] - public ChannelEditor[] Data { get; protected set; } - } + /// + /// Response for GetChannelEditors that returns a list of the broadcaster's channels editors. + /// + public class GetChannelEditorsResponse + { + /// + /// A list of users that are editors for the specified broadcaster. + /// The list is empty if the broadcaster doesn’t have editors. + /// + [JsonProperty(PropertyName = "data")] + public ChannelEditor[] Data { get; protected set; } + } } diff --git a/TwitchLib.Api.Helix.Models/Channels/GetChannelInformation/ChannelInformation.cs b/TwitchLib.Api.Helix.Models/Channels/GetChannelInformation/ChannelInformation.cs index 9e576376..b186eab7 100644 --- a/TwitchLib.Api.Helix.Models/Channels/GetChannelInformation/ChannelInformation.cs +++ b/TwitchLib.Api.Helix.Models/Channels/GetChannelInformation/ChannelInformation.cs @@ -2,25 +2,80 @@ namespace TwitchLib.Api.Helix.Models.Channels.GetChannelInformation { - public class ChannelInformation - { - [JsonProperty(PropertyName = "broadcaster_id")] - public string BroadcasterId { get; protected set; } - [JsonProperty(PropertyName = "broadcaster_login")] - public string BroadcasterLogin { get; protected set; } - [JsonProperty(PropertyName = "broadcaster_name")] - public string BroadcasterName { get; protected set; } - [JsonProperty(PropertyName = "broadcaster_language")] - public string BroadcasterLanguage { get; protected set; } - [JsonProperty(PropertyName = "game_id")] - public string GameId { get; protected set; } - [JsonProperty(PropertyName = "game_name")] - public string GameName { get; protected set; } - [JsonProperty(PropertyName = "title")] - public string Title { get; protected set; } - [JsonProperty(PropertyName = "delay")] - public int Delay { get; protected set; } - [JsonProperty(PropertyName = "tags")] - public string[] Tags{get; protected set;} - } + /// + /// Information about a channel + /// + public class ChannelInformation + { + /// + /// An ID that uniquely identifies the broadcaster. + /// + [JsonProperty(PropertyName = "broadcaster_id")] + public string BroadcasterId { get; protected set; } + + /// + /// The broadcaster’s login name. + /// + [JsonProperty(PropertyName = "broadcaster_login")] + public string BroadcasterLogin { get; protected set; } + + /// + /// The broadcaster’s display name. + /// + [JsonProperty(PropertyName = "broadcaster_name")] + public string BroadcasterName { get; protected set; } + + /// + /// An ID that uniquely identifies the game that the broadcaster is playing or last played. + /// The value is an empty string if the broadcaster has never played a game. + /// + [JsonProperty(PropertyName = "game_id")] + public string GameId { get; protected set; } + + /// + /// The broadcaster’s preferred language. + /// The value is an ISO 639-1 two-letter language code (for example, en for English). The value is set to “other” if the language is not a Twitch supported language. + /// + [JsonProperty(PropertyName = "broadcaster_language")] + public string BroadcasterLanguage { get; protected set; } + + /// + /// The name of the game that the broadcaster is playing or last played. + /// The value is an empty string if the broadcaster has never played a game. + /// + [JsonProperty(PropertyName = "game_name")] + public string GameName { get; protected set; } + + /// + /// The title of the stream that the broadcaster is currently streaming or last streamed. + /// The value is an empty string if the broadcaster has never streamed. + /// + [JsonProperty(PropertyName = "title")] + public string Title { get; protected set; } + + /// + /// The value of the broadcaster’s stream delay setting, in seconds. + /// This field’s value defaults to zero unless 1) the request specifies a user access token, 2) the ID in the broadcaster_id query parameter matches the user ID in the access token, and 3) the broadcaster has partner status and they set a non-zero stream delay value. + /// + [JsonProperty(PropertyName = "delay")] + public int Delay { get; protected set; } + + /// + /// The tags applied to the channel. + /// + [JsonProperty(PropertyName = "tags")] + public string[] Tags { get; protected set; } + + /// + /// The Content Classification Labels (CCL) applied to the channel. + /// + [JsonProperty(PropertyName = "content_classification_labels")] + public string[] ContentClassificationLabels { get; protected set; } + + /// + /// Boolean flag indicating if the channel has branded content. + /// + [JsonProperty(PropertyName = "is_branded_content")] + public bool IsBrandedContent { get; protected set; } + } } diff --git a/TwitchLib.Api.Helix.Models/Channels/GetChannelInformation/GetChannelInformationResponse.cs b/TwitchLib.Api.Helix.Models/Channels/GetChannelInformation/GetChannelInformationResponse.cs index 679d2654..f90023a3 100644 --- a/TwitchLib.Api.Helix.Models/Channels/GetChannelInformation/GetChannelInformationResponse.cs +++ b/TwitchLib.Api.Helix.Models/Channels/GetChannelInformation/GetChannelInformationResponse.cs @@ -2,9 +2,16 @@ namespace TwitchLib.Api.Helix.Models.Channels.GetChannelInformation { - public class GetChannelInformationResponse - { - [JsonProperty(PropertyName = "data")] - public ChannelInformation[] Data { get; protected set; } - } + /// + /// Response for GetChannelInformation which returns information about one or more channels. + /// + public class GetChannelInformationResponse + { + /// + /// A list that contains information about the specified channels. + /// The list is empty if the specified channels weren’t found. + /// + [JsonProperty(PropertyName = "data")] + public ChannelInformation[] Data { get; protected set; } + } } diff --git a/TwitchLib.Api.Helix.Models/Channels/GetChannelVIPs/ChannelVIPsResponseModel.cs b/TwitchLib.Api.Helix.Models/Channels/GetChannelVIPs/ChannelVIPsResponseModel.cs index 7a3265e4..4faaa420 100644 --- a/TwitchLib.Api.Helix.Models/Channels/GetChannelVIPs/ChannelVIPsResponseModel.cs +++ b/TwitchLib.Api.Helix.Models/Channels/GetChannelVIPs/ChannelVIPsResponseModel.cs @@ -2,22 +2,25 @@ namespace TwitchLib.Api.Helix.Models.Channels.GetChannelVIPs { - public class ChannelVIPsResponseModel - { - /// - /// An ID that uniquely identifies the VIP user. - /// - [JsonProperty(PropertyName = "user_id")] - public string UserId { get; protected set; } - /// - /// The user’s display name. - /// - [JsonProperty(PropertyName = "user_name")] - public string UserName { get; protected set; } - /// - /// The user’s login name. - /// - [JsonProperty(PropertyName = "user_login")] - public string UserLogin { get; protected set; } - } + /// + /// A user that is a VIP in a broadcaster's channel. + /// + public class ChannelVIPsResponseModel + { + /// + /// An ID that uniquely identifies the VIP user. + /// + [JsonProperty(PropertyName = "user_id")] + public string UserId { get; protected set; } + /// + /// The user’s display name. (Name has capitalization) + /// + [JsonProperty(PropertyName = "user_name")] + public string UserName { get; protected set; } + /// + /// The user’s login name. (Name is lowercase) + /// + [JsonProperty(PropertyName = "user_login")] + public string UserLogin { get; protected set; } + } } diff --git a/TwitchLib.Api.Helix.Models/Channels/GetChannelVIPs/GetChannelVIPsResponse.cs b/TwitchLib.Api.Helix.Models/Channels/GetChannelVIPs/GetChannelVIPsResponse.cs index 4fea7dc3..4334c4da 100644 --- a/TwitchLib.Api.Helix.Models/Channels/GetChannelVIPs/GetChannelVIPsResponse.cs +++ b/TwitchLib.Api.Helix.Models/Channels/GetChannelVIPs/GetChannelVIPsResponse.cs @@ -3,17 +3,22 @@ namespace TwitchLib.Api.Helix.Models.Channels.GetChannelVIPs { - public class GetChannelVIPsResponse - { - /// - /// The list of VIPs. The list is empty if the channel doesn’t have VIP users. The list does not include the broadcaster. - /// - [JsonProperty(PropertyName = "data")] - public ChannelVIPsResponseModel[] Data { get; protected set; } - /// - /// Contains the information used to page through the list of results. - /// - [JsonProperty(PropertyName = "pagination")] - public Pagination Pagination { get; protected set; } - } + /// + /// Response for GetVIPs that returns a list of the broadcaster's VIPs. + /// + public class GetChannelVIPsResponse + { + /// + /// The list of VIPs. + /// The list is empty if the channel doesn’t have VIP users. The list does not include the broadcaster. + /// + [JsonProperty(PropertyName = "data")] + public ChannelVIPsResponseModel[] Data { get; protected set; } + + /// + /// Contains the information used to page through the list of results. + /// + [JsonProperty(PropertyName = "pagination")] + public Pagination Pagination { get; protected set; } + } } diff --git a/TwitchLib.Api.Helix.Models/Channels/GetFollowedChannels/FollowedChannel.cs b/TwitchLib.Api.Helix.Models/Channels/GetFollowedChannels/FollowedChannel.cs index 9cb5a08b..862bf899 100644 --- a/TwitchLib.Api.Helix.Models/Channels/GetFollowedChannels/FollowedChannel.cs +++ b/TwitchLib.Api.Helix.Models/Channels/GetFollowedChannels/FollowedChannel.cs @@ -2,30 +2,33 @@ namespace TwitchLib.Api.Helix.Models.Channels.GetFollowedChannels { - public class FollowedChannel - { - /// - /// An ID that uniquely identifies the broadcaster that this user is following. - /// - [JsonProperty(PropertyName = "broadcaster_id")] - public string BroadcasterId { get; protected set; } - - /// - /// The broadcaster’s login name. - /// - [JsonProperty(PropertyName = "broadcaster_login")] - public string BroadcasterLogin { get; protected set; } - - /// - /// The broadcaster’s display name. - /// - [JsonProperty(PropertyName = "broadcaster_name")] - public string BroadcasterName { get; protected set; } - - /// - /// The UTC timestamp when the user started following the broadcaster. - /// - [JsonProperty(PropertyName = "followed_at")] - public string FollowedAt { get; protected set; } - } + /// + /// The broadcaster a user is following. + /// + public class FollowedChannel + { + /// + /// An ID that uniquely identifies the broadcaster that this user is following. + /// + [JsonProperty(PropertyName = "broadcaster_id")] + public string BroadcasterId { get; protected set; } + + /// + /// The broadcaster’s login name. (Name is lowercase) + /// + [JsonProperty(PropertyName = "broadcaster_login")] + public string BroadcasterLogin { get; protected set; } + + /// + /// The broadcaster’s display name. (Name has capitalization) + /// + [JsonProperty(PropertyName = "broadcaster_name")] + public string BroadcasterName { get; protected set; } + + /// + /// The UTC timestamp when the user started following the broadcaster. + /// + [JsonProperty(PropertyName = "followed_at")] + public string FollowedAt { get; protected set; } + } } \ No newline at end of file diff --git a/TwitchLib.Api.Helix.Models/Channels/GetFollowedChannels/GetFollowedChannelsResponse.cs b/TwitchLib.Api.Helix.Models/Channels/GetFollowedChannels/GetFollowedChannelsResponse.cs index b4a23263..679bfdb0 100644 --- a/TwitchLib.Api.Helix.Models/Channels/GetFollowedChannels/GetFollowedChannelsResponse.cs +++ b/TwitchLib.Api.Helix.Models/Channels/GetFollowedChannels/GetFollowedChannelsResponse.cs @@ -3,26 +3,32 @@ namespace TwitchLib.Api.Helix.Models.Channels.GetFollowedChannels { - public class GetFollowedChannelsResponse - { - /// - /// The list of broadcasters that the user follows. - /// The list is in descending order by followed_at (with the most recently followed broadcaster first). - /// The list is empty if the user doesn’t follow anyone. - /// - [JsonProperty(PropertyName = "data")] - public FollowedChannel[] Data { get; protected set; } - - /// - /// Contains the information used to page through the list of results. The object is empty if there are no more pages left to page through. - /// - [JsonProperty(PropertyName = "pagination")] - public Pagination Pagination { get; protected set; } - - /// - /// The total number of broadcasters that the user follows. As someone pages through the list, the number may change as the user follows or unfollows broadcasters. - /// - [JsonProperty(PropertyName = "total")] - public int Total { get; protected set; } - } + /// + /// The response for GetFollowedChannels that returns a list of broadcasters that the specified user follows. + /// This can also return whether a user follows a specific broadcaster. + /// + public class GetFollowedChannelsResponse + { + /// + /// The list of broadcasters that the user follows. + /// The list is in descending order by followed_at, with the most recently followed broadcaster first. + /// The list is empty if the user doesn’t follow anyone. + /// + [JsonProperty(PropertyName = "data")] + public FollowedChannel[] Data { get; protected set; } + + /// + /// Contains the information used to page through the list of results. + /// The object is empty if there are no more pages left to page through. + /// + [JsonProperty(PropertyName = "pagination")] + public Pagination Pagination { get; protected set; } + + /// + /// The total number of broadcasters that the user follows. + /// As someone pages through the list, the number may change as the user follows or unfollows broadcasters. + /// + [JsonProperty(PropertyName = "total")] + public int Total { get; protected set; } + } } \ No newline at end of file diff --git a/TwitchLib.Api.Helix.Models/Channels/ModifyChannelInformation/ContentClassificationLabel.cs b/TwitchLib.Api.Helix.Models/Channels/ModifyChannelInformation/ContentClassificationLabel.cs new file mode 100644 index 00000000..84ec9d7a --- /dev/null +++ b/TwitchLib.Api.Helix.Models/Channels/ModifyChannelInformation/ContentClassificationLabel.cs @@ -0,0 +1,27 @@ +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using TwitchLib.Api.Core.Enums; + +namespace TwitchLib.Api.Helix.Models.Channels.ModifyChannelInformation +{ + /// + /// Labels that can be set for the channel's Content Classification Labels + /// + public class ContentClassificationLabel + { + /// + /// ID of the Content Classification Labels that must be added/removed from the channel. + /// Can be one of the following values: + /// DrugsIntoxication, SexualThemes, ViolentGraphic, Gambling, ProfanityVulgarity + /// + [JsonConverter(typeof(StringEnumConverter))] + [JsonProperty(PropertyName = "id")] + public ContentClassificationLabelEnum Id { get; set; } + + /// + /// Boolean flag indicating whether the label should be enabled (true) or disabled (false) for the channel. + /// + [JsonProperty(PropertyName = "is_enabled")] + public bool IsEnabled { get; set; } + } +} diff --git a/TwitchLib.Api.Helix.Models/Channels/ModifyChannelInformation/ModifyChannelInformationRequest.cs b/TwitchLib.Api.Helix.Models/Channels/ModifyChannelInformation/ModifyChannelInformationRequest.cs index e807e776..793f67d9 100644 --- a/TwitchLib.Api.Helix.Models/Channels/ModifyChannelInformation/ModifyChannelInformationRequest.cs +++ b/TwitchLib.Api.Helix.Models/Channels/ModifyChannelInformation/ModifyChannelInformationRequest.cs @@ -2,18 +2,63 @@ namespace TwitchLib.Api.Helix.Models.Channels.ModifyChannelInformation { - [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public class ModifyChannelInformationRequest - { - [JsonProperty(PropertyName = "game_id", NullValueHandling = NullValueHandling.Ignore)] - public string GameId { get; set; } - [JsonProperty(PropertyName = "title", NullValueHandling = NullValueHandling.Ignore)] - public string Title { get; set; } - [JsonProperty(PropertyName = "broadcaster_language", NullValueHandling = NullValueHandling.Ignore)] - public string BroadcasterLanguage { get; set; } - [JsonProperty(PropertyName = "delay", NullValueHandling = NullValueHandling.Ignore)] - public int? Delay { get; set; } - [JsonProperty(PropertyName = "tags", NullValueHandling = NullValueHandling.Ignore)] - public string[] Tags { get; set; } - } + /// + /// A request to update a channel's properties + /// All fields are optional but you must specify at least one field. + /// + [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] + public class ModifyChannelInformationRequest + { + /// + /// The ID of the game that the broadcaster will be playing. + /// The game will not updated if the ID is not a game ID that Twitch recognizes. + /// To unset this field, use “0” or “” (an empty string). + /// + [JsonProperty(PropertyName = "game_id", NullValueHandling = NullValueHandling.Ignore)] + public string GameId { get; set; } + + /// + /// The broadcaster’s preferred language. + /// Set the value to an ISO 639-1 two-letter language code - for example, en for English. + /// Set the value to “other” if the broadcaster’s preferred language is not a Twitch supported language. + /// The language will not updated if the language code is not a Twitch supported language. + /// + [JsonProperty(PropertyName = "broadcaster_language", NullValueHandling = NullValueHandling.Ignore)] + public string BroadcasterLanguage { get; set; } + + /// + /// The title of the broadcaster's stream. + /// You may not set this field to an empty string. + /// + [JsonProperty(PropertyName = "title", NullValueHandling = NullValueHandling.Ignore)] + public string Title { get; set; } + + /// + /// The number of seconds you want your broadcast buffered before streaming it live. The delay helps ensure fairness during competitive play. + /// The maximum delay is 900 seconds (15 minutes). + /// Only users with Partner status may set this field. + /// + [JsonProperty(PropertyName = "delay", NullValueHandling = NullValueHandling.Ignore)] + public int? Delay { get; set; } + + /// + /// A list of channel-defined tags to apply to the channel. Tags help identify the content that the channel streams. + /// A channel may specify a maximum of 10 tags. Each tag is limited to a maximum of 25 characters and may not be an empty string or contain spaces or special characters. Tags are case insensitive. For readability, consider using camelCasing or PascalCasing. + /// To remove all tags from the channel, set tags to an empty array. + /// + [JsonProperty(PropertyName = "tags", NullValueHandling = NullValueHandling.Ignore)] + public string[] Tags { get; set; } + + /// + /// List of labels that should be set as the Channel’s Content Classificiation Labels (CCL). + /// + [JsonProperty(PropertyName = "content_classification_labels", NullValueHandling = NullValueHandling.Ignore)] + public ContentClassificationLabel[] ContentClassificationLabels { get; set; } + + /// + /// Boolean flag indicating if the channel has branded content. + /// + [JsonProperty(PropertyName = "is_branded_content", NullValueHandling = NullValueHandling.Ignore)] + public bool IsBrandedContent { get; set; } + } } diff --git a/TwitchLib.Api.Helix.Models/Charity/Amount.cs b/TwitchLib.Api.Helix.Models/Charity/Amount.cs index b5fdb1aa..3b0796f3 100644 --- a/TwitchLib.Api.Helix.Models/Charity/Amount.cs +++ b/TwitchLib.Api.Helix.Models/Charity/Amount.cs @@ -2,28 +2,30 @@ namespace TwitchLib.Api.Helix.Models.Charity { - public class Amount - { - /// - /// The monetary amount. - /// The amount is specified in the currency’s minor unit. - /// For example, the minor units for USD is cents, so if the amount is $5.50 USD, value is set to 550. - /// - [JsonProperty(PropertyName = "value")] - public int? Value { get; protected set; } + /// + /// + /// + public class Amount + { + /// + /// The monetary amount specified in the currency’s minor unit. + /// For example, the minor units for USD is cents, so if the amount is $5.50 USD, value is set to 550. + /// + [JsonProperty(PropertyName = "value")] + public int? Value { get; protected set; } - /// - /// The number of decimal places used by the currency. - /// For example, USD uses two decimal places. - /// Use this number to translate value from minor units to major units by using the formula: value / 10^decimal_places - /// - [JsonProperty(PropertyName = "decimal_places")] - public int? DecimalPlaces { get; protected set; } + /// + /// The number of decimal places used by the currency.
+ /// For example, USD uses two decimal places.
+ /// Use this number to translate value from minor units to major units by using the formula: value / 10^decimal_places + ///
+ [JsonProperty(PropertyName = "decimal_places")] + public int? DecimalPlaces { get; protected set; } - /// - /// The ISO-4217 three-letter currency code that identifies the type of currency in value. - /// - [JsonProperty(PropertyName = "currency")] - public string Currency { get; protected set; } - } + /// + /// The ISO-4217 three-letter currency code that identifies the type of currency in value. + /// + [JsonProperty(PropertyName = "currency")] + public string Currency { get; protected set; } + } } diff --git a/TwitchLib.Api.Helix.Models/Charity/GetCharityCampaign/CharityCampaignResponseModel.cs b/TwitchLib.Api.Helix.Models/Charity/GetCharityCampaign/CharityCampaignResponseModel.cs index 39c105ad..3da2f504 100644 --- a/TwitchLib.Api.Helix.Models/Charity/GetCharityCampaign/CharityCampaignResponseModel.cs +++ b/TwitchLib.Api.Helix.Models/Charity/GetCharityCampaign/CharityCampaignResponseModel.cs @@ -2,67 +2,71 @@ namespace TwitchLib.Api.Helix.Models.Charity.GetCharityCampaign { - public class CharityCampaignResponseModel - { - /// - /// An ID that uniquely identifies the charity campaign. - /// - [JsonProperty(PropertyName = "id")] - public string Id { get; protected set; } + /// + /// The charity campaign a broadcaster is raising money for through their channel. + /// + public class CharityCampaignResponseModel + { + /// + /// An ID that uniquely identifies the charity campaign. + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; protected set; } - /// - /// An ID that uniquely identifies the broadcaster that’s running the campaign. - /// - [JsonProperty(PropertyName = "broadcaster_id")] - public string BroadcasterId { get; protected set; } + /// + /// An ID that uniquely identifies the broadcaster that’s running the campaign. + /// + [JsonProperty(PropertyName = "broadcaster_id")] + public string BroadcasterId { get; protected set; } - /// - /// The broadcaster’s login name. - /// - [JsonProperty(PropertyName = "broadcaster_login")] - public string BroadcasterLogin { get; protected set; } + /// + /// The broadcaster’s login name. (Name is lowercase) + /// + [JsonProperty(PropertyName = "broadcaster_login")] + public string BroadcasterLogin { get; protected set; } - /// - /// The broadcaster’s display name. - /// - [JsonProperty(PropertyName = "broadcaster_name")] - public string BroadcasterName { get; protected set; } + /// + /// The broadcaster’s display name. (Name has capitalization) + /// + [JsonProperty(PropertyName = "broadcaster_name")] + public string BroadcasterName { get; protected set; } - /// - /// The charity’s name. - /// - [JsonProperty(PropertyName = "charity_name")] - public string CharityName { get; protected set; } + /// + /// The charity’s name. + /// + [JsonProperty(PropertyName = "charity_name")] + public string CharityName { get; protected set; } - /// - /// A description of the charity. - /// - [JsonProperty(PropertyName = "charity_description")] - public string CharityDescription { get; protected set; } + /// + /// A description of the charity. + /// + [JsonProperty(PropertyName = "charity_description")] + public string CharityDescription { get; protected set; } - /// - /// A URL to an image of the charity’s logo. The image’s type is PNG and its size is 100px X 100px. - /// - [JsonProperty(PropertyName = "charity_logo")] - public string CharityLogo { get; protected set; } + /// + /// A URL to an image of the charity’s logo.
+ /// The image’s type is PNG and its size is 100px X 100px.
+ ///
+ [JsonProperty(PropertyName = "charity_logo")] + public string CharityLogo { get; protected set; } - /// - /// A URL to the charity’s website. - /// - [JsonProperty(PropertyName = "charity_website")] - public string CharityWebsite { get; protected set; } + /// + /// A URL to the charity’s website. + /// + [JsonProperty(PropertyName = "charity_website")] + public string CharityWebsite { get; protected set; } - /// - /// An object that contains the current amount of donations that the campaign has received. - /// - [JsonProperty(PropertyName = "current_amount")] - public Amount CurrentAmount { get; protected set; } + /// + /// An object that contains the current amount of donations that the campaign has received. + /// + [JsonProperty(PropertyName = "current_amount")] + public Amount CurrentAmount { get; protected set; } - /// - /// An object that contains the amount of money that the campaign is trying to raise. - /// This field may be null if the broadcaster has not defined a target goal. - /// - [JsonProperty(PropertyName = "target_amount")] - public Amount TargetAmount { get; protected set; } - } + /// + /// An object that contains the amount of money that the campaign is trying to raise. + /// This field may be null if the broadcaster has not defined a target fundraising goal. + /// + [JsonProperty(PropertyName = "target_amount")] + public Amount TargetAmount { get; protected set; } + } } diff --git a/TwitchLib.Api.Helix.Models/Charity/GetCharityCampaign/GetCharityCampaignResponse.cs b/TwitchLib.Api.Helix.Models/Charity/GetCharityCampaign/GetCharityCampaignResponse.cs index ddff4041..ee5e1ba2 100644 --- a/TwitchLib.Api.Helix.Models/Charity/GetCharityCampaign/GetCharityCampaignResponse.cs +++ b/TwitchLib.Api.Helix.Models/Charity/GetCharityCampaign/GetCharityCampaignResponse.cs @@ -2,17 +2,17 @@ namespace TwitchLib.Api.Helix.Models.Charity.GetCharityCampaign { - public class GetCharityCampaignResponse - { - /// - /// A list that contains the charity campaign that the broadcaster is currently running. - /// The array is empty if the broadcaster is not running a charity campaign; - /// The campaign information is no longer available as soon as the campaign ends. - /// - [JsonProperty(PropertyName = "data")] - public CharityCampaignResponseModel[] Data { get; protected set; } - } + /// + /// The response for the GetCharityCampaign that returns information about the charity campaign that a broadcaster is running. + /// + public class GetCharityCampaignResponse + { + /// + /// A list that contains the charity campaign that the broadcaster is currently running. + /// The array is empty if the broadcaster is not running a charity campaign. + /// The campaign information is no longer available as soon as the campaign ends. + /// + [JsonProperty(PropertyName = "data")] + public CharityCampaignResponseModel[] Data { get; protected set; } + } } - - - diff --git a/TwitchLib.Api.Helix.Models/Charity/GetCharityCampaignDonations/CharityCampaignDonationsResponseModel.cs b/TwitchLib.Api.Helix.Models/Charity/GetCharityCampaignDonations/CharityCampaignDonationsResponseModel.cs index 225501a4..58619971 100644 --- a/TwitchLib.Api.Helix.Models/Charity/GetCharityCampaignDonations/CharityCampaignDonationsResponseModel.cs +++ b/TwitchLib.Api.Helix.Models/Charity/GetCharityCampaignDonations/CharityCampaignDonationsResponseModel.cs @@ -1,46 +1,46 @@ using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.Text; namespace TwitchLib.Api.Helix.Models.Charity.GetCharityCampaignDonations { - public class CharityCampaignDonationsResponseModel - { - /// - /// An ID that identifies the donation. The ID is unique across campaigns. - /// - [JsonProperty(PropertyName = "id")] - public string Id { get; protected set; } + /// + /// Donations that users have made to the broadcaster's active charity campaign. + /// + public class CharityCampaignDonationsResponseModel + { + /// + /// An ID that identifies the donation. The ID is unique across campaigns. + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; protected set; } - /// - /// An ID that identifies the charity campaign that the donation applies to. - /// - [JsonProperty(PropertyName = "campaign_id")] - public string CampaignId { get; protected set; } + /// + /// An ID that identifies the charity campaign that the donation applies to. + /// + [JsonProperty(PropertyName = "campaign_id")] + public string CampaignId { get; protected set; } - /// - /// An ID that identifies a user that donated money to the campaign. - /// - [JsonProperty(PropertyName = "user_id")] - public string UserId { get; protected set; } + /// + /// An ID that identifies a user that donated money to the campaign. + /// + [JsonProperty(PropertyName = "user_id")] + public string UserId { get; protected set; } - /// - /// The user’s login name. - /// - [JsonProperty(PropertyName = "user_login")] - public string UserLogin { get; protected set; } + /// + /// The user’s login name. (Name is lowercase) + /// + [JsonProperty(PropertyName = "user_login")] + public string UserLogin { get; protected set; } - /// - /// The user’s display name. - /// - [JsonProperty(PropertyName = "user_name")] - public string UserName { get; protected set; } + /// + /// The user’s display name. (Name has capitalization) + /// + [JsonProperty(PropertyName = "user_name")] + public string UserName { get; protected set; } - /// - /// An object that contains the amount of money that the user donated. - /// - [JsonProperty(PropertyName = "amount")] - public Amount Amount { get; protected set; } - } + /// + /// An object that contains the amount of money that the user donated. + /// + [JsonProperty(PropertyName = "amount")] + public Amount Amount { get; protected set; } + } } diff --git a/TwitchLib.Api.Helix.Models/Charity/GetCharityCampaignDonations/GetCharityCampaignDonationsResponse.cs b/TwitchLib.Api.Helix.Models/Charity/GetCharityCampaignDonations/GetCharityCampaignDonationsResponse.cs index 5c2104a3..bc7f30e8 100644 --- a/TwitchLib.Api.Helix.Models/Charity/GetCharityCampaignDonations/GetCharityCampaignDonationsResponse.cs +++ b/TwitchLib.Api.Helix.Models/Charity/GetCharityCampaignDonations/GetCharityCampaignDonationsResponse.cs @@ -1,24 +1,27 @@ using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.Text; using TwitchLib.Api.Helix.Models.Common; namespace TwitchLib.Api.Helix.Models.Charity.GetCharityCampaignDonations { - public class GetCharityCampaignDonationsResponse - { - /// - /// A list that contains the donations that users have made to the broadcaster’s charity campaign. - /// The list is empty if the broadcaster is not currently running a charity campaign; - /// The donation information is not available after the campaign ends. - /// - [JsonProperty(PropertyName = "data")] - public CharityCampaignDonationsResponseModel[] Data { get; protected set; } - /// - /// Contains the information used to page through the list of results. - /// - [JsonProperty(PropertyName = "pagination")] - public Pagination Pagination { get; protected set; } - } + /// + /// The response for GetCharityCampaignDonations that returns a list of donations that + /// users have made to the broadcaster's active charity campaign. + /// + public class GetCharityCampaignDonationsResponse + { + /// + /// A list that contains the donations that users have made to the broadcaster’s charity campaign. + /// The list is empty if the broadcaster is not currently running a charity campaign. + /// The donation information is not available after the campaign ends. + /// + [JsonProperty(PropertyName = "data")] + public CharityCampaignDonationsResponseModel[] Data { get; protected set; } + + /// + /// Contains the information used to page through the list of results. + /// The object is empty if there are no more pages left to page through. + /// + [JsonProperty(PropertyName = "pagination")] + public Pagination Pagination { get; protected set; } + } } diff --git a/TwitchLib.Api.Helix.Models/Clips/CreateClip/CreatedClip.cs b/TwitchLib.Api.Helix.Models/Clips/CreateClip/CreatedClip.cs index 2b2fbdc7..46edc37c 100644 --- a/TwitchLib.Api.Helix.Models/Clips/CreateClip/CreatedClip.cs +++ b/TwitchLib.Api.Helix.Models/Clips/CreateClip/CreatedClip.cs @@ -2,11 +2,22 @@ namespace TwitchLib.Api.Helix.Models.Clips.CreateClip { - public class CreatedClip - { - [JsonProperty(PropertyName = "id")] - public string Id { get; protected set; } - [JsonProperty(PropertyName = "edit_url")] - public string EditUrl { get; protected set; } - } + /// + /// A Twitch clip created from CreateClip + /// + public class CreatedClip + { + /// + /// A URL that you can use to edit the clip’s title, identify the part of the clip to publish, and publish the clip. + /// The URL is valid for up to 24 hours or until the clip is published, whichever comes first. + /// + [JsonProperty(PropertyName = "edit_url")] + public string EditUrl { get; protected set; } + + /// + /// An ID that uniquely identifies the clip. + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; protected set; } + } } diff --git a/TwitchLib.Api.Helix.Models/Clips/CreateClip/CreatedClipResponse.cs b/TwitchLib.Api.Helix.Models/Clips/CreateClip/CreatedClipResponse.cs index 9b2725e6..8dd540e1 100644 --- a/TwitchLib.Api.Helix.Models/Clips/CreateClip/CreatedClipResponse.cs +++ b/TwitchLib.Api.Helix.Models/Clips/CreateClip/CreatedClipResponse.cs @@ -2,9 +2,15 @@ namespace TwitchLib.Api.Helix.Models.Clips.CreateClip { - public class CreatedClipResponse - { - [JsonProperty(PropertyName = "data")] - public CreatedClip[] CreatedClips { get; protected set; } - } + /// + /// Response for CreateClip which creates a clip from the broadcaster's stream. + /// + public class CreatedClipResponse + { + /// + /// Contains clip's ID and edit_URL that can be used to edit the clip's title, identify the part of the clip to publish, and publish the clip. + /// + [JsonProperty(PropertyName = "data")] + public CreatedClip[] CreatedClips { get; protected set; } + } } diff --git a/TwitchLib.Api.Helix.Models/Clips/GetClips/Clip.cs b/TwitchLib.Api.Helix.Models/Clips/GetClips/Clip.cs index dc7b7b35..3fbc9569 100644 --- a/TwitchLib.Api.Helix.Models/Clips/GetClips/Clip.cs +++ b/TwitchLib.Api.Helix.Models/Clips/GetClips/Clip.cs @@ -2,39 +2,109 @@ namespace TwitchLib.Api.Helix.Models.Clips.GetClips { - public class Clip - { - [JsonProperty(PropertyName = "id")] - public string Id { get; protected set; } - [JsonProperty(PropertyName = "url")] - public string Url { get; protected set; } - [JsonProperty(PropertyName = "embed_url")] - public string EmbedUrl { get; protected set; } - [JsonProperty(PropertyName = "broadcaster_id")] - public string BroadcasterId { get; protected set; } - [JsonProperty(PropertyName = "broadcaster_name")] - public string BroadcasterName { get; protected set; } - [JsonProperty(PropertyName = "creator_id")] - public string CreatorId { get; protected set; } - [JsonProperty(PropertyName = "creator_name")] - public string CreatorName { get; protected set; } - [JsonProperty(PropertyName = "video_id")] - public string VideoId { get; protected set; } - [JsonProperty(PropertyName = "game_id")] - public string GameId { get; protected set; } - [JsonProperty(PropertyName = "language")] - public string Language { get; protected set; } - [JsonProperty(PropertyName = "title")] - public string Title { get; protected set; } - [JsonProperty(PropertyName = "view_count")] - public int ViewCount { get; protected set; } - [JsonProperty(PropertyName = "created_at")] - public string CreatedAt { get; protected set; } - [JsonProperty(PropertyName = "thumbnail_url")] - public string ThumbnailUrl { get; protected set; } - [JsonProperty(PropertyName = "duration")] - public float Duration { get; protected set; } - [JsonProperty(PropertyName = "vod_offset")] - public int VodOffset { get; protected set; } - } + /// + /// A clip that was created from a broadcaster's stream. + /// + public class Clip + { + /// + /// An ID that uniquely identifies the clip. + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; protected set; } + + /// + /// A URL to the clip. + /// + [JsonProperty(PropertyName = "url")] + public string Url { get; protected set; } + + /// + /// A URL that you can use in an iframe to embed the clip. + /// + [JsonProperty(PropertyName = "embed_url")] + public string EmbedUrl { get; protected set; } + + /// + /// An ID that identifies the broadcaster that the video was clipped from. + /// + [JsonProperty(PropertyName = "broadcaster_id")] + public string BroadcasterId { get; protected set; } + + /// + /// The broadcaster’s display name. + /// + [JsonProperty(PropertyName = "broadcaster_name")] + public string BroadcasterName { get; protected set; } + + /// + /// An ID that identifies the user that created the clip. + /// + [JsonProperty(PropertyName = "creator_id")] + public string CreatorId { get; protected set; } + + /// + /// The display name of the user that created the clip. + /// + [JsonProperty(PropertyName = "creator_name")] + public string CreatorName { get; protected set; } + + /// + /// An ID that identifies the video that the clip came from. + /// This field contains an empty string if the video is not available. + /// + [JsonProperty(PropertyName = "video_id")] + public string VideoId { get; protected set; } + + /// + /// The ID of the game that was being played when the clip was created. + /// + [JsonProperty(PropertyName = "game_id")] + public string GameId { get; protected set; } + + /// + /// The ISO 639-1 two-letter language code that the broadcaster broadcasts in. For example, en for English. + /// The value is other if the broadcaster uses a language that Twitch doesn’t support. + /// + [JsonProperty(PropertyName = "language")] + public string Language { get; protected set; } + + /// + /// The title of the clip. + /// + [JsonProperty(PropertyName = "title")] + public string Title { get; protected set; } + + /// + /// The number of times the clip has been viewed. + /// + [JsonProperty(PropertyName = "view_count")] + public int ViewCount { get; protected set; } + + /// + /// The date and time of when the clip was created. The date and time is in RFC3339 format. + /// + [JsonProperty(PropertyName = "created_at")] + public string CreatedAt { get; protected set; } + + /// + /// A URL to a thumbnail image of the clip. + /// + [JsonProperty(PropertyName = "thumbnail_url")] + public string ThumbnailUrl { get; protected set; } + + /// + /// The length of the clip, in seconds. Precision is 0.1. + /// + [JsonProperty(PropertyName = "duration")] + public float Duration { get; protected set; } + + /// + /// The zero-based offset, in seconds, to where the clip starts in the video (VOD). + /// Is null if the video is not available or hasn’t been created yet from the live stream (see video_id). + /// Note that there’s a delay between when a clip is created during a broadcast and when the offset is set. During the delay period, vod_offset is null. The delay is indeterminant but is typically minutes long. + /// + [JsonProperty(PropertyName = "vod_offset")] + public int VodOffset { get; protected set; } + } } diff --git a/TwitchLib.Api.Helix.Models/Clips/GetClips/GetClipsResponse.cs b/TwitchLib.Api.Helix.Models/Clips/GetClips/GetClipsResponse.cs index 8012abf4..0d0c9983 100644 --- a/TwitchLib.Api.Helix.Models/Clips/GetClips/GetClipsResponse.cs +++ b/TwitchLib.Api.Helix.Models/Clips/GetClips/GetClipsResponse.cs @@ -3,11 +3,24 @@ namespace TwitchLib.Api.Helix.Models.Clips.GetClips { - public class GetClipsResponse - { - [JsonProperty(PropertyName = "data")] - public Clip[] Clips { get; protected set; } - [JsonProperty(PropertyName = "pagination")] - public Pagination Pagination { get; protected set; } - } + /// + /// Response for GetClips which returns one or more video clips that were captured from streams. + /// + public class GetClipsResponse + { + /// + /// The list of video clips. + /// For clips returned by game_id or broadcaster_id, the list is in descending order by view count. + /// For lists returned by id, the list is in the same order as the input IDs. + /// + [JsonProperty(PropertyName = "data")] + public Clip[] Clips { get; protected set; } + + /// + /// The information used to page through the list of results.
+ /// The object is empty if there are no more pages left to page through.
+ ///
+ [JsonProperty(PropertyName = "pagination")] + public Pagination Pagination { get; protected set; } + } } diff --git a/TwitchLib.Api.Helix.Models/Common/DateRange.cs b/TwitchLib.Api.Helix.Models/Common/DateRange.cs index ddcfa8bb..a278bd9f 100644 --- a/TwitchLib.Api.Helix.Models/Common/DateRange.cs +++ b/TwitchLib.Api.Helix.Models/Common/DateRange.cs @@ -1,13 +1,23 @@ -using System; -using Newtonsoft.Json; +using Newtonsoft.Json; +using System; namespace TwitchLib.Api.Helix.Models.Common { - public class DateRange - { - [JsonProperty(PropertyName = "started_at")] - public DateTime StartedAt { get; protected set; } - [JsonProperty(PropertyName = "ended_at")] - public DateTime EndedAt { get; protected set; } - } + /// + /// The reporting period's start and end dates + /// + public class DateRange + { + /// + /// The reporting period's start date. + /// + [JsonProperty(PropertyName = "started_at")] + public DateTime StartedAt { get; protected set; } + + /// + /// The reporting period's end date. + /// + [JsonProperty(PropertyName = "ended_at")] + public DateTime EndedAt { get; protected set; } + } } diff --git a/TwitchLib.Api.Helix.Models/Common/Pagination.cs b/TwitchLib.Api.Helix.Models/Common/Pagination.cs index 38e32463..40f00698 100644 --- a/TwitchLib.Api.Helix.Models/Common/Pagination.cs +++ b/TwitchLib.Api.Helix.Models/Common/Pagination.cs @@ -2,9 +2,19 @@ namespace TwitchLib.Api.Helix.Models.Common { - public class Pagination - { - [JsonProperty(PropertyName = "cursor")] - public string Cursor { get; protected set; } - } + /// + /// + /// Twitch Docs: Pagination + /// Contains the cusor for the page. + /// The object is empty if there are no more pages left to page through. + /// + public class Pagination + { + /// + /// The cursor used to get the next page of results. + /// Use the cursor’s value to set the after or before query parameter depending on the direction you want to page. + /// + [JsonProperty(PropertyName = "cursor")] + public string Cursor { get; protected set; } + } } diff --git a/TwitchLib.Api.Helix.Models/ContentClassificationLabels/ContentClassificationLabel.cs b/TwitchLib.Api.Helix.Models/ContentClassificationLabels/ContentClassificationLabel.cs new file mode 100644 index 00000000..1a35973a --- /dev/null +++ b/TwitchLib.Api.Helix.Models/ContentClassificationLabels/ContentClassificationLabel.cs @@ -0,0 +1,28 @@ +using Newtonsoft.Json; + +namespace TwitchLib.Api.Helix.Models.ContentClassificationLabels +{ + /// + /// The list of Content Classification Labels available. + /// + public class ContentClassificationLabel + { + /// + /// Unique identifier for the Content Classification Labels. + /// + [JsonProperty(PropertyName = "id")] + public string ID { get; set; } + + /// + /// Localized description of the Content Classification Labels. + /// + [JsonProperty(PropertyName = "description")] + public string Description { get; set; } + + /// + /// Localized name of the Content Classification Labels. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + } +} diff --git a/TwitchLib.Api.Helix.Models/ContentClassificationLabels/GetContentClassificationLabelsResponse.cs b/TwitchLib.Api.Helix.Models/ContentClassificationLabels/GetContentClassificationLabelsResponse.cs new file mode 100644 index 00000000..8aecdd7f --- /dev/null +++ b/TwitchLib.Api.Helix.Models/ContentClassificationLabels/GetContentClassificationLabelsResponse.cs @@ -0,0 +1,16 @@ +using Newtonsoft.Json; + +namespace TwitchLib.Api.Helix.Models.ContentClassificationLabels +{ + /// + /// Response from GetContentClassificationLabels which gets information about Twitch content classification labels. + /// + public class GetContentClassificationLabelsResponse + { + /// + /// A list that contains information about the available content classification labels. + /// + [JsonProperty(PropertyName = "data")] + public ContentClassificationLabel[] Data { get; protected set; } + } +} diff --git a/TwitchLib.Api.Helix/Ads.cs b/TwitchLib.Api.Helix/Ads.cs index 463ce9cb..9844a7c9 100644 --- a/TwitchLib.Api.Helix/Ads.cs +++ b/TwitchLib.Api.Helix/Ads.cs @@ -1,5 +1,5 @@ -using System.Threading.Tasks; -using Newtonsoft.Json; +using Newtonsoft.Json; +using System.Threading.Tasks; using TwitchLib.Api.Core; using TwitchLib.Api.Core.Enums; using TwitchLib.Api.Core.Interfaces; @@ -7,27 +7,33 @@ namespace TwitchLib.Api.Helix { - /// - /// Ads related APIs - /// - public class Ads : ApiBase - { - public Ads(IApiSettings settings, IRateLimiter rateLimiter, IHttpCallHandler http) : base(settings, rateLimiter, http) - { - } + /// + /// Ads related APIs + /// + public class Ads : ApiBase + { + public Ads(IApiSettings settings, IRateLimiter rateLimiter, IHttpCallHandler http) : base(settings, rateLimiter, http) + { + } - #region StartCommercial - /// - /// Starts a commercial on a specified channel. - /// Required scope: channel:edit:commercial - /// - /// - /// 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 - } + #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/Analytics.cs b/TwitchLib.Api.Helix/Analytics.cs index 07121cf4..f5563edc 100644 --- a/TwitchLib.Api.Helix/Analytics.cs +++ b/TwitchLib.Api.Helix/Analytics.cs @@ -9,142 +9,192 @@ namespace TwitchLib.Api.Helix { - /// - /// Analytics related APIs - /// - public class Analytics : ApiBase - { - public Analytics(IApiSettings settings, IRateLimiter rateLimiter, IHttpCallHandler http) : base(settings, rateLimiter, http) - { - } - - #region GetGameAnalytics - - /// - /// Gets a URL that game developers can use to download analytics reports (CSV files) for their games. The URL is valid for 5 minutes. - /// !! the Token used to call this API has to be from a member of the Org the Game is registered to !! - /// Required scope: analytics:read:games - /// - /// - /// Game ID. If this is specified, the returned URL points to an analytics report for just the specified game. - /// If this is not specified, the response includes multiple URLs (paginated), pointing to separate analytics reports for each of the authenticated user’s games. - /// - /// - /// Starting date/time for returned reports, in RFC3339 format with the hours, minutes, and seconds zeroed out and the UTC timezone: YYYY-MM-DDT00:00:00Z. - /// If this is provided, endedAt also must be specified. - /// If startedAt is earlier than the default start date, the default date is used. - /// Default: 365 days before the report was issued. The file contains one row of data per day. - /// - /// - /// Ending date/time for returned reports, in RFC3339 format with the hours, minutes, and seconds zeroed out and the UTC timezone: YYYY-MM-DDT00:00:00Z. - /// The report covers the entire ending date; e.g., if 2018-05-01T00:00:00Z is specified, the report covers up to 2018-05-01T23:59:59Z. - /// If this is provided, startedAt also must be specified. - /// If endedAt is later than the default end date, the default date is used. - /// Default: 1-2 days before the request was issued (depending on report availability). - /// - /// Maximum number of objects to return. Maximum: 100. Default: 20. - /// - /// Cursor for forward pagination: tells the server where to start fetching the next set of results, in a multi-page response. - /// This applies only to queries without gameId. - /// - /// - /// Type of analytics report that is returned. - /// Currently, this field has no affect on the response as there is only one report type. - /// If additional types were added, using this field would return only the URL for the specified report. - /// Valid values: "overview_v2". - /// - /// optional access token to override the use of the stored one in the TwitchAPI instance - /// - public Task GetGameAnalyticsAsync(string gameId = null, DateTime? startedAt = null, DateTime? endedAt = null, int first = 20, string after = null, string type = null, string accessToken = null) - { - var getParams = new List> - { - new KeyValuePair("first", first.ToString()) - }; - - if (!string.IsNullOrWhiteSpace(gameId)) - getParams.Add(new KeyValuePair("game_id", gameId)); - - if (startedAt != null && endedAt != null) - { - getParams.Add(new KeyValuePair("started_at", startedAt.Value.ToRfc3339String())); - getParams.Add(new KeyValuePair("ended_at", endedAt.Value.ToRfc3339String())); - } - - if (!string.IsNullOrWhiteSpace(type)) - getParams.Add(new KeyValuePair("type", type)); - - if (!string.IsNullOrWhiteSpace(after)) - getParams.Add(new KeyValuePair("after", after)); - - return TwitchGetGenericAsync("/analytics/games", ApiVersion.Helix, getParams, accessToken); - } - - #endregion - - #region GetExtensionAnalytics - - /// - /// Gets a URL that Extension developers can use to download analytics reports (CSV files) for their Extensions. The URL is valid for 5 minutes. - /// !! the Token used to call this API has to be from a member of the Org the Extension is registered to, or if not part of an Org, the Extension Developer !! - /// Required scope: analytics:read:extensions - /// - /// - /// Client ID value assigned to the extension when it is created. If this is specified, the returned URL points to an analytics report for just the specified extension. - /// If this is not specified, the response includes multiple URLs (paginated), pointing to separate analytics reports for each of the authenticated user’s Extensions. - /// - /// - /// Starting date/time for returned reports, in RFC3339 format with the hours, minutes, and seconds zeroed out and the UTC timezone: YYYY-MM-DDT00:00:00Z. - /// If this is provided, endedAt also must be specified. - /// If startedAt is earlier than the default start date, the default date is used. - /// Default: 365 days before the report was issued. The file contains one row of data per day. - /// - /// - /// Ending date/time for returned reports, in RFC3339 format with the hours, minutes, and seconds zeroed out and the UTC timezone: YYYY-MM-DDT00:00:00Z. - /// The report covers the entire ending date; e.g., if 2018-05-01T00:00:00Z is specified, the report covers up to 2018-05-01T23:59:59Z. - /// If this is provided, startedAt also must be specified. - /// If endedAt is later than the default end date, the default date is used. - /// Default: 1-2 days before the request was issued (depending on report availability). - /// - /// Maximum number of objects to return. Maximum: 100. Default: 20. - /// - /// Cursor for forward pagination: tells the server where to start fetching the next set of results, in a multi-page response. - /// This applies only to queries without gameId. - /// - /// - /// Type of analytics report that is returned. - /// Currently, this field has no affect on the response as there is only one report type. - /// If additional types were added, using this field would return only the URL for the specified report. - /// Valid values: "overview_v2". - /// - /// optional access token to override the use of the stored one in the TwitchAPI instance - /// - public Task GetExtensionAnalyticsAsync(string extensionId, DateTime? startedAt = null, DateTime? endedAt = null, int first = 20, string after = null, string type = null, string accessToken = null) - { - var getParams = new List> - { - new KeyValuePair("first", first.ToString()) - }; - - if (!string.IsNullOrWhiteSpace(extensionId)) - getParams.Add(new KeyValuePair("extension_id", extensionId)); - - if (startedAt != null && endedAt != null) - { - getParams.Add(new KeyValuePair("started_at", startedAt.Value.ToRfc3339String())); - getParams.Add(new KeyValuePair("ended_at", endedAt.Value.ToRfc3339String())); - } - - if (!string.IsNullOrWhiteSpace(type)) - getParams.Add(new KeyValuePair("type", type)); - - if (!string.IsNullOrWhiteSpace(after)) - getParams.Add(new KeyValuePair("after", after)); - - return TwitchGetGenericAsync("/analytics/extensions", ApiVersion.Helix, getParams, accessToken); - } - - #endregion - - } + /// + /// Analytics related APIs + /// + public class Analytics : ApiBase + { + /// + /// Analytics related APIs + /// + /// + /// + /// + public Analytics(IApiSettings settings, IRateLimiter rateLimiter, IHttpCallHandler http) : base(settings, rateLimiter, http) + { + } + + #region GetGameAnalytics + + /// + /// + /// Twitch Docs: Get Game Analytics + /// Gets a URL that game developers can use to download analytics reports (CSV files) for their games. The URL is valid for 5 minutes. + /// !! The user access token used to call this API must be from a member of the organization the game is registered to !! + /// Requires a user access token that includes the scope:
+ /// analytics:read:games
+ ///
+ /// + /// + /// The game’s client ID. + /// If specified, the response contains an analytics report for just the specified game. + /// If not specified, the response includes multiple URLs (paginated), pointing to separate analytics reports for each of the authenticated user’s games. + /// + /// + /// + /// The starting date for the analytic report time period.
+ /// (This is automtically converted to RFC3339 format)
+ /// If you specify a start date, you must also specify an end date in endedAt. + /// The start date must be within one year of today’s date.
+ /// If you specify an earlier date, the API ignores it and uses a date that’s one year prior to today’s date.
+ /// If you don’t specify a start and end date, the report includes all available data for the last 365 days from today.
+ /// The report contains one row of data for each day in the reporting window. + /// + /// + /// + /// The ending date for the analytic report time period.
+ /// (This is automatically converted to RFC3339 format)
+ /// Only specify an end date if you specified a start date. + /// Because it can take up to two days for the data to be available, you must specify an end date that’s earlier than today minus one to two days. + /// If not, the API ignores your end date and uses an end date that is today minus one to two days. + /// + /// + /// + /// The maximum number of report URLs to return per page in the response. + /// Minimum page size: 1 URL per page
+ /// Maximum page size: 100 URLs per page.
+ /// Default page size: 20 URLs per page.
+ /// While you may specify a maximum value of 100, the response will contain at most 20 URLs per page. + /// + /// + /// + /// Cursor for forward pagination: tells the server where to start fetching the next set of results, in a multi-page response. + /// This parameter is ignored if the game_id parameter is set. + /// + /// + /// + /// Type of analytics report that is returned. + /// Currently, this field has no affect on the response as there is only one report type. + /// If additional types were added, using this field would return only the URL for the specified report. + /// Valid values: "overview_v2". + /// + /// + /// + /// Optional access token to override the use of the stored one in the TwitchAPI instance. + /// + /// + public Task GetGameAnalyticsAsync(string gameId = null, DateTime? startedAt = null, DateTime? endedAt = null, int first = 20, string after = null, string type = null, string accessToken = null) + { + var getParams = new List> + { + new KeyValuePair("first", first.ToString()) + }; + + if (!string.IsNullOrWhiteSpace(gameId)) + getParams.Add(new KeyValuePair("game_id", gameId)); + + if (startedAt != null && endedAt != null) + { + getParams.Add(new KeyValuePair("started_at", startedAt.Value.ToRfc3339String())); + getParams.Add(new KeyValuePair("ended_at", endedAt.Value.ToRfc3339String())); + } + + if (!string.IsNullOrWhiteSpace(type)) + getParams.Add(new KeyValuePair("type", type)); + + if (!string.IsNullOrWhiteSpace(after)) + getParams.Add(new KeyValuePair("after", after)); + + return TwitchGetGenericAsync("/analytics/games", ApiVersion.Helix, getParams, accessToken); + } + + #endregion + + #region GetExtensionAnalytics + + /// + /// + /// Twitch Docs: Get Extension Analytics + /// Gets a URL that Extension developers can use to download analytics reports (CSV files) for their Extensions. The URL is valid for 5 minutes. + /// !! The user access token used to call this API must be from a member of the organzation the extension is registered to or the Extension Developer !! + /// Requires a user access token that includes the analytics:read:extensions scope. + /// + /// + /// + /// Client ID value assigned to the extension when it is created. + /// If this is specified, the returned URL points to an analytics report for just the specified extension. + /// If this is not specified, the response includes multiple URLs (paginated), pointing to separate analytics reports for each of the authenticated user’s Extensions. + /// + /// + /// + /// The starting date for the analytic report time period.
+ /// (This is automtically converted to RFC3339 format)
+ /// If you specify a start date, you must also specify an end date in endedAt. + /// The start date must be on or after January 31, 2018.
+ /// If you specify an earlier date, the API ignores it and uses January 31, 2018.
+ /// If you specify a start date, you must specify an end date.
+ /// If you don’t specify a start and end date, the report includes all available data since January 31, 2018.
+ /// The report contains one row of data for each day in the reporting window. + /// + /// + /// + /// The ending date for the analytic report time period.
+ /// (This is automatically converted to RFC3339 format)
+ /// Only specify an end date if you specified a start date. + /// Because it can take up to two days for the data to be available, you must specify an end date that’s earlier than today minus one to two days. + /// If not, the API ignores your end date and uses an end date that is today minus one to two days. + /// + /// + /// + /// The maximum number of report URLs to return per page in the response. + /// Minimum page size: 1 URL per page
+ /// Maximum page size: 100 URLs per page.
+ /// Default page size: 20 URLs per page.
+ /// Note: While you may specify a maximum value of 100, the response will contain at most 20 URLs per page. + /// + /// + /// + /// Cursor for forward pagination: tells the server where to start fetching the next set of results, in a multi-page response. + /// This parameter is ignored if the extension_id parameter is set. + /// + /// + /// + /// Type of analytics report that is returned. + /// Currently, this field has no affect on the response as there is only one report type. + /// If additional types were added, using this field would return only the URL for the specified report. + /// Valid values: "overview_v2". + /// + /// + /// + /// Optional access token to override the use of the stored one in the TwitchAPI instance. + /// + /// + public Task GetExtensionAnalyticsAsync(string extensionId, DateTime? startedAt = null, DateTime? endedAt = null, int first = 20, string after = null, string type = null, string accessToken = null) + { + var getParams = new List> + { + new KeyValuePair("first", first.ToString()) + }; + + if (!string.IsNullOrWhiteSpace(extensionId)) + getParams.Add(new KeyValuePair("extension_id", extensionId)); + + if (startedAt != null && endedAt != null) + { + getParams.Add(new KeyValuePair("started_at", startedAt.Value.ToRfc3339String())); + getParams.Add(new KeyValuePair("ended_at", endedAt.Value.ToRfc3339String())); + } + + if (!string.IsNullOrWhiteSpace(type)) + getParams.Add(new KeyValuePair("type", type)); + + if (!string.IsNullOrWhiteSpace(after)) + getParams.Add(new KeyValuePair("after", after)); + + return TwitchGetGenericAsync("/analytics/extensions", ApiVersion.Helix, getParams, accessToken); + } + + #endregion + + } } \ No newline at end of file diff --git a/TwitchLib.Api.Helix/ContentClassificationLabels.cs b/TwitchLib.Api.Helix/ContentClassificationLabels.cs new file mode 100644 index 00000000..35285991 --- /dev/null +++ b/TwitchLib.Api.Helix/ContentClassificationLabels.cs @@ -0,0 +1,47 @@ +using System.Collections.Generic; +using System.Threading.Tasks; +using TwitchLib.Api.Core; +using TwitchLib.Api.Core.Enums; +using TwitchLib.Api.Core.Interfaces; +using TwitchLib.Api.Helix.Models.ContentClassificationLabels; + +namespace TwitchLib.Api.Helix +{ + /// + /// ContentClassificationLabels related APIs + /// + public class ContentClassificationLabels : ApiBase + { + /// + /// + /// + /// + /// + /// + public ContentClassificationLabels(IApiSettings settings, IRateLimiter rateLimiter, IHttpCallHandler http) : base(settings, rateLimiter, http) + {} + + #region GetContentClassificationLabels + /// + /// + /// TwitchAPI Docs: Get Content Classification Labels + /// Gets information about Twitch content classification labels. + /// Requires an app access token or user access token. + /// + /// + /// + /// + public Task GetContentClassificationLabelsAsync(string locale = null, string accessToken = null) + { + var getParams = new List>(); + + if (!string.IsNullOrWhiteSpace(locale)) + { + getParams.Add(new KeyValuePair("locale", locale)); + } + + return TwitchGetGenericAsync("/content_classification_labels", ApiVersion.Helix, getParams, accessToken); + } + #endregion + } +} diff --git a/TwitchLib.Api.Helix/Helix.cs b/TwitchLib.Api.Helix/Helix.cs index f1fe5dc1..6bb2a321 100644 --- a/TwitchLib.Api.Helix/Helix.cs +++ b/TwitchLib.Api.Helix/Helix.cs @@ -6,171 +6,176 @@ namespace TwitchLib.Api.Helix { - /// - /// Contains APIs under the /helix API namespace - /// - public class Helix - { - private readonly ILogger _logger; - /// - /// API Settings like the ClientId, Client Secret and so on - /// - public IApiSettings Settings { get; } - /// - /// Analytics related Helix APIs - /// - public Analytics Analytics { get; } - /// - /// Ads related Helix APIs - /// - public Ads Ads { get; } - /// - /// Bits related Helix APIs - /// - public Bits Bits { get; } - /// - /// Chat related Helix APIs - /// - public Chat Chat { get; } - /// - /// Channel related Helix APIs - /// - public Channels Channels { get; } - /// - /// Channel Points related Helix APIs - /// - public ChannelPoints ChannelPoints { get; } - /// - /// Charity related Helix APIs - /// - public Charity Charity { get; } - /// - /// Clips related Helix APIs - /// - public Clips Clips { get; } - /// - /// Entitlements related Helix APIs - /// - public Entitlements Entitlements { get; } - /// - /// EventSub related Helix APIs - /// - public EventSub EventSub { get; } - /// - /// Extensions related Helix APIs - /// - public Extensions Extensions { get; } - /// - /// Games related Helix APIs - /// - public Games Games { get; } - /// - /// Creator Goals related Helix APIs - /// - public Goals Goals { get; } - /// - /// HypeTrain related Helix APIs - /// - public HypeTrain HypeTrain { get; } - /// - /// Moderation related Helix APIs - /// - public Moderation Moderation { get; } - /// - /// Polls related Helix APIs - /// - public Polls Polls { get; } - /// - /// Prediction related Helix APIs - /// - public Predictions Predictions { get; } - /// - /// Raids related Helix APIs - /// - public Raids Raids { get; } - /// - /// Schedule related Helix APIs - /// - public Schedule Schedule { get; } - /// - /// Search related Helix APIs - /// - public Search Search { get; } - /// - /// Soundtrack related Helix APIs - /// - public Soundtrack Soundtrack { get; } - /// - /// Stream related Helix APIs - /// - public Streams Streams { get; } - /// - /// Subscription related Helix APIs - /// - public Subscriptions Subscriptions { get; } - /// - /// Tag related Helix APIs - /// - public Tags Tags { get; } - /// - /// Stream Team related Helix APIs - /// - public Teams Teams { get; } - /// - /// Video/VOD related Helix APIs - /// - public Videos Videos { get; } - /// - /// User related Helix APIs - /// - public Users Users { get; } - /// - /// Whisper related Helix APIs - /// - public Whispers Whispers { get; } + /// + /// Contains APIs under the /helix API namespace + /// + public class Helix + { + private readonly ILogger _logger; + /// + /// API Settings like the ClientId, Client Secret and so on + /// + public IApiSettings Settings { get; } + /// + /// Analytics related Helix APIs + /// + public Analytics Analytics { get; } + /// + /// Ads related Helix APIs + /// + public Ads Ads { get; } + /// + /// Bits related Helix APIs + /// + public Bits Bits { get; } + /// + /// Chat related Helix APIs + /// + public Chat Chat { get; } + /// + /// Channel related Helix APIs + /// + public Channels Channels { get; } + /// + /// Channel Points related Helix APIs + /// + public ChannelPoints ChannelPoints { get; } + /// + /// Charity related Helix APIs + /// + public Charity Charity { get; } + /// + /// Clips related Helix APIs + /// + public Clips Clips { get; } + /// + /// Entitlements related Helix APIs + /// + public Entitlements Entitlements { get; } + /// + /// ContentClassificationLabels related Helix APIs + /// + public ContentClassificationLabels ContentClassificationLabels { get; } + /// + /// EventSub related Helix APIs + /// + public EventSub EventSub { get; } + /// + /// Extensions related Helix APIs + /// + public Extensions Extensions { get; } + /// + /// Games related Helix APIs + /// + public Games Games { get; } + /// + /// Creator Goals related Helix APIs + /// + public Goals Goals { get; } + /// + /// HypeTrain related Helix APIs + /// + public HypeTrain HypeTrain { get; } + /// + /// Moderation related Helix APIs + /// + public Moderation Moderation { get; } + /// + /// Polls related Helix APIs + /// + public Polls Polls { get; } + /// + /// Prediction related Helix APIs + /// + public Predictions Predictions { get; } + /// + /// Raids related Helix APIs + /// + public Raids Raids { get; } + /// + /// Schedule related Helix APIs + /// + public Schedule Schedule { get; } + /// + /// Search related Helix APIs + /// + public Search Search { get; } + /// + /// Soundtrack related Helix APIs + /// + public Soundtrack Soundtrack { get; } + /// + /// Stream related Helix APIs + /// + public Streams Streams { get; } + /// + /// Subscription related Helix APIs + /// + public Subscriptions Subscriptions { get; } + /// + /// Tag related Helix APIs + /// + public Tags Tags { get; } + /// + /// Stream Team related Helix APIs + /// + public Teams Teams { get; } + /// + /// Video/VOD related Helix APIs + /// + public Videos Videos { get; } + /// + /// User related Helix APIs + /// + public Users Users { get; } + /// + /// Whisper related Helix APIs + /// + public Whispers Whispers { get; } - /// - /// Creates an Instance of the Helix Class. - /// - /// Instance Of LoggerFactory, otherwise no logging is used, - /// Instance Of RateLimiter, otherwise no ratelimiter is used. - /// Instance of ApiSettings, otherwise defaults used, can be changed later - /// Instance of HttpCallHandler, otherwise default handler used - public Helix(ILoggerFactory loggerFactory = null, IRateLimiter rateLimiter = null, IApiSettings settings = null, IHttpCallHandler http = null) - { - _logger = loggerFactory?.CreateLogger(); - rateLimiter = rateLimiter ?? BypassLimiter.CreateLimiterBypassInstance(); - http = http ?? new TwitchHttpClient(loggerFactory?.CreateLogger()); - Settings = settings ?? new ApiSettings(); + /// + /// Creates an Instance of the Helix Class. + /// + /// Instance Of LoggerFactory, otherwise no logging is used. + /// Instance Of RateLimiter, otherwise no ratelimiter is used. + /// Instance of ApiSettings, otherwise defaults used. (Can be changed later) + /// Instance of HttpCallHandler, otherwise default handler used. + public Helix(ILoggerFactory loggerFactory = null, IRateLimiter rateLimiter = null, IApiSettings settings = null, IHttpCallHandler http = null) + { + _logger = loggerFactory?.CreateLogger(); + rateLimiter = rateLimiter ?? BypassLimiter.CreateLimiterBypassInstance(); + http = http ?? new TwitchHttpClient(loggerFactory?.CreateLogger()); + 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); - ChannelPoints = new ChannelPoints(Settings, rateLimiter, http); - Charity = new Charity(Settings, rateLimiter, http); - Clips = new Clips(Settings, rateLimiter, http); - Entitlements = new Entitlements(Settings, rateLimiter, http); - EventSub = new EventSub(Settings, rateLimiter, http); - Extensions = new Extensions(Settings, rateLimiter, http); - Games = new Games(Settings, rateLimiter, http); - Goals = new Goals(settings, rateLimiter, http); - HypeTrain = new HypeTrain(Settings, rateLimiter, http); - Moderation = new Moderation(Settings, rateLimiter, http); - Polls = new Polls(Settings, rateLimiter, http); - Predictions = new Predictions(Settings, rateLimiter, http); - Raids = new Raids(settings, rateLimiter, http); - Schedule = new Schedule(Settings, rateLimiter, http); - Search = new Search(Settings, rateLimiter, http); - Soundtrack = new Soundtrack(Settings, rateLimiter, http); - Streams = new Streams(Settings, rateLimiter, http); - Subscriptions = new Subscriptions(Settings, rateLimiter, http); - Tags = new Tags(Settings, rateLimiter, http); - Teams = new Teams(Settings, rateLimiter, http); - Users = new Users(Settings, rateLimiter, http); - Videos = new Videos(Settings, rateLimiter, http); - Whispers = new Whispers(Settings, rateLimiter, http); - } - } + 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); + ChannelPoints = new ChannelPoints(Settings, rateLimiter, http); + Charity = new Charity(Settings, rateLimiter, http); + Clips = new Clips(Settings, rateLimiter, http); + ContentClassificationLabels = new ContentClassificationLabels(Settings, rateLimiter, http); + Entitlements = new Entitlements(Settings, rateLimiter, http); + EventSub = new EventSub(Settings, rateLimiter, http); + Extensions = new Extensions(Settings, rateLimiter, http); + Games = new Games(Settings, rateLimiter, http); + Goals = new Goals(settings, rateLimiter, http); + HypeTrain = new HypeTrain(Settings, rateLimiter, http); + Moderation = new Moderation(Settings, rateLimiter, http); + Polls = new Polls(Settings, rateLimiter, http); + Predictions = new Predictions(Settings, rateLimiter, http); + Raids = new Raids(settings, rateLimiter, http); + Schedule = new Schedule(Settings, rateLimiter, http); + Search = new Search(Settings, rateLimiter, http); + Soundtrack = new Soundtrack(Settings, rateLimiter, http); + Streams = new Streams(Settings, rateLimiter, http); + Subscriptions = new Subscriptions(Settings, rateLimiter, http); + Tags = new Tags(Settings, rateLimiter, http); + Teams = new Teams(Settings, rateLimiter, http); + Users = new Users(Settings, rateLimiter, http); + Videos = new Videos(Settings, rateLimiter, http); + Whispers = new Whispers(Settings, rateLimiter, http); + } + } }