Skip to content
Merged
Show file tree
Hide file tree
Changes from 18 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/WireMock.Net.Abstractions/IRequestMessage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public interface IRequestMessage
/// The original body as MimeMessage.
/// Convenience getter for Handlebars and WireMockAssertions.
/// </summary>
object? BodyAsMimeMessage { get; }
Models.Mime.IMimeMessageData? BodyAsMimeMessage { get; }
#endif

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
// Copyright © WireMock.Net

using System;

namespace WireMock.Models.Mime;

/// <summary>
/// An interface exposing the public, readable properties of a ContentDisposition.
/// </summary>
public interface IContentDispositionData
{
/// <summary>
/// Get the disposition.
/// </summary>
/// <value>The disposition.</value>
string Disposition { get; }

/// <summary>
/// Get a value indicating whether the <see cref="IMimeEntityData"/> is an attachment.
/// </summary>
/// <value><see langword="true" /> if the <see cref="IMimeEntityData"/> is an attachment; otherwise, <see langword="false" />.</value>
bool IsAttachment { get; }

/// <summary>
/// Get the list of parameters on the ContentDisposition.
/// </summary>
/// <value>The parameters.</value>
object Parameters { get; }

/// <summary>
/// Get the name of the file.
/// </summary>
/// <value>The name of the file.</value>
string FileName { get; }

/// <summary>
/// Get the creation-date parameter.
/// </summary>
/// <value>The creation date.</value>
DateTimeOffset? CreationDate { get; }

/// <summary>
/// Get the modification-date parameter.
/// </summary>
/// <value>The modification date.</value>
DateTimeOffset? ModificationDate { get; }

/// <summary>
/// Get the read-date parameter.
/// </summary>
/// <value>The read date.</value>
DateTimeOffset? ReadDate { get; }

/// <summary>
/// Get the size parameter.
/// </summary>
/// <value>The size.</value>
long? Size { get; }
}
67 changes: 67 additions & 0 deletions src/WireMock.Net.Abstractions/Models/Mime/IContentTypeData.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
// Copyright © WireMock.Net

using System.Collections.Generic;
using System.Text;

namespace WireMock.Models.Mime;

/// <summary>
/// An interface exposing the public, readable properties of a ContentType
/// with complex types simplified to a generic object.
/// </summary>
public interface IContentTypeData
{
/// <summary>
/// Get the type of the media.
/// </summary>
/// <value>The type of the media.</value>
string MediaType { get; }

/// <summary>
/// Get the media subtype.
/// </summary>
/// <value>The media subtype.</value>
string MediaSubtype { get; }

/// <summary>
/// Get the list of parameters on the ContentType.
/// </summary>
/// <value>The parameters.</value>
IList<string> Parameters { get; }

/// <summary>
/// Get the boundary parameter.
/// </summary>
/// <value>The boundary.</value>
string Boundary { get; }

/// <summary>
/// Get the charset parameter.
/// </summary>
/// <value>The charset.</value>
string Charset { get; }

/// <summary>
/// Get the charset parameter as an Encoding.
/// </summary>
/// <value>The charset encoding.</value>
Encoding CharsetEncoding { get; }

/// <summary>
/// Get the format parameter.
/// </summary>
/// <value>The format.</value>
string Format { get; }

/// <summary>
/// Get the simple mime-type.
/// </summary>
/// <value>The mime-type.</value>
string MimeType { get; }

/// <summary>
/// Get the name parameter.
/// </summary>
/// <value>The name.</value>
string Name { get; }
}
54 changes: 54 additions & 0 deletions src/WireMock.Net.Abstractions/Models/Mime/IMimeEntityData.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
// Copyright © WireMock.Net

using System;
using System.Collections.Generic;

namespace WireMock.Models.Mime;

/// <summary>
/// A simplified interface exposing the public, readable properties of MimeEntity.
/// </summary>
public interface IMimeEntityData
{
/// <summary>
/// Get the list of headers.
/// </summary>
/// <value>The list of headers.</value>
IList<string> Headers { get; }

/// <summary>
/// Get the content disposition.
/// </summary>
/// <value>The content disposition.</value>
IContentDispositionData? ContentDisposition { get; }

/// <summary>
/// Get the type of the content.
/// </summary>
/// <value>The type of the content.</value>
IContentTypeData? ContentType { get; }

/// <summary>
/// Get the base content URI.
/// </summary>
/// <value>The base content URI or <see langword="null"/>.</value>
Uri ContentBase { get; }

/// <summary>
/// Get the content location.
/// </summary>
/// <value>The content location or <see langword="null"/>.</value>
Uri ContentLocation { get; }

/// <summary>
/// Get the Content-Id.
/// </summary>
/// <value>The content identifier.</value>
string ContentId { get; }

/// <summary>
/// Get a value indicating whether this <see cref="IMimeEntityData"/> is an attachment.
/// </summary>
/// <value><see langword="true" /> if this <see cref="IMimeEntityData"/> is an attachment; otherwise, <see langword="false" />.</value>
bool IsAttachment { get; }
}
186 changes: 186 additions & 0 deletions src/WireMock.Net.Abstractions/Models/Mime/IMimeMessageData.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,186 @@
// Copyright © WireMock.Net

using System;
using System.Collections.Generic;

namespace WireMock.Models.Mime;

/// <summary>
/// A simplified interface exposing the public, readable properties of a MIME message.
/// </summary>
public interface IMimeMessageData
{
/// <summary>
/// Get the list of headers.
/// </summary>
/// <value>The list of headers.</value>
IList<string> Headers { get; }

/// <summary>
/// Get the value of the Importance header.
/// </summary>
/// <value>The importance, as an integer.</value>
int Importance { get; }

/// <summary>
/// Get the value of the Priority header.
/// </summary>
/// <value>The priority, as an integer.</value>
int Priority { get; }

/// <summary>
/// Get the value of the X-Priority header.
/// </summary>
/// <value>The X-priority, as an integer.</value>
int XPriority { get; }

/// <summary>
/// Get the address in the Sender header.
/// </summary>
/// <value>The address in the Sender header.</value>
string Sender { get; }

/// <summary>
/// Get the address in the Resent-Sender header.
/// </summary>
/// <value>The address in the Resent-Sender header.</value>
string ResentSender { get; }

/// <summary>
/// Get the list of addresses in the From header.
/// </summary>
/// <value>The list of addresses in the From header.</value>
IList<string> From { get; }

/// <summary>
/// Get the list of addresses in the Resent-From header.
/// </summary>
/// <value>The list of addresses in the Resent-From header.</value>
IList<string> ResentFrom { get; }

/// <summary>
/// Get the list of addresses in the Reply-To header.
/// </summary>
/// <value>The list of addresses in the Reply-To header.</value>
IList<string> ReplyTo { get; }

/// <summary>
/// Get the list of addresses in the Resent-Reply-To header.
/// </summary>
/// <value>The list of addresses in the Resent-Reply-To header.</value>
IList<string> ResentReplyTo { get; }

/// <summary>
/// Get the list of addresses in the To header.
/// </summary>
/// <value>The list of addresses in the To header.</value>
IList<string> To { get; }

/// <summary>
/// Get the list of addresses in the Resent-To header.
/// </summary>
/// <value>The list of addresses in the Resent-To header.</value>
IList<string> ResentTo { get; }

/// <summary>
/// Get the list of addresses in the Cc header.
/// </summary>
/// <value>The list of addresses in the Cc header.</value>
IList<string> Cc { get; }

/// <summary>
/// Get the list of addresses in the Resent-Cc header.
/// </summary>
/// <value>The list of addresses in the Resent-Cc header.</value>
IList<string> ResentCc { get; }

/// <summary>
/// Get the list of addresses in the Bcc header.
/// </summary>
/// <value>The list of addresses in the Bcc header.</value>
IList<string> Bcc { get; }

/// <summary>
/// Get the list of addresses in the Resent-Bcc header.
/// </summary>
/// <value>The list of addresses in the Resent-Bcc header.</value>
IList<string> ResentBcc { get; }

/// <summary>
/// Get the subject of the message.
/// </summary>
/// <value>The subject of the message.</value>
string Subject { get; }

/// <summary>
/// Get the date of the message.
/// </summary>
/// <value>The date of the message.</value>
DateTimeOffset Date { get; }

/// <summary>
/// Get the Resent-Date of the message.
/// </summary>
/// <value>The Resent-Date of the message.</value>
DateTimeOffset ResentDate { get; }

/// <summary>
/// Get the list of references to other messages.
/// </summary>
/// <value>The references.</value>
IList<string> References { get; }

/// <summary>
/// Get the Message-Id that this message is replying to.
/// </summary>
/// <value>The message id that this message is in reply to.</value>
string InReplyTo { get; }

/// <summary>
/// Get the message identifier.
/// </summary>
/// <value>The message identifier.</value>
string MessageId { get; }

/// <summary>
/// Get the Resent-Message-Id header.
/// </summary>
/// <value>The Resent-Message-Id.</value>
string ResentMessageId { get; }

/// <summary>
/// Get the MIME-Version.
/// </summary>
/// <value>The MIME version.</value>
Version MimeVersion { get; }

/// <summary>
/// Get the body of the message.
/// </summary>
/// <value>The body of the message.</value>
IMimeEntityData Body { get; }

/// <summary>
/// Get the text body of the message if it exists.
/// </summary>
/// <value>The text body if it exists; otherwise, <see langword="null"/>.</value>
string TextBody { get; }

/// <summary>
/// Get the html body of the message if it exists.
/// </summary>
/// <value>The html body if it exists; otherwise, <see langword="null"/>.</value>
string HtmlBody { get; }

/// <summary>
/// Get the body parts of the message.
/// </summary>
/// <value>The body parts.</value>
IList<IMimePartData> BodyParts { get; }

/// <summary>
/// Get the attachments.
/// </summary>
/// <value>The attachments.</value>
IList<IMimeEntityData> Attachments { get; }
}
Loading
Loading