From 6ce025b0f2520e97b93842d4902195cc84b7ea29 Mon Sep 17 00:00:00 2001 From: Matthew Parker Date: Sat, 13 Jul 2024 22:27:21 +0100 Subject: [PATCH] Made internal interfaces internal rather than public --- src/PinguApps.Appwrite.Client/Clients/AccountClient.cs | 5 +++-- src/PinguApps.Appwrite.Client/Internals/IAccountApi.cs | 2 +- src/PinguApps.Appwrite.Client/Internals/IBaseApi.cs | 2 +- src/PinguApps.Appwrite.Server/Internals/IAccountApi.cs | 2 +- src/PinguApps.Appwrite.Server/Internals/IBaseApi.cs | 2 +- src/PinguApps.Appwrite.Server/Servers/AccountServer.cs | 5 +++-- 6 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/PinguApps.Appwrite.Client/Clients/AccountClient.cs b/src/PinguApps.Appwrite.Client/Clients/AccountClient.cs index 05ff9053..4d2d1459 100644 --- a/src/PinguApps.Appwrite.Client/Clients/AccountClient.cs +++ b/src/PinguApps.Appwrite.Client/Clients/AccountClient.cs @@ -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; @@ -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(); } string? ISessionAware.Session { get; set; } diff --git a/src/PinguApps.Appwrite.Client/Internals/IAccountApi.cs b/src/PinguApps.Appwrite.Client/Internals/IAccountApi.cs index 8b4b12fd..3cd2791c 100644 --- a/src/PinguApps.Appwrite.Client/Internals/IAccountApi.cs +++ b/src/PinguApps.Appwrite.Client/Internals/IAccountApi.cs @@ -6,7 +6,7 @@ namespace PinguApps.Appwrite.Client.Internals; -public interface IAccountApi : IBaseApi +internal interface IAccountApi : IBaseApi { [Get("/account")] Task> GetAccount([Header("x-appwrite-session")] string? session); diff --git a/src/PinguApps.Appwrite.Client/Internals/IBaseApi.cs b/src/PinguApps.Appwrite.Client/Internals/IBaseApi.cs index efa53db2..984f68f6 100644 --- a/src/PinguApps.Appwrite.Client/Internals/IBaseApi.cs +++ b/src/PinguApps.Appwrite.Client/Internals/IBaseApi.cs @@ -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 { } diff --git a/src/PinguApps.Appwrite.Server/Internals/IAccountApi.cs b/src/PinguApps.Appwrite.Server/Internals/IAccountApi.cs index 5a5b0f2c..67b4105e 100644 --- a/src/PinguApps.Appwrite.Server/Internals/IAccountApi.cs +++ b/src/PinguApps.Appwrite.Server/Internals/IAccountApi.cs @@ -4,7 +4,7 @@ using Refit; namespace PinguApps.Appwrite.Server.Internals; -public interface IAccountApi : IBaseApi +internal interface IAccountApi : IBaseApi { [Post("/account")] Task> CreateAccount(CreateAccountRequest request); diff --git a/src/PinguApps.Appwrite.Server/Internals/IBaseApi.cs b/src/PinguApps.Appwrite.Server/Internals/IBaseApi.cs index 437e0c93..cffdc5ff 100644 --- a/src/PinguApps.Appwrite.Server/Internals/IBaseApi.cs +++ b/src/PinguApps.Appwrite.Server/Internals/IBaseApi.cs @@ -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 { } diff --git a/src/PinguApps.Appwrite.Server/Servers/AccountServer.cs b/src/PinguApps.Appwrite.Server/Servers/AccountServer.cs index 0c73395d..7279362f 100644 --- a/src/PinguApps.Appwrite.Server/Servers/AccountServer.cs +++ b/src/PinguApps.Appwrite.Server/Servers/AccountServer.cs @@ -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; @@ -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(); } public async Task> Create(CreateAccountRequest request)