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

/**
 * Original thrift service:-
 * SinkService
 */
interface SinkServiceAsyncIf extends \IThriftAsyncIf {
}

/**
 * Original thrift service:-
 * SinkService
 */
interface SinkServiceIf extends \IThriftSyncIf {
}

/**
 * Original thrift service:-
 * SinkService
 */
interface SinkServiceAsyncClientIf extends SinkServiceAsyncIf {
  /**
   * Original thrift definition:-
   * void, sink<SinkPayload, FinalResponse>
   *   method();
   */
  public function method(): Awaitable<\ResponseAndClientSink<null, SinkPayload, FinalResponse>>;

  /**
   * Original thrift definition:-
   * InitialResponse, sink<SinkPayload, FinalResponse>
   *   methodAndReponse();
   */
  public function methodAndReponse(): Awaitable<\ResponseAndClientSink<InitialResponse, SinkPayload, FinalResponse>>;

  /**
   * Original thrift definition:-
   * void, sink<SinkPayload, FinalResponse>
   *   methodThrow()
   *   throws (1: InitialException ex);
   */
  public function methodThrow(): Awaitable<\ResponseAndClientSink<null, SinkPayload, FinalResponse>>;

  /**
   * Original thrift definition:-
   * void, sink<SinkPayload, throws (1: SinkException1 ex), FinalResponse>
   *   methodSinkThrow();
   */
  public function methodSinkThrow(): Awaitable<\ResponseAndClientSink<null, SinkPayload, FinalResponse>>;

  /**
   * Original thrift definition:-
   * void, sink<SinkPayload, FinalResponse, throws (1: SinkException2 ex)>
   *   methodFinalThrow();
   */
  public function methodFinalThrow(): Awaitable<\ResponseAndClientSink<null, SinkPayload, FinalResponse>>;

  /**
   * Original thrift definition:-
   * void, sink<SinkPayload, throws (1: SinkException1 ex), FinalResponse, throws (1: SinkException2 ex)>
   *   methodBothThrow();
   */
  public function methodBothThrow(): Awaitable<\ResponseAndClientSink<null, SinkPayload, FinalResponse>>;

  /**
   * Original thrift definition:-
   * void, sink<SinkPayload, FinalResponse>
   *   methodFast();
   */
  public function methodFast(): Awaitable<\ResponseAndClientSink<null, SinkPayload, FinalResponse>>;
}

/**
 * Original thrift service:-
 * SinkService
 */
interface SinkServiceClientIf extends \IThriftSyncIf {
  /**
   * Original thrift definition:-
   * void, sink<SinkPayload, FinalResponse>
   *   method();
   */
  public function method(): Awaitable<\ResponseAndClientSink<null, SinkPayload, FinalResponse>>;

  /**
   * Original thrift definition:-
   * InitialResponse, sink<SinkPayload, FinalResponse>
   *   methodAndReponse();
   */
  public function methodAndReponse(): Awaitable<\ResponseAndClientSink<InitialResponse, SinkPayload, FinalResponse>>;

  /**
   * Original thrift definition:-
   * void, sink<SinkPayload, FinalResponse>
   *   methodThrow()
   *   throws (1: InitialException ex);
   */
  public function methodThrow(): Awaitable<\ResponseAndClientSink<null, SinkPayload, FinalResponse>>;

  /**
   * Original thrift definition:-
   * void, sink<SinkPayload, throws (1: SinkException1 ex), FinalResponse>
   *   methodSinkThrow();
   */
  public function methodSinkThrow(): Awaitable<\ResponseAndClientSink<null, SinkPayload, FinalResponse>>;

  /**
   * Original thrift definition:-
   * void, sink<SinkPayload, FinalResponse, throws (1: SinkException2 ex)>
   *   methodFinalThrow();
   */
  public function methodFinalThrow(): Awaitable<\ResponseAndClientSink<null, SinkPayload, FinalResponse>>;

  /**
   * Original thrift definition:-
   * void, sink<SinkPayload, throws (1: SinkException1 ex), FinalResponse, throws (1: SinkException2 ex)>
   *   methodBothThrow();
   */
  public function methodBothThrow(): Awaitable<\ResponseAndClientSink<null, SinkPayload, FinalResponse>>;

  /**
   * Original thrift definition:-
   * void, sink<SinkPayload, FinalResponse>
   *   methodFast();
   */
  public function methodFast(): Awaitable<\ResponseAndClientSink<null, SinkPayload, FinalResponse>>;
}

/**
 * Original thrift service:-
 * SinkService
 */
trait SinkServiceClientBase {
  require extends \ThriftClientBase;

}

class SinkServiceAsyncClient extends \ThriftClientBase implements SinkServiceAsyncClientIf {
  use SinkServiceClientBase;

  /**
   * Original thrift definition:-
   * void, sink<SinkPayload, FinalResponse>
   *   method();
   */
  public async function method(): Awaitable<\ResponseAndClientSink<null, SinkPayload, FinalResponse>> {
    $hh_frame_metadata = $this->getHHFrameMetadata();
    if ($hh_frame_metadata !== null) {
      \HH\set_frame_metadata($hh_frame_metadata);
    }
    $rpc_options = $this->getAndResetOptions() ?? \ThriftClientBase::defaultOptions();
    $args = SinkService_method_args::withDefaultValues();
    await $this->asyncHandler_->genBefore("SinkService", "method", $args);
    $currentseqid = $this->sendImplHelper($args, "method", false);
    return await $this->genAwaitSinkResponse(SinkService_method_FirstResponse::class, SinkService_method_SinkPayload::class, SinkService_method_FinalResponse::class, "method", true, $currentseqid, $rpc_options);
  }

  /**
   * Original thrift definition:-
   * InitialResponse, sink<SinkPayload, FinalResponse>
   *   methodAndReponse();
   */
  public async function methodAndReponse(): Awaitable<\ResponseAndClientSink<InitialResponse, SinkPayload, FinalResponse>> {
    $hh_frame_metadata = $this->getHHFrameMetadata();
    if ($hh_frame_metadata !== null) {
      \HH\set_frame_metadata($hh_frame_metadata);
    }
    $rpc_options = $this->getAndResetOptions() ?? \ThriftClientBase::defaultOptions();
    $args = SinkService_methodAndReponse_args::withDefaultValues();
    await $this->asyncHandler_->genBefore("SinkService", "methodAndReponse", $args);
    $currentseqid = $this->sendImplHelper($args, "methodAndReponse", false);
    return await $this->genAwaitSinkResponse(SinkService_methodAndReponse_FirstResponse::class, SinkService_methodAndReponse_SinkPayload::class, SinkService_methodAndReponse_FinalResponse::class, "methodAndReponse", false, $currentseqid, $rpc_options);
  }

  /**
   * Original thrift definition:-
   * void, sink<SinkPayload, FinalResponse>
   *   methodThrow()
   *   throws (1: InitialException ex);
   */
  public async function methodThrow(): Awaitable<\ResponseAndClientSink<null, SinkPayload, FinalResponse>> {
    $hh_frame_metadata = $this->getHHFrameMetadata();
    if ($hh_frame_metadata !== null) {
      \HH\set_frame_metadata($hh_frame_metadata);
    }
    $rpc_options = $this->getAndResetOptions() ?? \ThriftClientBase::defaultOptions();
    $args = SinkService_methodThrow_args::withDefaultValues();
    await $this->asyncHandler_->genBefore("SinkService", "methodThrow", $args);
    $currentseqid = $this->sendImplHelper($args, "methodThrow", false);
    return await $this->genAwaitSinkResponse(SinkService_methodThrow_FirstResponse::class, SinkService_methodThrow_SinkPayload::class, SinkService_methodThrow_FinalResponse::class, "methodThrow", true, $currentseqid, $rpc_options);
  }

  /**
   * Original thrift definition:-
   * void, sink<SinkPayload, throws (1: SinkException1 ex), FinalResponse>
   *   methodSinkThrow();
   */
  public async function methodSinkThrow(): Awaitable<\ResponseAndClientSink<null, SinkPayload, FinalResponse>> {
    $hh_frame_metadata = $this->getHHFrameMetadata();
    if ($hh_frame_metadata !== null) {
      \HH\set_frame_metadata($hh_frame_metadata);
    }
    $rpc_options = $this->getAndResetOptions() ?? \ThriftClientBase::defaultOptions();
    $args = SinkService_methodSinkThrow_args::withDefaultValues();
    await $this->asyncHandler_->genBefore("SinkService", "methodSinkThrow", $args);
    $currentseqid = $this->sendImplHelper($args, "methodSinkThrow", false);
    return await $this->genAwaitSinkResponse(SinkService_methodSinkThrow_FirstResponse::class, SinkService_methodSinkThrow_SinkPayload::class, SinkService_methodSinkThrow_FinalResponse::class, "methodSinkThrow", true, $currentseqid, $rpc_options);
  }

  /**
   * Original thrift definition:-
   * void, sink<SinkPayload, FinalResponse, throws (1: SinkException2 ex)>
   *   methodFinalThrow();
   */
  public async function methodFinalThrow(): Awaitable<\ResponseAndClientSink<null, SinkPayload, FinalResponse>> {
    $hh_frame_metadata = $this->getHHFrameMetadata();
    if ($hh_frame_metadata !== null) {
      \HH\set_frame_metadata($hh_frame_metadata);
    }
    $rpc_options = $this->getAndResetOptions() ?? \ThriftClientBase::defaultOptions();
    $args = SinkService_methodFinalThrow_args::withDefaultValues();
    await $this->asyncHandler_->genBefore("SinkService", "methodFinalThrow", $args);
    $currentseqid = $this->sendImplHelper($args, "methodFinalThrow", false);
    return await $this->genAwaitSinkResponse(SinkService_methodFinalThrow_FirstResponse::class, SinkService_methodFinalThrow_SinkPayload::class, SinkService_methodFinalThrow_FinalResponse::class, "methodFinalThrow", true, $currentseqid, $rpc_options);
  }

  /**
   * Original thrift definition:-
   * void, sink<SinkPayload, throws (1: SinkException1 ex), FinalResponse, throws (1: SinkException2 ex)>
   *   methodBothThrow();
   */
  public async function methodBothThrow(): Awaitable<\ResponseAndClientSink<null, SinkPayload, FinalResponse>> {
    $hh_frame_metadata = $this->getHHFrameMetadata();
    if ($hh_frame_metadata !== null) {
      \HH\set_frame_metadata($hh_frame_metadata);
    }
    $rpc_options = $this->getAndResetOptions() ?? \ThriftClientBase::defaultOptions();
    $args = SinkService_methodBothThrow_args::withDefaultValues();
    await $this->asyncHandler_->genBefore("SinkService", "methodBothThrow", $args);
    $currentseqid = $this->sendImplHelper($args, "methodBothThrow", false);
    return await $this->genAwaitSinkResponse(SinkService_methodBothThrow_FirstResponse::class, SinkService_methodBothThrow_SinkPayload::class, SinkService_methodBothThrow_FinalResponse::class, "methodBothThrow", true, $currentseqid, $rpc_options);
  }

  /**
   * Original thrift definition:-
   * void, sink<SinkPayload, FinalResponse>
   *   methodFast();
   */
  public async function methodFast(): Awaitable<\ResponseAndClientSink<null, SinkPayload, FinalResponse>> {
    $hh_frame_metadata = $this->getHHFrameMetadata();
    if ($hh_frame_metadata !== null) {
      \HH\set_frame_metadata($hh_frame_metadata);
    }
    $rpc_options = $this->getAndResetOptions() ?? \ThriftClientBase::defaultOptions();
    $args = SinkService_methodFast_args::withDefaultValues();
    await $this->asyncHandler_->genBefore("SinkService", "methodFast", $args);
    $currentseqid = $this->sendImplHelper($args, "methodFast", false);
    return await $this->genAwaitSinkResponse(SinkService_methodFast_FirstResponse::class, SinkService_methodFast_SinkPayload::class, SinkService_methodFast_FinalResponse::class, "methodFast", true, $currentseqid, $rpc_options);
  }

}

class SinkServiceClient extends \ThriftClientBase implements SinkServiceClientIf {
  use SinkServiceClientBase;

  /**
   * Original thrift definition:-
   * void, sink<SinkPayload, FinalResponse>
   *   method();
   */
  public async function method(): Awaitable<\ResponseAndClientSink<null, SinkPayload, FinalResponse>> {
    $hh_frame_metadata = $this->getHHFrameMetadata();
    if ($hh_frame_metadata !== null) {
      \HH\set_frame_metadata($hh_frame_metadata);
    }
    $rpc_options = $this->getAndResetOptions() ?? \ThriftClientBase::defaultOptions();
    $args = SinkService_method_args::withDefaultValues();
    await $this->asyncHandler_->genBefore("SinkService", "method", $args);
    $currentseqid = $this->sendImplHelper($args, "method", false);
    return await $this->genAwaitSinkResponse(SinkService_method_FirstResponse::class, SinkService_method_SinkPayload::class, SinkService_method_FinalResponse::class, "method", true, $currentseqid, $rpc_options);
  }

  /**
   * Original thrift definition:-
   * InitialResponse, sink<SinkPayload, FinalResponse>
   *   methodAndReponse();
   */
  public async function methodAndReponse(): Awaitable<\ResponseAndClientSink<InitialResponse, SinkPayload, FinalResponse>> {
    $hh_frame_metadata = $this->getHHFrameMetadata();
    if ($hh_frame_metadata !== null) {
      \HH\set_frame_metadata($hh_frame_metadata);
    }
    $rpc_options = $this->getAndResetOptions() ?? \ThriftClientBase::defaultOptions();
    $args = SinkService_methodAndReponse_args::withDefaultValues();
    await $this->asyncHandler_->genBefore("SinkService", "methodAndReponse", $args);
    $currentseqid = $this->sendImplHelper($args, "methodAndReponse", false);
    return await $this->genAwaitSinkResponse(SinkService_methodAndReponse_FirstResponse::class, SinkService_methodAndReponse_SinkPayload::class, SinkService_methodAndReponse_FinalResponse::class, "methodAndReponse", false, $currentseqid, $rpc_options);
  }

  /**
   * Original thrift definition:-
   * void, sink<SinkPayload, FinalResponse>
   *   methodThrow()
   *   throws (1: InitialException ex);
   */
  public async function methodThrow(): Awaitable<\ResponseAndClientSink<null, SinkPayload, FinalResponse>> {
    $hh_frame_metadata = $this->getHHFrameMetadata();
    if ($hh_frame_metadata !== null) {
      \HH\set_frame_metadata($hh_frame_metadata);
    }
    $rpc_options = $this->getAndResetOptions() ?? \ThriftClientBase::defaultOptions();
    $args = SinkService_methodThrow_args::withDefaultValues();
    await $this->asyncHandler_->genBefore("SinkService", "methodThrow", $args);
    $currentseqid = $this->sendImplHelper($args, "methodThrow", false);
    return await $this->genAwaitSinkResponse(SinkService_methodThrow_FirstResponse::class, SinkService_methodThrow_SinkPayload::class, SinkService_methodThrow_FinalResponse::class, "methodThrow", true, $currentseqid, $rpc_options);
  }

  /**
   * Original thrift definition:-
   * void, sink<SinkPayload, throws (1: SinkException1 ex), FinalResponse>
   *   methodSinkThrow();
   */
  public async function methodSinkThrow(): Awaitable<\ResponseAndClientSink<null, SinkPayload, FinalResponse>> {
    $hh_frame_metadata = $this->getHHFrameMetadata();
    if ($hh_frame_metadata !== null) {
      \HH\set_frame_metadata($hh_frame_metadata);
    }
    $rpc_options = $this->getAndResetOptions() ?? \ThriftClientBase::defaultOptions();
    $args = SinkService_methodSinkThrow_args::withDefaultValues();
    await $this->asyncHandler_->genBefore("SinkService", "methodSinkThrow", $args);
    $currentseqid = $this->sendImplHelper($args, "methodSinkThrow", false);
    return await $this->genAwaitSinkResponse(SinkService_methodSinkThrow_FirstResponse::class, SinkService_methodSinkThrow_SinkPayload::class, SinkService_methodSinkThrow_FinalResponse::class, "methodSinkThrow", true, $currentseqid, $rpc_options);
  }

  /**
   * Original thrift definition:-
   * void, sink<SinkPayload, FinalResponse, throws (1: SinkException2 ex)>
   *   methodFinalThrow();
   */
  public async function methodFinalThrow(): Awaitable<\ResponseAndClientSink<null, SinkPayload, FinalResponse>> {
    $hh_frame_metadata = $this->getHHFrameMetadata();
    if ($hh_frame_metadata !== null) {
      \HH\set_frame_metadata($hh_frame_metadata);
    }
    $rpc_options = $this->getAndResetOptions() ?? \ThriftClientBase::defaultOptions();
    $args = SinkService_methodFinalThrow_args::withDefaultValues();
    await $this->asyncHandler_->genBefore("SinkService", "methodFinalThrow", $args);
    $currentseqid = $this->sendImplHelper($args, "methodFinalThrow", false);
    return await $this->genAwaitSinkResponse(SinkService_methodFinalThrow_FirstResponse::class, SinkService_methodFinalThrow_SinkPayload::class, SinkService_methodFinalThrow_FinalResponse::class, "methodFinalThrow", true, $currentseqid, $rpc_options);
  }

  /**
   * Original thrift definition:-
   * void, sink<SinkPayload, throws (1: SinkException1 ex), FinalResponse, throws (1: SinkException2 ex)>
   *   methodBothThrow();
   */
  public async function methodBothThrow(): Awaitable<\ResponseAndClientSink<null, SinkPayload, FinalResponse>> {
    $hh_frame_metadata = $this->getHHFrameMetadata();
    if ($hh_frame_metadata !== null) {
      \HH\set_frame_metadata($hh_frame_metadata);
    }
    $rpc_options = $this->getAndResetOptions() ?? \ThriftClientBase::defaultOptions();
    $args = SinkService_methodBothThrow_args::withDefaultValues();
    await $this->asyncHandler_->genBefore("SinkService", "methodBothThrow", $args);
    $currentseqid = $this->sendImplHelper($args, "methodBothThrow", false);
    return await $this->genAwaitSinkResponse(SinkService_methodBothThrow_FirstResponse::class, SinkService_methodBothThrow_SinkPayload::class, SinkService_methodBothThrow_FinalResponse::class, "methodBothThrow", true, $currentseqid, $rpc_options);
  }

  /**
   * Original thrift definition:-
   * void, sink<SinkPayload, FinalResponse>
   *   methodFast();
   */
  public async function methodFast(): Awaitable<\ResponseAndClientSink<null, SinkPayload, FinalResponse>> {
    $hh_frame_metadata = $this->getHHFrameMetadata();
    if ($hh_frame_metadata !== null) {
      \HH\set_frame_metadata($hh_frame_metadata);
    }
    $rpc_options = $this->getAndResetOptions() ?? \ThriftClientBase::defaultOptions();
    $args = SinkService_methodFast_args::withDefaultValues();
    await $this->asyncHandler_->genBefore("SinkService", "methodFast", $args);
    $currentseqid = $this->sendImplHelper($args, "methodFast", false);
    return await $this->genAwaitSinkResponse(SinkService_methodFast_FirstResponse::class, SinkService_methodFast_SinkPayload::class, SinkService_methodFast_FinalResponse::class, "methodFast", true, $currentseqid, $rpc_options);
  }

  /* send and recv functions */
}

// HELPER FUNCTIONS AND STRUCTURES

class SinkService_method_args implements \IThriftSyncStruct, \IThriftStructMetadata {
  use \ThriftSerializationTrait;

  const \ThriftStructTypes::TSpec SPEC = dict[
  ];
  const dict<string, int> FIELDMAP = dict[
  ];

  const type TConstructorShape = shape(
  );

  const int STRUCTURAL_ID = 957977401221134810;

  public function __construct()[] {
  }

  public static function withDefaultValues()[]: this {
    return new static();
  }

  public static function fromShape(self::TConstructorShape $shape)[]: this {
    return new static(
    );
  }

  public function getName()[]: string {
    return 'SinkService_method_args';
  }

  public function clearTerseFields()[write_props]: void {
  }

  public static function getStructMetadata()[]: \tmeta_ThriftStruct {
    return tmeta_ThriftStruct::fromShape(
      shape(
        "name" => "module.method_args",
        "is_union" => false,
      )
    );
  }

  public static function getAllStructuredAnnotations()[write_props]: \TStructAnnotations {
    return shape(
      'struct' => dict[],
      'fields' => dict[
      ],
    );
  }

  public function getInstanceKey()[write_props]: string {
    return \TCompactSerializer::serialize($this);
  }

}

class SinkService_method_FirstResponse extends \ThriftSyncStructWithoutResult implements \IThriftStructMetadata {
  use \ThriftSerializationTrait;

  const \ThriftStructTypes::TSpec SPEC = dict[
  ];
  const dict<string, int> FIELDMAP = dict[
  ];

  const type TConstructorShape = shape(
  );

  const int STRUCTURAL_ID = 957977401221134810;

  public function __construct()[] {
  }

  public static function withDefaultValues()[]: this {
    return new static();
  }

  public static function fromShape(self::TConstructorShape $shape)[]: this {
    return new static(
    );
  }

  public function getName()[]: string {
    return 'SinkService_method_FirstResponse';
  }

  public function clearTerseFields()[write_props]: void {
  }

  public static function getStructMetadata()[]: \tmeta_ThriftStruct {
    return tmeta_ThriftStruct::fromShape(
      shape(
        "name" => "module.SinkService_method_FirstResponse",
        "is_union" => false,
      )
    );
  }

  public static function getAllStructuredAnnotations()[write_props]: \TStructAnnotations {
    return shape(
      'struct' => dict[],
      'fields' => dict[
      ],
    );
  }

  public function getInstanceKey()[write_props]: string {
    return \TCompactSerializer::serialize($this);
  }

}

class SinkService_method_SinkPayload extends \ThriftSyncStructWithResult implements \IThriftStructMetadata {
  use \ThriftSerializationTrait;

  const type TResult = SinkPayload;

  const \ThriftStructTypes::TSpec SPEC = dict[
    0 => shape(
      'var' => 'success',
      'type' => \TType::STRUCT,
      'class' => SinkPayload::class,
    ),
  ];
  const dict<string, int> FIELDMAP = dict[
    'success' => 0,
  ];

  const type TConstructorShape = shape(
    ?'success' => ?this::TResult,
  );

  const int STRUCTURAL_ID = 5047864711357047518;
  public ?this::TResult $success;

  public function __construct(?this::TResult $success = null)[] {
    $this->success = $success;
  }

  public static function withDefaultValues()[]: this {
    return new static();
  }

  public static function fromShape(self::TConstructorShape $shape)[]: this {
    return new static(
      Shapes::idx($shape, 'success'),
    );
  }

  public function getName()[]: string {
    return 'SinkService_method_SinkPayload';
  }

  public function clearTerseFields()[write_props]: void {
  }

  public static function getStructMetadata()[]: \tmeta_ThriftStruct {
    return tmeta_ThriftStruct::fromShape(
      shape(
        "name" => "module.SinkService_method_SinkPayload",
        "fields" => vec[
          tmeta_ThriftField::fromShape(
            shape(
              "id" => 0,
              "type" => tmeta_ThriftType::fromShape(
                shape(
                  "t_struct" => tmeta_ThriftStructType::fromShape(
                    shape(
                      "name" => "module.SinkPayload",
                    )
                  ),
                )
              ),
              "name" => "success",
            )
          ),
        ],
        "is_union" => false,
      )
    );
  }

  public static function getAllStructuredAnnotations()[write_props]: \TStructAnnotations {
    return shape(
      'struct' => dict[],
      'fields' => dict[
      ],
    );
  }

  public function getInstanceKey()[write_props]: string {
    return \TCompactSerializer::serialize($this);
  }

}

class SinkService_method_FinalResponse extends \ThriftSyncStructWithResult implements \IThriftStructMetadata {
  use \ThriftSerializationTrait;

  const type TResult = FinalResponse;

  const \ThriftStructTypes::TSpec SPEC = dict[
    0 => shape(
      'var' => 'success',
      'type' => \TType::STRUCT,
      'class' => FinalResponse::class,
    ),
  ];
  const dict<string, int> FIELDMAP = dict[
    'success' => 0,
  ];

  const type TConstructorShape = shape(
    ?'success' => ?this::TResult,
  );

  const int STRUCTURAL_ID = 7640464975912492398;
  public ?this::TResult $success;

  public function __construct(?this::TResult $success = null)[] {
    $this->success = $success;
  }

  public static function withDefaultValues()[]: this {
    return new static();
  }

  public static function fromShape(self::TConstructorShape $shape)[]: this {
    return new static(
      Shapes::idx($shape, 'success'),
    );
  }

  public function getName()[]: string {
    return 'SinkService_method_FinalResponse';
  }

  public function clearTerseFields()[write_props]: void {
  }

  public static function getStructMetadata()[]: \tmeta_ThriftStruct {
    return tmeta_ThriftStruct::fromShape(
      shape(
        "name" => "module.SinkService_method_FinalResponse",
        "fields" => vec[
          tmeta_ThriftField::fromShape(
            shape(
              "id" => 0,
              "type" => tmeta_ThriftType::fromShape(
                shape(
                  "t_struct" => tmeta_ThriftStructType::fromShape(
                    shape(
                      "name" => "module.FinalResponse",
                    )
                  ),
                )
              ),
              "name" => "success",
            )
          ),
        ],
        "is_union" => false,
      )
    );
  }

  public static function getAllStructuredAnnotations()[write_props]: \TStructAnnotations {
    return shape(
      'struct' => dict[],
      'fields' => dict[
      ],
    );
  }

  public function getInstanceKey()[write_props]: string {
    return \TCompactSerializer::serialize($this);
  }

}

class SinkService_methodAndReponse_args implements \IThriftSyncStruct, \IThriftStructMetadata {
  use \ThriftSerializationTrait;

  const \ThriftStructTypes::TSpec SPEC = dict[
  ];
  const dict<string, int> FIELDMAP = dict[
  ];

  const type TConstructorShape = shape(
  );

  const int STRUCTURAL_ID = 957977401221134810;

  public function __construct()[] {
  }

  public static function withDefaultValues()[]: this {
    return new static();
  }

  public static function fromShape(self::TConstructorShape $shape)[]: this {
    return new static(
    );
  }

  public function getName()[]: string {
    return 'SinkService_methodAndReponse_args';
  }

  public function clearTerseFields()[write_props]: void {
  }

  public static function getStructMetadata()[]: \tmeta_ThriftStruct {
    return tmeta_ThriftStruct::fromShape(
      shape(
        "name" => "module.methodAndReponse_args",
        "is_union" => false,
      )
    );
  }

  public static function getAllStructuredAnnotations()[write_props]: \TStructAnnotations {
    return shape(
      'struct' => dict[],
      'fields' => dict[
      ],
    );
  }

  public function getInstanceKey()[write_props]: string {
    return \TCompactSerializer::serialize($this);
  }

}

class SinkService_methodAndReponse_FirstResponse extends \ThriftSyncStructWithResult implements \IThriftStructMetadata {
  use \ThriftSerializationTrait;

  const type TResult = InitialResponse;

  const \ThriftStructTypes::TSpec SPEC = dict[
    0 => shape(
      'var' => 'success',
      'type' => \TType::STRUCT,
      'class' => InitialResponse::class,
    ),
  ];
  const dict<string, int> FIELDMAP = dict[
    'success' => 0,
  ];

  const type TConstructorShape = shape(
    ?'success' => ?this::TResult,
  );

  const int STRUCTURAL_ID = 1156060868779247352;
  public ?this::TResult $success;

  public function __construct(?this::TResult $success = null)[] {
    $this->success = $success;
  }

  public static function withDefaultValues()[]: this {
    return new static();
  }

  public static function fromShape(self::TConstructorShape $shape)[]: this {
    return new static(
      Shapes::idx($shape, 'success'),
    );
  }

  public function getName()[]: string {
    return 'SinkService_methodAndReponse_FirstResponse';
  }

  public function clearTerseFields()[write_props]: void {
  }

  public static function getStructMetadata()[]: \tmeta_ThriftStruct {
    return tmeta_ThriftStruct::fromShape(
      shape(
        "name" => "module.SinkService_methodAndReponse_FirstResponse",
        "fields" => vec[
          tmeta_ThriftField::fromShape(
            shape(
              "id" => 0,
              "type" => tmeta_ThriftType::fromShape(
                shape(
                  "t_struct" => tmeta_ThriftStructType::fromShape(
                    shape(
                      "name" => "module.InitialResponse",
                    )
                  ),
                )
              ),
              "name" => "success",
            )
          ),
        ],
        "is_union" => false,
      )
    );
  }

  public static function getAllStructuredAnnotations()[write_props]: \TStructAnnotations {
    return shape(
      'struct' => dict[],
      'fields' => dict[
      ],
    );
  }

  public function getInstanceKey()[write_props]: string {
    return \TCompactSerializer::serialize($this);
  }

}

class SinkService_methodAndReponse_SinkPayload extends \ThriftSyncStructWithResult implements \IThriftStructMetadata {
  use \ThriftSerializationTrait;

  const type TResult = SinkPayload;

  const \ThriftStructTypes::TSpec SPEC = dict[
    0 => shape(
      'var' => 'success',
      'type' => \TType::STRUCT,
      'class' => SinkPayload::class,
    ),
  ];
  const dict<string, int> FIELDMAP = dict[
    'success' => 0,
  ];

  const type TConstructorShape = shape(
    ?'success' => ?this::TResult,
  );

  const int STRUCTURAL_ID = 5047864711357047518;
  public ?this::TResult $success;

  public function __construct(?this::TResult $success = null)[] {
    $this->success = $success;
  }

  public static function withDefaultValues()[]: this {
    return new static();
  }

  public static function fromShape(self::TConstructorShape $shape)[]: this {
    return new static(
      Shapes::idx($shape, 'success'),
    );
  }

  public function getName()[]: string {
    return 'SinkService_methodAndReponse_SinkPayload';
  }

  public function clearTerseFields()[write_props]: void {
  }

  public static function getStructMetadata()[]: \tmeta_ThriftStruct {
    return tmeta_ThriftStruct::fromShape(
      shape(
        "name" => "module.SinkService_methodAndReponse_SinkPayload",
        "fields" => vec[
          tmeta_ThriftField::fromShape(
            shape(
              "id" => 0,
              "type" => tmeta_ThriftType::fromShape(
                shape(
                  "t_struct" => tmeta_ThriftStructType::fromShape(
                    shape(
                      "name" => "module.SinkPayload",
                    )
                  ),
                )
              ),
              "name" => "success",
            )
          ),
        ],
        "is_union" => false,
      )
    );
  }

  public static function getAllStructuredAnnotations()[write_props]: \TStructAnnotations {
    return shape(
      'struct' => dict[],
      'fields' => dict[
      ],
    );
  }

  public function getInstanceKey()[write_props]: string {
    return \TCompactSerializer::serialize($this);
  }

}

class SinkService_methodAndReponse_FinalResponse extends \ThriftSyncStructWithResult implements \IThriftStructMetadata {
  use \ThriftSerializationTrait;

  const type TResult = FinalResponse;

  const \ThriftStructTypes::TSpec SPEC = dict[
    0 => shape(
      'var' => 'success',
      'type' => \TType::STRUCT,
      'class' => FinalResponse::class,
    ),
  ];
  const dict<string, int> FIELDMAP = dict[
    'success' => 0,
  ];

  const type TConstructorShape = shape(
    ?'success' => ?this::TResult,
  );

  const int STRUCTURAL_ID = 7640464975912492398;
  public ?this::TResult $success;

  public function __construct(?this::TResult $success = null)[] {
    $this->success = $success;
  }

  public static function withDefaultValues()[]: this {
    return new static();
  }

  public static function fromShape(self::TConstructorShape $shape)[]: this {
    return new static(
      Shapes::idx($shape, 'success'),
    );
  }

  public function getName()[]: string {
    return 'SinkService_methodAndReponse_FinalResponse';
  }

  public function clearTerseFields()[write_props]: void {
  }

  public static function getStructMetadata()[]: \tmeta_ThriftStruct {
    return tmeta_ThriftStruct::fromShape(
      shape(
        "name" => "module.SinkService_methodAndReponse_FinalResponse",
        "fields" => vec[
          tmeta_ThriftField::fromShape(
            shape(
              "id" => 0,
              "type" => tmeta_ThriftType::fromShape(
                shape(
                  "t_struct" => tmeta_ThriftStructType::fromShape(
                    shape(
                      "name" => "module.FinalResponse",
                    )
                  ),
                )
              ),
              "name" => "success",
            )
          ),
        ],
        "is_union" => false,
      )
    );
  }

  public static function getAllStructuredAnnotations()[write_props]: \TStructAnnotations {
    return shape(
      'struct' => dict[],
      'fields' => dict[
      ],
    );
  }

  public function getInstanceKey()[write_props]: string {
    return \TCompactSerializer::serialize($this);
  }

}

class SinkService_methodThrow_args implements \IThriftSyncStruct, \IThriftStructMetadata {
  use \ThriftSerializationTrait;

  const \ThriftStructTypes::TSpec SPEC = dict[
  ];
  const dict<string, int> FIELDMAP = dict[
  ];

  const type TConstructorShape = shape(
  );

  const int STRUCTURAL_ID = 957977401221134810;

  public function __construct()[] {
  }

  public static function withDefaultValues()[]: this {
    return new static();
  }

  public static function fromShape(self::TConstructorShape $shape)[]: this {
    return new static(
    );
  }

  public function getName()[]: string {
    return 'SinkService_methodThrow_args';
  }

  public function clearTerseFields()[write_props]: void {
  }

  public static function getStructMetadata()[]: \tmeta_ThriftStruct {
    return tmeta_ThriftStruct::fromShape(
      shape(
        "name" => "module.methodThrow_args",
        "is_union" => false,
      )
    );
  }

  public static function getAllStructuredAnnotations()[write_props]: \TStructAnnotations {
    return shape(
      'struct' => dict[],
      'fields' => dict[
      ],
    );
  }

  public function getInstanceKey()[write_props]: string {
    return \TCompactSerializer::serialize($this);
  }

}

class SinkService_methodThrow_FirstResponse extends \ThriftSyncStructWithoutResult implements \IThriftStructMetadata {
  use \ThriftSerializationTrait;

  const \ThriftStructTypes::TSpec SPEC = dict[
    1 => shape(
      'var' => 'ex',
      'type' => \TType::STRUCT,
      'class' => InitialException::class,
    ),
  ];
  const dict<string, int> FIELDMAP = dict[
    'ex' => 1,
  ];

  const type TConstructorShape = shape(
    ?'ex' => ?InitialException,
  );

  const int STRUCTURAL_ID = 5881917388606205109;
  public ?InitialException $ex;

  public function __construct(?InitialException $ex = null)[] {
    $this->ex = $ex;
  }

  public static function withDefaultValues()[]: this {
    return new static();
  }

  public static function fromShape(self::TConstructorShape $shape)[]: this {
    return new static(
      Shapes::idx($shape, 'ex'),
    );
  }

  public function getName()[]: string {
    return 'SinkService_methodThrow_FirstResponse';
  }

  public function clearTerseFields()[write_props]: void {
  }

  public static function getStructMetadata()[]: \tmeta_ThriftStruct {
    return tmeta_ThriftStruct::fromShape(
      shape(
        "name" => "module.SinkService_methodThrow_FirstResponse",
        "fields" => vec[
          tmeta_ThriftField::fromShape(
            shape(
              "id" => 1,
              "type" => tmeta_ThriftType::fromShape(
                shape(
                  "t_struct" => tmeta_ThriftStructType::fromShape(
                    shape(
                      "name" => "module.InitialException",
                    )
                  ),
                )
              ),
              "name" => "ex",
            )
          ),
        ],
        "is_union" => false,
      )
    );
  }

  public static function getAllStructuredAnnotations()[write_props]: \TStructAnnotations {
    return shape(
      'struct' => dict[],
      'fields' => dict[
      ],
    );
  }

  public function getInstanceKey()[write_props]: string {
    return \TCompactSerializer::serialize($this);
  }

  public function checkForException(): ?\TException {
    if ($this->ex !== null) {
      return $this->ex;
    }
    return null;
  }
}

class SinkService_methodThrow_SinkPayload extends \ThriftSyncStructWithResult implements \IThriftStructMetadata {
  use \ThriftSerializationTrait;

  const type TResult = SinkPayload;

  const \ThriftStructTypes::TSpec SPEC = dict[
    0 => shape(
      'var' => 'success',
      'type' => \TType::STRUCT,
      'class' => SinkPayload::class,
    ),
  ];
  const dict<string, int> FIELDMAP = dict[
    'success' => 0,
  ];

  const type TConstructorShape = shape(
    ?'success' => ?this::TResult,
  );

  const int STRUCTURAL_ID = 5047864711357047518;
  public ?this::TResult $success;

  public function __construct(?this::TResult $success = null)[] {
    $this->success = $success;
  }

  public static function withDefaultValues()[]: this {
    return new static();
  }

  public static function fromShape(self::TConstructorShape $shape)[]: this {
    return new static(
      Shapes::idx($shape, 'success'),
    );
  }

  public function getName()[]: string {
    return 'SinkService_methodThrow_SinkPayload';
  }

  public function clearTerseFields()[write_props]: void {
  }

  public static function getStructMetadata()[]: \tmeta_ThriftStruct {
    return tmeta_ThriftStruct::fromShape(
      shape(
        "name" => "module.SinkService_methodThrow_SinkPayload",
        "fields" => vec[
          tmeta_ThriftField::fromShape(
            shape(
              "id" => 0,
              "type" => tmeta_ThriftType::fromShape(
                shape(
                  "t_struct" => tmeta_ThriftStructType::fromShape(
                    shape(
                      "name" => "module.SinkPayload",
                    )
                  ),
                )
              ),
              "name" => "success",
            )
          ),
        ],
        "is_union" => false,
      )
    );
  }

  public static function getAllStructuredAnnotations()[write_props]: \TStructAnnotations {
    return shape(
      'struct' => dict[],
      'fields' => dict[
      ],
    );
  }

  public function getInstanceKey()[write_props]: string {
    return \TCompactSerializer::serialize($this);
  }

}

class SinkService_methodThrow_FinalResponse extends \ThriftSyncStructWithResult implements \IThriftStructMetadata {
  use \ThriftSerializationTrait;

  const type TResult = FinalResponse;

  const \ThriftStructTypes::TSpec SPEC = dict[
    0 => shape(
      'var' => 'success',
      'type' => \TType::STRUCT,
      'class' => FinalResponse::class,
    ),
  ];
  const dict<string, int> FIELDMAP = dict[
    'success' => 0,
  ];

  const type TConstructorShape = shape(
    ?'success' => ?this::TResult,
  );

  const int STRUCTURAL_ID = 7640464975912492398;
  public ?this::TResult $success;

  public function __construct(?this::TResult $success = null)[] {
    $this->success = $success;
  }

  public static function withDefaultValues()[]: this {
    return new static();
  }

  public static function fromShape(self::TConstructorShape $shape)[]: this {
    return new static(
      Shapes::idx($shape, 'success'),
    );
  }

  public function getName()[]: string {
    return 'SinkService_methodThrow_FinalResponse';
  }

  public function clearTerseFields()[write_props]: void {
  }

  public static function getStructMetadata()[]: \tmeta_ThriftStruct {
    return tmeta_ThriftStruct::fromShape(
      shape(
        "name" => "module.SinkService_methodThrow_FinalResponse",
        "fields" => vec[
          tmeta_ThriftField::fromShape(
            shape(
              "id" => 0,
              "type" => tmeta_ThriftType::fromShape(
                shape(
                  "t_struct" => tmeta_ThriftStructType::fromShape(
                    shape(
                      "name" => "module.FinalResponse",
                    )
                  ),
                )
              ),
              "name" => "success",
            )
          ),
        ],
        "is_union" => false,
      )
    );
  }

  public static function getAllStructuredAnnotations()[write_props]: \TStructAnnotations {
    return shape(
      'struct' => dict[],
      'fields' => dict[
      ],
    );
  }

  public function getInstanceKey()[write_props]: string {
    return \TCompactSerializer::serialize($this);
  }

}

class SinkService_methodSinkThrow_args implements \IThriftSyncStruct, \IThriftStructMetadata {
  use \ThriftSerializationTrait;

  const \ThriftStructTypes::TSpec SPEC = dict[
  ];
  const dict<string, int> FIELDMAP = dict[
  ];

  const type TConstructorShape = shape(
  );

  const int STRUCTURAL_ID = 957977401221134810;

  public function __construct()[] {
  }

  public static function withDefaultValues()[]: this {
    return new static();
  }

  public static function fromShape(self::TConstructorShape $shape)[]: this {
    return new static(
    );
  }

  public function getName()[]: string {
    return 'SinkService_methodSinkThrow_args';
  }

  public function clearTerseFields()[write_props]: void {
  }

  public static function getStructMetadata()[]: \tmeta_ThriftStruct {
    return tmeta_ThriftStruct::fromShape(
      shape(
        "name" => "module.methodSinkThrow_args",
        "is_union" => false,
      )
    );
  }

  public static function getAllStructuredAnnotations()[write_props]: \TStructAnnotations {
    return shape(
      'struct' => dict[],
      'fields' => dict[
      ],
    );
  }

  public function getInstanceKey()[write_props]: string {
    return \TCompactSerializer::serialize($this);
  }

}

class SinkService_methodSinkThrow_FirstResponse extends \ThriftSyncStructWithoutResult implements \IThriftStructMetadata {
  use \ThriftSerializationTrait;

  const \ThriftStructTypes::TSpec SPEC = dict[
  ];
  const dict<string, int> FIELDMAP = dict[
  ];

  const type TConstructorShape = shape(
  );

  const int STRUCTURAL_ID = 957977401221134810;

  public function __construct()[] {
  }

  public static function withDefaultValues()[]: this {
    return new static();
  }

  public static function fromShape(self::TConstructorShape $shape)[]: this {
    return new static(
    );
  }

  public function getName()[]: string {
    return 'SinkService_methodSinkThrow_FirstResponse';
  }

  public function clearTerseFields()[write_props]: void {
  }

  public static function getStructMetadata()[]: \tmeta_ThriftStruct {
    return tmeta_ThriftStruct::fromShape(
      shape(
        "name" => "module.SinkService_methodSinkThrow_FirstResponse",
        "is_union" => false,
      )
    );
  }

  public static function getAllStructuredAnnotations()[write_props]: \TStructAnnotations {
    return shape(
      'struct' => dict[],
      'fields' => dict[
      ],
    );
  }

  public function getInstanceKey()[write_props]: string {
    return \TCompactSerializer::serialize($this);
  }

}

class SinkService_methodSinkThrow_SinkPayload extends \ThriftSyncStructWithResult implements \IThriftStructMetadata {
  use \ThriftSerializationTrait;

  const type TResult = SinkPayload;

  const \ThriftStructTypes::TSpec SPEC = dict[
    0 => shape(
      'var' => 'success',
      'type' => \TType::STRUCT,
      'class' => SinkPayload::class,
    ),
    1 => shape(
      'var' => 'ex',
      'type' => \TType::STRUCT,
      'class' => SinkException1::class,
    ),
  ];
  const dict<string, int> FIELDMAP = dict[
    'success' => 0,
    'ex' => 1,
  ];

  const type TConstructorShape = shape(
    ?'success' => ?this::TResult,
    ?'ex' => ?SinkException1,
  );

  const int STRUCTURAL_ID = 8919728181176611439;
  public ?this::TResult $success;
  public ?SinkException1 $ex;

  public function __construct(?this::TResult $success = null, ?SinkException1 $ex = null)[] {
    $this->success = $success;
    $this->ex = $ex;
  }

  public static function withDefaultValues()[]: this {
    return new static();
  }

  public static function fromShape(self::TConstructorShape $shape)[]: this {
    return new static(
      Shapes::idx($shape, 'success'),
      Shapes::idx($shape, 'ex'),
    );
  }

  public function getName()[]: string {
    return 'SinkService_methodSinkThrow_SinkPayload';
  }

  public function clearTerseFields()[write_props]: void {
  }

  public static function getStructMetadata()[]: \tmeta_ThriftStruct {
    return tmeta_ThriftStruct::fromShape(
      shape(
        "name" => "module.SinkService_methodSinkThrow_SinkPayload",
        "fields" => vec[
          tmeta_ThriftField::fromShape(
            shape(
              "id" => 0,
              "type" => tmeta_ThriftType::fromShape(
                shape(
                  "t_struct" => tmeta_ThriftStructType::fromShape(
                    shape(
                      "name" => "module.SinkPayload",
                    )
                  ),
                )
              ),
              "name" => "success",
            )
          ),
          tmeta_ThriftField::fromShape(
            shape(
              "id" => 1,
              "type" => tmeta_ThriftType::fromShape(
                shape(
                  "t_struct" => tmeta_ThriftStructType::fromShape(
                    shape(
                      "name" => "module.SinkException1",
                    )
                  ),
                )
              ),
              "name" => "ex",
            )
          ),
        ],
        "is_union" => false,
      )
    );
  }

  public static function getAllStructuredAnnotations()[write_props]: \TStructAnnotations {
    return shape(
      'struct' => dict[],
      'fields' => dict[
      ],
    );
  }

  public function getInstanceKey()[write_props]: string {
    return \TCompactSerializer::serialize($this);
  }

  public function checkForException(): ?\TException {
    if ($this->ex !== null) {
      return $this->ex;
    }
    return null;
  }
}

class SinkService_methodSinkThrow_FinalResponse extends \ThriftSyncStructWithResult implements \IThriftStructMetadata {
  use \ThriftSerializationTrait;

  const type TResult = FinalResponse;

  const \ThriftStructTypes::TSpec SPEC = dict[
    0 => shape(
      'var' => 'success',
      'type' => \TType::STRUCT,
      'class' => FinalResponse::class,
    ),
  ];
  const dict<string, int> FIELDMAP = dict[
    'success' => 0,
  ];

  const type TConstructorShape = shape(
    ?'success' => ?this::TResult,
  );

  const int STRUCTURAL_ID = 7640464975912492398;
  public ?this::TResult $success;

  public function __construct(?this::TResult $success = null)[] {
    $this->success = $success;
  }

  public static function withDefaultValues()[]: this {
    return new static();
  }

  public static function fromShape(self::TConstructorShape $shape)[]: this {
    return new static(
      Shapes::idx($shape, 'success'),
    );
  }

  public function getName()[]: string {
    return 'SinkService_methodSinkThrow_FinalResponse';
  }

  public function clearTerseFields()[write_props]: void {
  }

  public static function getStructMetadata()[]: \tmeta_ThriftStruct {
    return tmeta_ThriftStruct::fromShape(
      shape(
        "name" => "module.SinkService_methodSinkThrow_FinalResponse",
        "fields" => vec[
          tmeta_ThriftField::fromShape(
            shape(
              "id" => 0,
              "type" => tmeta_ThriftType::fromShape(
                shape(
                  "t_struct" => tmeta_ThriftStructType::fromShape(
                    shape(
                      "name" => "module.FinalResponse",
                    )
                  ),
                )
              ),
              "name" => "success",
            )
          ),
        ],
        "is_union" => false,
      )
    );
  }

  public static function getAllStructuredAnnotations()[write_props]: \TStructAnnotations {
    return shape(
      'struct' => dict[],
      'fields' => dict[
      ],
    );
  }

  public function getInstanceKey()[write_props]: string {
    return \TCompactSerializer::serialize($this);
  }

}

class SinkService_methodFinalThrow_args implements \IThriftSyncStruct, \IThriftStructMetadata {
  use \ThriftSerializationTrait;

  const \ThriftStructTypes::TSpec SPEC = dict[
  ];
  const dict<string, int> FIELDMAP = dict[
  ];

  const type TConstructorShape = shape(
  );

  const int STRUCTURAL_ID = 957977401221134810;

  public function __construct()[] {
  }

  public static function withDefaultValues()[]: this {
    return new static();
  }

  public static function fromShape(self::TConstructorShape $shape)[]: this {
    return new static(
    );
  }

  public function getName()[]: string {
    return 'SinkService_methodFinalThrow_args';
  }

  public function clearTerseFields()[write_props]: void {
  }

  public static function getStructMetadata()[]: \tmeta_ThriftStruct {
    return tmeta_ThriftStruct::fromShape(
      shape(
        "name" => "module.methodFinalThrow_args",
        "is_union" => false,
      )
    );
  }

  public static function getAllStructuredAnnotations()[write_props]: \TStructAnnotations {
    return shape(
      'struct' => dict[],
      'fields' => dict[
      ],
    );
  }

  public function getInstanceKey()[write_props]: string {
    return \TCompactSerializer::serialize($this);
  }

}

class SinkService_methodFinalThrow_FirstResponse extends \ThriftSyncStructWithoutResult implements \IThriftStructMetadata {
  use \ThriftSerializationTrait;

  const \ThriftStructTypes::TSpec SPEC = dict[
  ];
  const dict<string, int> FIELDMAP = dict[
  ];

  const type TConstructorShape = shape(
  );

  const int STRUCTURAL_ID = 957977401221134810;

  public function __construct()[] {
  }

  public static function withDefaultValues()[]: this {
    return new static();
  }

  public static function fromShape(self::TConstructorShape $shape)[]: this {
    return new static(
    );
  }

  public function getName()[]: string {
    return 'SinkService_methodFinalThrow_FirstResponse';
  }

  public function clearTerseFields()[write_props]: void {
  }

  public static function getStructMetadata()[]: \tmeta_ThriftStruct {
    return tmeta_ThriftStruct::fromShape(
      shape(
        "name" => "module.SinkService_methodFinalThrow_FirstResponse",
        "is_union" => false,
      )
    );
  }

  public static function getAllStructuredAnnotations()[write_props]: \TStructAnnotations {
    return shape(
      'struct' => dict[],
      'fields' => dict[
      ],
    );
  }

  public function getInstanceKey()[write_props]: string {
    return \TCompactSerializer::serialize($this);
  }

}

class SinkService_methodFinalThrow_SinkPayload extends \ThriftSyncStructWithResult implements \IThriftStructMetadata {
  use \ThriftSerializationTrait;

  const type TResult = SinkPayload;

  const \ThriftStructTypes::TSpec SPEC = dict[
    0 => shape(
      'var' => 'success',
      'type' => \TType::STRUCT,
      'class' => SinkPayload::class,
    ),
  ];
  const dict<string, int> FIELDMAP = dict[
    'success' => 0,
  ];

  const type TConstructorShape = shape(
    ?'success' => ?this::TResult,
  );

  const int STRUCTURAL_ID = 5047864711357047518;
  public ?this::TResult $success;

  public function __construct(?this::TResult $success = null)[] {
    $this->success = $success;
  }

  public static function withDefaultValues()[]: this {
    return new static();
  }

  public static function fromShape(self::TConstructorShape $shape)[]: this {
    return new static(
      Shapes::idx($shape, 'success'),
    );
  }

  public function getName()[]: string {
    return 'SinkService_methodFinalThrow_SinkPayload';
  }

  public function clearTerseFields()[write_props]: void {
  }

  public static function getStructMetadata()[]: \tmeta_ThriftStruct {
    return tmeta_ThriftStruct::fromShape(
      shape(
        "name" => "module.SinkService_methodFinalThrow_SinkPayload",
        "fields" => vec[
          tmeta_ThriftField::fromShape(
            shape(
              "id" => 0,
              "type" => tmeta_ThriftType::fromShape(
                shape(
                  "t_struct" => tmeta_ThriftStructType::fromShape(
                    shape(
                      "name" => "module.SinkPayload",
                    )
                  ),
                )
              ),
              "name" => "success",
            )
          ),
        ],
        "is_union" => false,
      )
    );
  }

  public static function getAllStructuredAnnotations()[write_props]: \TStructAnnotations {
    return shape(
      'struct' => dict[],
      'fields' => dict[
      ],
    );
  }

  public function getInstanceKey()[write_props]: string {
    return \TCompactSerializer::serialize($this);
  }

}

class SinkService_methodFinalThrow_FinalResponse extends \ThriftSyncStructWithResult implements \IThriftStructMetadata {
  use \ThriftSerializationTrait;

  const type TResult = FinalResponse;

  const \ThriftStructTypes::TSpec SPEC = dict[
    0 => shape(
      'var' => 'success',
      'type' => \TType::STRUCT,
      'class' => FinalResponse::class,
    ),
    1 => shape(
      'var' => 'ex',
      'type' => \TType::STRUCT,
      'class' => SinkException2::class,
    ),
  ];
  const dict<string, int> FIELDMAP = dict[
    'success' => 0,
    'ex' => 1,
  ];

  const type TConstructorShape = shape(
    ?'success' => ?this::TResult,
    ?'ex' => ?SinkException2,
  );

  const int STRUCTURAL_ID = 1352924921392902231;
  public ?this::TResult $success;
  public ?SinkException2 $ex;

  public function __construct(?this::TResult $success = null, ?SinkException2 $ex = null)[] {
    $this->success = $success;
    $this->ex = $ex;
  }

  public static function withDefaultValues()[]: this {
    return new static();
  }

  public static function fromShape(self::TConstructorShape $shape)[]: this {
    return new static(
      Shapes::idx($shape, 'success'),
      Shapes::idx($shape, 'ex'),
    );
  }

  public function getName()[]: string {
    return 'SinkService_methodFinalThrow_FinalResponse';
  }

  public function clearTerseFields()[write_props]: void {
  }

  public static function getStructMetadata()[]: \tmeta_ThriftStruct {
    return tmeta_ThriftStruct::fromShape(
      shape(
        "name" => "module.SinkService_methodFinalThrow_FinalResponse",
        "fields" => vec[
          tmeta_ThriftField::fromShape(
            shape(
              "id" => 0,
              "type" => tmeta_ThriftType::fromShape(
                shape(
                  "t_struct" => tmeta_ThriftStructType::fromShape(
                    shape(
                      "name" => "module.FinalResponse",
                    )
                  ),
                )
              ),
              "name" => "success",
            )
          ),
          tmeta_ThriftField::fromShape(
            shape(
              "id" => 1,
              "type" => tmeta_ThriftType::fromShape(
                shape(
                  "t_struct" => tmeta_ThriftStructType::fromShape(
                    shape(
                      "name" => "module.SinkException2",
                    )
                  ),
                )
              ),
              "name" => "ex",
            )
          ),
        ],
        "is_union" => false,
      )
    );
  }

  public static function getAllStructuredAnnotations()[write_props]: \TStructAnnotations {
    return shape(
      'struct' => dict[],
      'fields' => dict[
      ],
    );
  }

  public function getInstanceKey()[write_props]: string {
    return \TCompactSerializer::serialize($this);
  }

  public function checkForException(): ?\TException {
    if ($this->ex !== null) {
      return $this->ex;
    }
    return null;
  }
}

class SinkService_methodBothThrow_args implements \IThriftSyncStruct, \IThriftStructMetadata {
  use \ThriftSerializationTrait;

  const \ThriftStructTypes::TSpec SPEC = dict[
  ];
  const dict<string, int> FIELDMAP = dict[
  ];

  const type TConstructorShape = shape(
  );

  const int STRUCTURAL_ID = 957977401221134810;

  public function __construct()[] {
  }

  public static function withDefaultValues()[]: this {
    return new static();
  }

  public static function fromShape(self::TConstructorShape $shape)[]: this {
    return new static(
    );
  }

  public function getName()[]: string {
    return 'SinkService_methodBothThrow_args';
  }

  public function clearTerseFields()[write_props]: void {
  }

  public static function getStructMetadata()[]: \tmeta_ThriftStruct {
    return tmeta_ThriftStruct::fromShape(
      shape(
        "name" => "module.methodBothThrow_args",
        "is_union" => false,
      )
    );
  }

  public static function getAllStructuredAnnotations()[write_props]: \TStructAnnotations {
    return shape(
      'struct' => dict[],
      'fields' => dict[
      ],
    );
  }

  public function getInstanceKey()[write_props]: string {
    return \TCompactSerializer::serialize($this);
  }

}

class SinkService_methodBothThrow_FirstResponse extends \ThriftSyncStructWithoutResult implements \IThriftStructMetadata {
  use \ThriftSerializationTrait;

  const \ThriftStructTypes::TSpec SPEC = dict[
  ];
  const dict<string, int> FIELDMAP = dict[
  ];

  const type TConstructorShape = shape(
  );

  const int STRUCTURAL_ID = 957977401221134810;

  public function __construct()[] {
  }

  public static function withDefaultValues()[]: this {
    return new static();
  }

  public static function fromShape(self::TConstructorShape $shape)[]: this {
    return new static(
    );
  }

  public function getName()[]: string {
    return 'SinkService_methodBothThrow_FirstResponse';
  }

  public function clearTerseFields()[write_props]: void {
  }

  public static function getStructMetadata()[]: \tmeta_ThriftStruct {
    return tmeta_ThriftStruct::fromShape(
      shape(
        "name" => "module.SinkService_methodBothThrow_FirstResponse",
        "is_union" => false,
      )
    );
  }

  public static function getAllStructuredAnnotations()[write_props]: \TStructAnnotations {
    return shape(
      'struct' => dict[],
      'fields' => dict[
      ],
    );
  }

  public function getInstanceKey()[write_props]: string {
    return \TCompactSerializer::serialize($this);
  }

}

class SinkService_methodBothThrow_SinkPayload extends \ThriftSyncStructWithResult implements \IThriftStructMetadata {
  use \ThriftSerializationTrait;

  const type TResult = SinkPayload;

  const \ThriftStructTypes::TSpec SPEC = dict[
    0 => shape(
      'var' => 'success',
      'type' => \TType::STRUCT,
      'class' => SinkPayload::class,
    ),
    1 => shape(
      'var' => 'ex',
      'type' => \TType::STRUCT,
      'class' => SinkException1::class,
    ),
  ];
  const dict<string, int> FIELDMAP = dict[
    'success' => 0,
    'ex' => 1,
  ];

  const type TConstructorShape = shape(
    ?'success' => ?this::TResult,
    ?'ex' => ?SinkException1,
  );

  const int STRUCTURAL_ID = 8919728181176611439;
  public ?this::TResult $success;
  public ?SinkException1 $ex;

  public function __construct(?this::TResult $success = null, ?SinkException1 $ex = null)[] {
    $this->success = $success;
    $this->ex = $ex;
  }

  public static function withDefaultValues()[]: this {
    return new static();
  }

  public static function fromShape(self::TConstructorShape $shape)[]: this {
    return new static(
      Shapes::idx($shape, 'success'),
      Shapes::idx($shape, 'ex'),
    );
  }

  public function getName()[]: string {
    return 'SinkService_methodBothThrow_SinkPayload';
  }

  public function clearTerseFields()[write_props]: void {
  }

  public static function getStructMetadata()[]: \tmeta_ThriftStruct {
    return tmeta_ThriftStruct::fromShape(
      shape(
        "name" => "module.SinkService_methodBothThrow_SinkPayload",
        "fields" => vec[
          tmeta_ThriftField::fromShape(
            shape(
              "id" => 0,
              "type" => tmeta_ThriftType::fromShape(
                shape(
                  "t_struct" => tmeta_ThriftStructType::fromShape(
                    shape(
                      "name" => "module.SinkPayload",
                    )
                  ),
                )
              ),
              "name" => "success",
            )
          ),
          tmeta_ThriftField::fromShape(
            shape(
              "id" => 1,
              "type" => tmeta_ThriftType::fromShape(
                shape(
                  "t_struct" => tmeta_ThriftStructType::fromShape(
                    shape(
                      "name" => "module.SinkException1",
                    )
                  ),
                )
              ),
              "name" => "ex",
            )
          ),
        ],
        "is_union" => false,
      )
    );
  }

  public static function getAllStructuredAnnotations()[write_props]: \TStructAnnotations {
    return shape(
      'struct' => dict[],
      'fields' => dict[
      ],
    );
  }

  public function getInstanceKey()[write_props]: string {
    return \TCompactSerializer::serialize($this);
  }

  public function checkForException(): ?\TException {
    if ($this->ex !== null) {
      return $this->ex;
    }
    return null;
  }
}

class SinkService_methodBothThrow_FinalResponse extends \ThriftSyncStructWithResult implements \IThriftStructMetadata {
  use \ThriftSerializationTrait;

  const type TResult = FinalResponse;

  const \ThriftStructTypes::TSpec SPEC = dict[
    0 => shape(
      'var' => 'success',
      'type' => \TType::STRUCT,
      'class' => FinalResponse::class,
    ),
    1 => shape(
      'var' => 'ex',
      'type' => \TType::STRUCT,
      'class' => SinkException2::class,
    ),
  ];
  const dict<string, int> FIELDMAP = dict[
    'success' => 0,
    'ex' => 1,
  ];

  const type TConstructorShape = shape(
    ?'success' => ?this::TResult,
    ?'ex' => ?SinkException2,
  );

  const int STRUCTURAL_ID = 1352924921392902231;
  public ?this::TResult $success;
  public ?SinkException2 $ex;

  public function __construct(?this::TResult $success = null, ?SinkException2 $ex = null)[] {
    $this->success = $success;
    $this->ex = $ex;
  }

  public static function withDefaultValues()[]: this {
    return new static();
  }

  public static function fromShape(self::TConstructorShape $shape)[]: this {
    return new static(
      Shapes::idx($shape, 'success'),
      Shapes::idx($shape, 'ex'),
    );
  }

  public function getName()[]: string {
    return 'SinkService_methodBothThrow_FinalResponse';
  }

  public function clearTerseFields()[write_props]: void {
  }

  public static function getStructMetadata()[]: \tmeta_ThriftStruct {
    return tmeta_ThriftStruct::fromShape(
      shape(
        "name" => "module.SinkService_methodBothThrow_FinalResponse",
        "fields" => vec[
          tmeta_ThriftField::fromShape(
            shape(
              "id" => 0,
              "type" => tmeta_ThriftType::fromShape(
                shape(
                  "t_struct" => tmeta_ThriftStructType::fromShape(
                    shape(
                      "name" => "module.FinalResponse",
                    )
                  ),
                )
              ),
              "name" => "success",
            )
          ),
          tmeta_ThriftField::fromShape(
            shape(
              "id" => 1,
              "type" => tmeta_ThriftType::fromShape(
                shape(
                  "t_struct" => tmeta_ThriftStructType::fromShape(
                    shape(
                      "name" => "module.SinkException2",
                    )
                  ),
                )
              ),
              "name" => "ex",
            )
          ),
        ],
        "is_union" => false,
      )
    );
  }

  public static function getAllStructuredAnnotations()[write_props]: \TStructAnnotations {
    return shape(
      'struct' => dict[],
      'fields' => dict[
      ],
    );
  }

  public function getInstanceKey()[write_props]: string {
    return \TCompactSerializer::serialize($this);
  }

  public function checkForException(): ?\TException {
    if ($this->ex !== null) {
      return $this->ex;
    }
    return null;
  }
}

class SinkService_methodFast_args implements \IThriftSyncStruct, \IThriftStructMetadata {
  use \ThriftSerializationTrait;

  const \ThriftStructTypes::TSpec SPEC = dict[
  ];
  const dict<string, int> FIELDMAP = dict[
  ];

  const type TConstructorShape = shape(
  );

  const int STRUCTURAL_ID = 957977401221134810;

  public function __construct()[] {
  }

  public static function withDefaultValues()[]: this {
    return new static();
  }

  public static function fromShape(self::TConstructorShape $shape)[]: this {
    return new static(
    );
  }

  public function getName()[]: string {
    return 'SinkService_methodFast_args';
  }

  public function clearTerseFields()[write_props]: void {
  }

  public static function getStructMetadata()[]: \tmeta_ThriftStruct {
    return tmeta_ThriftStruct::fromShape(
      shape(
        "name" => "module.methodFast_args",
        "is_union" => false,
      )
    );
  }

  public static function getAllStructuredAnnotations()[write_props]: \TStructAnnotations {
    return shape(
      'struct' => dict[],
      'fields' => dict[
      ],
    );
  }

  public function getInstanceKey()[write_props]: string {
    return \TCompactSerializer::serialize($this);
  }

}

class SinkService_methodFast_FirstResponse extends \ThriftSyncStructWithoutResult implements \IThriftStructMetadata {
  use \ThriftSerializationTrait;

  const \ThriftStructTypes::TSpec SPEC = dict[
  ];
  const dict<string, int> FIELDMAP = dict[
  ];

  const type TConstructorShape = shape(
  );

  const int STRUCTURAL_ID = 957977401221134810;

  public function __construct()[] {
  }

  public static function withDefaultValues()[]: this {
    return new static();
  }

  public static function fromShape(self::TConstructorShape $shape)[]: this {
    return new static(
    );
  }

  public function getName()[]: string {
    return 'SinkService_methodFast_FirstResponse';
  }

  public function clearTerseFields()[write_props]: void {
  }

  public static function getStructMetadata()[]: \tmeta_ThriftStruct {
    return tmeta_ThriftStruct::fromShape(
      shape(
        "name" => "module.SinkService_methodFast_FirstResponse",
        "is_union" => false,
      )
    );
  }

  public static function getAllStructuredAnnotations()[write_props]: \TStructAnnotations {
    return shape(
      'struct' => dict[],
      'fields' => dict[
      ],
    );
  }

  public function getInstanceKey()[write_props]: string {
    return \TCompactSerializer::serialize($this);
  }

}

class SinkService_methodFast_SinkPayload extends \ThriftSyncStructWithResult implements \IThriftStructMetadata {
  use \ThriftSerializationTrait;

  const type TResult = SinkPayload;

  const \ThriftStructTypes::TSpec SPEC = dict[
    0 => shape(
      'var' => 'success',
      'type' => \TType::STRUCT,
      'class' => SinkPayload::class,
    ),
  ];
  const dict<string, int> FIELDMAP = dict[
    'success' => 0,
  ];

  const type TConstructorShape = shape(
    ?'success' => ?this::TResult,
  );

  const int STRUCTURAL_ID = 5047864711357047518;
  public ?this::TResult $success;

  public function __construct(?this::TResult $success = null)[] {
    $this->success = $success;
  }

  public static function withDefaultValues()[]: this {
    return new static();
  }

  public static function fromShape(self::TConstructorShape $shape)[]: this {
    return new static(
      Shapes::idx($shape, 'success'),
    );
  }

  public function getName()[]: string {
    return 'SinkService_methodFast_SinkPayload';
  }

  public function clearTerseFields()[write_props]: void {
  }

  public static function getStructMetadata()[]: \tmeta_ThriftStruct {
    return tmeta_ThriftStruct::fromShape(
      shape(
        "name" => "module.SinkService_methodFast_SinkPayload",
        "fields" => vec[
          tmeta_ThriftField::fromShape(
            shape(
              "id" => 0,
              "type" => tmeta_ThriftType::fromShape(
                shape(
                  "t_struct" => tmeta_ThriftStructType::fromShape(
                    shape(
                      "name" => "module.SinkPayload",
                    )
                  ),
                )
              ),
              "name" => "success",
            )
          ),
        ],
        "is_union" => false,
      )
    );
  }

  public static function getAllStructuredAnnotations()[write_props]: \TStructAnnotations {
    return shape(
      'struct' => dict[],
      'fields' => dict[
      ],
    );
  }

  public function getInstanceKey()[write_props]: string {
    return \TCompactSerializer::serialize($this);
  }

}

class SinkService_methodFast_FinalResponse extends \ThriftSyncStructWithResult implements \IThriftStructMetadata {
  use \ThriftSerializationTrait;

  const type TResult = FinalResponse;

  const \ThriftStructTypes::TSpec SPEC = dict[
    0 => shape(
      'var' => 'success',
      'type' => \TType::STRUCT,
      'class' => FinalResponse::class,
    ),
  ];
  const dict<string, int> FIELDMAP = dict[
    'success' => 0,
  ];

  const type TConstructorShape = shape(
    ?'success' => ?this::TResult,
  );

  const int STRUCTURAL_ID = 7640464975912492398;
  public ?this::TResult $success;

  public function __construct(?this::TResult $success = null)[] {
    $this->success = $success;
  }

  public static function withDefaultValues()[]: this {
    return new static();
  }

  public static function fromShape(self::TConstructorShape $shape)[]: this {
    return new static(
      Shapes::idx($shape, 'success'),
    );
  }

  public function getName()[]: string {
    return 'SinkService_methodFast_FinalResponse';
  }

  public function clearTerseFields()[write_props]: void {
  }

  public static function getStructMetadata()[]: \tmeta_ThriftStruct {
    return tmeta_ThriftStruct::fromShape(
      shape(
        "name" => "module.SinkService_methodFast_FinalResponse",
        "fields" => vec[
          tmeta_ThriftField::fromShape(
            shape(
              "id" => 0,
              "type" => tmeta_ThriftType::fromShape(
                shape(
                  "t_struct" => tmeta_ThriftStructType::fromShape(
                    shape(
                      "name" => "module.FinalResponse",
                    )
                  ),
                )
              ),
              "name" => "success",
            )
          ),
        ],
        "is_union" => false,
      )
    );
  }

  public static function getAllStructuredAnnotations()[write_props]: \TStructAnnotations {
    return shape(
      'struct' => dict[],
      'fields' => dict[
      ],
    );
  }

  public function getInstanceKey()[write_props]: string {
    return \TCompactSerializer::serialize($this);
  }

}

class SinkServiceStaticMetadata implements \IThriftServiceStaticMetadata {
  public static function getServiceMetadata()[]: \tmeta_ThriftService {
    return tmeta_ThriftService::fromShape(
      shape(
        "name" => "module.SinkService",
        "functions" => vec[
          tmeta_ThriftFunction::fromShape(
            shape(
              "name" => "method",
              "return_type" => tmeta_ThriftType::fromShape(
                shape(
                  "t_sink" => tmeta_ThriftSinkType::fromShape(
                    shape(
                      "elemType" => tmeta_ThriftType::fromShape(
                        shape(
                          "t_struct" => tmeta_ThriftStructType::fromShape(
                            shape(
                              "name" => "module.SinkPayload",
                            )
                          ),
                        )
                      ),
                      "finalResponseType" => tmeta_ThriftType::fromShape(
                        shape(
                          "t_struct" => tmeta_ThriftStructType::fromShape(
                            shape(
                              "name" => "module.FinalResponse",
                            )
                          ),
                        )
                      ),
                      "initialResponseType" => tmeta_ThriftType::fromShape(
                        shape(
                          "t_primitive" => tmeta_ThriftPrimitiveType::THRIFT_VOID_TYPE,
                        )
                      ),
                    )
                  ),
                )
              ),
            )
          ),
          tmeta_ThriftFunction::fromShape(
            shape(
              "name" => "methodAndReponse",
              "return_type" => tmeta_ThriftType::fromShape(
                shape(
                  "t_sink" => tmeta_ThriftSinkType::fromShape(
                    shape(
                      "elemType" => tmeta_ThriftType::fromShape(
                        shape(
                          "t_struct" => tmeta_ThriftStructType::fromShape(
                            shape(
                              "name" => "module.SinkPayload",
                            )
                          ),
                        )
                      ),
                      "finalResponseType" => tmeta_ThriftType::fromShape(
                        shape(
                          "t_struct" => tmeta_ThriftStructType::fromShape(
                            shape(
                              "name" => "module.FinalResponse",
                            )
                          ),
                        )
                      ),
                      "initialResponseType" => tmeta_ThriftType::fromShape(
                        shape(
                          "t_struct" => tmeta_ThriftStructType::fromShape(
                            shape(
                              "name" => "module.InitialResponse",
                            )
                          ),
                        )
                      ),
                    )
                  ),
                )
              ),
            )
          ),
          tmeta_ThriftFunction::fromShape(
            shape(
              "name" => "methodThrow",
              "return_type" => tmeta_ThriftType::fromShape(
                shape(
                  "t_sink" => tmeta_ThriftSinkType::fromShape(
                    shape(
                      "elemType" => tmeta_ThriftType::fromShape(
                        shape(
                          "t_struct" => tmeta_ThriftStructType::fromShape(
                            shape(
                              "name" => "module.SinkPayload",
                            )
                          ),
                        )
                      ),
                      "finalResponseType" => tmeta_ThriftType::fromShape(
                        shape(
                          "t_struct" => tmeta_ThriftStructType::fromShape(
                            shape(
                              "name" => "module.FinalResponse",
                            )
                          ),
                        )
                      ),
                      "initialResponseType" => tmeta_ThriftType::fromShape(
                        shape(
                          "t_primitive" => tmeta_ThriftPrimitiveType::THRIFT_VOID_TYPE,
                        )
                      ),
                    )
                  ),
                )
              ),
              "exceptions" => vec[
                tmeta_ThriftField::fromShape(
                  shape(
                    "id" => 1,
                    "type" => tmeta_ThriftType::fromShape(
                      shape(
                        "t_struct" => tmeta_ThriftStructType::fromShape(
                          shape(
                            "name" => "module.InitialException",
                          )
                        ),
                      )
                    ),
                    "name" => "ex",
                  )
                ),
              ],
            )
          ),
          tmeta_ThriftFunction::fromShape(
            shape(
              "name" => "methodSinkThrow",
              "return_type" => tmeta_ThriftType::fromShape(
                shape(
                  "t_sink" => tmeta_ThriftSinkType::fromShape(
                    shape(
                      "elemType" => tmeta_ThriftType::fromShape(
                        shape(
                          "t_struct" => tmeta_ThriftStructType::fromShape(
                            shape(
                              "name" => "module.SinkPayload",
                            )
                          ),
                        )
                      ),
                      "finalResponseType" => tmeta_ThriftType::fromShape(
                        shape(
                          "t_struct" => tmeta_ThriftStructType::fromShape(
                            shape(
                              "name" => "module.FinalResponse",
                            )
                          ),
                        )
                      ),
                      "initialResponseType" => tmeta_ThriftType::fromShape(
                        shape(
                          "t_primitive" => tmeta_ThriftPrimitiveType::THRIFT_VOID_TYPE,
                        )
                      ),
                    )
                  ),
                )
              ),
            )
          ),
          tmeta_ThriftFunction::fromShape(
            shape(
              "name" => "methodFinalThrow",
              "return_type" => tmeta_ThriftType::fromShape(
                shape(
                  "t_sink" => tmeta_ThriftSinkType::fromShape(
                    shape(
                      "elemType" => tmeta_ThriftType::fromShape(
                        shape(
                          "t_struct" => tmeta_ThriftStructType::fromShape(
                            shape(
                              "name" => "module.SinkPayload",
                            )
                          ),
                        )
                      ),
                      "finalResponseType" => tmeta_ThriftType::fromShape(
                        shape(
                          "t_struct" => tmeta_ThriftStructType::fromShape(
                            shape(
                              "name" => "module.FinalResponse",
                            )
                          ),
                        )
                      ),
                      "initialResponseType" => tmeta_ThriftType::fromShape(
                        shape(
                          "t_primitive" => tmeta_ThriftPrimitiveType::THRIFT_VOID_TYPE,
                        )
                      ),
                    )
                  ),
                )
              ),
            )
          ),
          tmeta_ThriftFunction::fromShape(
            shape(
              "name" => "methodBothThrow",
              "return_type" => tmeta_ThriftType::fromShape(
                shape(
                  "t_sink" => tmeta_ThriftSinkType::fromShape(
                    shape(
                      "elemType" => tmeta_ThriftType::fromShape(
                        shape(
                          "t_struct" => tmeta_ThriftStructType::fromShape(
                            shape(
                              "name" => "module.SinkPayload",
                            )
                          ),
                        )
                      ),
                      "finalResponseType" => tmeta_ThriftType::fromShape(
                        shape(
                          "t_struct" => tmeta_ThriftStructType::fromShape(
                            shape(
                              "name" => "module.FinalResponse",
                            )
                          ),
                        )
                      ),
                      "initialResponseType" => tmeta_ThriftType::fromShape(
                        shape(
                          "t_primitive" => tmeta_ThriftPrimitiveType::THRIFT_VOID_TYPE,
                        )
                      ),
                    )
                  ),
                )
              ),
            )
          ),
          tmeta_ThriftFunction::fromShape(
            shape(
              "name" => "methodFast",
              "return_type" => tmeta_ThriftType::fromShape(
                shape(
                  "t_sink" => tmeta_ThriftSinkType::fromShape(
                    shape(
                      "elemType" => tmeta_ThriftType::fromShape(
                        shape(
                          "t_struct" => tmeta_ThriftStructType::fromShape(
                            shape(
                              "name" => "module.SinkPayload",
                            )
                          ),
                        )
                      ),
                      "finalResponseType" => tmeta_ThriftType::fromShape(
                        shape(
                          "t_struct" => tmeta_ThriftStructType::fromShape(
                            shape(
                              "name" => "module.FinalResponse",
                            )
                          ),
                        )
                      ),
                      "initialResponseType" => tmeta_ThriftType::fromShape(
                        shape(
                          "t_primitive" => tmeta_ThriftPrimitiveType::THRIFT_VOID_TYPE,
                        )
                      ),
                    )
                  ),
                )
              ),
            )
          ),
        ],
      )
    );
  }

  public static function getServiceMetadataResponse()[]: \tmeta_ThriftServiceMetadataResponse {
    return \tmeta_ThriftServiceMetadataResponse::fromShape(
      shape(
        'context' => \tmeta_ThriftServiceContext::fromShape(
          shape(
            'service_info' => self::getServiceMetadata(),
            'module' => \tmeta_ThriftModuleContext::fromShape(
              shape(
                'name' => 'module',
              )
            ),
          )
        ),
        'metadata' => \tmeta_ThriftMetadata::fromShape(
          shape(
            'enums' => dict[
            ],
            'structs' => dict[
              'module.SinkPayload' => SinkPayload::getStructMetadata(),
              'module.FinalResponse' => FinalResponse::getStructMetadata(),
              'module.InitialResponse' => InitialResponse::getStructMetadata(),
            ],
            'exceptions' => dict[
              'module.InitialException' => InitialException::getExceptionMetadata(),
            ],
            'services' => dict[
            ],
          )
        ),
      )
    );
  }

  public static function getAllStructuredAnnotations()[write_props]: \TServiceAnnotations {
    return shape(
      'service' => dict[],
      'functions' => dict[
      ],
    );
  }
}


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

/**
 * Original thrift struct:-
 * Foo
 */
class Foo implements \IThriftSyncStruct, \IThriftStructMetadata {
  use \ThriftSerializationTrait;

  const \ThriftStructTypes::TSpec SPEC = dict[
    1 => shape(
      'var' => 'a',
      'type' => \TType::I64,
    ),
    2 => shape(
      'var' => 'b',
      'type' => \TType::STRING,
    ),
  ];
  const dict<string, int> FIELDMAP = dict[
    'a' => 1,
    'b' => 2,
  ];

  const type TConstructorShape = shape(
    ?'a' => ?int,
    ?'b' => ?string,
  );

  const int STRUCTURAL_ID = 5526046231048010857;
  /**
   * Original thrift field:-
   * 1: i64 a
   */
  public int $a;
  /**
   * Original thrift field:-
   * 2: string b
   */
  public string $b;

  public function __construct(?int $a = null, ?string $b = null)[] {
    $this->a = $a ?? 0;
    $this->b = $b ?? '';
  }

  public static function withDefaultValues()[]: this {
    return new static();
  }

  public static function fromShape(self::TConstructorShape $shape)[]: this {
    return new static(
      Shapes::idx($shape, 'a'),
      Shapes::idx($shape, 'b'),
    );
  }

  public static function fromMap_DEPRECATED(<<__Soft>> KeyedContainer<string, mixed> $map)[]: this {
    return new static(
      HH\FIXME\UNSAFE_CAST<mixed, int>(idx($map, 'a'), 'map value is mixed'),
      HH\FIXME\UNSAFE_CAST<mixed, string>(idx($map, 'b'), 'map value is mixed'),
    );
  }

  public function getName()[]: string {
    return 'Foo';
  }

  public function clearTerseFields()[write_props]: void {
  }

  public static function getStructMetadata()[]: \tmeta_ThriftStruct {
    return tmeta_ThriftStruct::fromShape(
      shape(
        "name" => "module.Foo",
        "fields" => vec[
          tmeta_ThriftField::fromShape(
            shape(
              "id" => 1,
              "type" => tmeta_ThriftType::fromShape(
                shape(
                  "t_primitive" => tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,
                )
              ),
              "name" => "a",
            )
          ),
          tmeta_ThriftField::fromShape(
            shape(
              "id" => 2,
              "type" => tmeta_ThriftType::fromShape(
                shape(
                  "t_primitive" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,
                )
              ),
              "name" => "b",
            )
          ),
        ],
        "is_union" => false,
      )
    );
  }

  public static function getAllStructuredAnnotations()[write_props]: \TStructAnnotations {
    return shape(
      'struct' => dict[],
      'fields' => dict[
      ],
    );
  }

  public function getInstanceKey()[write_props]: string {
    return \TCompactSerializer::serialize($this);
  }

}


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

/**
 * Original thrift exception:-
 * FooStreamEx
 */
class FooStreamEx extends \TException implements \IThriftSyncStruct, \IThriftExceptionMetadata {
  use \ThriftSerializationTrait;

  const \ThriftStructTypes::TSpec SPEC = dict[
  ];
  const dict<string, int> FIELDMAP = dict[
  ];

  const type TConstructorShape = shape(
  );

  const int STRUCTURAL_ID = 957977401221134810;

  public function __construct()[] {
    parent::__construct();
  }

  public static function withDefaultValues()[]: this {
    return new static();
  }

  public static function fromShape(self::TConstructorShape $shape)[]: this {
    return new static(
    );
  }

  public function getName()[]: string {
    return 'FooStreamEx';
  }

  public function clearTerseFields()[write_props]: void {
  }

  public static function getExceptionMetadata()[]: \tmeta_ThriftException {
    return tmeta_ThriftException::fromShape(
      shape(
        "name" => "module.FooStreamEx",
      )
    );
  }

  public static function getAllStructuredAnnotations()[write_props]: \TStructAnnotations {
    return shape(
      'struct' => dict[],
      'fields' => dict[
      ],
    );
  }

  public function getInstanceKey()[write_props]: string {
    return \TCompactSerializer::serialize($this);
  }

}

/**
 * Original thrift exception:-
 * FooEx
 */
class FooEx extends \TException implements \IThriftSyncStruct, \IThriftExceptionMetadata {
  use \ThriftSerializationTrait;

  const \ThriftStructTypes::TSpec SPEC = dict[
  ];
  const dict<string, int> FIELDMAP = dict[
  ];

  const type TConstructorShape = shape(
  );

  const int STRUCTURAL_ID = 957977401221134810;

  public function __construct()[] {
    parent::__construct();
  }

  public static function withDefaultValues()[]: this {
    return new static();
  }

  public static function fromShape(self::TConstructorShape $shape)[]: this {
    return new static(
    );
  }

  public function getName()[]: string {
    return 'FooEx';
  }

  public function clearTerseFields()[write_props]: void {
  }

  public static function getExceptionMetadata()[]: \tmeta_ThriftException {
    return tmeta_ThriftException::fromShape(
      shape(
        "name" => "module.FooEx",
      )
    );
  }

  public static function getAllStructuredAnnotations()[write_props]: \TStructAnnotations {
    return shape(
      'struct' => dict[],
      'fields' => dict[
      ],
    );
  }

  public function getInstanceKey()[write_props]: string {
    return \TCompactSerializer::serialize($this);
  }

}

/**
 * Original thrift exception:-
 * FooEx2
 */
class FooEx2 extends \TException implements \IThriftSyncStruct, \IThriftExceptionMetadata {
  use \ThriftSerializationTrait;

  const \ThriftStructTypes::TSpec SPEC = dict[
  ];
  const dict<string, int> FIELDMAP = dict[
  ];

  const type TConstructorShape = shape(
  );

  const int STRUCTURAL_ID = 957977401221134810;

  public function __construct()[] {
    parent::__construct();
  }

  public static function withDefaultValues()[]: this {
    return new static();
  }

  public static function fromShape(self::TConstructorShape $shape)[]: this {
    return new static(
    );
  }

  public function getName()[]: string {
    return 'FooEx2';
  }

  public function clearTerseFields()[write_props]: void {
  }

  public static function getExceptionMetadata()[]: \tmeta_ThriftException {
    return tmeta_ThriftException::fromShape(
      shape(
        "name" => "module.FooEx2",
      )
    );
  }

  public static function getAllStructuredAnnotations()[write_props]: \TStructAnnotations {
    return shape(
      'struct' => dict[],
      'fields' => dict[
      ],
    );
  }

  public function getInstanceKey()[write_props]: string {
    return \TCompactSerializer::serialize($this);
  }

}