class AccountRepositoryOkHttpImpl extends AbstractRepositoryOkHttpImpl implements AccountRepository {

  @Override
  public Observable<Page<AccountInfo>> search(AccountSearchCriteria criteria) {

    Integer pageSize = criteria.getPageSize();
    Integer pageNumber = criteria.getPageNumber();
    String offset = criteria.getOffset();
    Order order = toDto(criteria.getOrder());
    AccountOrderByEnum orderBy =
        criteria.getOrderBy() == null
            ? null
            : AccountOrderByEnum.fromValue(criteria.getOrderBy().getValue());
    String mosaicId = criteria.getMosaicId() == null ? null : criteria.getMosaicId().getIdAsHex();

    Callable<AccountPage> callback =
        () -> getClient().searchAccounts(pageSize, pageNumber, offset, order, orderBy, mosaicId);

    return exceptionHandling(
        call(callback)
            .map(
                page ->
                    this.toPage(
                        page.getPagination(),
                        page.getData().stream()
                            .map(this::toAccountInfo)
                            .collect(Collectors.toList()))));
  }

  public  AccountRepositoryOkHttpImpl(ApiClient apiClient);

}