<commit_before>class ZabbixApi
  class Applications < Basic

    API_PARAMETERS = %w(applicationids groupids hostids inherited itemids templated templateids selectItems)

    def method_name
      "application"
    end

    def indentify
      "name"
    end

    def get_full_data(data)
      filter_params = {}
      request_data = data.dup # Duplicate data, as we modify it. Otherwise methods that use data after calling get_full_data (such as get_id) will fail.

      request_data.each { |key, value| filter_params[key] = request_data.delete(key) unless API_PARAMETERS.include?(key) }
      @client.api_request(:method => "application.get", :params => request_data.merge({:filter => filter_params, :output => "extend"}))
    end

    def get_id(data)
      result = get_full_data(data)
      applicationid = nil
      result.each { |app| applicationid = app['applicationid'].to_i if app['name'] == data[:name] }
      applicationid
    end

    def create_or_update(data)
      applicationid = get_id(:name => data[:name], :hostid => data[:hostid])
      applicationid ? update(data.merge(:applicationid => applicationid)) : create(data)
    end

  end
end<commit_msg>remove applications overrides for get_full_data and get_id and use the inherited methods from basic instead<commit_after>class ZabbixApi
  class Applications < Basic

    API_PARAMETERS = %w(applicationids groupids hostids inherited itemids templated templateids selectItems)

    def method_name
      "application"
    end

    def indentify
      "name"
    end

    def create_or_update(data)
      applicationid = get_id(:name => data[:name], :hostid => data[:hostid])
      applicationid ? update(data.merge(:applicationid => applicationid)) : create(data)
    end

  end
end
{'fraction_non_alphanumeric': 0.0952109464082098, 'fraction_numerical': 0.0, 'mean_word_length': 3.692513368983957, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, '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': '6524146', 'n_tokens_mistral': 516, 'n_tokens_neox': 506, 'n_words': 139}