From a98d8ae7158f48b9c9be52942a440a211c8dfb4a Mon Sep 17 00:00:00 2001 From: Sebastian Stehle Date: Sun, 18 Aug 2024 21:17:38 +0200 Subject: [PATCH] Remove unused options. --- csharp/Squidex.ClientLibrary/Directory.Build.props | 2 +- .../Squidex.ClientLibrary.Tests/ContentQueryTests.cs | 6 +++--- .../Squidex.ClientLibrary/ContentOptions.cs | 8 +------- .../Squidex.ClientLibrary/Utils/Query.cs | 2 ++ 4 files changed, 7 insertions(+), 11 deletions(-) diff --git a/csharp/Squidex.ClientLibrary/Directory.Build.props b/csharp/Squidex.ClientLibrary/Directory.Build.props index d733281..7ef243d 100644 --- a/csharp/Squidex.ClientLibrary/Directory.Build.props +++ b/csharp/Squidex.ClientLibrary/Directory.Build.props @@ -15,7 +15,7 @@ Squidex HeadlessCMS true snupkg - 19.5.0 + 19.6.0 diff --git a/csharp/Squidex.ClientLibrary/Squidex.ClientLibrary.Tests/ContentQueryTests.cs b/csharp/Squidex.ClientLibrary/Squidex.ClientLibrary.Tests/ContentQueryTests.cs index 7a26fe9..0b6472b 100644 --- a/csharp/Squidex.ClientLibrary/Squidex.ClientLibrary.Tests/ContentQueryTests.cs +++ b/csharp/Squidex.ClientLibrary/Squidex.ClientLibrary.Tests/ContentQueryTests.cs @@ -124,7 +124,7 @@ public void ContentUpsertOptions_as_default() [Fact] public void ContentUpsertOptions_with_everything() { - var query = new ContentUpsertOptions { Publish = true, Patch = true, EnrichDefaults = true, EnrichRequiredFields = true } + var query = new ContentUpsertOptions { Publish = true, Patch = true, EnrichDefaults = true, EnrichRequiredFields = true } .ToQuery() .ToString(); @@ -164,11 +164,11 @@ public void ContentUpdateOptions_as_default() [Fact] public void ContentUpdateOptions_with_everything() { - var query = new ContentUpdateOptions { EnrichDefaults = true, EnrichRequiredFields = true } + var query = new ContentUpdateOptions { EnrichDefaults = true } .ToQuery() .ToString(); - Assert.Equal("?enrichDefaults=true&enrichRequiredFields=true", query); + Assert.Equal("?enrichDefaults=true", query); } [Fact] diff --git a/csharp/Squidex.ClientLibrary/Squidex.ClientLibrary/ContentOptions.cs b/csharp/Squidex.ClientLibrary/Squidex.ClientLibrary/ContentOptions.cs index 4f49491..baefe91 100644 --- a/csharp/Squidex.ClientLibrary/Squidex.ClientLibrary/ContentOptions.cs +++ b/csharp/Squidex.ClientLibrary/Squidex.ClientLibrary/ContentOptions.cs @@ -163,16 +163,10 @@ public record struct ContentUpdateOptions /// public bool EnrichDefaults { get; set; } - /// - /// True, to also enrich required fields. Default: false. - /// - public bool EnrichRequiredFields { get; set; } - internal readonly Query ToQuery() { return Query.Create() - .Append("enrichDefaults", EnrichDefaults) - .Append("enrichRequiredFields", EnrichRequiredFields); + .Append("enrichDefaults", EnrichDefaults); } /// diff --git a/csharp/Squidex.ClientLibrary/Squidex.ClientLibrary/Utils/Query.cs b/csharp/Squidex.ClientLibrary/Squidex.ClientLibrary/Utils/Query.cs index b3b74c5..bfa4571 100644 --- a/csharp/Squidex.ClientLibrary/Squidex.ClientLibrary/Utils/Query.cs +++ b/csharp/Squidex.ClientLibrary/Squidex.ClientLibrary/Utils/Query.cs @@ -8,6 +8,8 @@ using System.Globalization; using System.Text; +#pragma warning disable MA0089 // Optimize string method usage + namespace Squidex.ClientLibrary.Utils; internal sealed class Query