Class SecuredAPIKeyRestrictions

java.lang.Object
com.algolia.model.search.SecuredAPIKeyRestrictions

public class SecuredAPIKeyRestrictions extends Object
SecuredAPIKeyRestrictions
  • Constructor Details

    • SecuredAPIKeyRestrictions

      public SecuredAPIKeyRestrictions()
  • Method Details

    • setSearchParams

      public SecuredAPIKeyRestrictions setSearchParams(SearchParamsObject searchParams)
    • getSearchParams

      @Nullable public SearchParamsObject getSearchParams()
      Get searchParams
    • setFilters

      public SecuredAPIKeyRestrictions setFilters(String filters)
    • getFilters

      @Nullable public String getFilters()
      Filters that apply to every search made with the secured API key. Extra filters added at search time will be combined with `AND`. For example, if you set `group:admin` as fixed filter on your generated API key, and add `groups:visitors` to the search query, the complete set of filters will be `group:admin AND groups:visitors`.
    • setValidUntil

      public SecuredAPIKeyRestrictions setValidUntil(Long validUntil)
    • getValidUntil

      @Nullable public Long getValidUntil()
      Timestamp when the secured API key expires, measured in seconds since the Unix epoch.
    • setRestrictIndices

      public SecuredAPIKeyRestrictions setRestrictIndices(List<String> restrictIndices)
    • addRestrictIndices

      public SecuredAPIKeyRestrictions addRestrictIndices(String restrictIndicesItem)
    • getRestrictIndices

      @Nullable public List<String> getRestrictIndices()
      Index names or patterns that this API key can access. By default, an API key can access all indices in the same application. You can use leading and trailing wildcard characters (`*`): - `dev_*` matches all indices starting with \"dev_\". - `*_dev` matches all indices ending with \"_dev\". - `*_products_*` matches all indices containing \"_products_\".
    • setRestrictSources

      public SecuredAPIKeyRestrictions setRestrictSources(String restrictSources)
    • getRestrictSources

      @Nullable public String getRestrictSources()
      IP network that are allowed to use this key. You can only add a single source, but you can provide a range of IP addresses. Use this to protect against API key leaking and reuse.
    • setUserToken

      public SecuredAPIKeyRestrictions setUserToken(String userToken)
    • getUserToken

      @Nullable public String getUserToken()
      Pseudonymous user identifier to restrict usage of this API key to specific users. By default, rate limits are set based on IP addresses. This can be an issue if many users search from the same IP address. To avoid this, add a user token to each generated API key.
    • equals

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

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

      public String toString()
      Overrides:
      toString in class Object