; /** * * Original thrift definition:- * string * thing(1: i32 a, * 2: string b, * 3: set c) * throws (1: Bang bang); */ public function thing(int $a, string $b, Set $c): Awaitable; } /** * Detailed overview of service * * Original thrift service:- * C */ interface CIf extends \IThriftSyncIf { /** * Function doctext. * * Original thrift definition:- * void * f(); */ public function f(): void; /** * * Original thrift definition:- * string * thing(1: i32 a, * 2: string b, * 3: set c) * throws (1: Bang bang); */ public function thing(int $a, string $b, Set $c): string; } /** * Detailed overview of service * * Original thrift service:- * C */ interface CAsyncClientIf extends CAsyncIf { /** * Streaming function * * Original thrift definition:- * void, stream * numbers(); */ public function numbers(): Awaitable<\ResponseAndStream>; } /** * Detailed overview of service * * Original thrift service:- * C */ interface CClientIf extends \IThriftSyncIf { /** * Function doctext. * * Original thrift definition:- * void * f(); */ public function f(): Awaitable; /** * Streaming function * * Original thrift definition:- * void, stream * numbers(); */ public function numbers(): Awaitable<\ResponseAndStream>; /** * * Original thrift definition:- * string * thing(1: i32 a, * 2: string b, * 3: set c) * throws (1: Bang bang); */ public function thing(int $a, string $b, Set $c): Awaitable; } /** * Detailed overview of service * * Original thrift service:- * C */ trait CClientBase { require extends \ThriftClientBase; } class CAsyncClient extends \ThriftClientBase implements CAsyncClientIf { use CClientBase; /** * Function doctext. * * Original thrift definition:- * void * f(); */ public async function f(): 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 = C_f_args::withDefaultValues(); await $this->asyncHandler_->genBefore("C", "f", $args); $currentseqid = $this->sendImplHelper($args, "f", false); await $this->genAwaitResponse(C_f_result::class, "f", true, $currentseqid, $rpc_options); } /** * Streaming function * * Original thrift definition:- * void, stream * numbers(); */ public async function numbers(): Awaitable<\ResponseAndStream> { $hh_frame_metadata = $this->getHHFrameMetadata(); if ($hh_frame_metadata !== null) { \HH\set_frame_metadata($hh_frame_metadata); } $rpc_options = $this->getAndResetOptions() ?? \ThriftClientBase::defaultOptions(); $args = C_numbers_args::withDefaultValues(); await $this->asyncHandler_->genBefore("C", "numbers", $args); $currentseqid = $this->sendImplHelper($args, "numbers", false); return await $this->genAwaitStreamResponse(C_numbers_FirstResponse::class, C_numbers_StreamResponse::class, "numbers", true, $currentseqid, $rpc_options); } /** * * Original thrift definition:- * string * thing(1: i32 a, * 2: string b, * 3: set c) * throws (1: Bang bang); */ public async function thing(int $a, string $b, Set $c): 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 = C_thing_args::fromShape(shape( 'a' => $a, 'b' => $b, 'c' => $c, )); await $this->asyncHandler_->genBefore("C", "thing", $args); $currentseqid = $this->sendImplHelper($args, "thing", false); return await $this->genAwaitResponse(C_thing_result::class, "thing", false, $currentseqid, $rpc_options); } } class CClient extends \ThriftClientBase implements CClientIf { use CClientBase; /** * Function doctext. * * Original thrift definition:- * void * f(); */ public async function f(): 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 = C_f_args::withDefaultValues(); await $this->asyncHandler_->genBefore("C", "f", $args); $currentseqid = $this->sendImplHelper($args, "f", false); await $this->genAwaitResponse(C_f_result::class, "f", true, $currentseqid, $rpc_options); } /** * Streaming function * * Original thrift definition:- * void, stream * numbers(); */ public async function numbers(): Awaitable<\ResponseAndStream> { $hh_frame_metadata = $this->getHHFrameMetadata(); if ($hh_frame_metadata !== null) { \HH\set_frame_metadata($hh_frame_metadata); } $rpc_options = $this->getAndResetOptions() ?? \ThriftClientBase::defaultOptions(); $args = C_numbers_args::withDefaultValues(); await $this->asyncHandler_->genBefore("C", "numbers", $args); $currentseqid = $this->sendImplHelper($args, "numbers", false); return await $this->genAwaitStreamResponse(C_numbers_FirstResponse::class, C_numbers_StreamResponse::class, "numbers", true, $currentseqid, $rpc_options); } /** * * Original thrift definition:- * string * thing(1: i32 a, * 2: string b, * 3: set c) * throws (1: Bang bang); */ public async function thing(int $a, string $b, Set $c): 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 = C_thing_args::fromShape(shape( 'a' => $a, 'b' => $b, 'c' => $c, )); await $this->asyncHandler_->genBefore("C", "thing", $args); $currentseqid = $this->sendImplHelper($args, "thing", false); return await $this->genAwaitResponse(C_thing_result::class, "thing", false, $currentseqid, $rpc_options); } /* send and recv functions */ public function send_f(): int { $args = C_f_args::withDefaultValues(); return $this->sendImplHelper($args, "f", false); } public function recv_f(?int $expectedsequenceid = null): void { $this->recvImplHelper(C_f_result::class, "f", true, $expectedsequenceid); } public function send_thing(int $a, string $b, Set $c): int { $args = C_thing_args::fromShape(shape( 'a' => $a, 'b' => $b, 'c' => $c, )); return $this->sendImplHelper($args, "thing", false); } public function recv_thing(?int $expectedsequenceid = null): string { return $this->recvImplHelper(C_thing_result::class, "thing", false, $expectedsequenceid); } } // HELPER FUNCTIONS AND STRUCTURES class C_f_args implements \IThriftSyncStruct, \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 'C_f_args'; } public static function getStructMetadata()[]: \tmeta_ThriftStruct { return tmeta_ThriftStruct::fromShape( shape( "name" => "module.f_args", "is_union" => false, ) ); } public static function getAllStructuredAnnotations()[write_props]: \TStructAnnotations { return shape( 'struct' => dict[], 'fields' => dict[ ], ); } public function getInstanceKey()[write_props]: string { return \TCompactSerializer::serialize($this); } } class C_f_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 'C_f_result'; } public static function getStructMetadata()[]: \tmeta_ThriftStruct { return tmeta_ThriftStruct::fromShape( shape( "name" => "module.C_f_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); } } class C_numbers_args implements \IThriftSyncStruct, \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 'C_numbers_args'; } public static function getStructMetadata()[]: \tmeta_ThriftStruct { return tmeta_ThriftStruct::fromShape( shape( "name" => "module.numbers_args", "is_union" => false, ) ); } public static function getAllStructuredAnnotations()[write_props]: \TStructAnnotations { return shape( 'struct' => dict[], 'fields' => dict[ ], ); } public function getInstanceKey()[write_props]: string { return \TCompactSerializer::serialize($this); } } class C_numbers_StreamResponse extends \ThriftSyncStructWithResult implements \IThriftStructMetadata { use \ThriftSerializationTrait; const type TResult = int; const \ThriftStructTypes::TSpec SPEC = dict[ 0 => shape( 'var' => 'success', 'type' => \TType::I32, ), ]; const dict FIELDMAP = dict[ 'success' => 0, ]; const type TConstructorShape = shape( ?'success' => ?this::TResult, ); const int STRUCTURAL_ID = 1815418233987567820; 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 'C_numbers_StreamResponse'; } public static function getStructMetadata()[]: \tmeta_ThriftStruct { return tmeta_ThriftStruct::fromShape( shape( "name" => "module.C_numbers_StreamResponse", "fields" => vec[ tmeta_ThriftField::fromShape( shape( "id" => 0, "type" => tmeta_ThriftType::fromShape( shape( "t_typedef" => tmeta_ThriftTypedefType::fromShape( shape( "name" => "module.number", "underlyingType" => tmeta_ThriftType::fromShape( shape( "t_primitive" => tmeta_ThriftPrimitiveType::THRIFT_I32_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); } } class C_numbers_FirstResponse 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 'C_numbers_FirstResponse'; } public static function getStructMetadata()[]: \tmeta_ThriftStruct { return tmeta_ThriftStruct::fromShape( shape( "name" => "module.C_numbers_FirstResponse", "is_union" => false, ) ); } public static function getAllStructuredAnnotations()[write_props]: \TStructAnnotations { return shape( 'struct' => dict[], 'fields' => dict[ ], ); } public function getInstanceKey()[write_props]: string { return \TCompactSerializer::serialize($this); } } class C_thing_args implements \IThriftSyncStruct, \IThriftStructMetadata { use \ThriftSerializationTrait; const \ThriftStructTypes::TSpec SPEC = dict[ 1 => shape( 'var' => 'a', 'type' => \TType::I32, ), 2 => shape( 'var' => 'b', 'type' => \TType::STRING, ), 3 => shape( 'var' => 'c', 'type' => \TType::SET, 'etype' => \TType::I32, 'elem' => shape( 'type' => \TType::I32, ), 'format' => 'collection', ), ]; const dict FIELDMAP = dict[ 'a' => 1, 'b' => 2, 'c' => 3, ]; const type TConstructorShape = shape( ?'a' => ?int, ?'b' => ?string, ?'c' => ?Set, ); const int STRUCTURAL_ID = 5152653522450717322; public int $a; public string $b; public Set $c; public function __construct(?int $a = null, ?string $b = null, ?Set $c = null)[] { $this->a = $a ?? 0; $this->b = $b ?? ''; $this->c = $c ?? Set {}; } public static function withDefaultValues()[]: this { return new static(); } public static function fromShape(self::TConstructorShape $shape)[]: this { return new static( Shapes::idx($shape, 'a'), Shapes::idx($shape, 'b'), Shapes::idx($shape, 'c'), ); } public function getName()[]: string { return 'C_thing_args'; } public static function getStructMetadata()[]: \tmeta_ThriftStruct { return tmeta_ThriftStruct::fromShape( shape( "name" => "module.thing_args", "fields" => vec[ tmeta_ThriftField::fromShape( shape( "id" => 1, "type" => tmeta_ThriftType::fromShape( shape( "t_primitive" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE, ) ), "name" => "a", ) ), tmeta_ThriftField::fromShape( shape( "id" => 2, "type" => tmeta_ThriftType::fromShape( shape( "t_primitive" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE, ) ), "name" => "b", ) ), tmeta_ThriftField::fromShape( shape( "id" => 3, "type" => tmeta_ThriftType::fromShape( shape( "t_set" => tmeta_ThriftSetType::fromShape( shape( "valueType" => tmeta_ThriftType::fromShape( shape( "t_primitive" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE, ) ), ) ), ) ), "name" => "c", ) ), ], "is_union" => false, ) ); } public static function getAllStructuredAnnotations()[write_props]: \TStructAnnotations { return shape( 'struct' => dict[], 'fields' => dict[ ], ); } public function getInstanceKey()[write_props]: string { return \TCompactSerializer::serialize($this); } } class C_thing_result extends \ThriftSyncStructWithResult implements \IThriftStructMetadata { use \ThriftSerializationTrait; const type TResult = string; const \ThriftStructTypes::TSpec SPEC = dict[ 0 => shape( 'var' => 'success', 'type' => \TType::STRING, ), 1 => shape( 'var' => 'bang', 'type' => \TType::STRUCT, 'class' => Bang::class, ), ]; const dict FIELDMAP = dict[ 'success' => 0, 'bang' => 1, ]; const type TConstructorShape = shape( ?'success' => ?this::TResult, ?'bang' => ?Bang, ); const int STRUCTURAL_ID = 8456199022957829086; public ?this::TResult $success; public ?Bang $bang; public function __construct(?this::TResult $success = null, ?Bang $bang = null)[] { $this->success = $success; $this->bang = $bang; } public static function withDefaultValues()[]: this { return new static(); } public static function fromShape(self::TConstructorShape $shape)[]: this { return new static( Shapes::idx($shape, 'success'), Shapes::idx($shape, 'bang'), ); } public function getName()[]: string { return 'C_thing_result'; } public static function getStructMetadata()[]: \tmeta_ThriftStruct { return tmeta_ThriftStruct::fromShape( shape( "name" => "module.C_thing_result", "fields" => vec[ tmeta_ThriftField::fromShape( shape( "id" => 0, "type" => tmeta_ThriftType::fromShape( shape( "t_primitive" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE, ) ), "name" => "success", ) ), tmeta_ThriftField::fromShape( shape( "id" => 1, "type" => tmeta_ThriftType::fromShape( shape( "t_struct" => tmeta_ThriftStructType::fromShape( shape( "name" => "module.Bang", ) ), ) ), "name" => "bang", ) ), ], "is_union" => false, ) ); } public static function getAllStructuredAnnotations()[write_props]: \TStructAnnotations { return shape( 'struct' => dict[], 'fields' => dict[ ], ); } public function getInstanceKey()[write_props]: string { return \TCompactSerializer::serialize($this); } public function checkForException(): ?\TException { if ($this->bang !== null) { return $this->bang; } return null; } public function setException(\TException $e): bool { if ($e is Bang) { $this->bang = $e; return true; } return false; } } class CStaticMetadata implements \IThriftServiceStaticMetadata { public static function getServiceMetadata()[]: \tmeta_ThriftService { return tmeta_ThriftService::fromShape( shape( "name" => "module.C", "functions" => vec[ tmeta_ThriftFunction::fromShape( shape( "name" => "f", "return_type" => tmeta_ThriftType::fromShape( shape( "t_primitive" => tmeta_ThriftPrimitiveType::THRIFT_VOID_TYPE, ) ), ) ), tmeta_ThriftFunction::fromShape( shape( "name" => "numbers", "return_type" => tmeta_ThriftType::fromShape( shape( "t_stream" => tmeta_ThriftStreamType::fromShape( shape( "elemType" => tmeta_ThriftType::fromShape( shape( "t_typedef" => tmeta_ThriftTypedefType::fromShape( shape( "name" => "module.number", "underlyingType" => tmeta_ThriftType::fromShape( shape( "t_primitive" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE, ) ), ) ), ) ), "initialResponseType" => tmeta_ThriftType::fromShape( shape( "t_primitive" => tmeta_ThriftPrimitiveType::THRIFT_VOID_TYPE, ) ), ) ), ) ), ) ), tmeta_ThriftFunction::fromShape( shape( "name" => "thing", "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_I32_TYPE, ) ), "name" => "a", ) ), tmeta_ThriftField::fromShape( shape( "id" => 2, "type" => tmeta_ThriftType::fromShape( shape( "t_primitive" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE, ) ), "name" => "b", ) ), tmeta_ThriftField::fromShape( shape( "id" => 3, "type" => tmeta_ThriftType::fromShape( shape( "t_set" => tmeta_ThriftSetType::fromShape( shape( "valueType" => tmeta_ThriftType::fromShape( shape( "t_primitive" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE, ) ), ) ), ) ), "name" => "c", ) ), ], "exceptions" => vec[ tmeta_ThriftField::fromShape( shape( "id" => 1, "type" => tmeta_ThriftType::fromShape( shape( "t_struct" => tmeta_ThriftStructType::fromShape( shape( "name" => "module.Bang", ) ), ) ), "name" => "bang", ) ), ], ) ), ], ) ); } 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.Bang' => Bang::getExceptionMetadata(), ], 'services' => dict[ ], ) ), ) ); } public static function getAllStructuredAnnotations()[write_props]: \TServiceAnnotations { return shape( 'service' => dict[], 'functions' => dict[ ], ); } }