Update API
This commit is contained in:
@@ -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));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user