Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Comments for new model classes
  • Loading branch information
danielcrenna committed May 22, 2010
1 parent 1712f64 commit 627d216
Show file tree
Hide file tree
Showing 7 changed files with 174 additions and 10 deletions.
52 changes: 46 additions & 6 deletions src/Postmark/Model/PostmarkBounce.cs
Expand Up @@ -2,20 +2,60 @@

namespace PostmarkDotNet
{
/// <summary>
/// Represents an email bounce logged by Postmark.
/// </summary>
public class PostmarkBounce
{
/// <summary>
/// The bounce ID.
/// This is used for other API calls that require the ID.
/// </summary>
/// <value>The ID</value>
public string ID { get; set; }

/// <summary>
/// The <see cref="PostmarkBounceType" /> for this bounce.
/// </summary>
/// <value>The type</value>
public PostmarkBounceType Type { get; set; }

/// <summary>
/// The bounce details set by the server.
/// </summary>
/// <value>The details</value>
public string Details { get; set; }

/// <summary>
/// The email recipient that initiated the bounce.
/// </summary>
/// <value>The email</value>
public string Email { get; set; }

/// <summary>
/// The time the bounce occurred.
/// </summary>
/// <value>The time of the bounce</value>
public DateTime BouncedAt { get; set; }

/// <summary>
/// A value indicating whether a raw STMP dump is available.
/// </summary>
/// <value><c>true</c> if a dump is available; otherwise, <c>false</c></value>
public bool DumpAvailable { get; set; }

/// <summary>
/// A value indicating whether this <see cref="PostmarkBounce"/> is inactive.
/// </summary>
/// <value><c>true</c> if inactive; otherwise, <c>false</c></value>
public bool Inactive { get; set; }
public bool CanActivate { get; set; }
public string ID { get; set; }
}

public class PostmarkBounceDump
{
public string Body { get; set; }
/// <summary>
/// A value indicating whether this bounce can be activated.
/// </summary>
/// <value>
/// <c>true</c> if this instance can be activated; otherwise, <c>false</c>
/// </value>
public bool CanActivate { get; set; }
}
}
12 changes: 12 additions & 0 deletions src/Postmark/Model/PostmarkBounceActivation.cs
@@ -1,8 +1,20 @@
namespace PostmarkDotNet.Model
{
/// <summary>
/// Represents the results of a request to activate a <see cref="PostmarkBounce" />.
/// </summary>
public class PostmarkBounceActivation
{
/// <summary>
/// The server message accompanying the activation request.
/// </summary>
/// <value>The message.</value>
public string Message { get; set; }

/// <summary>
/// The activated bounce.
/// </summary>
/// <value>The activated bounce.</value>
public PostmarkBounce Bounce { get; set; }
}
}
14 changes: 14 additions & 0 deletions src/Postmark/Model/PostmarkBounceDump.cs
@@ -0,0 +1,14 @@
namespace PostmarkDotNet
{
///<summary>
/// Represents the raw SMTP details of a particular bounce.
///</summary>
public class PostmarkBounceDump
{
/// <summary>
/// The body of the bounce dump.
/// </summary>
/// <value>The body.</value>
public string Body { get; set; }
}
}
21 changes: 19 additions & 2 deletions src/Postmark/Model/PostmarkBounceSummary.cs
@@ -1,9 +1,26 @@
namespace PostmarkDotNet
{
/// <summary>
/// Represents an aggregate view of bounces.
/// </summary>
public class PostmarkBounceSummary
{
/// <summary>
/// An summary for a <see cref="PostmarkBounceType" />.
/// </summary>
/// <value>The type.</value>
public PostmarkBounceType Type { get; set; }
public string Name { get; set;}
public int Count { get; set;}

/// <summary>
/// The name of the summary.
/// </summary>
/// <value>The name.</value>
public string Name { get; set; }

/// <summary>
/// The numebr of results in the summary.
/// </summary>
/// <value>The count.</value>
public int Count { get; set; }
}
}
57 changes: 57 additions & 0 deletions src/Postmark/Model/PostmarkBounceType.cs
@@ -1,24 +1,81 @@
namespace PostmarkDotNet
{
/// <summary>
/// Represents the type of bounce for a <see cref="PostmarkBounce" />.
/// </summary>
public enum PostmarkBounceType
{
/// <summary>
/// HardBounce
/// </summary>
HardBounce,
/// <summary>
/// Transient
/// </summary>
Transient,
/// <summary>
/// Unsubscribe
/// </summary>
Unsubscribe,
/// <summary>
/// Subscribe
/// </summary>
Subscribe,
/// <summary>
/// AutoResponder
/// </summary>
AutoResponder,
/// <summary>
/// AddressChange
/// </summary>
AddressChange,
/// <summary>
/// DnsError
/// </summary>
DnsError,
/// <summary>
/// SpamNotification
/// </summary>
SpamNotification,
/// <summary>
/// OpenRelayTest
/// </summary>
OpenRelayTest,
/// <summary>
/// Unknown
/// </summary>
Unknown,
/// <summary>
/// SoftBounce
/// </summary>
SoftBounce,
/// <summary>
/// VirusNotification
/// </summary>
VirusNotification,
/// <summary>
/// ChallengeVerification
/// </summary>
ChallengeVerification,
/// <summary>
/// BadEmailAddress
/// </summary>
BadEmailAddress,
/// <summary>
/// SpamComplaint
/// </summary>
SpamComplaint,
/// <summary>
/// ManuallyDeactivated
/// </summary>
ManuallyDeactivated,
/// <summary>
/// Unconfirmed
/// </summary>
Unconfirmed,
/// <summary>
/// Blocked
/// </summary>
Blocked
}
}
14 changes: 14 additions & 0 deletions src/Postmark/Model/PostmarkBounces.cs
Expand Up @@ -2,9 +2,23 @@

namespace PostmarkDotNet
{
/// <summary>
/// Represents a partial result of bounces obtained from a search.
/// </summary>
public class PostmarkBounces
{
/// <summary>
/// The total number of bounces logged by the server.
/// Use this number to base paging parameters in subsequent
/// calls to retrieve bounces.
/// </summary>
/// <value>The total count.</value>
public int TotalCount { get; set; }

/// <summary>
/// The bounces returned in this query result.
/// </summary>
/// <value>The bounces.</value>
public List<PostmarkBounce> Bounces{ get; set; }
}
}
14 changes: 12 additions & 2 deletions src/Postmark/Model/PostmarkDeliveryStats.cs
Expand Up @@ -2,11 +2,21 @@

namespace PostmarkDotNet
{
// {"InactiveMails":0,"Bounces":[{"TypeCode":0,"Name":"All","Count":0}]}

/// <summary>
/// Represents delivery statistics at a particular time.
/// </summary>
public class PostmarkDeliveryStats
{
/// <summary>
/// The total number of inactive or bounced mails delivered.
/// </summary>
/// <value>The inactive mails.</value>
public int InactiveMails { get; set; }

/// <summary>
/// The list of summary results for the bounces in this report.
/// </summary>
/// <value>The bounces.</value>
public List<PostmarkBounceSummary> Bounces { get; set; }
}
}

0 comments on commit 627d216

Please sign in to comment.