adds interfaces to structure the piwigo api parts
This commit is contained in:
parent
e5ba4c6e4a
commit
cae3f94e39
3
PiwigoDotnet/Piwigo.Client/IGroupApi.cs
Normal file
3
PiwigoDotnet/Piwigo.Client/IGroupApi.cs
Normal file
@ -0,0 +1,3 @@
|
||||
namespace Piwigo.Client;
|
||||
|
||||
public interface IGroupApi {}
|
3
PiwigoDotnet/Piwigo.Client/IImageApi.cs
Normal file
3
PiwigoDotnet/Piwigo.Client/IImageApi.cs
Normal file
@ -0,0 +1,3 @@
|
||||
namespace Piwigo.Client;
|
||||
|
||||
public interface IImageApi {}
|
3
PiwigoDotnet/Piwigo.Client/IPermissionApi.cs
Normal file
3
PiwigoDotnet/Piwigo.Client/IPermissionApi.cs
Normal file
@ -0,0 +1,3 @@
|
||||
namespace Piwigo.Client;
|
||||
|
||||
public interface IPermissionApi {}
|
@ -2,6 +2,11 @@
|
||||
|
||||
public interface IPiwigoClient
|
||||
{
|
||||
IGroupApi Group { get; }
|
||||
IImageApi Image { get; }
|
||||
IPermissionApi Permission { get; }
|
||||
ITagApi Tag { get; }
|
||||
IUserApi User { get; }
|
||||
ISessionApi Session { get; }
|
||||
ICategoryApi Category { get; }
|
||||
}
|
3
PiwigoDotnet/Piwigo.Client/ITagApi.cs
Normal file
3
PiwigoDotnet/Piwigo.Client/ITagApi.cs
Normal file
@ -0,0 +1,3 @@
|
||||
namespace Piwigo.Client;
|
||||
|
||||
public interface ITagApi {}
|
3
PiwigoDotnet/Piwigo.Client/IUserApi.cs
Normal file
3
PiwigoDotnet/Piwigo.Client/IUserApi.cs
Normal file
@ -0,0 +1,3 @@
|
||||
namespace Piwigo.Client;
|
||||
|
||||
public interface IUserApi {}
|
@ -2,12 +2,22 @@ namespace Piwigo.Client;
|
||||
|
||||
public class PiwigoClient : IPiwigoClient
|
||||
{
|
||||
public PiwigoClient(ISessionApi session, ICategoryApi category)
|
||||
public PiwigoClient(IGroupApi group, IImageApi image, IPermissionApi permission, ITagApi tag, IUserApi user, ISessionApi session, ICategoryApi category)
|
||||
{
|
||||
Session = session;
|
||||
Category = category;
|
||||
Group = group ?? throw new ArgumentNullException(nameof(group));
|
||||
Image = image ?? throw new ArgumentNullException(nameof(image));
|
||||
Permission = permission ?? throw new ArgumentNullException(nameof(permission));
|
||||
Tag = tag ?? throw new ArgumentNullException(nameof(tag));
|
||||
User = user ?? throw new ArgumentNullException(nameof(user));
|
||||
Session = session ?? throw new ArgumentNullException(nameof(session));
|
||||
Category = category ?? throw new ArgumentNullException(nameof(category));
|
||||
}
|
||||
|
||||
public IGroupApi Group { get; }
|
||||
public IImageApi Image { get; }
|
||||
public IPermissionApi Permission { get; }
|
||||
public ITagApi Tag { get; }
|
||||
public IUserApi User { get; }
|
||||
public ISessionApi Session { get; }
|
||||
public ICategoryApi Category { get; }
|
||||
}
|
Loading…
Reference in New Issue
Block a user