/// <summary> /// Updates the given <see cref="Webhook"/>. /// </summary> /// <param name="webhookId">Id of the object being updated.</param> /// <param name="webhook">The <see cref="Webhook"/> to update.</param> /// <param name="cancellationToken">Cancellation Token</param> /// <returns>The updated <see cref="Webhook"/>.</returns> public virtual async Task <Entities.Webhook> UpdateAsync(long webhookId, Entities.Webhook webhook, CancellationToken cancellationToken = default) { return(await ExecutePutAsync <Entities.Webhook>($"webhooks/{webhookId}.json", "webhook", cancellationToken, new { webhook = webhook })); }
/// <summary> /// Creates a new <see cref="Webhook"/> on the store. /// </summary> /// <param name="webhook">A new <see cref="Webhook"/>. Id should be set to null.</param> /// <param name="cancellationToken">Cancellation Token</param> /// <returns>The new <see cref="Webhook"/>.</returns> public virtual async Task <Entities.Webhook> CreateAsync(Entities.Webhook webhook, CancellationToken cancellationToken = default) { return(await ExecutePostAsync <Entities.Webhook>("webhooks.json", "webhook", cancellationToken, new { webhook = webhook })); }