diff --git a/codegen/internal/generator/generator.go b/codegen/internal/generator/generator.go
index 08f617c..f5e86d9 100644
--- a/codegen/internal/generator/generator.go
+++ b/codegen/internal/generator/generator.go
@@ -543,9 +543,10 @@ func (g *Generator) buildClients(doc *v3.Document) ([]clientTemplateData, error)
ct, ok := clientMap[clientName]
if !ok {
ct = &clientTemplateData{
- Namespace: g.config.Namespace,
- ClientName: clientName,
- PropertyName: clientName,
+ Namespace: g.config.Namespace,
+ ClientName: clientName,
+ PropertyName: clientName,
+ TagDescription: findTagDescription(doc, tag),
}
clientMap[clientName] = ct
}
@@ -1338,7 +1339,11 @@ func sanitizeText(value string) string {
value = strings.ReplaceAll(value, "\r\n", " ")
value = strings.ReplaceAll(value, "\n", " ")
value = strings.Join(strings.Fields(value), " ")
- return value
+ return strings.NewReplacer(
+ "&", "&",
+ "<", "<",
+ ">", ">",
+ ).Replace(value)
}
func yamlNodeToString(node *yaml.Node) string {
@@ -1423,6 +1428,7 @@ type clientTemplateData struct {
Namespace string
ClientName string
PropertyName string
+ TagDescription string
Operations []operationTemplateData
UsesCollections bool
UsesJson bool
@@ -1492,6 +1498,21 @@ type rootTemplateData struct {
Clients []clientTemplateData
}
+func findTagDescription(doc *v3.Document, tagName string) string {
+ if doc == nil || doc.Tags == nil {
+ return ""
+ }
+ for _, tag := range doc.Tags {
+ if tag == nil {
+ continue
+ }
+ if strings.EqualFold(strings.TrimSpace(tag.Name), strings.TrimSpace(tagName)) {
+ return sanitizeText(tag.Description)
+ }
+ }
+ return ""
+}
+
type apiVersionTemplateData struct {
Namespace string
ApiVersion string
diff --git a/codegen/internal/generator/templates/client.tmpl b/codegen/internal/generator/templates/client.tmpl
index 404d34f..f680f79 100644
--- a/codegen/internal/generator/templates/client.tmpl
+++ b/codegen/internal/generator/templates/client.tmpl
@@ -18,6 +18,12 @@ public sealed partial class {{ .ClientName }}Client
{
private readonly ApiClient _client;
+ ///
+ /// Client for the {{ .ClientName }} API endpoints.
+ ///
+ {{- if .TagDescription }}
+ /// {{ .TagDescription }}
+ {{- end }}
internal {{ .ClientName }}Client(ApiClient client)
{
_client = client;
diff --git a/codegen/internal/generator/templates/root_client.tmpl b/codegen/internal/generator/templates/root_client.tmpl
index 13c69c1..07f05ca 100644
--- a/codegen/internal/generator/templates/root_client.tmpl
+++ b/codegen/internal/generator/templates/root_client.tmpl
@@ -16,6 +16,9 @@ public partial class SumUpClient
}
{{- range .Clients }}
+ ///
+ /// Access the {{ .ClientName }} API endpoints.
+ ///
public {{ .ClientName }}Client {{ .PropertyName }} { get; private set; } = default!;
{{- end }}
}
diff --git a/src/SumUp/CheckoutsClient.g.cs b/src/SumUp/CheckoutsClient.g.cs
index 8b348ee..0c00d22 100644
--- a/src/SumUp/CheckoutsClient.g.cs
+++ b/src/SumUp/CheckoutsClient.g.cs
@@ -15,6 +15,10 @@ public sealed partial class CheckoutsClient
{
private readonly ApiClient _client;
+ ///
+ /// Client for the Checkouts API endpoints.
+ ///
+ /// Checkouts represent online payment sessions that you create before attempting to charge a payer. A checkout captures the payment intent, such as the amount, currency, merchant, and optional customer or redirect settings, and then moves through its lifecycle as you process it. Use this tag to: - create a checkout before collecting or confirming payment details - process the checkout with a card, saved card, wallet, or supported alternative payment method - retrieve or list checkouts to inspect their current state and associated payment attempts - deactivate a checkout that should no longer be used Typical workflow: - create a checkout with the order amount, currency, and merchant information - process the checkout through SumUp client tools such as the [Payment Widget and Swift Checkout SDK](https://developer.sumup.com/online-payments/checkouts) - retrieve the checkout or use the Transactions endpoints to inspect the resulting payment record Checkouts are used to initiate and orchestrate online payments. Transactions remain the authoritative record of the resulting payment outcome.
internal CheckoutsClient(ApiClient client)
{
_client = client;
diff --git a/src/SumUp/CustomersClient.g.cs b/src/SumUp/CustomersClient.g.cs
index dffc5bd..2ed1665 100644
--- a/src/SumUp/CustomersClient.g.cs
+++ b/src/SumUp/CustomersClient.g.cs
@@ -15,6 +15,10 @@ public sealed partial class CustomersClient
{
private readonly ApiClient _client;
+ ///
+ /// Client for the Customers API endpoints.
+ ///
+ /// Allow your regular customers to save their information with the Customers model. This will prevent re-entering payment instrument information for recurring payments on your platform. Depending on the needs you can allow, creating, listing or deactivating payment instruments & creating, retrieving and updating customers.
internal CustomersClient(ApiClient client)
{
_client = client;
diff --git a/src/SumUp/MembersClient.g.cs b/src/SumUp/MembersClient.g.cs
index cf74956..c4a6e8d 100644
--- a/src/SumUp/MembersClient.g.cs
+++ b/src/SumUp/MembersClient.g.cs
@@ -15,6 +15,10 @@ public sealed partial class MembersClient
{
private readonly ApiClient _client;
+ ///
+ /// Client for the Members API endpoints.
+ ///
+ /// Endpoints to manage account members. Members are users that have membership within merchant accounts.
internal MembersClient(ApiClient client)
{
_client = client;
diff --git a/src/SumUp/MembershipsClient.g.cs b/src/SumUp/MembershipsClient.g.cs
index 6106654..3167004 100644
--- a/src/SumUp/MembershipsClient.g.cs
+++ b/src/SumUp/MembershipsClient.g.cs
@@ -15,6 +15,10 @@ public sealed partial class MembershipsClient
{
private readonly ApiClient _client;
+ ///
+ /// Client for the Memberships API endpoints.
+ ///
+ /// Endpoints to manage user's memberships. Memberships are used to connect the user to merchant accounts and to grant them access to the merchant's resources via roles.
internal MembershipsClient(ApiClient client)
{
_client = client;
diff --git a/src/SumUp/MerchantsClient.g.cs b/src/SumUp/MerchantsClient.g.cs
index 7dbb9f7..dcc72cd 100644
--- a/src/SumUp/MerchantsClient.g.cs
+++ b/src/SumUp/MerchantsClient.g.cs
@@ -14,6 +14,10 @@ public sealed partial class MerchantsClient
{
private readonly ApiClient _client;
+ ///
+ /// Client for the Merchants API endpoints.
+ ///
+ /// Merchant account represents a single business entity at SumUp.
internal MerchantsClient(ApiClient client)
{
_client = client;
diff --git a/src/SumUp/Models/PersonalProfilePayloadLegacy.g.cs b/src/SumUp/Models/PersonalProfilePayloadLegacy.g.cs
index 414edac..038e9a8 100644
--- a/src/SumUp/Models/PersonalProfilePayloadLegacy.g.cs
+++ b/src/SumUp/Models/PersonalProfilePayloadLegacy.g.cs
@@ -22,7 +22,7 @@ public sealed partial class PersonalProfilePayloadLegacy
/// Mobile phone number
[JsonPropertyName("mobile_phone")]
public string? MobilePhone { get; set; }
- /// National identification id. Country specific. Ex CPF (Brazil), DNI (Spain), PESEL (Poland)
+ /// National identification id. Country specific. Ex CPF (Brazil), DNI (Spain), PESEL (Poland)
[JsonPropertyName("national_id")]
public string? NationalId { get; set; }
}
\ No newline at end of file
diff --git a/src/SumUp/PayoutsClient.g.cs b/src/SumUp/PayoutsClient.g.cs
index 7a17fdd..e9442de 100644
--- a/src/SumUp/PayoutsClient.g.cs
+++ b/src/SumUp/PayoutsClient.g.cs
@@ -15,6 +15,10 @@ public sealed partial class PayoutsClient
{
private readonly ApiClient _client;
+ ///
+ /// Client for the Payouts API endpoints.
+ ///
+ /// The Payouts model will allow you to track funds you’ve received from SumUp. You can receive a detailed payouts list with information like dates, fees, references and statuses, using the `List payouts` endpoint.
internal PayoutsClient(ApiClient client)
{
_client = client;
diff --git a/src/SumUp/ReadersClient.g.cs b/src/SumUp/ReadersClient.g.cs
index fc0d5d5..66b569f 100644
--- a/src/SumUp/ReadersClient.g.cs
+++ b/src/SumUp/ReadersClient.g.cs
@@ -14,6 +14,10 @@ public sealed partial class ReadersClient
{
private readonly ApiClient _client;
+ ///
+ /// Client for the Readers API endpoints.
+ ///
+ /// A reader represents a device that accepts payments. You can use the SumUp Solo to accept in-person payments.
internal ReadersClient(ApiClient client)
{
_client = client;
diff --git a/src/SumUp/ReceiptsClient.g.cs b/src/SumUp/ReceiptsClient.g.cs
index 74d0923..637a0f5 100644
--- a/src/SumUp/ReceiptsClient.g.cs
+++ b/src/SumUp/ReceiptsClient.g.cs
@@ -14,6 +14,10 @@ public sealed partial class ReceiptsClient
{
private readonly ApiClient _client;
+ ///
+ /// Client for the Receipts API endpoints.
+ ///
+ /// The Receipts model obtains receipt-like details for specific transactions.
internal ReceiptsClient(ApiClient client)
{
_client = client;
diff --git a/src/SumUp/RolesClient.g.cs b/src/SumUp/RolesClient.g.cs
index 321d677..0344086 100644
--- a/src/SumUp/RolesClient.g.cs
+++ b/src/SumUp/RolesClient.g.cs
@@ -14,6 +14,10 @@ public sealed partial class RolesClient
{
private readonly ApiClient _client;
+ ///
+ /// Client for the Roles API endpoints.
+ ///
+ /// Endpoints to manage custom roles. Custom roles allow you to tailor roles from individual permissions to match your needs. Once created, you can assign your custom roles to your merchant account members using the memberships.
internal RolesClient(ApiClient client)
{
_client = client;
diff --git a/src/SumUp/SubaccountsClient.g.cs b/src/SumUp/SubaccountsClient.g.cs
index e3dce70..c1439f9 100644
--- a/src/SumUp/SubaccountsClient.g.cs
+++ b/src/SumUp/SubaccountsClient.g.cs
@@ -15,6 +15,10 @@ public sealed partial class SubaccountsClient
{
private readonly ApiClient _client;
+ ///
+ /// Client for the Subaccounts API endpoints.
+ ///
+ /// Endpoints for managing merchant sub-accounts (operators).
internal SubaccountsClient(ApiClient client)
{
_client = client;
diff --git a/src/SumUp/SumUpClient.g.cs b/src/SumUp/SumUpClient.g.cs
index ac421cc..33a7505 100644
--- a/src/SumUp/SumUpClient.g.cs
+++ b/src/SumUp/SumUpClient.g.cs
@@ -22,25 +22,58 @@ partial void InitializeGeneratedClients(ApiClient apiClient)
Transactions = new TransactionsClient(apiClient);
}
+ ///
+ /// Access the Checkouts API endpoints.
+ ///
public CheckoutsClient Checkouts { get; private set; } = default!;
+ ///
+ /// Access the Customers API endpoints.
+ ///
public CustomersClient Customers { get; private set; } = default!;
+ ///
+ /// Access the Members API endpoints.
+ ///
public MembersClient Members { get; private set; } = default!;
+ ///
+ /// Access the Memberships API endpoints.
+ ///
public MembershipsClient Memberships { get; private set; } = default!;
+ ///
+ /// Access the Merchants API endpoints.
+ ///
public MerchantsClient Merchants { get; private set; } = default!;
+ ///
+ /// Access the Payouts API endpoints.
+ ///
public PayoutsClient Payouts { get; private set; } = default!;
+ ///
+ /// Access the Readers API endpoints.
+ ///
public ReadersClient Readers { get; private set; } = default!;
+ ///
+ /// Access the Receipts API endpoints.
+ ///
public ReceiptsClient Receipts { get; private set; } = default!;
+ ///
+ /// Access the Roles API endpoints.
+ ///
public RolesClient Roles { get; private set; } = default!;
+ ///
+ /// Access the Subaccounts API endpoints.
+ ///
public SubaccountsClient Subaccounts { get; private set; } = default!;
+ ///
+ /// Access the Transactions API endpoints.
+ ///
public TransactionsClient Transactions { get; private set; } = default!;
}
\ No newline at end of file
diff --git a/src/SumUp/TransactionsClient.g.cs b/src/SumUp/TransactionsClient.g.cs
index 1902759..150d8bf 100644
--- a/src/SumUp/TransactionsClient.g.cs
+++ b/src/SumUp/TransactionsClient.g.cs
@@ -15,6 +15,10 @@ public sealed partial class TransactionsClient
{
private readonly ApiClient _client;
+ ///
+ /// Client for the Transactions API endpoints.
+ ///
+ /// Transactions represent completed or attempted payment operations processed for a merchant account. A transaction contains the core payment result, such as the amount, currency, payment method, creation time, and current high-level status. In addition to the main payment outcome, a transaction can contain related events that describe what happened after the original payment attempt. These events provide visibility into the financial lifecycle of the transaction, for example: - `PAYOUT`: the payment being prepared for payout or included in a payout to the merchant - `REFUND`: money returned to the payer - `CHARGE_BACK`: money reversed after the original payment - `PAYOUT_DEDUCTION`: an amount deducted from a payout to cover a refund or chargeback From an integrator's perspective, transactions are the authoritative record of payment outcomes. Use this tag to: - list transactions for reporting, reconciliation, and customer support workflows - retrieve a single transaction when you need the latest payment details - inspect `simple_status` for the current merchant-facing outcome of the payment - inspect `events` or `transaction_events` when you need refund, payout, or chargeback history Typical workflow: - create and process payments through the Checkouts endpoints - use the Transactions endpoints to read the resulting payment records - use the returned statuses and events to update your own order, accounting, or support systems
internal TransactionsClient(ApiClient client)
{
_client = client;