forked from elastic/elasticsearch-net
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathElasticLowLevelClient.Security.cs
375 lines (373 loc) · 45.3 KB
/
ElasticLowLevelClient.Security.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗
// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝
// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗
// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝
// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗
// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝
// -----------------------------------------------
//
// This file is automatically generated
// Please do not edit these files manually
// Run the following in the root of the repos:
//
// *NIX : ./build.sh codegen
// Windows : build.bat codegen
//
// -----------------------------------------------
// ReSharper disable RedundantUsingDirective
using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using Elasticsearch.Net;
using static Elasticsearch.Net.HttpMethod;
// ReSharper disable InterpolatedStringExpressionIsNotIFormattable
// ReSharper disable once CheckNamespace
// ReSharper disable InterpolatedStringExpressionIsNotIFormattable
// ReSharper disable RedundantExtendsListEntry
namespace Elasticsearch.Net.Specification.SecurityApi
{
///<summary>
/// Security APIs.
/// <para>Not intended to be instantiated directly. Use the <see cref = "IElasticLowLevelClient.Security"/> property
/// on <see cref = "IElasticLowLevelClient"/>.
///</para>
///</summary>
public class LowLevelSecurityNamespace : NamespacedClientProxy
{
internal LowLevelSecurityNamespace(ElasticLowLevelClient client): base(client)
{
}
///<summary>GET on /_security/_authenticate <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-authenticate.html</para></summary>
///<param name = "requestParameters">Request specific configuration such as querystring parameters & request specific connection settings.</param>
public TResponse Authenticate<TResponse>(AuthenticateRequestParameters requestParameters = null)
where TResponse : class, IElasticsearchResponse, new() => DoRequest<TResponse>(GET, "_security/_authenticate", null, RequestParams(requestParameters));
///<summary>GET on /_security/_authenticate <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-authenticate.html</para></summary>
///<param name = "requestParameters">Request specific configuration such as querystring parameters & request specific connection settings.</param>
public Task<TResponse> AuthenticateAsync<TResponse>(AuthenticateRequestParameters requestParameters = null, CancellationToken ctx = default)
where TResponse : class, IElasticsearchResponse, new() => DoRequestAsync<TResponse>(GET, "_security/_authenticate", ctx, null, RequestParams(requestParameters));
///<summary>PUT on /_security/user/{username}/_password <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-change-password.html</para></summary>
///<param name = "username">The username of the user to change the password for</param>
///<param name = "body">the new password for the user</param>
///<param name = "requestParameters">Request specific configuration such as querystring parameters & request specific connection settings.</param>
public TResponse ChangePassword<TResponse>(string username, PostData body, ChangePasswordRequestParameters requestParameters = null)
where TResponse : class, IElasticsearchResponse, new() => DoRequest<TResponse>(PUT, Url($"_security/user/{username:username}/_password"), body, RequestParams(requestParameters));
///<summary>PUT on /_security/user/{username}/_password <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-change-password.html</para></summary>
///<param name = "username">The username of the user to change the password for</param>
///<param name = "body">the new password for the user</param>
///<param name = "requestParameters">Request specific configuration such as querystring parameters & request specific connection settings.</param>
public Task<TResponse> ChangePasswordAsync<TResponse>(string username, PostData body, ChangePasswordRequestParameters requestParameters = null, CancellationToken ctx = default)
where TResponse : class, IElasticsearchResponse, new() => DoRequestAsync<TResponse>(PUT, Url($"_security/user/{username:username}/_password"), ctx, body, RequestParams(requestParameters));
///<summary>PUT on /_security/user/_password <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-change-password.html</para></summary>
///<param name = "body">the new password for the user</param>
///<param name = "requestParameters">Request specific configuration such as querystring parameters & request specific connection settings.</param>
public TResponse ChangePassword<TResponse>(PostData body, ChangePasswordRequestParameters requestParameters = null)
where TResponse : class, IElasticsearchResponse, new() => DoRequest<TResponse>(PUT, "_security/user/_password", body, RequestParams(requestParameters));
///<summary>PUT on /_security/user/_password <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-change-password.html</para></summary>
///<param name = "body">the new password for the user</param>
///<param name = "requestParameters">Request specific configuration such as querystring parameters & request specific connection settings.</param>
public Task<TResponse> ChangePasswordAsync<TResponse>(PostData body, ChangePasswordRequestParameters requestParameters = null, CancellationToken ctx = default)
where TResponse : class, IElasticsearchResponse, new() => DoRequestAsync<TResponse>(PUT, "_security/user/_password", ctx, body, RequestParams(requestParameters));
///<summary>POST on /_security/realm/{realms}/_clear_cache <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-cache.html</para></summary>
///<param name = "realms">Comma-separated list of realms to clear</param>
///<param name = "requestParameters">Request specific configuration such as querystring parameters & request specific connection settings.</param>
public TResponse ClearCachedRealms<TResponse>(string realms, ClearCachedRealmsRequestParameters requestParameters = null)
where TResponse : class, IElasticsearchResponse, new() => DoRequest<TResponse>(POST, Url($"_security/realm/{realms:realms}/_clear_cache"), null, RequestParams(requestParameters));
///<summary>POST on /_security/realm/{realms}/_clear_cache <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-cache.html</para></summary>
///<param name = "realms">Comma-separated list of realms to clear</param>
///<param name = "requestParameters">Request specific configuration such as querystring parameters & request specific connection settings.</param>
public Task<TResponse> ClearCachedRealmsAsync<TResponse>(string realms, ClearCachedRealmsRequestParameters requestParameters = null, CancellationToken ctx = default)
where TResponse : class, IElasticsearchResponse, new() => DoRequestAsync<TResponse>(POST, Url($"_security/realm/{realms:realms}/_clear_cache"), ctx, null, RequestParams(requestParameters));
///<summary>POST on /_security/role/{name}/_clear_cache <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-role-cache.html</para></summary>
///<param name = "name">Role name</param>
///<param name = "requestParameters">Request specific configuration such as querystring parameters & request specific connection settings.</param>
public TResponse ClearCachedRoles<TResponse>(string name, ClearCachedRolesRequestParameters requestParameters = null)
where TResponse : class, IElasticsearchResponse, new() => DoRequest<TResponse>(POST, Url($"_security/role/{name:name}/_clear_cache"), null, RequestParams(requestParameters));
///<summary>POST on /_security/role/{name}/_clear_cache <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-role-cache.html</para></summary>
///<param name = "name">Role name</param>
///<param name = "requestParameters">Request specific configuration such as querystring parameters & request specific connection settings.</param>
public Task<TResponse> ClearCachedRolesAsync<TResponse>(string name, ClearCachedRolesRequestParameters requestParameters = null, CancellationToken ctx = default)
where TResponse : class, IElasticsearchResponse, new() => DoRequestAsync<TResponse>(POST, Url($"_security/role/{name:name}/_clear_cache"), ctx, null, RequestParams(requestParameters));
///<summary>PUT on /_security/api_key <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-create-api-key.html</para></summary>
///<param name = "body">The api key request to create an API key</param>
///<param name = "requestParameters">Request specific configuration such as querystring parameters & request specific connection settings.</param>
public TResponse CreateApiKey<TResponse>(PostData body, CreateApiKeyRequestParameters requestParameters = null)
where TResponse : class, IElasticsearchResponse, new() => DoRequest<TResponse>(PUT, "_security/api_key", body, RequestParams(requestParameters));
///<summary>PUT on /_security/api_key <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-create-api-key.html</para></summary>
///<param name = "body">The api key request to create an API key</param>
///<param name = "requestParameters">Request specific configuration such as querystring parameters & request specific connection settings.</param>
public Task<TResponse> CreateApiKeyAsync<TResponse>(PostData body, CreateApiKeyRequestParameters requestParameters = null, CancellationToken ctx = default)
where TResponse : class, IElasticsearchResponse, new() => DoRequestAsync<TResponse>(PUT, "_security/api_key", ctx, body, RequestParams(requestParameters));
///<summary>DELETE on /_security/privilege/{application}/{name} <para>TODO</para></summary>
///<param name = "application">Application name</param>
///<param name = "name">Privilege name</param>
///<param name = "requestParameters">Request specific configuration such as querystring parameters & request specific connection settings.</param>
public TResponse DeletePrivileges<TResponse>(string application, string name, DeletePrivilegesRequestParameters requestParameters = null)
where TResponse : class, IElasticsearchResponse, new() => DoRequest<TResponse>(DELETE, Url($"_security/privilege/{application:application}/{name:name}"), null, RequestParams(requestParameters));
///<summary>DELETE on /_security/privilege/{application}/{name} <para>TODO</para></summary>
///<param name = "application">Application name</param>
///<param name = "name">Privilege name</param>
///<param name = "requestParameters">Request specific configuration such as querystring parameters & request specific connection settings.</param>
public Task<TResponse> DeletePrivilegesAsync<TResponse>(string application, string name, DeletePrivilegesRequestParameters requestParameters = null, CancellationToken ctx = default)
where TResponse : class, IElasticsearchResponse, new() => DoRequestAsync<TResponse>(DELETE, Url($"_security/privilege/{application:application}/{name:name}"), ctx, null, RequestParams(requestParameters));
///<summary>DELETE on /_security/role/{name} <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-role.html</para></summary>
///<param name = "name">Role name</param>
///<param name = "requestParameters">Request specific configuration such as querystring parameters & request specific connection settings.</param>
public TResponse DeleteRole<TResponse>(string name, DeleteRoleRequestParameters requestParameters = null)
where TResponse : class, IElasticsearchResponse, new() => DoRequest<TResponse>(DELETE, Url($"_security/role/{name:name}"), null, RequestParams(requestParameters));
///<summary>DELETE on /_security/role/{name} <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-role.html</para></summary>
///<param name = "name">Role name</param>
///<param name = "requestParameters">Request specific configuration such as querystring parameters & request specific connection settings.</param>
public Task<TResponse> DeleteRoleAsync<TResponse>(string name, DeleteRoleRequestParameters requestParameters = null, CancellationToken ctx = default)
where TResponse : class, IElasticsearchResponse, new() => DoRequestAsync<TResponse>(DELETE, Url($"_security/role/{name:name}"), ctx, null, RequestParams(requestParameters));
///<summary>DELETE on /_security/role_mapping/{name} <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-role-mapping.html</para></summary>
///<param name = "name">Role-mapping name</param>
///<param name = "requestParameters">Request specific configuration such as querystring parameters & request specific connection settings.</param>
public TResponse DeleteRoleMapping<TResponse>(string name, DeleteRoleMappingRequestParameters requestParameters = null)
where TResponse : class, IElasticsearchResponse, new() => DoRequest<TResponse>(DELETE, Url($"_security/role_mapping/{name:name}"), null, RequestParams(requestParameters));
///<summary>DELETE on /_security/role_mapping/{name} <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-role-mapping.html</para></summary>
///<param name = "name">Role-mapping name</param>
///<param name = "requestParameters">Request specific configuration such as querystring parameters & request specific connection settings.</param>
public Task<TResponse> DeleteRoleMappingAsync<TResponse>(string name, DeleteRoleMappingRequestParameters requestParameters = null, CancellationToken ctx = default)
where TResponse : class, IElasticsearchResponse, new() => DoRequestAsync<TResponse>(DELETE, Url($"_security/role_mapping/{name:name}"), ctx, null, RequestParams(requestParameters));
///<summary>DELETE on /_security/user/{username} <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-user.html</para></summary>
///<param name = "username">username</param>
///<param name = "requestParameters">Request specific configuration such as querystring parameters & request specific connection settings.</param>
public TResponse DeleteUser<TResponse>(string username, DeleteUserRequestParameters requestParameters = null)
where TResponse : class, IElasticsearchResponse, new() => DoRequest<TResponse>(DELETE, Url($"_security/user/{username:username}"), null, RequestParams(requestParameters));
///<summary>DELETE on /_security/user/{username} <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-user.html</para></summary>
///<param name = "username">username</param>
///<param name = "requestParameters">Request specific configuration such as querystring parameters & request specific connection settings.</param>
public Task<TResponse> DeleteUserAsync<TResponse>(string username, DeleteUserRequestParameters requestParameters = null, CancellationToken ctx = default)
where TResponse : class, IElasticsearchResponse, new() => DoRequestAsync<TResponse>(DELETE, Url($"_security/user/{username:username}"), ctx, null, RequestParams(requestParameters));
///<summary>PUT on /_security/user/{username}/_disable <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-disable-user.html</para></summary>
///<param name = "username">The username of the user to disable</param>
///<param name = "requestParameters">Request specific configuration such as querystring parameters & request specific connection settings.</param>
public TResponse DisableUser<TResponse>(string username, DisableUserRequestParameters requestParameters = null)
where TResponse : class, IElasticsearchResponse, new() => DoRequest<TResponse>(PUT, Url($"_security/user/{username:username}/_disable"), null, RequestParams(requestParameters));
///<summary>PUT on /_security/user/{username}/_disable <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-disable-user.html</para></summary>
///<param name = "username">The username of the user to disable</param>
///<param name = "requestParameters">Request specific configuration such as querystring parameters & request specific connection settings.</param>
public Task<TResponse> DisableUserAsync<TResponse>(string username, DisableUserRequestParameters requestParameters = null, CancellationToken ctx = default)
where TResponse : class, IElasticsearchResponse, new() => DoRequestAsync<TResponse>(PUT, Url($"_security/user/{username:username}/_disable"), ctx, null, RequestParams(requestParameters));
///<summary>PUT on /_security/user/{username}/_enable <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-enable-user.html</para></summary>
///<param name = "username">The username of the user to enable</param>
///<param name = "requestParameters">Request specific configuration such as querystring parameters & request specific connection settings.</param>
public TResponse EnableUser<TResponse>(string username, EnableUserRequestParameters requestParameters = null)
where TResponse : class, IElasticsearchResponse, new() => DoRequest<TResponse>(PUT, Url($"_security/user/{username:username}/_enable"), null, RequestParams(requestParameters));
///<summary>PUT on /_security/user/{username}/_enable <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-enable-user.html</para></summary>
///<param name = "username">The username of the user to enable</param>
///<param name = "requestParameters">Request specific configuration such as querystring parameters & request specific connection settings.</param>
public Task<TResponse> EnableUserAsync<TResponse>(string username, EnableUserRequestParameters requestParameters = null, CancellationToken ctx = default)
where TResponse : class, IElasticsearchResponse, new() => DoRequestAsync<TResponse>(PUT, Url($"_security/user/{username:username}/_enable"), ctx, null, RequestParams(requestParameters));
///<summary>GET on /_security/api_key <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-api-key.html</para></summary>
///<param name = "requestParameters">Request specific configuration such as querystring parameters & request specific connection settings.</param>
public TResponse GetApiKey<TResponse>(GetApiKeyRequestParameters requestParameters = null)
where TResponse : class, IElasticsearchResponse, new() => DoRequest<TResponse>(GET, "_security/api_key", null, RequestParams(requestParameters));
///<summary>GET on /_security/api_key <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-api-key.html</para></summary>
///<param name = "requestParameters">Request specific configuration such as querystring parameters & request specific connection settings.</param>
public Task<TResponse> GetApiKeyAsync<TResponse>(GetApiKeyRequestParameters requestParameters = null, CancellationToken ctx = default)
where TResponse : class, IElasticsearchResponse, new() => DoRequestAsync<TResponse>(GET, "_security/api_key", ctx, null, RequestParams(requestParameters));
///<summary>GET on /_security/privilege <para>TODO</para></summary>
///<param name = "requestParameters">Request specific configuration such as querystring parameters & request specific connection settings.</param>
public TResponse GetPrivileges<TResponse>(GetPrivilegesRequestParameters requestParameters = null)
where TResponse : class, IElasticsearchResponse, new() => DoRequest<TResponse>(GET, "_security/privilege", null, RequestParams(requestParameters));
///<summary>GET on /_security/privilege <para>TODO</para></summary>
///<param name = "requestParameters">Request specific configuration such as querystring parameters & request specific connection settings.</param>
public Task<TResponse> GetPrivilegesAsync<TResponse>(GetPrivilegesRequestParameters requestParameters = null, CancellationToken ctx = default)
where TResponse : class, IElasticsearchResponse, new() => DoRequestAsync<TResponse>(GET, "_security/privilege", ctx, null, RequestParams(requestParameters));
///<summary>GET on /_security/privilege/{application} <para>TODO</para></summary>
///<param name = "application">Application name</param>
///<param name = "requestParameters">Request specific configuration such as querystring parameters & request specific connection settings.</param>
public TResponse GetPrivileges<TResponse>(string application, GetPrivilegesRequestParameters requestParameters = null)
where TResponse : class, IElasticsearchResponse, new() => DoRequest<TResponse>(GET, Url($"_security/privilege/{application:application}"), null, RequestParams(requestParameters));
///<summary>GET on /_security/privilege/{application} <para>TODO</para></summary>
///<param name = "application">Application name</param>
///<param name = "requestParameters">Request specific configuration such as querystring parameters & request specific connection settings.</param>
public Task<TResponse> GetPrivilegesAsync<TResponse>(string application, GetPrivilegesRequestParameters requestParameters = null, CancellationToken ctx = default)
where TResponse : class, IElasticsearchResponse, new() => DoRequestAsync<TResponse>(GET, Url($"_security/privilege/{application:application}"), ctx, null, RequestParams(requestParameters));
///<summary>GET on /_security/privilege/{application}/{name} <para>TODO</para></summary>
///<param name = "application">Application name</param>
///<param name = "name">Privilege name</param>
///<param name = "requestParameters">Request specific configuration such as querystring parameters & request specific connection settings.</param>
public TResponse GetPrivileges<TResponse>(string application, string name, GetPrivilegesRequestParameters requestParameters = null)
where TResponse : class, IElasticsearchResponse, new() => DoRequest<TResponse>(GET, Url($"_security/privilege/{application:application}/{name:name}"), null, RequestParams(requestParameters));
///<summary>GET on /_security/privilege/{application}/{name} <para>TODO</para></summary>
///<param name = "application">Application name</param>
///<param name = "name">Privilege name</param>
///<param name = "requestParameters">Request specific configuration such as querystring parameters & request specific connection settings.</param>
public Task<TResponse> GetPrivilegesAsync<TResponse>(string application, string name, GetPrivilegesRequestParameters requestParameters = null, CancellationToken ctx = default)
where TResponse : class, IElasticsearchResponse, new() => DoRequestAsync<TResponse>(GET, Url($"_security/privilege/{application:application}/{name:name}"), ctx, null, RequestParams(requestParameters));
///<summary>GET on /_security/role/{name} <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-role.html</para></summary>
///<param name = "name">Role name</param>
///<param name = "requestParameters">Request specific configuration such as querystring parameters & request specific connection settings.</param>
public TResponse GetRole<TResponse>(string name, GetRoleRequestParameters requestParameters = null)
where TResponse : class, IElasticsearchResponse, new() => DoRequest<TResponse>(GET, Url($"_security/role/{name:name}"), null, RequestParams(requestParameters));
///<summary>GET on /_security/role/{name} <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-role.html</para></summary>
///<param name = "name">Role name</param>
///<param name = "requestParameters">Request specific configuration such as querystring parameters & request specific connection settings.</param>
public Task<TResponse> GetRoleAsync<TResponse>(string name, GetRoleRequestParameters requestParameters = null, CancellationToken ctx = default)
where TResponse : class, IElasticsearchResponse, new() => DoRequestAsync<TResponse>(GET, Url($"_security/role/{name:name}"), ctx, null, RequestParams(requestParameters));
///<summary>GET on /_security/role <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-role.html</para></summary>
///<param name = "requestParameters">Request specific configuration such as querystring parameters & request specific connection settings.</param>
public TResponse GetRole<TResponse>(GetRoleRequestParameters requestParameters = null)
where TResponse : class, IElasticsearchResponse, new() => DoRequest<TResponse>(GET, "_security/role", null, RequestParams(requestParameters));
///<summary>GET on /_security/role <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-role.html</para></summary>
///<param name = "requestParameters">Request specific configuration such as querystring parameters & request specific connection settings.</param>
public Task<TResponse> GetRoleAsync<TResponse>(GetRoleRequestParameters requestParameters = null, CancellationToken ctx = default)
where TResponse : class, IElasticsearchResponse, new() => DoRequestAsync<TResponse>(GET, "_security/role", ctx, null, RequestParams(requestParameters));
///<summary>GET on /_security/role_mapping/{name} <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-role-mapping.html</para></summary>
///<param name = "name">Role-Mapping name</param>
///<param name = "requestParameters">Request specific configuration such as querystring parameters & request specific connection settings.</param>
public TResponse GetRoleMapping<TResponse>(string name, GetRoleMappingRequestParameters requestParameters = null)
where TResponse : class, IElasticsearchResponse, new() => DoRequest<TResponse>(GET, Url($"_security/role_mapping/{name:name}"), null, RequestParams(requestParameters));
///<summary>GET on /_security/role_mapping/{name} <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-role-mapping.html</para></summary>
///<param name = "name">Role-Mapping name</param>
///<param name = "requestParameters">Request specific configuration such as querystring parameters & request specific connection settings.</param>
public Task<TResponse> GetRoleMappingAsync<TResponse>(string name, GetRoleMappingRequestParameters requestParameters = null, CancellationToken ctx = default)
where TResponse : class, IElasticsearchResponse, new() => DoRequestAsync<TResponse>(GET, Url($"_security/role_mapping/{name:name}"), ctx, null, RequestParams(requestParameters));
///<summary>GET on /_security/role_mapping <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-role-mapping.html</para></summary>
///<param name = "requestParameters">Request specific configuration such as querystring parameters & request specific connection settings.</param>
public TResponse GetRoleMapping<TResponse>(GetRoleMappingRequestParameters requestParameters = null)
where TResponse : class, IElasticsearchResponse, new() => DoRequest<TResponse>(GET, "_security/role_mapping", null, RequestParams(requestParameters));
///<summary>GET on /_security/role_mapping <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-role-mapping.html</para></summary>
///<param name = "requestParameters">Request specific configuration such as querystring parameters & request specific connection settings.</param>
public Task<TResponse> GetRoleMappingAsync<TResponse>(GetRoleMappingRequestParameters requestParameters = null, CancellationToken ctx = default)
where TResponse : class, IElasticsearchResponse, new() => DoRequestAsync<TResponse>(GET, "_security/role_mapping", ctx, null, RequestParams(requestParameters));
///<summary>POST on /_security/oauth2/token <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-token.html</para></summary>
///<param name = "body">The token request to get</param>
///<param name = "requestParameters">Request specific configuration such as querystring parameters & request specific connection settings.</param>
public TResponse GetUserAccessToken<TResponse>(PostData body, GetUserAccessTokenRequestParameters requestParameters = null)
where TResponse : class, IElasticsearchResponse, new() => DoRequest<TResponse>(POST, "_security/oauth2/token", body, RequestParams(requestParameters));
///<summary>POST on /_security/oauth2/token <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-token.html</para></summary>
///<param name = "body">The token request to get</param>
///<param name = "requestParameters">Request specific configuration such as querystring parameters & request specific connection settings.</param>
public Task<TResponse> GetUserAccessTokenAsync<TResponse>(PostData body, GetUserAccessTokenRequestParameters requestParameters = null, CancellationToken ctx = default)
where TResponse : class, IElasticsearchResponse, new() => DoRequestAsync<TResponse>(POST, "_security/oauth2/token", ctx, body, RequestParams(requestParameters));
///<summary>GET on /_security/user/{username} <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-user.html</para></summary>
///<param name = "username">A comma-separated list of usernames</param>
///<param name = "requestParameters">Request specific configuration such as querystring parameters & request specific connection settings.</param>
public TResponse GetUser<TResponse>(string username, GetUserRequestParameters requestParameters = null)
where TResponse : class, IElasticsearchResponse, new() => DoRequest<TResponse>(GET, Url($"_security/user/{username:username}"), null, RequestParams(requestParameters));
///<summary>GET on /_security/user/{username} <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-user.html</para></summary>
///<param name = "username">A comma-separated list of usernames</param>
///<param name = "requestParameters">Request specific configuration such as querystring parameters & request specific connection settings.</param>
public Task<TResponse> GetUserAsync<TResponse>(string username, GetUserRequestParameters requestParameters = null, CancellationToken ctx = default)
where TResponse : class, IElasticsearchResponse, new() => DoRequestAsync<TResponse>(GET, Url($"_security/user/{username:username}"), ctx, null, RequestParams(requestParameters));
///<summary>GET on /_security/user <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-user.html</para></summary>
///<param name = "requestParameters">Request specific configuration such as querystring parameters & request specific connection settings.</param>
public TResponse GetUser<TResponse>(GetUserRequestParameters requestParameters = null)
where TResponse : class, IElasticsearchResponse, new() => DoRequest<TResponse>(GET, "_security/user", null, RequestParams(requestParameters));
///<summary>GET on /_security/user <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-user.html</para></summary>
///<param name = "requestParameters">Request specific configuration such as querystring parameters & request specific connection settings.</param>
public Task<TResponse> GetUserAsync<TResponse>(GetUserRequestParameters requestParameters = null, CancellationToken ctx = default)
where TResponse : class, IElasticsearchResponse, new() => DoRequestAsync<TResponse>(GET, "_security/user", ctx, null, RequestParams(requestParameters));
///<summary>GET on /_security/user/_privileges <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-privileges.html</para></summary>
///<param name = "requestParameters">Request specific configuration such as querystring parameters & request specific connection settings.</param>
public TResponse GetUserPrivileges<TResponse>(GetUserPrivilegesRequestParameters requestParameters = null)
where TResponse : class, IElasticsearchResponse, new() => DoRequest<TResponse>(GET, "_security/user/_privileges", null, RequestParams(requestParameters));
///<summary>GET on /_security/user/_privileges <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-privileges.html</para></summary>
///<param name = "requestParameters">Request specific configuration such as querystring parameters & request specific connection settings.</param>
public Task<TResponse> GetUserPrivilegesAsync<TResponse>(GetUserPrivilegesRequestParameters requestParameters = null, CancellationToken ctx = default)
where TResponse : class, IElasticsearchResponse, new() => DoRequestAsync<TResponse>(GET, "_security/user/_privileges", ctx, null, RequestParams(requestParameters));
///<summary>POST on /_security/user/_has_privileges <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-has-privileges.html</para></summary>
///<param name = "body">The privileges to test</param>
///<param name = "requestParameters">Request specific configuration such as querystring parameters & request specific connection settings.</param>
public TResponse HasPrivileges<TResponse>(PostData body, HasPrivilegesRequestParameters requestParameters = null)
where TResponse : class, IElasticsearchResponse, new() => DoRequest<TResponse>(POST, "_security/user/_has_privileges", body, RequestParams(requestParameters));
///<summary>POST on /_security/user/_has_privileges <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-has-privileges.html</para></summary>
///<param name = "body">The privileges to test</param>
///<param name = "requestParameters">Request specific configuration such as querystring parameters & request specific connection settings.</param>
public Task<TResponse> HasPrivilegesAsync<TResponse>(PostData body, HasPrivilegesRequestParameters requestParameters = null, CancellationToken ctx = default)
where TResponse : class, IElasticsearchResponse, new() => DoRequestAsync<TResponse>(POST, "_security/user/_has_privileges", ctx, body, RequestParams(requestParameters));
///<summary>POST on /_security/user/{user}/_has_privileges <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-has-privileges.html</para></summary>
///<param name = "user">Username</param>
///<param name = "body">The privileges to test</param>
///<param name = "requestParameters">Request specific configuration such as querystring parameters & request specific connection settings.</param>
public TResponse HasPrivileges<TResponse>(string user, PostData body, HasPrivilegesRequestParameters requestParameters = null)
where TResponse : class, IElasticsearchResponse, new() => DoRequest<TResponse>(POST, Url($"_security/user/{user:user}/_has_privileges"), body, RequestParams(requestParameters));
///<summary>POST on /_security/user/{user}/_has_privileges <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-has-privileges.html</para></summary>
///<param name = "user">Username</param>
///<param name = "body">The privileges to test</param>
///<param name = "requestParameters">Request specific configuration such as querystring parameters & request specific connection settings.</param>
public Task<TResponse> HasPrivilegesAsync<TResponse>(string user, PostData body, HasPrivilegesRequestParameters requestParameters = null, CancellationToken ctx = default)
where TResponse : class, IElasticsearchResponse, new() => DoRequestAsync<TResponse>(POST, Url($"_security/user/{user:user}/_has_privileges"), ctx, body, RequestParams(requestParameters));
///<summary>DELETE on /_security/api_key <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-invalidate-api-key.html</para></summary>
///<param name = "body">The api key request to invalidate API key(s)</param>
///<param name = "requestParameters">Request specific configuration such as querystring parameters & request specific connection settings.</param>
public TResponse InvalidateApiKey<TResponse>(PostData body, InvalidateApiKeyRequestParameters requestParameters = null)
where TResponse : class, IElasticsearchResponse, new() => DoRequest<TResponse>(DELETE, "_security/api_key", body, RequestParams(requestParameters));
///<summary>DELETE on /_security/api_key <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-invalidate-api-key.html</para></summary>
///<param name = "body">The api key request to invalidate API key(s)</param>
///<param name = "requestParameters">Request specific configuration such as querystring parameters & request specific connection settings.</param>
public Task<TResponse> InvalidateApiKeyAsync<TResponse>(PostData body, InvalidateApiKeyRequestParameters requestParameters = null, CancellationToken ctx = default)
where TResponse : class, IElasticsearchResponse, new() => DoRequestAsync<TResponse>(DELETE, "_security/api_key", ctx, body, RequestParams(requestParameters));
///<summary>DELETE on /_security/oauth2/token <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-invalidate-token.html</para></summary>
///<param name = "body">The token to invalidate</param>
///<param name = "requestParameters">Request specific configuration such as querystring parameters & request specific connection settings.</param>
public TResponse InvalidateUserAccessToken<TResponse>(PostData body, InvalidateUserAccessTokenRequestParameters requestParameters = null)
where TResponse : class, IElasticsearchResponse, new() => DoRequest<TResponse>(DELETE, "_security/oauth2/token", body, RequestParams(requestParameters));
///<summary>DELETE on /_security/oauth2/token <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-invalidate-token.html</para></summary>
///<param name = "body">The token to invalidate</param>
///<param name = "requestParameters">Request specific configuration such as querystring parameters & request specific connection settings.</param>
public Task<TResponse> InvalidateUserAccessTokenAsync<TResponse>(PostData body, InvalidateUserAccessTokenRequestParameters requestParameters = null, CancellationToken ctx = default)
where TResponse : class, IElasticsearchResponse, new() => DoRequestAsync<TResponse>(DELETE, "_security/oauth2/token", ctx, body, RequestParams(requestParameters));
///<summary>PUT on /_security/privilege/ <para>TODO</para></summary>
///<param name = "body">The privilege(s) to add</param>
///<param name = "requestParameters">Request specific configuration such as querystring parameters & request specific connection settings.</param>
public TResponse PutPrivileges<TResponse>(PostData body, PutPrivilegesRequestParameters requestParameters = null)
where TResponse : class, IElasticsearchResponse, new() => DoRequest<TResponse>(PUT, "_security/privilege/", body, RequestParams(requestParameters));
///<summary>PUT on /_security/privilege/ <para>TODO</para></summary>
///<param name = "body">The privilege(s) to add</param>
///<param name = "requestParameters">Request specific configuration such as querystring parameters & request specific connection settings.</param>
public Task<TResponse> PutPrivilegesAsync<TResponse>(PostData body, PutPrivilegesRequestParameters requestParameters = null, CancellationToken ctx = default)
where TResponse : class, IElasticsearchResponse, new() => DoRequestAsync<TResponse>(PUT, "_security/privilege/", ctx, body, RequestParams(requestParameters));
///<summary>PUT on /_security/role/{name} <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-role.html</para></summary>
///<param name = "name">Role name</param>
///<param name = "body">The role to add</param>
///<param name = "requestParameters">Request specific configuration such as querystring parameters & request specific connection settings.</param>
public TResponse PutRole<TResponse>(string name, PostData body, PutRoleRequestParameters requestParameters = null)
where TResponse : class, IElasticsearchResponse, new() => DoRequest<TResponse>(PUT, Url($"_security/role/{name:name}"), body, RequestParams(requestParameters));
///<summary>PUT on /_security/role/{name} <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-role.html</para></summary>
///<param name = "name">Role name</param>
///<param name = "body">The role to add</param>
///<param name = "requestParameters">Request specific configuration such as querystring parameters & request specific connection settings.</param>
public Task<TResponse> PutRoleAsync<TResponse>(string name, PostData body, PutRoleRequestParameters requestParameters = null, CancellationToken ctx = default)
where TResponse : class, IElasticsearchResponse, new() => DoRequestAsync<TResponse>(PUT, Url($"_security/role/{name:name}"), ctx, body, RequestParams(requestParameters));
///<summary>PUT on /_security/role_mapping/{name} <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-role-mapping.html</para></summary>
///<param name = "name">Role-mapping name</param>
///<param name = "body">The role to add</param>
///<param name = "requestParameters">Request specific configuration such as querystring parameters & request specific connection settings.</param>
public TResponse PutRoleMapping<TResponse>(string name, PostData body, PutRoleMappingRequestParameters requestParameters = null)
where TResponse : class, IElasticsearchResponse, new() => DoRequest<TResponse>(PUT, Url($"_security/role_mapping/{name:name}"), body, RequestParams(requestParameters));
///<summary>PUT on /_security/role_mapping/{name} <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-role-mapping.html</para></summary>
///<param name = "name">Role-mapping name</param>
///<param name = "body">The role to add</param>
///<param name = "requestParameters">Request specific configuration such as querystring parameters & request specific connection settings.</param>
public Task<TResponse> PutRoleMappingAsync<TResponse>(string name, PostData body, PutRoleMappingRequestParameters requestParameters = null, CancellationToken ctx = default)
where TResponse : class, IElasticsearchResponse, new() => DoRequestAsync<TResponse>(PUT, Url($"_security/role_mapping/{name:name}"), ctx, body, RequestParams(requestParameters));
///<summary>PUT on /_security/user/{username} <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-user.html</para></summary>
///<param name = "username">The username of the User</param>
///<param name = "body">The user to add</param>
///<param name = "requestParameters">Request specific configuration such as querystring parameters & request specific connection settings.</param>
public TResponse PutUser<TResponse>(string username, PostData body, PutUserRequestParameters requestParameters = null)
where TResponse : class, IElasticsearchResponse, new() => DoRequest<TResponse>(PUT, Url($"_security/user/{username:username}"), body, RequestParams(requestParameters));
///<summary>PUT on /_security/user/{username} <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-user.html</para></summary>
///<param name = "username">The username of the User</param>
///<param name = "body">The user to add</param>
///<param name = "requestParameters">Request specific configuration such as querystring parameters & request specific connection settings.</param>
public Task<TResponse> PutUserAsync<TResponse>(string username, PostData body, PutUserRequestParameters requestParameters = null, CancellationToken ctx = default)
where TResponse : class, IElasticsearchResponse, new() => DoRequestAsync<TResponse>(PUT, Url($"_security/user/{username:username}"), ctx, body, RequestParams(requestParameters));
///<summary>GET on /_ssl/certificates <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-ssl.html</para></summary>
///<param name = "requestParameters">Request specific configuration such as querystring parameters & request specific connection settings.</param>
public TResponse GetCertificates<TResponse>(GetCertificatesRequestParameters requestParameters = null)
where TResponse : class, IElasticsearchResponse, new() => DoRequest<TResponse>(GET, "_ssl/certificates", null, RequestParams(requestParameters));
///<summary>GET on /_ssl/certificates <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-ssl.html</para></summary>
///<param name = "requestParameters">Request specific configuration such as querystring parameters & request specific connection settings.</param>
public Task<TResponse> GetCertificatesAsync<TResponse>(GetCertificatesRequestParameters requestParameters = null, CancellationToken ctx = default)
where TResponse : class, IElasticsearchResponse, new() => DoRequestAsync<TResponse>(GET, "_ssl/certificates", ctx, null, RequestParams(requestParameters));
}
}