public async Task Given_Valid_Url_Add_Returns_Successful_Result() { var api = Helpers.ApiHelper.GetApi(); var request = new AddExpiredWebhook { Url = @$ "https://getaddress.io?test={Guid.NewGuid()}" }; var addResult = await api.Webhooks.Expired.Add(request); addResult.IsSuccess.ShouldBeTrue(); var getResult = await api.Webhooks.Expired.Get(addResult.Success.Id); getResult.IsSuccess.ShouldBeTrue(); var listResult = await api.Webhooks.Expired.Get(); listResult.IsSuccess.ShouldBeTrue(); listResult.Success.Length.ShouldBeGreaterThan(0); var removeResult = await api.Webhooks.Expired.Remove(getResult.Success.Id); removeResult.IsSuccess.ShouldBeTrue(); }
public async Task <Result <SuccessfulExpiredWebhookAdd> > Add(AddExpiredWebhook request, AccessToken accessToken = default, CancellationToken cancellationToken = default) { var nameValueCollection = request.Options?.GetNameValueCollectionOrDefault(); var requestUri = GetUri(path, nameValueCollection); return(await HttpPost <SuccessfulExpiredWebhookAdd>(requestUri, data : request, administrationOrApiKey : AdministrationKey, token : accessToken, cancellationToken : cancellationToken)); }