public async Task <GetFirstLimitReachedWebhookResponse> Get(GetFirstLimitReachedRequest request) { return(await Get(Api, Path, AdminKey, request)); }
public async static Task <GetFirstLimitReachedWebhookResponse> Get(GetAddesssApi api, string path, AdminKey adminKey, GetFirstLimitReachedRequest request) { if (api == null) { throw new ArgumentNullException(nameof(api)); } if (path == null) { throw new ArgumentNullException(nameof(path)); } if (adminKey == null) { throw new ArgumentNullException(nameof(adminKey)); } if (request == null) { throw new ArgumentNullException(nameof(request)); } var fullPath = path + request.Id; api.SetAuthorizationKey(adminKey); var response = await api.Get(fullPath); var body = await response.Content.ReadAsStringAsync(); if (response.IsSuccessStatusCode) { var webhook = GetFirstLimitWebhook(body); return(new GetFirstLimitReachedWebhookResponse.Success((int)response.StatusCode, response.ReasonPhrase, body, webhook.Id, webhook.Url)); } return(new GetFirstLimitReachedWebhookResponse.Failed((int)response.StatusCode, response.ReasonPhrase, body)); }
public async static Task <GetFirstLimitReachedWebhookResponse> Get(GetAddesssApi api, string path, AdminKey adminKey, GetFirstLimitReachedRequest request) { var result = await Get(api, path, adminKey, new GetWebhookRequest(request.Id)); return(result.FormerResult()); }