Skip to content
This repository has been archived by the owner on Jan 19, 2024. It is now read-only.

Commit

Permalink
Merge pull request #39 from salesforce-marketingcloud/development
Browse files Browse the repository at this point in the history
v1.0.0 Development Branch Merge
  • Loading branch information
smunuswami authored Aug 1, 2017
2 parents 8d08097 + 02dec2f commit ce43f12
Show file tree
Hide file tree
Showing 1,390 changed files with 132,561 additions and 7,567 deletions.
11 changes: 10 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
.DS_Store
bin
obj
packages
FuelSDK-Test/ContentAreaTest.cs
FuelSDK-CSharp.v12.suo
docs/latex
# Build Folders (you can keep bin if you'd like, to store dlls and pdbs)
[Bb]in/Debug/
[Oo]bj/
Expand Down Expand Up @@ -120,4 +127,6 @@ objsamples/[Rr]elease/

objsamples/FuelSDK_config.xml
FuelSDK-CSharp/fixer.awk
FuelSDK-CSharp/bin
*.suo
FuelSDK-CSharp.v12.suo
FuelSDK-Test/App.config
1 change: 1 addition & 0 deletions BuildDocs.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.\packages\Doxygen.1.8.13\tools\doxygen docs.config
44 changes: 42 additions & 2 deletions FuelSDK-CSharp.sln
Original file line number Diff line number Diff line change
@@ -1,10 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012
# Visual Studio 2013
VisualStudioVersion = 12.0.40629.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FuelSDK-CSharp", "FuelSDK-CSharp\FuelSDK-CSharp.csproj", "{50281782-FA9F-44B3-A073-3759A5CA1CD8}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "objsamples", "objsamples\objsamples.csproj", "{3E140C94-A503-47C9-9381-40AE7FAB2049}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FuelSDK.Test", "FuelSDK-Test\FuelSDK.Test.csproj", "{08451C56-0ABB-4378-8526-DF1E159D9BD6}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{217C661B-3CF6-4835-B811-F8698E46523E}"
ProjectSection(SolutionItems) = preProject
.nuget\packages.config = .nuget\packages.config
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{0D76AC0C-1D08-4A45-8EA0-69B1C0002CB6}"
ProjectSection(SolutionItems) = preProject
BuildDocs.bat = BuildDocs.bat
readme.md = readme.md
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug.4|Any CPU = Debug.4|Any CPU
Expand Down Expand Up @@ -46,7 +61,8 @@ Global
{3E140C94-A503-47C9-9381-40AE7FAB2049}.Debug.4|Mixed Platforms.Build.0 = Debug.4|x86
{3E140C94-A503-47C9-9381-40AE7FAB2049}.Debug.4|x86.ActiveCfg = Debug.4|x86
{3E140C94-A503-47C9-9381-40AE7FAB2049}.Debug.4|x86.Build.0 = Debug.4|x86
{3E140C94-A503-47C9-9381-40AE7FAB2049}.Debug|Any CPU.ActiveCfg = Debug|x86
{3E140C94-A503-47C9-9381-40AE7FAB2049}.Debug|Any CPU.ActiveCfg = Debug.4|x86
{3E140C94-A503-47C9-9381-40AE7FAB2049}.Debug|Any CPU.Build.0 = Debug.4|x86
{3E140C94-A503-47C9-9381-40AE7FAB2049}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
{3E140C94-A503-47C9-9381-40AE7FAB2049}.Debug|Mixed Platforms.Build.0 = Debug|x86
{3E140C94-A503-47C9-9381-40AE7FAB2049}.Debug|x86.ActiveCfg = Debug|x86
Expand All @@ -61,6 +77,30 @@ Global
{3E140C94-A503-47C9-9381-40AE7FAB2049}.Release|Mixed Platforms.Build.0 = Release|x86
{3E140C94-A503-47C9-9381-40AE7FAB2049}.Release|x86.ActiveCfg = Release|x86
{3E140C94-A503-47C9-9381-40AE7FAB2049}.Release|x86.Build.0 = Release|x86
{08451C56-0ABB-4378-8526-DF1E159D9BD6}.Debug.4|Any CPU.ActiveCfg = Debug|Any CPU
{08451C56-0ABB-4378-8526-DF1E159D9BD6}.Debug.4|Any CPU.Build.0 = Debug|Any CPU
{08451C56-0ABB-4378-8526-DF1E159D9BD6}.Debug.4|Mixed Platforms.ActiveCfg = Debug|Any CPU
{08451C56-0ABB-4378-8526-DF1E159D9BD6}.Debug.4|Mixed Platforms.Build.0 = Debug|Any CPU
{08451C56-0ABB-4378-8526-DF1E159D9BD6}.Debug.4|x86.ActiveCfg = Debug|Any CPU
{08451C56-0ABB-4378-8526-DF1E159D9BD6}.Debug.4|x86.Build.0 = Debug|Any CPU
{08451C56-0ABB-4378-8526-DF1E159D9BD6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{08451C56-0ABB-4378-8526-DF1E159D9BD6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{08451C56-0ABB-4378-8526-DF1E159D9BD6}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{08451C56-0ABB-4378-8526-DF1E159D9BD6}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{08451C56-0ABB-4378-8526-DF1E159D9BD6}.Debug|x86.ActiveCfg = Debug|Any CPU
{08451C56-0ABB-4378-8526-DF1E159D9BD6}.Debug|x86.Build.0 = Debug|Any CPU
{08451C56-0ABB-4378-8526-DF1E159D9BD6}.Release.4|Any CPU.ActiveCfg = Release|Any CPU
{08451C56-0ABB-4378-8526-DF1E159D9BD6}.Release.4|Any CPU.Build.0 = Release|Any CPU
{08451C56-0ABB-4378-8526-DF1E159D9BD6}.Release.4|Mixed Platforms.ActiveCfg = Release|Any CPU
{08451C56-0ABB-4378-8526-DF1E159D9BD6}.Release.4|Mixed Platforms.Build.0 = Release|Any CPU
{08451C56-0ABB-4378-8526-DF1E159D9BD6}.Release.4|x86.ActiveCfg = Release|Any CPU
{08451C56-0ABB-4378-8526-DF1E159D9BD6}.Release.4|x86.Build.0 = Release|Any CPU
{08451C56-0ABB-4378-8526-DF1E159D9BD6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{08451C56-0ABB-4378-8526-DF1E159D9BD6}.Release|Any CPU.Build.0 = Release|Any CPU
{08451C56-0ABB-4378-8526-DF1E159D9BD6}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{08451C56-0ABB-4378-8526-DF1E159D9BD6}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{08451C56-0ABB-4378-8526-DF1E159D9BD6}.Release|x86.ActiveCfg = Release|Any CPU
{08451C56-0ABB-4378-8526-DF1E159D9BD6}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
67 changes: 67 additions & 0 deletions FuelSDK-CSharp/APIObject.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
using System;
using System.Xml.Serialization;
using Newtonsoft.Json;

namespace FuelSDK
{
/// <summary>
/// The APIObject is the object from which all SOAP API base objects inherit. The APIObject allows all base objects to
/// - Refer to a specific account.
/// - Have an associated creation date.
/// - Have a Marketing Cloud identifier.
/// - Have an associated key from an external system.
/// </summary>
public partial class APIObject
{
/// <summary>
/// Gets or sets the authentication stub.
/// </summary>
/// <value>The authentication stub.</value>
[XmlIgnore, JsonIgnore]
public ETClient AuthStub { get; set; }
/// <summary>
/// Gets or sets the properties.
/// </summary>
/// <value>The properties.</value>
[XmlIgnore]
public string[] Props { get; set; }
/// <summary>
/// Gets or sets the search filter.
/// </summary>
/// <value>The search filter.</value>
[XmlIgnore]
public FilterPart SearchFilter { get; set; }
/// <summary>
/// Gets or sets the last request identifier.
/// </summary>
/// <value>The last request identifier.</value>
[XmlIgnore]
public string LastRequestID { get; set; }
/// <summary>
/// Gets or sets the directory path.
/// </summary>
/// <value>The directory path.</value>
[XmlElementAttribute(Order = 10000), JsonIgnore]
public string DirectoryPath { get; set; }
/// <summary>
/// Gets the unique identifier.
/// Returns the ID if the value is greater than 0.
/// If not and Object ID is not null returns Object ID.
/// If not and Customer Key is not null returns Customer Key.
/// If not throw throws error.
/// </summary>
/// <exception cref="System.InvalidOperationException">
/// <value>The unique identifier.</value>
[XmlIgnore, JsonIgnore]
public string UniqueID
{
get
{
if (ID > 0) return ID.ToString();
if (!string.IsNullOrEmpty(ObjectID)) return ObjectID;
if (!string.IsNullOrEmpty(CustomerKey)) return CustomerKey;
throw new InvalidOperationException("Unable to generate UniqueID");
}
}
}
}
55 changes: 55 additions & 0 deletions FuelSDK-CSharp/DeleteReturn.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
using System;
using System.Linq;

namespace FuelSDK
{
/// <summary>
/// Return object by delete operation.
/// </summary>
public class DeleteReturn : FuelReturn
{
/// <summary>
/// Gets or sets the results as an ResultDetail array.
/// </summary>
/// <value>Array of ResultDetail.</value>
public ResultDetail[] Results { get; set; }
/// <summary>
/// Initializes a new instance of the <see cref="T:FuelSDK.DeleteReturn"/> class.
/// </summary>
/// <param name="objs">APIObject</param>
public DeleteReturn(APIObject objs)
{
if (objs == null)
throw new ArgumentNullException("objs");
var response = ExecuteAPI((client, o) =>
{
string requestID;
string overallStatus;
return new ExecuteAPIResponse<DeleteResult>(client.SoapClient.Delete(new DeleteOptions(), o, out requestID, out overallStatus), requestID, overallStatus);
}, objs);
if (response != null)
if (response.GetType() == typeof(DeleteResult[]) && response.Length > 0)
Results = response.Cast<DeleteResult>().Select(x => new ResultDetail
{
StatusCode = x.StatusCode,
StatusMessage = x.StatusMessage,
Object = (x.Object != null ? (objs.GetType().ToString().Contains("ET_") ? TranslateObject2(x.Object) : TranslateObject(x.Object)) : null),
OrdinalID = x.OrdinalID,
ErrorCode = x.ErrorCode,
}).ToArray();
else
Results = new ResultDetail[0];
}
/// <summary>
/// Initializes a new instance of the <see cref="T:FuelSDK.DeleteReturn"/> class.
/// </summary>
/// <exception cref="System.ArgumentNullException">
/// <param name="obj">FuelObject</param>
public DeleteReturn(FuelObject obj)
{
if (obj == null)
throw new ArgumentNullException("obj");
ExecuteFuel(obj, obj.URLProperties, "DELETE", false);
}
}
}
40 changes: 40 additions & 0 deletions FuelSDK-CSharp/ETBounceEvent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
using System;
namespace FuelSDK
{
/// <summary>
/// Contains SMTP and other information pertaining to the specific event of an email message bounce.
/// </summary>
public class ETBounceEvent : BounceEvent
{
/// <summary>
/// Gets or sets a value indicating whether this <see cref="T:FuelSDK.ETBounceEvent"/> get since last batch.
/// </summary>
/// <value><c>true</c> if get since last batch; otherwise, <c>false</c>.</value>
public bool GetSinceLastBatch { get; set; }
/// <summary>
/// Initializes a new instance of the <see cref="T:FuelSDK.ETBounceEvent"/> class and set get since last batch to false.
/// </summary>
public ETBounceEvent() { GetSinceLastBatch = true; }
/// <summary>
/// Get <see cref="T:FuelSDK.GetReturn"/> object after initializaing LastRequestID.
/// </summary>
/// <returns>The <see cref="T:FuelSDK.GetReturn"/> object</returns>
public GetReturn Get() { var r = new GetReturn(this); LastRequestID = r.RequestID; return r; }
/// <summary>
/// Gets more results.
/// </summary>
/// <returns><see cref="T:FuelSDK.GetReturn"/> object</returns>
public GetReturn GetMoreResults() { var r = new GetReturn(this, true, null); LastRequestID = r.RequestID; return r; }
/// <summary>
/// Returns the <see cref="T:FuelSDK.InfoReturn"/> object.
/// </summary>
/// <returns><see cref="T:FuelSDK.InfoReturn"/> object</returns>
public InfoReturn Info() { return new InfoReturn(this); }
}

[Obsolete("ET_BounceEvent will be removed in future release. Please use ETBounceEvent instead.")]
public class ET_BounceEvent : ETBounceEvent
{

}
}
96 changes: 96 additions & 0 deletions FuelSDK-CSharp/ETCampaign.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
using System;
using Newtonsoft.Json.Linq;

namespace FuelSDK
{
/// <summary>
/// Represents a program in an account
/// </summary>
public class ETCampaign : FuelObject
{
/// <summary>
/// Gets or sets the name of the campaign.
/// </summary>
/// <value>The name.</value>
public string Name { get; set; }
/// <summary>
/// Gets or sets the description of the campaign.
/// </summary>
/// <value>The description.</value>
public string Description { get; set; }
/// <summary>
/// Gets or sets the campaign code of the campaign.
/// </summary>
/// <value>The campaign code.</value>
public string CampaignCode { get; set; }
/// <summary>
/// Gets or sets the color of the campaign.
/// </summary>
/// <value>The color.</value>
public string Color { get; set; }
/// <summary>
/// Gets or sets the if the campaign is flagged as favorite.
/// </summary>
/// <value>The favorite flag.</value>
public bool? Favorite { get; set; }
/// <summary>
/// Initializes a new instance of the <see cref="T:FuelSDK.ETCampaign"/> class.
/// </summary>
public ETCampaign()
{
Endpoint = "https://www.exacttargetapis.com/hub/v1/campaigns/{ID}";
URLProperties = new[] { "ID" };
RequiredURLProperties = new string[0];
}
/// <summary>
/// Initializes a new instance of the <see cref="T:FuelSDK.ETCampaign"/> class.
/// </summary>
/// <param name="obj">Javascript object.</param>
public ETCampaign(JObject obj)
{
if (obj["id"] != null)
ID = int.Parse(CleanRestValue(obj["id"]));
if (obj["createdDate"] != null)
CreatedDate = DateTime.Parse(CleanRestValue(obj["createdDate"]));
if (obj["modifiedDate"] != null)
ModifiedDate = DateTime.Parse(CleanRestValue(obj["modifiedDate"]));
if (obj["name"] != null)
Name = CleanRestValue(obj["name"]);
if (obj["description"] != null)
Description = CleanRestValue(obj["description"]);
if (obj["campaignCode"] != null)
CampaignCode = CleanRestValue(obj["campaignCode"]);
if (obj["color"] != null)
Color = CleanRestValue(obj["color"]);
if (obj["favorite"] != null)
Favorite = bool.Parse(CleanRestValue(obj["favorite"]));
}
/// <summary>
/// Post this instance.
/// </summary>
/// <returns>The <see cref="T:FuelSDK.PostReturn"/>.</returns>
public PostReturn Post() { return new PostReturn(this); }
/// <summary>
/// Delete this instance.
/// </summary>
/// <returns>The <see cref="T:FuelSDK.DeleteReturn"/>.</returns>
public DeleteReturn Delete() { return new DeleteReturn(this); }
/// <summary>
/// Get this instance.
/// </summary>
/// <returns>The <see cref="T:FuelSDK.GetReturn"/>.</returns>
public GetReturn Get() { var r = new GetReturn(this); Page = r.LastPageNumber; return r; }
/// <summary>
/// Gets more results.
/// </summary>
/// <returns>The <see cref="T:FuelSDK.GetReturn"/>.</returns>
public GetReturn GetMoreResults() { Page++; var r = new GetReturn(this); Page = r.LastPageNumber; return r; }
}

[Obsolete("ET_Campaign will be removed in future release. Please use ETCampaign instead.")]
public class ET_Campaign : ETCampaign
{
public ET_Campaign() : base() {}
public ET_Campaign(JObject obj) : base(obj) { }
}
}
Loading

0 comments on commit ce43f12

Please sign in to comment.