1
- // Licensed to Elasticsearch B.V under one or more agreements.
2
- // Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
3
- // See the LICENSE file in the project root for more information.
4
- //
5
- // ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗
6
- // ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝
7
- // ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗
8
- // ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝
9
- // ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗
10
- // ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝
11
- // ------------------------------------------------
12
- //
13
- // This file is automatically generated.
14
- // Please do not edit these files manually.
15
- //
16
- // ------------------------------------------------
17
-
18
- #nullable restore
19
-
20
- using System ;
21
- using System . Linq ;
22
- using Elastic . Clients . Elasticsearch . Serialization ;
23
-
24
- namespace Elastic . Clients . Elasticsearch . Cluster ;
25
-
26
- internal sealed partial class AllocationStoreConverter : System . Text . Json . Serialization . JsonConverter < Elastic . Clients . Elasticsearch . Cluster . AllocationStore >
27
- {
28
- private static readonly System . Text . Json . JsonEncodedText PropAllocationId = System . Text . Json . JsonEncodedText . Encode ( "allocation_id" ) ;
29
- private static readonly System . Text . Json . JsonEncodedText PropFound = System . Text . Json . JsonEncodedText . Encode ( "found" ) ;
30
- private static readonly System . Text . Json . JsonEncodedText PropInSync = System . Text . Json . JsonEncodedText . Encode ( "in_sync" ) ;
31
- private static readonly System . Text . Json . JsonEncodedText PropMatchingSizeInBytes = System . Text . Json . JsonEncodedText . Encode ( "matching_size_in_bytes" ) ;
32
- private static readonly System . Text . Json . JsonEncodedText PropMatchingSyncId = System . Text . Json . JsonEncodedText . Encode ( "matching_sync_id" ) ;
33
- private static readonly System . Text . Json . JsonEncodedText PropStoreException = System . Text . Json . JsonEncodedText . Encode ( "store_exception" ) ;
34
-
35
- public override Elastic . Clients . Elasticsearch . Cluster . AllocationStore Read ( ref System . Text . Json . Utf8JsonReader reader , System . Type typeToConvert , System . Text . Json . JsonSerializerOptions options )
36
- {
37
- reader . ValidateToken ( System . Text . Json . JsonTokenType . StartObject ) ;
38
- LocalJsonValue < string > propAllocationId = default ;
39
- LocalJsonValue < bool > propFound = default ;
40
- LocalJsonValue < bool > propInSync = default ;
41
- LocalJsonValue < long > propMatchingSizeInBytes = default ;
42
- LocalJsonValue < bool > propMatchingSyncId = default ;
43
- LocalJsonValue < string > propStoreException = default ;
44
- while ( reader . Read ( ) && reader . TokenType is System . Text . Json . JsonTokenType . PropertyName )
45
- {
46
- if ( propAllocationId . TryReadProperty ( ref reader , options , PropAllocationId , null ) )
47
- {
48
- continue ;
49
- }
50
-
51
- if ( propFound . TryReadProperty ( ref reader , options , PropFound , null ) )
52
- {
53
- continue ;
54
- }
55
-
56
- if ( propInSync . TryReadProperty ( ref reader , options , PropInSync , null ) )
57
- {
58
- continue ;
59
- }
60
-
61
- if ( propMatchingSizeInBytes . TryReadProperty ( ref reader , options , PropMatchingSizeInBytes , null ) )
62
- {
63
- continue ;
64
- }
65
-
66
- if ( propMatchingSyncId . TryReadProperty ( ref reader , options , PropMatchingSyncId , null ) )
67
- {
68
- continue ;
69
- }
70
-
71
- if ( propStoreException . TryReadProperty ( ref reader , options , PropStoreException , null ) )
72
- {
73
- continue ;
74
- }
75
-
76
- if ( options . UnmappedMemberHandling is System . Text . Json . Serialization . JsonUnmappedMemberHandling . Skip )
77
- {
78
- reader . Skip ( ) ;
79
- continue ;
80
- }
81
-
82
- throw new System . Text . Json . JsonException ( $ "Unknown JSON property '{ reader . GetString ( ) } ' for type '{ typeToConvert . Name } '.") ;
83
- }
84
-
85
- reader . ValidateToken ( System . Text . Json . JsonTokenType . EndObject ) ;
86
- return new Elastic . Clients . Elasticsearch . Cluster . AllocationStore ( Elastic . Clients . Elasticsearch . Serialization . JsonConstructorSentinel . Instance )
87
- {
88
- AllocationId = propAllocationId . Value ,
89
- Found = propFound . Value ,
90
- InSync = propInSync . Value ,
91
- MatchingSizeInBytes = propMatchingSizeInBytes . Value ,
92
- MatchingSyncId = propMatchingSyncId . Value ,
93
- StoreException = propStoreException . Value
94
- } ;
95
- }
96
-
97
- public override void Write ( System . Text . Json . Utf8JsonWriter writer , Elastic . Clients . Elasticsearch . Cluster . AllocationStore value , System . Text . Json . JsonSerializerOptions options )
98
- {
99
- writer . WriteStartObject ( ) ;
100
- writer . WriteProperty ( options , PropAllocationId , value . AllocationId , null , null ) ;
101
- writer . WriteProperty ( options , PropFound , value . Found , null , null ) ;
102
- writer . WriteProperty ( options , PropInSync , value . InSync , null , null ) ;
103
- writer . WriteProperty ( options , PropMatchingSizeInBytes , value . MatchingSizeInBytes , null , null ) ;
104
- writer . WriteProperty ( options , PropMatchingSyncId , value . MatchingSyncId , null , null ) ;
105
- writer . WriteProperty ( options , PropStoreException , value . StoreException , null , null ) ;
106
- writer . WriteEndObject ( ) ;
107
- }
108
- }
109
-
110
- [ System . Text . Json . Serialization . JsonConverter ( typeof ( Elastic . Clients . Elasticsearch . Cluster . AllocationStoreConverter ) ) ]
111
- public sealed partial class AllocationStore
112
- {
113
- [ System . Diagnostics . CodeAnalysis . SetsRequiredMembers ]
114
- public AllocationStore ( string allocationId , bool found , bool inSync , long matchingSizeInBytes , bool matchingSyncId , string storeException )
115
- {
116
- AllocationId = allocationId ;
117
- Found = found ;
118
- InSync = inSync ;
119
- MatchingSizeInBytes = matchingSizeInBytes ;
120
- MatchingSyncId = matchingSyncId ;
121
- StoreException = storeException ;
122
- }
123
- #if NET7_0_OR_GREATER
124
- public AllocationStore ( )
125
- {
126
- }
127
- #endif
128
- #if ! NET7_0_OR_GREATER
129
- [ System . Obsolete ( "The type contains additional required properties that must be initialized. Please use an alternative constructor to ensure all required values are properly set." ) ]
130
- public AllocationStore ( )
131
- {
132
- }
133
- #endif
134
- [ System . Diagnostics . CodeAnalysis . SetsRequiredMembers ]
135
- internal AllocationStore ( Elastic . Clients . Elasticsearch . Serialization . JsonConstructorSentinel sentinel )
136
- {
137
- _ = sentinel ;
138
- }
139
-
140
- public
141
- #if NET7_0_OR_GREATER
142
- required
143
- #endif
144
- string AllocationId { get ; set ; }
145
- public
146
- #if NET7_0_OR_GREATER
147
- required
148
- #endif
149
- bool Found { get ; set ; }
150
- public
151
- #if NET7_0_OR_GREATER
152
- required
153
- #endif
154
- bool InSync { get ; set ; }
155
- public
156
- #if NET7_0_OR_GREATER
157
- required
158
- #endif
159
- long MatchingSizeInBytes { get ; set ; }
160
- public
161
- #if NET7_0_OR_GREATER
162
- required
163
- #endif
164
- bool MatchingSyncId { get ; set ; }
165
- public
166
- #if NET7_0_OR_GREATER
167
- required
168
- #endif
169
- string StoreException { get ; set ; }
170
- }
0 commit comments