You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: field.rb
    path of file: ./repos/gitlabhq/app/models/integrations
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

module Integrations
  class Field
    BOOLEAN_ATTRIBUTES = %i[required api_only is_secret exposes_secrets].freeze

    ATTRIBUTES = %i[
      section type placeholder choices value checkbox_label
      title h
    
    def initialize(name:, integration_class:, type: :text, is_secret: false, api_only: false, **attributes)
      @name = name.to_s.freeze
      @integration_class = integration_class

      attributes[:type] = is_secret ? :password : type
      attributes[:api_only] = api_only
      attributes[:if] = attributes.fetch(:if, true)
      attributes[:is_secret] = is_secret
      @attributes = attributes.freeze

      invalid_attributes = attributes.keys - ATTRIBUTES
      if invalid_attributes.present?
        raise ArgumentError, "Invalid attributes #{invalid_attributes.inspect}"
      elsif !TYPES.include?(self[:type])
        raise ArgumentError, "Invalid type #{self[:type].inspect}"
      end