From 4aab14df96638baa895b63c801b566468c4faa38 Mon Sep 17 00:00:00 2001 From: Richard Randak Date: Thu, 8 Jul 2021 11:30:08 +0200 Subject: [PATCH] Change List to IList in model --- FortnoxSDK/Connectors/InvoiceFileConnectionConnector.cs | 4 ++-- FortnoxSDK/Entities.Special/EmailSenders.cs | 4 ++-- FortnoxSDK/Entities.Special/EntityCollection.cs | 2 +- FortnoxSDK/Entities.Subsets/SupplierInvoiceSubset.cs | 2 +- FortnoxSDK/Entities/Archive/ArchiveFolder.cs | 4 ++-- FortnoxSDK/Entities/Contract Accruals/ContractAccrual.cs | 2 +- FortnoxSDK/Entities/Contract Templates/ContractTemplate.cs | 2 +- FortnoxSDK/Entities/Contracts/Contract.cs | 2 +- FortnoxSDK/Entities/Invoice Accruals/InvoiceAccrual.cs | 2 +- FortnoxSDK/Entities/Invoice Payments/InvoicePayment.cs | 2 +- FortnoxSDK/Entities/Invoices/Invoice.cs | 4 ++-- FortnoxSDK/Entities/Offers/Offer.cs | 2 +- FortnoxSDK/Entities/Orders/Order.cs | 2 +- .../Supplier Invoice Accruals/SupplierInvoiceAccrual.cs | 2 +- .../Supplier Invoice Payments/SupplierInvoicePayment.cs | 2 +- FortnoxSDK/Entities/Supplier Invoices/SupplierInvoice.cs | 4 ++-- FortnoxSDK/Entities/Vouchers/Voucher.cs | 2 +- FortnoxSDK/Interfaces/IInvoiceFileConnectionConnector.cs | 4 ++-- FortnoxSDK/Interfaces/ISIEConnector.cs | 2 +- FortnoxSDK/Requests/BaseRequest.cs | 6 +++--- 20 files changed, 28 insertions(+), 28 deletions(-) diff --git a/FortnoxSDK/Connectors/InvoiceFileConnectionConnector.cs b/FortnoxSDK/Connectors/InvoiceFileConnectionConnector.cs index 5f0d3dda..9bc53d25 100644 --- a/FortnoxSDK/Connectors/InvoiceFileConnectionConnector.cs +++ b/FortnoxSDK/Connectors/InvoiceFileConnectionConnector.cs @@ -22,7 +22,7 @@ public InvoiceFileConnectionConnector() Resource = "fileattachments/attachments-v1"; } - public List GetConnections(long? entityId, EntityType? entityType) + public IList GetConnections(long? entityId, EntityType? entityType) { return GetConnectionsAsync(entityId, entityType).GetResult(); } @@ -102,7 +102,7 @@ public async Task UpdateAsync(InvoiceFileConnection invoi return result; } - public async Task> GetConnectionsAsync(long? entityId, EntityType? entityType) + public async Task> GetConnectionsAsync(long? entityId, EntityType? entityType) { var request = new EntityRequest>() { diff --git a/FortnoxSDK/Entities.Special/EmailSenders.cs b/FortnoxSDK/Entities.Special/EmailSenders.cs index 50279718..a6f91c01 100644 --- a/FortnoxSDK/Entities.Special/EmailSenders.cs +++ b/FortnoxSDK/Entities.Special/EmailSenders.cs @@ -8,8 +8,8 @@ namespace Fortnox.SDK.Entities public class EmailSenders { [JsonProperty] - public List TrustedSenders { get; set; } + public IList TrustedSenders { get; set; } [JsonProperty] - public List RejectedSenders { get; set; } + public IList RejectedSenders { get; set; } } } diff --git a/FortnoxSDK/Entities.Special/EntityCollection.cs b/FortnoxSDK/Entities.Special/EntityCollection.cs index ecea70f6..548ed85a 100644 --- a/FortnoxSDK/Entities.Special/EntityCollection.cs +++ b/FortnoxSDK/Entities.Special/EntityCollection.cs @@ -8,7 +8,7 @@ public class EntityCollection { [GenericPropertyName] [JsonProperty] - public List Entities { get; set; } + public IList Entities { get; set; } [JsonProperty] internal MetaInformation MetaInformation { get; set; } diff --git a/FortnoxSDK/Entities.Subsets/SupplierInvoiceSubset.cs b/FortnoxSDK/Entities.Subsets/SupplierInvoiceSubset.cs index 67f2c28a..3a0cd7ac 100644 --- a/FortnoxSDK/Entities.Subsets/SupplierInvoiceSubset.cs +++ b/FortnoxSDK/Entities.Subsets/SupplierInvoiceSubset.cs @@ -98,7 +98,7 @@ public class SupplierInvoiceSubset public decimal? Total { get; set; } [JsonProperty] - public List Vouchers { get; set; } + public IList Vouchers { get; set; } [JsonProperty] public DateTime? FinalPayDate { get; set; } diff --git a/FortnoxSDK/Entities/Archive/ArchiveFolder.cs b/FortnoxSDK/Entities/Archive/ArchiveFolder.cs index 2d7bb162..896b6876 100644 --- a/FortnoxSDK/Entities/Archive/ArchiveFolder.cs +++ b/FortnoxSDK/Entities/Archive/ArchiveFolder.cs @@ -21,12 +21,12 @@ public class ArchiveFolder /// List of files [ReadOnly] [JsonProperty] - public List Files { get; private set; } + public IList Files { get; private set; } /// List of folders [ReadOnly] [JsonProperty] - public List Folders { get; private set; } + public IList Folders { get; private set; } /// Id of the folder [ReadOnly] diff --git a/FortnoxSDK/Entities/Contract Accruals/ContractAccrual.cs b/FortnoxSDK/Entities/Contract Accruals/ContractAccrual.cs index 6a8094de..facc5479 100644 --- a/FortnoxSDK/Entities/Contract Accruals/ContractAccrual.cs +++ b/FortnoxSDK/Entities/Contract Accruals/ContractAccrual.cs @@ -27,7 +27,7 @@ public class ContractAccrual /// [JsonProperty] - public List AccrualRows { get; set; } + public IList AccrualRows { get; set; } /// Document number [JsonProperty] diff --git a/FortnoxSDK/Entities/Contract Templates/ContractTemplate.cs b/FortnoxSDK/Entities/Contract Templates/ContractTemplate.cs index d31ac79f..bbf65a28 100644 --- a/FortnoxSDK/Entities/Contract Templates/ContractTemplate.cs +++ b/FortnoxSDK/Entities/Contract Templates/ContractTemplate.cs @@ -31,7 +31,7 @@ public class ContractTemplate /// [JsonProperty] - public List InvoiceRows { get; set; } + public IList InvoiceRows { get; set; } /// If the contract is continuous [JsonProperty] diff --git a/FortnoxSDK/Entities/Contracts/Contract.cs b/FortnoxSDK/Entities/Contracts/Contract.cs index d63a555f..053b11f2 100644 --- a/FortnoxSDK/Entities/Contracts/Contract.cs +++ b/FortnoxSDK/Entities/Contracts/Contract.cs @@ -115,7 +115,7 @@ public class Contract /// [JsonProperty] - public List InvoiceRows { get; set; } + public IList InvoiceRows { get; set; } /// Invoices remaining [ReadOnly] diff --git a/FortnoxSDK/Entities/Invoice Accruals/InvoiceAccrual.cs b/FortnoxSDK/Entities/Invoice Accruals/InvoiceAccrual.cs index 88fce7c8..aacb4500 100644 --- a/FortnoxSDK/Entities/Invoice Accruals/InvoiceAccrual.cs +++ b/FortnoxSDK/Entities/Invoice Accruals/InvoiceAccrual.cs @@ -28,7 +28,7 @@ public class InvoiceAccrual /// [JsonProperty] - public List InvoiceAccrualRows { get; set; } + public IList InvoiceAccrualRows { get; set; } /// Invoice number [JsonProperty] diff --git a/FortnoxSDK/Entities/Invoice Payments/InvoicePayment.cs b/FortnoxSDK/Entities/Invoice Payments/InvoicePayment.cs index 27b2486b..a944677a 100644 --- a/FortnoxSDK/Entities/Invoice Payments/InvoicePayment.cs +++ b/FortnoxSDK/Entities/Invoice Payments/InvoicePayment.cs @@ -119,6 +119,6 @@ public class InvoicePayment /// [JsonProperty] - public List WriteOffs { get; set; } + public IList WriteOffs { get; set; } } } \ No newline at end of file diff --git a/FortnoxSDK/Entities/Invoices/Invoice.cs b/FortnoxSDK/Entities/Invoices/Invoice.cs index 26201997..d0ce5feb 100644 --- a/FortnoxSDK/Entities/Invoices/Invoice.cs +++ b/FortnoxSDK/Entities/Invoices/Invoice.cs @@ -221,7 +221,7 @@ public class Invoice /// The properties for the object in this array is listed in the table “Invoice Rows”. [JsonProperty] - public List InvoiceRows { get; set; } + public IList InvoiceRows { get; set; } /// The type of invoice. [JsonProperty] @@ -229,7 +229,7 @@ public class Invoice /// The properties for the object in this array is listed in the table “Labels” [JsonProperty] - public List Labels { get; set; } + public IList Labels { get; set; } /// Language code. Can be SV or EN. [JsonProperty] diff --git a/FortnoxSDK/Entities/Offers/Offer.cs b/FortnoxSDK/Entities/Offers/Offer.cs index 63d147b0..28f5afa6 100644 --- a/FortnoxSDK/Entities/Offers/Offer.cs +++ b/FortnoxSDK/Entities/Offers/Offer.cs @@ -207,7 +207,7 @@ public class Offer /// [JsonProperty] - public List OfferRows { get; set; } + public IList OfferRows { get; set; } /// If document is printed or e-mailed to customer [ReadOnly] diff --git a/FortnoxSDK/Entities/Orders/Order.cs b/FortnoxSDK/Entities/Orders/Order.cs index 308b06a2..8cb0c8be 100644 --- a/FortnoxSDK/Entities/Orders/Order.cs +++ b/FortnoxSDK/Entities/Orders/Order.cs @@ -179,7 +179,7 @@ public class Order /// [JsonProperty] - public List OrderRows { get; set; } + public IList OrderRows { get; set; } /// Type of the Order. Can be Order or Backorder. [ReadOnly] diff --git a/FortnoxSDK/Entities/Supplier Invoice Accruals/SupplierInvoiceAccrual.cs b/FortnoxSDK/Entities/Supplier Invoice Accruals/SupplierInvoiceAccrual.cs index bdf89c80..5e860047 100644 --- a/FortnoxSDK/Entities/Supplier Invoice Accruals/SupplierInvoiceAccrual.cs +++ b/FortnoxSDK/Entities/Supplier Invoice Accruals/SupplierInvoiceAccrual.cs @@ -40,7 +40,7 @@ public class SupplierInvoiceAccrual /// [JsonProperty] - public List SupplierInvoiceAccrualRows { get; set; } + public IList SupplierInvoiceAccrualRows { get; set; } /// Start date [JsonProperty] diff --git a/FortnoxSDK/Entities/Supplier Invoice Payments/SupplierInvoicePayment.cs b/FortnoxSDK/Entities/Supplier Invoice Payments/SupplierInvoicePayment.cs index 0cf0ff75..1b37bb01 100644 --- a/FortnoxSDK/Entities/Supplier Invoice Payments/SupplierInvoicePayment.cs +++ b/FortnoxSDK/Entities/Supplier Invoice Payments/SupplierInvoicePayment.cs @@ -108,6 +108,6 @@ public class SupplierInvoicePayment /// [JsonProperty] - public List WriteOffs { get; set; } + public IList WriteOffs { get; set; } } } \ No newline at end of file diff --git a/FortnoxSDK/Entities/Supplier Invoices/SupplierInvoice.cs b/FortnoxSDK/Entities/Supplier Invoices/SupplierInvoice.cs index b9078c42..b5e70d19 100644 --- a/FortnoxSDK/Entities/Supplier Invoices/SupplierInvoice.cs +++ b/FortnoxSDK/Entities/Supplier Invoices/SupplierInvoice.cs @@ -136,7 +136,7 @@ public class SupplierInvoice /// [JsonProperty] - public List SupplierInvoiceRows { get; set; } + public IList SupplierInvoiceRows { get; set; } /// Supplier number [JsonProperty] @@ -165,7 +165,7 @@ public class SupplierInvoice [ReadOnly] [JsonProperty] - public List Vouchers { get; private set; } + public IList Vouchers { get; private set; } /// Voucher number for the invoice. This is created when the invoice is bookkept. [Obsolete("Seems like this is only populated in bookkeep action response. Use Vouchers property instead for other use cases")] diff --git a/FortnoxSDK/Entities/Vouchers/Voucher.cs b/FortnoxSDK/Entities/Vouchers/Voucher.cs index 9e3f4774..52eeec35 100644 --- a/FortnoxSDK/Entities/Vouchers/Voucher.cs +++ b/FortnoxSDK/Entities/Vouchers/Voucher.cs @@ -51,7 +51,7 @@ public class Voucher /// The properties for the object in this array is listed in the table for “Voucher Rows”. [JsonProperty] - public List VoucherRows { get; set; } + public IList VoucherRows { get; set; } /// Code of the voucher series. The code must be of an existing voucher series. [JsonProperty] diff --git a/FortnoxSDK/Interfaces/IInvoiceFileConnectionConnector.cs b/FortnoxSDK/Interfaces/IInvoiceFileConnectionConnector.cs index 5251ca0c..5147a260 100644 --- a/FortnoxSDK/Interfaces/IInvoiceFileConnectionConnector.cs +++ b/FortnoxSDK/Interfaces/IInvoiceFileConnectionConnector.cs @@ -11,11 +11,11 @@ public interface IInvoiceFileConnectionConnector : IEntityConnector InvoiceFileConnection Update(InvoiceFileConnection invoiceFileConnection); InvoiceFileConnection Create(InvoiceFileConnection invoiceFileConnection); void Delete(string id); - List GetConnections(long? entityId, EntityType? entityType); + IList GetConnections(long? entityId, EntityType? entityType); Task UpdateAsync(InvoiceFileConnection invoiceFileConnection); Task CreateAsync(InvoiceFileConnection invoiceFileConnection); Task DeleteAsync(string id); - Task> GetConnectionsAsync(long? entityId, EntityType? entityType); + Task> GetConnectionsAsync(long? entityId, EntityType? entityType); } } diff --git a/FortnoxSDK/Interfaces/ISIEConnector.cs b/FortnoxSDK/Interfaces/ISIEConnector.cs index 8d0b73cc..62a175ef 100644 --- a/FortnoxSDK/Interfaces/ISIEConnector.cs +++ b/FortnoxSDK/Interfaces/ISIEConnector.cs @@ -39,7 +39,7 @@ public class SIEExportOptions /// public bool? ExportAll; - public List Selection; + public IList Selection; public DateTime? FromDate; diff --git a/FortnoxSDK/Requests/BaseRequest.cs b/FortnoxSDK/Requests/BaseRequest.cs index ae9f9da2..979fbc2b 100644 --- a/FortnoxSDK/Requests/BaseRequest.cs +++ b/FortnoxSDK/Requests/BaseRequest.cs @@ -8,14 +8,14 @@ namespace Fortnox.SDK.Requests internal class BaseRequest { public HttpMethod Method { get; set; } - public Dictionary Headers { get; set; } = new Dictionary(); + public IDictionary Headers { get; set; } = new Dictionary(); public byte[] Content { get; set; } public string BaseUrl { get; set; } = APIConstants.FortnoxApi; public string Version { get; set; } = "3"; public string Resource { get; set; } - public List Indices { get; set; } = new List(); - public Dictionary Parameters { get; set; } = new Dictionary(); + public IList Indices { get; set; } = new List(); + public IDictionary Parameters { get; set; } = new Dictionary(); public string AbsoluteUrl => BuildUrl();