Skip to content

Commit

Permalink
Change List to IList in model
Browse files Browse the repository at this point in the history
  • Loading branch information
richardrandak committed Jul 8, 2021
1 parent 864b5e4 commit 4aab14d
Show file tree
Hide file tree
Showing 20 changed files with 28 additions and 28 deletions.
4 changes: 2 additions & 2 deletions FortnoxSDK/Connectors/InvoiceFileConnectionConnector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public InvoiceFileConnectionConnector()
Resource = "fileattachments/attachments-v1";
}

public List<InvoiceFileConnection> GetConnections(long? entityId, EntityType? entityType)
public IList<InvoiceFileConnection> GetConnections(long? entityId, EntityType? entityType)
{
return GetConnectionsAsync(entityId, entityType).GetResult();
}
Expand Down Expand Up @@ -102,7 +102,7 @@ public async Task<InvoiceFileConnection> UpdateAsync(InvoiceFileConnection invoi
return result;
}

public async Task<List<InvoiceFileConnection>> GetConnectionsAsync(long? entityId, EntityType? entityType)
public async Task<IList<InvoiceFileConnection>> GetConnectionsAsync(long? entityId, EntityType? entityType)
{
var request = new EntityRequest<List<InvoiceFileConnection>>()
{
Expand Down
4 changes: 2 additions & 2 deletions FortnoxSDK/Entities.Special/EmailSenders.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ namespace Fortnox.SDK.Entities
public class EmailSenders
{
[JsonProperty]
public List<TrustedEmailSender> TrustedSenders { get; set; }
public IList<TrustedEmailSender> TrustedSenders { get; set; }
[JsonProperty]
public List<TrustedEmailSender> RejectedSenders { get; set; }
public IList<TrustedEmailSender> RejectedSenders { get; set; }
}
}
2 changes: 1 addition & 1 deletion FortnoxSDK/Entities.Special/EntityCollection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public class EntityCollection<T>
{
[GenericPropertyName]
[JsonProperty]
public List<T> Entities { get; set; }
public IList<T> Entities { get; set; }

[JsonProperty]
internal MetaInformation MetaInformation { get; set; }
Expand Down
2 changes: 1 addition & 1 deletion FortnoxSDK/Entities.Subsets/SupplierInvoiceSubset.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public class SupplierInvoiceSubset
public decimal? Total { get; set; }

[JsonProperty]
public List<VoucherReference> Vouchers { get; set; }
public IList<VoucherReference> Vouchers { get; set; }

[JsonProperty]
public DateTime? FinalPayDate { get; set; }
Expand Down
4 changes: 2 additions & 2 deletions FortnoxSDK/Entities/Archive/ArchiveFolder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ public class ArchiveFolder
///<summary> List of files </summary>
[ReadOnly]
[JsonProperty]
public List<ArchiveFile> Files { get; private set; }
public IList<ArchiveFile> Files { get; private set; }

///<summary> List of folders </summary>
[ReadOnly]
[JsonProperty]
public List<ArchiveFolder> Folders { get; private set; }
public IList<ArchiveFolder> Folders { get; private set; }

///<summary> Id of the folder </summary>
[ReadOnly]
Expand Down
2 changes: 1 addition & 1 deletion FortnoxSDK/Entities/Contract Accruals/ContractAccrual.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public class ContractAccrual

///<summary> – </summary>
[JsonProperty]
public List<ContractAccrualRow> AccrualRows { get; set; }
public IList<ContractAccrualRow> AccrualRows { get; set; }

///<summary> Document number </summary>
[JsonProperty]
Expand Down
2 changes: 1 addition & 1 deletion FortnoxSDK/Entities/Contract Templates/ContractTemplate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public class ContractTemplate

///<summary> – </summary>
[JsonProperty]
public List<ContractTemplateInvoiceRow> InvoiceRows { get; set; }
public IList<ContractTemplateInvoiceRow> InvoiceRows { get; set; }

///<summary> If the contract is continuous </summary>
[JsonProperty]
Expand Down
2 changes: 1 addition & 1 deletion FortnoxSDK/Entities/Contracts/Contract.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public class Contract

///<summary> – </summary>
[JsonProperty]
public List<ContractInvoiceRow> InvoiceRows { get; set; }
public IList<ContractInvoiceRow> InvoiceRows { get; set; }

///<summary> Invoices remaining </summary>
[ReadOnly]
Expand Down
2 changes: 1 addition & 1 deletion FortnoxSDK/Entities/Invoice Accruals/InvoiceAccrual.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class InvoiceAccrual

///<summary> – </summary>
[JsonProperty]
public List<InvoiceAccrualRow> InvoiceAccrualRows { get; set; }
public IList<InvoiceAccrualRow> InvoiceAccrualRows { get; set; }

///<summary> Invoice number </summary>
[JsonProperty]
Expand Down
2 changes: 1 addition & 1 deletion FortnoxSDK/Entities/Invoice Payments/InvoicePayment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,6 @@ public class InvoicePayment

///<summary> </summary>
[JsonProperty]
public List<WriteOff> WriteOffs { get; set; }
public IList<WriteOff> WriteOffs { get; set; }
}
}
4 changes: 2 additions & 2 deletions FortnoxSDK/Entities/Invoices/Invoice.cs
Original file line number Diff line number Diff line change
Expand Up @@ -221,15 +221,15 @@ public class Invoice

///<summary> The properties for the object in this array is listed in the table “Invoice Rows”. </summary>
[JsonProperty]
public List<InvoiceRow> InvoiceRows { get; set; }
public IList<InvoiceRow> InvoiceRows { get; set; }

///<summary> The type of invoice.</summary>
[JsonProperty]
public InvoiceType? InvoiceType { get; set; }

///<summary> The properties for the object in this array is listed in the table “Labels” </summary>
[JsonProperty]
public List<LabelReference> Labels { get; set; }
public IList<LabelReference> Labels { get; set; }

///<summary> Language code. Can be SV or EN. </summary>
[JsonProperty]
Expand Down
2 changes: 1 addition & 1 deletion FortnoxSDK/Entities/Offers/Offer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ public class Offer

///<summary> – </summary>
[JsonProperty]
public List<OfferRow> OfferRows { get; set; }
public IList<OfferRow> OfferRows { get; set; }

///<summary> If document is printed or e-mailed to customer </summary>
[ReadOnly]
Expand Down
2 changes: 1 addition & 1 deletion FortnoxSDK/Entities/Orders/Order.cs
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ public class Order

///<summary> </summary>
[JsonProperty]
public List<OrderRow> OrderRows { get; set; }
public IList<OrderRow> OrderRows { get; set; }

///<summary> Type of the Order. Can be Order or Backorder. </summary>
[ReadOnly]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public class SupplierInvoiceAccrual

///<summary> – </summary>
[JsonProperty]
public List<SupplierInvoiceAccrualRow> SupplierInvoiceAccrualRows { get; set; }
public IList<SupplierInvoiceAccrualRow> SupplierInvoiceAccrualRows { get; set; }

///<summary> Start date </summary>
[JsonProperty]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,6 @@ public class SupplierInvoicePayment

///<summary> </summary>
[JsonProperty]
public List<WriteOff> WriteOffs { get; set; }
public IList<WriteOff> WriteOffs { get; set; }
}
}
4 changes: 2 additions & 2 deletions FortnoxSDK/Entities/Supplier Invoices/SupplierInvoice.cs
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ public class SupplierInvoice

///<summary> – </summary>
[JsonProperty]
public List<SupplierInvoiceRow> SupplierInvoiceRows { get; set; }
public IList<SupplierInvoiceRow> SupplierInvoiceRows { get; set; }

///<summary> Supplier number </summary>
[JsonProperty]
Expand Down Expand Up @@ -165,7 +165,7 @@ public class SupplierInvoice

[ReadOnly]
[JsonProperty]
public List<VoucherReference> Vouchers { get; private set; }
public IList<VoucherReference> Vouchers { get; private set; }

///<summary> Voucher number for the invoice. This is created when the invoice is bookkept.</summary>
[Obsolete("Seems like this is only populated in bookkeep action response. Use Vouchers property instead for other use cases")]
Expand Down
2 changes: 1 addition & 1 deletion FortnoxSDK/Entities/Vouchers/Voucher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public class Voucher

///<summary> The properties for the object in this array is listed in the table for “Voucher Rows”. </summary>
[JsonProperty]
public List<VoucherRow> VoucherRows { get; set; }
public IList<VoucherRow> VoucherRows { get; set; }

///<summary> Code of the voucher series. The code must be of an existing voucher series. </summary>
[JsonProperty]
Expand Down
4 changes: 2 additions & 2 deletions FortnoxSDK/Interfaces/IInvoiceFileConnectionConnector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ public interface IInvoiceFileConnectionConnector : IEntityConnector
InvoiceFileConnection Update(InvoiceFileConnection invoiceFileConnection);
InvoiceFileConnection Create(InvoiceFileConnection invoiceFileConnection);
void Delete(string id);
List<InvoiceFileConnection> GetConnections(long? entityId, EntityType? entityType);
IList<InvoiceFileConnection> GetConnections(long? entityId, EntityType? entityType);

Task<InvoiceFileConnection> UpdateAsync(InvoiceFileConnection invoiceFileConnection);
Task<InvoiceFileConnection> CreateAsync(InvoiceFileConnection invoiceFileConnection);
Task DeleteAsync(string id);
Task<List<InvoiceFileConnection>> GetConnectionsAsync(long? entityId, EntityType? entityType);
Task<IList<InvoiceFileConnection>> GetConnectionsAsync(long? entityId, EntityType? entityType);
}
}
2 changes: 1 addition & 1 deletion FortnoxSDK/Interfaces/ISIEConnector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public class SIEExportOptions
/// </summary>
public bool? ExportAll;

public List<VoucherSelection> Selection;
public IList<VoucherSelection> Selection;

public DateTime? FromDate;

Expand Down
6 changes: 3 additions & 3 deletions FortnoxSDK/Requests/BaseRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ namespace Fortnox.SDK.Requests
internal class BaseRequest
{
public HttpMethod Method { get; set; }
public Dictionary<string, string> Headers { get; set; } = new Dictionary<string, string>();
public IDictionary<string, string> Headers { get; set; } = new Dictionary<string, string>();
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<string> Indices { get; set; } = new List<string>();
public Dictionary<string, string> Parameters { get; set; } = new Dictionary<string, string>();
public IList<string> Indices { get; set; } = new List<string>();
public IDictionary<string, string> Parameters { get; set; } = new Dictionary<string, string>();

public string AbsoluteUrl => BuildUrl();

Expand Down

0 comments on commit 4aab14d

Please sign in to comment.