Update API

This commit is contained in:
Chris Chen
2022-09-30 09:40:42 -07:00
parent 184db15773
commit b33c0d8286
55 changed files with 3877 additions and 360 deletions
+27
View File
@@ -0,0 +1,27 @@
using System;
using System.Threading.Tasks;
namespace LineMessaging
{
public partial class LineMessagingClient
{
private const string GroupProfileApiPath = "v2/bot/group/{0}/summary";
private const string QuotaApiPath = "/v2/bot/message/quota/consumption";
public async Task<int> GetTotalUsage()
{
return Get<LineUsage>(QuotaApiPath).Result.TotalUsage;
}
public async Task<LineGroupProfile> GetGroupProfile(string groupId)
{
if (string.IsNullOrEmpty(groupId))
{
throw new ArgumentException($"{nameof(groupId)} is null or empty.");
}
return await Get<LineGroupProfile>(string.Format(GroupProfileApiPath, groupId));
}
}
}