Inital Commit
This commit is contained in:
43
TwitchDesktopNotifications/JsonStructure/Authentication.cs
Normal file
43
TwitchDesktopNotifications/JsonStructure/Authentication.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
17
TwitchDesktopNotifications/JsonStructure/Helix/Pagination.cs
Normal file
17
TwitchDesktopNotifications/JsonStructure/Helix/Pagination.cs
Normal 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; }
|
||||
}
|
||||
}
|
||||
17
TwitchDesktopNotifications/JsonStructure/Helix/Streams.cs
Normal file
17
TwitchDesktopNotifications/JsonStructure/Helix/Streams.cs
Normal 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; }
|
||||
}
|
||||
}
|
||||
@@ -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; }
|
||||
}
|
||||
}
|
||||
17
TwitchDesktopNotifications/JsonStructure/Helix/User.cs
Normal file
17
TwitchDesktopNotifications/JsonStructure/Helix/User.cs
Normal 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; }
|
||||
}
|
||||
}
|
||||
47
TwitchDesktopNotifications/JsonStructure/Helix/UserData.cs
Normal file
47
TwitchDesktopNotifications/JsonStructure/Helix/UserData.cs
Normal 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; }
|
||||
}
|
||||
}
|
||||
@@ -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; }
|
||||
}
|
||||
}
|
||||
@@ -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; }
|
||||
|
||||
}
|
||||
}
|
||||
21
TwitchDesktopNotifications/JsonStructure/Store.cs
Normal file
21
TwitchDesktopNotifications/JsonStructure/Store.cs
Normal 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; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user