Skip to content

Commit

Permalink
309 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 66a817b commit 5997c2b
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 16 deletions.
8 changes: 4 additions & 4 deletions src/Mollie.Api/Models/ClientLink/Request/ClientLinkOwner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,24 @@ public class ClientLinkOwner
/// <summary>
/// The email address of your customer.
/// </summary>
public string Email { get; set; }
public required string Email { get; init; }

/// <summary>
/// The given name (first name) of your customer.
/// </summary>
public string GivenName { get; set; }
public required string GivenName { get; init; }

/// <summary>
/// The family name (surname) of your customer.
/// </summary>
public string FamilyName { get; set; }
public required string FamilyName { get; init; }

/// <summary>
/// Allows you to preset the language to be used in the login / authorize flow. When this parameter is
/// omitted, the browser language will be used instead. You can provide any xx_XX format ISO 15897 locale,
/// but the authorize flow currently only supports the following languages:
/// en_US nl_NL nl_BE fr_FR fr_BE de_DE es_ES it_IT
/// </summary>
public string Locale { get; set; }
public string? Locale { get; set; }
}
}
10 changes: 5 additions & 5 deletions src/Mollie.Api/Models/ClientLink/Request/ClientLinkRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,29 @@ public class ClientLinkRequest
/// <summary>
/// Personal data of your customer which is required for this endpoint.
/// </summary>
public ClientLinkOwner Owner { get; set; }
public required ClientLinkOwner Owner { get; init; }

/// <summary>
/// Name of the organization.
/// </summary>
public string Name { get; set; }
public required string Name { get; init; }

/// <summary>
/// Address of the organization. Note that the country parameter
/// must always be provided.
/// </summary>
public AddressObject Address { get; set; }
public required AddressObject Address { get; init; }

/// <summary>
/// The Chamber of Commerce (or local equivalent) registration number
/// of the organization.
/// </summary>
public string RegistrationNumber { get; set; }
public string? RegistrationNumber { get; set; }

/// <summary>
/// The VAT number of the organization, if based in the European Union
/// or the United Kingdom.
/// </summary>
public string VatNumber { get; set; }
public string? VatNumber { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
using Mollie.Api.Models.Url;

namespace Mollie.Api.Models.ClientLink.Response
{
public class ClientLinkResponseLinks
{
public UrlLink ClientLink { get; set; }
namespace Mollie.Api.Models.ClientLink.Response {
public class ClientLinkResponseLinks {
public required UrlLink ClientLink { get; init; }
public required UrlLink Documentation { get; init; }
}
}
14 changes: 12 additions & 2 deletions tests/Mollie.Tests.Unit/Client/ClientLinkClientTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using System.Threading.Tasks;
using FluentAssertions;
using Mollie.Api.Client;
using Mollie.Api.Models;
using Mollie.Api.Models.Chargeback;
using Mollie.Api.Models.ClientLink.Request;
using Mollie.Api.Models.ClientLink.Response;
Expand All @@ -24,10 +25,19 @@ public async Task CreateClientLinkAsync_ResponseIsDeserializedInExpectedFormat()
mockHttp.When( HttpMethod.Post, $"{BaseMollieClient.ApiEndPoint}client-links")
.Respond("application/json", clientLinkResponseJson);
HttpClient httpClient = mockHttp.ToHttpClient();
ClientLinkClient clientLinkClient = new ClientLinkClient("clientId", "access_1234", httpClient);
ClientLinkClient clientLinkClient = new ClientLinkClient("clientId", "access_1234", httpClient);
var request = new ClientLinkRequest {
Owner = new ClientLinkOwner {
Email = "email",
GivenName = "gicen-name",
FamilyName = "family-name"
},
Address = new AddressObject(),
Name = "name"
};

// When: We send the request
ClientLinkResponse response = await clientLinkClient.CreateClientLinkAsync(new ClientLinkRequest());
ClientLinkResponse response = await clientLinkClient.CreateClientLinkAsync(request);

// Then
response.Id.Should().Be(clientLinkId);
Expand Down

0 comments on commit 5997c2b

Please sign in to comment.