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

/**
 * Original thrift service:-
 * MyService
 */
interface MyServiceAsyncIf extends \IThriftAsyncIf {
  /**
   * Original thrift definition:-
   * void
   *   ping()
   *   throws (1: MyException myExcept);
   */
  public function ping(): Awaitable<void>;

  /**
   * Original thrift definition:-
   * string
   *   getRandomData();
   */
  public function getRandomData(): Awaitable<string>;

  /**
   * Original thrift definition:-
   * bool
   *   hasDataById(1: i64 id);
   */
  public function hasDataById(int $id): Awaitable<bool>;

  /**
   * Original thrift definition:-
   * string
   *   getDataById(1: i64 id);
   */
  public function getDataById(int $id): Awaitable<string>;

  /**
   * Original thrift definition:-
   * void
   *   putDataById(1: i64 id,
   *               2: string data);
   */
  public function putDataById(int $id, string $data): Awaitable<void>;

  /**
   * Original thrift definition:-
   * oneway void
   *   lobDataById(1: i64 id,
   *               2: string data);
   */
  public function lobDataById(int $id, string $data): Awaitable<void>;

  /**
   * Original thrift definition:-
   * void
   *   doNothing();
   */
  public function doNothing(): Awaitable<void>;
}

/**
 * Original thrift service:-
 * MyService
 */
interface MyServiceIf extends \IThriftSyncIf {
  /**
   * Original thrift definition:-
   * void
   *   ping()
   *   throws (1: MyException myExcept);
   */
  public function ping(): void;

  /**
   * Original thrift definition:-
   * string
   *   getRandomData();
   */
  public function getRandomData(): string;

  /**
   * Original thrift definition:-
   * bool
   *   hasDataById(1: i64 id);
   */
  public function hasDataById(int $id): bool;

  /**
   * Original thrift definition:-
   * string
   *   getDataById(1: i64 id);
   */
  public function getDataById(int $id): string;

  /**
   * Original thrift definition:-
   * void
   *   putDataById(1: i64 id,
   *               2: string data);
   */
  public function putDataById(int $id, string $data): void;

  /**
   * Original thrift definition:-
   * oneway void
   *   lobDataById(1: i64 id,
   *               2: string data);
   */
  public function lobDataById(int $id, string $data): void;

  /**
   * Original thrift definition:-
   * void
   *   doNothing();
   */
  public function doNothing(): void;
}

/**
 * Original thrift service:-
 * MyService
 */
interface MyServiceAsyncClientIf extends MyServiceAsyncIf {
}

/**
 * Original thrift service:-
 * MyService
 */
interface MyServiceClientIf extends \IThriftSyncIf {
  /**
   * Original thrift definition:-
   * void
   *   ping()
   *   throws (1: MyException myExcept);
   */
  public function ping(): Awaitable<void>;

  /**
   * Original thrift definition:-
   * string
   *   getRandomData();
   */
  public function getRandomData(): Awaitable<string>;

  /**
   * Original thrift definition:-
   * bool
   *   hasDataById(1: i64 id);
   */
  public function hasDataById(int $id): Awaitable<bool>;

  /**
   * Original thrift definition:-
   * string
   *   getDataById(1: i64 id);
   */
  public function getDataById(int $id): Awaitable<string>;

  /**
   * Original thrift definition:-
   * void
   *   putDataById(1: i64 id,
   *               2: string data);
   */
  public function putDataById(int $id, string $data): Awaitable<void>;

  /**
   * Original thrift definition:-
   * oneway void
   *   lobDataById(1: i64 id,
   *               2: string data);
   */
  public function lobDataById(int $id, string $data): Awaitable<void>;

  /**
   * Original thrift definition:-
   * void
   *   doNothing();
   */
  public function doNothing(): Awaitable<void>;
}

/**
 * Original thrift service:-
 * MyService
 */
trait MyServiceClientBase {
  require extends \ThriftClientBase;

  /**
   * Original thrift definition:-
   * void
   *   ping()
   *   throws (1: MyException myExcept);
   */
  public async function ping(): Awaitable<void> {
    $hh_frame_metadata = $this->getHHFrameMetadata();
    if ($hh_frame_metadata !== null) {
      \HH\set_frame_metadata($hh_frame_metadata);
    }
    $rpc_options = $this->getAndResetOptions() ?? \ThriftClientBase::defaultOptions();
    $args = MyService_ping_args::withDefaultValues();
    await $this->asyncHandler_->genBefore("MyService", "ping", $args);
    $currentseqid = $this->sendImplHelper($args, "ping", false, "MyService" );
    await $this->genAwaitResponse(MyService_ping_result::class, "ping", true, $currentseqid, $rpc_options);
  }

  /**
   * Original thrift definition:-
   * string
   *   getRandomData();
   */
  public async function getRandomData(): Awaitable<string> {
    $hh_frame_metadata = $this->getHHFrameMetadata();
    if ($hh_frame_metadata !== null) {
      \HH\set_frame_metadata($hh_frame_metadata);
    }
    $rpc_options = $this->getAndResetOptions() ?? \ThriftClientBase::defaultOptions();
    $args = MyService_getRandomData_args::withDefaultValues();
    await $this->asyncHandler_->genBefore("MyService", "getRandomData", $args);
    $currentseqid = $this->sendImplHelper($args, "getRandomData", false, "MyService" );
    return await $this->genAwaitResponse(MyService_getRandomData_result::class, "getRandomData", false, $currentseqid, $rpc_options);
  }

  /**
   * Original thrift definition:-
   * bool
   *   hasDataById(1: i64 id);
   */
  public async function hasDataById(int $id): Awaitable<bool> {
    $hh_frame_metadata = $this->getHHFrameMetadata();
    if ($hh_frame_metadata !== null) {
      \HH\set_frame_metadata($hh_frame_metadata);
    }
    $rpc_options = $this->getAndResetOptions() ?? \ThriftClientBase::defaultOptions();
    $args = MyService_hasDataById_args::fromShape(shape(
      'id' => $id,
    ));
    await $this->asyncHandler_->genBefore("MyService", "hasDataById", $args);
    $currentseqid = $this->sendImplHelper($args, "hasDataById", false, "MyService" );
    return await $this->genAwaitResponse(MyService_hasDataById_result::class, "hasDataById", false, $currentseqid, $rpc_options);
  }

  /**
   * Original thrift definition:-
   * string
   *   getDataById(1: i64 id);
   */
  public async function getDataById(int $id): Awaitable<string> {
    $hh_frame_metadata = $this->getHHFrameMetadata();
    if ($hh_frame_metadata !== null) {
      \HH\set_frame_metadata($hh_frame_metadata);
    }
    $rpc_options = $this->getAndResetOptions() ?? \ThriftClientBase::defaultOptions();
    $args = MyService_getDataById_args::fromShape(shape(
      'id' => $id,
    ));
    await $this->asyncHandler_->genBefore("MyService", "getDataById", $args);
    $currentseqid = $this->sendImplHelper($args, "getDataById", false, "MyService" );
    return await $this->genAwaitResponse(MyService_getDataById_result::class, "getDataById", false, $currentseqid, $rpc_options);
  }

  /**
   * Original thrift definition:-
   * void
   *   putDataById(1: i64 id,
   *               2: string data);
   */
  public async function putDataById(int $id, string $data): Awaitable<void> {
    $hh_frame_metadata = $this->getHHFrameMetadata();
    if ($hh_frame_metadata !== null) {
      \HH\set_frame_metadata($hh_frame_metadata);
    }
    $rpc_options = $this->getAndResetOptions() ?? \ThriftClientBase::defaultOptions();
    $args = MyService_putDataById_args::fromShape(shape(
      'id' => $id,
      'data' => $data,
    ));
    await $this->asyncHandler_->genBefore("MyService", "putDataById", $args);
    $currentseqid = $this->sendImplHelper($args, "putDataById", false, "MyService" );
    await $this->genAwaitResponse(MyService_putDataById_result::class, "putDataById", true, $currentseqid, $rpc_options);
  }

  /**
   * Original thrift definition:-
   * oneway void
   *   lobDataById(1: i64 id,
   *               2: string data);
   */
  public async function lobDataById(int $id, string $data): Awaitable<void> {
    $hh_frame_metadata = $this->getHHFrameMetadata();
    if ($hh_frame_metadata !== null) {
      \HH\set_frame_metadata($hh_frame_metadata);
    }
    $rpc_options = $this->getAndResetOptions() ?? \ThriftClientBase::defaultOptions();
    $args = MyService_lobDataById_args::fromShape(shape(
      'id' => $id,
      'data' => $data,
    ));
    await $this->asyncHandler_->genBefore("MyService", "lobDataById", $args);
    $currentseqid = $this->sendImplHelper($args, "lobDataById", true, "MyService" );
    await $this->genAwaitNoResponse($rpc_options);
  }

  /**
   * Original thrift definition:-
   * void
   *   doNothing();
   */
  public async function doNothing(): Awaitable<void> {
    $hh_frame_metadata = $this->getHHFrameMetadata();
    if ($hh_frame_metadata !== null) {
      \HH\set_frame_metadata($hh_frame_metadata);
    }
    $rpc_options = $this->getAndResetOptions() ?? \ThriftClientBase::defaultOptions();
    $args = MyService_doNothing_args::withDefaultValues();
    await $this->asyncHandler_->genBefore("MyService", "doNothing", $args);
    $currentseqid = $this->sendImplHelper($args, "doNothing", false, "MyService" );
    await $this->genAwaitResponse(MyService_doNothing_result::class, "doNothing", true, $currentseqid, $rpc_options);
  }

}

class MyServiceAsyncClient extends \ThriftClientBase implements MyServiceAsyncClientIf {
  use MyServiceClientBase;

}

class MyServiceClient extends \ThriftClientBase implements MyServiceClientIf {
  use MyServiceClientBase;

}

abstract class MyServiceAsyncProcessorBase extends \ThriftAsyncProcessor {
  use \GetThriftServiceMetadata;
  abstract const type TThriftIf as MyServiceAsyncIf;
  const classname<\IThriftServiceStaticMetadata> SERVICE_METADATA_CLASS = MyServiceStaticMetadata::class;
  const string THRIFT_SVC_NAME = 'MyService';

  protected async function process_ping(int $seqid, \TProtocol $input, \TProtocol $output): Awaitable<void> {
    $handler_ctx = $this->eventHandler_->getHandlerContext('ping');
    $reply_type = \TMessageType::REPLY;
    $args = $this->readHelper(MyService_ping_args::class, $input, 'ping', $handler_ctx);
    $result = MyService_ping_result::withDefaultValues();
    try {
      $this->eventHandler_->preExec($handler_ctx, 'MyService', 'ping', $args);
      await $this->handler->ping();
      $this->eventHandler_->postExec($handler_ctx, 'ping', $result);
    } catch (\Exception $ex) {
      if ($result->setException($ex)) {
        $this->eventHandler_->handlerException($handler_ctx, 'ping', $ex);
      } else {
        $reply_type = \TMessageType::EXCEPTION;
        $this->eventHandler_->handlerError($handler_ctx, 'ping', $ex);
        $result = new \TApplicationException($ex->getMessage()."\n".$ex->getTraceAsString());
      }
    }
    $this->writeHelper($result, 'ping', $seqid, $handler_ctx, $output, $reply_type);
  }
  protected async function process_getRandomData(int $seqid, \TProtocol $input, \TProtocol $output): Awaitable<void> {
    $handler_ctx = $this->eventHandler_->getHandlerContext('getRandomData');
    $reply_type = \TMessageType::REPLY;
    $args = $this->readHelper(MyService_getRandomData_args::class, $input, 'getRandomData', $handler_ctx);
    $result = MyService_getRandomData_result::withDefaultValues();
    try {
      $this->eventHandler_->preExec($handler_ctx, 'MyService', 'getRandomData', $args);
      $result->success = await $this->handler->getRandomData();
      $this->eventHandler_->postExec($handler_ctx, 'getRandomData', $result);
    } catch (\Exception $ex) {
      $reply_type = \TMessageType::EXCEPTION;
      $this->eventHandler_->handlerError($handler_ctx, 'getRandomData', $ex);
      $result = new \TApplicationException($ex->getMessage()."\n".$ex->getTraceAsString());
    }
    $this->writeHelper($result, 'getRandomData', $seqid, $handler_ctx, $output, $reply_type);
  }
  protected async function process_hasDataById(int $seqid, \TProtocol $input, \TProtocol $output): Awaitable<void> {
    $handler_ctx = $this->eventHandler_->getHandlerContext('hasDataById');
    $reply_type = \TMessageType::REPLY;
    $args = $this->readHelper(MyService_hasDataById_args::class, $input, 'hasDataById', $handler_ctx);
    $result = MyService_hasDataById_result::withDefaultValues();
    try {
      $this->eventHandler_->preExec($handler_ctx, 'MyService', 'hasDataById', $args);
      $result->success = await $this->handler->hasDataById($args->id);
      $this->eventHandler_->postExec($handler_ctx, 'hasDataById', $result);
    } catch (\Exception $ex) {
      $reply_type = \TMessageType::EXCEPTION;
      $this->eventHandler_->handlerError($handler_ctx, 'hasDataById', $ex);
      $result = new \TApplicationException($ex->getMessage()."\n".$ex->getTraceAsString());
    }
    $this->writeHelper($result, 'hasDataById', $seqid, $handler_ctx, $output, $reply_type);
  }
  protected async function process_getDataById(int $seqid, \TProtocol $input, \TProtocol $output): Awaitable<void> {
    $handler_ctx = $this->eventHandler_->getHandlerContext('getDataById');
    $reply_type = \TMessageType::REPLY;
    $args = $this->readHelper(MyService_getDataById_args::class, $input, 'getDataById', $handler_ctx);
    $result = MyService_getDataById_result::withDefaultValues();
    try {
      $this->eventHandler_->preExec($handler_ctx, 'MyService', 'getDataById', $args);
      $result->success = await $this->handler->getDataById($args->id);
      $this->eventHandler_->postExec($handler_ctx, 'getDataById', $result);
    } catch (\Exception $ex) {
      $reply_type = \TMessageType::EXCEPTION;
      $this->eventHandler_->handlerError($handler_ctx, 'getDataById', $ex);
      $result = new \TApplicationException($ex->getMessage()."\n".$ex->getTraceAsString());
    }
    $this->writeHelper($result, 'getDataById', $seqid, $handler_ctx, $output, $reply_type);
  }
  protected async function process_putDataById(int $seqid, \TProtocol $input, \TProtocol $output): Awaitable<void> {
    $handler_ctx = $this->eventHandler_->getHandlerContext('putDataById');
    $reply_type = \TMessageType::REPLY;
    $args = $this->readHelper(MyService_putDataById_args::class, $input, 'putDataById', $handler_ctx);
    $result = MyService_putDataById_result::withDefaultValues();
    try {
      $this->eventHandler_->preExec($handler_ctx, 'MyService', 'putDataById', $args);
      await $this->handler->putDataById($args->id, $args->data);
      $this->eventHandler_->postExec($handler_ctx, 'putDataById', $result);
    } catch (\Exception $ex) {
      $reply_type = \TMessageType::EXCEPTION;
      $this->eventHandler_->handlerError($handler_ctx, 'putDataById', $ex);
      $result = new \TApplicationException($ex->getMessage()."\n".$ex->getTraceAsString());
    }
    $this->writeHelper($result, 'putDataById', $seqid, $handler_ctx, $output, $reply_type);
  }
  protected async function process_lobDataById(int $seqid, \TProtocol $input, \TProtocol $output): Awaitable<void> {
    $handler_ctx = $this->eventHandler_->getHandlerContext('lobDataById');
    $reply_type = \TMessageType::REPLY;
    $args = $this->readHelper(MyService_lobDataById_args::class, $input, 'lobDataById', $handler_ctx);
    try {
      $this->eventHandler_->preExec($handler_ctx, 'MyService', 'lobDataById', $args);
      await $this->handler->lobDataById($args->id, $args->data);
    } catch (\Exception $ex) {
      $reply_type = \TMessageType::EXCEPTION;
      $this->eventHandler_->handlerError($handler_ctx, 'lobDataById', $ex);
      $result = new \TApplicationException($ex->getMessage()."\n".$ex->getTraceAsString());
    }
    return;
  }
  protected async function process_doNothing(int $seqid, \TProtocol $input, \TProtocol $output): Awaitable<void> {
    $handler_ctx = $this->eventHandler_->getHandlerContext('doNothing');
    $reply_type = \TMessageType::REPLY;
    $args = $this->readHelper(MyService_doNothing_args::class, $input, 'doNothing', $handler_ctx);
    $result = MyService_doNothing_result::withDefaultValues();
    try {
      $this->eventHandler_->preExec($handler_ctx, 'MyService', 'doNothing', $args);
      await $this->handler->doNothing();
      $this->eventHandler_->postExec($handler_ctx, 'doNothing', $result);
    } catch (\Exception $ex) {
      $reply_type = \TMessageType::EXCEPTION;
      $this->eventHandler_->handlerError($handler_ctx, 'doNothing', $ex);
      $result = new \TApplicationException($ex->getMessage()."\n".$ex->getTraceAsString());
    }
    $this->writeHelper($result, 'doNothing', $seqid, $handler_ctx, $output, $reply_type);
  }
  protected async function process_getThriftServiceMetadata(int $seqid, \TProtocol $input, \TProtocol $output): Awaitable<void> {
    $this->process_getThriftServiceMetadataHelper($seqid, $input, $output, MyServiceStaticMetadata::class);
  }
}
class MyServiceAsyncProcessor extends MyServiceAsyncProcessorBase {
  const type TThriftIf = MyServiceAsyncIf;
}

abstract class MyServiceSyncProcessorBase extends \ThriftSyncProcessor {
  use \GetThriftServiceMetadata;
  abstract const type TThriftIf as MyServiceIf;
  const classname<\IThriftServiceStaticMetadata> SERVICE_METADATA_CLASS = MyServiceStaticMetadata::class;
  const string THRIFT_SVC_NAME = 'MyService';

  protected function process_ping(int $seqid, \TProtocol $input, \TProtocol $output): void {
    $handler_ctx = $this->eventHandler_->getHandlerContext('ping');
    $reply_type = \TMessageType::REPLY;
    $args = $this->readHelper(MyService_ping_args::class, $input, 'ping', $handler_ctx);
    $result = MyService_ping_result::withDefaultValues();
    try {
      $this->eventHandler_->preExec($handler_ctx, 'MyService', 'ping', $args);
      $this->handler->ping();
      $this->eventHandler_->postExec($handler_ctx, 'ping', $result);
    } catch (\Exception $ex) {
      if ($result->setException($ex)) {
        $this->eventHandler_->handlerException($handler_ctx, 'ping', $ex);
      } else {
        $reply_type = \TMessageType::EXCEPTION;
        $this->eventHandler_->handlerError($handler_ctx, 'ping', $ex);
        $result = new \TApplicationException($ex->getMessage()."\n".$ex->getTraceAsString());
      }
    }
    $this->writeHelper($result, 'ping', $seqid, $handler_ctx, $output, $reply_type);
  }
  protected function process_getRandomData(int $seqid, \TProtocol $input, \TProtocol $output): void {
    $handler_ctx = $this->eventHandler_->getHandlerContext('getRandomData');
    $reply_type = \TMessageType::REPLY;
    $args = $this->readHelper(MyService_getRandomData_args::class, $input, 'getRandomData', $handler_ctx);
    $result = MyService_getRandomData_result::withDefaultValues();
    try {
      $this->eventHandler_->preExec($handler_ctx, 'MyService', 'getRandomData', $args);
      $result->success = $this->handler->getRandomData();
      $this->eventHandler_->postExec($handler_ctx, 'getRandomData', $result);
    } catch (\Exception $ex) {
      $reply_type = \TMessageType::EXCEPTION;
      $this->eventHandler_->handlerError($handler_ctx, 'getRandomData', $ex);
      $result = new \TApplicationException($ex->getMessage()."\n".$ex->getTraceAsString());
    }
    $this->writeHelper($result, 'getRandomData', $seqid, $handler_ctx, $output, $reply_type);
  }
  protected function process_hasDataById(int $seqid, \TProtocol $input, \TProtocol $output): void {
    $handler_ctx = $this->eventHandler_->getHandlerContext('hasDataById');
    $reply_type = \TMessageType::REPLY;
    $args = $this->readHelper(MyService_hasDataById_args::class, $input, 'hasDataById', $handler_ctx);
    $result = MyService_hasDataById_result::withDefaultValues();
    try {
      $this->eventHandler_->preExec($handler_ctx, 'MyService', 'hasDataById', $args);
      $result->success = $this->handler->hasDataById($args->id);
      $this->eventHandler_->postExec($handler_ctx, 'hasDataById', $result);
    } catch (\Exception $ex) {
      $reply_type = \TMessageType::EXCEPTION;
      $this->eventHandler_->handlerError($handler_ctx, 'hasDataById', $ex);
      $result = new \TApplicationException($ex->getMessage()."\n".$ex->getTraceAsString());
    }
    $this->writeHelper($result, 'hasDataById', $seqid, $handler_ctx, $output, $reply_type);
  }
  protected function process_getDataById(int $seqid, \TProtocol $input, \TProtocol $output): void {
    $handler_ctx = $this->eventHandler_->getHandlerContext('getDataById');
    $reply_type = \TMessageType::REPLY;
    $args = $this->readHelper(MyService_getDataById_args::class, $input, 'getDataById', $handler_ctx);
    $result = MyService_getDataById_result::withDefaultValues();
    try {
      $this->eventHandler_->preExec($handler_ctx, 'MyService', 'getDataById', $args);
      $result->success = $this->handler->getDataById($args->id);
      $this->eventHandler_->postExec($handler_ctx, 'getDataById', $result);
    } catch (\Exception $ex) {
      $reply_type = \TMessageType::EXCEPTION;
      $this->eventHandler_->handlerError($handler_ctx, 'getDataById', $ex);
      $result = new \TApplicationException($ex->getMessage()."\n".$ex->getTraceAsString());
    }
    $this->writeHelper($result, 'getDataById', $seqid, $handler_ctx, $output, $reply_type);
  }
  protected function process_putDataById(int $seqid, \TProtocol $input, \TProtocol $output): void {
    $handler_ctx = $this->eventHandler_->getHandlerContext('putDataById');
    $reply_type = \TMessageType::REPLY;
    $args = $this->readHelper(MyService_putDataById_args::class, $input, 'putDataById', $handler_ctx);
    $result = MyService_putDataById_result::withDefaultValues();
    try {
      $this->eventHandler_->preExec($handler_ctx, 'MyService', 'putDataById', $args);
      $this->handler->putDataById($args->id, $args->data);
      $this->eventHandler_->postExec($handler_ctx, 'putDataById', $result);
    } catch (\Exception $ex) {
      $reply_type = \TMessageType::EXCEPTION;
      $this->eventHandler_->handlerError($handler_ctx, 'putDataById', $ex);
      $result = new \TApplicationException($ex->getMessage()."\n".$ex->getTraceAsString());
    }
    $this->writeHelper($result, 'putDataById', $seqid, $handler_ctx, $output, $reply_type);
  }
  protected function process_lobDataById(int $seqid, \TProtocol $input, \TProtocol $output): void {
    $handler_ctx = $this->eventHandler_->getHandlerContext('lobDataById');
    $reply_type = \TMessageType::REPLY;
    $args = $this->readHelper(MyService_lobDataById_args::class, $input, 'lobDataById', $handler_ctx);
    try {
      $this->eventHandler_->preExec($handler_ctx, 'MyService', 'lobDataById', $args);
      $this->handler->lobDataById($args->id, $args->data);
    } catch (\Exception $ex) {
      $reply_type = \TMessageType::EXCEPTION;
      $this->eventHandler_->handlerError($handler_ctx, 'lobDataById', $ex);
      $result = new \TApplicationException($ex->getMessage()."\n".$ex->getTraceAsString());
    }
    return;
  }
  protected function process_doNothing(int $seqid, \TProtocol $input, \TProtocol $output): void {
    $handler_ctx = $this->eventHandler_->getHandlerContext('doNothing');
    $reply_type = \TMessageType::REPLY;
    $args = $this->readHelper(MyService_doNothing_args::class, $input, 'doNothing', $handler_ctx);
    $result = MyService_doNothing_result::withDefaultValues();
    try {
      $this->eventHandler_->preExec($handler_ctx, 'MyService', 'doNothing', $args);
      $this->handler->doNothing();
      $this->eventHandler_->postExec($handler_ctx, 'doNothing', $result);
    } catch (\Exception $ex) {
      $reply_type = \TMessageType::EXCEPTION;
      $this->eventHandler_->handlerError($handler_ctx, 'doNothing', $ex);
      $result = new \TApplicationException($ex->getMessage()."\n".$ex->getTraceAsString());
    }
    $this->writeHelper($result, 'doNothing', $seqid, $handler_ctx, $output, $reply_type);
  }
  protected function process_getThriftServiceMetadata(int $seqid, \TProtocol $input, \TProtocol $output): void {
    $this->process_getThriftServiceMetadataHelper($seqid, $input, $output, MyServiceStaticMetadata::class);
  }
}
class MyServiceSyncProcessor extends MyServiceSyncProcessorBase {
  const type TThriftIf = MyServiceIf;
}
// For backwards compatibility
class MyServiceProcessor extends MyServiceSyncProcessor {}

// HELPER FUNCTIONS AND STRUCTURES

class MyService_ping_args implements \IThriftSyncStruct, \IThriftStructMetadata, \IThriftShapishSyncStruct {
  use \ThriftSerializationTrait;

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

  const type TConstructorShape = shape(
  );

  const type TShape = 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 'MyService_ping_args';
  }

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

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

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

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

  public function readFromJson(string $jsonText): void {
    $parsed = json_decode($jsonText, true);

    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {
      throw new \TProtocolException("Cannot parse the given json string.");
    }

  }

}

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

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

  const type TConstructorShape = shape(
    ?'myExcept' => ?MyException,
  );

  const int STRUCTURAL_ID = 7189959854181053156;
  public ?MyException $myExcept;

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

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

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

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

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

  public static function getAllStructuredAnnotations()[write_props]: \TStructAnnotations {
    return shape(
      'struct' => dict[],
      'fields' => dict[
        'myExcept' => shape(
          'field' => dict[],
          'type' => dict[
            '\facebook\thrift\annotation\cpp\Name' => \facebook\thrift\annotation\cpp\Name::fromShape(
              shape(
                "value" => "YourException",
              )
            ),
            '\facebook\thrift\annotation\cpp\Adapter' => \facebook\thrift\annotation\cpp\Adapter::fromShape(
              shape(
                "name" => "::StaticCast",
              )
            ),
          ],
        ),
      ],
    );
  }

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

  public function readFromJson(string $jsonText): void {
    $parsed = json_decode($jsonText, true);

    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {
      throw new \TProtocolException("Cannot parse the given json string.");
    }

    if (idx($parsed, 'myExcept') !== null) {
      $_tmp0 = \json_encode(HH\FIXME\UNSAFE_CAST<mixed, MyException>($parsed['myExcept']));
      $_tmp1 = MyException::withDefaultValues();
      $_tmp1->readFromJson($_tmp0);
      $this->myExcept = $_tmp1;
    }
  }

  public function checkForException(): ?\TException {
    if ($this->myExcept !== null) {
      return $this->myExcept;
    }
    return null;
  }
  
  public function setException(\Exception $e): bool {
    if ($e is MyException) {
      $this->myExcept = $e;
      return true;
    }
    return false;
  }
}

class MyService_getRandomData_args implements \IThriftSyncStruct, \IThriftStructMetadata, \IThriftShapishSyncStruct {
  use \ThriftSerializationTrait;

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

  const type TConstructorShape = shape(
  );

  const type TShape = 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 'MyService_getRandomData_args';
  }

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

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

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

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

  public function readFromJson(string $jsonText): void {
    $parsed = json_decode($jsonText, true);

    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {
      throw new \TProtocolException("Cannot parse the given json string.");
    }

  }

}

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

  const type TResult = string;

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

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

  const int STRUCTURAL_ID = 1365128170602685579;
  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 'MyService_getRandomData_result';
  }

  public static function getStructMetadata()[]: \tmeta_ThriftStruct {
    return tmeta_ThriftStruct::fromShape(
      shape(
        "name" => "module.MyService_getRandomData_result",
        "fields" => vec[
          tmeta_ThriftField::fromShape(
            shape(
              "id" => 0,
              "type" => tmeta_ThriftType::fromShape(
                shape(
                  "t_primitive" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,
                )
              ),
              "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);
  }

  public function readFromJson(string $jsonText): void {
    $parsed = json_decode($jsonText, true);

    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {
      throw new \TProtocolException("Cannot parse the given json string.");
    }

    if (idx($parsed, 'success') !== null) {
      $this->success = HH\FIXME\UNSAFE_CAST<mixed, string>($parsed['success']);
    }
  }

}

class MyService_hasDataById_args implements \IThriftSyncStruct, \IThriftStructMetadata, \IThriftShapishSyncStruct {
  use \ThriftSerializationTrait;

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

  const type TConstructorShape = shape(
    ?'id' => ?int,
  );

  const type TShape = shape(
    'id' => int,
    ...
  );
  const int STRUCTURAL_ID = 3807211151619655933;
  public int $id;

  public function __construct(?int $id = null)[] {
    $this->id = $id ?? 0;
  }

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

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

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

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

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

  public static function __fromShape(self::TShape $shape)[]: this {
    return new static(
      $shape['id'],
    );
  }

  public function __toShape()[]: self::TShape {
    return shape(
      'id' => $this->id,
    );
  }
  public function getInstanceKey()[write_props]: string {
    return \TCompactSerializer::serialize($this);
  }

  public function readFromJson(string $jsonText): void {
    $parsed = json_decode($jsonText, true);

    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {
      throw new \TProtocolException("Cannot parse the given json string.");
    }

    if (idx($parsed, 'id') !== null) {
      $this->id = HH\FIXME\UNSAFE_CAST<mixed, int>($parsed['id']);
    }
  }

}

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

  const type TResult = bool;

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

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

  const int STRUCTURAL_ID = 8594383818423018844;
  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 'MyService_hasDataById_result';
  }

  public static function getStructMetadata()[]: \tmeta_ThriftStruct {
    return tmeta_ThriftStruct::fromShape(
      shape(
        "name" => "module.MyService_hasDataById_result",
        "fields" => vec[
          tmeta_ThriftField::fromShape(
            shape(
              "id" => 0,
              "type" => tmeta_ThriftType::fromShape(
                shape(
                  "t_primitive" => tmeta_ThriftPrimitiveType::THRIFT_BOOL_TYPE,
                )
              ),
              "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);
  }

  public function readFromJson(string $jsonText): void {
    $parsed = json_decode($jsonText, true);

    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {
      throw new \TProtocolException("Cannot parse the given json string.");
    }

    if (idx($parsed, 'success') !== null) {
      $this->success = HH\FIXME\UNSAFE_CAST<mixed, bool>($parsed['success']);
    }
  }

}

class MyService_getDataById_args implements \IThriftSyncStruct, \IThriftStructMetadata, \IThriftShapishSyncStruct {
  use \ThriftSerializationTrait;

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

  const type TConstructorShape = shape(
    ?'id' => ?int,
  );

  const type TShape = shape(
    'id' => int,
    ...
  );
  const int STRUCTURAL_ID = 3807211151619655933;
  public int $id;

  public function __construct(?int $id = null)[] {
    $this->id = $id ?? 0;
  }

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

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

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

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

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

  public static function __fromShape(self::TShape $shape)[]: this {
    return new static(
      $shape['id'],
    );
  }

  public function __toShape()[]: self::TShape {
    return shape(
      'id' => $this->id,
    );
  }
  public function getInstanceKey()[write_props]: string {
    return \TCompactSerializer::serialize($this);
  }

  public function readFromJson(string $jsonText): void {
    $parsed = json_decode($jsonText, true);

    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {
      throw new \TProtocolException("Cannot parse the given json string.");
    }

    if (idx($parsed, 'id') !== null) {
      $this->id = HH\FIXME\UNSAFE_CAST<mixed, int>($parsed['id']);
    }
  }

}

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

  const type TResult = string;

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

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

  const int STRUCTURAL_ID = 1365128170602685579;
  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 'MyService_getDataById_result';
  }

  public static function getStructMetadata()[]: \tmeta_ThriftStruct {
    return tmeta_ThriftStruct::fromShape(
      shape(
        "name" => "module.MyService_getDataById_result",
        "fields" => vec[
          tmeta_ThriftField::fromShape(
            shape(
              "id" => 0,
              "type" => tmeta_ThriftType::fromShape(
                shape(
                  "t_primitive" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,
                )
              ),
              "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);
  }

  public function readFromJson(string $jsonText): void {
    $parsed = json_decode($jsonText, true);

    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {
      throw new \TProtocolException("Cannot parse the given json string.");
    }

    if (idx($parsed, 'success') !== null) {
      $this->success = HH\FIXME\UNSAFE_CAST<mixed, string>($parsed['success']);
    }
  }

}

class MyService_putDataById_args implements \IThriftSyncStruct, \IThriftStructMetadata, \IThriftShapishSyncStruct {
  use \ThriftSerializationTrait;

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

  const type TConstructorShape = shape(
    ?'id' => ?int,
    ?'data' => ?string,
  );

  const type TShape = shape(
    'id' => int,
    'data' => string,
    ...
  );
  const int STRUCTURAL_ID = 1055685087985327657;
  public int $id;
  public string $data;

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

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

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

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

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

  public static function getAllStructuredAnnotations()[write_props]: \TStructAnnotations {
    return shape(
      'struct' => dict[],
      'fields' => dict[
        'data' => shape(
          'field' => dict[
            'MyStructNestedAnnotation' => MyStructNestedAnnotation::fromShape(
              shape(
                "name" => "argument",
              )
            ),
          ],
          'type' => dict[],
        ),
      ],
    );
  }

  public static function __fromShape(self::TShape $shape)[]: this {
    return new static(
      $shape['id'],
      $shape['data'],
    );
  }

  public function __toShape()[]: self::TShape {
    return shape(
      'id' => $this->id,
      'data' => $this->data,
    );
  }
  public function getInstanceKey()[write_props]: string {
    return \TCompactSerializer::serialize($this);
  }

  public function readFromJson(string $jsonText): void {
    $parsed = json_decode($jsonText, true);

    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {
      throw new \TProtocolException("Cannot parse the given json string.");
    }

    if (idx($parsed, 'id') !== null) {
      $this->id = HH\FIXME\UNSAFE_CAST<mixed, int>($parsed['id']);
    }
    if (idx($parsed, 'data') !== null) {
      $this->data = HH\FIXME\UNSAFE_CAST<mixed, string>($parsed['data']);
    }
  }

}

class MyService_putDataById_result 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 'MyService_putDataById_result';
  }

  public static function getStructMetadata()[]: \tmeta_ThriftStruct {
    return tmeta_ThriftStruct::fromShape(
      shape(
        "name" => "module.MyService_putDataById_result",
        "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 readFromJson(string $jsonText): void {
    $parsed = json_decode($jsonText, true);

    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {
      throw new \TProtocolException("Cannot parse the given json string.");
    }

  }

}

class MyService_lobDataById_args implements \IThriftSyncStruct, \IThriftStructMetadata, \IThriftShapishSyncStruct {
  use \ThriftSerializationTrait;

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

  const type TConstructorShape = shape(
    ?'id' => ?int,
    ?'data' => ?string,
  );

  const type TShape = shape(
    'id' => int,
    'data' => string,
    ...
  );
  const int STRUCTURAL_ID = 1055685087985327657;
  public int $id;
  public string $data;

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

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

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

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

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

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

  public static function __fromShape(self::TShape $shape)[]: this {
    return new static(
      $shape['id'],
      $shape['data'],
    );
  }

  public function __toShape()[]: self::TShape {
    return shape(
      'id' => $this->id,
      'data' => $this->data,
    );
  }
  public function getInstanceKey()[write_props]: string {
    return \TCompactSerializer::serialize($this);
  }

  public function readFromJson(string $jsonText): void {
    $parsed = json_decode($jsonText, true);

    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {
      throw new \TProtocolException("Cannot parse the given json string.");
    }

    if (idx($parsed, 'id') !== null) {
      $this->id = HH\FIXME\UNSAFE_CAST<mixed, int>($parsed['id']);
    }
    if (idx($parsed, 'data') !== null) {
      $this->data = HH\FIXME\UNSAFE_CAST<mixed, string>($parsed['data']);
    }
  }

}

class MyService_doNothing_args implements \IThriftSyncStruct, \IThriftStructMetadata, \IThriftShapishSyncStruct {
  use \ThriftSerializationTrait;

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

  const type TConstructorShape = shape(
  );

  const type TShape = 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 'MyService_doNothing_args';
  }

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

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

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

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

  public function readFromJson(string $jsonText): void {
    $parsed = json_decode($jsonText, true);

    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {
      throw new \TProtocolException("Cannot parse the given json string.");
    }

  }

}

class MyService_doNothing_result 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 'MyService_doNothing_result';
  }

  public static function getStructMetadata()[]: \tmeta_ThriftStruct {
    return tmeta_ThriftStruct::fromShape(
      shape(
        "name" => "module.MyService_doNothing_result",
        "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 readFromJson(string $jsonText): void {
    $parsed = json_decode($jsonText, true);

    if ($parsed === null || !($parsed is KeyedContainer<_, _>)) {
      throw new \TProtocolException("Cannot parse the given json string.");
    }

  }

}

class MyServiceStaticMetadata implements \IThriftServiceStaticMetadata {
  public static function getServiceMetadata()[]: \tmeta_ThriftService {
    return tmeta_ThriftService::fromShape(
      shape(
        "name" => "module.MyService",
        "functions" => vec[
          tmeta_ThriftFunction::fromShape(
            shape(
              "name" => "ping",
              "return_type" => 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.MyException",
                          )
                        ),
                      )
                    ),
                    "name" => "myExcept",
                  )
                ),
              ],
            )
          ),
          tmeta_ThriftFunction::fromShape(
            shape(
              "name" => "getRandomData",
              "return_type" => tmeta_ThriftType::fromShape(
                shape(
                  "t_primitive" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,
                )
              ),
            )
          ),
          tmeta_ThriftFunction::fromShape(
            shape(
              "name" => "hasDataById",
              "return_type" => tmeta_ThriftType::fromShape(
                shape(
                  "t_primitive" => tmeta_ThriftPrimitiveType::THRIFT_BOOL_TYPE,
                )
              ),
              "arguments" => vec[
                tmeta_ThriftField::fromShape(
                  shape(
                    "id" => 1,
                    "type" => tmeta_ThriftType::fromShape(
                      shape(
                        "t_primitive" => tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,
                      )
                    ),
                    "name" => "id",
                  )
                ),
              ],
            )
          ),
          tmeta_ThriftFunction::fromShape(
            shape(
              "name" => "getDataById",
              "return_type" => tmeta_ThriftType::fromShape(
                shape(
                  "t_primitive" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,
                )
              ),
              "arguments" => vec[
                tmeta_ThriftField::fromShape(
                  shape(
                    "id" => 1,
                    "type" => tmeta_ThriftType::fromShape(
                      shape(
                        "t_primitive" => tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,
                      )
                    ),
                    "name" => "id",
                  )
                ),
              ],
            )
          ),
          tmeta_ThriftFunction::fromShape(
            shape(
              "name" => "putDataById",
              "return_type" => tmeta_ThriftType::fromShape(
                shape(
                  "t_primitive" => tmeta_ThriftPrimitiveType::THRIFT_VOID_TYPE,
                )
              ),
              "arguments" => vec[
                tmeta_ThriftField::fromShape(
                  shape(
                    "id" => 1,
                    "type" => tmeta_ThriftType::fromShape(
                      shape(
                        "t_primitive" => tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,
                      )
                    ),
                    "name" => "id",
                  )
                ),
                tmeta_ThriftField::fromShape(
                  shape(
                    "id" => 2,
                    "type" => tmeta_ThriftType::fromShape(
                      shape(
                        "t_primitive" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,
                      )
                    ),
                    "name" => "data",
                  )
                ),
              ],
            )
          ),
          tmeta_ThriftFunction::fromShape(
            shape(
              "name" => "lobDataById",
              "return_type" => tmeta_ThriftType::fromShape(
                shape(
                  "t_primitive" => tmeta_ThriftPrimitiveType::THRIFT_VOID_TYPE,
                )
              ),
              "arguments" => vec[
                tmeta_ThriftField::fromShape(
                  shape(
                    "id" => 1,
                    "type" => tmeta_ThriftType::fromShape(
                      shape(
                        "t_primitive" => tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,
                      )
                    ),
                    "name" => "id",
                  )
                ),
                tmeta_ThriftField::fromShape(
                  shape(
                    "id" => 2,
                    "type" => tmeta_ThriftType::fromShape(
                      shape(
                        "t_primitive" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,
                      )
                    ),
                    "name" => "data",
                  )
                ),
              ],
              "is_oneway" => true,
            )
          ),
          tmeta_ThriftFunction::fromShape(
            shape(
              "name" => "doNothing",
              "return_type" => 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[
            ],
            'exceptions' => dict[
              'module.MyException' => MyException::getExceptionMetadata(),
            ],
            'services' => dict[
            ],
          )
        ),
      )
    );
  }

  public static function getAllStructuredAnnotations()[write_props]: \TServiceAnnotations {
    return shape(
      'service' => dict[],
      'functions' => dict[
        'getDataById' => dict[
          '\facebook\thrift\annotation\go\Name' => \facebook\thrift\annotation\go\Name::fromShape(
            shape(
              "name" => "GoGetDataById",
            )
          ),
        ],
        'doNothing' => dict[
          '\facebook\thrift\annotation\cpp\Name' => \facebook\thrift\annotation\cpp\Name::fromShape(
            shape(
              "value" => "cppDoNothing",
            )
          ),
          '\facebook\thrift\annotation\go\Name' => \facebook\thrift\annotation\go\Name::fromShape(
            shape(
              "name" => "GoDoNothing",
            )
          ),
        ],
      ],
    );
  }
}

