Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Made internal interfaces internal rather than public #70

Merged
merged 1 commit into from
Jul 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/PinguApps.Appwrite.Client/Clients/AccountClient.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using PinguApps.Appwrite.Client.Clients;
using PinguApps.Appwrite.Client.Internals;
using PinguApps.Appwrite.Client.Utils;
Expand All @@ -14,9 +15,9 @@ public class AccountClient : IAccountClient, ISessionAware
{
private readonly IAccountApi _accountApi;

public AccountClient(IAccountApi accountApi)
public AccountClient(IServiceProvider services)
{
_accountApi = accountApi;
_accountApi = services.GetRequiredService<IAccountApi>();
}

string? ISessionAware.Session { get; set; }
Expand Down
2 changes: 1 addition & 1 deletion src/PinguApps.Appwrite.Client/Internals/IAccountApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace PinguApps.Appwrite.Client.Internals;

public interface IAccountApi : IBaseApi
internal interface IAccountApi : IBaseApi
{
[Get("/account")]
Task<IApiResponse<User>> GetAccount([Header("x-appwrite-session")] string? session);
Expand Down
2 changes: 1 addition & 1 deletion src/PinguApps.Appwrite.Client/Internals/IBaseApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ namespace PinguApps.Appwrite.Client.Internals;
"x-sdk-language: dotnet",
"x-sdk-version: 0.0.1",
"X-Appwrite-Response-Format: 1.5.0")]
public interface IBaseApi
internal interface IBaseApi
{
}
2 changes: 1 addition & 1 deletion src/PinguApps.Appwrite.Server/Internals/IAccountApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using Refit;

namespace PinguApps.Appwrite.Server.Internals;
public interface IAccountApi : IBaseApi
internal interface IAccountApi : IBaseApi
{
[Post("/account")]
Task<IApiResponse<User>> CreateAccount(CreateAccountRequest request);
Expand Down
2 changes: 1 addition & 1 deletion src/PinguApps.Appwrite.Server/Internals/IBaseApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ namespace PinguApps.Appwrite.Server.Internals;
"x-sdk-language: dotnet",
"x-sdk-version: 0.0.1",
"X-Appwrite-Response-Format: 1.5.0")]
public interface IBaseApi
internal interface IBaseApi
{
}
5 changes: 3 additions & 2 deletions src/PinguApps.Appwrite.Server/Servers/AccountServer.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using PinguApps.Appwrite.Server.Internals;
using PinguApps.Appwrite.Server.Utils;
using PinguApps.Appwrite.Shared;
Expand All @@ -11,9 +12,9 @@ public class AccountServer : IAccountServer
{
private readonly IAccountApi _accountApi;

public AccountServer(IAccountApi accountApi)
public AccountServer(IServiceProvider services)
{
_accountApi = accountApi;
_accountApi = services.GetRequiredService<IAccountApi>();
}

public async Task<AppwriteResult<User>> Create(CreateAccountRequest request)
Expand Down