def update_api_key(key, object, request_options = {}, max_queries_per_IP_per_hour = 0, max_hits_per_query = 0, indexes = nil)
      if object.instance_of?(Array)
        params = { :acl => object }
      else
        params = object
      end

      validity = 0
      unless request_options.is_a?(Hash)
        validity = request_options
        request_options = {}
      end

      params[:indexes] = indexes if indexes
      params['validity'] = validity.to_i if validity != 0
      params['maxQueriesPerIPPerHour'] = max_queries_per_IP_per_hour.to_i if max_queries_per_IP_per_hour != 0
      params['maxHitsPerQuery'] = max_hits_per_query.to_i if max_hits_per_query != 0

      put(Protocol.key_uri(key), params.to_json, :write, request_options)
    end
def update_api_key(key, object, request_options = {}, max_queries_per_IP_per_hour = 0, max_hits_per_query = 0, indexes = nil)
      if object.instance_of?(Array)
        params = { :acl => object }
      else
        params = object
      end

      validity = 0
      unless request_options.is_a?(Hash)
        validity = request_options
        request_options = {}
      end

      params[:indexes] = indexes if indexes
      params['validity'] = validity.to_i if validity != 0
      params['maxQueriesPerIPPerHour'] = max_queries_per_IP_per_hour.to_i if max_queries_per_IP_per_hour != 0
      params['maxHitsPerQuery'] = max_hits_per_query.to_i if max_hits_per_query != 0

      put(Protocol.key_uri(key), params.to_json, :write, request_options)
    end
Update a user key

  Deprecated call was update_api_key(key, acl, validity, max_queries_per_IP_per_hour, max_hits_per_query, indexes)

  ACL can contain an array with those strings:
    - search: allow to search (https and http)
    - addObject: allows to add/update an object in the index (https only)
    - deleteObject : allows to delete an existing object (https only)
    - deleteIndex : allows to delete index content (https only)
    - settings : allows to get index settings (https only)
    - editSettings : allows to change index settings (https only)

  @param key API Key to update
  @param object The list of parameters for this key.
         Defined by a Hash that can contain the following values:
          - acl: array of string
          - indexes: array of string
          - validity: int
          - referers: array of string
          - description: string
          - maxHitsPerQuery: integer
          - queryParameters: string
          - maxQueriesPerIPPerHour: integer
  @param request_options contains extra parameters to send with your query - Default = {}