Skip to content

Commit

Permalink
319 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 7f772ba commit 66a817b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 14 deletions.
10 changes: 5 additions & 5 deletions src/Mollie.Api/Models/Chargeback/ChargebackResponse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ public class ChargebackResponse : IResponseObject {
/// <summary>
/// The amount charged back.
/// </summary>
public Amount Amount { get; set; }
public required Amount Amount { get; init; }

/// <summary>
/// This optional field will contain the amount that will be deducted from your account, converted to the currency
/// your account is settled in. It follows the same syntax as the amount property.
/// </summary>
public Amount SettlementAmount { get; set; }
public Amount? SettlementAmount { get; set; }

/// <summary>
/// The date and time the chargeback was issued, in ISO 8601 format.
Expand All @@ -32,17 +32,17 @@ public class ChargebackResponse : IResponseObject {
/// <summary>
/// The id of the payment this chargeback belongs to.
/// </summary>
public string PaymentId { get; set; }
public required string PaymentId { get; init; }

/// <summary>
/// The reason given for a Chargeback, this can help determine the cost for the chargeback
/// </summary>
public ChargebackResponseReason Reason { get; set; }
public ChargebackResponseReason? Reason { get; set; }

/// <summary>
/// An object with several URL objects relevant to the chargeback. Every URL object will contain an href and a type field.
/// </summary>
[JsonProperty("_links")]
public ChargebackResponseLinks Links { get; set; }
public required ChargebackResponseLinks Links { get; init; }
}
}
6 changes: 3 additions & 3 deletions src/Mollie.Api/Models/Chargeback/ChargebackResponseLinks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ public class ChargebackResponseLinks {
/// <summary>
/// The API resource URL of the chargeback itself.
/// </summary>
public UrlObjectLink<ChargebackResponse> Self { get; set; }
public required UrlObjectLink<ChargebackResponse> Self { get; init; }

/// <summary>
/// The API resource URL of the payment this chargeback belongs to.
/// </summary>
public UrlObjectLink<PaymentResponse> Payment { get; set; }
public required UrlObjectLink<PaymentResponse> Payment { get; init; }

/// <summary>
/// The API resource URL of the settlement this payment has been settled with. Not present if not yet settled.
/// </summary>
public UrlObjectLink<SettlementResponse> Settlement { get; set; }
public UrlObjectLink<SettlementResponse>? Settlement { get; set; }

/// <summary>
/// The URL to the chargeback retrieval endpoint documentation.
Expand Down
8 changes: 2 additions & 6 deletions src/Mollie.Api/Models/Chargeback/ChargebackResponseReason.cs
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace Mollie.Api.Models.Chargeback {
public class ChargebackResponseReason {
/// <summary>
/// The reason for the chargeback, these are documented here on Mollie's webiste https://help.mollie.com/hc/en-us/articles/115000309865-Why-did-my-direct-debit-payment-fail-
/// </summary>
public string Code { get; set; }
public required string Code { get; init; }
/// <summary>
/// an accompanying note to the code
/// </summary>
public string Description { get; set; }
public required string Description { get; init; }
}
}

0 comments on commit 66a817b

Please sign in to comment.