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
+ using Elastic . Clients . Elasticsearch . Fluent ;
19
+ using Elastic . Clients . Elasticsearch . Requests ;
20
+ using Elastic . Clients . Elasticsearch . Serialization ;
21
+ using Elastic . Transport ;
22
+ using System ;
23
+ using System . Collections . Generic ;
24
+ using System . Linq . Expressions ;
25
+ using System . Text . Json ;
26
+ using System . Text . Json . Serialization ;
27
+
28
+ #nullable restore
29
+ namespace Elastic . Clients . Elasticsearch . IndexManagement ;
30
+ public sealed class UpdateAliasesRequestParameters : RequestParameters
31
+ {
32
+ [ JsonIgnore ]
33
+ public Elastic . Clients . Elasticsearch . Duration ? MasterTimeout { get => Q < Elastic . Clients . Elasticsearch . Duration ? > ( "master_timeout" ) ; set => Q ( "master_timeout" , value ) ; }
34
+
35
+ [ JsonIgnore ]
36
+ public Elastic . Clients . Elasticsearch . Duration ? Timeout { get => Q < Elastic . Clients . Elasticsearch . Duration ? > ( "timeout" ) ; set => Q ( "timeout" , value ) ; }
37
+ }
38
+
39
+ public sealed partial class UpdateAliasesRequest : PlainRequest < UpdateAliasesRequestParameters >
40
+ {
41
+ internal override ApiUrls ApiUrls => ApiUrlsLookups . IndexManagementUpdateAliases ;
42
+ protected override HttpMethod StaticHttpMethod => HttpMethod . POST ;
43
+ internal override bool SupportsBody => true ;
44
+ [ JsonIgnore ]
45
+ public Elastic . Clients . Elasticsearch . Duration ? MasterTimeout { get => Q < Elastic . Clients . Elasticsearch . Duration ? > ( "master_timeout" ) ; set => Q ( "master_timeout" , value ) ; }
46
+
47
+ [ JsonIgnore ]
48
+ public Elastic . Clients . Elasticsearch . Duration ? Timeout { get => Q < Elastic . Clients . Elasticsearch . Duration ? > ( "timeout" ) ; set => Q ( "timeout" , value ) ; }
49
+
50
+ [ JsonInclude , JsonPropertyName ( "actions" ) ]
51
+ public ICollection < Elastic . Clients . Elasticsearch . IndexManagement . Action > ? Actions { get ; set ; }
52
+ }
53
+
54
+ public sealed partial class UpdateAliasesRequestDescriptor < TDocument > : RequestDescriptor < UpdateAliasesRequestDescriptor < TDocument > , UpdateAliasesRequestParameters >
55
+ {
56
+ internal UpdateAliasesRequestDescriptor ( Action < UpdateAliasesRequestDescriptor < TDocument > > configure ) => configure . Invoke ( this ) ;
57
+ public UpdateAliasesRequestDescriptor ( )
58
+ {
59
+ }
60
+
61
+ internal override ApiUrls ApiUrls => ApiUrlsLookups . IndexManagementUpdateAliases ;
62
+ protected override HttpMethod StaticHttpMethod => HttpMethod . POST ;
63
+ internal override bool SupportsBody => true ;
64
+ public UpdateAliasesRequestDescriptor < TDocument > MasterTimeout ( Elastic . Clients . Elasticsearch . Duration ? masterTimeout ) => Qs ( "master_timeout" , masterTimeout ) ;
65
+ public UpdateAliasesRequestDescriptor < TDocument > Timeout ( Elastic . Clients . Elasticsearch . Duration ? timeout ) => Qs ( "timeout" , timeout ) ;
66
+ private ICollection < Elastic . Clients . Elasticsearch . IndexManagement . Action > ? ActionsValue { get ; set ; }
67
+
68
+ private ActionDescriptor ActionsDescriptor { get ; set ; }
69
+
70
+ private Action < ActionDescriptor > ActionsDescriptorAction { get ; set ; }
71
+
72
+ private Action < ActionDescriptor > [ ] ActionsDescriptorActions { get ; set ; }
73
+
74
+ public UpdateAliasesRequestDescriptor < TDocument > Actions ( ICollection < Elastic . Clients . Elasticsearch . IndexManagement . Action > ? actions )
75
+ {
76
+ ActionsDescriptor = null ;
77
+ ActionsDescriptorAction = null ;
78
+ ActionsDescriptorActions = null ;
79
+ ActionsValue = actions ;
80
+ return Self ;
81
+ }
82
+
83
+ public UpdateAliasesRequestDescriptor < TDocument > Actions ( ActionDescriptor descriptor )
84
+ {
85
+ ActionsValue = null ;
86
+ ActionsDescriptorAction = null ;
87
+ ActionsDescriptorActions = null ;
88
+ ActionsDescriptor = descriptor ;
89
+ return Self ;
90
+ }
91
+
92
+ public UpdateAliasesRequestDescriptor < TDocument > Actions ( Action < ActionDescriptor > configure )
93
+ {
94
+ ActionsValue = null ;
95
+ ActionsDescriptor = null ;
96
+ ActionsDescriptorActions = null ;
97
+ ActionsDescriptorAction = configure ;
98
+ return Self ;
99
+ }
100
+
101
+ public UpdateAliasesRequestDescriptor < TDocument > Actions ( params Action < ActionDescriptor > [ ] configure )
102
+ {
103
+ ActionsValue = null ;
104
+ ActionsDescriptor = null ;
105
+ ActionsDescriptorAction = null ;
106
+ ActionsDescriptorActions = configure ;
107
+ return Self ;
108
+ }
109
+
110
+ protected override void Serialize ( Utf8JsonWriter writer , JsonSerializerOptions options , IElasticsearchClientSettings settings )
111
+ {
112
+ writer . WriteStartObject ( ) ;
113
+ if ( ActionsDescriptor is not null )
114
+ {
115
+ writer . WritePropertyName ( "actions" ) ;
116
+ writer . WriteStartArray ( ) ;
117
+ JsonSerializer . Serialize ( writer , ActionsDescriptor , options ) ;
118
+ writer . WriteEndArray ( ) ;
119
+ }
120
+ else if ( ActionsDescriptorAction is not null )
121
+ {
122
+ writer . WritePropertyName ( "actions" ) ;
123
+ writer . WriteStartArray ( ) ;
124
+ JsonSerializer . Serialize ( writer , new ActionDescriptor ( ActionsDescriptorAction ) , options ) ;
125
+ writer . WriteEndArray ( ) ;
126
+ }
127
+ else if ( ActionsDescriptorActions is not null )
128
+ {
129
+ writer . WritePropertyName ( "actions" ) ;
130
+ writer . WriteStartArray ( ) ;
131
+ foreach ( var action in ActionsDescriptorActions )
132
+ {
133
+ JsonSerializer . Serialize ( writer , new ActionDescriptor ( action ) , options ) ;
134
+ }
135
+
136
+ writer . WriteEndArray ( ) ;
137
+ }
138
+ else if ( ActionsValue is not null )
139
+ {
140
+ writer . WritePropertyName ( "actions" ) ;
141
+ JsonSerializer . Serialize ( writer , ActionsValue , options ) ;
142
+ }
143
+
144
+ writer . WriteEndObject ( ) ;
145
+ }
146
+ }
147
+
148
+ public sealed partial class UpdateAliasesRequestDescriptor : RequestDescriptor < UpdateAliasesRequestDescriptor , UpdateAliasesRequestParameters >
149
+ {
150
+ internal UpdateAliasesRequestDescriptor ( Action < UpdateAliasesRequestDescriptor > configure ) => configure . Invoke ( this ) ;
151
+ public UpdateAliasesRequestDescriptor ( )
152
+ {
153
+ }
154
+
155
+ internal override ApiUrls ApiUrls => ApiUrlsLookups . IndexManagementUpdateAliases ;
156
+ protected override HttpMethod StaticHttpMethod => HttpMethod . POST ;
157
+ internal override bool SupportsBody => true ;
158
+ public UpdateAliasesRequestDescriptor MasterTimeout ( Elastic . Clients . Elasticsearch . Duration ? masterTimeout ) => Qs ( "master_timeout" , masterTimeout ) ;
159
+ public UpdateAliasesRequestDescriptor Timeout ( Elastic . Clients . Elasticsearch . Duration ? timeout ) => Qs ( "timeout" , timeout ) ;
160
+ private ICollection < Elastic . Clients . Elasticsearch . IndexManagement . Action > ? ActionsValue { get ; set ; }
161
+
162
+ private ActionDescriptor ActionsDescriptor { get ; set ; }
163
+
164
+ private Action < ActionDescriptor > ActionsDescriptorAction { get ; set ; }
165
+
166
+ private Action < ActionDescriptor > [ ] ActionsDescriptorActions { get ; set ; }
167
+
168
+ public UpdateAliasesRequestDescriptor Actions ( ICollection < Elastic . Clients . Elasticsearch . IndexManagement . Action > ? actions )
169
+ {
170
+ ActionsDescriptor = null ;
171
+ ActionsDescriptorAction = null ;
172
+ ActionsDescriptorActions = null ;
173
+ ActionsValue = actions ;
174
+ return Self ;
175
+ }
176
+
177
+ public UpdateAliasesRequestDescriptor Actions ( ActionDescriptor descriptor )
178
+ {
179
+ ActionsValue = null ;
180
+ ActionsDescriptorAction = null ;
181
+ ActionsDescriptorActions = null ;
182
+ ActionsDescriptor = descriptor ;
183
+ return Self ;
184
+ }
185
+
186
+ public UpdateAliasesRequestDescriptor Actions ( Action < ActionDescriptor > configure )
187
+ {
188
+ ActionsValue = null ;
189
+ ActionsDescriptor = null ;
190
+ ActionsDescriptorActions = null ;
191
+ ActionsDescriptorAction = configure ;
192
+ return Self ;
193
+ }
194
+
195
+ public UpdateAliasesRequestDescriptor Actions ( params Action < ActionDescriptor > [ ] configure )
196
+ {
197
+ ActionsValue = null ;
198
+ ActionsDescriptor = null ;
199
+ ActionsDescriptorAction = null ;
200
+ ActionsDescriptorActions = configure ;
201
+ return Self ;
202
+ }
203
+
204
+ protected override void Serialize ( Utf8JsonWriter writer , JsonSerializerOptions options , IElasticsearchClientSettings settings )
205
+ {
206
+ writer . WriteStartObject ( ) ;
207
+ if ( ActionsDescriptor is not null )
208
+ {
209
+ writer . WritePropertyName ( "actions" ) ;
210
+ writer . WriteStartArray ( ) ;
211
+ JsonSerializer . Serialize ( writer , ActionsDescriptor , options ) ;
212
+ writer . WriteEndArray ( ) ;
213
+ }
214
+ else if ( ActionsDescriptorAction is not null )
215
+ {
216
+ writer . WritePropertyName ( "actions" ) ;
217
+ writer . WriteStartArray ( ) ;
218
+ JsonSerializer . Serialize ( writer , new ActionDescriptor ( ActionsDescriptorAction ) , options ) ;
219
+ writer . WriteEndArray ( ) ;
220
+ }
221
+ else if ( ActionsDescriptorActions is not null )
222
+ {
223
+ writer . WritePropertyName ( "actions" ) ;
224
+ writer . WriteStartArray ( ) ;
225
+ foreach ( var action in ActionsDescriptorActions )
226
+ {
227
+ JsonSerializer . Serialize ( writer , new ActionDescriptor ( action ) , options ) ;
228
+ }
229
+
230
+ writer . WriteEndArray ( ) ;
231
+ }
232
+ else if ( ActionsValue is not null )
233
+ {
234
+ writer . WritePropertyName ( "actions" ) ;
235
+ JsonSerializer . Serialize ( writer , ActionsValue , options ) ;
236
+ }
237
+
238
+ writer . WriteEndObject ( ) ;
239
+ }
240
+ }
0 commit comments