-
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.
- Added IApiClient interface to ApiClient to make extending easier - Fixed operations classes having an internal constructor preventing extension - Added DeviceOperations.AddSetupTokenAsync - Sealed some classes which will never get inherited from - Moved to 0.1.5
- Loading branch information
1 parent
207f985
commit c253599
Showing
17 changed files
with
156 additions
and
17 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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
|
||
namespace WifiPlug.Api.Entities | ||
{ | ||
/// <summary> | ||
/// Represents a device setup token. | ||
/// </summary> | ||
public class DeviceSetupTokenEntity | ||
{ | ||
/// <summary> | ||
/// Gets or sets the UUID. | ||
/// </summary> | ||
public Guid UUID { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the token. | ||
/// </summary> | ||
public string Token { get; set; } | ||
} | ||
} |
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,78 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Net.Http; | ||
using System.Text; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
using WifiPlug.Api.Operations; | ||
|
||
namespace WifiPlug.Api | ||
{ | ||
/// <summary> | ||
/// Defines the interface for an api client. | ||
/// </summary> | ||
public interface IApiClient | ||
{ | ||
/// <summary> | ||
/// Gets or sets the retry count for transient failures. | ||
/// </summary> | ||
int RetryCount { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the retry delay. | ||
/// </summary> | ||
TimeSpan RetryDelay { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the authentication method. | ||
/// </summary> | ||
ApiAuthentication Authentication { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the timeout for requests. | ||
/// </summary> | ||
TimeSpan Timeout { get; set; } | ||
|
||
/// <summary> | ||
/// Gets the underlying http client. | ||
/// </summary> | ||
HttpClient Client { get; } | ||
|
||
/// <summary> | ||
/// Gets or sets the base address. | ||
/// </summary> | ||
Uri BaseAddress { get; set; } | ||
|
||
/// <summary> | ||
/// Gets the device operations. | ||
/// </summary> | ||
IDeviceOperations Devices { get; } | ||
|
||
/// <summary> | ||
/// Gets the session operations. | ||
/// </summary> | ||
ISessionOperations Sessions { get; } | ||
|
||
/// <summary> | ||
/// Gets the user operations. | ||
/// </summary> | ||
IUserOperations Users { get; } | ||
|
||
/// <summary> | ||
/// Gets the group operations. | ||
/// </summary> | ||
IGroupOperations Groups { get; } | ||
|
||
/// <summary> | ||
/// Gets the event operations. | ||
/// </summary> | ||
IEventOperations Events { get; } | ||
|
||
/// <summary> | ||
/// Pings the API to check if it's up. | ||
/// </summary> | ||
/// <param name="cancellationToken">The cancellation token.</param> | ||
/// <returns>The ping response.</returns> | ||
Task<string> PingAsync(CancellationToken cancellationToken = default(CancellationToken)); | ||
} | ||
} |
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
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