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: account_client.rb
    path of file: ./repos/algoliasearch-client-ruby/lib/algolia
    
    the code of the file until where you have to start completion: module Algolia
  module Account
    class Client
      class << self
        # Copies settings, synonyms, rules and objects from the source index to the
        # destination index. The replicas of the source index should not be copied.
        #
        # Throw an exception if the destination index al
    
        def copy_index(src_index, dest_index, opts = {})
          raise AlgoliaError, 'The indices are on the same application. Use Algolia::Search::Client.copy_index instead.' if src_index.config.app_id == dest_index.config.app_id

          begin
            dest_settings = dest_index.get_settings

            raise AlgoliaError, 'Destination index already exists. Please delete it before copying index across applications.' if dest_settings
          rescue AlgoliaHttpError => e
            raise e if e.code != 404
          end