Skip to content

Commit 4155f19

Browse files
Brandon's SurfaceBrandon's Surface
authored andcommitted
-Added BatchWebHooks
-Enhancements
1 parent 3e44563 commit 4155f19

Some content is hidden

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

52 files changed

+186
-69
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
// --------------------------------------------------------------------------------------------------------------------
2+
// <copyright file="AuthorizedAppTest.cs" company="Brandon Seydel">
3+
// N/A
4+
// </copyright>
5+
// --------------------------------------------------------------------------------------------------------------------
6+
7+
using System.Linq;
8+
using System.Threading.Tasks;
9+
using MailChimp.Net.Models;
10+
using Microsoft.VisualStudio.TestTools.UnitTesting;
11+
12+
namespace MailChimp.Net.Tests
13+
{
14+
/// <summary>
15+
/// The api test.
16+
/// </summary>
17+
[TestClass]
18+
public class BatchWebHookTest : MailChimpTest
19+
{
20+
/// <summary>
21+
/// The should_ return_ ap i_ information.
22+
/// </summary>
23+
/// <returns>
24+
/// The <see cref="Task"/>.
25+
/// </returns>
26+
[TestMethod]
27+
public async Task Should_Create_Batch_Webhook()
28+
{
29+
30+
var batches = await this.MailChimpManager.BatchWebHooks.GetAllAsync().ConfigureAwait(false);
31+
Task.WhenAll(batches.ToList().Select(x => this.MailChimpManager.BatchWebHooks.DeleteAsync(x.Id)));
32+
33+
var apiInfo = await this.MailChimpManager.BatchWebHooks.AddAsync("http://asdfasdf.com").ConfigureAwait(false);
34+
Assert.IsNotNull(apiInfo);
35+
}
36+
}
37+
}

MailChimp.Net.Tests/ListWebhookTests.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
using System.Threading.Tasks;
22
using FluentAssertions;
3-
using MailChimp.Net.Core;
43
using MailChimp.Net.Models;
54
using Microsoft.VisualStudio.TestTools.UnitTesting;
65

MailChimp.Net.Tests/MailChimp.Net.Tests.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
</Otherwise>
6262
</Choose>
6363
<ItemGroup>
64+
<Compile Include="BatchWebHookTest.cs" />
6465
<Compile Include="ECommerceLogicTest.cs" />
6566
<Compile Include="ApiTest.cs" />
6667
<Compile Include="ConversationTest.cs" />

MailChimp.Net.Tests/SegmentTest.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
using System;
22
using System.Collections.Generic;
33
using System.Linq;
4-
using System.Text;
54
using System.Threading.Tasks;
65
using MailChimp.Net.Core;
76
using MailChimp.Net.Models;

MailChimp.Net/Core/BaseLogic.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@
66

77
using System;
88
using System.Net.Http;
9-
using System.Reflection;
109
using System.Security.Cryptography;
11-
using System.Text;
1210
using MailChimp.Net.Interfaces;
1311

1412
#pragma warning disable 1584,1711,1572,1581,1580

MailChimp.Net/Core/Helper.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
// </copyright>
55
// --------------------------------------------------------------------------------------------------------------------
66

7-
using System;
87
using System.IO;
98
using System.Net;
109
using System.Net.Http;
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
using MailChimp.Net.Models;
7+
using Newtonsoft.Json;
8+
9+
namespace MailChimp.Net.Core
10+
{
11+
public class BatchWebHookResponse
12+
{
13+
[JsonProperty("webhooks")]
14+
public IEnumerable<BatchWebHook> WebHooks { get; set; }
15+
[JsonProperty("url")]
16+
public string Url { get; set; }
17+
[JsonProperty("_links")]
18+
public IEnumerable<Link> Links { get; set; }
19+
}
20+
}

MailChimp.Net/Interfaces/IAbuseReportLogic.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212

1313
namespace MailChimp.Net.Interfaces
1414
{
15-
using System;
16-
1715
/// <summary>
1816
/// The AbuseReportLogic interface.
1917
/// </summary>

MailChimp.Net/Interfaces/IActivityLogic.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
// </copyright>
55
// --------------------------------------------------------------------------------------------------------------------
66

7-
using System;
87
using System.Collections.Generic;
98
using System.Threading.Tasks;
109

MailChimp.Net/Interfaces/IAuthorizedAppLogic.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212

1313
namespace MailChimp.Net.Interfaces
1414
{
15-
using System;
16-
1715
/// <summary>
1816
/// The AuthorizedAppLogic interface.
1917
/// </summary>

0 commit comments

Comments
 (0)