<commit_before># API
class API
  # API for ApiKey
  class ApiKeyAPI < ModelAPI
    self.model = ApiKey

    self.high_detail_page_length = 100
    self.low_detail_page_length  = 1000
    self.put_page_length         = 1000
    self.delete_page_length      = 1000

    self.high_detail_includes = [
      :user
    ]

    def query_params
      raise NoMethodForAction.new("GET", :api_keys)
    end

    def create_params
      @for_user = parse_user(:for_user, default: @user)
      {
        notes:    parse_string(:app),
        user:     @for_user,
        verified: (@for_user == @user ? Time.now : nil)
      }
    end

    def validate_create_params!(params)
      raise MissingParameter.new(:app) if params[:notes].blank?
    end

    def after_create(api_key)
      return if @for_user == @user
      VerifyAPIKeyEmail.build(@for_user, @user, api_key).deliver_now
    end

    def update_params
      {
        notes: parse_string(:set_notes)
      }
    end
  end
end
<commit_msg>Need query_params for PUT and DELETE requests, not just GET requests. So need to disable GET requests by overriding get method, not query_params.<commit_after># API
class API
  # API for ApiKey
  class ApiKeyAPI < ModelAPI
    self.model = ApiKey

    self.high_detail_page_length = 100
    self.low_detail_page_length  = 1000
    self.put_page_length         = 1000
    self.delete_page_length      = 1000

    self.high_detail_includes = [
      :user
    ]

    def query_params
      {
        where:      sql_id_condition,
        created_at: parse_time_range(:created_at),
        updated_at: parse_time_range(:updated_at),
        notes_has:  parse_string(:notes)
      }
    end

    def create_params
      @for_user = parse_user(:for_user, default: @user)
      {
        notes:    parse_string(:app),
        user:     @for_user,
        verified: (@for_user == @user ? Time.now : nil)
      }
    end

    def validate_create_params!(params)
      raise MissingParameter.new(:app) if params[:notes].blank?
    end

    def after_create(api_key)
      return if @for_user == @user
      VerifyAPIKeyEmail.build(@for_user, @user, api_key).deliver_now
    end

    def update_params
      {
        notes: parse_string(:set_app)
      }
    end

    def get
      raise NoMethodForAction.new("GET", :api_keys)
    end
  end
end

{'fraction_non_alphanumeric': 0.08512467755803955, 'fraction_numerical': 0.012897678417884782, 'mean_word_length': 2.4070278184480234, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4126526', 'n_tokens_mistral': 788, 'n_tokens_neox': 748, 'n_words': 169}