/// <summary> /// List the webhooks in the account. /// </summary> /// <param name="accountId">The account ID</param> /// <param name="options">Options passed to the list (sorting and /// pagination).</param> /// <returns>The list of webhooks in the account</returns> /// <see>https://developer.dnsimple.com/v2/webhooks/#listWebhooks</see> public ListResponse <Webhook> ListWebhooks(long accountId, ListWebhooksOptions options = null) { var builder = BuildRequestForPath(WebhooksPath(accountId)); AddListOptionsToRequest(options, ref builder); return(new ListResponse <Webhook>(Execute(builder.Request))); }
public void ListWebhooksSorted(long accountId, string expectedUrl) { var client = new MockDnsimpleClient(ListWebhooksFixture); var options = new ListWebhooksOptions { Pagination = new Pagination { PerPage = 42, Page = 7 } }.SortById(Order.asc); client.Webhooks.ListWebhooks(accountId, options); Assert.AreEqual(expectedUrl, client.RequestSentTo()); }