complete NetworkServiceProvider and all associated logic
This commit is contained in:
@@ -1,16 +1,349 @@
|
||||
namespace Chtn.CSharp.SDK.Models.Network
|
||||
using Newtonsoft.Json;
|
||||
using System.Collections.Generic;
|
||||
using Chtn.CSharp.SDK.Models.Common;
|
||||
using System;
|
||||
|
||||
namespace Chtn.CSharp.SDK.Models.Network
|
||||
{
|
||||
public class CreateNetworkReq
|
||||
#region Core Network Entities
|
||||
public class Network
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public string Visibility { get; set; }
|
||||
public string UserId { get; set; }
|
||||
[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
|
||||
{
|
||||
public string ChannelId { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string Desc { get; set; }
|
||||
[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; }
|
||||
}
|
||||
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; }
|
||||
}
|
||||
#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
|
||||
}
|
||||
173
Services/NetworkMethods.cs
Normal file
173
Services/NetworkMethods.cs
Normal file
@@ -0,0 +1,173 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using Chtn.CSharp.SDK.Core;
|
||||
using Chtn.CSharp.SDK.Models.Network;
|
||||
|
||||
namespace Chtn.CSharp.SDK.Services
|
||||
{
|
||||
public interface INetworkService
|
||||
{
|
||||
// General & Discovery
|
||||
Task<NetworkInvite> CreateInvite(CreateInviteReq req);
|
||||
Task<List<NetworkInvite>> GetInvites(GetInvitesReq req);
|
||||
Task Create(CreateNetworkReq req);
|
||||
Task<List<Network>> GetNetworks(GetNetworksReq req);
|
||||
Task AcceptInvite(AcceptInviteReq req);
|
||||
Task JoinPublicNetwork(JoinPublicNetworkReq req);
|
||||
Task Leave(LeaveNetworkReq req);
|
||||
Task Delete(DeleteNetworkReq req);
|
||||
Task<Network> GetFromInvite(GetFromInviteReq req);
|
||||
Task<NetworkDiscovery> GetDiscovery();
|
||||
|
||||
// Categories
|
||||
Task CreateCategory(CreateCategoryReq req);
|
||||
Task DeleteCategory(DeleteCategoryReq req);
|
||||
Task MoveCategory(MoveCategoryReq req);
|
||||
Task EditCategory(EditCategoryReq req);
|
||||
Task ToggleCategoryMute(ToggleCategoryMuteReq req);
|
||||
|
||||
// Channels
|
||||
Task CreateChannel(CreateChannelReq req);
|
||||
Task EditChannel(EditChannelReq req);
|
||||
Task ToggleChannelMute(ToggleChannelMuteReq req);
|
||||
|
||||
// Ranks & Members
|
||||
Task CreateRank(CreateRankReq req);
|
||||
Task DeleteRank(DeleteRankReq req);
|
||||
Task MoveRank(MoveRankReq req);
|
||||
Task EditRank(EditRankReq req);
|
||||
Task AssignRankToMember(AssignRankToMemberReq req);
|
||||
Task RemoveRankFromMember(RemoveRankFromMemberReq req);
|
||||
Task<List<NetworkMember>> GetMembers(GetMembersReq req);
|
||||
|
||||
// Moderation
|
||||
Task KickMember(KickMemberReq req);
|
||||
Task BanMember(BanMemberReq req);
|
||||
Task UnbanMember(UnbanMemberReq req);
|
||||
Task<List<BannedMember>> GetBannedMembers(GetBannedMembersReq req);
|
||||
|
||||
//Permissions & Overwrites
|
||||
Task ModifyRankPermissions(ModifyPermissionsReq req);
|
||||
Task OverwritePermission(OverwritePermissionReq req);
|
||||
Task OverwriteChannelPermission(OverwriteChannelPermissionReq req);
|
||||
Task<List<PermissionOverwrite>> GetOverwrites(GetOverwritesReq req);
|
||||
Task<List<PermissionOverwrite>> GetChannelOverwrites(GetChannelOverwritesReq req);
|
||||
|
||||
// Settings & Realtime
|
||||
Task UploadNewPic(UploadNewPictureReq req);
|
||||
Task ChangeVisibility(ChangeVisibilityReq req);
|
||||
Task EditName(EditNameReq req);
|
||||
Task ToggleMute(ToggleNetworkMuteReq req);
|
||||
Task JoinWebSocketRoom(JoinWebSocketRoomReq req);
|
||||
}
|
||||
|
||||
public class NetworkServiceProvider : INetworkService
|
||||
{
|
||||
private readonly ApiClient _apiClient;
|
||||
|
||||
public NetworkServiceProvider(ApiClient apiClient)
|
||||
{
|
||||
_apiClient = apiClient ?? throw new ArgumentNullException(nameof(apiClient));
|
||||
}
|
||||
|
||||
#region General & Discovery
|
||||
public async Task<NetworkInvite> CreateInvite(CreateInviteReq req) =>
|
||||
await _apiClient.PostAsync<CreateInviteReq, NetworkInvite>("network/createInvite", req);
|
||||
public async Task<List<NetworkInvite>> GetInvites(GetInvitesReq req) =>
|
||||
await _apiClient.PostAsync<GetInvitesReq, List<NetworkInvite>>("network/invites", req);
|
||||
public async Task Create(CreateNetworkReq req) =>
|
||||
await _apiClient.PostAsync<CreateNetworkReq, object>("network/create", req);
|
||||
public async Task<List<Network>> GetNetworks(GetNetworksReq req) =>
|
||||
await _apiClient.PostAsync<GetNetworksReq, List<Network>>("network/get", req);
|
||||
public async Task AcceptInvite(AcceptInviteReq req) =>
|
||||
await _apiClient.PostAsync<AcceptInviteReq, object>("network/acceptInvite", req);
|
||||
public async Task JoinPublicNetwork(JoinPublicNetworkReq req) =>
|
||||
await _apiClient.PostAsync<JoinPublicNetworkReq, object>("network/joinNetworkDiscovery", req);
|
||||
public async Task Leave(LeaveNetworkReq req) =>
|
||||
await _apiClient.PostAsync<LeaveNetworkReq, object>("network/leave", req);
|
||||
public async Task Delete(DeleteNetworkReq req) =>
|
||||
await _apiClient.PostAsync<DeleteNetworkReq, object>("network/delete", req);
|
||||
public async Task<Network> GetFromInvite(GetFromInviteReq req) =>
|
||||
await _apiClient.PostAsync<GetFromInviteReq, Network>("network/fromInvite", req);
|
||||
public async Task<NetworkDiscovery> GetDiscovery() =>
|
||||
await _apiClient.PostAsync<object, NetworkDiscovery>("network/discovery", new { });
|
||||
#endregion
|
||||
|
||||
#region Categories
|
||||
public async Task CreateCategory(CreateCategoryReq req) =>
|
||||
await _apiClient.PostAsync<CreateCategoryReq, object>("network/createCategory", req);
|
||||
public async Task DeleteCategory(DeleteCategoryReq req) =>
|
||||
await _apiClient.PostAsync<DeleteCategoryReq, object>("network/deleteCategory", req);
|
||||
public async Task MoveCategory(MoveCategoryReq req) =>
|
||||
await _apiClient.PostAsync<MoveCategoryReq, object>("network/moveCategory", req);
|
||||
public async Task EditCategory(EditCategoryReq req) =>
|
||||
await _apiClient.PostAsync<EditCategoryReq, object>("network/editCategory", req);
|
||||
public async Task ToggleCategoryMute(ToggleCategoryMuteReq req) =>
|
||||
await _apiClient.PostAsync<ToggleCategoryMuteReq, object>("network/toggleCatMute", req);
|
||||
#endregion
|
||||
|
||||
#region Channels
|
||||
public async Task CreateChannel(CreateChannelReq req) =>
|
||||
await _apiClient.PostAsync<CreateChannelReq, object>("network/createChannel", req);
|
||||
public async Task EditChannel(EditChannelReq req) =>
|
||||
await _apiClient.PostAsync<EditChannelReq, object>("network/editChannel", req);
|
||||
public async Task ToggleChannelMute(ToggleChannelMuteReq req) =>
|
||||
await _apiClient.PostAsync<ToggleChannelMuteReq, object>("network/toggleChanMute", req);
|
||||
#endregion
|
||||
|
||||
#region Ranks & Members
|
||||
public async Task CreateRank(CreateRankReq req) =>
|
||||
await _apiClient.PostAsync<CreateRankReq, object>("network/createRank", req);
|
||||
public async Task DeleteRank(DeleteRankReq req) =>
|
||||
await _apiClient.PostAsync<DeleteRankReq, object>("network/deleteRank", req);
|
||||
public async Task MoveRank(MoveRankReq req) =>
|
||||
await _apiClient.PostAsync<MoveRankReq, object>("network/moveRank", req);
|
||||
public async Task EditRank(EditRankReq req) =>
|
||||
await _apiClient.PostAsync<EditRankReq, object>("network/editRank", req);
|
||||
public async Task AssignRankToMember(AssignRankToMemberReq req) =>
|
||||
await _apiClient.PostAsync<AssignRankToMemberReq, object>("network/assignRankToMember", req);
|
||||
public async Task RemoveRankFromMember(RemoveRankFromMemberReq req) =>
|
||||
await _apiClient.PostAsync<RemoveRankFromMemberReq, object>("network/removeRankFromMember", req);
|
||||
public async Task<List<NetworkMember>> GetMembers(GetMembersReq req) =>
|
||||
await _apiClient.PostAsync<GetMembersReq, List<NetworkMember>>("network/getMembers", req);
|
||||
#endregion
|
||||
|
||||
#region Moderation
|
||||
public async Task KickMember(KickMemberReq req) =>
|
||||
await _apiClient.PostAsync<KickMemberReq, object>("network/kickMember", req);
|
||||
public async Task BanMember(BanMemberReq req) =>
|
||||
await _apiClient.PostAsync<BanMemberReq, object>("network/banMember", req);
|
||||
public async Task UnbanMember(UnbanMemberReq req) =>
|
||||
await _apiClient.PostAsync<UnbanMemberReq, object>("network/unbanMember", req);
|
||||
public async Task<List<BannedMember>> GetBannedMembers(GetBannedMembersReq req) =>
|
||||
await _apiClient.PostAsync<GetBannedMembersReq, List<BannedMember>>("network/getBannedMembers", req);
|
||||
#endregion
|
||||
|
||||
#region Permissions & Overwrites
|
||||
public async Task ModifyRankPermissions(ModifyPermissionsReq req) =>
|
||||
await _apiClient.PostAsync<ModifyPermissionsReq, object>("network/modifyPermissions", req);
|
||||
public async Task OverwritePermission(OverwritePermissionReq req) =>
|
||||
await _apiClient.PostAsync<OverwritePermissionReq, object>("network/overwritePermission", req);
|
||||
public async Task OverwriteChannelPermission(OverwriteChannelPermissionReq req) =>
|
||||
await _apiClient.PostAsync<OverwriteChannelPermissionReq, object>("network/overwriteChannelPermission", req);
|
||||
public async Task<List<PermissionOverwrite>> GetOverwrites(GetOverwritesReq req) =>
|
||||
await _apiClient.PostAsync<GetOverwritesReq, List<PermissionOverwrite>>("network/getOverwrites", req);
|
||||
public async Task<List<PermissionOverwrite>> GetChannelOverwrites(GetChannelOverwritesReq req) =>
|
||||
await _apiClient.PostAsync<GetChannelOverwritesReq, List<PermissionOverwrite>>("network/getChannelOverwrites", req);
|
||||
#endregion
|
||||
|
||||
#region Settings & Real-time
|
||||
public async Task UploadNewPic(UploadNewPictureReq req) =>
|
||||
await _apiClient.PostAsync<UploadNewPictureReq, object>("v2/network/uploadNewPic", req);
|
||||
public async Task ChangeVisibility(ChangeVisibilityReq req) =>
|
||||
await _apiClient.PostAsync<ChangeVisibilityReq, object>("network/changeVisibility", req);
|
||||
public async Task EditName(EditNameReq req) =>
|
||||
await _apiClient.PostAsync<EditNameReq, object>("network/editName", req);
|
||||
public async Task ToggleMute(ToggleNetworkMuteReq req) =>
|
||||
await _apiClient.PostAsync<ToggleNetworkMuteReq, object>("network/toggleNetMute", req);
|
||||
public async Task JoinWebSocketRoom(JoinWebSocketRoomReq req) =>
|
||||
await _apiClient.PostAsync<JoinWebSocketRoomReq, object>("v2/network/joinWebSocketRoom", req);
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user