Skip to content

Commit

Permalink
273 nullability warnings to go
Browse files Browse the repository at this point in the history
  • Loading branch information
Viincenttt committed Mar 24, 2024
1 parent 5997c2b commit 4664b20
Show file tree
Hide file tree
Showing 12 changed files with 38 additions and 38 deletions.
16 changes: 8 additions & 8 deletions src/Mollie.Api/Models/Balance/Response/BalanceResponse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,45 +22,45 @@ public class BalanceResponse : IResponseObject {
/// <summary>
/// The balance’s ISO 4217 currency code.
/// </summary>
public string Currency { get; set; }
public required string Currency { get; init; }

/// <summary>
/// The status of the balance.
/// </summary>
[JsonConverter(typeof(StringEnumConverter))]
public BalanceResponseStatus Status { get; set; }
public required BalanceResponseStatus Status { get; init; }

/// <summary>
/// The frequency at which the available amount on the balance will be settled to the configured transfer destination.
/// See transferDestination.
/// </summary>
public string TransferFrequency { get; set; }
public required string TransferFrequency { get; init; }

/// <summary>
/// The minimum amount configured for scheduled automatic settlements. As soon as the amount on the balance exceeds this threshold,
/// the complete balance will be paid out to the transferDestination according to the configured transferFrequency.
/// </summary>
public Amount TransferThreshold { get; set; }
public required Amount TransferThreshold { get; init; }

/// <summary>
/// The transfer reference set to be included in all the transfers for this balance. Either a string or null.
/// </summary>
public string TransferReference { get; set; }
public string? TransferReference { get; set; }

/// <summary>
/// The destination where the available amount will be automatically transferred to according to the configured transferFrequency.
/// </summary>
public BalanceTransferDestination TransferDestination { get; set; }
public required BalanceTransferDestination TransferDestination { get; init; }

/// <summary>
/// The amount directly available on the balance, e.g. {"currency":"EUR", "value":"100.00"}.
/// </summary>
public Amount AvailableAmount { get; set; }
public required Amount AvailableAmount { get; init; }

/// <summary>
/// The total amount that is queued to be transferred to your balance. For example, a credit card payment can take a few days to clear.
/// </summary>
public Amount PendingAmount { get; set; }
public required Amount PendingAmount { get; init; }

/// <summary>
/// An object with several URL objects relevant to the balance. Every URL object will contain an href and a type field.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ public class BalanceResponseLinks {
/// <summary>
/// The API resource URL of the balance itself.
/// </summary>
public UrlObjectLink<BalanceResponse> Self { get; set; }
public required UrlObjectLink<BalanceResponse> Self { get; init; }

/// <summary>
/// The URL to the order retrieval endpoint documentation.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,28 +17,28 @@ public class BalanceTransaction {
/// <summary>
/// The type of movement, for example payment or refund. See Mollie docs for a full list of values
/// </summary>
public string Type { get; set; }
public required string Type { get; init; }

/// <summary>
/// The final amount that was moved to or from the balance, e.g. {"currency":"EUR", "value":"100.00"}.
/// If the transaction moves funds away from the balance, for example when it concerns a refund, the
/// amount will be negative.
/// </summary>
public Amount ResultAmount { get; set; }
public required Amount ResultAmount { get; init; }

/// <summary>
/// The amount that was to be moved to or from the balance, excluding deductions. If the transaction
/// moves funds away from the balance, for example when it concerns a refund, the amount will be negative.
/// </summary>
public Amount InitialAmount { get; set; }
public required Amount InitialAmount { get; init; }

/// <summary>
/// The total amount of deductions withheld from the movement. For example, if a €10,00 payment comes in
/// with a €0,29 fee, the deductions amount will be {"currency":"EUR", "value":"-0.29"}. When moving funds
/// to a balance, we always round the deduction to a ‘real’ amount. Any differences between these realtime
/// rounded amounts and the final invoice will be compensated when the invoice is generated.
/// </summary>
public Amount Deductions { get; set; }
public required Amount Deductions { get; init; }

/// <summary>
/// The date and time of the movement, in ISO 8601 format.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@ public class BalanceTransactionResponse {
/// The number of transactions found in _embedded, which is either the requested number
/// (with a maximum of 250) or the default number.
/// </summary>
public int Count { get; set; }
public required int Count { get; init; }

/// <summary>
/// The object containing the queried data.
/// </summary>
[JsonProperty("_embedded")]
public BalanceTransactionEmbeddedResponse Embedded { get; set; }
public required BalanceTransactionEmbeddedResponse Embedded { get; init; }

/// <summary>
/// Links to help navigate through the lists of balance transactions. Every URL object will contain an href and a type field.
/// </summary>
[JsonProperty("_links")]
public BalanceTransactionResponseLinks Links { get; set; }
public required BalanceTransactionResponseLinks Links { get; init; }
}

public class BalanceTransactionEmbeddedResponse {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ public class BalanceTransactionResponseLinks {
/// <summary>
/// The URL to the current set of balance transactions.
/// </summary>
public UrlObjectLink<BalanceTransactionResponse> Self { get; set; }
public required UrlObjectLink<BalanceTransactionResponse> Self { get; init; }

/// <summary>
/// The previous set of balance transactions, if available.
/// </summary>
public UrlLink Previous { get; set; }
public required UrlLink Previous { get; init; }

/// <summary>
/// The next set of balance transactions, if available.
/// </summary>
public UrlLink Next { get; set; }
public required UrlLink Next { get; init; }

/// <summary>
/// The URL to the balance transactions list endpoint documentation.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
namespace Mollie.Api.Models.Balance.Response.BalanceTransaction.Specific {
public class CaptureBalanceTransaction : BalanceTransaction {
public CaptureTransactionContext Context { get; set; }
public required CaptureTransactionContext Context { get; init; }
}

public class CaptureTransactionContext {
public string PaymentId { get; set; }
public string CaptureId { get; set; }
public required string PaymentId { get; init; }
public required string CaptureId { get; init; }
}
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
namespace Mollie.Api.Models.Balance.Response.BalanceTransaction.Specific {
public class ChargebackBalanceTransaction : BalanceTransaction {
public ChargebackTransactionContext Context { get; set; }
public required ChargebackTransactionContext Context { get; init; }
}

public class ChargebackTransactionContext {
public string PaymentId { get; set; }
public string ChargebackId { get; set; }
public required string PaymentId { get; init; }
public required string ChargebackId { get; init; }
}
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
namespace Mollie.Api.Models.Balance.Response.BalanceTransaction.Specific {
public class InvoiceBalanceTransaction : BalanceTransaction {
public InvoiceTransactionContext Context { get; set; }
public required InvoiceTransactionContext Context { get; init; }
}

public class InvoiceTransactionContext {
public string InvoiceId { get; set; }
public required string InvoiceId { get; init; }
}
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
namespace Mollie.Api.Models.Balance.Response.BalanceTransaction.Specific {
public class PaymentBalanceTransaction : BalanceTransaction {
public PaymentTransactionContext Context { get; set; }
public required PaymentTransactionContext Context { get; init; }
}

public class PaymentTransactionContext {
public string PaymentId { get; set; }
public required string PaymentId { get; init; }
}
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
namespace Mollie.Api.Models.Balance.Response.BalanceTransaction.Specific {
public class RefundBalanceTransaction : BalanceTransaction {
public RefundTransactionContext Context { get; set; }
public required RefundTransactionContext Context { get; init; }
}

public class RefundTransactionContext {
public string PaymentId { get; set; }
public string RefundId { get; set; }
public required string PaymentId { get; init; }
public required string RefundId { get; init; }
}
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
namespace Mollie.Api.Models.Balance.Response.BalanceTransaction.Specific {
public class SettlementBalanceTransaction : BalanceTransaction {
public SettlementTransactionContext Context { get; set; }
public required SettlementTransactionContext Context { get; init; }
}

public class SettlementTransactionContext {
public string TransferId { get; set; }
public string SettlementId { get; set; }
public required string TransferId { get; init; }
public required string SettlementId { get; init; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@ public class BalanceTransferDestination {
/// <summary>
/// The default destination of automatic scheduled transfers. Currently only bank-account is supported.
/// </summary>
public string Type { get; set; }
public required string Type { get; init; }

/// <summary>
/// The configured bank account number of the beneficiary the balance amount is to be transferred to.
/// </summary>
public string BankAccount { get; set; }
public required string BankAccount { get; init; }

/// <summary>
/// The full name of the beneficiary the balance amount is to be transferred to.
/// </summary>
public string BeneficiaryName { get; set; }
public required string BeneficiaryName { get; init; }

public override string ToString() {
return $"{Type} - {BankAccount} - {BeneficiaryName}";
Expand Down

0 comments on commit 4664b20

Please sign in to comment.