'test.dev/fixtures/basic/MyService'))>> interface MyServiceAsyncIf extends \IThriftAsyncIf { /** * Original thrift definition:- * void * ping(); */ public function ping(): Awaitable; /** * Original thrift definition:- * string * getRandomData(); */ public function getRandomData(): Awaitable; /** * Original thrift definition:- * void * sink(1: i64 sink); */ public function sink(int $sink): Awaitable; /** * Original thrift definition:- * void * putDataById(1: i64 id, * 2: string data); */ public function putDataById(int $id, string $data): Awaitable; /** * Original thrift definition:- * bool * hasDataById(1: i64 id); */ public function hasDataById(int $id): Awaitable; /** * Original thrift definition:- * string * getDataById(1: i64 id); */ public function getDataById(int $id): Awaitable; /** * Original thrift definition:- * void * deleteDataById(1: i64 id); */ public function deleteDataById(int $id): Awaitable; /** * Original thrift definition:- * oneway void * lobDataById(1: i64 id, * 2: string data); */ public function lobDataById(int $id, string $data): Awaitable; } /** * Original thrift service:- * MyService */ <<\ThriftTypeInfo(shape('uri' => 'test.dev/fixtures/basic/MyService'))>> interface MyServiceIf extends \IThriftSyncIf { /** * Original thrift definition:- * void * ping(); */ public function ping(): void; /** * Original thrift definition:- * string * getRandomData(); */ public function getRandomData(): string; /** * Original thrift definition:- * void * sink(1: i64 sink); */ public function sink(int $sink): void; /** * Original thrift definition:- * void * putDataById(1: i64 id, * 2: string data); */ public function putDataById(int $id, string $data): void; /** * 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 * deleteDataById(1: i64 id); */ public function deleteDataById(int $id): void; /** * Original thrift definition:- * oneway void * lobDataById(1: i64 id, * 2: string data); */ public function lobDataById(int $id, string $data): void; } /** * Original thrift service:- * MyService */ <<\ThriftTypeInfo(shape('uri' => 'test.dev/fixtures/basic/MyService'))>> interface MyServiceAsyncClientIf extends MyServiceAsyncIf { } /** * Original thrift service:- * MyService */ <<\ThriftTypeInfo(shape('uri' => 'test.dev/fixtures/basic/MyService'))>> interface MyServiceClientIf extends \IThriftSyncIf { /** * Original thrift definition:- * void * ping(); */ public function ping(): Awaitable; /** * Original thrift definition:- * string * getRandomData(); */ public function getRandomData(): Awaitable; /** * Original thrift definition:- * void * sink(1: i64 sink); */ public function sink(int $sink): Awaitable; /** * Original thrift definition:- * void * putDataById(1: i64 id, * 2: string data); */ public function putDataById(int $id, string $data): Awaitable; /** * Original thrift definition:- * bool * hasDataById(1: i64 id); */ public function hasDataById(int $id): Awaitable; /** * Original thrift definition:- * string * getDataById(1: i64 id); */ public function getDataById(int $id): Awaitable; /** * Original thrift definition:- * void * deleteDataById(1: i64 id); */ public function deleteDataById(int $id): Awaitable; /** * Original thrift definition:- * oneway void * lobDataById(1: i64 id, * 2: string data); */ public function lobDataById(int $id, string $data): Awaitable; } /** * Original thrift service:- * MyService */ trait MyServiceClientBase { require extends \ThriftClientBase; } class MyServiceAsyncClient extends \ThriftClientBase implements MyServiceAsyncClientIf { use MyServiceClientBase; /** * Original thrift definition:- * void * ping(); */ public async function ping(): Awaitable { $hh_frame_metadata = $this->getHHFrameMetadata(); if ($hh_frame_metadata !== null) { \HH\set_frame_metadata($hh_frame_metadata); } $rpc_options = $this->getAndResetOptions() ?? \ThriftClientBase::defaultOptions(); $args = \test\fixtures\basic\MyService_ping_args::withDefaultValues(); await $this->asyncHandler_->genBefore("MyService", "ping", $args); $currentseqid = $this->sendImplHelper($args, "ping", false); await $this->genAwaitResponse(\test\fixtures\basic\MyService_ping_result::class, "ping", true, $currentseqid, $rpc_options); } /** * Original thrift definition:- * string * getRandomData(); */ public async function getRandomData(): Awaitable { $hh_frame_metadata = $this->getHHFrameMetadata(); if ($hh_frame_metadata !== null) { \HH\set_frame_metadata($hh_frame_metadata); } $rpc_options = $this->getAndResetOptions() ?? \ThriftClientBase::defaultOptions(); $args = \test\fixtures\basic\MyService_getRandomData_args::withDefaultValues(); await $this->asyncHandler_->genBefore("MyService", "getRandomData", $args); $currentseqid = $this->sendImplHelper($args, "getRandomData", false); return await $this->genAwaitResponse(\test\fixtures\basic\MyService_getRandomData_result::class, "getRandomData", false, $currentseqid, $rpc_options); } /** * Original thrift definition:- * void * sink(1: i64 sink); */ public async function sink(int $sink): Awaitable { $hh_frame_metadata = $this->getHHFrameMetadata(); if ($hh_frame_metadata !== null) { \HH\set_frame_metadata($hh_frame_metadata); } $rpc_options = $this->getAndResetOptions() ?? \ThriftClientBase::defaultOptions(); $args = \test\fixtures\basic\MyService_sink_args::fromShape(shape( 'sink' => $sink, )); await $this->asyncHandler_->genBefore("MyService", "sink", $args); $currentseqid = $this->sendImplHelper($args, "sink", false); await $this->genAwaitResponse(\test\fixtures\basic\MyService_sink_result::class, "sink", true, $currentseqid, $rpc_options); } /** * Original thrift definition:- * void * putDataById(1: i64 id, * 2: string data); */ public async function putDataById(int $id, string $data): Awaitable { $hh_frame_metadata = $this->getHHFrameMetadata(); if ($hh_frame_metadata !== null) { \HH\set_frame_metadata($hh_frame_metadata); } $rpc_options = $this->getAndResetOptions() ?? \ThriftClientBase::defaultOptions(); $args = \test\fixtures\basic\MyService_putDataById_args::fromShape(shape( 'id' => $id, 'data' => $data, )); await $this->asyncHandler_->genBefore("MyService", "putDataById", $args); $currentseqid = $this->sendImplHelper($args, "putDataById", false); await $this->genAwaitResponse(\test\fixtures\basic\MyService_putDataById_result::class, "putDataById", true, $currentseqid, $rpc_options); } /** * Original thrift definition:- * bool * hasDataById(1: i64 id); */ public async function hasDataById(int $id): Awaitable { $hh_frame_metadata = $this->getHHFrameMetadata(); if ($hh_frame_metadata !== null) { \HH\set_frame_metadata($hh_frame_metadata); } $rpc_options = $this->getAndResetOptions() ?? \ThriftClientBase::defaultOptions(); $args = \test\fixtures\basic\MyService_hasDataById_args::fromShape(shape( 'id' => $id, )); await $this->asyncHandler_->genBefore("MyService", "hasDataById", $args); $currentseqid = $this->sendImplHelper($args, "hasDataById", false); return await $this->genAwaitResponse(\test\fixtures\basic\MyService_hasDataById_result::class, "hasDataById", false, $currentseqid, $rpc_options); } /** * Original thrift definition:- * string * getDataById(1: i64 id); */ public async function getDataById(int $id): Awaitable { $hh_frame_metadata = $this->getHHFrameMetadata(); if ($hh_frame_metadata !== null) { \HH\set_frame_metadata($hh_frame_metadata); } $rpc_options = $this->getAndResetOptions() ?? \ThriftClientBase::defaultOptions(); $args = \test\fixtures\basic\MyService_getDataById_args::fromShape(shape( 'id' => $id, )); await $this->asyncHandler_->genBefore("MyService", "getDataById", $args); $currentseqid = $this->sendImplHelper($args, "getDataById", false); return await $this->genAwaitResponse(\test\fixtures\basic\MyService_getDataById_result::class, "getDataById", false, $currentseqid, $rpc_options); } /** * Original thrift definition:- * void * deleteDataById(1: i64 id); */ public async function deleteDataById(int $id): Awaitable { $hh_frame_metadata = $this->getHHFrameMetadata(); if ($hh_frame_metadata !== null) { \HH\set_frame_metadata($hh_frame_metadata); } $rpc_options = $this->getAndResetOptions() ?? \ThriftClientBase::defaultOptions(); $args = \test\fixtures\basic\MyService_deleteDataById_args::fromShape(shape( 'id' => $id, )); await $this->asyncHandler_->genBefore("MyService", "deleteDataById", $args); $currentseqid = $this->sendImplHelper($args, "deleteDataById", false); await $this->genAwaitResponse(\test\fixtures\basic\MyService_deleteDataById_result::class, "deleteDataById", 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 { $hh_frame_metadata = $this->getHHFrameMetadata(); if ($hh_frame_metadata !== null) { \HH\set_frame_metadata($hh_frame_metadata); } $rpc_options = $this->getAndResetOptions() ?? \ThriftClientBase::defaultOptions(); $args = \test\fixtures\basic\MyService_lobDataById_args::fromShape(shape( 'id' => $id, 'data' => $data, )); await $this->asyncHandler_->genBefore("MyService", "lobDataById", $args); $currentseqid = $this->sendImplHelper($args, "lobDataById", true); await $this->genAwaitNoResponse($rpc_options); } } class MyServiceClient extends \ThriftClientBase implements MyServiceClientIf { use MyServiceClientBase; /** * Original thrift definition:- * void * ping(); */ public async function ping(): Awaitable { $hh_frame_metadata = $this->getHHFrameMetadata(); if ($hh_frame_metadata !== null) { \HH\set_frame_metadata($hh_frame_metadata); } $rpc_options = $this->getAndResetOptions() ?? \ThriftClientBase::defaultOptions(); $args = \test\fixtures\basic\MyService_ping_args::withDefaultValues(); await $this->asyncHandler_->genBefore("MyService", "ping", $args); $currentseqid = $this->sendImplHelper($args, "ping", false); await $this->genAwaitResponse(\test\fixtures\basic\MyService_ping_result::class, "ping", true, $currentseqid, $rpc_options); } /** * Original thrift definition:- * string * getRandomData(); */ public async function getRandomData(): Awaitable { $hh_frame_metadata = $this->getHHFrameMetadata(); if ($hh_frame_metadata !== null) { \HH\set_frame_metadata($hh_frame_metadata); } $rpc_options = $this->getAndResetOptions() ?? \ThriftClientBase::defaultOptions(); $args = \test\fixtures\basic\MyService_getRandomData_args::withDefaultValues(); await $this->asyncHandler_->genBefore("MyService", "getRandomData", $args); $currentseqid = $this->sendImplHelper($args, "getRandomData", false); return await $this->genAwaitResponse(\test\fixtures\basic\MyService_getRandomData_result::class, "getRandomData", false, $currentseqid, $rpc_options); } /** * Original thrift definition:- * void * sink(1: i64 sink); */ public async function sink(int $sink): Awaitable { $hh_frame_metadata = $this->getHHFrameMetadata(); if ($hh_frame_metadata !== null) { \HH\set_frame_metadata($hh_frame_metadata); } $rpc_options = $this->getAndResetOptions() ?? \ThriftClientBase::defaultOptions(); $args = \test\fixtures\basic\MyService_sink_args::fromShape(shape( 'sink' => $sink, )); await $this->asyncHandler_->genBefore("MyService", "sink", $args); $currentseqid = $this->sendImplHelper($args, "sink", false); await $this->genAwaitResponse(\test\fixtures\basic\MyService_sink_result::class, "sink", true, $currentseqid, $rpc_options); } /** * Original thrift definition:- * void * putDataById(1: i64 id, * 2: string data); */ public async function putDataById(int $id, string $data): Awaitable { $hh_frame_metadata = $this->getHHFrameMetadata(); if ($hh_frame_metadata !== null) { \HH\set_frame_metadata($hh_frame_metadata); } $rpc_options = $this->getAndResetOptions() ?? \ThriftClientBase::defaultOptions(); $args = \test\fixtures\basic\MyService_putDataById_args::fromShape(shape( 'id' => $id, 'data' => $data, )); await $this->asyncHandler_->genBefore("MyService", "putDataById", $args); $currentseqid = $this->sendImplHelper($args, "putDataById", false); await $this->genAwaitResponse(\test\fixtures\basic\MyService_putDataById_result::class, "putDataById", true, $currentseqid, $rpc_options); } /** * Original thrift definition:- * bool * hasDataById(1: i64 id); */ public async function hasDataById(int $id): Awaitable { $hh_frame_metadata = $this->getHHFrameMetadata(); if ($hh_frame_metadata !== null) { \HH\set_frame_metadata($hh_frame_metadata); } $rpc_options = $this->getAndResetOptions() ?? \ThriftClientBase::defaultOptions(); $args = \test\fixtures\basic\MyService_hasDataById_args::fromShape(shape( 'id' => $id, )); await $this->asyncHandler_->genBefore("MyService", "hasDataById", $args); $currentseqid = $this->sendImplHelper($args, "hasDataById", false); return await $this->genAwaitResponse(\test\fixtures\basic\MyService_hasDataById_result::class, "hasDataById", false, $currentseqid, $rpc_options); } /** * Original thrift definition:- * string * getDataById(1: i64 id); */ public async function getDataById(int $id): Awaitable { $hh_frame_metadata = $this->getHHFrameMetadata(); if ($hh_frame_metadata !== null) { \HH\set_frame_metadata($hh_frame_metadata); } $rpc_options = $this->getAndResetOptions() ?? \ThriftClientBase::defaultOptions(); $args = \test\fixtures\basic\MyService_getDataById_args::fromShape(shape( 'id' => $id, )); await $this->asyncHandler_->genBefore("MyService", "getDataById", $args); $currentseqid = $this->sendImplHelper($args, "getDataById", false); return await $this->genAwaitResponse(\test\fixtures\basic\MyService_getDataById_result::class, "getDataById", false, $currentseqid, $rpc_options); } /** * Original thrift definition:- * void * deleteDataById(1: i64 id); */ public async function deleteDataById(int $id): Awaitable { $hh_frame_metadata = $this->getHHFrameMetadata(); if ($hh_frame_metadata !== null) { \HH\set_frame_metadata($hh_frame_metadata); } $rpc_options = $this->getAndResetOptions() ?? \ThriftClientBase::defaultOptions(); $args = \test\fixtures\basic\MyService_deleteDataById_args::fromShape(shape( 'id' => $id, )); await $this->asyncHandler_->genBefore("MyService", "deleteDataById", $args); $currentseqid = $this->sendImplHelper($args, "deleteDataById", false); await $this->genAwaitResponse(\test\fixtures\basic\MyService_deleteDataById_result::class, "deleteDataById", 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 { $hh_frame_metadata = $this->getHHFrameMetadata(); if ($hh_frame_metadata !== null) { \HH\set_frame_metadata($hh_frame_metadata); } $rpc_options = $this->getAndResetOptions() ?? \ThriftClientBase::defaultOptions(); $args = \test\fixtures\basic\MyService_lobDataById_args::fromShape(shape( 'id' => $id, 'data' => $data, )); await $this->asyncHandler_->genBefore("MyService", "lobDataById", $args); $currentseqid = $this->sendImplHelper($args, "lobDataById", true); await $this->genAwaitNoResponse($rpc_options); } /* send and recv functions */ public function send_ping(): int { $args = \test\fixtures\basic\MyService_ping_args::withDefaultValues(); return $this->sendImplHelper($args, "ping", false); } public function recv_ping(?int $expectedsequenceid = null): void { $this->recvImplHelper(\test\fixtures\basic\MyService_ping_result::class, "ping", true, $expectedsequenceid); } public function send_getRandomData(): int { $args = \test\fixtures\basic\MyService_getRandomData_args::withDefaultValues(); return $this->sendImplHelper($args, "getRandomData", false); } public function recv_getRandomData(?int $expectedsequenceid = null): string { return $this->recvImplHelper(\test\fixtures\basic\MyService_getRandomData_result::class, "getRandomData", false, $expectedsequenceid); } public function send_sink(int $sink): int { $args = \test\fixtures\basic\MyService_sink_args::fromShape(shape( 'sink' => $sink, )); return $this->sendImplHelper($args, "sink", false); } public function recv_sink(?int $expectedsequenceid = null): void { $this->recvImplHelper(\test\fixtures\basic\MyService_sink_result::class, "sink", true, $expectedsequenceid); } public function send_putDataById(int $id, string $data): int { $args = \test\fixtures\basic\MyService_putDataById_args::fromShape(shape( 'id' => $id, 'data' => $data, )); return $this->sendImplHelper($args, "putDataById", false); } public function recv_putDataById(?int $expectedsequenceid = null): void { $this->recvImplHelper(\test\fixtures\basic\MyService_putDataById_result::class, "putDataById", true, $expectedsequenceid); } public function send_hasDataById(int $id): int { $args = \test\fixtures\basic\MyService_hasDataById_args::fromShape(shape( 'id' => $id, )); return $this->sendImplHelper($args, "hasDataById", false); } public function recv_hasDataById(?int $expectedsequenceid = null): bool { return $this->recvImplHelper(\test\fixtures\basic\MyService_hasDataById_result::class, "hasDataById", false, $expectedsequenceid); } public function send_getDataById(int $id): int { $args = \test\fixtures\basic\MyService_getDataById_args::fromShape(shape( 'id' => $id, )); return $this->sendImplHelper($args, "getDataById", false); } public function recv_getDataById(?int $expectedsequenceid = null): string { return $this->recvImplHelper(\test\fixtures\basic\MyService_getDataById_result::class, "getDataById", false, $expectedsequenceid); } public function send_deleteDataById(int $id): int { $args = \test\fixtures\basic\MyService_deleteDataById_args::fromShape(shape( 'id' => $id, )); return $this->sendImplHelper($args, "deleteDataById", false); } public function recv_deleteDataById(?int $expectedsequenceid = null): void { $this->recvImplHelper(\test\fixtures\basic\MyService_deleteDataById_result::class, "deleteDataById", true, $expectedsequenceid); } public function send_lobDataById(int $id, string $data): int { $args = \test\fixtures\basic\MyService_lobDataById_args::fromShape(shape( 'id' => $id, 'data' => $data, )); return $this->sendImplHelper($args, "lobDataById", true); } } 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 { $handler_ctx = $this->eventHandler_->getHandlerContext('ping'); $reply_type = \TMessageType::REPLY; $args = $this->readHelper(\test\fixtures\basic\MyService_ping_args::class, $input, 'ping', $handler_ctx); $result = \test\fixtures\basic\MyService_ping_result::withDefaultValues(); try { $this->eventHandler_->preExec($handler_ctx, '\test\fixtures\basic\MyService', 'ping', $args); await $this->handler->ping(); $this->eventHandler_->postExec($handler_ctx, 'ping', $result); } catch (\Exception $ex) { $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 { $handler_ctx = $this->eventHandler_->getHandlerContext('getRandomData'); $reply_type = \TMessageType::REPLY; $args = $this->readHelper(\test\fixtures\basic\MyService_getRandomData_args::class, $input, 'getRandomData', $handler_ctx); $result = \test\fixtures\basic\MyService_getRandomData_result::withDefaultValues(); try { $this->eventHandler_->preExec($handler_ctx, '\test\fixtures\basic\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_sink(int $seqid, \TProtocol $input, \TProtocol $output): Awaitable { $handler_ctx = $this->eventHandler_->getHandlerContext('sink'); $reply_type = \TMessageType::REPLY; $args = $this->readHelper(\test\fixtures\basic\MyService_sink_args::class, $input, 'sink', $handler_ctx); $result = \test\fixtures\basic\MyService_sink_result::withDefaultValues(); try { $this->eventHandler_->preExec($handler_ctx, '\test\fixtures\basic\MyService', 'sink', $args); await $this->handler->sink($args->sink); $this->eventHandler_->postExec($handler_ctx, 'sink', $result); } catch (\Exception $ex) { $reply_type = \TMessageType::EXCEPTION; $this->eventHandler_->handlerError($handler_ctx, 'sink', $ex); $result = new \TApplicationException($ex->getMessage()."\n".$ex->getTraceAsString()); } $this->writeHelper($result, 'sink', $seqid, $handler_ctx, $output, $reply_type); } protected async function process_putDataById(int $seqid, \TProtocol $input, \TProtocol $output): Awaitable { $handler_ctx = $this->eventHandler_->getHandlerContext('putDataById'); $reply_type = \TMessageType::REPLY; $args = $this->readHelper(\test\fixtures\basic\MyService_putDataById_args::class, $input, 'putDataById', $handler_ctx); $result = \test\fixtures\basic\MyService_putDataById_result::withDefaultValues(); try { $this->eventHandler_->preExec($handler_ctx, '\test\fixtures\basic\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_hasDataById(int $seqid, \TProtocol $input, \TProtocol $output): Awaitable { $handler_ctx = $this->eventHandler_->getHandlerContext('hasDataById'); $reply_type = \TMessageType::REPLY; $args = $this->readHelper(\test\fixtures\basic\MyService_hasDataById_args::class, $input, 'hasDataById', $handler_ctx); $result = \test\fixtures\basic\MyService_hasDataById_result::withDefaultValues(); try { $this->eventHandler_->preExec($handler_ctx, '\test\fixtures\basic\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 { $handler_ctx = $this->eventHandler_->getHandlerContext('getDataById'); $reply_type = \TMessageType::REPLY; $args = $this->readHelper(\test\fixtures\basic\MyService_getDataById_args::class, $input, 'getDataById', $handler_ctx); $result = \test\fixtures\basic\MyService_getDataById_result::withDefaultValues(); try { $this->eventHandler_->preExec($handler_ctx, '\test\fixtures\basic\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_deleteDataById(int $seqid, \TProtocol $input, \TProtocol $output): Awaitable { $handler_ctx = $this->eventHandler_->getHandlerContext('deleteDataById'); $reply_type = \TMessageType::REPLY; $args = $this->readHelper(\test\fixtures\basic\MyService_deleteDataById_args::class, $input, 'deleteDataById', $handler_ctx); $result = \test\fixtures\basic\MyService_deleteDataById_result::withDefaultValues(); try { $this->eventHandler_->preExec($handler_ctx, '\test\fixtures\basic\MyService', 'deleteDataById', $args); await $this->handler->deleteDataById($args->id); $this->eventHandler_->postExec($handler_ctx, 'deleteDataById', $result); } catch (\Exception $ex) { $reply_type = \TMessageType::EXCEPTION; $this->eventHandler_->handlerError($handler_ctx, 'deleteDataById', $ex); $result = new \TApplicationException($ex->getMessage()."\n".$ex->getTraceAsString()); } $this->writeHelper($result, 'deleteDataById', $seqid, $handler_ctx, $output, $reply_type); } protected async function process_lobDataById(int $seqid, \TProtocol $input, \TProtocol $output): Awaitable { $handler_ctx = $this->eventHandler_->getHandlerContext('lobDataById'); $reply_type = \TMessageType::REPLY; $args = $this->readHelper(\test\fixtures\basic\MyService_lobDataById_args::class, $input, 'lobDataById', $handler_ctx); try { $this->eventHandler_->preExec($handler_ctx, '\test\fixtures\basic\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_getThriftServiceMetadata(int $seqid, \TProtocol $input, \TProtocol $output): Awaitable { $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(\test\fixtures\basic\MyService_ping_args::class, $input, 'ping', $handler_ctx); $result = \test\fixtures\basic\MyService_ping_result::withDefaultValues(); try { $this->eventHandler_->preExec($handler_ctx, '\test\fixtures\basic\MyService', 'ping', $args); $this->handler->ping(); $this->eventHandler_->postExec($handler_ctx, 'ping', $result); } catch (\Exception $ex) { $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(\test\fixtures\basic\MyService_getRandomData_args::class, $input, 'getRandomData', $handler_ctx); $result = \test\fixtures\basic\MyService_getRandomData_result::withDefaultValues(); try { $this->eventHandler_->preExec($handler_ctx, '\test\fixtures\basic\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_sink(int $seqid, \TProtocol $input, \TProtocol $output): void { $handler_ctx = $this->eventHandler_->getHandlerContext('sink'); $reply_type = \TMessageType::REPLY; $args = $this->readHelper(\test\fixtures\basic\MyService_sink_args::class, $input, 'sink', $handler_ctx); $result = \test\fixtures\basic\MyService_sink_result::withDefaultValues(); try { $this->eventHandler_->preExec($handler_ctx, '\test\fixtures\basic\MyService', 'sink', $args); $this->handler->sink($args->sink); $this->eventHandler_->postExec($handler_ctx, 'sink', $result); } catch (\Exception $ex) { $reply_type = \TMessageType::EXCEPTION; $this->eventHandler_->handlerError($handler_ctx, 'sink', $ex); $result = new \TApplicationException($ex->getMessage()."\n".$ex->getTraceAsString()); } $this->writeHelper($result, 'sink', $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(\test\fixtures\basic\MyService_putDataById_args::class, $input, 'putDataById', $handler_ctx); $result = \test\fixtures\basic\MyService_putDataById_result::withDefaultValues(); try { $this->eventHandler_->preExec($handler_ctx, '\test\fixtures\basic\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_hasDataById(int $seqid, \TProtocol $input, \TProtocol $output): void { $handler_ctx = $this->eventHandler_->getHandlerContext('hasDataById'); $reply_type = \TMessageType::REPLY; $args = $this->readHelper(\test\fixtures\basic\MyService_hasDataById_args::class, $input, 'hasDataById', $handler_ctx); $result = \test\fixtures\basic\MyService_hasDataById_result::withDefaultValues(); try { $this->eventHandler_->preExec($handler_ctx, '\test\fixtures\basic\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(\test\fixtures\basic\MyService_getDataById_args::class, $input, 'getDataById', $handler_ctx); $result = \test\fixtures\basic\MyService_getDataById_result::withDefaultValues(); try { $this->eventHandler_->preExec($handler_ctx, '\test\fixtures\basic\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_deleteDataById(int $seqid, \TProtocol $input, \TProtocol $output): void { $handler_ctx = $this->eventHandler_->getHandlerContext('deleteDataById'); $reply_type = \TMessageType::REPLY; $args = $this->readHelper(\test\fixtures\basic\MyService_deleteDataById_args::class, $input, 'deleteDataById', $handler_ctx); $result = \test\fixtures\basic\MyService_deleteDataById_result::withDefaultValues(); try { $this->eventHandler_->preExec($handler_ctx, '\test\fixtures\basic\MyService', 'deleteDataById', $args); $this->handler->deleteDataById($args->id); $this->eventHandler_->postExec($handler_ctx, 'deleteDataById', $result); } catch (\Exception $ex) { $reply_type = \TMessageType::EXCEPTION; $this->eventHandler_->handlerError($handler_ctx, 'deleteDataById', $ex); $result = new \TApplicationException($ex->getMessage()."\n".$ex->getTraceAsString()); } $this->writeHelper($result, 'deleteDataById', $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(\test\fixtures\basic\MyService_lobDataById_args::class, $input, 'lobDataById', $handler_ctx); try { $this->eventHandler_->preExec($handler_ctx, '\test\fixtures\basic\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_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 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[ ]; const dict 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_ping_result'; } public static function getStructMetadata()[]: \tmeta_ThriftStruct { return \tmeta_ThriftStruct::fromShape( shape( "name" => "module.MyService_ping_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_getRandomData_args implements \IThriftSyncStruct, \IThriftStructMetadata, \IThriftShapishSyncStruct { use \ThriftSerializationTrait; const \ThriftStructTypes::TSpec SPEC = dict[ ]; const dict 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 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($parsed['success']); } } } class MyService_sink_args implements \IThriftSyncStruct, \IThriftStructMetadata, \IThriftShapishSyncStruct { use \ThriftSerializationTrait; const \ThriftStructTypes::TSpec SPEC = dict[ 1 => shape( 'var' => 'sink', 'type' => \TType::I64, ), ]; const dict FIELDMAP = dict[ 'sink' => 1, ]; const type TConstructorShape = shape( ?'sink' => ?int, ); const type TShape = shape( 'sink' => int, ... ); const int STRUCTURAL_ID = 7104007081489563250; public int $sink; public function __construct(?int $sink = null)[] { $this->sink = $sink ?? 0; } public static function withDefaultValues()[]: this { return new static(); } public static function fromShape(self::TConstructorShape $shape)[]: this { return new static( Shapes::idx($shape, 'sink'), ); } public function getName()[]: string { return 'MyService_sink_args'; } public static function getStructMetadata()[]: \tmeta_ThriftStruct { return \tmeta_ThriftStruct::fromShape( shape( "name" => "module.sink_args", "fields" => vec[ \tmeta_ThriftField::fromShape( shape( "id" => 1, "type" => \tmeta_ThriftType::fromShape( shape( "t_primitive" => \tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE, ) ), "name" => "sink", ) ), ], "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['sink'], ); } public function __toShape()[]: self::TShape { return shape( 'sink' => $this->sink, ); } 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, 'sink') !== null) { $this->sink = HH\FIXME\UNSAFE_CAST($parsed['sink']); } } } class MyService_sink_result extends \ThriftSyncStructWithoutResult implements \IThriftStructMetadata { use \ThriftSerializationTrait; const \ThriftStructTypes::TSpec SPEC = dict[ ]; const dict 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_sink_result'; } public static function getStructMetadata()[]: \tmeta_ThriftStruct { return \tmeta_ThriftStruct::fromShape( shape( "name" => "module.MyService_sink_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_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 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[ ], ); } 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($parsed['id']); } if (idx($parsed, 'data') !== null) { $this->data = HH\FIXME\UNSAFE_CAST($parsed['data']); } } } class MyService_putDataById_result extends \ThriftSyncStructWithoutResult implements \IThriftStructMetadata { use \ThriftSerializationTrait; const \ThriftStructTypes::TSpec SPEC = dict[ ]; const dict 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_hasDataById_args implements \IThriftSyncStruct, \IThriftStructMetadata, \IThriftShapishSyncStruct { use \ThriftSerializationTrait; const \ThriftStructTypes::TSpec SPEC = dict[ 1 => shape( 'var' => 'id', 'type' => \TType::I64, ), ]; const dict 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($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 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($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 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($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 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($parsed['success']); } } } class MyService_deleteDataById_args implements \IThriftSyncStruct, \IThriftStructMetadata, \IThriftShapishSyncStruct { use \ThriftSerializationTrait; const \ThriftStructTypes::TSpec SPEC = dict[ 1 => shape( 'var' => 'id', 'type' => \TType::I64, ), ]; const dict 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_deleteDataById_args'; } public static function getStructMetadata()[]: \tmeta_ThriftStruct { return \tmeta_ThriftStruct::fromShape( shape( "name" => "module.deleteDataById_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($parsed['id']); } } } class MyService_deleteDataById_result extends \ThriftSyncStructWithoutResult implements \IThriftStructMetadata { use \ThriftSerializationTrait; const \ThriftStructTypes::TSpec SPEC = dict[ ]; const dict 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_deleteDataById_result'; } public static function getStructMetadata()[]: \tmeta_ThriftStruct { return \tmeta_ThriftStruct::fromShape( shape( "name" => "module.MyService_deleteDataById_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 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($parsed['id']); } if (idx($parsed, 'data') !== null) { $this->data = HH\FIXME\UNSAFE_CAST($parsed['data']); } } } 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, ) ), ) ), \tmeta_ThriftFunction::fromShape( shape( "name" => "getRandomData", "return_type" => \tmeta_ThriftType::fromShape( shape( "t_primitive" => \tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE, ) ), ) ), \tmeta_ThriftFunction::fromShape( shape( "name" => "sink", "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" => "sink", ) ), ], ) ), \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" => "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" => "deleteDataById", "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_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, ) ), ], ) ); } 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[ ], 'services' => dict[ ], ) ), ) ); } public static function getAllStructuredAnnotations()[write_props]: \TServiceAnnotations { return shape( 'service' => dict[], 'functions' => dict[ 'invalid_return_for_hack' => dict[ '\facebook\thrift\annotation\hack\SkipCodegen' => \facebook\thrift\annotation\hack\SkipCodegen::fromShape( shape( "reason" => "Invalid key type", ) ), ], 'rpc_skipped_codegen' => dict[ '\facebook\thrift\annotation\hack\SkipCodegen' => \facebook\thrift\annotation\hack\SkipCodegen::fromShape( shape( "reason" => "Skip function deprecation", ) ), ], ], ); } }