Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Summaries to API Models & Added ContentClassificiationLabel API Endpoint #366

Merged
merged 21 commits into from
Jul 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
f8abb38
- Added summaries to Ad Models
koishibuh Jul 19, 2023
09a6630
- Added summaries to GetCheermote models
koishibuh Jul 19, 2023
6894abb
- Added summaries to CreateClip models
koishibuh Jul 19, 2023
6800786
- Rearranged CreatedClip model properties to match Twitch API docs fo…
koishibuh Jul 19, 2023
1527623
- Added summaries for GetClips models
koishibuh Jul 19, 2023
8a247bd
- Added summaries to GetChannelEditors Models
koishibuh Jul 20, 2023
baac0cf
- Added summaries to GetChannelInformation models
koishibuh Jul 20, 2023
31c16a7
- Rerranged ChannelInformation properties to match TwitchAPI document…
koishibuh Jul 20, 2023
3dea346
- Added new ContentClassificationLabel & IsBrandedContent properties …
koishibuh Jul 20, 2023
1457436
- Updated the GetChannelVIPs models
koishibuh Jul 20, 2023
7cccadb
- Updated the GetFollowedChannel models
koishibuh Jul 20, 2023
0947954
- Added summary to ModifyChannelInformation model
koishibuh Jul 20, 2023
86e485e
- Rearranged the ModifyChannelInformation model to match TwitchAPI docs
koishibuh Jul 20, 2023
0ef3e75
- Added the ContentClassificationLabel to the ModifyChannelInformatio…
koishibuh Jul 20, 2023
43dc5b7
- Updated summaries for GetCharityCampaign & GetCharityCampaignDonations
koishibuh Jul 20, 2023
ceae857
- Added a string converter to the ContentClassificationLabel
koishibuh Jul 21, 2023
7b18ca2
- Added ContentClassificationLabel to the Helix class
koishibuh Jul 21, 2023
d329824
- Updated Summary for Ad EndPoints & Ad model
koishibuh Jul 21, 2023
9326100
- Added summary to Pagination model
koishibuh Jul 21, 2023
b5ff96d
- Update summary for Analytics
koishibuh Jul 21, 2023
ddeeb6a
- Added missing Pagination property in GetExtensionAnalyticsResponse
koishibuh Jul 21, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions TwitchLib.Api.Core.Enums/ContentClassificationLabelEnum.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
namespace TwitchLib.Api.Core.Enums
{
/// <summary>
/// <para>Enum representing the Content Classification Labels.</para>
/// </summary>
public enum ContentClassificationLabelEnum
{
/// <summary>
/// <para>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.</para>
/// </summary>
DrugsIntoxication,

/// <summary>
/// <para>Content Classification Label for broadcasts with content that focuses on
/// sexualized physical attributes and activities, sexual topics, or experiences.</para>
/// </summary>
SexualThemes,

/// <summary>
/// <para>Content Classification Label for broadcasts with simulations and/or depictions
/// of realistic violence, gore, extreme injury, or death.</para>
/// </summary>
ViolentGraphic,

/// <summary>
/// <para>Content Classification Label for broadcasts that participate in online or
/// in-person gambling, poker or fantasy sports, that involve the exchange of real money.</para>
/// </summary>
Gambling,

/// <summary>
/// <para>Content Classification Label for broadcasts with prolonged, and repeated use
/// of obscenities, profanities, and vulgarities, especially as a regular part of speech.</para>
/// </summary>
ProfanityVulgarity
}
}
29 changes: 21 additions & 8 deletions TwitchLib.Api.Helix.Models/Ads/StartCommercialRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
}
}
/// <summary>
/// <para>Request Body for StartCommercial</para>
/// </summary>
public class StartCommercialRequest
{
/// <summary>
/// <para>The ID of the partner or affiliate broadcaster that wants to run the commercial.</para>
/// <para><b>This ID must match the user ID found in the OAuth token.</b></para>
/// </summary>
[JsonProperty(PropertyName = "broadcaster_id")]
public string BroadcasterId { get; set; }

/// <summary>
/// <para> The length of the commercial to run, in seconds.</para>
/// <para> 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.</para>
/// </summary>
[JsonProperty(PropertyName = "length")]
public int Length { get; set; }
}
}
33 changes: 24 additions & 9 deletions TwitchLib.Api.Helix.Models/Ads/StartCommercialResponse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
}
/// <summary>
/// The response for starting a commercial on a specified channel.
/// </summary>
public class StartCommercialResponse
{
/// <summary>
/// The length of the commercial you requested.
/// If you request a commercial that’s longer than 180 seconds, the API uses 180 seconds.
/// </summary>
[JsonProperty(PropertyName = "length")]
public int Length { get; protected set; }

/// <summary>
/// A message that indicates whether Twitch was able to serve an ad.
/// </summary>
[JsonProperty(PropertyName = "message")]
public string Message { get; protected set; }

/// <summary>
/// The number of seconds you must wait before running another commercial.
/// </summary>
[JsonProperty(PropertyName = "retry_after")]
public int RetryAfter { get; protected set; }
}
}
41 changes: 30 additions & 11 deletions TwitchLib.Api.Helix.Models/Analytics/ExtensionAnalytics.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
}
/// <summary>
/// <para>A analytic report for an extension.</para>
/// </summary>
public class ExtensionAnalytics
{
/// <summary>
/// <para>An ID that identifies the extension that the analytic report was generated for.</para>
/// </summary>
[JsonProperty(PropertyName = "extension_id")]
public string ExtensionId { get; protected set; }

/// <summary>
/// <para>The URL that you use to download the analytic report.</para>
/// <para><b>The URL is valid for 5 minutes.</b></para>
/// </summary>
[JsonProperty(PropertyName = "URL")]
public string Url { get; protected set; }

/// <summary>
/// <para>The type of analytic report.</para>
/// </summary>
[JsonProperty(PropertyName = "type")]
public string Type { get; protected set; }

/// <summary>
/// <para>The reporting period�s start and end dates.</para>
/// </summary>
[JsonProperty(PropertyName = "date_range")]
public DateRange DateRange { get; protected set; }
}
}
41 changes: 30 additions & 11 deletions TwitchLib.Api.Helix.Models/Analytics/GameAnalytics.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
}
/// <summary>
/// <para></para>
/// </summary>
public class GameAnalytics
{
/// <summary>
/// <para>An ID that identifies the game that the analytic report was generated for.</para>
/// </summary>
[JsonProperty(PropertyName = "game_id")]
public string GameId { get; protected set; }

/// <summary>
/// <para>The URL that you use to download the analytic report.</para>
/// <para><b>The URL is valid for 5 minutes.</b></para>
/// </summary>
[JsonProperty(PropertyName = "URL")]
public string Url { get; protected set; }

/// <summary>
/// <para>The type of analytic report.</para>
/// </summary>
[JsonProperty(PropertyName = "type")]
public string Type { get; protected set; }

/// <summary>
/// <para>The reporting period’s start and end dates.</para>
/// </summary>
[JsonProperty(PropertyName = "date_range")]
public DateRange DateRange { get; protected set; }
}
}
Original file line number Diff line number Diff line change
@@ -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; }
}
/// <summary>
/// <para>The response for GetExtensionAnalytics that gets a list of analytic reports for one or more extensions.</para>
/// <para>The response contains the URLs used to download the reports (CSV files) and the URLs are only valid for 5 minutes.</para>
/// </summary>
public class GetExtensionAnalyticsResponse
{
/// <summary>
/// <para>A list of analytic reports for the extensions.</para>
/// <para>The reports are returned in no particular order; however, the data within each report is in ascending order by date (newest first).</para>
/// <para>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.</para>
/// <para>The array is empty if there are no reports.</para>
/// </summary>
[JsonProperty(PropertyName = "data")]
public ExtensionAnalytics[] Data { get; protected set; }

/// <summary>
/// <para>Contains the information used to page through the list of results.</para>
/// <para>The object is empty if there are no more pages left to page through.</para>
/// <para>Use the cursor to set the GetExtensionAnalytics request’s after query parameter.</para>
/// </summary>
[JsonProperty(PropertyName = "pagination")]
public Pagination Pagination { get; protected set; }
}
}
31 changes: 24 additions & 7 deletions TwitchLib.Api.Helix.Models/Analytics/GetGameAnalyticsResponse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
}
/// <summary>
/// <para>Response for GetGameAnalytics which gets gets a list of analytic reports for one or more games.</para>
/// <para>The response contains the URLs used to download the reports (CSV files) and the URLs are only valid for 5 minutes.</para>
/// </summary>
public class GetGameAnalyticsResponse
{
/// <summary>
/// <para>A list of game analytics reports.</para>
/// <para>The reports are returned in no particular order; however, the data within each report is in ascending order by date (newest first).</para>
/// <para>The report contains one row of data per day of the reporting window and only contains rows the days that the game was used.</para>
/// <para>A report is available only if the game was broadcast for at least 5 hours over the reporting period.</para>
/// <para>The array is empty if there are no reports.</para>
/// </summary>
[JsonProperty(PropertyName = "data")]
public GameAnalytics[] Data { get; protected set; }

/// <summary>
/// <para>Contains the information used to page through the list of results.</para>
/// <para>The object is empty if there are no more pages left to page through.</para>
/// <para>Use the cursor to set the GetGameAnalytics request’s after query parameter.</para>
/// </summary>
[JsonProperty(PropertyName = "pagination")]
public Pagination Pagination { get; protected set; }
}
}
76 changes: 58 additions & 18 deletions TwitchLib.Api.Helix.Models/Bits/Cheermote.cs
Original file line number Diff line number Diff line change
@@ -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; }
}
{ /// <summary>
/// Cheermotes are animated emotes that viewers can assign Bits to and can be used in any Bits-enabled channel’s chat room.
/// </summary>
public class Cheermote
{
/// <summary>
/// <para>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}.</para>
/// 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.
/// </summary>
[JsonProperty(PropertyName = "prefix")]
public string Prefix { get; protected set; }

/// <summary>
/// <para>A list of tier levels that the Cheermote supports.</para>
/// <para>Each tier identifies the range of Bits that you can cheer at that tier level and an image that graphically identifies the tier level.</para>
/// </summary>
[JsonProperty(PropertyName = "tiers")]
public Tier[] Tiers { get; protected set; }

/// <summary>
/// <para>The type of Cheermote. Possible values are:</para>
/// <para>global_first_party - A Twitch-defined Cheermote that is shown in the Bits card.</para>
/// <para>global_third_party - A Twitch-defined Cheermote that is not shown in the Bits card. </para>
/// <para>channel_custom - A broadcaster-defined Cheermote.</para>
/// <para>display_only - Do not use; for internal use only.</para>
/// <para>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.</para>
/// </summary>
[JsonProperty(PropertyName = "type")]
public string Type { get; protected set; }

/// <summary>
/// <para>The order that the Cheermotes are shown in the Bits card.</para>
/// <para>The numbers may not be consecutive.
/// For example, the numbers may jump from 1 to 7 to 13.</para>
/// <para>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.</para>
/// </summary>
[JsonProperty(PropertyName = "order")]
public int Order { get; protected set; }

/// <summary>
/// The date and time when this Cheermote was last updated.
/// </summary>
[JsonProperty(PropertyName = "last_updated")]
public DateTime LastUpdated { get; protected set; }

/// <summary>
/// A Boolean value that indicates whether this Cheermote provides a charitable contribution match during charity campaigns.
/// </summary>
[JsonProperty(PropertyName = "is_charitable")]
public bool IsCharitable { get; protected set; }
}
}
16 changes: 11 additions & 5 deletions TwitchLib.Api.Helix.Models/Bits/GetCheermotesResponse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,15 @@

namespace TwitchLib.Api.Helix.Models.Bits
{
public class GetCheermotesResponse
{
[JsonProperty(PropertyName = "data")]
public Cheermote[] Listings { get; protected set; }
}
/// <summary>
/// Response from GetCheermotes which gets a list of Cheermotes that users can use to cheer Bits in any Bits-enabled channel’s chat room.
/// </summary>
public class GetCheermotesResponse
{
/// <summary>
/// The list of Cheermotes. The list is in ascending order by the order field’s value.
/// </summary>
[JsonProperty(PropertyName = "data")]
public Cheermote[] Listings { get; protected set; }
}
}
Loading