by

Data Contract as input parameter for Create/Update List

This bean collects all the parameters that should be passed to the methods regarding the management of Lists.
There are two distinguished beans for the creation and for the update so that the "required" attributes can be set properly for the two different cases.
The attribute 'scope' is designed as String, and will be managed in the backend code with the help of ListScopeEnum enum. It is a best practice to avoid the use of enums in the data contracts otherwise backward compatibility issues can arise with old clients.
Copy Embed Code
<iframe id="embedFrame" style="width:600px; height:300px;"
src="https://www.snip2code.com/Embed/174389/Data-Contract-as-input-parameter-for-Cre?startLine=0"></iframe>
Click on the embed code to copy it into your clipboard Width Height
Leave empty to retrieve all the content Start End
namespace MailUpSOA.Ws.Contract.API.DataContracts.Console { [DataContract(Name = "ConsoleListCreateDetails", Namespace = "http://MailupSoa.Ws.Schema.API.Console")] public class ConsoleListCreateDetails : ConsoleListDetails { [DataMember(IsRequired = true)] public String Name { get; set; } [DataMember(IsRequired = true)] public Int32 idSettings { get; set; } [DataMember(IsRequired = true)] public Boolean useDefaultSettings { get; set; } [DataMember(IsRequired = true)] public Boolean copyTemplate { get; set; } [DataMember(IsRequired = true)] public String scope { get; set; } [DataMember(IsRequired = true)] public Boolean business { get; set; } [DataMember(IsRequired = true)] public Boolean Customer { get; set; } [DataMember(IsRequired = true)] public Boolean copyWebhooks { get; set; } } [DataContract(Name = "ConsoleListUpdateDetails", Namespace = "http://MailupSoa.Ws.Schema.API.Console")] public class ConsoleListUpdateDetails : ConsoleListDetails { [DataMember(IsRequired = true)] public Int32 IdList { get; set; } [DataMember(IsRequired = false)] public String Name { get; set; } [DataMember(IsRequired = false)] public String scope { get; set; } [DataMember(IsRequired = false)] public Boolean? business { get; set; } [DataMember(IsRequired = false)] public Boolean? Customer { get; set; } } [DataContract(Name = "ConsoleListDetails", Namespace = "http://MailupSoa.Ws.Schema.API.Console")] public class ConsoleListDetails : BaseDataContract { #region OPTIONS [DataMember(IsRequired = false)] public String format { get; set; } [DataMember(IsRequired = false)] public String owneremail { get; set; } [DataMember(IsRequired = false)] public String bouncedemail { get; set; } [DataMember(IsRequired = false)] public String description { get; set; } [DataMember(IsRequired = false)] public String charset { get; set; } [DataMember(IsRequired = false)] public Boolean? @public { get; set; } [DataMember(IsRequired = false)] public Boolean? tracking { get; set; } [DataMember(IsRequired = false)] public String nl_sendername { get; set; } [DataMember(IsRequired = false)] public String sms_sendername { get; set; } [DataMember(IsRequired = false)] public Int32? optout_type { get; set; } [DataMember(IsRequired = false)] public Boolean? sendemailoptout { get; set; } [DataMember(IsRequired = false)] public String notifyemail { get; set; } [DataMember(IsRequired = false)] public Boolean? frontendform { get; set; } [DataMember(IsRequired = false)] public String disclaimer { get; set; } [DataMember(IsRequired = false)] public String headerxabuse { get; set; } [DataMember(IsRequired = false)] public Int32? kbmax { get; set; } [DataMember(IsRequired = false)] public String replyto { get; set; } [DataMember(IsRequired = false)] public String displayas { get; set; } [DataMember(IsRequired = false)] public String headerlistunsubscriber { get; set; } [DataMember(IsRequired = false)] public Boolean? multipart_text { get; set; } [DataMember(IsRequired = false)] public String conversionlab_trackcode { get; set; } [DataMember(IsRequired = false)] public String default_prefix { get; set; } [DataMember(IsRequired = false)] public String multi_optout_list { get; set; } [DataMember(IsRequired = false)] public Boolean? subscribedemail { get; set; } [DataMember(IsRequired = false)] public Boolean? sendconfirmsms { get; set; } [DataMember(IsRequired = false)] public String senderfaxname { get; set; } [DataMember(IsRequired = false)] public String senderfax { get; set; } #endregion } /// <summary> /// Provides an enumeration of the possible scopes of a list /// </summary> public enum ListScopeEnum { /// <summary> /// List to be used to send newsletters /// </summary> newsletters, /// <summary> /// List to be used to send direct messages /// </summary> Direct_Advertising, /// <summary> /// List to be used to send transactional emails /// </summary> Transactional } }
If you want to be updated about similar snippets, Sign in and follow our Channels

blog comments powered by Disqus