/**
 * Copyright Soramitsu Co., Ltd. All Rights Reserved.
 * SPDX-License-Identifier: Apache-2.0
 */

#include "interfaces/queries/query_variant.hpp"

#include "interfaces/queries/get_account.hpp"
#include "interfaces/queries/get_account_asset_transactions.hpp"
#include "interfaces/queries/get_account_assets.hpp"
#include "interfaces/queries/get_account_detail.hpp"
#include "interfaces/queries/get_account_transactions.hpp"
#include "interfaces/queries/get_asset_info.hpp"
#include "interfaces/queries/get_pending_transactions.hpp"
#include "interfaces/queries/get_role_permissions.hpp"
#include "interfaces/queries/get_roles.hpp"
#include "interfaces/queries/get_signatories.hpp"
#include "interfaces/queries/get_transactions.hpp"
#include "interfaces/queries/query_payload_meta.hpp"
#include "utils/visitor_apply_for_all.hpp"

using Variant = shared_model::interface::Query::QueryVariantType;
template Variant::~variant();
template Variant::variant(Variant &&);
template bool Variant::operator==(const Variant &) const;
template void Variant::destroy_content();
template int Variant::which() const;
template void Variant::indicate_which(int);
template bool Variant::using_backup() const;
template Variant::convert_copy_into::convert_copy_into(void *);

namespace shared_model {
  namespace interface {

    std::string Query::toString() const {
      return detail::PrettyStringBuilder()
          .init("Query")
          .append("creatorId", creatorAccountId())
          .append("queryCounter", std::to_string(queryCounter()))
          .append(Signable::toString())
          .append(boost::apply_visitor(detail::ToStringVisitor(), get()))
          .finalize();
    }

    bool Query::operator==(const ModelType &rhs) const {
      return this->get() == rhs.get();
    }

  }  // namespace interface
}  // namespace shared_model
