Class CreateApiKeyRequest.Builder
java.lang.Object
co.elastic.clients.elasticsearch.security.CreateApiKeyRequest.Builder
- All Implemented Interfaces:
ObjectBuilder<CreateApiKeyRequest>
- Enclosing class:
- CreateApiKeyRequest
public static class CreateApiKeyRequest.Builder extends java.lang.Object implements ObjectBuilder<CreateApiKeyRequest>
Builder for
CreateApiKeyRequest
.-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
Modifier and Type Method Description CreateApiKeyRequest
build()
Builds aCreateApiKeyRequest
.CreateApiKeyRequest.Builder
expiration(java.lang.String value)
Expiration time for the API key.CreateApiKeyRequest.Builder
metadata(java.util.Map<java.lang.String,JsonData> value)
Arbitrary metadata that you want to associate with the API key.CreateApiKeyRequest.Builder
name(java.lang.String value)
Specifies the name for this API key.CreateApiKeyRequest.Builder
putMetadata(java.lang.String key, JsonData value)
Add a key/value tometadata(Map)
, creating the map if needed.CreateApiKeyRequest.Builder
putRoleDescriptors(java.lang.String key, RoleDescriptor value)
Add a key/value toroleDescriptors(Map)
, creating the map if needed.CreateApiKeyRequest.Builder
putRoleDescriptors(java.lang.String key, java.util.function.Function<RoleDescriptor.Builder,ObjectBuilder<RoleDescriptor>> fn)
Add a key/value toroleDescriptors(Map)
, creating the map if needed.CreateApiKeyRequest.Builder
refresh(jakarta.json.JsonValue value)
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.CreateApiKeyRequest.Builder
roleDescriptors(java.lang.String key, java.util.function.Function<RoleDescriptor.Builder,ObjectBuilder<RoleDescriptor>> fn)
SetroleDescriptors(Map)
to a singleton map.CreateApiKeyRequest.Builder
roleDescriptors(java.util.Map<java.lang.String,RoleDescriptor> value)
An array of role descriptors for this API key.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
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
-
expiration
Expiration time for the API key. By default, API keys never expire.API name:
expiration
-
name
Specifies the name for this API key.API name:
name
-
roleDescriptors
public CreateApiKeyRequest.Builder roleDescriptors(@Nullable java.util.Map<java.lang.String,RoleDescriptor> value)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
-
putRoleDescriptors
Add a key/value toroleDescriptors(Map)
, creating the map if needed. -
roleDescriptors
public CreateApiKeyRequest.Builder roleDescriptors(java.lang.String key, java.util.function.Function<RoleDescriptor.Builder,ObjectBuilder<RoleDescriptor>> fn)SetroleDescriptors(Map)
to a singleton map. -
putRoleDescriptors
public CreateApiKeyRequest.Builder putRoleDescriptors(java.lang.String key, java.util.function.Function<RoleDescriptor.Builder,ObjectBuilder<RoleDescriptor>> fn)Add a key/value toroleDescriptors(Map)
, creating the map if needed. -
metadata
public CreateApiKeyRequest.Builder metadata(@Nullable java.util.Map<java.lang.String,JsonData> value)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
-
putMetadata
Add a key/value tometadata(Map)
, creating the map if needed. -
build
Builds aCreateApiKeyRequest
.- Specified by:
build
in interfaceObjectBuilder<CreateApiKeyRequest>
- Throws:
java.lang.NullPointerException
- if some of the required fields are null.
-