diff --git a/codegen/internal/generator/generator.go b/codegen/internal/generator/generator.go index ec6a5cb..5bbd2bf 100644 --- a/codegen/internal/generator/generator.go +++ b/codegen/internal/generator/generator.go @@ -769,17 +769,11 @@ func (g *Generator) convertParameter(param *v3.Parameter) (parameterTemplateData required := param.Required != nil && *param.Required typeInfo := g.resolveType(param.Schema, required) argName := naming.Identifier(param.Name) - declaration := "" - if shouldUseOptionalQueryParameter(param, required, typeInfo) { - baseType := strings.TrimSuffix(typeInfo.TypeName, "?") - declaration = fmt.Sprintf("OptionalQuery<%s> %s = default", baseType, argName) - } else { - defaultValue := "" - if !required { - defaultValue = " = null" - } - declaration = fmt.Sprintf("%s %s%s", typeInfo.TypeName, argName, defaultValue) + defaultValue := "" + if !required { + defaultValue = " = null" } + declaration := fmt.Sprintf("%s %s%s", typeInfo.TypeName, argName, defaultValue) return parameterTemplateData{ Location: param.In, Name: param.Name, @@ -847,16 +841,6 @@ func (g *Generator) buildOperationOptions(clientName, methodName, summary string } } -func shouldUseOptionalQueryParameter(param *v3.Parameter, required bool, typeInfo typeInfo) bool { - if param == nil || required || param.In != "query" { - return false - } - if typeInfo.IsValueType || typeInfo.IsCollection { - return false - } - return schemaAllowsNull(param.Schema) -} - func schemaAllowsNull(schemaRef *base.SchemaProxy) bool { if schemaRef == nil { return false diff --git a/codegen/internal/generator/generator_test.go b/codegen/internal/generator/generator_test.go index 6ac7e75..cf24b03 100644 --- a/codegen/internal/generator/generator_test.go +++ b/codegen/internal/generator/generator_test.go @@ -184,13 +184,16 @@ func TestBuildModels_HandlesOpenAPI31NullableTypes(t *testing.T) { } } -func TestBuildClients_UsesOptionalQueryForOpenAPI31NullableTypes(t *testing.T) { +func TestBuildClients_UsesOptionalStringsForAllowEmptyQueryParameters(t *testing.T) { + t.Parallel() + const spec = `{ "openapi": "3.1.0", "info": { "title": "test", "version": "1.0.0" }, + "components": { "schemas": { "ResourceType": { "type": "string" } } }, "paths": { "/memberships": { "get": { @@ -199,7 +202,13 @@ func TestBuildClients_UsesOptionalQueryForOpenAPI31NullableTypes(t *testing.T) { "parameters": [{ "name": "resource.parent.id", "in": "query", - "schema": { "type": ["string", "null"] } + "allowEmptyValue": true, + "schema": { "type": "string" } + }, { + "name": "resource.parent.type", + "in": "query", + "allowEmptyValue": true, + "schema": { "$ref": "#/components/schemas/ResourceType" } }], "responses": { "204": { "description": "ok" } } } @@ -214,9 +223,11 @@ func TestBuildClients_UsesOptionalQueryForOpenAPI31NullableTypes(t *testing.T) { t.Fatalf("buildClients() error = %v", err) } - parameter := clients[0].Operations[0].QueryParams[0] - if got, want := parameter.Declaration, "OptionalQuery resourceParentId = default"; got != want { - t.Fatalf("parameter declaration = %q, want %q", got, want) + for i, want := range []string{"string? resourceParentId = null", "string? resourceParentType = null"} { + parameter := clients[0].Operations[0].QueryParams[i] + if got := parameter.Declaration; got != want { + t.Errorf("parameter declaration = %q, want %q", got, want) + } } } diff --git a/codegen/internal/generator/samples.go b/codegen/internal/generator/samples.go index 1153608..49451c9 100644 --- a/codegen/internal/generator/samples.go +++ b/codegen/internal/generator/samples.go @@ -194,10 +194,6 @@ public static class Program func (g *Generator) sampleValue(typeName, name string) string { typeName = strings.TrimSuffix(strings.TrimSpace(typeName), "?") - if strings.HasPrefix(typeName, "OptionalQuery<") && strings.HasSuffix(typeName, ">") { - inner := strings.TrimSuffix(strings.TrimPrefix(typeName, "OptionalQuery<"), ">") - return fmt.Sprintf("%s.From(%s)", typeName, g.sampleValue(inner, name)) - } if strings.HasPrefix(typeName, "IEnumerable<") && strings.HasSuffix(typeName, ">") { inner := strings.TrimSuffix(strings.TrimPrefix(typeName, "IEnumerable<"), ">") return fmt.Sprintf("Array.Empty<%s>()", inner) diff --git a/openapi.json b/openapi.json index f514d26..8f2f661 100644 --- a/openapi.json +++ b/openapi.json @@ -243,7 +243,7 @@ "post": { "operationId": "CreateCheckout", "summary": "Create a checkout", - "description": "Creates a new payment checkout resource. The unique `checkout_reference` created by this request, is used for further manipulation of the checkout.\n\nFor 3DS checkouts, add the `redirect_url` parameter to your request body schema.\nTo use the [Hosted Checkout](https://developer.sumup.com/online-payments/checkouts/hosted-checkout/) page, set the `hosted_checkout.enabled` to `true`.\n\nFollow by processing a checkout to charge the provided payment instrument.", + "description": "Creates a payment checkout for the specified merchant, amount, and currency. Supply a `checkout_reference` to identify the payment attempt in your own systems. Creating a checkout does not charge a payment instrument.\n\nSet `hosted_checkout.enabled` to `true` to receive a [Hosted Checkout](https://developer.sumup.com/online-payments/checkouts/hosted-checkout/) URL where the customer can complete the payment.\nUse `redirect_url` for redirect-based payment and 3DS flows. If `return_url` is provided, SumUp sends processing updates to that backend callback URL.\n\nComplete the payment through [Hosted Checkout](https://developer.sumup.com/online-payments/checkouts/hosted-checkout/) or the [Payment Widget](https://developer.sumup.com/online-payments/checkouts/card-widget).", "tags": [ "Checkouts" ], @@ -746,7 +746,7 @@ "patch": { "operationId": "UpdateCheckout", "summary": "Update a checkout", - "description": "Updates an identified checkout resource.", + "description": "Updates the amount, currency, description, reference, expiration, or customer associated with an existing checkout. Only the supplied fields are updated.\n\nThis request changes the checkout details; it does not charge a payment instrument. Process the checkout separately to attempt a payment.", "tags": [ "Checkouts" ], @@ -3443,28 +3443,30 @@ "type": "string" } }, + { + "name": "resource.id", + "in": "query", + "description": "Filter memberships by the ID of the resource the membership is in.", + "schema": { + "type": "string" + } + }, { "name": "resource.parent.id", "in": "query", - "description": "Filter memberships by the parent of the resource the membership is in.\nWhen filtering by parent both `resource.parent.id` and `resource.parent.type` must be present. Pass explicit null to filter for resources without a parent.", + "allowEmptyValue": true, + "description": "Filter memberships by the parent of the resource the membership is in.\nOmit both `resource.parent.id` and `resource.parent.type` to skip parent filtering. When filtering by parent, both parameters must be present. To select resources without a parent, set each parameter to an empty value. Otherwise, both parameters must identify a parent.", "schema": { - "type": [ - "string", - "null" - ] + "type": "string" } }, { "name": "resource.parent.type", "in": "query", - "description": "Filter memberships by the parent of the resource the membership is in.\nWhen filtering by parent both `resource.parent.id` and `resource.parent.type` must be present. Pass explicit null to filter for resources without a parent.", + "allowEmptyValue": true, + "description": "Filter memberships by the parent of the resource the membership is in.\nOmit both `resource.parent.id` and `resource.parent.type` to skip parent filtering. When filtering by parent, both parameters must be present. To select resources without a parent, set each parameter to an empty value. Otherwise, both parameters must identify a parent.", "schema": { - "allOf": [ - { - "$ref": "#/components/schemas/ResourceType" - } - ], - "type": "null" + "$ref": "#/components/schemas/ResourceType" } }, { @@ -3603,19 +3605,6 @@ "example": "245b2ead-85bf-45ff-856f-311a88a5d454" } }, - { - "name": "user.type", - "in": "query", - "description": "Filter the returned members by user type. Repeat this parameter to include multiple user types.", - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/UserType" - } - }, - "style": "form", - "explode": true - }, { "name": "status", "in": "query", @@ -3730,7 +3719,7 @@ "post": { "operationId": "CreateMerchantMember", "summary": "Create a member", - "description": "Create a merchant member.", + "description": "Adds a member to the merchant account with the specified roles.\n\nBy default, sends an invitation email to the provided address. The recipient must accept the invitation to join the account.\nWhen `is_managed_user` is `true`, creates a managed user with the provided password and optional nickname and assigns the roles directly, without sending an invitation.", "tags": [ "Members" ], @@ -3795,6 +3784,7 @@ "roles": { "type": "array", "description": "List of roles to assign to the new member.", + "minItems": 1, "maxItems": 124, "items": { "type": "string", @@ -3978,7 +3968,7 @@ }, "put": { "summary": "Update a member", - "description": "Update the merchant member.", + "description": "Updates a merchant member and returns the updated member.\n\nProviding `roles` replaces the member's assigned roles and can grant or revoke access. Providing `metadata` replaces the entire metadata object.\nFor managed users, `user.nickname` changes the display name and `user.password` replaces the password. Updating the password also enables the managed user account.", "tags": [ "Members" ], @@ -4017,6 +4007,7 @@ "properties": { "roles": { "type": "array", + "minItems": 1, "maxItems": 124, "items": { "type": "string", @@ -4392,6 +4383,7 @@ "permissions": { "type": "array", "description": "User's permissions.", + "minItems": 1, "maxItems": 100, "items": { "type": "string" @@ -4652,7 +4644,7 @@ "patch": { "operationId": "UpdateMerchantRole", "summary": "Update a role", - "description": "Update a custom role.", + "description": "Updates a custom role's name, description, or permissions and returns the updated role.\n\nProviding `permissions` replaces the role's permission list and changes the access granted to members assigned to that role. Omitted fields remain unchanged.", "tags": [ "Roles" ], @@ -4696,6 +4688,7 @@ "permissions": { "type": "array", "description": "User's permissions.", + "minItems": 1, "maxItems": 100, "items": { "type": "string" @@ -5438,7 +5431,7 @@ }, "patch": { "summary": "Update a Reader", - "description": "Update a Reader.", + "description": "Updates a reader's name or metadata and returns the updated reader.\n\nProviding `metadata` replaces the entire metadata object; include all entries that should be retained. Omitted fields remain unchanged.", "operationId": "UpdateReader", "tags": [ "Readers" @@ -8923,17 +8916,6 @@ } } }, - "UserType": { - "type": "string", - "description": "Type of the user account.", - "enum": [ - "user", - "managed_user", - "service_account", - "system_account" - ], - "example": "user" - }, "Metadata": { "description": "Set of user-defined key-value pairs attached to the object. Partial updates are not supported. When updating, always submit whole metadata. Maximum of 64 parameters are allowed in the object.", "type": "object", @@ -8947,6 +8929,17 @@ "example": {}, "additionalProperties": true }, + "UserType": { + "type": "string", + "description": "Type of the user account.", + "enum": [ + "user", + "managed_user", + "service_account", + "system_account" + ], + "example": "user" + }, "Address": { "externalDocs": { "description": "Address documentation", diff --git a/src/SumUp.Tests/MembershipsClientTests.cs b/src/SumUp.Tests/MembershipsClientTests.cs new file mode 100644 index 0000000..6e833e9 --- /dev/null +++ b/src/SumUp.Tests/MembershipsClientTests.cs @@ -0,0 +1,59 @@ +using System; +using System.Net; +using System.Net.Http; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +using Xunit; + +namespace SumUp.Tests; + +public class MembershipsClientTests +{ + [Theory] + [InlineData(null, null, "")] + [InlineData("", "", "?resource.parent.id=&resource.parent.type=")] + [InlineData("parent /&", "organization", "?resource.parent.id=parent%20%2F%26&resource.parent.type=organization")] + public async Task List_SerializesParentFilters(string? parentId, string? parentType, string expectedQuery) + { + using var handler = new RecordingHttpMessageHandler(); + using var httpClient = new HttpClient(handler) + { + BaseAddress = new Uri("https://mocked.sumup.test/") + }; + using var client = new SumUpClient(new SumUpClientOptions + { + HttpClient = httpClient, + AccessToken = "test-token" + }); + var options = new MembershipsListOptions + { + ResourceParentId = parentId, + ResourceParentType = parentType + }; + var expectedUri = "https://mocked.sumup.test/v0.1/memberships" + expectedQuery; + + await client.Memberships.ListAsync(options); + Assert.Equal(expectedUri, handler.RequestUri!.AbsoluteUri); + + client.Memberships.List(options); + Assert.Equal(expectedUri, handler.RequestUri!.AbsoluteUri); + + await client.Memberships.ListAsync(); + Assert.Equal("https://mocked.sumup.test/v0.1/memberships", handler.RequestUri!.AbsoluteUri); + } + + private sealed class RecordingHttpMessageHandler : HttpMessageHandler + { + public Uri? RequestUri { get; private set; } + + protected override Task SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) + { + RequestUri = request.RequestUri; + return Task.FromResult(new HttpResponseMessage(HttpStatusCode.OK) + { + Content = new StringContent("{\"items\":[]}", Encoding.UTF8, "application/json") + }); + } + } +} diff --git a/src/SumUp.Tests/RequestBuilderTests.cs b/src/SumUp.Tests/RequestBuilderTests.cs index f2989c7..2a6c145 100644 --- a/src/SumUp.Tests/RequestBuilderTests.cs +++ b/src/SumUp.Tests/RequestBuilderTests.cs @@ -51,23 +51,23 @@ public void Build_SerializesRepeatedEnumQueryUsingEnumMemberValues() } [Fact] - public void Build_OmitsUnsetOptionalQuery() + public void Build_OmitsNullQuery() { var builder = new RequestBuilder(HttpMethod.Get, "/v0.1/items", new Uri("https://api.sumup.com")); - builder.AddQuery("status", OptionalQuery.Unset); + builder.AddQuery("status", null); var request = builder.Build(); Assert.Equal("https://api.sumup.com/v0.1/items", request.RequestUri!.AbsoluteUri); } [Fact] - public void Build_EmitsExplicitNullOptionalQuery() + public void Build_PreservesEmptyQuery() { var builder = new RequestBuilder(HttpMethod.Get, "/v0.1/items", new Uri("https://api.sumup.com")); - builder.AddQuery("status", OptionalQuery.Null()); + builder.AddQuery("status", string.Empty); var request = builder.Build(); - Assert.Equal("https://api.sumup.com/v0.1/items?status=null", request.RequestUri!.AbsoluteUri); + Assert.Equal("https://api.sumup.com/v0.1/items?status=", request.RequestUri!.AbsoluteUri); } [Fact] diff --git a/src/SumUp/CheckoutsClient.g.cs b/src/SumUp/CheckoutsClient.g.cs index ea30029..4e7a211 100644 --- a/src/SumUp/CheckoutsClient.g.cs +++ b/src/SumUp/CheckoutsClient.g.cs @@ -27,7 +27,7 @@ internal CheckoutsClient(ApiClient client) /// /// Create a checkout /// - /// Creates a new payment checkout resource. The unique checkout_reference created by this request, is used for further manipulation of the checkout. For 3DS checkouts, add the redirect_url parameter to your request body schema. To use the Hosted Checkout page, set the hosted_checkout.enabled to true. Follow by processing a checkout to charge the provided payment instrument. + /// Creates a payment checkout for the specified merchant, amount, and currency. Supply a checkout_reference to identify the payment attempt in your own systems. Creating a checkout does not charge a payment instrument. Set hosted_checkout.enabled to true to receive a Hosted Checkout URL where the customer can complete the payment. Use redirect_url for redirect-based payment and 3DS flows. If return_url is provided, SumUp sends processing updates to that backend callback URL. Complete the payment through Hosted Checkout or the Payment Widget. /// Details for creating a checkout resource. /// Optional per-request overrides. /// Token used to cancel the request. @@ -92,7 +92,7 @@ public ApiResponse Create(CheckoutCreateRequest body, RequestOptions? /// /// Create a checkout /// - /// Creates a new payment checkout resource. The unique checkout_reference created by this request, is used for further manipulation of the checkout. For 3DS checkouts, add the redirect_url parameter to your request body schema. To use the Hosted Checkout page, set the hosted_checkout.enabled to true. Follow by processing a checkout to charge the provided payment instrument. + /// Creates a payment checkout for the specified merchant, amount, and currency. Supply a checkout_reference to identify the payment attempt in your own systems. Creating a checkout does not charge a payment instrument. Set hosted_checkout.enabled to true to receive a Hosted Checkout URL where the customer can complete the payment. Use redirect_url for redirect-based payment and 3DS flows. If return_url is provided, SumUp sends processing updates to that backend callback URL. Complete the payment through Hosted Checkout or the Payment Widget. /// Details for creating a checkout resource. /// Optional per-request overrides. /// Token used to cancel the request. @@ -845,7 +845,7 @@ public async Task> ProcessAsync(string che /// /// Update a checkout /// - /// Updates an identified checkout resource. + /// Updates the amount, currency, description, reference, expiration, or customer associated with an existing checkout. Only the supplied fields are updated. This request changes the checkout details; it does not charge a payment instrument. Process the checkout separately to attempt a payment. /// Unique identifier of the checkout resource. /// Details for updating a checkout resource. /// Optional per-request overrides. @@ -904,7 +904,7 @@ public ApiResponse Update(string checkoutId, CheckoutUpdateRequest bod /// /// Update a checkout /// - /// Updates an identified checkout resource. + /// Updates the amount, currency, description, reference, expiration, or customer associated with an existing checkout. Only the supplied fields are updated. This request changes the checkout details; it does not charge a payment instrument. Process the checkout separately to attempt a payment. /// Unique identifier of the checkout resource. /// Details for updating a checkout resource. /// Optional per-request overrides. diff --git a/src/SumUp/Http/RequestBuilder.cs b/src/SumUp/Http/RequestBuilder.cs index 1385956..9a1bd57 100644 --- a/src/SumUp/Http/RequestBuilder.cs +++ b/src/SumUp/Http/RequestBuilder.cs @@ -68,22 +68,6 @@ internal void AddQuery(string name, object? value) _query.Add(new KeyValuePair(name, ConvertToString(value))); } - internal void AddQuery(string name, OptionalQuery value) - { - if (!value.IsSet) - { - return; - } - - if (value.IsNull) - { - _query.Add(new KeyValuePair(name, "null")); - return; - } - - AddQuery(name, value.RawValue); - } - internal void AddHeader(string name, object? value) { if (value is null) diff --git a/src/SumUp/MembersClient.g.cs b/src/SumUp/MembersClient.g.cs index 53cc018..2e90ff5 100644 --- a/src/SumUp/MembersClient.g.cs +++ b/src/SumUp/MembersClient.g.cs @@ -27,7 +27,7 @@ internal MembersClient(ApiClient client) /// /// Create a member /// - /// Create a merchant member. + /// Adds a member to the merchant account with the specified roles. By default, sends an invitation email to the provided address. The recipient must accept the invitation to join the account. When is_managed_user is true, creates a managed user with the provided password and optional nickname and assigns the roles directly, without sending an invitation. /// Short unique identifier for the merchant. /// Request body payload. /// Optional per-request overrides. @@ -91,7 +91,7 @@ public ApiResponse Create(string merchantCode, MembersCreateRequest body /// /// Create a member /// - /// Create a merchant member. + /// Adds a member to the merchant account with the specified roles. By default, sends an invitation email to the provided address. The recipient must accept the invitation to join the account. When is_managed_user is true, creates a managed user with the provided password and optional nickname and assigns the roles directly, without sending an invitation. /// Short unique identifier for the merchant. /// Request body payload. /// Optional per-request overrides. @@ -381,7 +381,6 @@ public ApiResponse List(string merchantCode, MembersListOpt builder.AddQuery("scroll", operationOptions.Scroll); builder.AddQuery("email", operationOptions.Email); builder.AddQuery("user.id", operationOptions.UserId); - builder.AddQuery("user.type", operationOptions.UserType); builder.AddQuery("status", operationOptions.Status); builder.AddQuery("roles", operationOptions.Roles); }); @@ -440,7 +439,6 @@ public async Task> ListAsync(string merchantCod builder.AddQuery("scroll", operationOptions.Scroll); builder.AddQuery("email", operationOptions.Email); builder.AddQuery("user.id", operationOptions.UserId); - builder.AddQuery("user.type", operationOptions.UserType); builder.AddQuery("status", operationOptions.Status); builder.AddQuery("roles", operationOptions.Roles); }); @@ -483,7 +481,7 @@ public async Task> ListAsync(string merchantCod /// /// Update a member /// - /// Update the merchant member. + /// Updates a merchant member and returns the updated member. Providing roles replaces the member's assigned roles and can grant or revoke access. Providing metadata replaces the entire metadata object. For managed users, user.nickname changes the display name and user.password replaces the password. Updating the password also enables the managed user account. /// Short unique identifier for the merchant. /// The ID of the member to retrieve. /// Request body payload. @@ -554,7 +552,7 @@ public ApiResponse Update(string merchantCode, string memberId, MembersU /// /// Update a member /// - /// Update the merchant member. + /// Updates a merchant member and returns the updated member. Providing roles replaces the member's assigned roles and can grant or revoke access. Providing metadata replaces the entire metadata object. For managed users, user.nickname changes the display name and user.password replaces the password. Updating the password also enables the managed user account. /// Short unique identifier for the merchant. /// The ID of the member to retrieve. /// Request body payload. diff --git a/src/SumUp/MembershipsClient.g.cs b/src/SumUp/MembershipsClient.g.cs index ec9ec9a..296889b 100644 --- a/src/SumUp/MembershipsClient.g.cs +++ b/src/SumUp/MembershipsClient.g.cs @@ -43,6 +43,7 @@ public ApiResponse List(MembershipsListOptions? options builder.AddQuery("resource.type", operationOptions.ResourceType); builder.AddQuery("resource.attributes.sandbox", operationOptions.ResourceAttributesSandbox); builder.AddQuery("resource.name", operationOptions.ResourceName); + builder.AddQuery("resource.id", operationOptions.ResourceId); builder.AddQuery("resource.parent.id", operationOptions.ResourceParentId); builder.AddQuery("resource.parent.type", operationOptions.ResourceParentType); builder.AddQuery("roles", operationOptions.Roles); @@ -107,6 +108,7 @@ public async Task> ListAsync(MembershipsLis builder.AddQuery("resource.type", operationOptions.ResourceType); builder.AddQuery("resource.attributes.sandbox", operationOptions.ResourceAttributesSandbox); builder.AddQuery("resource.name", operationOptions.ResourceName); + builder.AddQuery("resource.id", operationOptions.ResourceId); builder.AddQuery("resource.parent.id", operationOptions.ResourceParentId); builder.AddQuery("resource.parent.type", operationOptions.ResourceParentType); builder.AddQuery("roles", operationOptions.Roles); diff --git a/src/SumUp/OptionalQuery.cs b/src/SumUp/OptionalQuery.cs deleted file mode 100644 index 887b88e..0000000 --- a/src/SumUp/OptionalQuery.cs +++ /dev/null @@ -1,42 +0,0 @@ -namespace SumUp; - -/// -/// Represents a query parameter that can be omitted, set to a value, or set explicitly to null. -/// -public readonly struct OptionalQuery -{ - internal object? RawValue { get; } - - /// - /// Indicates whether the query parameter should be emitted. - /// - public bool IsSet { get; } - - /// - /// Indicates whether the query parameter should be emitted with a literal null value. - /// - public bool IsNull => IsSet && RawValue is null; - - private OptionalQuery(bool isSet, object? value) - { - IsSet = isSet; - RawValue = value; - } - - /// - /// Omits the parameter from the query string. - /// - public static OptionalQuery Unset => default; - - /// - /// Emits the parameter as an explicit null literal. - /// - public static OptionalQuery Null() => new(isSet: true, value: null); - - /// - /// Emits the parameter with the provided value. - /// - public static OptionalQuery From(T value) => new(isSet: true, value: value); - - public static implicit operator OptionalQuery(T value) => From(value); -} diff --git a/src/SumUp/Options/MembersListOptions.g.cs b/src/SumUp/Options/MembersListOptions.g.cs index f60457f..d459c6c 100644 --- a/src/SumUp/Options/MembersListOptions.g.cs +++ b/src/SumUp/Options/MembersListOptions.g.cs @@ -19,8 +19,6 @@ public sealed partial class MembersListOptions public string? Email { get; set; } /// Search for a member by user id. public Guid? UserId { get; set; } - /// Filter the returned members by user type. Repeat this parameter to include multiple user types. - public IEnumerable? UserType { get; set; } /// Filter the returned members by the membership status. public MembershipStatus? Status { get; set; } /// Filter the returned members by role. diff --git a/src/SumUp/Options/MembershipsListOptions.g.cs b/src/SumUp/Options/MembershipsListOptions.g.cs index f48c022..8929f9a 100644 --- a/src/SumUp/Options/MembershipsListOptions.g.cs +++ b/src/SumUp/Options/MembershipsListOptions.g.cs @@ -23,10 +23,12 @@ public sealed partial class MembershipsListOptions public bool? ResourceAttributesSandbox { get; set; } /// Filter memberships by the name of the resource the membership is in. public string? ResourceName { get; set; } - /// Filter memberships by the parent of the resource the membership is in. When filtering by parent both resource.parent.id and resource.parent.type must be present. Pass explicit null to filter for resources without a parent. - public OptionalQuery ResourceParentId { get; set; } - /// Filter memberships by the parent of the resource the membership is in. When filtering by parent both resource.parent.id and resource.parent.type must be present. Pass explicit null to filter for resources without a parent. - public OptionalQuery ResourceParentType { get; set; } + /// Filter memberships by the ID of the resource the membership is in. + public string? ResourceId { get; set; } + /// Filter memberships by the parent of the resource the membership is in. Omit both resource.parent.id and resource.parent.type to skip parent filtering. When filtering by parent, both parameters must be present. To select resources without a parent, set each parameter to an empty value. Otherwise, both parameters must identify a parent. + public string? ResourceParentId { get; set; } + /// Filter memberships by the parent of the resource the membership is in. Omit both resource.parent.id and resource.parent.type to skip parent filtering. When filtering by parent, both parameters must be present. To select resources without a parent, set each parameter to an empty value. Otherwise, both parameters must identify a parent. + public string? ResourceParentType { get; set; } /// Filter the returned memberships by role. public IEnumerable? Roles { get; set; } } \ No newline at end of file diff --git a/src/SumUp/ReadersClient.g.cs b/src/SumUp/ReadersClient.g.cs index e713a94..a843f52 100644 --- a/src/SumUp/ReadersClient.g.cs +++ b/src/SumUp/ReadersClient.g.cs @@ -1112,7 +1112,7 @@ public async Task> TerminateCheckoutAsync(string merch /// /// Update a Reader /// - /// Update a Reader. + /// Updates a reader's name or metadata and returns the updated reader. Providing metadata replaces the entire metadata object; include all entries that should be retained. Omitted fields remain unchanged. /// Short unique identifier for the merchant. /// The unique identifier of the reader. /// Request body payload. @@ -1173,7 +1173,7 @@ public ApiResponse Update(string merchantCode, string readerId, ReadersU /// /// Update a Reader /// - /// Update a Reader. + /// Updates a reader's name or metadata and returns the updated reader. Providing metadata replaces the entire metadata object; include all entries that should be retained. Omitted fields remain unchanged. /// Short unique identifier for the merchant. /// The unique identifier of the reader. /// Request body payload. diff --git a/src/SumUp/RolesClient.g.cs b/src/SumUp/RolesClient.g.cs index 0344086..55f9348 100644 --- a/src/SumUp/RolesClient.g.cs +++ b/src/SumUp/RolesClient.g.cs @@ -452,7 +452,7 @@ public async Task> ListAsync(string merchantCode, /// /// Update a role /// - /// Update a custom role. + /// Updates a custom role's name, description, or permissions and returns the updated role. Providing permissions replaces the role's permission list and changes the access granted to members assigned to that role. Omitted fields remain unchanged. /// Short unique identifier for the merchant. /// The ID of the role to retrieve. /// Request body payload. @@ -513,7 +513,7 @@ public ApiResponse Update(string merchantCode, string roleId, RolesUpdateR /// /// Update a role /// - /// Update a custom role. + /// Updates a custom role's name, description, or permissions and returns the updated role. Providing permissions replaces the role's permission list and changes the access granted to members assigned to that role. Omitted fields remain unchanged. /// Short unique identifier for the merchant. /// The ID of the role to retrieve. /// Request body payload.