Table of Contents

Class UpdateWebhookRequest

Namespace
Mailtrap.Webhooks.Requests
Assembly
Mailtrap.Abstractions.dll

Request object for updating a webhook. Only properties set on the request are sent.

public sealed record UpdateWebhookRequest : IValidatable, IEquatable<UpdateWebhookRequest>
Inheritance
UpdateWebhookRequest
Implements

Properties

Active

Gets or sets a value indicating whether the webhook is active.

[JsonPropertyName("active")]
[JsonPropertyOrder(2)]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public bool? Active { get; set; }

Property Value

bool?

Active flag or null to leave unchanged.

EventTypes

Gets or sets the list of event types the webhook subscribes to.
Applicable only for email_sending webhooks.
Leave null to keep the existing event types unchanged.

[JsonPropertyName("event_types")]
[JsonPropertyOrder(4)]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public IList<WebhookEventType>? EventTypes { get; set; }

Property Value

IList<WebhookEventType>

List of event types or null to leave unchanged.

PayloadFormat

Gets or sets the format of the webhook payload.

[JsonPropertyName("payload_format")]
[JsonPropertyOrder(3)]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public WebhookPayloadFormat? PayloadFormat { get; set; }

Property Value

WebhookPayloadFormat

Webhook payload format or null to leave unchanged.

Url

Gets or sets the URL that will receive webhook payloads.

[JsonPropertyName("url")]
[JsonPropertyOrder(1)]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public Uri? Url { get; set; }

Property Value

Uri

Target URL or null to leave unchanged.

Methods

Validate()

Validates the current instance.

public ValidationResult Validate()

Returns

ValidationResult

Object containing validation errors, if any.