-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from Kencdk/kenchr/wip
Updated IZoneDNSClient with Update and PATCH calls Added RestClientFactory Upgraded nuget packages. Minor changes here and there.
- Loading branch information
Showing
20 changed files
with
324 additions
and
119 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
src/Libraries/Kenc.Cloudflare.Core.Tests/HttpClientFactory.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
namespace Kenc.Cloudflare.Core.Tests | ||
{ | ||
using System.Net.Http; | ||
|
||
class MyHttpClientFactory : IHttpClientFactory | ||
{ | ||
public HttpClient CreateClient(string name) | ||
{ | ||
return HttpClientFactory.Create(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
src/Libraries/Kenc.Cloudflare.Core/Clients/CloudflareClientFactory.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
namespace Kenc.Cloudflare.Core.Clients | ||
{ | ||
using System; | ||
|
||
public class CloudflareClientFactory : ICloudflareClientFactory | ||
{ | ||
private string username; | ||
private string apiKey; | ||
private ICloudflareRestClientFactory restClientFactory; | ||
private Uri endpoint; | ||
|
||
public CloudflareClientFactory() | ||
{ | ||
} | ||
|
||
public ICloudflareClient Create() | ||
{ | ||
return new CloudflareClient(restClientFactory, username, apiKey, endpoint); | ||
} | ||
|
||
public ICloudflareClientFactory WithUsername(string username) | ||
{ | ||
this.username = username; | ||
return this; | ||
} | ||
|
||
public ICloudflareClientFactory WithAPIKey(string apiKey) | ||
{ | ||
this.apiKey = apiKey; | ||
return this; | ||
} | ||
|
||
public ICloudflareClientFactory WithEndpoint(Uri endpoint) | ||
{ | ||
this.endpoint = endpoint ?? throw new ArgumentNullException(nameof(endpoint)); | ||
return this; | ||
} | ||
|
||
public ICloudflareClientFactory WithRestClientFactory(ICloudflareRestClientFactory cloudflareRestClientFactory) | ||
{ | ||
this.restClientFactory = cloudflareRestClientFactory; | ||
return this; | ||
} | ||
} | ||
} |
Oops, something went wrong.