@@ -25,73 +25,73 @@ namespace Elastic.Clients.Elasticsearch.Core.Bulk;
2525
2626internal sealed partial class OperationTypeConverter : System . Text . Json . Serialization . JsonConverter < Elastic . Clients . Elasticsearch . Core . Bulk . OperationType >
2727{
28- private static readonly System . Text . Json . JsonEncodedText MemberIndex = System . Text . Json . JsonEncodedText . Encode ( "index" ) ;
2928 private static readonly System . Text . Json . JsonEncodedText MemberCreate = System . Text . Json . JsonEncodedText . Encode ( "create" ) ;
30- private static readonly System . Text . Json . JsonEncodedText MemberUpdate = System . Text . Json . JsonEncodedText . Encode ( "update" ) ;
3129 private static readonly System . Text . Json . JsonEncodedText MemberDelete = System . Text . Json . JsonEncodedText . Encode ( "delete" ) ;
30+ private static readonly System . Text . Json . JsonEncodedText MemberIndex = System . Text . Json . JsonEncodedText . Encode ( "index" ) ;
31+ private static readonly System . Text . Json . JsonEncodedText MemberUpdate = System . Text . Json . JsonEncodedText . Encode ( "update" ) ;
3232
3333 public override Elastic . Clients . Elasticsearch . Core . Bulk . OperationType Read ( ref System . Text . Json . Utf8JsonReader reader , System . Type typeToConvert , System . Text . Json . JsonSerializerOptions options )
3434 {
35- if ( reader . ValueTextEquals ( MemberIndex ) )
36- {
37- return Elastic . Clients . Elasticsearch . Core . Bulk . OperationType . Index ;
38- }
39-
4035 if ( reader . ValueTextEquals ( MemberCreate ) )
4136 {
4237 return Elastic . Clients . Elasticsearch . Core . Bulk . OperationType . Create ;
4338 }
4439
45- if ( reader . ValueTextEquals ( MemberUpdate ) )
46- {
47- return Elastic . Clients . Elasticsearch . Core . Bulk . OperationType . Update ;
48- }
49-
5040 if ( reader . ValueTextEquals ( MemberDelete ) )
5141 {
5242 return Elastic . Clients . Elasticsearch . Core . Bulk . OperationType . Delete ;
5343 }
5444
55- var value = reader . GetString ( ) ! ;
56- if ( string . Equals ( value , MemberIndex . Value , System . StringComparison . OrdinalIgnoreCase ) )
45+ if ( reader . ValueTextEquals ( MemberIndex ) )
5746 {
5847 return Elastic . Clients . Elasticsearch . Core . Bulk . OperationType . Index ;
5948 }
6049
61- if ( string . Equals ( value , MemberCreate . Value , System . StringComparison . OrdinalIgnoreCase ) )
50+ if ( reader . ValueTextEquals ( MemberUpdate ) )
6251 {
63- return Elastic . Clients . Elasticsearch . Core . Bulk . OperationType . Create ;
52+ return Elastic . Clients . Elasticsearch . Core . Bulk . OperationType . Update ;
6453 }
6554
66- if ( string . Equals ( value , MemberUpdate . Value , System . StringComparison . OrdinalIgnoreCase ) )
55+ var value = reader . GetString ( ) ! ;
56+ if ( string . Equals ( value , MemberCreate . Value , System . StringComparison . OrdinalIgnoreCase ) )
6757 {
68- return Elastic . Clients . Elasticsearch . Core . Bulk . OperationType . Update ;
58+ return Elastic . Clients . Elasticsearch . Core . Bulk . OperationType . Create ;
6959 }
7060
7161 if ( string . Equals ( value , MemberDelete . Value , System . StringComparison . OrdinalIgnoreCase ) )
7262 {
7363 return Elastic . Clients . Elasticsearch . Core . Bulk . OperationType . Delete ;
7464 }
7565
66+ if ( string . Equals ( value , MemberIndex . Value , System . StringComparison . OrdinalIgnoreCase ) )
67+ {
68+ return Elastic . Clients . Elasticsearch . Core . Bulk . OperationType . Index ;
69+ }
70+
71+ if ( string . Equals ( value , MemberUpdate . Value , System . StringComparison . OrdinalIgnoreCase ) )
72+ {
73+ return Elastic . Clients . Elasticsearch . Core . Bulk . OperationType . Update ;
74+ }
75+
7676 throw new System . Text . Json . JsonException ( $ "Unknown member '{ value } ' for enum '{ nameof ( Elastic . Clients . Elasticsearch . Core . Bulk . OperationType ) } '.") ;
7777 }
7878
7979 public override void Write ( System . Text . Json . Utf8JsonWriter writer , Elastic . Clients . Elasticsearch . Core . Bulk . OperationType value , System . Text . Json . JsonSerializerOptions options )
8080 {
8181 switch ( value )
8282 {
83- case Elastic . Clients . Elasticsearch . Core . Bulk . OperationType . Index :
84- writer . WriteStringValue ( MemberIndex ) ;
85- break ;
8683 case Elastic . Clients . Elasticsearch . Core . Bulk . OperationType . Create :
8784 writer . WriteStringValue ( MemberCreate ) ;
8885 break ;
89- case Elastic . Clients . Elasticsearch . Core . Bulk . OperationType . Update :
90- writer . WriteStringValue ( MemberUpdate ) ;
91- break ;
9286 case Elastic . Clients . Elasticsearch . Core . Bulk . OperationType . Delete :
9387 writer . WriteStringValue ( MemberDelete ) ;
9488 break ;
89+ case Elastic . Clients . Elasticsearch . Core . Bulk . OperationType . Index :
90+ writer . WriteStringValue ( MemberIndex ) ;
91+ break ;
92+ case Elastic . Clients . Elasticsearch . Core . Bulk . OperationType . Update :
93+ writer . WriteStringValue ( MemberUpdate ) ;
94+ break ;
9595 default :
9696 throw new System . Text . Json . JsonException ( $ "Invalid value '{ value } ' for enum '{ nameof ( Elastic . Clients . Elasticsearch . Core . Bulk . OperationType ) } '.") ;
9797 }
@@ -110,52 +110,52 @@ public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer,
110110
111111internal sealed partial class FailureStoreStatusConverter : System . Text . Json . Serialization . JsonConverter < Elastic . Clients . Elasticsearch . Core . Bulk . FailureStoreStatus >
112112{
113+ private static readonly System . Text . Json . JsonEncodedText MemberFailed = System . Text . Json . JsonEncodedText . Encode ( "failed" ) ;
113114 private static readonly System . Text . Json . JsonEncodedText MemberNotApplicableOrUnknown = System . Text . Json . JsonEncodedText . Encode ( "not_applicable_or_unknown" ) ;
114- private static readonly System . Text . Json . JsonEncodedText MemberUsed = System . Text . Json . JsonEncodedText . Encode ( "used" ) ;
115115 private static readonly System . Text . Json . JsonEncodedText MemberNotEnabled = System . Text . Json . JsonEncodedText . Encode ( "not_enabled" ) ;
116- private static readonly System . Text . Json . JsonEncodedText MemberFailed = System . Text . Json . JsonEncodedText . Encode ( "failed " ) ;
116+ private static readonly System . Text . Json . JsonEncodedText MemberUsed = System . Text . Json . JsonEncodedText . Encode ( "used " ) ;
117117
118118 public override Elastic . Clients . Elasticsearch . Core . Bulk . FailureStoreStatus Read ( ref System . Text . Json . Utf8JsonReader reader , System . Type typeToConvert , System . Text . Json . JsonSerializerOptions options )
119119 {
120- if ( reader . ValueTextEquals ( MemberNotApplicableOrUnknown ) )
120+ if ( reader . ValueTextEquals ( MemberFailed ) )
121121 {
122- return Elastic . Clients . Elasticsearch . Core . Bulk . FailureStoreStatus . NotApplicableOrUnknown ;
122+ return Elastic . Clients . Elasticsearch . Core . Bulk . FailureStoreStatus . Failed ;
123123 }
124124
125- if ( reader . ValueTextEquals ( MemberUsed ) )
125+ if ( reader . ValueTextEquals ( MemberNotApplicableOrUnknown ) )
126126 {
127- return Elastic . Clients . Elasticsearch . Core . Bulk . FailureStoreStatus . Used ;
127+ return Elastic . Clients . Elasticsearch . Core . Bulk . FailureStoreStatus . NotApplicableOrUnknown ;
128128 }
129129
130130 if ( reader . ValueTextEquals ( MemberNotEnabled ) )
131131 {
132132 return Elastic . Clients . Elasticsearch . Core . Bulk . FailureStoreStatus . NotEnabled ;
133133 }
134134
135- if ( reader . ValueTextEquals ( MemberFailed ) )
135+ if ( reader . ValueTextEquals ( MemberUsed ) )
136136 {
137- return Elastic . Clients . Elasticsearch . Core . Bulk . FailureStoreStatus . Failed ;
137+ return Elastic . Clients . Elasticsearch . Core . Bulk . FailureStoreStatus . Used ;
138138 }
139139
140140 var value = reader . GetString ( ) ! ;
141- if ( string . Equals ( value , MemberNotApplicableOrUnknown . Value , System . StringComparison . OrdinalIgnoreCase ) )
141+ if ( string . Equals ( value , MemberFailed . Value , System . StringComparison . OrdinalIgnoreCase ) )
142142 {
143- return Elastic . Clients . Elasticsearch . Core . Bulk . FailureStoreStatus . NotApplicableOrUnknown ;
143+ return Elastic . Clients . Elasticsearch . Core . Bulk . FailureStoreStatus . Failed ;
144144 }
145145
146- if ( string . Equals ( value , MemberUsed . Value , System . StringComparison . OrdinalIgnoreCase ) )
146+ if ( string . Equals ( value , MemberNotApplicableOrUnknown . Value , System . StringComparison . OrdinalIgnoreCase ) )
147147 {
148- return Elastic . Clients . Elasticsearch . Core . Bulk . FailureStoreStatus . Used ;
148+ return Elastic . Clients . Elasticsearch . Core . Bulk . FailureStoreStatus . NotApplicableOrUnknown ;
149149 }
150150
151151 if ( string . Equals ( value , MemberNotEnabled . Value , System . StringComparison . OrdinalIgnoreCase ) )
152152 {
153153 return Elastic . Clients . Elasticsearch . Core . Bulk . FailureStoreStatus . NotEnabled ;
154154 }
155155
156- if ( string . Equals ( value , MemberFailed . Value , System . StringComparison . OrdinalIgnoreCase ) )
156+ if ( string . Equals ( value , MemberUsed . Value , System . StringComparison . OrdinalIgnoreCase ) )
157157 {
158- return Elastic . Clients . Elasticsearch . Core . Bulk . FailureStoreStatus . Failed ;
158+ return Elastic . Clients . Elasticsearch . Core . Bulk . FailureStoreStatus . Used ;
159159 }
160160
161161 throw new System . Text . Json . JsonException ( $ "Unknown member '{ value } ' for enum '{ nameof ( Elastic . Clients . Elasticsearch . Core . Bulk . FailureStoreStatus ) } '.") ;
@@ -165,17 +165,17 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien
165165 {
166166 switch ( value )
167167 {
168+ case Elastic . Clients . Elasticsearch . Core . Bulk . FailureStoreStatus . Failed :
169+ writer . WriteStringValue ( MemberFailed ) ;
170+ break ;
168171 case Elastic . Clients . Elasticsearch . Core . Bulk . FailureStoreStatus . NotApplicableOrUnknown :
169172 writer . WriteStringValue ( MemberNotApplicableOrUnknown ) ;
170173 break ;
171- case Elastic . Clients . Elasticsearch . Core . Bulk . FailureStoreStatus . Used :
172- writer . WriteStringValue ( MemberUsed ) ;
173- break ;
174174 case Elastic . Clients . Elasticsearch . Core . Bulk . FailureStoreStatus . NotEnabled :
175175 writer . WriteStringValue ( MemberNotEnabled ) ;
176176 break ;
177- case Elastic . Clients . Elasticsearch . Core . Bulk . FailureStoreStatus . Failed :
178- writer . WriteStringValue ( MemberFailed ) ;
177+ case Elastic . Clients . Elasticsearch . Core . Bulk . FailureStoreStatus . Used :
178+ writer . WriteStringValue ( MemberUsed ) ;
179179 break ;
180180 default :
181181 throw new System . Text . Json . JsonException ( $ "Invalid value '{ value } ' for enum '{ nameof ( Elastic . Clients . Elasticsearch . Core . Bulk . FailureStoreStatus ) } '.") ;
@@ -196,25 +196,25 @@ public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer,
196196[ System . Text . Json . Serialization . JsonConverter ( typeof ( Elastic . Clients . Elasticsearch . Core . Bulk . OperationTypeConverter ) ) ]
197197public enum OperationType
198198{
199- [ System . Runtime . Serialization . EnumMember ( Value = "index" ) ]
200- Index ,
201199 [ System . Runtime . Serialization . EnumMember ( Value = "create" ) ]
202200 Create ,
203- [ System . Runtime . Serialization . EnumMember ( Value = "update" ) ]
204- Update ,
205201 [ System . Runtime . Serialization . EnumMember ( Value = "delete" ) ]
206- Delete
202+ Delete ,
203+ [ System . Runtime . Serialization . EnumMember ( Value = "index" ) ]
204+ Index ,
205+ [ System . Runtime . Serialization . EnumMember ( Value = "update" ) ]
206+ Update
207207}
208208
209209[ System . Text . Json . Serialization . JsonConverter ( typeof ( Elastic . Clients . Elasticsearch . Core . Bulk . FailureStoreStatusConverter ) ) ]
210210public enum FailureStoreStatus
211211{
212+ [ System . Runtime . Serialization . EnumMember ( Value = "failed" ) ]
213+ Failed ,
212214 [ System . Runtime . Serialization . EnumMember ( Value = "not_applicable_or_unknown" ) ]
213215 NotApplicableOrUnknown ,
214- [ System . Runtime . Serialization . EnumMember ( Value = "used" ) ]
215- Used ,
216216 [ System . Runtime . Serialization . EnumMember ( Value = "not_enabled" ) ]
217217 NotEnabled ,
218- [ System . Runtime . Serialization . EnumMember ( Value = "failed " ) ]
219- Failed
218+ [ System . Runtime . Serialization . EnumMember ( Value = "used " ) ]
219+ Used
220220}
0 commit comments