Skip to content

Commit

Permalink
Use ModelName -> Request/Response namespaces everywhere
Browse files Browse the repository at this point in the history
  • Loading branch information
Viincenttt committed May 14, 2024
1 parent 0a9bf53 commit 130b6da
Show file tree
Hide file tree
Showing 65 changed files with 140 additions and 94 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
@page "/payment-method/overview"
@using Mollie.Api.Models.List.Response
@using Mollie.Api.Models.PaymentMethod.Response

@inject IPaymentMethodClient PaymentMethodClient

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

@using Mollie.WebApplication.Blazor.Models.Subscription
@using Mollie.Api.Client
@using Mollie.Api.Models.Subscription.Request

@inject ISubscriptionClient SubscriptionClient
@inject NavigationManager NavigationManager
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
@page "/customer/{customerId}/subscription/overview"
@using Mollie.Api.Models.List.Response
@using Mollie.Api.Models.Subscription.Response

@inject ISubscriptionClient SubscriptionClient

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
@page "/terminal/overview"
@using Mollie.Api.Models.List.Response
@using Mollie.Api.Models.Terminal.Response

@inject ITerminalClient TerminalClient

Expand Down
1 change: 1 addition & 0 deletions src/Mollie.Api/Client/Abstract/IOrderClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using Mollie.Api.Models.Order.Response;
using Mollie.Api.Models.Payment.Response;
using Mollie.Api.Models.Refund;
using Mollie.Api.Models.Refund.Response;
using Mollie.Api.Models.Url;

namespace Mollie.Api.Client.Abstract {
Expand Down
1 change: 1 addition & 0 deletions src/Mollie.Api/Client/Abstract/IPaymentMethodClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using Mollie.Api.Models.List.Response;
using Mollie.Api.Models.Payment;
using Mollie.Api.Models.PaymentMethod;
using Mollie.Api.Models.PaymentMethod.Response;
using Mollie.Api.Models.Url;

namespace Mollie.Api.Client.Abstract {
Expand Down
1 change: 1 addition & 0 deletions src/Mollie.Api/Client/Abstract/IPermissionsClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using Mollie.Api.Models.List;
using Mollie.Api.Models.List.Response;
using Mollie.Api.Models.Permission;
using Mollie.Api.Models.Permission.Response;
using Mollie.Api.Models.Url;

namespace Mollie.Api.Client.Abstract {
Expand Down
1 change: 1 addition & 0 deletions src/Mollie.Api/Client/Abstract/IProfileClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using Mollie.Api.Models.List;
using Mollie.Api.Models.List.Response;
using Mollie.Api.Models.PaymentMethod;
using Mollie.Api.Models.PaymentMethod.Response;
using Mollie.Api.Models.Profile.Request;
using Mollie.Api.Models.Profile.Response;
using Mollie.Api.Models.Url;
Expand Down
2 changes: 2 additions & 0 deletions src/Mollie.Api/Client/Abstract/IRefundClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
using Mollie.Api.Models.List;
using Mollie.Api.Models.List.Response;
using Mollie.Api.Models.Refund;
using Mollie.Api.Models.Refund.Request;
using Mollie.Api.Models.Refund.Response;
using Mollie.Api.Models.Url;

namespace Mollie.Api.Client.Abstract {
Expand Down
2 changes: 2 additions & 0 deletions src/Mollie.Api/Client/Abstract/ISettlementsClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
using Mollie.Api.Models.List.Response;
using Mollie.Api.Models.Payment.Response;
using Mollie.Api.Models.Refund;
using Mollie.Api.Models.Refund.Response;
using Mollie.Api.Models.Settlement;
using Mollie.Api.Models.Settlement.Response;
using Mollie.Api.Models.Url;

namespace Mollie.Api.Client.Abstract {
Expand Down
2 changes: 2 additions & 0 deletions src/Mollie.Api/Client/Abstract/ISubscriptionClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
using Mollie.Api.Models.List.Response;
using Mollie.Api.Models.Payment.Response;
using Mollie.Api.Models.Subscription;
using Mollie.Api.Models.Subscription.Request;
using Mollie.Api.Models.Subscription.Response;
using Mollie.Api.Models.Url;

namespace Mollie.Api.Client.Abstract {
Expand Down
1 change: 1 addition & 0 deletions src/Mollie.Api/Client/Abstract/ITerminalClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using Mollie.Api.Models.List;
using Mollie.Api.Models.List.Response;
using Mollie.Api.Models.Terminal;
using Mollie.Api.Models.Terminal.Response;
using Mollie.Api.Models.Url;

namespace Mollie.Api.Client.Abstract
Expand Down
1 change: 1 addition & 0 deletions src/Mollie.Api/Client/OrderClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
using Mollie.Api.Models.Order.Response;
using Mollie.Api.Models.Payment.Response;
using Mollie.Api.Models.Refund;
using Mollie.Api.Models.Refund.Response;
using Mollie.Api.Models.Url;

namespace Mollie.Api.Client {
Expand Down
1 change: 1 addition & 0 deletions src/Mollie.Api/Client/PaymentMethodClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using Mollie.Api.Models.List.Response;
using Mollie.Api.Models.Payment;
using Mollie.Api.Models.PaymentMethod;
using Mollie.Api.Models.PaymentMethod.Response;
using Mollie.Api.Models.Url;

namespace Mollie.Api.Client
Expand Down
1 change: 1 addition & 0 deletions src/Mollie.Api/Client/PermissionsClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using Mollie.Api.Models.List;
using Mollie.Api.Models.List.Response;
using Mollie.Api.Models.Permission;
using Mollie.Api.Models.Permission.Response;
using Mollie.Api.Models.Url;

namespace Mollie.Api.Client {
Expand Down
1 change: 1 addition & 0 deletions src/Mollie.Api/Client/ProfileClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using Mollie.Api.Models.List;
using Mollie.Api.Models.List.Response;
using Mollie.Api.Models.PaymentMethod;
using Mollie.Api.Models.PaymentMethod.Response;
using Mollie.Api.Models.Profile.Request;
using Mollie.Api.Models.Profile.Response;
using Mollie.Api.Models.Url;
Expand Down
2 changes: 2 additions & 0 deletions src/Mollie.Api/Client/RefundClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
using Mollie.Api.Models.List;
using Mollie.Api.Models.List.Response;
using Mollie.Api.Models.Refund;
using Mollie.Api.Models.Refund.Request;
using Mollie.Api.Models.Refund.Response;
using Mollie.Api.Models.Url;

namespace Mollie.Api.Client {
Expand Down
2 changes: 2 additions & 0 deletions src/Mollie.Api/Client/SettlementsClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
using Mollie.Api.Models.List.Response;
using Mollie.Api.Models.Payment.Response;
using Mollie.Api.Models.Refund;
using Mollie.Api.Models.Refund.Response;
using Mollie.Api.Models.Settlement;
using Mollie.Api.Models.Settlement.Response;
using Mollie.Api.Models.Url;

namespace Mollie.Api.Client {
Expand Down
2 changes: 2 additions & 0 deletions src/Mollie.Api/Client/SubscriptionClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
using Mollie.Api.Models.List.Response;
using Mollie.Api.Models.Payment.Response;
using Mollie.Api.Models.Subscription;
using Mollie.Api.Models.Subscription.Request;
using Mollie.Api.Models.Subscription.Response;
using Mollie.Api.Models.Url;

namespace Mollie.Api.Client {
Expand Down
1 change: 1 addition & 0 deletions src/Mollie.Api/Client/TerminalClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using Mollie.Api.Models.List;
using Mollie.Api.Models.List.Response;
using Mollie.Api.Models.Terminal;
using Mollie.Api.Models.Terminal.Response;
using Mollie.Api.Models.Url;

namespace Mollie.Api.Client {
Expand Down
1 change: 1 addition & 0 deletions src/Mollie.Api/JsonConverters/SettlementPeriodConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using Mollie.Api.Models.Settlement.Response;

namespace Mollie.Api.JsonConverters {
internal class SettlementPeriodConverter : JsonConverter {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Mollie.Api.Models.Payment.Response;
using Mollie.Api.Models.Settlement;
using Mollie.Api.Models.Settlement.Response;
using Mollie.Api.Models.Shipment.Response;
using Mollie.Api.Models.Url;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Mollie.Api.Models.Payment.Response;
using Mollie.Api.Models.Settlement;
using Mollie.Api.Models.Settlement.Response;
using Mollie.Api.Models.Url;

namespace Mollie.Api.Models.Chargeback.Response {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using Mollie.Api.Models.List.Response;
using Mollie.Api.Models.Payment.Response;
using Mollie.Api.Models.Subscription;
using Mollie.Api.Models.Subscription.Response;
using Mollie.Api.Models.Url;

namespace Mollie.Api.Models.Customer.Response {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System.Collections.Generic;
using Mollie.Api.Models.Payment.Response;
using Mollie.Api.Models.Refund;
using Mollie.Api.Models.Refund.Response;
using Mollie.Api.Models.Shipment.Response;

namespace Mollie.Api.Models.Order.Response {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System.Collections.Generic;
using Mollie.Api.Models.Refund;
using Mollie.Api.Models.Refund.Response;

namespace Mollie.Api.Models.Order.Response {
public record OrderRefundResponse : RefundResponse {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
using Mollie.Api.Models.Payment.Response;
using Mollie.Api.Models.Profile.Response;
using Mollie.Api.Models.Refund;
using Mollie.Api.Models.Refund.Response;
using Mollie.Api.Models.Settlement;
using Mollie.Api.Models.Settlement.Response;
using Mollie.Api.Models.Url;

namespace Mollie.Api.Models.Organization {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using Mollie.Api.Models.Chargeback;
using Mollie.Api.Models.Chargeback.Response;
using Mollie.Api.Models.Refund;
using Mollie.Api.Models.Refund.Response;

namespace Mollie.Api.Models.Payment.Response {
public record PaymentEmbeddedResponse {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
using Mollie.Api.Models.Mandate;
using Mollie.Api.Models.Mandate.Response;
using Mollie.Api.Models.Settlement;
using Mollie.Api.Models.Settlement.Response;
using Mollie.Api.Models.Subscription;
using Mollie.Api.Models.Subscription.Response;
using Mollie.Api.Models.Url;

namespace Mollie.Api.Models.Payment.Response {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Mollie.Api.Models.PaymentMethod.Pricing
namespace Mollie.Api.Models.PaymentMethod.Response
{
public record FixedPricingResponse {
/// <summary>
Expand All @@ -11,4 +11,4 @@ public record FixedPricingResponse {
/// </summary>
public required decimal Value { get; init; }
}
}
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
using Newtonsoft.Json;
using System.Collections.Generic;
using Mollie.Api.Models.Issuer;
using System.Collections.Generic;
using Mollie.Api.Models.Issuer.Response;
using Mollie.Api.Models.PaymentMethod.Pricing;
using Newtonsoft.Json;

namespace Mollie.Api.Models.PaymentMethod {
namespace Mollie.Api.Models.PaymentMethod.Response {
public record PaymentMethodResponse {
/// <summary>
/// Indicates the response contains a method object. Will always contain method for this endpoint.
Expand Down Expand Up @@ -56,4 +54,4 @@ public override string ToString() {
return Description;
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Mollie.Api.Models.PaymentMethod {
namespace Mollie.Api.Models.PaymentMethod.Response {
/// <summary>
/// URLs of images representing the payment method.
/// </summary>
Expand All @@ -22,4 +22,4 @@ public override string ToString() {
return Size1x;
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Mollie.Api.Models.Url;

namespace Mollie.Api.Models.PaymentMethod {
namespace Mollie.Api.Models.PaymentMethod.Response {
public record PaymentMethodResponseLinks {
/// <summary>
/// The API resource URL of the payment method itself.
Expand All @@ -12,4 +12,4 @@ public record PaymentMethodResponseLinks {
/// </summary>
public required UrlLink Documentation { get; init; }
}
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Mollie.Api.Models.PaymentMethod.Pricing
namespace Mollie.Api.Models.PaymentMethod.Response
{
public record PricingResponse {
/// <summary>
Expand All @@ -17,10 +17,10 @@ public record PricingResponse {
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
/// 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 required string? FeeRegion { get; set; }
}
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Newtonsoft.Json;

namespace Mollie.Api.Models.Permission {
namespace Mollie.Api.Models.Permission.Response {
public record PermissionResponse {
/// <summary>
/// Indicates the response contains a permission object.
Expand Down Expand Up @@ -29,4 +29,4 @@ public record PermissionResponse {
[JsonProperty("_links")]
public required PermissionResponseLinks Links { get; init; }
}
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Mollie.Api.Models.Url;

namespace Mollie.Api.Models.Permission {
namespace Mollie.Api.Models.Permission.Response {
public record PermissionResponseLinks {
/// <summary>
/// The API resource URL of the permission itself.
Expand All @@ -12,4 +12,4 @@ public record PermissionResponseLinks {
/// </summary>
public required UrlLink Documentation { get; init; }
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
using Mollie.Api.Models.List.Response;
using Mollie.Api.Models.Payment.Response;
using Mollie.Api.Models.PaymentMethod;
using Mollie.Api.Models.PaymentMethod.Response;
using Mollie.Api.Models.Refund;
using Mollie.Api.Models.Refund.Response;
using Mollie.Api.Models.Url;

namespace Mollie.Api.Models.Profile.Response {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Mollie.Api.JsonConverters;
using Newtonsoft.Json;

namespace Mollie.Api.Models.Refund {
namespace Mollie.Api.Models.Refund.Request {
public record RefundRequest {
/// <summary>
/// The amount to refund. For some payments, it can be up to €25.00 more than the original transaction amount.
Expand All @@ -15,7 +15,7 @@ public record RefundRequest {
public string? Description { get; set; }

/// <summary>
/// Provide any data you like, for example a string or a JSON object. We will save the data alongside the refund. Whenever
/// Provide any data you like, for example a string or a JSON object. We will save the data alongside the refund. Whenever
/// you fetch the refund with our API, we’ll also include the metadata. You can use up to approximately 1kB.
/// </summary>
[JsonConverter(typeof(RawJsonConverter))]
Expand All @@ -30,4 +30,4 @@ public void SetMetadata(object metadataObj, JsonSerializerSettings? jsonSerializ
Metadata = JsonConvert.SerializeObject(metadataObj, jsonSerializerSettings);
}
}
}
}
Loading

0 comments on commit 130b6da

Please sign in to comment.