Skip to content

Commit

Permalink
Less then 500 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 bedaad2 commit fc497ce
Show file tree
Hide file tree
Showing 18 changed files with 75 additions and 79 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ public class PaymentLinkResponse : IResponseObject
/// <summary>
/// The URL your customer will be redirected to after completing the payment process.
/// </summary>
public string RedirectUrl { get; set; }
public string? RedirectUrl { get; set; }

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

/// <summary>
/// The payment link’s date and time of creation, in ISO 8601 format.
Expand All @@ -62,7 +62,6 @@ public class PaymentLinkResponse : IResponseObject
/// </summary>
public DateTime? UpdatedAt { get; set; }


/// <summary>
/// The expiry date and time of the payment link, in ISO 8601 format.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,27 +1,20 @@
using Mollie.Api.Models.Chargeback;
using Mollie.Api.Models.Customer;
using Mollie.Api.Models.List;
using Mollie.Api.Models.Mandate;
using Mollie.Api.Models.Settlement;
using Mollie.Api.Models.Subscription;
using Mollie.Api.Models.Url;
using Mollie.Api.Models.Url;

namespace Mollie.Api.Models.PaymentLink.Response {
public class PaymentLinkResponseLinks {
/// <summary>
/// The API resource URL of the payment link itself.
/// </summary>
public UrlObjectLink<PaymentLinkResponse> Self { get; set; }
public required UrlObjectLink<PaymentLinkResponse> Self { get; init; }

/// <summary>
/// Direct link to the payment link.
/// </summary>
public UrlLink PaymentLink { get; set; }
public required UrlLink PaymentLink { get; init; }

/// <summary>
///The URL to the payment link retrieval endpoint documentation.
/// </summary>
public UrlLink Documentation { get; set; }

public required UrlLink Documentation { get; init; }
}
}
16 changes: 8 additions & 8 deletions src/Mollie.Api/Models/PaymentMethod/PaymentMethodResponse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,41 +18,41 @@ public class PaymentMethodResponse : IResponseObject {
/// <summary>
/// The full name of the payment method.
/// </summary>
public string Description { get; set; }
public required string Description { get; init; }

/// <summary>
/// Minimum payment amount required to use this payment method.
/// </summary>
public Amount MinimumAmount { get; set; }
public required Amount MinimumAmount { get; init; }

/// <summary>
/// Maximum payment amount allowed when using this payment method. (Could be null)
/// </summary>
public Amount MaximumAmount { get; set; }
public required Amount MaximumAmount { get; init; }

/// <summary>
/// URLs of images representing the payment method.
/// </summary>
public PaymentMethodResponseImage Image { get; set; }
public required PaymentMethodResponseImage Image { get; init; }

/// <summary>
/// List of Issuers
/// </summary>
public List<IssuerResponse> Issuers { get; set; }
public List<IssuerResponse>? Issuers { get; set; }

/// <summary>
/// Pricing set of the payment method what will be include if you add the parameter.
/// </summary>
public List<PricingResponse> Pricing { get; set; }
public List<PricingResponse>? Pricing { get; set; }

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

public override string ToString() {
return this.Description;
return Description;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,20 @@ public class PaymentMethodResponseImage {
/// <summary>
/// The URL for a payment method icon of 55x37 pixels.
/// </summary>
public string Size1x { get; set; }
public required string Size1x { get; init; }

/// <summary>
/// The URL for a payment method icon of 110x74 pixels. Use this for high resolution screens.
/// </summary>
public string Size2x { get; set; }
public required string Size2x { get; init; }

/// <summary>
/// The URL for a payment method icon in vector format. Usage of this format is preferred since it can scale to any desired size.
/// </summary>
public string Svg { get; set; }
public required string Svg { get; init; }

public override string ToString() {
return this.Size1x;
return Size1x;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ public class PaymentMethodResponseLinks {
/// <summary>
/// The API resource URL of the payment method itself.
/// </summary>
public UrlObjectLink<PaymentMethodResponse> Self { get; set; }
public required UrlObjectLink<PaymentMethodResponse> Self { get; init; }

/// <summary>
/// The URL to the payment method retrieval endpoint documentation.
/// </summary>
public UrlLink Documentation { get; set; }
public required UrlLink Documentation { get; init; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ public class FixedPricingResponse : IResponseObject {
/// <summary>
/// The ISO 4217 currency code.
/// </summary>
public string Currency { get; set; }
public required string Currency { get; init; }

/// <summary>
/// A string containing the exact amount in the given currency.
/// </summary>
public decimal Value { get; set; }
public required decimal Value { get; init; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,23 @@ public class PricingResponse : IResponseObject {
/// <summary>
/// The area or product-type where the pricing is applied for, translated in the optional locale passed.
/// </summary>
public string Description { get; set; }
public required string Description { get; init; }

/// <summary>
/// The fixed price per transaction
/// </summary>
public FixedPricingResponse Fixed { get; set; }
public required FixedPricingResponse Fixed { get; init; }

/// <summary>
/// A string containing the percentage what will be charged over the payment amount besides the fixed price.
/// </summary>
public decimal Variable { get; set; }
public required decimal Variable { get; init; }

/// <summary>
/// This value is only available for credit card rates. It will correspond with the regions as documented in
/// the Payments API. See the Mollie.Api.Models.Payment.Response.CreditCardFeeRegion class for a full list of
/// known values.
/// </summary>
public string FeeRegion { get; set; }
public required string? FeeRegion { get; set; }
}
}
4 changes: 2 additions & 2 deletions src/Mollie.Api/Models/Permission/PermissionResponse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class PermissionResponse : IResponseObject {
/// <summary>
/// A short description of what the permission allows.
/// </summary>
public string Description { get; set; }
public required string Description { get; init; }

/// <summary>
/// Whether this permission is granted to the app by the organization or not.
Expand All @@ -27,6 +27,6 @@ public class PermissionResponse : IResponseObject {
/// An object with several URL objects relevant to the permission. Every URL object will contain an href and a type field.
/// </summary>
[JsonProperty("_links")]
public PermissionResponseLinks Links { get; set; }
public required PermissionResponseLinks Links { get; init; }
}
}
4 changes: 2 additions & 2 deletions src/Mollie.Api/Models/Permission/PermissionResponseLInks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ public class PermissionResponseLinks {
/// <summary>
/// The API resource URL of the permission itself.
/// </summary>
public UrlObjectLink<PermissionResponse> Self { get; set; }
public required UrlObjectLink<PermissionResponse> Self { get; init; }

/// <summary>
/// The URL to the permission retrieval endpoint documentation.
/// </summary>
public UrlLink Documentation { get; set; }
public required UrlLink Documentation { get; init; }
}
}
17 changes: 8 additions & 9 deletions src/Mollie.Api/Models/Profile/Request/ProfileRequest.cs
Original file line number Diff line number Diff line change
@@ -1,43 +1,42 @@
using System;
using System.Collections.Generic;
using System.Collections.Generic;

namespace Mollie.Api.Models.Profile.Request {
public class ProfileRequest {
/// <summary>
/// The profile's name should reflect the tradename or brand name of the profile's website or application.
/// </summary>
public string Name { get; set; }
public required string Name { get; init; }

/// <summary>
/// The URL to the profile's website or application. The URL should start with http:// or https://.
/// </summary>
public string Website { get; set; }
public required string Website { get; init; }

/// <summary>
/// The email address associated with the profile's tradename or brand.
/// </summary>
public string Email { get; set; }
public required string Email { get; init; }

/// <summary>
/// The phone number associated with the profile's tradename or brand.
/// </summary>
public string Phone { get; set; }
public required string Phone { get; init; }

/// <summary>
/// The products or services that the profile’s website offers.
/// </summary>
public string Description { get; set; }
public string? Description { get; set; }

/// <summary>
/// The list of countries where you expect that the majority of the profile’s customers will live, in ISO 3166-1 alpha-2 format.
/// </summary>
public IEnumerable<string> CountriesOfActivity { get; set; }
public IEnumerable<string>? CountriesOfActivity { get; set; }

/// <summary>
/// The industry associated with the profile’s trade name or brand. Please refer to the documentation of the business category
/// for more information on which values are accepted.
/// </summary>
public string BusinessCategory { get; set; }
public string? BusinessCategory { get; set; }

/// <summary>
/// Optional – Creating a test profile by setting this parameter to test, enables you to start using the API without
Expand Down
2 changes: 1 addition & 1 deletion src/Mollie.Api/Models/Profile/Response/ApiKey.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class ApiKey {
/// The actual API key, which you'll use when creating payments or when otherwise communicating with the API. Never
/// share the API key with anyone.
/// </summary>
public string Key { get; set; }
public required string Key { get; init; }

/// <summary>
/// The API key's date and time of creation.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@ public class EnableGiftCardIssuerResponse {
/// <summary>
/// The full name of the gift card issuer.
/// </summary>
public string Description { get; set; }
public required string Description { get; init; }

/// <summary>
/// The status that the issuer is in. Possible values: pending-issuer or activated.
/// </summary>
public string Status { get; set; }
public required string Status { get; init; }

/// <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 EnableGiftCardIssuerResponseLinks Links { get; set; }
public required EnableGiftCardIssuerResponseLinks Links { get; init; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ public class EnableGiftCardIssuerResponseLinks {
/// <summary>
/// The API resource URL of the gift card issuer itself.
/// </summary>
public UrlLink Self { get; set; }
public required UrlLink Self { get; init; }

/// <summary>
/// The URL to the gift card issuer retrieval endpoint documentation.
/// </summary>
public UrlLink Documentation { get; set; }
public required UrlLink Documentation { get; init; }
}
}
Loading

0 comments on commit fc497ce

Please sign in to comment.