/**
 * Autogenerated by Thrift for thrift/compiler/test/fixtures/params/src/module.thrift
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 *  @generated
 */

#include <thrift/compiler/test/fixtures/params/gen-py3/module/clients_wrapper.h>

namespace cpp2 {


folly::Future<folly::Unit>
NestedContainersClientWrapper::mapList(
    apache::thrift::RpcOptions& rpcOptions,
    std::map<int32_t,std::vector<int32_t>> arg_foo) {
  auto* client = static_cast<::cpp2::NestedContainersAsyncClient*>(async_client_.get());
  using CallbackHelper = apache::thrift::detail::FutureCallbackHelper<folly::Unit>;
  folly::Promise<CallbackHelper::PromiseResult> _promise;
  auto _future = _promise.getFuture();
  auto callback = std::make_unique<::thrift::py3::FutureCallback<folly::Unit>>(
    std::move(_promise), rpcOptions, client->recv_wrapped_mapList, channel_);
  try {
    client->mapList(
      rpcOptions,
      std::move(callback),
      arg_foo
    );
  } catch (...) {
    return folly::makeFuture<folly::Unit>(folly::exception_wrapper(
      std::current_exception()
    ));
  }
  return std::move(_future).thenValue(CallbackHelper::extractResult);
}

folly::Future<folly::Unit>
NestedContainersClientWrapper::mapSet(
    apache::thrift::RpcOptions& rpcOptions,
    std::map<int32_t,std::set<int32_t>> arg_foo) {
  auto* client = static_cast<::cpp2::NestedContainersAsyncClient*>(async_client_.get());
  using CallbackHelper = apache::thrift::detail::FutureCallbackHelper<folly::Unit>;
  folly::Promise<CallbackHelper::PromiseResult> _promise;
  auto _future = _promise.getFuture();
  auto callback = std::make_unique<::thrift::py3::FutureCallback<folly::Unit>>(
    std::move(_promise), rpcOptions, client->recv_wrapped_mapSet, channel_);
  try {
    client->mapSet(
      rpcOptions,
      std::move(callback),
      arg_foo
    );
  } catch (...) {
    return folly::makeFuture<folly::Unit>(folly::exception_wrapper(
      std::current_exception()
    ));
  }
  return std::move(_future).thenValue(CallbackHelper::extractResult);
}

folly::Future<folly::Unit>
NestedContainersClientWrapper::listMap(
    apache::thrift::RpcOptions& rpcOptions,
    std::vector<std::map<int32_t,int32_t>> arg_foo) {
  auto* client = static_cast<::cpp2::NestedContainersAsyncClient*>(async_client_.get());
  using CallbackHelper = apache::thrift::detail::FutureCallbackHelper<folly::Unit>;
  folly::Promise<CallbackHelper::PromiseResult> _promise;
  auto _future = _promise.getFuture();
  auto callback = std::make_unique<::thrift::py3::FutureCallback<folly::Unit>>(
    std::move(_promise), rpcOptions, client->recv_wrapped_listMap, channel_);
  try {
    client->listMap(
      rpcOptions,
      std::move(callback),
      arg_foo
    );
  } catch (...) {
    return folly::makeFuture<folly::Unit>(folly::exception_wrapper(
      std::current_exception()
    ));
  }
  return std::move(_future).thenValue(CallbackHelper::extractResult);
}

folly::Future<folly::Unit>
NestedContainersClientWrapper::listSet(
    apache::thrift::RpcOptions& rpcOptions,
    std::vector<std::set<int32_t>> arg_foo) {
  auto* client = static_cast<::cpp2::NestedContainersAsyncClient*>(async_client_.get());
  using CallbackHelper = apache::thrift::detail::FutureCallbackHelper<folly::Unit>;
  folly::Promise<CallbackHelper::PromiseResult> _promise;
  auto _future = _promise.getFuture();
  auto callback = std::make_unique<::thrift::py3::FutureCallback<folly::Unit>>(
    std::move(_promise), rpcOptions, client->recv_wrapped_listSet, channel_);
  try {
    client->listSet(
      rpcOptions,
      std::move(callback),
      arg_foo
    );
  } catch (...) {
    return folly::makeFuture<folly::Unit>(folly::exception_wrapper(
      std::current_exception()
    ));
  }
  return std::move(_future).thenValue(CallbackHelper::extractResult);
}

folly::Future<folly::Unit>
NestedContainersClientWrapper::turtles(
    apache::thrift::RpcOptions& rpcOptions,
    std::vector<std::vector<std::map<int32_t,std::map<int32_t,std::set<int32_t>>>>> arg_foo) {
  auto* client = static_cast<::cpp2::NestedContainersAsyncClient*>(async_client_.get());
  using CallbackHelper = apache::thrift::detail::FutureCallbackHelper<folly::Unit>;
  folly::Promise<CallbackHelper::PromiseResult> _promise;
  auto _future = _promise.getFuture();
  auto callback = std::make_unique<::thrift::py3::FutureCallback<folly::Unit>>(
    std::move(_promise), rpcOptions, client->recv_wrapped_turtles, channel_);
  try {
    client->turtles(
      rpcOptions,
      std::move(callback),
      arg_foo
    );
  } catch (...) {
    return folly::makeFuture<folly::Unit>(folly::exception_wrapper(
      std::current_exception()
    ));
  }
  return std::move(_future).thenValue(CallbackHelper::extractResult);
}

} // namespace cpp2
