/**
 * Autogenerated by Thrift
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 *  @generated
 */

package test.fixtures.exceptions;

import java.util.*;

public class RaiserReactiveBlockingWrapper 
  implements Raiser {
  private final Raiser.Reactive _delegate;

  public RaiserReactiveBlockingWrapper(Raiser.Reactive _delegate) {
    
    this._delegate = _delegate;
  }

  public RaiserReactiveBlockingWrapper(org.apache.thrift.ProtocolId _protocolId, reactor.core.publisher.Mono<? extends com.facebook.thrift.client.RpcClient> _rpcClient, Map<String, String> _headers, Map<String, String> _persistentHeaders) {
    this(new RaiserReactiveClient(_protocolId, _rpcClient, _headers, _persistentHeaders));
  }

  @java.lang.Override
  public void close() {
    _delegate.dispose();
  }

  @java.lang.Override
  public void doBland() throws org.apache.thrift.TException {
      doBlandWrapper(com.facebook.thrift.client.RpcOptions.EMPTY);
  }

  @java.lang.Override
  public void doBland(
        com.facebook.thrift.client.RpcOptions rpcOptions) throws org.apache.thrift.TException {
      doBlandWrapper(rpcOptions);
  }

  @java.lang.Override
  public com.facebook.thrift.client.ResponseWrapper<Void> doBlandWrapper(
    com.facebook.thrift.client.RpcOptions rpcOptions) throws org.apache.thrift.TException {
      try {
        return _delegate.doBlandWrapper(rpcOptions).block();
      } catch (Throwable t) {
        throw com.facebook.thrift.util.ExceptionUtil.wrap(t);
      }
  }
  @java.lang.Override
  public void doRaise() throws test.fixtures.exceptions.Banal, test.fixtures.exceptions.Fiery, test.fixtures.exceptions.Serious, org.apache.thrift.TException {
      doRaiseWrapper(com.facebook.thrift.client.RpcOptions.EMPTY);
  }

  @java.lang.Override
  public void doRaise(
        com.facebook.thrift.client.RpcOptions rpcOptions) throws test.fixtures.exceptions.Banal, test.fixtures.exceptions.Fiery, test.fixtures.exceptions.Serious, org.apache.thrift.TException {
      doRaiseWrapper(rpcOptions);
  }

  @java.lang.Override
  public com.facebook.thrift.client.ResponseWrapper<Void> doRaiseWrapper(
    com.facebook.thrift.client.RpcOptions rpcOptions) throws test.fixtures.exceptions.Banal, test.fixtures.exceptions.Fiery, test.fixtures.exceptions.Serious, org.apache.thrift.TException {
      try {
        return _delegate.doRaiseWrapper(rpcOptions).block();
      } catch (Throwable t) {
        if (t instanceof test.fixtures.exceptions.Banal) {
          throw (test.fixtures.exceptions.Banal)t;
        }
        if (t instanceof test.fixtures.exceptions.Fiery) {
          throw (test.fixtures.exceptions.Fiery)t;
        }
        if (t instanceof test.fixtures.exceptions.Serious) {
          throw (test.fixtures.exceptions.Serious)t;
        }
        throw com.facebook.thrift.util.ExceptionUtil.wrap(t);
      }
  }
  @java.lang.Override
  public String get200() throws org.apache.thrift.TException {
      return get200Wrapper(com.facebook.thrift.client.RpcOptions.EMPTY).getData();
  }

  @java.lang.Override
  public String get200(
        com.facebook.thrift.client.RpcOptions rpcOptions) throws org.apache.thrift.TException {
      return get200Wrapper(rpcOptions).getData();
  }

  @java.lang.Override
  public com.facebook.thrift.client.ResponseWrapper<String> get200Wrapper(
    com.facebook.thrift.client.RpcOptions rpcOptions) throws org.apache.thrift.TException {
      try {
        return _delegate.get200Wrapper(rpcOptions).block();
      } catch (Throwable t) {
        throw com.facebook.thrift.util.ExceptionUtil.wrap(t);
      }
  }
  @java.lang.Override
  public String get500() throws test.fixtures.exceptions.Fiery, test.fixtures.exceptions.Banal, test.fixtures.exceptions.Serious, org.apache.thrift.TException {
      return get500Wrapper(com.facebook.thrift.client.RpcOptions.EMPTY).getData();
  }

  @java.lang.Override
  public String get500(
        com.facebook.thrift.client.RpcOptions rpcOptions) throws test.fixtures.exceptions.Fiery, test.fixtures.exceptions.Banal, test.fixtures.exceptions.Serious, org.apache.thrift.TException {
      return get500Wrapper(rpcOptions).getData();
  }

  @java.lang.Override
  public com.facebook.thrift.client.ResponseWrapper<String> get500Wrapper(
    com.facebook.thrift.client.RpcOptions rpcOptions) throws test.fixtures.exceptions.Fiery, test.fixtures.exceptions.Banal, test.fixtures.exceptions.Serious, org.apache.thrift.TException {
      try {
        return _delegate.get500Wrapper(rpcOptions).block();
      } catch (Throwable t) {
        if (t instanceof test.fixtures.exceptions.Fiery) {
          throw (test.fixtures.exceptions.Fiery)t;
        }
        if (t instanceof test.fixtures.exceptions.Banal) {
          throw (test.fixtures.exceptions.Banal)t;
        }
        if (t instanceof test.fixtures.exceptions.Serious) {
          throw (test.fixtures.exceptions.Serious)t;
        }
        throw com.facebook.thrift.util.ExceptionUtil.wrap(t);
      }
  }

}
