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 . AsyncSearch . Json ;
25+
26+ public sealed partial class AsyncSearchStatusResponseConverter : System . Text . Json . Serialization . JsonConverter < Elastic . Clients . Elasticsearch . AsyncSearch . AsyncSearchStatusResponse >
27+ {
28+ private static readonly System . Text . Json . JsonEncodedText PropClusters = System . Text . Json . JsonEncodedText . Encode ( "_clusters" ) ;
29+ private static readonly System . Text . Json . JsonEncodedText PropCompletionStatus = System . Text . Json . JsonEncodedText . Encode ( "completion_status" ) ;
30+ private static readonly System . Text . Json . JsonEncodedText PropCompletionTime = System . Text . Json . JsonEncodedText . Encode ( "completion_time" ) ;
31+ private static readonly System . Text . Json . JsonEncodedText PropCompletionTimeInMillis = System . Text . Json . JsonEncodedText . Encode ( "completion_time_in_millis" ) ;
32+ private static readonly System . Text . Json . JsonEncodedText PropExpirationTime = System . Text . Json . JsonEncodedText . Encode ( "expiration_time" ) ;
33+ private static readonly System . Text . Json . JsonEncodedText PropExpirationTimeInMillis = System . Text . Json . JsonEncodedText . Encode ( "expiration_time_in_millis" ) ;
34+ private static readonly System . Text . Json . JsonEncodedText PropId = System . Text . Json . JsonEncodedText . Encode ( "id" ) ;
35+ private static readonly System . Text . Json . JsonEncodedText PropIsPartial = System . Text . Json . JsonEncodedText . Encode ( "is_partial" ) ;
36+ private static readonly System . Text . Json . JsonEncodedText PropIsRunning = System . Text . Json . JsonEncodedText . Encode ( "is_running" ) ;
37+ private static readonly System . Text . Json . JsonEncodedText PropShards = System . Text . Json . JsonEncodedText . Encode ( "_shards" ) ;
38+ private static readonly System . Text . Json . JsonEncodedText PropStartTime = System . Text . Json . JsonEncodedText . Encode ( "start_time" ) ;
39+ private static readonly System . Text . Json . JsonEncodedText PropStartTimeInMillis = System . Text . Json . JsonEncodedText . Encode ( "start_time_in_millis" ) ;
40+
41+ public override Elastic . Clients . Elasticsearch . AsyncSearch . AsyncSearchStatusResponse Read ( ref System . Text . Json . Utf8JsonReader reader , System . Type typeToConvert , System . Text . Json . JsonSerializerOptions options )
42+ {
43+ reader . ValidateToken ( System . Text . Json . JsonTokenType . StartObject ) ;
44+ LocalJsonValue < Elastic . Clients . Elasticsearch . ClusterStatistics ? > propClusters = default ;
45+ LocalJsonValue < int ? > propCompletionStatus = default ;
46+ LocalJsonValue < System . DateTimeOffset ? > propCompletionTime = default ;
47+ LocalJsonValue < System . DateTimeOffset ? > propCompletionTimeInMillis = default ;
48+ LocalJsonValue < System . DateTimeOffset ? > propExpirationTime = default ;
49+ LocalJsonValue < System . DateTimeOffset > propExpirationTimeInMillis = default ;
50+ LocalJsonValue < string ? > propId = default ;
51+ LocalJsonValue < bool > propIsPartial = default ;
52+ LocalJsonValue < bool > propIsRunning = default ;
53+ LocalJsonValue < Elastic . Clients . Elasticsearch . ShardStatistics > propShards = default ;
54+ LocalJsonValue < System . DateTimeOffset ? > propStartTime = default ;
55+ LocalJsonValue < System . DateTimeOffset > propStartTimeInMillis = default ;
56+ while ( reader . Read ( ) && reader . TokenType is System . Text . Json . JsonTokenType . PropertyName )
57+ {
58+ if ( propClusters . TryReadProperty ( ref reader , options , PropClusters , null ) )
59+ {
60+ continue ;
61+ }
62+
63+ if ( propCompletionStatus . TryReadProperty ( ref reader , options , PropCompletionStatus , static int ? ( ref System . Text . Json . Utf8JsonReader r , System . Text . Json . JsonSerializerOptions o ) => r . ReadNullableValue < int > ( o ) ) )
64+ {
65+ continue ;
66+ }
67+
68+ if ( propCompletionTime . TryReadProperty ( ref reader , options , PropCompletionTime , static System . DateTimeOffset ? ( ref System . Text . Json . Utf8JsonReader r , System . Text . Json . JsonSerializerOptions o ) => r . ReadNullableValueEx < System . DateTimeOffset > ( o , typeof ( Elastic . Clients . Elasticsearch . Serialization . DateTimeMarker ) ) ) )
69+ {
70+ continue ;
71+ }
72+
73+ if ( propCompletionTimeInMillis . TryReadProperty ( ref reader , options , PropCompletionTimeInMillis , static System . DateTimeOffset ? ( ref System . Text . Json . Utf8JsonReader r , System . Text . Json . JsonSerializerOptions o ) => r . ReadNullableValueEx < System . DateTimeOffset > ( o , typeof ( Elastic . Clients . Elasticsearch . Serialization . DateTimeMillisMarker ) ) ) )
74+ {
75+ continue ;
76+ }
77+
78+ if ( propExpirationTime . TryReadProperty ( ref reader , options , PropExpirationTime , static System . DateTimeOffset ? ( ref System . Text . Json . Utf8JsonReader r , System . Text . Json . JsonSerializerOptions o ) => r . ReadNullableValueEx < System . DateTimeOffset > ( o , typeof ( Elastic . Clients . Elasticsearch . Serialization . DateTimeMarker ) ) ) )
79+ {
80+ continue ;
81+ }
82+
83+ if ( propExpirationTimeInMillis . TryReadProperty ( ref reader , options , PropExpirationTimeInMillis , static System . DateTimeOffset ( ref System . Text . Json . Utf8JsonReader r , System . Text . Json . JsonSerializerOptions o ) => r . ReadValueEx < System . DateTimeOffset > ( o , typeof ( Elastic . Clients . Elasticsearch . Serialization . DateTimeMillisMarker ) ) ) )
84+ {
85+ continue ;
86+ }
87+
88+ if ( propId . TryReadProperty ( ref reader , options , PropId , null ) )
89+ {
90+ continue ;
91+ }
92+
93+ if ( propIsPartial . TryReadProperty ( ref reader , options , PropIsPartial , null ) )
94+ {
95+ continue ;
96+ }
97+
98+ if ( propIsRunning . TryReadProperty ( ref reader , options , PropIsRunning , null ) )
99+ {
100+ continue ;
101+ }
102+
103+ if ( propShards . TryReadProperty ( ref reader , options , PropShards , null ) )
104+ {
105+ continue ;
106+ }
107+
108+ if ( propStartTime . TryReadProperty ( ref reader , options , PropStartTime , static System . DateTimeOffset ? ( ref System . Text . Json . Utf8JsonReader r , System . Text . Json . JsonSerializerOptions o ) => r . ReadNullableValueEx < System . DateTimeOffset > ( o , typeof ( Elastic . Clients . Elasticsearch . Serialization . DateTimeMarker ) ) ) )
109+ {
110+ continue ;
111+ }
112+
113+ if ( propStartTimeInMillis . TryReadProperty ( ref reader , options , PropStartTimeInMillis , static System . DateTimeOffset ( ref System . Text . Json . Utf8JsonReader r , System . Text . Json . JsonSerializerOptions o ) => r . ReadValueEx < System . DateTimeOffset > ( o , typeof ( Elastic . Clients . Elasticsearch . Serialization . DateTimeMillisMarker ) ) ) )
114+ {
115+ continue ;
116+ }
117+
118+ if ( options . UnmappedMemberHandling is System . Text . Json . Serialization . JsonUnmappedMemberHandling . Skip )
119+ {
120+ reader . Skip ( ) ;
121+ continue ;
122+ }
123+
124+ throw new System . Text . Json . JsonException ( $ "Unknown JSON property '{ reader . GetString ( ) } ' for type '{ typeToConvert . Name } '.") ;
125+ }
126+
127+ reader . ValidateToken ( System . Text . Json . JsonTokenType . EndObject ) ;
128+ return new Elastic . Clients . Elasticsearch . AsyncSearch . AsyncSearchStatusResponse ( Elastic . Clients . Elasticsearch . Serialization . JsonConstructorSentinel . Instance )
129+ {
130+ Clusters = propClusters . Value ,
131+ CompletionStatus = propCompletionStatus . Value ,
132+ CompletionTime = propCompletionTime . Value ,
133+ CompletionTimeInMillis = propCompletionTimeInMillis . Value ,
134+ ExpirationTime = propExpirationTime . Value ,
135+ ExpirationTimeInMillis = propExpirationTimeInMillis . Value ,
136+ Id = propId . Value ,
137+ IsPartial = propIsPartial . Value ,
138+ IsRunning = propIsRunning . Value ,
139+ Shards = propShards . Value ,
140+ StartTime = propStartTime . Value ,
141+ StartTimeInMillis = propStartTimeInMillis . Value
142+ } ;
143+ }
144+
145+ public override void Write ( System . Text . Json . Utf8JsonWriter writer , Elastic . Clients . Elasticsearch . AsyncSearch . AsyncSearchStatusResponse value , System . Text . Json . JsonSerializerOptions options )
146+ {
147+ writer . WriteStartObject ( ) ;
148+ writer . WriteProperty ( options , PropClusters , value . Clusters , null , null ) ;
149+ writer . WriteProperty ( options , PropCompletionStatus , value . CompletionStatus , null , static ( System . Text . Json . Utf8JsonWriter w , System . Text . Json . JsonSerializerOptions o , int ? v ) => w . WriteNullableValue < int > ( o , v ) ) ;
150+ writer . WriteProperty ( options , PropCompletionTime , value . CompletionTime , null , static ( System . Text . Json . Utf8JsonWriter w , System . Text . Json . JsonSerializerOptions o , System . DateTimeOffset ? v ) => w . WriteNullableValueEx < System . DateTimeOffset > ( o , v , typeof ( Elastic . Clients . Elasticsearch . Serialization . DateTimeMarker ) ) ) ;
151+ writer . WriteProperty ( options , PropCompletionTimeInMillis , value . CompletionTimeInMillis , null , static ( System . Text . Json . Utf8JsonWriter w , System . Text . Json . JsonSerializerOptions o , System . DateTimeOffset ? v ) => w . WriteNullableValueEx < System . DateTimeOffset > ( o , v , typeof ( Elastic . Clients . Elasticsearch . Serialization . DateTimeMillisMarker ) ) ) ;
152+ writer . WriteProperty ( options , PropExpirationTime , value . ExpirationTime , null , static ( System . Text . Json . Utf8JsonWriter w , System . Text . Json . JsonSerializerOptions o , System . DateTimeOffset ? v ) => w . WriteNullableValueEx < System . DateTimeOffset > ( o , v , typeof ( Elastic . Clients . Elasticsearch . Serialization . DateTimeMarker ) ) ) ;
153+ writer . WriteProperty ( options , PropExpirationTimeInMillis , value . ExpirationTimeInMillis , null , static ( System . Text . Json . Utf8JsonWriter w , System . Text . Json . JsonSerializerOptions o , System . DateTimeOffset v ) => w . WriteValueEx < System . DateTimeOffset > ( o , v , typeof ( Elastic . Clients . Elasticsearch . Serialization . DateTimeMillisMarker ) ) ) ;
154+ writer . WriteProperty ( options , PropId , value . Id , null , null ) ;
155+ writer . WriteProperty ( options , PropIsPartial , value . IsPartial , null , null ) ;
156+ writer . WriteProperty ( options , PropIsRunning , value . IsRunning , null , null ) ;
157+ writer . WriteProperty ( options , PropShards , value . Shards , null , null ) ;
158+ writer . WriteProperty ( options , PropStartTime , value . StartTime , null , static ( System . Text . Json . Utf8JsonWriter w , System . Text . Json . JsonSerializerOptions o , System . DateTimeOffset ? v ) => w . WriteNullableValueEx < System . DateTimeOffset > ( o , v , typeof ( Elastic . Clients . Elasticsearch . Serialization . DateTimeMarker ) ) ) ;
159+ writer . WriteProperty ( options , PropStartTimeInMillis , value . StartTimeInMillis , null , static ( System . Text . Json . Utf8JsonWriter w , System . Text . Json . JsonSerializerOptions o , System . DateTimeOffset v ) => w . WriteValueEx < System . DateTimeOffset > ( o , v , typeof ( Elastic . Clients . Elasticsearch . Serialization . DateTimeMillisMarker ) ) ) ;
160+ writer . WriteEndObject ( ) ;
161+ }
162+ }
0 commit comments