Skip to content

Commit

Permalink
69 nullability warnings to go
Browse files Browse the repository at this point in the history
  • Loading branch information
Viincenttt committed Mar 26, 2024
1 parent 34aa215 commit 3de6d4d
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 25 deletions.
6 changes: 3 additions & 3 deletions src/Mollie.Api/Models/Order/Response/OrderEmbeddedResponse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ namespace Mollie.Api.Models.Order.Response {

public class OrderEmbeddedResponse : IResponseObject {

public IEnumerable<PaymentResponse> Payments { get; set; }
public IEnumerable<PaymentResponse>? Payments { get; set; }

public IEnumerable<RefundResponse> Refunds { get; set; }
public IEnumerable<RefundResponse>? Refunds { get; set; }

public IEnumerable<ShipmentResponse> Shipments { get; set; }
public IEnumerable<ShipmentResponse>? Shipments { get; set; }
}
}
8 changes: 4 additions & 4 deletions src/Mollie.Api/Models/Order/Response/OrderLineResponse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,24 @@ public class OrderLineResponse {
/// <summary>
/// The ID of the order the line belongs too, for example ord_kEn1PlbGa.
/// </summary>
public string OrderId { get; set; }
public required string OrderId { get; init; }

/// <summary>
/// The type of product bought, for example, a physical or a digital product. See the
/// Mollie.Api.Models.Order.OrderLineDetailsType class for a full list of known values.
/// </summary>
public string Type { get; set; }
public string? Type { get; set; }

/// <summary>
/// A description of the order line, for example LEGO 4440 Forest Police Station.
/// </summary>
public string Name { get; set; }
public required string Name { get; init; }

/// <summary>
/// Status of the order line - See the Mollie.Api.Models.Order.OrderLineStatus class for
/// a full list of known values.
/// </summary>
public string Status { get; set; }
public required string Status { get; init; }

/// <summary>
/// Whether or not the order line can be (partially) canceled.
Expand Down
36 changes: 18 additions & 18 deletions src/Mollie.Api/Models/Order/Response/OrderResponse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ public class OrderResponse : IResponseObject {
/// <summary>
/// The profile the order was created on, for example pfl_v9hTwCvYqw.
/// </summary>
public string ProfileId { get; set; }
public required string ProfileId { get; init; }

/// <summary>
/// The payment method last used when paying for the order - See the
/// Mollie.Api.Models.Payment.PaymentMethod class for a full list of known values.
/// </summary>
public string Method { get; set; }
public string? Method { get; set; }

/// <summary>
/// The mode used to create this order.
Expand All @@ -37,32 +37,32 @@ public class OrderResponse : IResponseObject {
/// <summary>
/// The total amount of the order, including VAT and discounts.
/// </summary>
public Amount Amount { get; set; }
public required Amount Amount { get; init; }

/// <summary>
/// The amount captured, thus far. The captured amount will be settled to your account.
/// </summary>
public Amount AmountCaptured { get; set; }
public Amount? AmountCaptured { get; set; }

/// <summary>
/// The total amount refunded, thus far.
/// </summary>
public Amount AmountRefunded { get; set; }
public Amount? AmountRefunded { get; set; }

/// <summary>
/// The status of the order - See the Mollie.Api.Models.Order.OrderStatus class for a full list of known values.
/// </summary>
public string Status { get; set; }
public required string Status { get; init; }

/// <summary>
/// Whether or not the order can be (partially) canceled.
/// </summary>
public bool IsCancelable { get; set; }
public required bool IsCancelable { get; init; }

/// <summary>
/// The person and the address the order is billed to. See below.
/// </summary>
public OrderAddressDetails BillingAddress { get; set; }
public OrderAddressDetails? BillingAddress { get; set; }

/// <summary>
/// The date of birth of your customer, if available.
Expand All @@ -72,30 +72,30 @@ public class OrderResponse : IResponseObject {
/// <summary>
/// Your order number that was used when creating the order.
/// </summary>
public string OrderNumber { get; set; }
public required string OrderNumber { get; init; }

/// <summary>
/// The person and the address the order is billed to. See below.
/// </summary>
public OrderAddressDetails ShippingAddress { get; set; }
public OrderAddressDetails? ShippingAddress { get; set; }

/// <summary>
/// The locale used during checkout.
/// </summary>
public string Locale { get; set; }
public required string Locale { get; init; }

/// <summary>
/// Provide any data you like, for example a string or a JSON object. We will save the data
/// alongside the order. Whenever you fetch the order with our API, we’ll also include the
/// metadata. You can use up to approximately 1kB.
/// </summary>
[JsonConverter(typeof(RawJsonConverter))]
public string Metadata { get; set; }
public string? Metadata { get; set; }

/// <summary>
/// The URL your customer will be redirected to after completing or canceling the payment process.
/// </summary>
public string RedirectUrl { get; set; }
public string? RedirectUrl { get; set; }

/// <summary>
/// The optional redirect URL you provided during payment creation. Consumer that explicitly cancel the
Expand All @@ -107,12 +107,12 @@ public class OrderResponse : IResponseObject {
///
/// The URL will be null for recurring orders.
/// </summary>
public string CancelUrl { get; set; }
public string? CancelUrl { get; set; }

/// <summary>
/// The URL Mollie will call as soon an important status change on the order takes place.
/// </summary>
public string WebhookUrl { get; set; }
public string? WebhookUrl { get; set; }

/// <summary>
/// The order’s date and time of creation, in ISO 8601 format.
Expand Down Expand Up @@ -150,16 +150,16 @@ public class OrderResponse : IResponseObject {
/// </summary>
public DateTime? CompletedAt { get; set; }

public IEnumerable<OrderLineResponse> Lines { get; set; }
public required IEnumerable<OrderLineResponse> Lines { get; init; }

[JsonProperty("_embedded")]
public OrderEmbeddedResponse Embedded { get; set; }
public OrderEmbeddedResponse? Embedded { get; set; }

/// <summary>
/// An object with several URL objects relevant to the order. Every URL object will contain an href and a type field.
/// </summary>
[JsonProperty("_links")]
public OrderResponseLinks Links { get; set; }
public required OrderResponseLinks Links { get; init; }

public T? GetMetadata<T>(JsonSerializerSettings? jsonSerializerSettings = null) {
return Metadata != null ? JsonConvert.DeserializeObject<T>(this.Metadata, jsonSerializerSettings) : default;
Expand Down

0 comments on commit 3de6d4d

Please sign in to comment.