-
Notifications
You must be signed in to change notification settings - Fork 42
Expand file tree
/
Copy pathAppliesToEntry.cs
More file actions
28 lines (22 loc) · 957 Bytes
/
AppliesToEntry.cs
File metadata and controls
28 lines (22 loc) · 957 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information
using System.Text.Json.Serialization;
namespace Elastic.Documentation.Search;
/// <summary>
/// Flat wire-format entry for the <c>applies_to</c> array indexed in Elasticsearch.
/// One entry per (type, sub_type, lifecycle, version) tuple, preserving the exact JSON shape
/// produced by the applicability converter in docs-builder.
/// </summary>
public record AppliesToEntry
{
[JsonPropertyName("type")]
public required string Type { get; init; }
[JsonPropertyName("sub_type")]
public required string SubType { get; init; }
[JsonPropertyName("lifecycle")]
public required string Lifecycle { get; init; }
[JsonPropertyName("version")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? Version { get; init; }
}