Class WebhookNewAttachmentPayload
NEW_ATTACHMENT webhook payload. Sent to your webhook url endpoint via HTTP POST when an email is received by the inbox that your webhook is attached to that contains an attachment. You can use the attachmentId to download the attachment.
Implements
Inherited Members
Namespace: mailslurp.Model
Assembly: mailslurp.dll
Syntax
[DataContract(Name = "WebhookNewAttachmentPayload")]
public class WebhookNewAttachmentPayload : IEquatable<WebhookNewAttachmentPayload>, IValidatableObject
Constructors
View SourceWebhookNewAttachmentPayload()
Initializes a new instance of the WebhookNewAttachmentPayload class.
Declaration
[JsonConstructor]
protected WebhookNewAttachmentPayload()
WebhookNewAttachmentPayload(string, Guid, string, EventNameEnum, string, string, string, long)
Initializes a new instance of the WebhookNewAttachmentPayload class.
Declaration
public WebhookNewAttachmentPayload(string messageId = null, Guid webhookId = default, string webhookName = null, WebhookNewAttachmentPayload.EventNameEnum eventName = (WebhookNewAttachmentPayload.EventNameEnum)0, string attachmentId = null, string name = null, string contentType = null, long contentLength = 0)
Parameters
Type | Name | Description |
---|---|---|
string | messageId | Idempotent message ID. Store this ID locally or in a database to prevent message duplication. (required). |
System.Guid | webhookId | ID of webhook entity being triggered (required). |
string | webhookName | Name of the webhook being triggered. |
WebhookNewAttachmentPayload.EventNameEnum | eventName | Name of the event type webhook is being triggered for. (required). |
string | attachmentId | ID of attachment. Use the |
string | name | Filename of the attachment if present (required). |
string | contentType | Content type of attachment such as 'image/png' or 'application/pdf (required). |
long | contentLength | Size of attachment in bytes (required). |
Properties
View SourceAttachmentId
ID of attachment. Use the AttachmentController
to
Declaration
[DataMember(Name = "attachmentId", IsRequired = true, EmitDefaultValue = true)]
public string AttachmentId { get; set; }
Property Value
Type | Description |
---|---|
string | ID of attachment. Use the |
ContentLength
Size of attachment in bytes
Declaration
[DataMember(Name = "contentLength", IsRequired = true, EmitDefaultValue = true)]
public long ContentLength { get; set; }
Property Value
Type | Description |
---|---|
long | Size of attachment in bytes |
ContentType
Content type of attachment such as 'image/png' or 'application/pdf
Declaration
[DataMember(Name = "contentType", IsRequired = true, EmitDefaultValue = true)]
public string ContentType { get; set; }
Property Value
Type | Description |
---|---|
string | Content type of attachment such as 'image/png' or 'application/pdf |
EventName
Name of the event type webhook is being triggered for.
Declaration
[DataMember(Name = "eventName", IsRequired = true, EmitDefaultValue = true)]
public WebhookNewAttachmentPayload.EventNameEnum EventName { get; set; }
Property Value
Type | Description |
---|---|
WebhookNewAttachmentPayload.EventNameEnum | Name of the event type webhook is being triggered for. |
MessageId
Idempotent message ID. Store this ID locally or in a database to prevent message duplication.
Declaration
[DataMember(Name = "messageId", IsRequired = true, EmitDefaultValue = true)]
public string MessageId { get; set; }
Property Value
Type | Description |
---|---|
string | Idempotent message ID. Store this ID locally or in a database to prevent message duplication. |
Name
Filename of the attachment if present
Declaration
[DataMember(Name = "name", IsRequired = true, EmitDefaultValue = true)]
public string Name { get; set; }
Property Value
Type | Description |
---|---|
string | Filename of the attachment if present |
WebhookId
ID of webhook entity being triggered
Declaration
[DataMember(Name = "webhookId", IsRequired = true, EmitDefaultValue = true)]
public Guid WebhookId { get; set; }
Property Value
Type | Description |
---|---|
System.Guid | ID of webhook entity being triggered |
WebhookName
Name of the webhook being triggered
Declaration
[DataMember(Name = "webhookName", EmitDefaultValue = true)]
public string WebhookName { get; set; }
Property Value
Type | Description |
---|---|
string | Name of the webhook being triggered |
Methods
View SourceEquals(WebhookNewAttachmentPayload)
Returns true if WebhookNewAttachmentPayload instances are equal
Declaration
public bool Equals(WebhookNewAttachmentPayload input)
Parameters
Type | Name | Description |
---|---|---|
WebhookNewAttachmentPayload | input | Instance of WebhookNewAttachmentPayload to be compared |
Returns
Type | Description |
---|---|
bool | Boolean |
Equals(object)
Returns true if objects are equal
Declaration
public override bool Equals(object input)
Parameters
Type | Name | Description |
---|---|---|
object | input | Object to be compared |
Returns
Type | Description |
---|---|
bool | Boolean |
Overrides
View SourceGetHashCode()
Gets the hash code
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
int | Hash code |
Overrides
View SourceToJson()
Returns the JSON string presentation of the object
Declaration
public virtual string ToJson()
Returns
Type | Description |
---|---|
string | JSON string presentation of the object |
ToString()
Returns the string presentation of the object
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
string | String presentation of the object |
Overrides
Validate(ValidationContext)
To validate all properties of the instance
Declaration
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
Parameters
Type | Name | Description |
---|---|---|
ValidationContext | validationContext | Validation context |
Returns
Type | Description |
---|---|
IEnumerable<ValidationResult> | Validation Result |