-
Notifications
You must be signed in to change notification settings - Fork 2
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 #50 from PinguApps/33-add-intellisense-comments
Added intellisense comments to everything public in all projects
- Loading branch information
Showing
19 changed files
with
232 additions
and
8 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,26 @@ | ||
using PinguApps.Appwrite.Client.Clients; | ||
namespace PinguApps.Appwrite.Client; | ||
|
||
namespace PinguApps.Appwrite.Client; | ||
|
||
public interface IAppwriteClient : ISessionAware | ||
/// <summary> | ||
/// The root of the Client SDK. Access all API sections from here | ||
/// </summary> | ||
public interface IAppwriteClient | ||
{ | ||
/// <summary> | ||
/// <para>The Account service allows you to authenticate and manage a user account. You can use the account service to update user information, retrieve the user sessions across different devices, and fetch the user security logs with his or her recent activity.</para> | ||
/// <para>Register new user accounts with the Create Account, Create Magic URL session, or Create Phone session endpoint.You can authenticate the user account by using multiple sign-in methods available.Once the user is authenticated, a new session object will be created to allow the user to access his or her private data and settings.</para> | ||
/// <para>This service also exposes an endpoint to save and read the user preferences as a key-value object. This feature is handy if you want to allow extra customization in your app.Common usage for this feature may include saving the user's preferred locale, timezone, or custom app theme.</para> | ||
/// <para><see href="https://appwrite.io/docs/references/1.5.x/client-rest/account">Appwrite Docs</see></para> | ||
/// </summary> | ||
IAccountClient Account { get; } | ||
|
||
/// <summary> | ||
/// Set the session of the logged in user | ||
/// </summary> | ||
/// <param name="session">The session token</param> | ||
void SetSession(string? session); | ||
|
||
/// <summary> | ||
/// The sessio of the currently logged in user | ||
/// </summary> | ||
string? Session { get; } | ||
} |
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 |
---|---|---|
@@ -1,6 +1,8 @@ | ||
namespace PinguApps.Appwrite.Client.Clients; | ||
public interface ISessionAware | ||
|
||
internal interface ISessionAware | ||
{ | ||
public string? Session { get; protected set; } | ||
|
||
public void UpdateSession(string? session) => Session = session; | ||
} |
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 |
---|---|---|
@@ -1,16 +1,40 @@ | ||
using OneOf; | ||
|
||
namespace PinguApps.Appwrite.Shared; | ||
|
||
/// <summary> | ||
/// The result of all API calls | ||
/// </summary> | ||
/// <typeparam name="TResult">the type of response expected on success</typeparam> | ||
public class AppwriteResult<TResult> | ||
{ | ||
public AppwriteResult(OneOf<TResult, AppwriteError, InternalError> result) | ||
{ | ||
Result = result; | ||
} | ||
|
||
/// <summary> | ||
/// The result of making the API call. Can be <see cref="TResult"/>, <see cref="AppwriteError"/> or <see cref="InternalError"/> depending on what happened | ||
/// </summary> | ||
public OneOf<TResult, AppwriteError, InternalError> Result { get; } | ||
|
||
/// <summary> | ||
/// Indicates the API call was successful | ||
/// </summary> | ||
public bool Success => Result.IsT0; | ||
|
||
/// <summary> | ||
/// Indicates there is an error | ||
/// </summary> | ||
public bool IsError => Result.IsT1 || Result.IsT2; | ||
|
||
/// <summary> | ||
/// Indicates that there was an error thrown within Appwrite | ||
/// </summary> | ||
public bool IsAppwriteError => Result.IsT1; | ||
|
||
/// <summary> | ||
/// Indicates that there was an error thrown within the SDK | ||
/// </summary> | ||
public bool IsInternalError => Result.IsT2; | ||
} |
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 |
---|---|---|
@@ -1,12 +1,25 @@ | ||
using System.Runtime.Serialization; | ||
|
||
namespace PinguApps.Appwrite.Shared.Enums; | ||
|
||
/// <summary> | ||
/// The type of target | ||
/// </summary> | ||
public enum TargetProviderType | ||
{ | ||
/// <summary> | ||
/// </summary> | ||
[EnumMember(Value = "email")] | ||
Email, | ||
/// <summary> | ||
/// Sms | ||
/// </summary> | ||
[EnumMember(Value = "sms")] | ||
Sms, | ||
/// <summary> | ||
/// Push | ||
/// </summary> | ||
[EnumMember(Value = "push")] | ||
Push | ||
} |
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 |
---|---|---|
@@ -1,4 +1,9 @@ | ||
namespace PinguApps.Appwrite.Shared; | ||
|
||
/// <summary> | ||
/// An internal error, indicating a fault within the SDK rather than Appwrite | ||
/// </summary> | ||
/// <param name="Message">The message of any thrown exception</param> | ||
public record InternalError( | ||
string Message | ||
); |
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
Oops, something went wrong.