Files
SDK-CSharp/Models/NetworkModels.cs

352 lines
14 KiB
C#

using Newtonsoft.Json;
using System.Collections.Generic;
using Chtn.CSharp.SDK.Models.Common;
using System;
namespace Chtn.CSharp.SDK.Models.Network
{
#region Core Network Entities
public class Network
{
[JsonProperty("id")] public string Id { get; set; }
[JsonProperty("name")] public string Name { get; set; }
[JsonProperty("ownerId")] public string OwnerId { get; set; }
[JsonProperty("visibility")] public string Visibility { get; set; }
[JsonProperty("Icon")] public string Icon { get; set; }
[JsonProperty("description")] public string Description { get; set; }
}
public class NetworkMember
{
[JsonProperty("userId")] public string UserId { get; set; }
[JsonProperty("username")] public string Username { get; set; }
[JsonProperty("avatar")] public string Avatar { get; set; }
[JsonProperty("ranks")] public List<string> Ranks { get; set; }
[JsonProperty("joinedAt")] public TimeStamp JoinedAt { get; set; }
}
public class BannedMember
{
[JsonProperty("userId")] public string UserId { get; set; }
[JsonProperty("reason")] public string Reason { get; set; }
[JsonProperty("bannedBy")] public string BannedBy { get; set; }
}
public class NetworkCategory
{
[JsonProperty("id")] public string Id { get; set; }
[JsonProperty("categoryId")] public string CategoryId { get; set; }
[JsonProperty("name")] public string Name { get; set; }
[JsonProperty("type")] public string Type { get; set; }
[JsonProperty("position")] public int Position { get; set; }
}
public class NetworkChannel
{
[JsonProperty("id")] public string Id { get; set; }
[JsonProperty("categoryId")] public string CategoryId { get; set; }
[JsonProperty("name")] public string Name { get; set; }
[JsonProperty("type")] public string Type { get; set; }
[JsonProperty("position")] public int Posititon { get; set; }
}
public class NetworkRank
{
[JsonProperty("id")] public string Id { get; set; }
[JsonProperty("name")] public string Name { get; set; }
[JsonProperty("permissions")] public long Permissions { get; set; }
[JsonProperty("position")] public string Position { get; set; }
[JsonProperty("color")] public string Color { get; set; }
}
#endregion
#region Permissions & Overwrites
public class PermissionUpdate
{
[JsonProperty("id")] public string Id { get; set; }
[JsonProperty("allow")] public long Allow { get; set; }
[JsonProperty("deny")] public long Deny { get; set; }
}
public class PermissionOverwrite
{
[JsonProperty("id")] public string Id { get; set; }
[JsonProperty("type")] public string Type { get; set; }
[JsonProperty("allow")] public long Allow { get; set; }
[JsonProperty("deny")] public long Deny { get; set; }
}
public class POW // Permission Overwrite Wrapper
{
[JsonProperty("channelId")] public string ChannelId { get; set; }
[JsonProperty("overwrites")] public List<PermissionOverwrite> Overwrites { get; set; }
}
#endregion
#region General Requests
public class GetInvitesReq { [JsonProperty("networkId")] public string NetworkId { get; set; } }
public class CreateNetworkReq
{
[JsonProperty("name")] public string Name { get; set; }
[JsonProperty("visibility")] public string Visibility { get; set; }
[JsonProperty("userId")] public string UserId { get; set; }
}
public class GetNetworksReq { [JsonProperty("userId")] public string UserId { get; set; } }
public class AcceptInviteReq { [JsonProperty("inviteCode")] public string InviteCode { get; set; } }
public class JoinPublicNetworkReq { [JsonProperty("networkId")] public string NetworkId { get; set; } }
public class LeaveNetworkReq { [JsonProperty("networkId")] public string NetworkId { get; set; } }
public class DeleteNetworkReq { [JsonProperty("networkId")] public string NetworkId { get; set; } }
public class GetFromInviteReq { [JsonProperty("inviteCode")] public string InviteCode { get; set; } }
#endregion
#region Management Requests (Category, Channel, Rank)
public class CreateCategoryReq
{
[JsonProperty("networkId")] public string NetworkId { get; set; }
[JsonProperty("name")] public string Name { get; set; }
}
public class DeleteCategoryReq { [JsonProperty("categoryId")] public string CategoryId { get; set; } }
public class MoveCategoryReq
{
[JsonProperty("categoryId")] public string CategoryId { get; set; }
[JsonProperty("newPosition")] public int NewPosition { get; set; }
}
public class EditCategoryReq
{
[JsonProperty("categoryId")] public string CategoryId { get; set; }
[JsonProperty("name")] public string Name { get; set; }
}
public class CreateChannelReq
{
[JsonProperty("networkId")] public string NetworkId { get; set; }
[JsonProperty("categoryId")] public string CategoryId { get; set; }
[JsonProperty("name")] public string Name { get; set; }
[JsonProperty("type")] public string Type { get; set; }
}
public class EditChannelReq
{
[JsonProperty("channelId")] public string ChannelId { get; set; }
[JsonProperty("name")] public string Name { get; set; }
[JsonProperty("desc")] public string Desc { get; set; }
}
public class CreateRankReq
{
[JsonProperty("networkId")] public string NetworkId { get; set; }
[JsonProperty("name")] public string Name { get; set; }
}
public class DeleteRankReq
{
[JsonProperty("rankId")] public string RankId { get; set; }
}
public class MoveRankReq
{
[JsonProperty("rankId")] public string RankId { get; set; }
[JsonProperty("newPosition")] public int NewPosition { get; set; }
}
public class EditRankReq
{
[JsonProperty("rankId")] public string RankId { get; set; }
[JsonProperty("name")] public string Name { get; set; }
[JsonProperty("color")] public string Color { get; set; }
}
#endregion
#region Moderation Requests
public class GetMembersReq { [JsonProperty("networkId")] public string NetworkId { get; set; } }
public class KickMemberReq
{
[JsonProperty("networkId")] public string NetworkId { get; set; }
[JsonProperty("targetId")] public string TargetId { get; set; }
}
public class BanMemberReq
{
[JsonProperty("networkId")] public string NetworkId { get; set; }
[JsonProperty("targetId")] public string TargetId { get; set; }
[JsonProperty("reason")] public string Reason { get; set; }
}
public class UnbanMemberReq
{
[JsonProperty("networkId")] public string NetworkId { get; set; }
[JsonProperty("targetId")] public string TargetId { get; set; }
[JsonProperty("userId")] public string UserId { get; set; }
}
public class GetBannedMembersReq { [JsonProperty("networkId")] public string NetworkId { get; set; } }
public class AssignRankToMemberReq
{
[JsonProperty("rankId")] public string RankId { get; set; }
[JsonProperty("targetId")] public string TargetId { get; set; }
}
public class RemoveRankFromMemberReq
{
[JsonProperty("rankId")] public string RankId { get; set; }
[JsonProperty("targetId")] public string TargetId { get; set; }
[JsonProperty("networkId")] public string NetworkId { get; set; }
[JsonProperty("userId")] public string UserId { get; set; }
}
#endregion
#region Permission Overwrite Requests
public class ModifyPermissionsReq
{
[JsonProperty("rankId")] public string RankId { get; set; }
[JsonProperty("permissions")] public long Permissions { get; set; }
}
public class OverwritePermissionReq
{
[JsonProperty("networkId")] public string NetworkId { get; set; }
[JsonProperty("overwrite")] public PermissionOverwrite Overwrite { get; set; }
}
public class OverwriteChannelPermissionReq
{
[JsonProperty("channelId")] public string ChannelId { get; set; }
[JsonProperty("overwrite")] public PermissionOverwrite Overwrite { get; set; }
}
public class GetOverwritesReq
{
[JsonProperty("networkId")] public string NetworkId { get; set; }
}
public class GetChannelOverwritesReq
{
[JsonProperty("channelId")] public string ChannelId { get; set; }
}
#endregion
#region Misc & Settings Requests
public class UploadNewPictureReq
{
[JsonProperty("networkId")] public string NetworkId { get; set; }
[JsonProperty("data")] public byte[] Data { get; set; }
}
public class ChangeVisibilityReq
{
[JsonProperty("networkId")] public string NetworkId { get; set; }
[JsonProperty("visibility")] public string Visibility { get; set; }
}
public class EditNameReq
{
[JsonProperty("networkId")] public string NetworkId { get; set; }
[JsonProperty("name")] public string Name { get; set; }
}
public class ToggleNetworkMuteReq { [JsonProperty("networkId")] public string NetworkId { get; set; } }
public class ToggleCategoryMuteReq { [JsonProperty("categoryId")] public string CategoryId { get; set; } }
public class ToggleChannelMuteReq { [JsonProperty("channelId")] public string ChannelId { get; set; } }
public class JoinWebSocketRoomReq { [JsonProperty("networkId")] public string NetworkId { get; set; } }
#endregion
#region Discovery & Invites
public class CreateInviteReq
{
[JsonProperty("networkId")] public string NetworkId { get; set; }
[JsonProperty("maxUses")] public int MaxUses { get; set; }
[JsonProperty("expiresAt")] public long ExpiresAt { get; set; }
}
public class NetworkInvite
{
[JsonProperty("code")] public string Code { get; set; }
[JsonProperty("inviterId")] public string InviterId { get; set; }
[JsonProperty("uses")] public int Uses { get; set; } }
public class NetworkDiscovery { [JsonProperty("trending")] public List<Network> Trending { get; set; } }
#endregion
#region WebSocket Payloads (WS)
public class WSCategoryDeletedPayload { [JsonProperty("categoryId")] public string CategoryId { get; set; } }
public class WSCategoryMovedPayload
{
[JsonProperty("categoryId")] public string CategoryId { get; set; }
[JsonProperty("position")] public int Position { get; set; }
}
public class WSMemberLeftPayload
{
[JsonProperty("networkId")] public string NetworkId { get; set; }
[JsonProperty("userId")] public string UserId { get; set; }
}
public class WSRankMovedPayload
{
[JsonProperty("rankId")] public string RankId { get; set; }
[JsonProperty("position")] public int Position { get; set; }
}
public class WSKickedPayload
{
[JsonProperty("networkId")] public string NetworkId { get; set; }
[JsonProperty("userId")] public string UserId { get; set; }
}
public class WSBannedPayload
{
[JsonProperty("networkId")] public string NetworkId { get; set; }
[JsonProperty("userId")] public string UserId { get; set; }
}
public class WSModifiedPermissionsPayload
{
[JsonProperty("rankId")] public string RankId { get; set; }
[JsonProperty("permissions")] public long Permissions { get; set; }
}
public class WSOverwrittenPermissionPayload
{
[JsonProperty("id")] public string Id { get; set; }
[JsonProperty("overwrite")] public PermissionOverwrite Overwrite { get; set; }
}
public class WSEditedCategoryPayload
{
[JsonProperty("categoryId")] public string CategoryId { get; set; }
[JsonProperty("name")] public string Name { get; set; }
}
public class WSRankEditedPayload
{
[JsonProperty("rankId")] public string RankId { get; set; }
[JsonProperty("name")] public string Name { get; set; }
}
public class WSChannelRemovedPayload { [JsonProperty("channelId")] public string ChannelId { get; set; } }
public class WSEditedChannelPayload
{
[JsonProperty("channelId")] public string ChannelId { get; set; }
[JsonProperty("name")] public string Name { get; set; }
}
public class WSOverwrittenPermissionPayloadChannel
{
[JsonProperty("channelId")] public string ChannelId { get; set; }
[JsonProperty("overwrite")] public PermissionOverwrite Overwrite { get; set; }
}
public class WSRankRemovedPayload
{
[JsonProperty("networkId")] public string NetworkId { get; set; }
[JsonProperty("rankId")] public string RankId { get; set; }
}
public class WSRankRemovedFromMemberPayload
{
[JsonProperty("userId")] public string UserId { get; set; }
[JsonProperty("rankId")] public string RankId { get; set; }
}
public class WSRankAssignedToMemberPayload
{
[JsonProperty("userId")] public string UserId { get; set; }
[JsonProperty("rankId")] public string RankId { get; set; }
}
public class WSNewNetworkPicPayload
{
[JsonProperty("networkId")] public string NetworkId { get; set; }
[JsonProperty("url")] public string Url { get; set; }
}
public class WSNewVisibilityPayload
{
[JsonProperty("networkId")] public string NetworkId { get; set; }
[JsonProperty("visibility")] public string Visibility { get; set; }
}
public class WSNewNamePayload
{
[JsonProperty("networkId")] public string NetworkId { get; set; }
[JsonProperty("name")] public string Name { get; set; }
}
public class WSNewChannelPayload { [JsonProperty("channel")] public NetworkChannel Channel { get; set; } }
#endregion
}