require_relative "provider"
require_relative "static/static_connector"
require_relative "static/static_provider_account"
require_relative "static/category_provider_static"

module Provider
  class Static < AbstractProvider

    PROVIDER = "static"

    def name
      PROVIDER
    end

    def create_connector config, account
      options = {
        #static_ssh_key: account.ssh_key,

#        static_proxy: config[:static_proxy],
#        static_no_proxy: config[:static_no_proxy],
        static_integration_run_list: config[:static_integration_run_list]
      }
      add_connector(account.account_name, StaticConnector.new(options))
    end

    def create_account hash
      Devops::Model::StaticProviderAccount.new(hash)
    end

    def create_category_provider hash
      Devops::Model::CategoryProviderStatic.new(hash)
    end

    def account name
      Devops::Model::StaticProviderAccount.find(name)
    end

    def accounts
      Devops::Model::StaticProviderAccount.all
    end
  end

  register Static

end
