Inital Commit

This commit is contained in:
Martin Barker
2023-01-27 23:36:55 +00:00
parent f0dfb9a1a8
commit ac4b022587
20 changed files with 926 additions and 0 deletions

View File

@@ -0,0 +1,43 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.Json.Serialization;
using System.Threading.Tasks;
namespace TwitchDesktopNotifications.JsonStructure
{
internal class Authentication
{
[JsonPropertyName("access_token")]
public string AccessToken { get; set; }
[JsonPropertyName("expires_in")]
public int ExpiresSeconds { get; set; }
[JsonPropertyName("refresh_token")]
public string RefreshToken { get; set; }
[JsonPropertyName("scope")]
public List<string> Scopes { get; set; }
[JsonPropertyName("token_type")]
public string TokenType { get; set; }
[JsonPropertyName("expiresAt")]
public long ExpiresAt { get; set; }
[JsonIgnore]
public DateTime ExpiresAsDate {
get
{
return (new DateTime(1970, 1, 1)).AddMilliseconds(ExpiresAt);
}
set
{
DateTime unixStart = DateTime.SpecifyKind(new DateTime(1970, 1, 1), DateTimeKind.Utc);
ExpiresAt = (long)Math.Floor((value.ToUniversalTime() - unixStart).TotalMilliseconds);
}
}
}
}

View File

@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.Json.Serialization;
using System.Threading.Tasks;
namespace TwitchDesktopNotifications.JsonStructure.Helix
{
internal class Pagination
{
public Pagination() { }
[JsonPropertyName("cursor")]
public string Cursor { get; set; }
}
}

View File

@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.Json.Serialization;
using System.Threading.Tasks;
namespace TwitchDesktopNotifications.JsonStructure.Helix
{
internal class Streams
{
public Streams() { }
[JsonPropertyName("data")]
public List<StreamsData> Data { get; set; }
}
}

View File

@@ -0,0 +1,29 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.Json.Serialization;
using System.Threading.Tasks;
namespace TwitchDesktopNotifications.JsonStructure.Helix
{
internal class StreamsData
{
public StreamsData() { }
[JsonPropertyName("user_id")]
public string UserId { get; set; }
[JsonPropertyName("user_name")]
public string DisplayName { get; set; }
[JsonPropertyName("type")]
public string Type { get; set; }
[JsonPropertyName("title")]
public string Title { get; set; }
[JsonPropertyName("thumbnail_url")]
public string ThumbnailImg { get; set; }
}
}

View File

@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.Json.Serialization;
using System.Threading.Tasks;
namespace TwitchDesktopNotifications.JsonStructure.Helix
{
internal class User
{
public User() { }
[JsonPropertyName("data")]
public List<UserData> Data { get; set; }
}
}

View File

@@ -0,0 +1,47 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.Json.Serialization;
using System.Threading.Tasks;
namespace TwitchDesktopNotifications.JsonStructure.Helix
{
internal class UserData
{
public UserData() { }
[JsonPropertyName("id")]
public string UserId { get; set; }
[JsonPropertyName("login")]
public string UserName { get; set; }
[JsonPropertyName("display_name")]
public string DisplayName { get; set; }
[JsonPropertyName("type")]
public string Type { get; set; }
[JsonPropertyName("broadcaster_type")]
public string BroadcasterType { get; set; }
[JsonPropertyName("description")]
public string Description { get; set; }
[JsonPropertyName("profile_image_url")]
public string ProfileImage { get; set; }
[JsonPropertyName("offline_image_url")]
public string OfflineImage { get; set; }
[JsonPropertyName("view_count")]
public int TotalViewers { get; set; }
[JsonPropertyName("email")]
public string EMail { get; set; }
[JsonPropertyName("created_at")]
public string CreatedISODate { get; set; }
}
}

View File

@@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.Json.Serialization;
using System.Threading.Tasks;
namespace TwitchDesktopNotifications.JsonStructure.Helix
{
internal class UserFollows
{
public UserFollows() { }
[JsonPropertyName("data")]
public List<UsersFollowsData> results { get; set; }
[JsonPropertyName("pagination")]
public Pagination Pagination { get; set; }
}
}

View File

@@ -0,0 +1,36 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.Json.Serialization;
using System.Threading.Tasks;
namespace TwitchDesktopNotifications.JsonStructure.Helix
{
internal class UsersFollowsData
{
public UsersFollowsData() { }
[JsonPropertyName("from_id")]
public string FromID { get; set; }
[JsonPropertyName("from_login")]
public string FromUserName { get; set; }
[JsonPropertyName("from_name")]
public string FromDisplayName { get; set; }
[JsonPropertyName("to_id")]
public string ToID { get; set; }
[JsonPropertyName("to_login")]
public string ToUserName { get; set; }
[JsonPropertyName("to_name")]
public string ToDisplayName { get; set; }
[JsonPropertyName("followed_at")]
public string FollowedISODateTime { get; set; }
}
}

View File

@@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.Json.Serialization;
using System.Threading.Tasks;
using TwitchDesktopNotifications.JsonStructure.Helix;
namespace TwitchDesktopNotifications.JsonStructure
{
internal class Store
{
public Store() { }
[JsonPropertyName("authentication")]
public Authentication Authentication { get; set; }
[JsonPropertyName("user_data")]
public UserData UserData { get; set; }
}
}