@@ -25,73 +25,73 @@ namespace Elastic.Clients.Elasticsearch.Core.Bulk;
25
25
26
26
internal sealed partial class OperationTypeConverter : System . Text . Json . Serialization . JsonConverter < Elastic . Clients . Elasticsearch . Core . Bulk . OperationType >
27
27
{
28
- private static readonly System . Text . Json . JsonEncodedText MemberIndex = System . Text . Json . JsonEncodedText . Encode ( "index" ) ;
29
28
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" ) ;
31
29
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" ) ;
32
32
33
33
public override Elastic . Clients . Elasticsearch . Core . Bulk . OperationType Read ( ref System . Text . Json . Utf8JsonReader reader , System . Type typeToConvert , System . Text . Json . JsonSerializerOptions options )
34
34
{
35
- if ( reader . ValueTextEquals ( MemberIndex ) )
36
- {
37
- return Elastic . Clients . Elasticsearch . Core . Bulk . OperationType . Index ;
38
- }
39
-
40
35
if ( reader . ValueTextEquals ( MemberCreate ) )
41
36
{
42
37
return Elastic . Clients . Elasticsearch . Core . Bulk . OperationType . Create ;
43
38
}
44
39
45
- if ( reader . ValueTextEquals ( MemberUpdate ) )
46
- {
47
- return Elastic . Clients . Elasticsearch . Core . Bulk . OperationType . Update ;
48
- }
49
-
50
40
if ( reader . ValueTextEquals ( MemberDelete ) )
51
41
{
52
42
return Elastic . Clients . Elasticsearch . Core . Bulk . OperationType . Delete ;
53
43
}
54
44
55
- var value = reader . GetString ( ) ! ;
56
- if ( string . Equals ( value , MemberIndex . Value , System . StringComparison . OrdinalIgnoreCase ) )
45
+ if ( reader . ValueTextEquals ( MemberIndex ) )
57
46
{
58
47
return Elastic . Clients . Elasticsearch . Core . Bulk . OperationType . Index ;
59
48
}
60
49
61
- if ( string . Equals ( value , MemberCreate . Value , System . StringComparison . OrdinalIgnoreCase ) )
50
+ if ( reader . ValueTextEquals ( MemberUpdate ) )
62
51
{
63
- return Elastic . Clients . Elasticsearch . Core . Bulk . OperationType . Create ;
52
+ return Elastic . Clients . Elasticsearch . Core . Bulk . OperationType . Update ;
64
53
}
65
54
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 ) )
67
57
{
68
- return Elastic . Clients . Elasticsearch . Core . Bulk . OperationType . Update ;
58
+ return Elastic . Clients . Elasticsearch . Core . Bulk . OperationType . Create ;
69
59
}
70
60
71
61
if ( string . Equals ( value , MemberDelete . Value , System . StringComparison . OrdinalIgnoreCase ) )
72
62
{
73
63
return Elastic . Clients . Elasticsearch . Core . Bulk . OperationType . Delete ;
74
64
}
75
65
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
+
76
76
throw new System . Text . Json . JsonException ( $ "Unknown member '{ value } ' for enum '{ nameof ( Elastic . Clients . Elasticsearch . Core . Bulk . OperationType ) } '.") ;
77
77
}
78
78
79
79
public override void Write ( System . Text . Json . Utf8JsonWriter writer , Elastic . Clients . Elasticsearch . Core . Bulk . OperationType value , System . Text . Json . JsonSerializerOptions options )
80
80
{
81
81
switch ( value )
82
82
{
83
- case Elastic . Clients . Elasticsearch . Core . Bulk . OperationType . Index :
84
- writer . WriteStringValue ( MemberIndex ) ;
85
- break ;
86
83
case Elastic . Clients . Elasticsearch . Core . Bulk . OperationType . Create :
87
84
writer . WriteStringValue ( MemberCreate ) ;
88
85
break ;
89
- case Elastic . Clients . Elasticsearch . Core . Bulk . OperationType . Update :
90
- writer . WriteStringValue ( MemberUpdate ) ;
91
- break ;
92
86
case Elastic . Clients . Elasticsearch . Core . Bulk . OperationType . Delete :
93
87
writer . WriteStringValue ( MemberDelete ) ;
94
88
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 ;
95
95
default :
96
96
throw new System . Text . Json . JsonException ( $ "Invalid value '{ value } ' for enum '{ nameof ( Elastic . Clients . Elasticsearch . Core . Bulk . OperationType ) } '.") ;
97
97
}
@@ -110,52 +110,52 @@ public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer,
110
110
111
111
internal sealed partial class FailureStoreStatusConverter : System . Text . Json . Serialization . JsonConverter < Elastic . Clients . Elasticsearch . Core . Bulk . FailureStoreStatus >
112
112
{
113
+ private static readonly System . Text . Json . JsonEncodedText MemberFailed = System . Text . Json . JsonEncodedText . Encode ( "failed" ) ;
113
114
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" ) ;
115
115
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 " ) ;
117
117
118
118
public override Elastic . Clients . Elasticsearch . Core . Bulk . FailureStoreStatus Read ( ref System . Text . Json . Utf8JsonReader reader , System . Type typeToConvert , System . Text . Json . JsonSerializerOptions options )
119
119
{
120
- if ( reader . ValueTextEquals ( MemberNotApplicableOrUnknown ) )
120
+ if ( reader . ValueTextEquals ( MemberFailed ) )
121
121
{
122
- return Elastic . Clients . Elasticsearch . Core . Bulk . FailureStoreStatus . NotApplicableOrUnknown ;
122
+ return Elastic . Clients . Elasticsearch . Core . Bulk . FailureStoreStatus . Failed ;
123
123
}
124
124
125
- if ( reader . ValueTextEquals ( MemberUsed ) )
125
+ if ( reader . ValueTextEquals ( MemberNotApplicableOrUnknown ) )
126
126
{
127
- return Elastic . Clients . Elasticsearch . Core . Bulk . FailureStoreStatus . Used ;
127
+ return Elastic . Clients . Elasticsearch . Core . Bulk . FailureStoreStatus . NotApplicableOrUnknown ;
128
128
}
129
129
130
130
if ( reader . ValueTextEquals ( MemberNotEnabled ) )
131
131
{
132
132
return Elastic . Clients . Elasticsearch . Core . Bulk . FailureStoreStatus . NotEnabled ;
133
133
}
134
134
135
- if ( reader . ValueTextEquals ( MemberFailed ) )
135
+ if ( reader . ValueTextEquals ( MemberUsed ) )
136
136
{
137
- return Elastic . Clients . Elasticsearch . Core . Bulk . FailureStoreStatus . Failed ;
137
+ return Elastic . Clients . Elasticsearch . Core . Bulk . FailureStoreStatus . Used ;
138
138
}
139
139
140
140
var value = reader . GetString ( ) ! ;
141
- if ( string . Equals ( value , MemberNotApplicableOrUnknown . Value , System . StringComparison . OrdinalIgnoreCase ) )
141
+ if ( string . Equals ( value , MemberFailed . Value , System . StringComparison . OrdinalIgnoreCase ) )
142
142
{
143
- return Elastic . Clients . Elasticsearch . Core . Bulk . FailureStoreStatus . NotApplicableOrUnknown ;
143
+ return Elastic . Clients . Elasticsearch . Core . Bulk . FailureStoreStatus . Failed ;
144
144
}
145
145
146
- if ( string . Equals ( value , MemberUsed . Value , System . StringComparison . OrdinalIgnoreCase ) )
146
+ if ( string . Equals ( value , MemberNotApplicableOrUnknown . Value , System . StringComparison . OrdinalIgnoreCase ) )
147
147
{
148
- return Elastic . Clients . Elasticsearch . Core . Bulk . FailureStoreStatus . Used ;
148
+ return Elastic . Clients . Elasticsearch . Core . Bulk . FailureStoreStatus . NotApplicableOrUnknown ;
149
149
}
150
150
151
151
if ( string . Equals ( value , MemberNotEnabled . Value , System . StringComparison . OrdinalIgnoreCase ) )
152
152
{
153
153
return Elastic . Clients . Elasticsearch . Core . Bulk . FailureStoreStatus . NotEnabled ;
154
154
}
155
155
156
- if ( string . Equals ( value , MemberFailed . Value , System . StringComparison . OrdinalIgnoreCase ) )
156
+ if ( string . Equals ( value , MemberUsed . Value , System . StringComparison . OrdinalIgnoreCase ) )
157
157
{
158
- return Elastic . Clients . Elasticsearch . Core . Bulk . FailureStoreStatus . Failed ;
158
+ return Elastic . Clients . Elasticsearch . Core . Bulk . FailureStoreStatus . Used ;
159
159
}
160
160
161
161
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
165
165
{
166
166
switch ( value )
167
167
{
168
+ case Elastic . Clients . Elasticsearch . Core . Bulk . FailureStoreStatus . Failed :
169
+ writer . WriteStringValue ( MemberFailed ) ;
170
+ break ;
168
171
case Elastic . Clients . Elasticsearch . Core . Bulk . FailureStoreStatus . NotApplicableOrUnknown :
169
172
writer . WriteStringValue ( MemberNotApplicableOrUnknown ) ;
170
173
break ;
171
- case Elastic . Clients . Elasticsearch . Core . Bulk . FailureStoreStatus . Used :
172
- writer . WriteStringValue ( MemberUsed ) ;
173
- break ;
174
174
case Elastic . Clients . Elasticsearch . Core . Bulk . FailureStoreStatus . NotEnabled :
175
175
writer . WriteStringValue ( MemberNotEnabled ) ;
176
176
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 ) ;
179
179
break ;
180
180
default :
181
181
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,
196
196
[ System . Text . Json . Serialization . JsonConverter ( typeof ( Elastic . Clients . Elasticsearch . Core . Bulk . OperationTypeConverter ) ) ]
197
197
public enum OperationType
198
198
{
199
- [ System . Runtime . Serialization . EnumMember ( Value = "index" ) ]
200
- Index ,
201
199
[ System . Runtime . Serialization . EnumMember ( Value = "create" ) ]
202
200
Create ,
203
- [ System . Runtime . Serialization . EnumMember ( Value = "update" ) ]
204
- Update ,
205
201
[ 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
207
207
}
208
208
209
209
[ System . Text . Json . Serialization . JsonConverter ( typeof ( Elastic . Clients . Elasticsearch . Core . Bulk . FailureStoreStatusConverter ) ) ]
210
210
public enum FailureStoreStatus
211
211
{
212
+ [ System . Runtime . Serialization . EnumMember ( Value = "failed" ) ]
213
+ Failed ,
212
214
[ System . Runtime . Serialization . EnumMember ( Value = "not_applicable_or_unknown" ) ]
213
215
NotApplicableOrUnknown ,
214
- [ System . Runtime . Serialization . EnumMember ( Value = "used" ) ]
215
- Used ,
216
216
[ System . Runtime . Serialization . EnumMember ( Value = "not_enabled" ) ]
217
217
NotEnabled ,
218
- [ System . Runtime . Serialization . EnumMember ( Value = "failed " ) ]
219
- Failed
218
+ [ System . Runtime . Serialization . EnumMember ( Value = "used " ) ]
219
+ Used
220
220
}
0 commit comments