Class InvalidateApiKeyRequest

java.lang.Object
co.elastic.clients.elasticsearch._types.RequestBase
co.elastic.clients.elasticsearch.security.InvalidateApiKeyRequest
All Implemented Interfaces:
JsonpSerializable

@JsonpDeserializable public class InvalidateApiKeyRequest extends RequestBase implements JsonpSerializable
Invalidates one or more API keys. The manage_api_key privilege allows deleting any API keys. The manage_own_api_key only allows deleting API keys that are owned by the user. In addition, with the manage_own_api_key privilege, an invalidation request must be issued in one of the three formats:
  • Set the parameter owner=true.
  • Or, set both username and realm_name to match the user’s identity.
  • Or, if the request is issued by an API key, i.e. an API key invalidates itself, specify its ID in the ids field.
See Also:
  • Field Details

  • Method Details

    • of

    • id

      @Nullable public final String id()
      API name: id
    • ids

      public final List<String> ids()
      A list of API key ids. This parameter cannot be used with any of name, realm_name, or username.

      API name: ids

    • name

      @Nullable public final String name()
      An API key name. This parameter cannot be used with any of ids, realm_name or username.

      API name: name

    • owner

      @Nullable public final Boolean owner()
      Can be used to query API keys owned by the currently authenticated user. The realm_name or username parameters cannot be specified when this parameter is set to true as they are assumed to be the currently authenticated ones.

      API name: owner

    • realmName

      @Nullable public final String realmName()
      The name of an authentication realm. This parameter cannot be used with either ids or name, or when owner flag is set to true.

      API name: realm_name

    • username

      @Nullable public final String username()
      The username of a user. This parameter cannot be used with either ids or name, or when owner flag is set to true.

      API name: username

    • serialize

      public void serialize(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper)
      Serialize this object to JSON.
      Specified by:
      serialize in interface JsonpSerializable
    • serializeInternal

      protected void serializeInternal(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper)
    • setupInvalidateApiKeyRequestDeserializer

      protected static void setupInvalidateApiKeyRequestDeserializer(ObjectDeserializer<InvalidateApiKeyRequest.Builder> op)