File tree 1 file changed +14
-5
lines changed
src/Elastic.Clients.Elasticsearch/Api
1 file changed +14
-5
lines changed Original file line number Diff line number Diff line change 2
2
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
3
3
// See the LICENSE file in the project root for more information.
4
4
5
+ using System ;
6
+
5
7
namespace Elastic . Clients . Elasticsearch . Core . Bulk ;
6
8
7
9
public abstract partial class ResponseItem
@@ -15,12 +17,19 @@ public bool IsValid
15
17
if ( Error is not null )
16
18
return false ;
17
19
18
- return Operation . ToLowerInvariant ( ) switch
20
+ var operation = Operation ;
21
+
22
+ if ( operation . Equals ( "delete" , StringComparison . OrdinalIgnoreCase ) )
23
+ return Status is 200 or 404 ;
24
+
25
+ if ( operation . Equals ( "create" , StringComparison . OrdinalIgnoreCase ) ||
26
+ operation . Equals ( "update" , StringComparison . OrdinalIgnoreCase ) ||
27
+ operation . Equals ( "index" , StringComparison . OrdinalIgnoreCase ) )
19
28
{
20
- "delete" => Status == 200 || Status == 404 ,
21
- "update" or "index" or "create" => Status == 200 || Status == 201 ,
22
- _ => false ,
23
- } ;
29
+ return Status is 200 or 201 ;
30
+ }
31
+
32
+ return false ;
24
33
}
25
34
}
26
35
}
You can’t perform that action at this time.
0 commit comments