From 5a09b391a9e93191218448637751afc871a8d438 Mon Sep 17 00:00:00 2001 From: gogeterobert Date: Fri, 16 Dec 2022 13:13:02 +0100 Subject: [PATCH] Added an interface to the BindleClient Signed-off-by: gogeterobert --- src/Bindle/BindleClient.cs | 2 +- src/Bindle/IBindleClient.cs | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 src/Bindle/IBindleClient.cs diff --git a/src/Bindle/BindleClient.cs b/src/Bindle/BindleClient.cs index 8bc74c3..c53999c 100644 --- a/src/Bindle/BindleClient.cs +++ b/src/Bindle/BindleClient.cs @@ -10,7 +10,7 @@ namespace Deislabs.Bindle; -public class BindleClient +public class BindleClient: IBindleClient { public BindleClient(string connectionString) : this(new ConnectionInfo(connectionString)) { } diff --git a/src/Bindle/IBindleClient.cs b/src/Bindle/IBindleClient.cs new file mode 100644 index 0000000..a1a9650 --- /dev/null +++ b/src/Bindle/IBindleClient.cs @@ -0,0 +1,20 @@ +using System.IO; +using System.Net.Http; +using System.Threading.Tasks; + +namespace Deislabs.Bindle +{ + public interface IBindleClient + { + Task CreateInvoice(Invoice invoice); + Task CreateParcel(string invoiceId, string parcelId, byte[] content); + Task CreateParcel(string invoiceId, string parcelId, HttpContent content); + Task CreateParcel(string invoiceId, string parcelId, Stream content); + Task CreateParcel(string invoiceId, string parcelId, string content); + Task GetInvoice(string invoiceId, GetInvoiceOptions options = GetInvoiceOptions.None); + Task GetParcel(string invoiceId, string parcelId); + Task ListMissingParcels(string invoiceId); + Task QueryInvoices(string? queryString = null, ulong? offset = null, long? limit = null, bool? strict = null, string? semVer = null, bool? yanked = null); + Task YankInvoice(string invoiceId); + } +} \ No newline at end of file