28 lines
780 B
C#
28 lines
780 B
C#
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));
|
|
}
|
|
}
|
|
}
|