Skip to content

Commit

Permalink
-Added missing fields on campaigns
Browse files Browse the repository at this point in the history
-Added some string enum stuff for easier use
  • Loading branch information
brandonseydel committed May 27, 2016
1 parent 34dad90 commit 33de6ec
Show file tree
Hide file tree
Showing 16 changed files with 201 additions and 4 deletions.
10 changes: 10 additions & 0 deletions MailChimp.Net/MailChimp.Net.csproj
Expand Up @@ -89,15 +89,25 @@
<Compile Include="Models\Address.cs" />
<Compile Include="Models\AutomationStatus.cs" />
<Compile Include="Models\CampaignAction.cs" />
<Compile Include="Models\Capsule.cs" />
<Compile Include="Models\ConditionType.cs" />
<Compile Include="Models\CrmCampaign.cs" />
<Compile Include="Models\DailySend.cs" />
<Compile Include="Models\FeedbackSource.cs" />
<Compile Include="Models\FileType.cs" />
<Compile Include="Models\HighRise.cs" />
<Compile Include="Models\Match.cs" />
<Compile Include="Models\MemberStats.cs" />
<Compile Include="Models\Method.cs" />
<Compile Include="Models\Operator.cs" />
<Compile Include="Models\ReportType.cs" />
<Compile Include="Models\RssOptions.cs" />
<Compile Include="Models\SalesForce.cs" />
<Compile Include="Models\Schedule.cs" />
<Compile Include="Models\SocialCard.cs" />
<Compile Include="Models\Store.cs" />
<Compile Include="Models\TemplateType.cs" />
<Compile Include="Models\VariateContens.cs" />
<Compile Include="Models\Visibility.cs" />
<Compile Include="Models\WebHookResponse.cs" />
<Compile Include="GlobalSuppressions.cs" />
Expand Down
9 changes: 9 additions & 0 deletions MailChimp.Net/Models/Campaign.cs
Expand Up @@ -37,6 +37,15 @@ public class Campaign
[JsonProperty("delivery_status")]
public DeliveryStatus DeliveryStatus { get; set; }

[JsonProperty("rss_opts")]
public RssOptions RssOptions { get; set; }

[JsonProperty("social_card")]
public SocialCard SocialCard { get; set; }

[JsonProperty("report_summary")]
public ReportSummary ReportSummary { get; set; }

/// <summary>
/// Gets or sets the emails sent.
/// </summary>
Expand Down
10 changes: 10 additions & 0 deletions MailChimp.Net/Models/Capsule.cs
@@ -0,0 +1,10 @@
using Newtonsoft.Json;

namespace MailChimp.Net.Models
{
public class Capsule
{
[JsonProperty("notes")]
public bool UpdateNotesForCampaign { get; set; }
}
}
7 changes: 6 additions & 1 deletion MailChimp.Net/Models/Content.cs
Expand Up @@ -4,6 +4,8 @@
// </copyright>
// --------------------------------------------------------------------------------------------------------------------

using System.Collections;
using System.Collections.Generic;
using Newtonsoft.Json;

namespace MailChimp.Net.Models
Expand All @@ -23,7 +25,10 @@ public class Content
/// Gets or sets the links.
/// </summary>
[JsonProperty("_links")]
public Link[] Links { get; set; }
public IEnumerable<Link> Links { get; set; }

[JsonProperty("variate_contents")]
public IEnumerable<VariateContens> VariateContents { get; set; }

/// <summary>
/// Gets or sets the plain text.
Expand Down
13 changes: 13 additions & 0 deletions MailChimp.Net/Models/CrmCampaign.cs
@@ -0,0 +1,13 @@
using Newtonsoft.Json;

namespace MailChimp.Net.Models
{
public abstract class CrmCampaign
{
[JsonProperty("campaign")]
public bool CreateCampaignInAccount { get; set; }

[JsonProperty("notes")]
public bool UpdateNotesForCampaign { get; set; }
}
}
28 changes: 28 additions & 0 deletions MailChimp.Net/Models/DailySend.cs
@@ -0,0 +1,28 @@
using Newtonsoft.Json;

namespace MailChimp.Net.Models
{
public class DailySend
{
[JsonProperty("sunday")]
public bool Sunday { get; set; }

[JsonProperty("monday")]
public bool Monday { get; set; }

[JsonProperty("tuesday")]
public bool Tuesday { get; set; }

[JsonProperty("wednesday")]
public bool Wednesday { get; set; }

[JsonProperty("thursday")]
public bool Thursday { get; set; }

[JsonProperty("friday")]
public bool Friday { get; set; }

[JsonProperty("saturday")]
public bool Saturday { get; set; }
}
}
12 changes: 12 additions & 0 deletions MailChimp.Net/Models/DeliveryStatus.cs
Expand Up @@ -18,5 +18,17 @@ public class DeliveryStatus
/// </summary>
[JsonProperty("enabled")]
public bool Enabled { get; set; }

[JsonProperty("can_cancel")]
public bool CanCancel { get; set; }

[JsonProperty("status")]
public string Status { get; set; }

[JsonProperty("emails_sent")]
public int EmailsSent { get; set; }

[JsonProperty("emails_canceled")]
public int EmailsCanceled { get; set; }
}
}
5 changes: 3 additions & 2 deletions MailChimp.Net/Models/Feedback.cs
Expand Up @@ -5,7 +5,7 @@
// --------------------------------------------------------------------------------------------------------------------

using System.Collections.Generic;

using MailChimp.Net.Core;
using Newtonsoft.Json;

// ReSharper disable UnusedAutoPropertyAccessor.Local
Expand Down Expand Up @@ -74,7 +74,8 @@ public class Feedback
/// Gets the source.
/// </summary>
[JsonProperty("source")]
public string Source { get; set; }
[JsonConverter(typeof(StringEnumDescriptionConverter))]
public FeedbackSource Source { get; set; }

/// <summary>
/// Gets the updated at.
Expand Down
20 changes: 20 additions & 0 deletions MailChimp.Net/Models/FeedbackSource.cs
@@ -0,0 +1,20 @@
using System.ComponentModel;

namespace MailChimp.Net.Models
{
public enum FeedbackSource
{
[Description("api")]
Api,
[Description("email")]
Email,
[Description("sms")]
Sms,
[Description("web")]
Web,
[Description("ios")]
Ios,
[Description("android")]
Android
}
}
6 changes: 6 additions & 0 deletions MailChimp.Net/Models/HighRise.cs
@@ -0,0 +1,6 @@
namespace MailChimp.Net.Models
{
public class HighRise : CrmCampaign
{
}
}
16 changes: 16 additions & 0 deletions MailChimp.Net/Models/RssOptions.cs
@@ -0,0 +1,16 @@
using Newtonsoft.Json;

namespace MailChimp.Net.Models
{
public class RssOptions
{
[JsonProperty("feed_url")]
public string Url { get; set; }
[JsonProperty("frequency")]
public string Frequency { get; set; }
[JsonProperty("schedule")]
public Schedule Schedule { get; set; }
[JsonProperty("constrain_rss_img")]
public bool ConstrainImage { get; set; }
}
}
7 changes: 7 additions & 0 deletions MailChimp.Net/Models/SalesForce.cs
@@ -0,0 +1,7 @@
namespace MailChimp.Net.Models
{
public class SalesForce : CrmCampaign
{

}
}
19 changes: 19 additions & 0 deletions MailChimp.Net/Models/Schedule.cs
@@ -0,0 +1,19 @@
using Newtonsoft.Json;

namespace MailChimp.Net.Models
{
public class Schedule
{
[JsonProperty("hour")]
public int Hour { get; set; }

[JsonProperty("daily_send")]
public DailySend DailySend { get; set; }

[JsonProperty("weekly_send_day")]
public string DayOfWeekToSend { get; set; }

[JsonProperty("monthly_send_date")]
public int DayOfMonthToSend { get; set; }
}
}
16 changes: 16 additions & 0 deletions MailChimp.Net/Models/SocialCard.cs
@@ -0,0 +1,16 @@
using Newtonsoft.Json;

namespace MailChimp.Net.Models
{
public class SocialCard
{
[JsonProperty("image_url")]
public string ImageUrl { get; set; }

[JsonProperty("description")]
public string Description { get; set; }

[JsonProperty("title")]
public string Title { get; set; }
}
}
11 changes: 10 additions & 1 deletion MailChimp.Net/Models/Tracking.cs
Expand Up @@ -35,7 +35,7 @@ public class Tracking
/// Gets or sets the google analytics.
/// </summary>
[JsonProperty("google_analytics")]
public bool? GoogleAnalytics { get; set; }
public string GoogleAnalytics { get; set; }

/// <summary>
/// Gets or sets a value indicating whether html clicks.
Expand All @@ -49,6 +49,15 @@ public class Tracking
[JsonProperty("opens")]
public bool Opens { get; set; }

[JsonProperty("salesforce")]
public SalesForce SalesForce { get; set; }

[JsonProperty("highrise")]
public HighRise HighRise { get; set; }

[JsonProperty("capsule")]
public Capsule Capsule { get; set; }

/// <summary>
/// Gets or sets a value indicating whether text clicks.
/// </summary>
Expand Down
16 changes: 16 additions & 0 deletions MailChimp.Net/Models/VariateContens.cs
@@ -0,0 +1,16 @@
using Newtonsoft.Json;

namespace MailChimp.Net.Models
{
public class VariateContens
{
[JsonProperty("content_label")]
public string ContentLable { get; set; }

[JsonProperty("plain_text")]
public string PlainText { get; set; }

[JsonProperty("html")]
public string Html { get; set; }
}
}

0 comments on commit 33de6ec

Please sign in to comment.