diff --git a/src/Elastic.Clients.Elasticsearch/Common/Infer/IndexName/IndexName.cs b/src/Elastic.Clients.Elasticsearch/Common/Infer/IndexName/IndexName.cs index d5f9034c880..b6a25e12ed8 100644 --- a/src/Elastic.Clients.Elasticsearch/Common/Infer/IndexName/IndexName.cs +++ b/src/Elastic.Clients.Elasticsearch/Common/Infer/IndexName/IndexName.cs @@ -35,9 +35,9 @@ private IndexName(string index, Type type, string cluster = null) Cluster = cluster; } - public string Cluster { get; } - public string Name { get; } - public Type Type { get; } + internal string Cluster { get; } + internal string Name { get; } + internal Type Type { get; } internal string DebugDisplay => Type == null ? Name : $"{nameof(IndexName)} for typeof: {Type?.Name}"; diff --git a/src/Elastic.Clients.Elasticsearch/Common/UrlParameters/Username/Username.cs b/src/Elastic.Clients.Elasticsearch/Common/UrlParameters/Username/Username.cs index 008f2486054..55de23a81df 100644 --- a/src/Elastic.Clients.Elasticsearch/Common/UrlParameters/Username/Username.cs +++ b/src/Elastic.Clients.Elasticsearch/Common/UrlParameters/Username/Username.cs @@ -15,7 +15,7 @@ public class Username : IEquatable, IUrlParameter { public Username(string name) => Value = name?.Trim(); - internal string Value { get; } + public string Value { get; } private string DebugDisplay => Value; @@ -25,7 +25,7 @@ public class Username : IEquatable, IUrlParameter string IUrlParameter.GetString(ITransportConfiguration? settings) => Value; - public override string ToString() => DebugDisplay; + public override string ToString() => Value; public static implicit operator Username(string name) => name.IsNullOrEmpty() ? null : new Username(name); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ScrollResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ScrollResponse.g.cs index ee1107105ce..52e1e334ca2 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ScrollResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ScrollResponse.g.cs @@ -58,7 +58,7 @@ public sealed partial class ScrollResponse : ElasticsearchResponseBas [JsonInclude] [JsonPropertyName("_scroll_id")] - public string? ScrollId { get; init; } + public Elastic.Clients.Elasticsearch.ScrollId? ScrollId { get; init; } [JsonInclude] [JsonPropertyName("_shards")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchResponse.g.cs index cfe5ecc1b5a..8f75fc3bd10 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchResponse.g.cs @@ -58,7 +58,7 @@ public sealed partial class SearchResponse : ElasticsearchResponseBas [JsonInclude] [JsonPropertyName("_scroll_id")] - public string? ScrollId { get; init; } + public Elastic.Clients.Elasticsearch.ScrollId? ScrollId { get; init; } [JsonInclude] [JsonPropertyName("_shards")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/AsyncSearch/AsyncSearch.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/AsyncSearch/AsyncSearch.g.cs index 275db166d8a..e614e5e3235 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/AsyncSearch/AsyncSearch.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/AsyncSearch/AsyncSearch.g.cs @@ -32,7 +32,7 @@ public partial class AsyncSearch [JsonInclude] [JsonPropertyName("_scroll_id")] - public string? ScrollId { get; init; } + public Elastic.Clients.Elasticsearch.ScrollId? ScrollId { get; init; } [JsonInclude] [JsonPropertyName("_shards")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Security.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Security.g.cs index f2a921f8c95..4ecadee0884 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Security.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Security.g.cs @@ -151,6 +151,8 @@ public enum ClusterPrivilege Monitor, [EnumMember(Value = "manage_watcher")] ManageWatcher, + [EnumMember(Value = "manage_user_profile")] + ManageUserProfile, [EnumMember(Value = "manage_transform")] ManageTransform, [EnumMember(Value = "manage_token")] @@ -232,6 +234,8 @@ public override ClusterPrivilege Read(ref Utf8JsonReader reader, Type typeToConv return ClusterPrivilege.Monitor; case "manage_watcher": return ClusterPrivilege.ManageWatcher; + case "manage_user_profile": + return ClusterPrivilege.ManageUserProfile; case "manage_transform": return ClusterPrivilege.ManageTransform; case "manage_token": @@ -327,6 +331,9 @@ public override void Write(Utf8JsonWriter writer, ClusterPrivilege value, JsonSe case ClusterPrivilege.ManageWatcher: writer.WriteStringValue("manage_watcher"); return; + case ClusterPrivilege.ManageUserProfile: + writer.WriteStringValue("manage_user_profile"); + return; case ClusterPrivilege.ManageTransform: writer.WriteStringValue("manage_transform"); return; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Migration/MigrationFeature.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Migration/MigrationFeature.g.cs index 79a7ea670eb..72faf353cdd 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Migration/MigrationFeature.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Migration/MigrationFeature.g.cs @@ -29,17 +29,5 @@ public partial class MigrationFeature [JsonInclude] [JsonPropertyName("feature_name")] public string FeatureName { get; init; } - - [JsonInclude] - [JsonPropertyName("indices")] - public IReadOnlyCollection Indices { get; init; } - - [JsonInclude] - [JsonPropertyName("migration_status")] - public Elastic.Clients.Elasticsearch.Migration.MigrationStatus MigrationStatus { get; init; } - - [JsonInclude] - [JsonPropertyName("minimum_index_version")] - public string MinimumIndexVersion { get; init; } } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/ResponseBody.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/ResponseBody.g.cs index 5a744b9884b..b4cad76d328 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/ResponseBody.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/ResponseBody.g.cs @@ -32,7 +32,7 @@ public partial class ResponseBody [JsonInclude] [JsonPropertyName("_scroll_id")] - public string? ScrollId { get; init; } + public Elastic.Clients.Elasticsearch.ScrollId? ScrollId { get; init; } [JsonInclude] [JsonPropertyName("_shards")] diff --git a/tests/Tests/AsyncSearch/AsyncSearchApiTests.cs b/tests/Tests/AsyncSearch/AsyncSearchApiTests.cs index 293f7ad196b..d566f99a5ea 100644 --- a/tests/Tests/AsyncSearch/AsyncSearchApiTests.cs +++ b/tests/Tests/AsyncSearch/AsyncSearchApiTests.cs @@ -94,8 +94,8 @@ public AsyncSearchApiTests(ReadOnlyCluster cluster, EndpointUsage usage) : base( u.Calls, GetAsyncSearchRequest, GetAsyncSearchResponse>( v => new GetAsyncSearchRequest(v), (v, d) => d, - (v, c, f) => c.AsyncSearch.Get(v, f), - (v, c, f) => c.AsyncSearch.GetAsync(v, f), + (v, c, f) => c.AsyncSearch.Get(v, f), + (v, c, f) => c.AsyncSearch.GetAsync(v, f), (v, c, r) => c.AsyncSearch.Get(r), (v, c, r) => c.AsyncSearch.GetAsync(r), uniqueValueSelector: values => values.ExtendedValue("id") @@ -120,6 +120,8 @@ public AsyncSearchApiTests(ReadOnlyCluster cluster, EndpointUsage usage) : base( public async Task AsyncSearchSubmitResponse() => await Assert>(SubmitStep, r => { r.ShouldBeValid(); + r.Id.Should().NotBeNullOrEmpty(); + // TODO - MORE ASSERTIONS r.Response.Should().NotBeNull(); r.Response.Took.Should().BeGreaterOrEqualTo(0); }); diff --git a/tests/Tests/Common/Infer/Indices/IndicesTests.cs b/tests/Tests/Common/Infer/Indices/IndicesTests.cs index 8326ad0d329..a27f7c936e0 100644 --- a/tests/Tests/Common/Infer/Indices/IndicesTests.cs +++ b/tests/Tests/Common/Infer/Indices/IndicesTests.cs @@ -108,11 +108,12 @@ public async Task Serializes_All_Correctly() } [U] - public async void Deserializes_All_Correctly() + public void Deserializes_All_Correctly() { const string json = @"{""indices"":""_all""}"; var obj = DeserializeJsonString(json); - await Verifier.Verify(obj); + obj.Indices.Should().HaveCount(1); + obj.Indices.First().Name.Should().Be("_all"); } [U] diff --git a/tests/Tests/Serialization/Documents/MGetSerialization.cs b/tests/Tests/Serialization/Documents/MGetSerialization.cs index 834faf7558d..0225d69119a 100644 --- a/tests/Tests/Serialization/Documents/MGetSerialization.cs +++ b/tests/Tests/Serialization/Documents/MGetSerialization.cs @@ -25,6 +25,9 @@ public async Task DeserializesError() var error = search.Docs.First().Item2; error.Should().NotBeNull(); - await Verifier.Verify(error); + error.Id.Should().Be("1001"); + error.Index.Should().Be("devs"); + + await Verifier.Verify(error.Error); } } diff --git a/tests/Tests/_VerifySnapshots/IndicesSerializationTests.Deserializes_All_Correctly.verified.txt b/tests/Tests/_VerifySnapshots/IndicesSerializationTests.Deserializes_All_Correctly.verified.txt deleted file mode 100644 index 4015f2aea58..00000000000 --- a/tests/Tests/_VerifySnapshots/IndicesSerializationTests.Deserializes_All_Correctly.verified.txt +++ /dev/null @@ -1,7 +0,0 @@ -{ - Indices: [ - { - Name: _all - } - ] -} \ No newline at end of file diff --git a/tests/Tests/_VerifySnapshots/MGetSerialization.DeserializesError.verified.txt b/tests/Tests/_VerifySnapshots/MGetSerialization.DeserializesError.verified.txt index 17cb0f77232..ba33de609b8 100644 --- a/tests/Tests/_VerifySnapshots/MGetSerialization.DeserializesError.verified.txt +++ b/tests/Tests/_VerifySnapshots/MGetSerialization.DeserializesError.verified.txt @@ -1,14 +1,10 @@ { - Id: 1001, - Index: devs, - Error: { - Reason: routing is required for [devs]/[1001], - RootCause: [ - { - Reason: routing is required for [devs]/[1001], - Type: routing_missing_exception - } - ], - Type: routing_missing_exception - } + Reason: routing is required for [devs]/[1001], + RootCause: [ + { + Reason: routing is required for [devs]/[1001], + Type: routing_missing_exception + } + ], + Type: routing_missing_exception } \ No newline at end of file