Skip to content

Commit 329be8d

Browse files
committed
Patch REST API spec to include owner flag.
1 parent e434ce9 commit 329be8d

File tree

4 files changed

+30
-1
lines changed

4 files changed

+30
-1
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"security.get_api_key": {
3+
"url": {
4+
"params": {
5+
"owner": {
6+
"type": "boolean",
7+
"default": false,
8+
"description": "flag to query API keys owned by the currently authenticated user"
9+
}
10+
}
11+
}
12+
}
13+
}

src/Elasticsearch.Net/Api/RequestParameters/RequestParameters.Security.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,13 @@ public string Name
186186
set => Q("name", value);
187187
}
188188

189+
///<summary>flag to query API keys owned by the currently authenticated user</summary>
190+
public bool? Owner
191+
{
192+
get => Q<bool? >("owner");
193+
set => Q("owner", value);
194+
}
195+
189196
///<summary>realm name of the user who created this API key to be retrieved</summary>
190197
public string RealmName
191198
{

src/Nest/Descriptors.Security.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,9 @@ public partial class GetApiKeyDescriptor : RequestDescriptorBase<GetApiKeyDescri
266266
public GetApiKeyDescriptor Id(string id) => Qs("id", id);
267267
///<summary>API key name of the API key to be retrieved</summary>
268268
public GetApiKeyDescriptor Name(string name) => Qs("name", name);
269-
///<summary>realm name of the user who created this API key to be retrieved</summary>
269+
///<summary>flag to query API keys owned by the currently authenticated user</summary>
270+
public GetApiKeyDescriptor Owner(bool? owner = true) => Qs("owner", owner);
271+
///<summary>realm name of the user who created this API key to be retrieved</summary>
270272
public GetApiKeyDescriptor RealmName(string realmname) => Qs("realm_name", realmname);
271273
///<summary>user name of the user who created this API key to be retrieved</summary>
272274
public GetApiKeyDescriptor Username(string username) => Qs("username", username);

src/Nest/Requests.Security.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -468,6 +468,13 @@ public string Name
468468
set => Q("name", value);
469469
}
470470

471+
///<summary>flag to query API keys owned by the currently authenticated user</summary>
472+
public bool? Owner
473+
{
474+
get => Q<bool? >("owner");
475+
set => Q("owner", value);
476+
}
477+
471478
///<summary>realm name of the user who created this API key to be retrieved</summary>
472479
public string RealmName
473480
{

0 commit comments

Comments
 (0)