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

#include <thrift/compiler/test/fixtures/transitive-deps/gen-py3/s/clients_wrapper.h>

namespace cpp2 {


folly::Future<folly::Unit>
TestServiceClientWrapper::test(
    apache::thrift::RpcOptions& rpcOptions) {
  auto* client = static_cast<::cpp2::TestServiceAsyncClient*>(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_test, channel_);
  try {
    client->test(
      rpcOptions,
      std::move(callback)
    );
  } catch (...) {
    return folly::makeFuture<folly::Unit>(folly::exception_wrapper(
      std::current_exception()
    ));
  }
  return std::move(_future).thenValue(CallbackHelper::extractResult);
}

} // namespace cpp2
