3 * Autogenerated by Thrift
5 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
9 namespace thrift\annotation\hack
;
12 * Original thrift struct:-
15 <<\
ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/hack/FieldWrapper'))>>
16 class FieldWrapper
implements \IThriftSyncStruct
, \IThriftShapishSyncStruct
{
17 use \ThriftSerializationTrait
;
19 const dict
<int, this
::TFieldSpec
> SPEC
= dict
[
22 'type' => \TType
::STRING,
25 const dict
<string, int> FIELDMAP
= dict
[
29 const type TConstructorShape
= shape(
33 const type TShape
= shape(
36 const int STRUCTURAL_ID
= 2593878277785201336;
38 * Original thrift field:-
43 public function __construct(?
string $name = null)[] {
44 $this->name
= $name ??
'';
47 public static function withDefaultValues()[]: this
{
51 public static function fromShape(self
::TConstructorShape
$shape)[]: this
{
53 Shapes
::idx($shape, 'name'),
57 public static function fromMap_DEPRECATED(@KeyedContainer
<string, mixed> $map)[]: this
{
59 HH\FIXME\UNSAFE_CAST
<mixed, string>(idx($map, 'name'), 'map value is mixed'),
63 public function getName()[]: string {
64 return 'FieldWrapper';
67 public static function getStructMetadata()[]: \tmeta_ThriftStruct
{
68 return \tmeta_ThriftStruct
::fromShape(
70 "name" => "hack.FieldWrapper",
72 \tmeta_ThriftField
::fromShape(
75 "type" => \tmeta_ThriftType
::fromShape(
77 "t_primitive" => \tmeta_ThriftPrimitiveType
::THRIFT_STRING_TYPE
,
89 public static function getAllStructuredAnnotations()[write_props
]: \TStructAnnotations
{
92 '\thrift\annotation\Field' => \thrift\annotation\Field
::fromShape(
102 public static function __stringifyMapKeys
<T
>(dict
<arraykey
, T
> $m)[]: dict
<string, T
> {
103 return Dict\
map_keys($m, $key ==> (string)$key);
106 public static function __fromShape(self
::TShape
$shape)[]: this
{
112 public function __toShape()[]: self
::TShape
{
114 'name' => $this->name
,
117 public function getInstanceKey()[write_props
]: string {
118 return \TCompactSerializer
::serialize($this);
121 public function readFromJson(string $jsonText): void
{
122 $parsed = json_decode($jsonText, true);
124 if ($parsed === null ||
!($parsed is KeyedContainer
<_
, _
>)) {
125 throw new \
TProtocolException("Cannot parse the given json string.");
128 if (idx($parsed, 'name') !== null) {
129 $this->name
= HH\FIXME\UNSAFE_CAST
<mixed, string>($parsed['name']);
136 * Original thrift struct:-
139 <<\
ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/hack/Wrapper'))>>
140 class Wrapper
implements \IThriftSyncStruct
, \IThriftShapishSyncStruct
{
141 use \ThriftSerializationTrait
;
143 const dict
<int, this
::TFieldSpec
> SPEC
= dict
[
146 'type' => \TType
::STRING,
149 'var' => 'underlyingName',
150 'type' => \TType
::STRING,
153 'var' => 'extraNamespace',
154 'type' => \TType
::STRING,
157 const dict
<string, int> FIELDMAP
= dict
[
159 'underlyingName' => 2,
160 'extraNamespace' => 3,
163 const type TConstructorShape
= shape(
165 ?
'underlyingName' => ?
string,
166 ?
'extraNamespace' => ?
string,
169 const type TShape
= shape(
171 'underlyingName' => string,
172 'extraNamespace' => string,
174 const int STRUCTURAL_ID
= 1284986773698322040;
176 * Original thrift field:-
181 * Original thrift field:-
182 * 2: string underlyingName
184 public string $underlyingName;
186 * Original thrift field:-
187 * 3: string extraNamespace
189 public string $extraNamespace;
191 public function __construct(?
string $name = null, ?
string $underlyingName = null, ?
string $extraNamespace = null)[] {
192 $this->name
= $name ??
'';
193 $this->underlyingName
= $underlyingName ??
'';
194 $this->extraNamespace
= $extraNamespace ??
"thrift_adapted_types";
197 public static function withDefaultValues()[]: this
{
201 public static function fromShape(self
::TConstructorShape
$shape)[]: this
{
203 Shapes
::idx($shape, 'name'),
204 Shapes
::idx($shape, 'underlyingName'),
205 Shapes
::idx($shape, 'extraNamespace'),
209 public static function fromMap_DEPRECATED(@KeyedContainer
<string, mixed> $map)[]: this
{
211 HH\FIXME\UNSAFE_CAST
<mixed, string>(idx($map, 'name'), 'map value is mixed'),
212 HH\FIXME\UNSAFE_CAST
<mixed, string>(idx($map, 'underlyingName'), 'map value is mixed'),
213 HH\FIXME\UNSAFE_CAST
<mixed, string>(idx($map, 'extraNamespace'), 'map value is mixed'),
217 public function getName()[]: string {
221 public static function getStructMetadata()[]: \tmeta_ThriftStruct
{
222 return \tmeta_ThriftStruct
::fromShape(
224 "name" => "hack.Wrapper",
226 \tmeta_ThriftField
::fromShape(
229 "type" => \tmeta_ThriftType
::fromShape(
231 "t_primitive" => \tmeta_ThriftPrimitiveType
::THRIFT_STRING_TYPE
,
237 \tmeta_ThriftField
::fromShape(
240 "type" => \tmeta_ThriftType
::fromShape(
242 "t_primitive" => \tmeta_ThriftPrimitiveType
::THRIFT_STRING_TYPE
,
245 "name" => "underlyingName",
248 \tmeta_ThriftField
::fromShape(
251 "type" => \tmeta_ThriftType
::fromShape(
253 "t_primitive" => \tmeta_ThriftPrimitiveType
::THRIFT_STRING_TYPE
,
256 "name" => "extraNamespace",
265 public static function getAllStructuredAnnotations()[write_props
]: \TStructAnnotations
{
268 '\thrift\annotation\Typedef' => \thrift\annotation\Typedef
::fromShape(
272 '\thrift\annotation\Struct' => \thrift\annotation\Struct
::fromShape(
276 '\thrift\annotation\Field' => \thrift\annotation\Field
::fromShape(
286 public static function __stringifyMapKeys
<T
>(dict
<arraykey
, T
> $m)[]: dict
<string, T
> {
287 return Dict\
map_keys($m, $key ==> (string)$key);
290 public static function __fromShape(self
::TShape
$shape)[]: this
{
293 $shape['underlyingName'],
294 $shape['extraNamespace'],
298 public function __toShape()[]: self
::TShape
{
300 'name' => $this->name
,
301 'underlyingName' => $this->underlyingName
,
302 'extraNamespace' => $this->extraNamespace
,
305 public function getInstanceKey()[write_props
]: string {
306 return \TCompactSerializer
::serialize($this);
309 public function readFromJson(string $jsonText): void
{
310 $parsed = json_decode($jsonText, true);
312 if ($parsed === null ||
!($parsed is KeyedContainer
<_
, _
>)) {
313 throw new \
TProtocolException("Cannot parse the given json string.");
316 if (idx($parsed, 'name') !== null) {
317 $this->name
= HH\FIXME\UNSAFE_CAST
<mixed, string>($parsed['name']);
319 if (idx($parsed, 'underlyingName') !== null) {
320 $this->underlyingName
= HH\FIXME\UNSAFE_CAST
<mixed, string>($parsed['underlyingName']);
322 if (idx($parsed, 'extraNamespace') !== null) {
323 $this->extraNamespace
= HH\FIXME\UNSAFE_CAST
<mixed, string>($parsed['extraNamespace']);
330 * Original thrift struct:-
333 <<\
ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/hack/Adapter'))>>
334 class Adapter
implements \IThriftSyncStruct
, \IThriftShapishSyncStruct
{
335 use \ThriftSerializationTrait
;
337 const dict
<int, this
::TFieldSpec
> SPEC
= dict
[
340 'type' => \TType
::STRING,
343 const dict
<string, int> FIELDMAP
= dict
[
347 const type TConstructorShape
= shape(
351 const type TShape
= shape(
354 const int STRUCTURAL_ID
= 2593878277785201336;
356 * Original thrift field:-
361 public function __construct(?
string $name = null)[] {
362 $this->name
= $name ??
'';
365 public static function withDefaultValues()[]: this
{
369 public static function fromShape(self
::TConstructorShape
$shape)[]: this
{
371 Shapes
::idx($shape, 'name'),
375 public static function fromMap_DEPRECATED(@KeyedContainer
<string, mixed> $map)[]: this
{
377 HH\FIXME\UNSAFE_CAST
<mixed, string>(idx($map, 'name'), 'map value is mixed'),
381 public function getName()[]: string {
385 public static function getStructMetadata()[]: \tmeta_ThriftStruct
{
386 return \tmeta_ThriftStruct
::fromShape(
388 "name" => "hack.Adapter",
390 \tmeta_ThriftField
::fromShape(
393 "type" => \tmeta_ThriftType
::fromShape(
395 "t_primitive" => \tmeta_ThriftPrimitiveType
::THRIFT_STRING_TYPE
,
407 public static function getAllStructuredAnnotations()[write_props
]: \TStructAnnotations
{
410 '\thrift\annotation\Typedef' => \thrift\annotation\Typedef
::fromShape(
414 '\thrift\annotation\Field' => \thrift\annotation\Field
::fromShape(
424 public static function __stringifyMapKeys
<T
>(dict
<arraykey
, T
> $m)[]: dict
<string, T
> {
425 return Dict\
map_keys($m, $key ==> (string)$key);
428 public static function __fromShape(self
::TShape
$shape)[]: this
{
434 public function __toShape()[]: self
::TShape
{
436 'name' => $this->name
,
439 public function getInstanceKey()[write_props
]: string {
440 return \TCompactSerializer
::serialize($this);
443 public function readFromJson(string $jsonText): void
{
444 $parsed = json_decode($jsonText, true);
446 if ($parsed === null ||
!($parsed is KeyedContainer
<_
, _
>)) {
447 throw new \
TProtocolException("Cannot parse the given json string.");
450 if (idx($parsed, 'name') !== null) {
451 $this->name
= HH\FIXME\UNSAFE_CAST
<mixed, string>($parsed['name']);
458 * Original thrift struct:-
461 <<\
ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/hack/SkipCodegen'))>>
462 class SkipCodegen
implements \IThriftSyncStruct
, \IThriftShapishSyncStruct
{
463 use \ThriftSerializationTrait
;
465 const dict
<int, this
::TFieldSpec
> SPEC
= dict
[
468 'type' => \TType
::STRING,
471 const dict
<string, int> FIELDMAP
= dict
[
475 const type TConstructorShape
= shape(
476 ?
'reason' => ?
string,
479 const type TShape
= shape(
482 const int STRUCTURAL_ID
= 3707764047816594739;
484 * Original thrift field:-
487 public string $reason;
489 public function __construct(?
string $reason = null)[] {
490 $this->reason
= $reason ??
'';
493 public static function withDefaultValues()[]: this
{
497 public static function fromShape(self
::TConstructorShape
$shape)[]: this
{
499 Shapes
::idx($shape, 'reason'),
503 public static function fromMap_DEPRECATED(@KeyedContainer
<string, mixed> $map)[]: this
{
505 HH\FIXME\UNSAFE_CAST
<mixed, string>(idx($map, 'reason'), 'map value is mixed'),
509 public function getName()[]: string {
510 return 'SkipCodegen';
513 public static function getStructMetadata()[]: \tmeta_ThriftStruct
{
514 return \tmeta_ThriftStruct
::fromShape(
516 "name" => "hack.SkipCodegen",
518 \tmeta_ThriftField
::fromShape(
521 "type" => \tmeta_ThriftType
::fromShape(
523 "t_primitive" => \tmeta_ThriftPrimitiveType
::THRIFT_STRING_TYPE
,
535 public static function getAllStructuredAnnotations()[write_props
]: \TStructAnnotations
{
538 '\thrift\annotation\Field' => \thrift\annotation\Field
::fromShape(
542 '\thrift\annotation\TFunction' => \thrift\annotation\TFunction
::fromShape(
552 public static function __stringifyMapKeys
<T
>(dict
<arraykey
, T
> $m)[]: dict
<string, T
> {
553 return Dict\
map_keys($m, $key ==> (string)$key);
556 public static function __fromShape(self
::TShape
$shape)[]: this
{
562 public function __toShape()[]: self
::TShape
{
564 'reason' => $this->reason
,
567 public function getInstanceKey()[write_props
]: string {
568 return \TCompactSerializer
::serialize($this);
571 public function readFromJson(string $jsonText): void
{
572 $parsed = json_decode($jsonText, true);
574 if ($parsed === null ||
!($parsed is KeyedContainer
<_
, _
>)) {
575 throw new \
TProtocolException("Cannot parse the given json string.");
578 if (idx($parsed, 'reason') !== null) {
579 $this->reason
= HH\FIXME\UNSAFE_CAST
<mixed, string>($parsed['reason']);
586 * Original thrift struct:-
589 <<\
ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/hack/Name'))>>
590 class Name
implements \IThriftSyncStruct
, \IThriftShapishSyncStruct
{
591 use \ThriftSerializationTrait
;
593 const dict
<int, this
::TFieldSpec
> SPEC
= dict
[
596 'type' => \TType
::STRING,
600 'type' => \TType
::STRING,
603 const dict
<string, int> FIELDMAP
= dict
[
608 const type TConstructorShape
= shape(
610 ?
'reason' => ?
string,
613 const type TShape
= shape(
617 const int STRUCTURAL_ID
= 4844827548325959202;
619 * Original thrift field:-
624 * Original thrift field:-
627 public string $reason;
629 public function __construct(?
string $name = null, ?
string $reason = null)[] {
630 $this->name
= $name ??
'';
631 $this->reason
= $reason ??
'';
634 public static function withDefaultValues()[]: this
{
638 public static function fromShape(self
::TConstructorShape
$shape)[]: this
{
640 Shapes
::idx($shape, 'name'),
641 Shapes
::idx($shape, 'reason'),
645 public static function fromMap_DEPRECATED(@KeyedContainer
<string, mixed> $map)[]: this
{
647 HH\FIXME\UNSAFE_CAST
<mixed, string>(idx($map, 'name'), 'map value is mixed'),
648 HH\FIXME\UNSAFE_CAST
<mixed, string>(idx($map, 'reason'), 'map value is mixed'),
652 public function getName()[]: string {
656 public static function getStructMetadata()[]: \tmeta_ThriftStruct
{
657 return \tmeta_ThriftStruct
::fromShape(
659 "name" => "hack.Name",
661 \tmeta_ThriftField
::fromShape(
664 "type" => \tmeta_ThriftType
::fromShape(
666 "t_primitive" => \tmeta_ThriftPrimitiveType
::THRIFT_STRING_TYPE
,
672 \tmeta_ThriftField
::fromShape(
675 "type" => \tmeta_ThriftType
::fromShape(
677 "t_primitive" => \tmeta_ThriftPrimitiveType
::THRIFT_STRING_TYPE
,
689 public static function getAllStructuredAnnotations()[write_props
]: \TStructAnnotations
{
697 public static function __stringifyMapKeys
<T
>(dict
<arraykey
, T
> $m)[]: dict
<string, T
> {
698 return Dict\
map_keys($m, $key ==> (string)$key);
701 public static function __fromShape(self
::TShape
$shape)[]: this
{
708 public function __toShape()[]: self
::TShape
{
710 'name' => $this->name
,
711 'reason' => $this->reason
,
714 public function getInstanceKey()[write_props
]: string {
715 return \TCompactSerializer
::serialize($this);
718 public function readFromJson(string $jsonText): void
{
719 $parsed = json_decode($jsonText, true);
721 if ($parsed === null ||
!($parsed is KeyedContainer
<_
, _
>)) {
722 throw new \
TProtocolException("Cannot parse the given json string.");
725 if (idx($parsed, 'name') !== null) {
726 $this->name
= HH\FIXME\UNSAFE_CAST
<mixed, string>($parsed['name']);
728 if (idx($parsed, 'reason') !== null) {
729 $this->reason
= HH\FIXME\UNSAFE_CAST
<mixed, string>($parsed['reason']);
736 * Original thrift struct:-
737 * UnionEnumAttributes
739 <<\
ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/hack/UnionEnumAttributes'))>>
740 class UnionEnumAttributes
implements \IThriftSyncStruct
, \IThriftShapishSyncStruct
{
741 use \ThriftSerializationTrait
;
743 const dict
<int, this
::TFieldSpec
> SPEC
= dict
[
745 'var' => 'attributes',
746 'type' => \TType
::LST
,
747 'etype' => \TType
::STRING,
749 'type' => \TType
::STRING,
751 'format' => 'harray',
754 const dict
<string, int> FIELDMAP
= dict
[
758 const type TConstructorShape
= shape(
759 ?
'attributes' => ?vec
<string>,
762 const type TShape
= shape(
763 'attributes' => vec
<string>,
765 const int STRUCTURAL_ID
= 4379867690114498379;
767 * Original thrift field:-
768 * 1: list<string> attributes
770 public vec
<string> $attributes;
772 public function __construct(?vec
<string> $attributes = null)[] {
773 $this->attributes
= $attributes ?? vec
[];
776 public static function withDefaultValues()[]: this
{
780 public static function fromShape(self
::TConstructorShape
$shape)[]: this
{
782 Shapes
::idx($shape, 'attributes'),
786 public static function fromMap_DEPRECATED(@KeyedContainer
<string, mixed> $map)[]: this
{
788 HH\FIXME\UNSAFE_CAST
<mixed, vec
<string>>(idx($map, 'attributes'), 'map value is mixed'),
792 public function getName()[]: string {
793 return 'UnionEnumAttributes';
796 public static function getStructMetadata()[]: \tmeta_ThriftStruct
{
797 return \tmeta_ThriftStruct
::fromShape(
799 "name" => "hack.UnionEnumAttributes",
801 \tmeta_ThriftField
::fromShape(
804 "type" => \tmeta_ThriftType
::fromShape(
806 "t_list" => \tmeta_ThriftListType
::fromShape(
808 "valueType" => \tmeta_ThriftType
::fromShape(
810 "t_primitive" => \tmeta_ThriftPrimitiveType
::THRIFT_STRING_TYPE
,
817 "name" => "attributes",
826 public static function getAllStructuredAnnotations()[write_props
]: \TStructAnnotations
{
829 '\thrift\annotation\Union' => \thrift\annotation\Union
::fromShape(
839 public static function __stringifyMapKeys
<T
>(dict
<arraykey
, T
> $m)[]: dict
<string, T
> {
840 return Dict\
map_keys($m, $key ==> (string)$key);
843 public static function __fromShape(self
::TShape
$shape)[]: this
{
845 $shape['attributes'],
849 public function __toShape()[]: self
::TShape
{
851 'attributes' => $this->attributes
,
854 public function getInstanceKey()[write_props
]: string {
855 return \TCompactSerializer
::serialize($this);
858 public function readFromJson(string $jsonText): void
{
859 $parsed = json_decode($jsonText, true);
861 if ($parsed === null ||
!($parsed is KeyedContainer
<_
, _
>)) {
862 throw new \
TProtocolException("Cannot parse the given json string.");
865 if (idx($parsed, 'attributes') !== null) {
866 $_json3 = HH\FIXME\UNSAFE_CAST
<mixed, vec
<string>>($parsed['attributes']);
867 $_container4 = vec
[];
868 foreach($_json3 as $_key1 => $_value2) {
871 $_container4 []= $_elem5;
873 $this->attributes
= $_container4;
880 * Original thrift struct:-
883 <<\
ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/hack/StructTrait'))>>
884 class StructTrait
implements \IThriftSyncStruct
, \IThriftShapishSyncStruct
{
885 use \ThriftSerializationTrait
;
887 const dict
<int, this
::TFieldSpec
> SPEC
= dict
[
890 'type' => \TType
::STRING,
893 const dict
<string, int> FIELDMAP
= dict
[
897 const type TConstructorShape
= shape(
901 const type TShape
= shape(
904 const int STRUCTURAL_ID
= 2593878277785201336;
906 * Original thrift field:-
911 public function __construct(?
string $name = null)[] {
912 $this->name
= $name ??
'';
915 public static function withDefaultValues()[]: this
{
919 public static function fromShape(self
::TConstructorShape
$shape)[]: this
{
921 Shapes
::idx($shape, 'name'),
925 public static function fromMap_DEPRECATED(@KeyedContainer
<string, mixed> $map)[]: this
{
927 HH\FIXME\UNSAFE_CAST
<mixed, string>(idx($map, 'name'), 'map value is mixed'),
931 public function getName()[]: string {
932 return 'StructTrait';
935 public static function getStructMetadata()[]: \tmeta_ThriftStruct
{
936 return \tmeta_ThriftStruct
::fromShape(
938 "name" => "hack.StructTrait",
940 \tmeta_ThriftField
::fromShape(
943 "type" => \tmeta_ThriftType
::fromShape(
945 "t_primitive" => \tmeta_ThriftPrimitiveType
::THRIFT_STRING_TYPE
,
957 public static function getAllStructuredAnnotations()[write_props
]: \TStructAnnotations
{
960 '\thrift\annotation\Struct' => \thrift\annotation\Struct
::fromShape(
970 public static function __stringifyMapKeys
<T
>(dict
<arraykey
, T
> $m)[]: dict
<string, T
> {
971 return Dict\
map_keys($m, $key ==> (string)$key);
974 public static function __fromShape(self
::TShape
$shape)[]: this
{
980 public function __toShape()[]: self
::TShape
{
982 'name' => $this->name
,
985 public function getInstanceKey()[write_props
]: string {
986 return \TCompactSerializer
::serialize($this);
989 public function readFromJson(string $jsonText): void
{
990 $parsed = json_decode($jsonText, true);
992 if ($parsed === null ||
!($parsed is KeyedContainer
<_
, _
>)) {
993 throw new \
TProtocolException("Cannot parse the given json string.");
996 if (idx($parsed, 'name') !== null) {
997 $this->name
= HH\FIXME\UNSAFE_CAST
<mixed, string>($parsed['name']);
1004 * Original thrift struct:-
1007 <<\
ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/hack/Attributes'))>>
1008 class Attributes
implements \IThriftSyncStruct
, \IThriftShapishSyncStruct
{
1009 use \ThriftSerializationTrait
;
1011 const dict
<int, this
::TFieldSpec
> SPEC
= dict
[
1013 'var' => 'attributes',
1014 'type' => \TType
::LST
,
1015 'etype' => \TType
::STRING,
1017 'type' => \TType
::STRING,
1019 'format' => 'harray',
1022 const dict
<string, int> FIELDMAP
= dict
[
1026 const type TConstructorShape
= shape(
1027 ?
'attributes' => ?vec
<string>,
1030 const type TShape
= shape(
1031 'attributes' => vec
<string>,
1033 const int STRUCTURAL_ID
= 4379867690114498379;
1035 * Original thrift field:-
1036 * 1: list<string> attributes
1038 public vec
<string> $attributes;
1040 public function __construct(?vec
<string> $attributes = null)[] {
1041 $this->attributes
= $attributes ?? vec
[];
1044 public static function withDefaultValues()[]: this
{
1045 return new static();
1048 public static function fromShape(self
::TConstructorShape
$shape)[]: this
{
1050 Shapes
::idx($shape, 'attributes'),
1054 public static function fromMap_DEPRECATED(@KeyedContainer
<string, mixed> $map)[]: this
{
1056 HH\FIXME\UNSAFE_CAST
<mixed, vec
<string>>(idx($map, 'attributes'), 'map value is mixed'),
1060 public function getName()[]: string {
1061 return 'Attributes';
1064 public static function getStructMetadata()[]: \tmeta_ThriftStruct
{
1065 return \tmeta_ThriftStruct
::fromShape(
1067 "name" => "hack.Attributes",
1069 \tmeta_ThriftField
::fromShape(
1072 "type" => \tmeta_ThriftType
::fromShape(
1074 "t_list" => \tmeta_ThriftListType
::fromShape(
1076 "valueType" => \tmeta_ThriftType
::fromShape(
1078 "t_primitive" => \tmeta_ThriftPrimitiveType
::THRIFT_STRING_TYPE
,
1085 "name" => "attributes",
1089 "is_union" => false,
1094 public static function getAllStructuredAnnotations()[write_props
]: \TStructAnnotations
{
1102 public static function __stringifyMapKeys
<T
>(dict
<arraykey
, T
> $m)[]: dict
<string, T
> {
1103 return Dict\
map_keys($m, $key ==> (string)$key);
1106 public static function __fromShape(self
::TShape
$shape)[]: this
{
1108 $shape['attributes'],
1112 public function __toShape()[]: self
::TShape
{
1114 'attributes' => $this->attributes
,
1117 public function getInstanceKey()[write_props
]: string {
1118 return \TCompactSerializer
::serialize($this);
1121 public function readFromJson(string $jsonText): void
{
1122 $parsed = json_decode($jsonText, true);
1124 if ($parsed === null ||
!($parsed is KeyedContainer
<_
, _
>)) {
1125 throw new \
TProtocolException("Cannot parse the given json string.");
1128 if (idx($parsed, 'attributes') !== null) {
1129 $_json3 = HH\FIXME\UNSAFE_CAST
<mixed, vec
<string>>($parsed['attributes']);
1130 $_container4 = vec
[];
1131 foreach($_json3 as $_key1 => $_value2) {
1134 $_container4 []= $_elem5;
1136 $this->attributes
= $_container4;
1143 * Original thrift struct:-
1146 <<\
ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/annotation/hack/StructAsTrait'))>>
1147 class StructAsTrait
implements \IThriftSyncStruct
, \IThriftShapishSyncStruct
{
1148 use \ThriftSerializationTrait
;
1150 const dict
<int, this
::TFieldSpec
> SPEC
= dict
[
1152 const dict
<string, int> FIELDMAP
= dict
[
1155 const type TConstructorShape
= shape(
1158 const type TShape
= shape(
1160 const int STRUCTURAL_ID
= 957977401221134810;
1162 public function __construct()[] {
1165 public static function withDefaultValues()[]: this
{
1166 return new static();
1169 public static function fromShape(self
::TConstructorShape
$shape)[]: this
{
1174 public static function fromMap_DEPRECATED(@KeyedContainer
<string, mixed> $map)[]: this
{
1179 public function getName()[]: string {
1180 return 'StructAsTrait';
1183 public static function getStructMetadata()[]: \tmeta_ThriftStruct
{
1184 return \tmeta_ThriftStruct
::fromShape(
1186 "name" => "hack.StructAsTrait",
1187 "is_union" => false,
1192 public static function getAllStructuredAnnotations()[write_props
]: \TStructAnnotations
{
1195 '\thrift\annotation\Struct' => \thrift\annotation\Struct
::fromShape(
1205 public static function __stringifyMapKeys
<T
>(dict
<arraykey
, T
> $m)[]: dict
<string, T
> {
1206 return Dict\
map_keys($m, $key ==> (string)$key);
1209 public static function __fromShape(self
::TShape
$shape)[]: this
{
1214 public function __toShape()[]: self
::TShape
{
1218 public function getInstanceKey()[write_props
]: string {
1219 return \TCompactSerializer
::serialize($this);
1222 public function readFromJson(string $jsonText): void
{
1223 $parsed = json_decode($jsonText, true);
1225 if ($parsed === null ||
!($parsed is KeyedContainer
<_
, _
>)) {
1226 throw new \
TProtocolException("Cannot parse the given json string.");