diff --git a/codegen/internal/generator/generator.go b/codegen/internal/generator/generator.go
index 08f617c..1687013 100644
--- a/codegen/internal/generator/generator.go
+++ b/codegen/internal/generator/generator.go
@@ -546,6 +546,7 @@ func (g *Generator) buildClients(doc *v3.Document) ([]clientTemplateData, error)
Namespace: g.config.Namespace,
ClientName: clientName,
PropertyName: clientName,
+ TagDescription: findTagDescription(doc, tag),
}
clientMap[clientName] = ct
}
@@ -1423,6 +1424,7 @@ type clientTemplateData struct {
Namespace string
ClientName string
PropertyName string
+ TagDescription string
Operations []operationTemplateData
UsesCollections bool
UsesJson bool
@@ -1492,6 +1494,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..8b9a524 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.
+ ///
+ /// Accept payments from your end users by adding the Checkouts model to your platform. SumUp supports standard and single payment 3DS checkout flows. The Checkout model allows creating, listing, retrieving, processing and deactivating checkouts. A payment is completed by creating a checkout and then processing the checkout.
internal CheckoutsClient(ApiClient client)
{
_client = client;
diff --git a/src/SumUp/CustomersClient.g.cs b/src/SumUp/CustomersClient.g.cs
index dffc5bd..cc4c277 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/PayoutsClient.g.cs b/src/SumUp/PayoutsClient.g.cs
index 124a188..d547034 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 4d31e4d..7085e50 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.
+ ///
+ /// Retrieve details for a specific transaction by it’s `id` or any other required query parameter, or list all transactions related to the merchant account.
internal TransactionsClient(ApiClient client)
{
_client = client;