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

Commit ce43f12

Browse files
authored
Merge pull request #39 from salesforce-marketingcloud/development
v1.0.0 Development Branch Merge
2 parents 8d08097 + 02dec2f commit ce43f12

File tree

1,390 files changed

+132561
-7567
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,390 files changed

+132561
-7567
lines changed

.gitignore

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
.DS_Store
2+
bin
3+
obj
4+
packages
5+
FuelSDK-Test/ContentAreaTest.cs
6+
FuelSDK-CSharp.v12.suo
7+
docs/latex
18
# Build Folders (you can keep bin if you'd like, to store dlls and pdbs)
29
[Bb]in/Debug/
310
[Oo]bj/
@@ -120,4 +127,6 @@ objsamples/[Rr]elease/
120127

121128
objsamples/FuelSDK_config.xml
122129
FuelSDK-CSharp/fixer.awk
123-
FuelSDK-CSharp/bin
130+
*.suo
131+
FuelSDK-CSharp.v12.suo
132+
FuelSDK-Test/App.config

BuildDocs.bat

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.\packages\Doxygen.1.8.13\tools\doxygen docs.config

FuelSDK-CSharp.sln

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,25 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio 2012
3+
# Visual Studio 2013
4+
VisualStudioVersion = 12.0.40629.0
5+
MinimumVisualStudioVersion = 10.0.40219.1
46
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FuelSDK-CSharp", "FuelSDK-CSharp\FuelSDK-CSharp.csproj", "{50281782-FA9F-44B3-A073-3759A5CA1CD8}"
57
EndProject
68
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "objsamples", "objsamples\objsamples.csproj", "{3E140C94-A503-47C9-9381-40AE7FAB2049}"
79
EndProject
10+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FuelSDK.Test", "FuelSDK-Test\FuelSDK.Test.csproj", "{08451C56-0ABB-4378-8526-DF1E159D9BD6}"
11+
EndProject
12+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{217C661B-3CF6-4835-B811-F8698E46523E}"
13+
ProjectSection(SolutionItems) = preProject
14+
.nuget\packages.config = .nuget\packages.config
15+
EndProjectSection
16+
EndProject
17+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{0D76AC0C-1D08-4A45-8EA0-69B1C0002CB6}"
18+
ProjectSection(SolutionItems) = preProject
19+
BuildDocs.bat = BuildDocs.bat
20+
readme.md = readme.md
21+
EndProjectSection
22+
EndProject
823
Global
924
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1025
Debug.4|Any CPU = Debug.4|Any CPU
@@ -46,7 +61,8 @@ Global
4661
{3E140C94-A503-47C9-9381-40AE7FAB2049}.Debug.4|Mixed Platforms.Build.0 = Debug.4|x86
4762
{3E140C94-A503-47C9-9381-40AE7FAB2049}.Debug.4|x86.ActiveCfg = Debug.4|x86
4863
{3E140C94-A503-47C9-9381-40AE7FAB2049}.Debug.4|x86.Build.0 = Debug.4|x86
49-
{3E140C94-A503-47C9-9381-40AE7FAB2049}.Debug|Any CPU.ActiveCfg = Debug|x86
64+
{3E140C94-A503-47C9-9381-40AE7FAB2049}.Debug|Any CPU.ActiveCfg = Debug.4|x86
65+
{3E140C94-A503-47C9-9381-40AE7FAB2049}.Debug|Any CPU.Build.0 = Debug.4|x86
5066
{3E140C94-A503-47C9-9381-40AE7FAB2049}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
5167
{3E140C94-A503-47C9-9381-40AE7FAB2049}.Debug|Mixed Platforms.Build.0 = Debug|x86
5268
{3E140C94-A503-47C9-9381-40AE7FAB2049}.Debug|x86.ActiveCfg = Debug|x86
@@ -61,6 +77,30 @@ Global
6177
{3E140C94-A503-47C9-9381-40AE7FAB2049}.Release|Mixed Platforms.Build.0 = Release|x86
6278
{3E140C94-A503-47C9-9381-40AE7FAB2049}.Release|x86.ActiveCfg = Release|x86
6379
{3E140C94-A503-47C9-9381-40AE7FAB2049}.Release|x86.Build.0 = Release|x86
80+
{08451C56-0ABB-4378-8526-DF1E159D9BD6}.Debug.4|Any CPU.ActiveCfg = Debug|Any CPU
81+
{08451C56-0ABB-4378-8526-DF1E159D9BD6}.Debug.4|Any CPU.Build.0 = Debug|Any CPU
82+
{08451C56-0ABB-4378-8526-DF1E159D9BD6}.Debug.4|Mixed Platforms.ActiveCfg = Debug|Any CPU
83+
{08451C56-0ABB-4378-8526-DF1E159D9BD6}.Debug.4|Mixed Platforms.Build.0 = Debug|Any CPU
84+
{08451C56-0ABB-4378-8526-DF1E159D9BD6}.Debug.4|x86.ActiveCfg = Debug|Any CPU
85+
{08451C56-0ABB-4378-8526-DF1E159D9BD6}.Debug.4|x86.Build.0 = Debug|Any CPU
86+
{08451C56-0ABB-4378-8526-DF1E159D9BD6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
87+
{08451C56-0ABB-4378-8526-DF1E159D9BD6}.Debug|Any CPU.Build.0 = Debug|Any CPU
88+
{08451C56-0ABB-4378-8526-DF1E159D9BD6}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
89+
{08451C56-0ABB-4378-8526-DF1E159D9BD6}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
90+
{08451C56-0ABB-4378-8526-DF1E159D9BD6}.Debug|x86.ActiveCfg = Debug|Any CPU
91+
{08451C56-0ABB-4378-8526-DF1E159D9BD6}.Debug|x86.Build.0 = Debug|Any CPU
92+
{08451C56-0ABB-4378-8526-DF1E159D9BD6}.Release.4|Any CPU.ActiveCfg = Release|Any CPU
93+
{08451C56-0ABB-4378-8526-DF1E159D9BD6}.Release.4|Any CPU.Build.0 = Release|Any CPU
94+
{08451C56-0ABB-4378-8526-DF1E159D9BD6}.Release.4|Mixed Platforms.ActiveCfg = Release|Any CPU
95+
{08451C56-0ABB-4378-8526-DF1E159D9BD6}.Release.4|Mixed Platforms.Build.0 = Release|Any CPU
96+
{08451C56-0ABB-4378-8526-DF1E159D9BD6}.Release.4|x86.ActiveCfg = Release|Any CPU
97+
{08451C56-0ABB-4378-8526-DF1E159D9BD6}.Release.4|x86.Build.0 = Release|Any CPU
98+
{08451C56-0ABB-4378-8526-DF1E159D9BD6}.Release|Any CPU.ActiveCfg = Release|Any CPU
99+
{08451C56-0ABB-4378-8526-DF1E159D9BD6}.Release|Any CPU.Build.0 = Release|Any CPU
100+
{08451C56-0ABB-4378-8526-DF1E159D9BD6}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
101+
{08451C56-0ABB-4378-8526-DF1E159D9BD6}.Release|Mixed Platforms.Build.0 = Release|Any CPU
102+
{08451C56-0ABB-4378-8526-DF1E159D9BD6}.Release|x86.ActiveCfg = Release|Any CPU
103+
{08451C56-0ABB-4378-8526-DF1E159D9BD6}.Release|x86.Build.0 = Release|Any CPU
64104
EndGlobalSection
65105
GlobalSection(SolutionProperties) = preSolution
66106
HideSolutionNode = FALSE

FuelSDK-CSharp/APIObject.cs

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
using System;
2+
using System.Xml.Serialization;
3+
using Newtonsoft.Json;
4+
5+
namespace FuelSDK
6+
{
7+
/// <summary>
8+
/// The APIObject is the object from which all SOAP API base objects inherit. The APIObject allows all base objects to
9+
/// - Refer to a specific account.
10+
/// - Have an associated creation date.
11+
/// - Have a Marketing Cloud identifier.
12+
/// - Have an associated key from an external system.
13+
/// </summary>
14+
public partial class APIObject
15+
{
16+
/// <summary>
17+
/// Gets or sets the authentication stub.
18+
/// </summary>
19+
/// <value>The authentication stub.</value>
20+
[XmlIgnore, JsonIgnore]
21+
public ETClient AuthStub { get; set; }
22+
/// <summary>
23+
/// Gets or sets the properties.
24+
/// </summary>
25+
/// <value>The properties.</value>
26+
[XmlIgnore]
27+
public string[] Props { get; set; }
28+
/// <summary>
29+
/// Gets or sets the search filter.
30+
/// </summary>
31+
/// <value>The search filter.</value>
32+
[XmlIgnore]
33+
public FilterPart SearchFilter { get; set; }
34+
/// <summary>
35+
/// Gets or sets the last request identifier.
36+
/// </summary>
37+
/// <value>The last request identifier.</value>
38+
[XmlIgnore]
39+
public string LastRequestID { get; set; }
40+
/// <summary>
41+
/// Gets or sets the directory path.
42+
/// </summary>
43+
/// <value>The directory path.</value>
44+
[XmlElementAttribute(Order = 10000), JsonIgnore]
45+
public string DirectoryPath { get; set; }
46+
/// <summary>
47+
/// Gets the unique identifier.
48+
/// Returns the ID if the value is greater than 0.
49+
/// If not and Object ID is not null returns Object ID.
50+
/// If not and Customer Key is not null returns Customer Key.
51+
/// If not throw throws error.
52+
/// </summary>
53+
/// <exception cref="System.InvalidOperationException">
54+
/// <value>The unique identifier.</value>
55+
[XmlIgnore, JsonIgnore]
56+
public string UniqueID
57+
{
58+
get
59+
{
60+
if (ID > 0) return ID.ToString();
61+
if (!string.IsNullOrEmpty(ObjectID)) return ObjectID;
62+
if (!string.IsNullOrEmpty(CustomerKey)) return CustomerKey;
63+
throw new InvalidOperationException("Unable to generate UniqueID");
64+
}
65+
}
66+
}
67+
}

FuelSDK-CSharp/DeleteReturn.cs

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
using System;
2+
using System.Linq;
3+
4+
namespace FuelSDK
5+
{
6+
/// <summary>
7+
/// Return object by delete operation.
8+
/// </summary>
9+
public class DeleteReturn : FuelReturn
10+
{
11+
/// <summary>
12+
/// Gets or sets the results as an ResultDetail array.
13+
/// </summary>
14+
/// <value>Array of ResultDetail.</value>
15+
public ResultDetail[] Results { get; set; }
16+
/// <summary>
17+
/// Initializes a new instance of the <see cref="T:FuelSDK.DeleteReturn"/> class.
18+
/// </summary>
19+
/// <param name="objs">APIObject</param>
20+
public DeleteReturn(APIObject objs)
21+
{
22+
if (objs == null)
23+
throw new ArgumentNullException("objs");
24+
var response = ExecuteAPI((client, o) =>
25+
{
26+
string requestID;
27+
string overallStatus;
28+
return new ExecuteAPIResponse<DeleteResult>(client.SoapClient.Delete(new DeleteOptions(), o, out requestID, out overallStatus), requestID, overallStatus);
29+
}, objs);
30+
if (response != null)
31+
if (response.GetType() == typeof(DeleteResult[]) && response.Length > 0)
32+
Results = response.Cast<DeleteResult>().Select(x => new ResultDetail
33+
{
34+
StatusCode = x.StatusCode,
35+
StatusMessage = x.StatusMessage,
36+
Object = (x.Object != null ? (objs.GetType().ToString().Contains("ET_") ? TranslateObject2(x.Object) : TranslateObject(x.Object)) : null),
37+
OrdinalID = x.OrdinalID,
38+
ErrorCode = x.ErrorCode,
39+
}).ToArray();
40+
else
41+
Results = new ResultDetail[0];
42+
}
43+
/// <summary>
44+
/// Initializes a new instance of the <see cref="T:FuelSDK.DeleteReturn"/> class.
45+
/// </summary>
46+
/// <exception cref="System.ArgumentNullException">
47+
/// <param name="obj">FuelObject</param>
48+
public DeleteReturn(FuelObject obj)
49+
{
50+
if (obj == null)
51+
throw new ArgumentNullException("obj");
52+
ExecuteFuel(obj, obj.URLProperties, "DELETE", false);
53+
}
54+
}
55+
}

FuelSDK-CSharp/ETBounceEvent.cs

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
using System;
2+
namespace FuelSDK
3+
{
4+
/// <summary>
5+
/// Contains SMTP and other information pertaining to the specific event of an email message bounce.
6+
/// </summary>
7+
public class ETBounceEvent : BounceEvent
8+
{
9+
/// <summary>
10+
/// Gets or sets a value indicating whether this <see cref="T:FuelSDK.ETBounceEvent"/> get since last batch.
11+
/// </summary>
12+
/// <value><c>true</c> if get since last batch; otherwise, <c>false</c>.</value>
13+
public bool GetSinceLastBatch { get; set; }
14+
/// <summary>
15+
/// Initializes a new instance of the <see cref="T:FuelSDK.ETBounceEvent"/> class and set get since last batch to false.
16+
/// </summary>
17+
public ETBounceEvent() { GetSinceLastBatch = true; }
18+
/// <summary>
19+
/// Get <see cref="T:FuelSDK.GetReturn"/> object after initializaing LastRequestID.
20+
/// </summary>
21+
/// <returns>The <see cref="T:FuelSDK.GetReturn"/> object</returns>
22+
public GetReturn Get() { var r = new GetReturn(this); LastRequestID = r.RequestID; return r; }
23+
/// <summary>
24+
/// Gets more results.
25+
/// </summary>
26+
/// <returns><see cref="T:FuelSDK.GetReturn"/> object</returns>
27+
public GetReturn GetMoreResults() { var r = new GetReturn(this, true, null); LastRequestID = r.RequestID; return r; }
28+
/// <summary>
29+
/// Returns the <see cref="T:FuelSDK.InfoReturn"/> object.
30+
/// </summary>
31+
/// <returns><see cref="T:FuelSDK.InfoReturn"/> object</returns>
32+
public InfoReturn Info() { return new InfoReturn(this); }
33+
}
34+
35+
[Obsolete("ET_BounceEvent will be removed in future release. Please use ETBounceEvent instead.")]
36+
public class ET_BounceEvent : ETBounceEvent
37+
{
38+
39+
}
40+
}

FuelSDK-CSharp/ETCampaign.cs

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
using System;
2+
using Newtonsoft.Json.Linq;
3+
4+
namespace FuelSDK
5+
{
6+
/// <summary>
7+
/// Represents a program in an account
8+
/// </summary>
9+
public class ETCampaign : FuelObject
10+
{
11+
/// <summary>
12+
/// Gets or sets the name of the campaign.
13+
/// </summary>
14+
/// <value>The name.</value>
15+
public string Name { get; set; }
16+
/// <summary>
17+
/// Gets or sets the description of the campaign.
18+
/// </summary>
19+
/// <value>The description.</value>
20+
public string Description { get; set; }
21+
/// <summary>
22+
/// Gets or sets the campaign code of the campaign.
23+
/// </summary>
24+
/// <value>The campaign code.</value>
25+
public string CampaignCode { get; set; }
26+
/// <summary>
27+
/// Gets or sets the color of the campaign.
28+
/// </summary>
29+
/// <value>The color.</value>
30+
public string Color { get; set; }
31+
/// <summary>
32+
/// Gets or sets the if the campaign is flagged as favorite.
33+
/// </summary>
34+
/// <value>The favorite flag.</value>
35+
public bool? Favorite { get; set; }
36+
/// <summary>
37+
/// Initializes a new instance of the <see cref="T:FuelSDK.ETCampaign"/> class.
38+
/// </summary>
39+
public ETCampaign()
40+
{
41+
Endpoint = "https://www.exacttargetapis.com/hub/v1/campaigns/{ID}";
42+
URLProperties = new[] { "ID" };
43+
RequiredURLProperties = new string[0];
44+
}
45+
/// <summary>
46+
/// Initializes a new instance of the <see cref="T:FuelSDK.ETCampaign"/> class.
47+
/// </summary>
48+
/// <param name="obj">Javascript object.</param>
49+
public ETCampaign(JObject obj)
50+
{
51+
if (obj["id"] != null)
52+
ID = int.Parse(CleanRestValue(obj["id"]));
53+
if (obj["createdDate"] != null)
54+
CreatedDate = DateTime.Parse(CleanRestValue(obj["createdDate"]));
55+
if (obj["modifiedDate"] != null)
56+
ModifiedDate = DateTime.Parse(CleanRestValue(obj["modifiedDate"]));
57+
if (obj["name"] != null)
58+
Name = CleanRestValue(obj["name"]);
59+
if (obj["description"] != null)
60+
Description = CleanRestValue(obj["description"]);
61+
if (obj["campaignCode"] != null)
62+
CampaignCode = CleanRestValue(obj["campaignCode"]);
63+
if (obj["color"] != null)
64+
Color = CleanRestValue(obj["color"]);
65+
if (obj["favorite"] != null)
66+
Favorite = bool.Parse(CleanRestValue(obj["favorite"]));
67+
}
68+
/// <summary>
69+
/// Post this instance.
70+
/// </summary>
71+
/// <returns>The <see cref="T:FuelSDK.PostReturn"/>.</returns>
72+
public PostReturn Post() { return new PostReturn(this); }
73+
/// <summary>
74+
/// Delete this instance.
75+
/// </summary>
76+
/// <returns>The <see cref="T:FuelSDK.DeleteReturn"/>.</returns>
77+
public DeleteReturn Delete() { return new DeleteReturn(this); }
78+
/// <summary>
79+
/// Get this instance.
80+
/// </summary>
81+
/// <returns>The <see cref="T:FuelSDK.GetReturn"/>.</returns>
82+
public GetReturn Get() { var r = new GetReturn(this); Page = r.LastPageNumber; return r; }
83+
/// <summary>
84+
/// Gets more results.
85+
/// </summary>
86+
/// <returns>The <see cref="T:FuelSDK.GetReturn"/>.</returns>
87+
public GetReturn GetMoreResults() { Page++; var r = new GetReturn(this); Page = r.LastPageNumber; return r; }
88+
}
89+
90+
[Obsolete("ET_Campaign will be removed in future release. Please use ETCampaign instead.")]
91+
public class ET_Campaign : ETCampaign
92+
{
93+
public ET_Campaign() : base() {}
94+
public ET_Campaign(JObject obj) : base(obj) { }
95+
}
96+
}

0 commit comments

Comments
 (0)