Class CreateApiKeyRequest.Builder
java.lang.Object
co.elastic.clients.util.ObjectBuilderBase
co.elastic.clients.util.WithJsonObjectBuilderBase<BuilderT>
co.elastic.clients.elasticsearch._types.RequestBase.AbstractBuilder<CreateApiKeyRequest.Builder>
co.elastic.clients.elasticsearch.security.CreateApiKeyRequest.Builder
- All Implemented Interfaces:
WithJson<CreateApiKeyRequest.Builder>
,ObjectBuilder<CreateApiKeyRequest>
- Enclosing class:
- CreateApiKeyRequest
public static class CreateApiKeyRequest.Builder
extends RequestBase.AbstractBuilder<CreateApiKeyRequest.Builder>
implements ObjectBuilder<CreateApiKeyRequest>
Builder for
CreateApiKeyRequest
.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds aCreateApiKeyRequest
.expiration
(Time value) Expiration time for the API key.Expiration time for the API key.Arbitrary metadata that you want to associate with the API key.Arbitrary metadata that you want to associate with the API key.Specifies the name for this API key.Iftrue
(the default) then refresh the affected shards to make this operation visible to search, ifwait_for
then wait for a refresh to make this operation visible to search, iffalse
then do nothing with refreshes.roleDescriptors
(String key, RoleDescriptor value) An array of role descriptors for this API key.An array of role descriptors for this API key.An array of role descriptors for this API key.protected CreateApiKeyRequest.Builder
self()
Methods inherited from class co.elastic.clients.util.WithJsonObjectBuilderBase
withJson
Methods inherited from class co.elastic.clients.util.ObjectBuilderBase
_checkSingleUse, _listAdd, _listAddAll, _mapPut, _mapPutAll
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
expiration
Expiration time for the API key. By default, API keys never expire.API name:
expiration
-
expiration
Expiration time for the API key. By default, API keys never expire.API name:
expiration
-
metadata
Arbitrary metadata that you want to associate with the API key. It supports nested data structure. Within the metadata object, keys beginning with_
are reserved for system usage.API name:
metadata
Adds all entries of
map
tometadata
. -
metadata
Arbitrary metadata that you want to associate with the API key. It supports nested data structure. Within the metadata object, keys beginning with_
are reserved for system usage.API name:
metadata
Adds an entry to
metadata
. -
name
Specifies the name for this API key.API name:
name
-
refresh
Iftrue
(the default) then refresh the affected shards to make this operation visible to search, ifwait_for
then wait for a refresh to make this operation visible to search, iffalse
then do nothing with refreshes.API name:
refresh
-
roleDescriptors
An array of role descriptors for this API key. This parameter is optional. When it is not specified or is an empty array, then the API key will have a point in time snapshot of permissions of the authenticated user. If you supply role descriptors then the resultant permissions would be an intersection of API keys permissions and authenticated user’s permissions thereby limiting the access scope for API keys. The structure of role descriptor is the same as the request for create role API. For more details, see create or update roles API.API name:
role_descriptors
Adds all entries of
map
toroleDescriptors
. -
roleDescriptors
An array of role descriptors for this API key. This parameter is optional. When it is not specified or is an empty array, then the API key will have a point in time snapshot of permissions of the authenticated user. If you supply role descriptors then the resultant permissions would be an intersection of API keys permissions and authenticated user’s permissions thereby limiting the access scope for API keys. The structure of role descriptor is the same as the request for create role API. For more details, see create or update roles API.API name:
role_descriptors
Adds an entry to
roleDescriptors
. -
roleDescriptors
public final CreateApiKeyRequest.Builder roleDescriptors(String key, Function<RoleDescriptor.Builder, ObjectBuilder<RoleDescriptor>> fn) An array of role descriptors for this API key. This parameter is optional. When it is not specified or is an empty array, then the API key will have a point in time snapshot of permissions of the authenticated user. If you supply role descriptors then the resultant permissions would be an intersection of API keys permissions and authenticated user’s permissions thereby limiting the access scope for API keys. The structure of role descriptor is the same as the request for create role API. For more details, see create or update roles API.API name:
role_descriptors
Adds an entry to
roleDescriptors
using a builder lambda. -
self
- Specified by:
self
in classRequestBase.AbstractBuilder<CreateApiKeyRequest.Builder>
-
build
Builds aCreateApiKeyRequest
.- Specified by:
build
in interfaceObjectBuilder<CreateApiKeyRequest>
- Throws:
NullPointerException
- if some of the required fields are null.
-