Class CreateApiKeyRequest

java.lang.Object
org.elasticsearch.client.security.CreateApiKeyRequest
All Implemented Interfaces:
Validatable, org.elasticsearch.xcontent.ToXContent, org.elasticsearch.xcontent.ToXContentObject

public final class CreateApiKeyRequest extends Object implements Validatable, org.elasticsearch.xcontent.ToXContentObject
Request to create API key
  • Constructor Details

    • CreateApiKeyRequest

      public CreateApiKeyRequest(String name, List<Role> roles, @Nullable org.elasticsearch.core.TimeValue expiration, @Nullable RefreshPolicy refreshPolicy, @Nullable Map<String,Object> metadata)
      Create API Key request constructor
      Parameters:
      name - name for the API key
      roles - list of Roles
      expiration - to specify expiration for the API key
      metadata - Arbitrary metadata for the API key
    • CreateApiKeyRequest

      public CreateApiKeyRequest(String name, List<Role> roles, @Nullable org.elasticsearch.core.TimeValue expiration, @Nullable RefreshPolicy refreshPolicy)
  • Method Details

    • getName

      public String getName()
    • getExpiration

      public org.elasticsearch.core.TimeValue getExpiration()
    • getRoles

      public List<Role> getRoles()
    • getRefreshPolicy

      public RefreshPolicy getRefreshPolicy()
    • getMetadata

      public Map<String,Object> getMetadata()
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • toXContent

      public org.elasticsearch.xcontent.XContentBuilder toXContent(org.elasticsearch.xcontent.XContentBuilder builder, org.elasticsearch.xcontent.ToXContent.Params params) throws IOException
      Specified by:
      toXContent in interface org.elasticsearch.xcontent.ToXContent
      Throws:
      IOException