Class GetApiKeyRequest
- java.lang.Object
-
- org.elasticsearch.client.security.GetApiKeyRequest
-
- All Implemented Interfaces:
Validatable
,ToXContent
,ToXContentObject
public final class GetApiKeyRequest extends java.lang.Object implements Validatable, ToXContentObject
Request for get API key
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.elasticsearch.common.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
-
-
Field Summary
-
Fields inherited from interface org.elasticsearch.common.xcontent.ToXContent
EMPTY_PARAMS
-
Fields inherited from interface org.elasticsearch.client.Validatable
EMPTY
-
-
Method Summary
Modifier and Type Method Description static GetApiKeyRequest
forAllApiKeys()
Creates get api key request to retrieve api key information for all api keys if the authenticated user is authorized to do so.static GetApiKeyRequest
forOwnedApiKeys()
Creates get api key request to retrieve api key information for the api keys owned by the current authenticated user.java.lang.String
getId()
java.lang.String
getName()
java.lang.String
getRealmName()
java.lang.String
getUserName()
boolean
ownedByAuthenticatedUser()
XContentBuilder
toXContent(XContentBuilder builder, ToXContent.Params params)
static GetApiKeyRequest
usingApiKeyId(java.lang.String apiKeyId, boolean ownedByAuthenticatedUser)
Creates get API key request for given api key idstatic GetApiKeyRequest
usingApiKeyName(java.lang.String apiKeyName, boolean ownedByAuthenticatedUser)
Creates get API key request for given api key namestatic GetApiKeyRequest
usingRealmAndUserName(java.lang.String realmName, java.lang.String userName)
Creates get API key request for given realm and user namestatic GetApiKeyRequest
usingRealmName(java.lang.String realmName)
Creates get API key request for given realm namestatic GetApiKeyRequest
usingUserName(java.lang.String userName)
Creates get API key request for given user name-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.elasticsearch.common.xcontent.ToXContentObject
isFragment
-
Methods inherited from interface org.elasticsearch.client.Validatable
validate
-
-
-
-
Method Detail
-
getRealmName
public java.lang.String getRealmName()
-
getUserName
public java.lang.String getUserName()
-
getId
public java.lang.String getId()
-
getName
public java.lang.String getName()
-
ownedByAuthenticatedUser
public boolean ownedByAuthenticatedUser()
-
usingRealmName
public static GetApiKeyRequest usingRealmName(java.lang.String realmName)
Creates get API key request for given realm name- Parameters:
realmName
- realm name- Returns:
GetApiKeyRequest
-
usingUserName
public static GetApiKeyRequest usingUserName(java.lang.String userName)
Creates get API key request for given user name- Parameters:
userName
- user name- Returns:
GetApiKeyRequest
-
usingRealmAndUserName
public static GetApiKeyRequest usingRealmAndUserName(java.lang.String realmName, java.lang.String userName)
Creates get API key request for given realm and user name- Parameters:
realmName
- realm nameuserName
- user name- Returns:
GetApiKeyRequest
-
usingApiKeyId
public static GetApiKeyRequest usingApiKeyId(java.lang.String apiKeyId, boolean ownedByAuthenticatedUser)
Creates get API key request for given api key id- Parameters:
apiKeyId
- api key idownedByAuthenticatedUser
- settrue
if the request is only for the API keys owned by current authenticated user elsefalse
- Returns:
GetApiKeyRequest
-
usingApiKeyName
public static GetApiKeyRequest usingApiKeyName(java.lang.String apiKeyName, boolean ownedByAuthenticatedUser)
Creates get API key request for given api key name- Parameters:
apiKeyName
- api key nameownedByAuthenticatedUser
- settrue
if the request is only for the API keys owned by current authenticated user elsefalse
- Returns:
GetApiKeyRequest
-
forOwnedApiKeys
public static GetApiKeyRequest forOwnedApiKeys()
Creates get api key request to retrieve api key information for the api keys owned by the current authenticated user.
-
forAllApiKeys
public static GetApiKeyRequest forAllApiKeys()
Creates get api key request to retrieve api key information for all api keys if the authenticated user is authorized to do so.
-
toXContent
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException
- Specified by:
toXContent
in interfaceToXContent
- Throws:
java.io.IOException
-
-