From 33de6ec07ffabb6c055024ff9ad063ea2a3c6a5b Mon Sep 17 00:00:00 2001 From: Brandon Seydel Date: Fri, 27 May 2016 07:52:59 -0500 Subject: [PATCH] -Added missing fields on campaigns -Added some string enum stuff for easier use --- MailChimp.Net/MailChimp.Net.csproj | 10 +++++++++ MailChimp.Net/Models/Campaign.cs | 9 +++++++++ MailChimp.Net/Models/Capsule.cs | 10 +++++++++ MailChimp.Net/Models/Content.cs | 7 ++++++- MailChimp.Net/Models/CrmCampaign.cs | 13 ++++++++++++ MailChimp.Net/Models/DailySend.cs | 28 ++++++++++++++++++++++++++ MailChimp.Net/Models/DeliveryStatus.cs | 12 +++++++++++ MailChimp.Net/Models/Feedback.cs | 5 +++-- MailChimp.Net/Models/FeedbackSource.cs | 20 ++++++++++++++++++ MailChimp.Net/Models/HighRise.cs | 6 ++++++ MailChimp.Net/Models/RssOptions.cs | 16 +++++++++++++++ MailChimp.Net/Models/SalesForce.cs | 7 +++++++ MailChimp.Net/Models/Schedule.cs | 19 +++++++++++++++++ MailChimp.Net/Models/SocialCard.cs | 16 +++++++++++++++ MailChimp.Net/Models/Tracking.cs | 11 +++++++++- MailChimp.Net/Models/VariateContens.cs | 16 +++++++++++++++ 16 files changed, 201 insertions(+), 4 deletions(-) create mode 100644 MailChimp.Net/Models/Capsule.cs create mode 100644 MailChimp.Net/Models/CrmCampaign.cs create mode 100644 MailChimp.Net/Models/DailySend.cs create mode 100644 MailChimp.Net/Models/FeedbackSource.cs create mode 100644 MailChimp.Net/Models/HighRise.cs create mode 100644 MailChimp.Net/Models/RssOptions.cs create mode 100644 MailChimp.Net/Models/SalesForce.cs create mode 100644 MailChimp.Net/Models/Schedule.cs create mode 100644 MailChimp.Net/Models/SocialCard.cs create mode 100644 MailChimp.Net/Models/VariateContens.cs diff --git a/MailChimp.Net/MailChimp.Net.csproj b/MailChimp.Net/MailChimp.Net.csproj index f449592e..df8b89b1 100644 --- a/MailChimp.Net/MailChimp.Net.csproj +++ b/MailChimp.Net/MailChimp.Net.csproj @@ -89,15 +89,25 @@ + + + + + + + + + + diff --git a/MailChimp.Net/Models/Campaign.cs b/MailChimp.Net/Models/Campaign.cs index a1887f03..1f9d8876 100644 --- a/MailChimp.Net/Models/Campaign.cs +++ b/MailChimp.Net/Models/Campaign.cs @@ -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; } + /// /// Gets or sets the emails sent. /// diff --git a/MailChimp.Net/Models/Capsule.cs b/MailChimp.Net/Models/Capsule.cs new file mode 100644 index 00000000..0a6ff7e7 --- /dev/null +++ b/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; } + } +} \ No newline at end of file diff --git a/MailChimp.Net/Models/Content.cs b/MailChimp.Net/Models/Content.cs index 867e000c..736780f3 100644 --- a/MailChimp.Net/Models/Content.cs +++ b/MailChimp.Net/Models/Content.cs @@ -4,6 +4,8 @@ // // -------------------------------------------------------------------------------------------------------------------- +using System.Collections; +using System.Collections.Generic; using Newtonsoft.Json; namespace MailChimp.Net.Models @@ -23,7 +25,10 @@ public class Content /// Gets or sets the links. /// [JsonProperty("_links")] - public Link[] Links { get; set; } + public IEnumerable Links { get; set; } + + [JsonProperty("variate_contents")] + public IEnumerable VariateContents { get; set; } /// /// Gets or sets the plain text. diff --git a/MailChimp.Net/Models/CrmCampaign.cs b/MailChimp.Net/Models/CrmCampaign.cs new file mode 100644 index 00000000..a3801033 --- /dev/null +++ b/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; } + } +} \ No newline at end of file diff --git a/MailChimp.Net/Models/DailySend.cs b/MailChimp.Net/Models/DailySend.cs new file mode 100644 index 00000000..f32ba951 --- /dev/null +++ b/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; } + } +} \ No newline at end of file diff --git a/MailChimp.Net/Models/DeliveryStatus.cs b/MailChimp.Net/Models/DeliveryStatus.cs index 9ad96f31..64de2216 100644 --- a/MailChimp.Net/Models/DeliveryStatus.cs +++ b/MailChimp.Net/Models/DeliveryStatus.cs @@ -18,5 +18,17 @@ public class DeliveryStatus /// [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; } } } \ No newline at end of file diff --git a/MailChimp.Net/Models/Feedback.cs b/MailChimp.Net/Models/Feedback.cs index 86391006..677c7661 100644 --- a/MailChimp.Net/Models/Feedback.cs +++ b/MailChimp.Net/Models/Feedback.cs @@ -5,7 +5,7 @@ // -------------------------------------------------------------------------------------------------------------------- using System.Collections.Generic; - +using MailChimp.Net.Core; using Newtonsoft.Json; // ReSharper disable UnusedAutoPropertyAccessor.Local @@ -74,7 +74,8 @@ public class Feedback /// Gets the source. /// [JsonProperty("source")] - public string Source { get; set; } + [JsonConverter(typeof(StringEnumDescriptionConverter))] + public FeedbackSource Source { get; set; } /// /// Gets the updated at. diff --git a/MailChimp.Net/Models/FeedbackSource.cs b/MailChimp.Net/Models/FeedbackSource.cs new file mode 100644 index 00000000..736de55e --- /dev/null +++ b/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 + } +} \ No newline at end of file diff --git a/MailChimp.Net/Models/HighRise.cs b/MailChimp.Net/Models/HighRise.cs new file mode 100644 index 00000000..f82a6353 --- /dev/null +++ b/MailChimp.Net/Models/HighRise.cs @@ -0,0 +1,6 @@ +namespace MailChimp.Net.Models +{ + public class HighRise : CrmCampaign + { + } +} \ No newline at end of file diff --git a/MailChimp.Net/Models/RssOptions.cs b/MailChimp.Net/Models/RssOptions.cs new file mode 100644 index 00000000..53862f92 --- /dev/null +++ b/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; } + } +} \ No newline at end of file diff --git a/MailChimp.Net/Models/SalesForce.cs b/MailChimp.Net/Models/SalesForce.cs new file mode 100644 index 00000000..df9c1dd5 --- /dev/null +++ b/MailChimp.Net/Models/SalesForce.cs @@ -0,0 +1,7 @@ +namespace MailChimp.Net.Models +{ + public class SalesForce : CrmCampaign + { + + } +} \ No newline at end of file diff --git a/MailChimp.Net/Models/Schedule.cs b/MailChimp.Net/Models/Schedule.cs new file mode 100644 index 00000000..a440514e --- /dev/null +++ b/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; } + } +} \ No newline at end of file diff --git a/MailChimp.Net/Models/SocialCard.cs b/MailChimp.Net/Models/SocialCard.cs new file mode 100644 index 00000000..d4fb7653 --- /dev/null +++ b/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; } + } +} \ No newline at end of file diff --git a/MailChimp.Net/Models/Tracking.cs b/MailChimp.Net/Models/Tracking.cs index 4f335829..cbfc30f9 100644 --- a/MailChimp.Net/Models/Tracking.cs +++ b/MailChimp.Net/Models/Tracking.cs @@ -35,7 +35,7 @@ public class Tracking /// Gets or sets the google analytics. /// [JsonProperty("google_analytics")] - public bool? GoogleAnalytics { get; set; } + public string GoogleAnalytics { get; set; } /// /// Gets or sets a value indicating whether html clicks. @@ -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; } + /// /// Gets or sets a value indicating whether text clicks. /// diff --git a/MailChimp.Net/Models/VariateContens.cs b/MailChimp.Net/Models/VariateContens.cs new file mode 100644 index 00000000..0970cbeb --- /dev/null +++ b/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; } + } +} \ No newline at end of file