Table of Contents

Class CreateContactEventRequest

Namespace
Mailtrap.ContactEvents.Requests
Assembly
Mailtrap.Abstractions.dll

Request object for creating a contact event.

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

Constructors

CreateContactEventRequest()

Parameterless constructor for serializers.

[JsonConstructor]
public CreateContactEventRequest()

CreateContactEventRequest(string, IDictionary<string, object?>?)

Primary instance constructor.

public CreateContactEventRequest(string name, IDictionary<string, object?>? @params = null)

Parameters

name string

.

params IDictionary<string, object>

.

Remarks

name must be 1-255 characters long.

Exceptions

ArgumentNullException

When name is null or Empty.

Properties

Name

Gets or sets the contact event name.

[JsonPropertyName("name")]
[JsonRequired]
public string Name { get; set; }

Property Value

string

Contact event name.

Params

Gets contact event params.

[JsonPropertyName("params")]
[JsonObjectCreationHandling(JsonObjectCreationHandling.Populate)]
public IDictionary<string, object?> Params { get; }

Property Value

IDictionary<string, object>

Contact event params.

Methods

Validate()

Validates the current instance.

public ValidationResult Validate()

Returns

ValidationResult

Object containing validation errors, if any.