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

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

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

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

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

  @param object can be two different parameters:
        The list of parameters for this key. Defined by a Hash that
        can contains the following values:
          - acl: array of string
          - validity: int
          - referers: array of string
          - description: string
          - maxHitsPerQuery: integer
          - queryParameters: string
          - maxQueriesPerIPPerHour: integer
        Or the list of ACL for this key. Defined by an array of String that
        can contains the following values:
          - 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 validity the number of seconds after which the key will be automatically removed (0 means no time limit for this key)
  @param max_queries_per_IP_per_hour the maximum number of API calls allowed from an IP address per hour (0 means unlimited)
  @param max_hits_per_query  the maximum number of hits this API key can retrieve in one call (0 means unlimited)
  @param request_options contains extra parameters to send with your query

 Deprecated: Please use `client.update_api_key` instead