Class ApiKey.Builder
java.lang.Object
co.elastic.clients.util.ObjectBuilderBase
co.elastic.clients.util.WithJsonObjectBuilderBase<ApiKey.Builder>
co.elastic.clients.elasticsearch.security.ApiKey.Builder
- All Implemented Interfaces:
WithJson<ApiKey.Builder>
,ObjectBuilder<ApiKey>
- Enclosing class:
- ApiKey
public static class ApiKey.Builder
extends WithJsonObjectBuilderBase<ApiKey.Builder>
implements ObjectBuilder<ApiKey>
Builder for
ApiKey
.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds aApiKey
.final ApiKey.Builder
Creation time for the API key in milliseconds.final ApiKey.Builder
expiration
(Long value) Expiration time for the API key in milliseconds.final ApiKey.Builder
Required - Id for the API keyfinal ApiKey.Builder
invalidated
(Boolean value) Invalidation status for the API key.final ApiKey.Builder
limitedBy
(List<Map<String, RoleDescriptor>> list) The owner user’s permissions associated with the API key.final ApiKey.Builder
limitedBy
(Map<String, RoleDescriptor> value, Map<String, RoleDescriptor>... values) The owner user’s permissions associated with the API key.final ApiKey.Builder
Metadata of the API keyfinal ApiKey.Builder
Metadata of the API keyfinal ApiKey.Builder
Required - Name of the API key.final ApiKey.Builder
Realm name of the principal for which this API key was created.final ApiKey.Builder
roleDescriptors
(String key, RoleDescriptor value) The role descriptors assigned to this API key when it was created or last updated.final ApiKey.Builder
The role descriptors assigned to this API key when it was created or last updated.final ApiKey.Builder
The role descriptors assigned to this API key when it was created or last updated.protected ApiKey.Builder
self()
final ApiKey.Builder
sort
(FieldValue value, FieldValue... values) API name:_sort
final ApiKey.Builder
API name:_sort
final ApiKey.Builder
sort
(List<FieldValue> list) API name:_sort
final ApiKey.Builder
Principal for which this API key was createdMethods 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
-
creation
Creation time for the API key in milliseconds.API name:
creation
-
expiration
Expiration time for the API key in milliseconds.API name:
expiration
-
id
Required - Id for the API keyAPI name:
id
-
invalidated
Invalidation status for the API key. If the key has been invalidated, it has a value oftrue
. Otherwise, it isfalse
.API name:
invalidated
-
name
Required - Name of the API key.API name:
name
-
realm
Realm name of the principal for which this API key was created.API name:
realm
-
username
Principal for which this API key was createdAPI name:
username
-
metadata
Metadata of the API keyAPI name:
metadata
Adds all entries of
map
tometadata
. -
metadata
Metadata of the API keyAPI name:
metadata
Adds an entry to
metadata
. -
roleDescriptors
The role descriptors assigned to this API key when it was created or last updated. An empty role descriptor means the API key inherits the owner user’s permissions.API name:
role_descriptors
Adds all entries of
map
toroleDescriptors
. -
roleDescriptors
The role descriptors assigned to this API key when it was created or last updated. An empty role descriptor means the API key inherits the owner user’s permissions.API name:
role_descriptors
Adds an entry to
roleDescriptors
. -
roleDescriptors
public final ApiKey.Builder roleDescriptors(String key, Function<RoleDescriptor.Builder, ObjectBuilder<RoleDescriptor>> fn) The role descriptors assigned to this API key when it was created or last updated. An empty role descriptor means the API key inherits the owner user’s permissions.API name:
role_descriptors
Adds an entry to
roleDescriptors
using a builder lambda. -
limitedBy
The owner user’s permissions associated with the API key. It is a point-in-time snapshot captured at creation and subsequent updates. An API key’s effective permissions are an intersection of its assigned privileges and the owner user’s permissions.API name:
limited_by
Adds all elements of
list
tolimitedBy
. -
limitedBy
public final ApiKey.Builder limitedBy(Map<String, RoleDescriptor> value, Map<String, RoleDescriptor>... values) The owner user’s permissions associated with the API key. It is a point-in-time snapshot captured at creation and subsequent updates. An API key’s effective permissions are an intersection of its assigned privileges and the owner user’s permissions.API name:
limited_by
Adds one or more values to
limitedBy
. -
sort
API name:_sort
Adds all elements of
list
tosort
. -
sort
API name:_sort
Adds one or more values to
sort
. -
sort
API name:_sort
Adds a value to
sort
using a builder lambda. -
self
- Specified by:
self
in classWithJsonObjectBuilderBase<ApiKey.Builder>
-
build
Builds aApiKey
.- Specified by:
build
in interfaceObjectBuilder<ApiKey>
- Throws:
NullPointerException
- if some of the required fields are null.
-