30
30
* GitHub history for details.
31
31
*/
32
32
33
+ //----------------------------------------------------
34
+ // THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST.
35
+ //----------------------------------------------------
36
+
33
37
package org .opensearch .client .opensearch .snapshot ;
34
38
35
39
import java .util .HashMap ;
36
40
import java .util .Map ;
37
41
import java .util .function .Function ;
42
+ import javax .annotation .Generated ;
38
43
import javax .annotation .Nullable ;
39
44
import org .opensearch .client .opensearch ._types .ErrorResponse ;
40
45
import org .opensearch .client .opensearch ._types .RequestBase ;
49
54
50
55
/**
51
56
* Removes stale data from repository.
52
- *
53
57
*/
54
-
58
+ @ Generated ( "org.opensearch.client.codegen.CodeGenerator" )
55
59
public class CleanupRepositoryRequest extends RequestBase {
56
- @ Deprecated
57
- @ Nullable
58
- private final Time masterTimeout ;
59
60
60
61
@ Nullable
61
62
private final Time clusterManagerTimeout ;
62
63
63
- private final String name ;
64
+ @ Deprecated
65
+ @ Nullable
66
+ private final Time masterTimeout ;
67
+
68
+ private final String repository ;
64
69
65
70
@ Nullable
66
71
private final Time timeout ;
67
72
68
73
// ---------------------------------------------------------------------------------------------
69
74
70
75
private CleanupRepositoryRequest (Builder builder ) {
71
-
72
- this .masterTimeout = builder .masterTimeout ;
73
76
this .clusterManagerTimeout = builder .clusterManagerTimeout ;
74
- this .name = ApiTypeHelper .requireNonNull (builder .name , this , "name" );
77
+ this .masterTimeout = builder .masterTimeout ;
78
+ this .repository = ApiTypeHelper .requireNonNull (builder .repository , this , "repository" );
75
79
this .timeout = builder .timeout ;
76
-
77
80
}
78
81
79
- public static CleanupRepositoryRequest of (Function <Builder , ObjectBuilder <CleanupRepositoryRequest >> fn ) {
82
+ public static CleanupRepositoryRequest of (Function <CleanupRepositoryRequest . Builder , ObjectBuilder <CleanupRepositoryRequest >> fn ) {
80
83
return fn .apply (new Builder ()).build ();
81
84
}
82
85
83
86
/**
84
- * Explicit operation timeout for connection to master node
87
+ * Operation timeout for connection to cluster-manager node.
85
88
* <p>
86
- * API name: {@code master_timeout}
89
+ * API name: {@code cluster_manager_timeout}
90
+ * </p>
87
91
*/
88
- @ Deprecated
89
92
@ Nullable
90
- public final Time masterTimeout () {
91
- return this .masterTimeout ;
93
+ public final Time clusterManagerTimeout () {
94
+ return this .clusterManagerTimeout ;
92
95
}
93
96
94
97
/**
95
- * Explicit operation timeout for connection to cluster-manager node
98
+ * Period to wait for a connection to the master node.
96
99
* <p>
97
- * API name: {@code cluster_manager_timeout}
100
+ * API name: {@code master_timeout}
101
+ * </p>
98
102
*/
103
+ @ Deprecated
99
104
@ Nullable
100
- public final Time clusterManagerTimeout () {
101
- return this .clusterManagerTimeout ;
105
+ public final Time masterTimeout () {
106
+ return this .masterTimeout ;
102
107
}
103
108
104
109
/**
105
- * Required - A repository name
110
+ * Required - Snapshot repository to clean up.
106
111
* <p>
107
112
* API name: {@code repository}
113
+ * </p>
108
114
*/
109
- public final String name () {
110
- return this .name ;
115
+ public final String repository () {
116
+ return this .repository ;
111
117
}
112
118
113
119
/**
114
- * Explicit operation timeout
120
+ * Period to wait for a response.
115
121
* <p>
116
122
* API name: {@code timeout}
123
+ * </p>
117
124
*/
118
125
@ Nullable
119
126
public final Time timeout () {
@@ -125,94 +132,95 @@ public final Time timeout() {
125
132
/**
126
133
* Builder for {@link CleanupRepositoryRequest}.
127
134
*/
128
-
129
135
public static class Builder extends ObjectBuilderBase implements ObjectBuilder <CleanupRepositoryRequest > {
130
- @ Deprecated
131
- @ Nullable
132
- private Time masterTimeout ;
133
-
134
136
@ Nullable
135
137
private Time clusterManagerTimeout ;
136
-
137
- private String name ;
138
-
138
+ @ Nullable
139
+ private Time masterTimeout ;
140
+ private String repository ;
139
141
@ Nullable
140
142
private Time timeout ;
141
143
142
144
/**
143
- * Explicit operation timeout for connection to master node
145
+ * Operation timeout for connection to cluster-manager node.
144
146
* <p>
145
- * API name: {@code master_timeout}
147
+ * API name: {@code cluster_manager_timeout}
148
+ * </p>
146
149
*/
147
- @ Deprecated
148
- public final Builder masterTimeout (@ Nullable Time value ) {
149
- this .masterTimeout = value ;
150
+ public final Builder clusterManagerTimeout (@ Nullable Time value ) {
151
+ this .clusterManagerTimeout = value ;
150
152
return this ;
151
153
}
152
154
153
155
/**
154
- * Explicit operation timeout for connection to master node
156
+ * Operation timeout for connection to cluster-manager node.
155
157
* <p>
156
- * API name: {@code master_timeout}
158
+ * API name: {@code cluster_manager_timeout}
159
+ * </p>
157
160
*/
158
- @ Deprecated
159
- public final Builder masterTimeout (Function <Time .Builder , ObjectBuilder <Time >> fn ) {
160
- return this .masterTimeout (fn .apply (new Time .Builder ()).build ());
161
+ public final Builder clusterManagerTimeout (Function <Time .Builder , ObjectBuilder <Time >> fn ) {
162
+ return clusterManagerTimeout (fn .apply (new Time .Builder ()).build ());
161
163
}
162
164
163
165
/**
164
- * Explicit operation timeout for connection to cluster-manager node
166
+ * Period to wait for a connection to the master node.
165
167
* <p>
166
- * API name: {@code cluster_manager_timeout}
168
+ * API name: {@code master_timeout}
169
+ * </p>
167
170
*/
168
- public final Builder clusterManagerTimeout (@ Nullable Time value ) {
169
- this .clusterManagerTimeout = value ;
171
+ @ Deprecated
172
+ public final Builder masterTimeout (@ Nullable Time value ) {
173
+ this .masterTimeout = value ;
170
174
return this ;
171
175
}
172
176
173
177
/**
174
- * Explicit operation timeout for connection to cluster-manager node
178
+ * Period to wait for a connection to the master node.
175
179
* <p>
176
- * API name: {@code cluster_manager_timeout}
180
+ * API name: {@code master_timeout}
181
+ * </p>
177
182
*/
178
- public final Builder clusterManagerTimeout (Function <Time .Builder , ObjectBuilder <Time >> fn ) {
179
- return this .clusterManagerTimeout (fn .apply (new Time .Builder ()).build ());
183
+ @ Deprecated
184
+ public final Builder masterTimeout (Function <Time .Builder , ObjectBuilder <Time >> fn ) {
185
+ return masterTimeout (fn .apply (new Time .Builder ()).build ());
180
186
}
181
187
182
188
/**
183
- * Required - A repository name
189
+ * Required - Snapshot repository to clean up.
184
190
* <p>
185
191
* API name: {@code repository}
192
+ * </p>
186
193
*/
187
- public final Builder name (String value ) {
188
- this .name = value ;
194
+ public final Builder repository (String value ) {
195
+ this .repository = value ;
189
196
return this ;
190
197
}
191
198
192
199
/**
193
- * Explicit operation timeout
200
+ * Period to wait for a response.
194
201
* <p>
195
202
* API name: {@code timeout}
203
+ * </p>
196
204
*/
197
205
public final Builder timeout (@ Nullable Time value ) {
198
206
this .timeout = value ;
199
207
return this ;
200
208
}
201
209
202
210
/**
203
- * Explicit operation timeout
211
+ * Period to wait for a response.
204
212
* <p>
205
213
* API name: {@code timeout}
214
+ * </p>
206
215
*/
207
216
public final Builder timeout (Function <Time .Builder , ObjectBuilder <Time >> fn ) {
208
- return this . timeout (fn .apply (new Time .Builder ()).build ());
217
+ return timeout (fn .apply (new Time .Builder ()).build ());
209
218
}
210
219
211
220
/**
212
221
* Builds a {@link CleanupRepositoryRequest}.
213
222
*
214
- * @throws NullPointerException
215
- * if some of the required fields are null.
223
+ * @throws NullPointerException if some of the required fields are null.
216
224
*/
217
225
public CleanupRepositoryRequest build () {
218
226
_checkSingleUse ();
@@ -227,47 +235,29 @@ public CleanupRepositoryRequest build() {
227
235
* Endpoint "{@code snapshot.cleanup_repository}".
228
236
*/
229
237
public static final Endpoint <CleanupRepositoryRequest , CleanupRepositoryResponse , ErrorResponse > _ENDPOINT = new SimpleEndpoint <>(
230
-
231
238
// Request method
232
- request -> {
233
- return "POST" ;
234
-
235
- },
236
-
239
+ request -> "POST" ,
237
240
// Request path
238
241
request -> {
239
- final int _name = 1 << 0 ;
240
-
241
- int propsSet = 0 ;
242
-
243
- propsSet |= _name ;
244
-
245
- if (propsSet == (_name )) {
246
- StringBuilder buf = new StringBuilder ();
247
- buf .append ("/_snapshot" );
248
- buf .append ("/" );
249
- SimpleEndpoint .pathEncode (request .name , buf );
250
- buf .append ("/_cleanup" );
251
- return buf .toString ();
252
- }
253
- throw SimpleEndpoint .noPathTemplateFound ("path" );
254
-
242
+ StringBuilder buf = new StringBuilder ();
243
+ buf .append ("/_snapshot/" );
244
+ SimpleEndpoint .pathEncode (request .repository , buf );
245
+ buf .append ("/_cleanup" );
246
+ return buf .toString ();
255
247
},
256
-
257
248
// Request parameters
258
249
request -> {
259
250
Map <String , String > params = new HashMap <>();
260
- if (request .masterTimeout != null ) {
261
- params .put ("master_timeout" , request .masterTimeout ._toJsonString ());
262
- }
263
251
if (request .clusterManagerTimeout != null ) {
264
252
params .put ("cluster_manager_timeout" , request .clusterManagerTimeout ._toJsonString ());
265
253
}
254
+ if (request .masterTimeout != null ) {
255
+ params .put ("master_timeout" , request .masterTimeout ._toJsonString ());
256
+ }
266
257
if (request .timeout != null ) {
267
258
params .put ("timeout" , request .timeout ._toJsonString ());
268
259
}
269
260
return params ;
270
-
271
261
},
272
262
SimpleEndpoint .emptyMap (),
273
263
false ,
0 commit comments