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

namespace apache\thrift\fixtures\types;

/**
 * Original thrift enum:-
 * has_bitwise_ops
 */
<<\ThriftTypeInfo(shape('uri' => 'apache.org/thrift/fixtures/types/has_bitwise_ops'))>>
enum has_bitwise_ops: int {
  none = 0;
  zero = 1;
  one = 2;
  two = 4;
  three = 8;
}

class has_bitwise_ops_TEnumStaticMetadata implements \IThriftEnumStaticMetadata {
  public static function getEnumMetadata()[]: \tmeta_ThriftEnum {
    return \tmeta_ThriftEnum::fromShape(
      shape(
        "name" => "module.has_bitwise_ops",
        "elements" => dict[
          0 => "none",
          1 => "zero",
          2 => "one",
          4 => "two",
          8 => "three",
        ],
      )
    );
  }

  public static function getAllStructuredAnnotations()[write_props]: \TEnumAnnotations {
    return shape(
      'enum' => dict[],
      'constants' => dict[
      ],
    );
  }
}

/**
 * Original thrift enum:-
 * is_unscoped
 */
<<\ThriftTypeInfo(shape('uri' => 'apache.org/thrift/fixtures/types/is_unscoped'))>>
enum is_unscoped: int {
  hello = 0;
  world = 1;
}

class is_unscoped_TEnumStaticMetadata implements \IThriftEnumStaticMetadata {
  public static function getEnumMetadata()[]: \tmeta_ThriftEnum {
    return \tmeta_ThriftEnum::fromShape(
      shape(
        "name" => "module.is_unscoped",
        "elements" => dict[
          0 => "hello",
          1 => "world",
        ],
      )
    );
  }

  public static function getAllStructuredAnnotations()[write_props]: \TEnumAnnotations {
    return shape(
      'enum' => dict[],
      'constants' => dict[
      ],
    );
  }
}

/**
 * Original thrift enum:-
 * MyForwardRefEnum
 */
<<\ThriftTypeInfo(shape('uri' => 'apache.org/thrift/fixtures/types/MyForwardRefEnum'))>>
enum MyForwardRefEnum: int {
  ZERO = 0;
  NONZERO = 12;
}

class MyForwardRefEnum_TEnumStaticMetadata implements \IThriftEnumStaticMetadata {
  public static function getEnumMetadata()[]: \tmeta_ThriftEnum {
    return \tmeta_ThriftEnum::fromShape(
      shape(
        "name" => "module.MyForwardRefEnum",
        "elements" => dict[
          0 => "ZERO",
          12 => "NONZERO",
        ],
      )
    );
  }

  public static function getAllStructuredAnnotations()[write_props]: \TEnumAnnotations {
    return shape(
      'enum' => dict[],
      'constants' => dict[
      ],
    );
  }
}

/**
 * Original thrift struct:-
 * empty_struct
 */
<<\ThriftTypeInfo(shape('uri' => 'apache.org/thrift/fixtures/types/empty_struct'))>>
class empty_struct implements \IThriftSyncStruct, \IThriftStructMetadata {
  use \ThriftSerializationTrait;

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

  const type TConstructorShape = shape(
  );

  const int STRUCTURAL_ID = 957977401221134810;

  public function __construct()[] {
  }

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

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

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

  public static function getStructMetadata()[]: \tmeta_ThriftStruct {
    return \tmeta_ThriftStruct::fromShape(
      shape(
        "name" => "module.empty_struct",
        "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.");
    }

  }

}

/**
 * Original thrift struct:-
 * decorated_struct
 */
<<\ThriftTypeInfo(shape('uri' => 'apache.org/thrift/fixtures/types/decorated_struct'))>>
class decorated_struct implements \IThriftSyncStruct, \IThriftStructMetadata {
  use \ThriftSerializationTrait;

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

  const type TConstructorShape = shape(
    ?'field' => ?string,
  );

  const int STRUCTURAL_ID = 6158382972310209096;
  /**
   * Original thrift field:-
   * 1: string field
   */
  public string $field;

  public function __construct(?string $field = null)[] {
    $this->field = $field ?? '';
  }

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

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

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

  public static function getStructMetadata()[]: \tmeta_ThriftStruct {
    return \tmeta_ThriftStruct::fromShape(
      shape(
        "name" => "module.decorated_struct",
        "fields" => vec[
          \tmeta_ThriftField::fromShape(
            shape(
              "id" => 1,
              "type" => \tmeta_ThriftType::fromShape(
                shape(
                  "t_primitive" => \tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,
                )
              ),
              "name" => "field",
            )
          ),
        ],
        "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, 'field') !== null) {
      $this->field = HH\FIXME\UNSAFE_CAST<mixed, string>($parsed['field']);
    }
  }

}

/**
 * Original thrift struct:-
 * ContainerStruct
 */
<<\ThriftTypeInfo(shape('uri' => 'apache.org/thrift/fixtures/types/ContainerStruct'))>>
class ContainerStruct implements \IThriftSyncStruct, \IThriftStructMetadata {
  use \ThriftSerializationTrait;

  const \ThriftStructTypes::TSpec SPEC = dict[
    12 => shape(
      'var' => 'fieldA',
      'type' => \TType::LST,
      'etype' => \TType::I32,
      'elem' => shape(
        'type' => \TType::I32,
      ),
      'format' => 'collection',
    ),
    2 => shape(
      'var' => 'fieldB',
      'type' => \TType::LST,
      'etype' => \TType::I32,
      'elem' => shape(
        'type' => \TType::I32,
      ),
      'format' => 'collection',
    ),
    3 => shape(
      'var' => 'fieldC',
      'type' => \TType::LST,
      'etype' => \TType::I32,
      'elem' => shape(
        'type' => \TType::I32,
      ),
      'format' => 'collection',
    ),
    4 => shape(
      'var' => 'fieldD',
      'type' => \TType::LST,
      'etype' => \TType::I32,
      'elem' => shape(
        'type' => \TType::I32,
      ),
      'format' => 'collection',
    ),
    5 => shape(
      'var' => 'fieldE',
      'type' => \TType::LST,
      'etype' => \TType::I32,
      'elem' => shape(
        'type' => \TType::I32,
      ),
      'format' => 'collection',
    ),
    6 => shape(
      'var' => 'fieldF',
      'type' => \TType::SET,
      'etype' => \TType::I32,
      'elem' => shape(
        'type' => \TType::I32,
      ),
      'format' => 'collection',
    ),
    7 => shape(
      'var' => 'fieldG',
      'type' => \TType::MAP,
      'ktype' => \TType::I32,
      'vtype' => \TType::STRING,
      'key' => shape(
        'type' => \TType::I32,
      ),
      'val' => shape(
        'type' => \TType::STRING,
      ),
      'format' => 'collection',
    ),
    8 => shape(
      'var' => 'fieldH',
      'type' => \TType::MAP,
      'ktype' => \TType::I32,
      'vtype' => \TType::STRING,
      'key' => shape(
        'type' => \TType::I32,
      ),
      'val' => shape(
        'type' => \TType::STRING,
      ),
      'format' => 'collection',
    ),
  ];
  const dict<string, int> FIELDMAP = dict[
    'fieldA' => 12,
    'fieldB' => 2,
    'fieldC' => 3,
    'fieldD' => 4,
    'fieldE' => 5,
    'fieldF' => 6,
    'fieldG' => 7,
    'fieldH' => 8,
  ];

  const type TConstructorShape = shape(
    ?'fieldA' => ?Vector<int>,
    ?'fieldB' => ?Vector<int>,
    ?'fieldC' => ?Vector<int>,
    ?'fieldD' => ?Vector<int>,
    ?'fieldE' => ?Vector<int>,
    ?'fieldF' => ?Set<int>,
    ?'fieldG' => ?Map<int, string>,
    ?'fieldH' => ?Map<int, string>,
  );

  const int STRUCTURAL_ID = 7915479604049708983;
  /**
   * Original thrift field:-
   * 12: list<i32> fieldA
   */
  public Vector<int> $fieldA;
  /**
   * Original thrift field:-
   * 2: list<i32> fieldB
   */
  public Vector<int> $fieldB;
  /**
   * Original thrift field:-
   * 3: list<i32> fieldC
   */
  public Vector<int> $fieldC;
  /**
   * Original thrift field:-
   * 4: list<i32> fieldD
   */
  public Vector<int> $fieldD;
  /**
   * Original thrift field:-
   * 5: list<i32> fieldE
   */
  public Vector<int> $fieldE;
  /**
   * Original thrift field:-
   * 6: module.set_i32_7194 fieldF
   */
  public Set<int> $fieldF;
  /**
   * Original thrift field:-
   * 7: module.map_i32_string_1261 fieldG
   */
  public Map<int, string> $fieldG;
  /**
   * Original thrift field:-
   * 8: included.SomeMap fieldH
   */
  public Map<int, string> $fieldH;

  public function __construct(?Vector<int> $fieldA = null, ?Vector<int> $fieldB = null, ?Vector<int> $fieldC = null, ?Vector<int> $fieldD = null, ?Vector<int> $fieldE = null, ?Set<int> $fieldF = null, ?Map<int, string> $fieldG = null, ?Map<int, string> $fieldH = null)[] {
    $this->fieldA = $fieldA ?? Vector {};
    $this->fieldB = $fieldB ?? Vector {};
    $this->fieldC = $fieldC ?? Vector {};
    $this->fieldD = $fieldD ?? Vector {};
    $this->fieldE = $fieldE ?? Vector {};
    $this->fieldF = $fieldF ?? Set {};
    $this->fieldG = $fieldG ?? Map {};
    $this->fieldH = $fieldH ?? Map {};
  }

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

  public static function fromShape(self::TConstructorShape $shape)[]: this {
    return new static(
      Shapes::idx($shape, 'fieldA'),
      Shapes::idx($shape, 'fieldB'),
      Shapes::idx($shape, 'fieldC'),
      Shapes::idx($shape, 'fieldD'),
      Shapes::idx($shape, 'fieldE'),
      Shapes::idx($shape, 'fieldF'),
      Shapes::idx($shape, 'fieldG'),
      Shapes::idx($shape, 'fieldH'),
    );
  }

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

  public static function getStructMetadata()[]: \tmeta_ThriftStruct {
    return \tmeta_ThriftStruct::fromShape(
      shape(
        "name" => "module.ContainerStruct",
        "fields" => vec[
          \tmeta_ThriftField::fromShape(
            shape(
              "id" => 12,
              "type" => \tmeta_ThriftType::fromShape(
                shape(
                  "t_list" => \tmeta_ThriftListType::fromShape(
                    shape(
                      "valueType" => \tmeta_ThriftType::fromShape(
                        shape(
                          "t_primitive" => \tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,
                        )
                      ),
                    )
                  ),
                )
              ),
              "name" => "fieldA",
            )
          ),
          \tmeta_ThriftField::fromShape(
            shape(
              "id" => 2,
              "type" => \tmeta_ThriftType::fromShape(
                shape(
                  "t_list" => \tmeta_ThriftListType::fromShape(
                    shape(
                      "valueType" => \tmeta_ThriftType::fromShape(
                        shape(
                          "t_primitive" => \tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,
                        )
                      ),
                    )
                  ),
                )
              ),
              "name" => "fieldB",
            )
          ),
          \tmeta_ThriftField::fromShape(
            shape(
              "id" => 3,
              "type" => \tmeta_ThriftType::fromShape(
                shape(
                  "t_list" => \tmeta_ThriftListType::fromShape(
                    shape(
                      "valueType" => \tmeta_ThriftType::fromShape(
                        shape(
                          "t_primitive" => \tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,
                        )
                      ),
                    )
                  ),
                )
              ),
              "name" => "fieldC",
            )
          ),
          \tmeta_ThriftField::fromShape(
            shape(
              "id" => 4,
              "type" => \tmeta_ThriftType::fromShape(
                shape(
                  "t_list" => \tmeta_ThriftListType::fromShape(
                    shape(
                      "valueType" => \tmeta_ThriftType::fromShape(
                        shape(
                          "t_primitive" => \tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,
                        )
                      ),
                    )
                  ),
                )
              ),
              "name" => "fieldD",
            )
          ),
          \tmeta_ThriftField::fromShape(
            shape(
              "id" => 5,
              "type" => \tmeta_ThriftType::fromShape(
                shape(
                  "t_list" => \tmeta_ThriftListType::fromShape(
                    shape(
                      "valueType" => \tmeta_ThriftType::fromShape(
                        shape(
                          "t_primitive" => \tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,
                        )
                      ),
                    )
                  ),
                )
              ),
              "name" => "fieldE",
            )
          ),
          \tmeta_ThriftField::fromShape(
            shape(
              "id" => 6,
              "type" => \tmeta_ThriftType::fromShape(
                shape(
                  "t_typedef" => \tmeta_ThriftTypedefType::fromShape(
                    shape(
                      "name" => "module.set_i32_7194",
                      "underlyingType" => \tmeta_ThriftType::fromShape(
                        shape(
                          "t_set" => \tmeta_ThriftSetType::fromShape(
                            shape(
                              "valueType" => \tmeta_ThriftType::fromShape(
                                shape(
                                  "t_primitive" => \tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,
                                )
                              ),
                            )
                          ),
                        )
                      ),
                    )
                  ),
                )
              ),
              "name" => "fieldF",
            )
          ),
          \tmeta_ThriftField::fromShape(
            shape(
              "id" => 7,
              "type" => \tmeta_ThriftType::fromShape(
                shape(
                  "t_typedef" => \tmeta_ThriftTypedefType::fromShape(
                    shape(
                      "name" => "module.map_i32_string_1261",
                      "underlyingType" => \tmeta_ThriftType::fromShape(
                        shape(
                          "t_typedef" => \tmeta_ThriftTypedefType::fromShape(
                            shape(
                              "name" => "module.map_i32_string_1261",
                              "underlyingType" => \tmeta_ThriftType::fromShape(
                                shape(
                                  "t_map" => \tmeta_ThriftMapType::fromShape(
                                    shape(
                                      "keyType" => \tmeta_ThriftType::fromShape(
                                        shape(
                                          "t_primitive" => \tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,
                                        )
                                      ),
                                      "valueType" => \tmeta_ThriftType::fromShape(
                                        shape(
                                          "t_primitive" => \tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,
                                        )
                                      ),
                                    )
                                  ),
                                )
                              ),
                            )
                          ),
                        )
                      ),
                    )
                  ),
                )
              ),
              "name" => "fieldG",
            )
          ),
          \tmeta_ThriftField::fromShape(
            shape(
              "id" => 8,
              "type" => \tmeta_ThriftType::fromShape(
                shape(
                  "t_typedef" => \tmeta_ThriftTypedefType::fromShape(
                    shape(
                      "name" => "included.SomeMap",
                      "underlyingType" => \tmeta_ThriftType::fromShape(
                        shape(
                          "t_map" => \tmeta_ThriftMapType::fromShape(
                            shape(
                              "keyType" => \tmeta_ThriftType::fromShape(
                                shape(
                                  "t_primitive" => \tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,
                                )
                              ),
                              "valueType" => \tmeta_ThriftType::fromShape(
                                shape(
                                  "t_primitive" => \tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,
                                )
                              ),
                            )
                          ),
                        )
                      ),
                    )
                  ),
                )
              ),
              "name" => "fieldH",
            )
          ),
        ],
        "is_union" => false,
      )
    );
  }

  public static function getAllStructuredAnnotations()[write_props]: \TStructAnnotations {
    return shape(
      'struct' => dict[],
      'fields' => dict[
        'fieldB' => shape(
          'field' => dict[
            '\facebook\thrift\annotation\cpp\Type' => \facebook\thrift\annotation\cpp\Type::fromShape(
              shape(
                "template" => "std::list",
              )
            ),
          ],
          'type' => dict[],
        ),
        'fieldC' => shape(
          'field' => dict[
            '\facebook\thrift\annotation\cpp\Type' => \facebook\thrift\annotation\cpp\Type::fromShape(
              shape(
                "template" => "std::deque",
              )
            ),
          ],
          'type' => dict[],
        ),
        'fieldD' => shape(
          'field' => dict[
            '\facebook\thrift\annotation\cpp\Type' => \facebook\thrift\annotation\cpp\Type::fromShape(
              shape(
                "template" => "folly::fbvector",
              )
            ),
          ],
          'type' => dict[],
        ),
        'fieldE' => shape(
          'field' => dict[
            '\facebook\thrift\annotation\cpp\Type' => \facebook\thrift\annotation\cpp\Type::fromShape(
              shape(
                "template" => "folly::small_vector",
              )
            ),
          ],
          'type' => dict[],
        ),
        'fieldF' => shape(
          'field' => dict[],
          'type' => dict[
            '\facebook\thrift\annotation\cpp\Type' => \facebook\thrift\annotation\cpp\Type::fromShape(
              shape(
                "template" => "folly::sorted_vector_set",
              )
            ),
          ],
        ),
        'fieldG' => shape(
          'field' => dict[
            '\facebook\thrift\annotation\cpp\Type' => \facebook\thrift\annotation\cpp\Type::fromShape(
              shape(
                "template" => "folly::sorted_vector_map",
              )
            ),
          ],
          'type' => dict[],
        ),
        'fieldH' => shape(
          'field' => dict[],
          'type' => dict[
            '\facebook\thrift\annotation\cpp\Type' => \facebook\thrift\annotation\cpp\Type::fromShape(
              shape(
                "template" => "std::unordered_map",
              )
            ),
          ],
        ),
      ],
    );
  }

  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, 'fieldA') !== null) {
      $_json3 = HH\FIXME\UNSAFE_CAST<mixed, Vector<int>>($parsed['fieldA']);
      $_container4 = Vector {};
      foreach($_json3 as $_key1 => $_value2) {
        $_elem5 = 0;
        $_tmp6 = (int)$_value2;
        if ($_tmp6 > 0x7fffffff) {
          throw new \TProtocolException("number exceeds limit in field");
        } else {
          $_elem5 = (int)$_tmp6;
        }
        $_container4 []= $_elem5;
      }
      $this->fieldA = $_container4;
    }
    if (idx($parsed, 'fieldB') !== null) {
      $_json10 = HH\FIXME\UNSAFE_CAST<mixed, Vector<int>>($parsed['fieldB']);
      $_container11 = Vector {};
      foreach($_json10 as $_key8 => $_value9) {
        $_elem12 = 0;
        $_tmp13 = (int)$_value9;
        if ($_tmp13 > 0x7fffffff) {
          throw new \TProtocolException("number exceeds limit in field");
        } else {
          $_elem12 = (int)$_tmp13;
        }
        $_container11 []= $_elem12;
      }
      $this->fieldB = $_container11;
    }
    if (idx($parsed, 'fieldC') !== null) {
      $_json17 = HH\FIXME\UNSAFE_CAST<mixed, Vector<int>>($parsed['fieldC']);
      $_container18 = Vector {};
      foreach($_json17 as $_key15 => $_value16) {
        $_elem19 = 0;
        $_tmp20 = (int)$_value16;
        if ($_tmp20 > 0x7fffffff) {
          throw new \TProtocolException("number exceeds limit in field");
        } else {
          $_elem19 = (int)$_tmp20;
        }
        $_container18 []= $_elem19;
      }
      $this->fieldC = $_container18;
    }
    if (idx($parsed, 'fieldD') !== null) {
      $_json24 = HH\FIXME\UNSAFE_CAST<mixed, Vector<int>>($parsed['fieldD']);
      $_container25 = Vector {};
      foreach($_json24 as $_key22 => $_value23) {
        $_elem26 = 0;
        $_tmp27 = (int)$_value23;
        if ($_tmp27 > 0x7fffffff) {
          throw new \TProtocolException("number exceeds limit in field");
        } else {
          $_elem26 = (int)$_tmp27;
        }
        $_container25 []= $_elem26;
      }
      $this->fieldD = $_container25;
    }
    if (idx($parsed, 'fieldE') !== null) {
      $_json31 = HH\FIXME\UNSAFE_CAST<mixed, Vector<int>>($parsed['fieldE']);
      $_container32 = Vector {};
      foreach($_json31 as $_key29 => $_value30) {
        $_elem33 = 0;
        $_tmp34 = (int)$_value30;
        if ($_tmp34 > 0x7fffffff) {
          throw new \TProtocolException("number exceeds limit in field");
        } else {
          $_elem33 = (int)$_tmp34;
        }
        $_container32 []= $_elem33;
      }
      $this->fieldE = $_container32;
    }
    if (idx($parsed, 'fieldF') !== null) {
      $_json38 = HH\FIXME\UNSAFE_CAST<mixed, Set<int>>($parsed['fieldF']);
      $_container39 = Set {};
      foreach($_json38 as $_key36 => $_value37) {
        $_elem40 = 0;
        $_tmp41 = (int)$_value37;
        if ($_tmp41 > 0x7fffffff) {
          throw new \TProtocolException("number exceeds limit in field");
        } else {
          $_elem40 = (int)$_tmp41;
        }
        $_container39->add($_elem40);
      }
      $this->fieldF = $_container39;
    }
    if (idx($parsed, 'fieldG') !== null) {
      $_json45 = HH\FIXME\UNSAFE_CAST<mixed, Map<int, string>>($parsed['fieldG']);
      $_container46 = Map {};
      foreach($_json45 as $_key43 => $_value44) {
        $_value47 = '';
        $_value47 = $_value44;
        $_container46[$_key43] = $_value47;
      }
      $this->fieldG = $_container46;
    }
    if (idx($parsed, 'fieldH') !== null) {
      $_json51 = HH\FIXME\UNSAFE_CAST<mixed, Map<int, string>>($parsed['fieldH']);
      $_container52 = Map {};
      foreach($_json51 as $_key49 => $_value50) {
        $_value53 = '';
        $_value53 = $_value50;
        $_container52[$_key49] = $_value53;
      }
      $this->fieldH = $_container52;
    }
  }

}

/**
 * Original thrift struct:-
 * CppTypeStruct
 */
<<\ThriftTypeInfo(shape('uri' => 'apache.org/thrift/fixtures/types/CppTypeStruct'))>>
class CppTypeStruct implements \IThriftSyncStruct, \IThriftStructMetadata {
  use \ThriftSerializationTrait;

  const \ThriftStructTypes::TSpec SPEC = dict[
    1 => shape(
      'var' => 'fieldA',
      'type' => \TType::LST,
      'etype' => \TType::I32,
      'elem' => shape(
        'type' => \TType::I32,
      ),
      'format' => 'collection',
    ),
  ];
  const dict<string, int> FIELDMAP = dict[
    'fieldA' => 1,
  ];

  const type TConstructorShape = shape(
    ?'fieldA' => ?Vector<int>,
  );

  const int STRUCTURAL_ID = 9369458949141941;
  /**
   * Original thrift field:-
   * 1: list<i32> fieldA
   */
  public Vector<int> $fieldA;

  public function __construct(?Vector<int> $fieldA = null)[] {
    $this->fieldA = $fieldA ?? Vector {};
  }

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

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

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

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

  public static function getAllStructuredAnnotations()[write_props]: \TStructAnnotations {
    return shape(
      'struct' => dict[],
      'fields' => dict[
        'fieldA' => shape(
          'field' => dict[
            '\facebook\thrift\annotation\cpp\Type' => \facebook\thrift\annotation\cpp\Type::fromShape(
              shape(
                "name" => "std::list<int32_t>",
              )
            ),
          ],
          'type' => 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, 'fieldA') !== null) {
      $_json3 = HH\FIXME\UNSAFE_CAST<mixed, Vector<int>>($parsed['fieldA']);
      $_container4 = Vector {};
      foreach($_json3 as $_key1 => $_value2) {
        $_elem5 = 0;
        $_tmp6 = (int)$_value2;
        if ($_tmp6 > 0x7fffffff) {
          throw new \TProtocolException("number exceeds limit in field");
        } else {
          $_elem5 = (int)$_tmp6;
        }
        $_container4 []= $_elem5;
      }
      $this->fieldA = $_container4;
    }
  }

}

/**
 * Original thrift struct:-
 * VirtualStruct
 */
<<\ThriftTypeInfo(shape('uri' => 'apache.org/thrift/fixtures/types/VirtualStruct'))>>
class VirtualStruct implements \IThriftSyncStruct, \IThriftStructMetadata {
  use \ThriftSerializationTrait;

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

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

  const int STRUCTURAL_ID = 7014352813131039231;
  /**
   * Original thrift field:-
   * 1: i64 MyIntField
   */
  public int $MyIntField;

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

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

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

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

  public static function getStructMetadata()[]: \tmeta_ThriftStruct {
    return \tmeta_ThriftStruct::fromShape(
      shape(
        "name" => "module.VirtualStruct",
        "fields" => vec[
          \tmeta_ThriftField::fromShape(
            shape(
              "id" => 1,
              "type" => \tmeta_ThriftType::fromShape(
                shape(
                  "t_primitive" => \tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,
                )
              ),
              "name" => "MyIntField",
            )
          ),
        ],
        "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, 'MyIntField') !== null) {
      $this->MyIntField = HH\FIXME\UNSAFE_CAST<mixed, int>($parsed['MyIntField']);
    }
  }

}

/**
 * Original thrift struct:-
 * MyStructWithForwardRefEnum
 */
<<\ThriftTypeInfo(shape('uri' => 'apache.org/thrift/fixtures/types/MyStructWithForwardRefEnum'))>>
class MyStructWithForwardRefEnum implements \IThriftSyncStruct, \IThriftStructMetadata {
  use \ThriftSerializationTrait;

  const \ThriftStructTypes::TSpec SPEC = dict[
    1 => shape(
      'var' => 'a',
      'type' => \TType::I32,
      'enum' => \apache\thrift\fixtures\types\MyForwardRefEnum::class,
    ),
    2 => shape(
      'var' => 'b',
      'type' => \TType::I32,
      'enum' => \apache\thrift\fixtures\types\MyForwardRefEnum::class,
    ),
  ];
  const dict<string, int> FIELDMAP = dict[
    'a' => 1,
    'b' => 2,
  ];

  const type TConstructorShape = shape(
    ?'a' => ?\apache\thrift\fixtures\types\MyForwardRefEnum,
    ?'b' => ?\apache\thrift\fixtures\types\MyForwardRefEnum,
  );

  const int STRUCTURAL_ID = 6098225215594902198;
  /**
   * Original thrift field:-
   * 1: module.MyForwardRefEnum a
   */
  public ?\apache\thrift\fixtures\types\MyForwardRefEnum $a;
  /**
   * Original thrift field:-
   * 2: module.MyForwardRefEnum b
   */
  public ?\apache\thrift\fixtures\types\MyForwardRefEnum $b;

  public function __construct(?\apache\thrift\fixtures\types\MyForwardRefEnum $a = null, ?\apache\thrift\fixtures\types\MyForwardRefEnum $b = null)[] {
    $this->a = $a ?? \apache\thrift\fixtures\types\MyForwardRefEnum::NONZERO;
    $this->b = $b ?? \apache\thrift\fixtures\types\MyForwardRefEnum::NONZERO;
  }

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

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

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

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

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

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

  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, 'a') !== null) {
      $this->a = \apache\thrift\fixtures\types\MyForwardRefEnum::coerce(HH\FIXME\UNSAFE_CAST<mixed, \apache\thrift\fixtures\types\MyForwardRefEnum>($parsed['a']));
    }
    if (idx($parsed, 'b') !== null) {
      $this->b = \apache\thrift\fixtures\types\MyForwardRefEnum::coerce(HH\FIXME\UNSAFE_CAST<mixed, \apache\thrift\fixtures\types\MyForwardRefEnum>($parsed['b']));
    }
  }

}

/**
 * Original thrift struct:-
 * TrivialNumeric
 */
<<\ThriftTypeInfo(shape('uri' => 'apache.org/thrift/fixtures/types/TrivialNumeric'))>>
class TrivialNumeric implements \IThriftSyncStruct, \IThriftStructMetadata {
  use \ThriftSerializationTrait;

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

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

  const int STRUCTURAL_ID = 3920068475021763685;
  /**
   * Original thrift field:-
   * 1: i32 a
   */
  public int $a;
  /**
   * Original thrift field:-
   * 2: bool b
   */
  public bool $b;

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

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

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

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

  public static function getStructMetadata()[]: \tmeta_ThriftStruct {
    return \tmeta_ThriftStruct::fromShape(
      shape(
        "name" => "module.TrivialNumeric",
        "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_BOOL_TYPE,
                )
              ),
              "name" => "b",
            )
          ),
        ],
        "is_union" => false,
      )
    );
  }

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

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

  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, 'a') !== null) {
      $_tmp0 = (int)HH\FIXME\UNSAFE_CAST<mixed, int>($parsed['a']);
      if ($_tmp0 > 0x7fffffff) {
        throw new \TProtocolException("number exceeds limit in field");
      } else {
        $this->a = (int)$_tmp0;
      }
    }
    if (idx($parsed, 'b') !== null) {
      $this->b = HH\FIXME\UNSAFE_CAST<mixed, bool>($parsed['b']);
    }
  }

}

/**
 * Original thrift struct:-
 * TrivialNestedWithDefault
 */
<<\ThriftTypeInfo(shape('uri' => 'apache.org/thrift/fixtures/types/TrivialNestedWithDefault'))>>
class TrivialNestedWithDefault implements \IThriftSyncStruct, \IThriftStructMetadata {
  use \ThriftSerializationTrait;

  const \ThriftStructTypes::TSpec SPEC = dict[
    1 => shape(
      'var' => 'z',
      'type' => \TType::I32,
    ),
    2 => shape(
      'var' => 'n',
      'type' => \TType::STRUCT,
      'class' => \apache\thrift\fixtures\types\TrivialNumeric::class,
    ),
  ];
  const dict<string, int> FIELDMAP = dict[
    'z' => 1,
    'n' => 2,
  ];

  const type TConstructorShape = shape(
    ?'z' => ?int,
    ?'n' => ?\apache\thrift\fixtures\types\TrivialNumeric,
  );

  const int STRUCTURAL_ID = 5012136746274172257;
  /**
   * Original thrift field:-
   * 1: i32 z
   */
  public int $z;
  /**
   * Original thrift field:-
   * 2: module.TrivialNumeric n
   */
  public ?\apache\thrift\fixtures\types\TrivialNumeric $n;

  public function __construct(?int $z = null, ?\apache\thrift\fixtures\types\TrivialNumeric $n = null)[] {
    $this->z = $z ?? 4;
    $this->n = $n;
  }

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

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

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

  public static function getStructMetadata()[]: \tmeta_ThriftStruct {
    return \tmeta_ThriftStruct::fromShape(
      shape(
        "name" => "module.TrivialNestedWithDefault",
        "fields" => vec[
          \tmeta_ThriftField::fromShape(
            shape(
              "id" => 1,
              "type" => \tmeta_ThriftType::fromShape(
                shape(
                  "t_primitive" => \tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,
                )
              ),
              "name" => "z",
            )
          ),
          \tmeta_ThriftField::fromShape(
            shape(
              "id" => 2,
              "type" => \tmeta_ThriftType::fromShape(
                shape(
                  "t_struct" => \tmeta_ThriftStructType::fromShape(
                    shape(
                      "name" => "module.TrivialNumeric",
                    )
                  ),
                )
              ),
              "name" => "n",
            )
          ),
        ],
        "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, 'z') !== null) {
      $_tmp0 = (int)HH\FIXME\UNSAFE_CAST<mixed, int>($parsed['z']);
      if ($_tmp0 > 0x7fffffff) {
        throw new \TProtocolException("number exceeds limit in field");
      } else {
        $this->z = (int)$_tmp0;
      }
    }
    if (idx($parsed, 'n') !== null) {
      $_tmp1 = \json_encode(HH\FIXME\UNSAFE_CAST<mixed, \apache\thrift\fixtures\types\TrivialNumeric>($parsed['n']));
      $_tmp2 = \apache\thrift\fixtures\types\TrivialNumeric::withDefaultValues();
      $_tmp2->readFromJson($_tmp1);
      $this->n = $_tmp2;
    }
  }

}

/**
 * Original thrift struct:-
 * ComplexString
 */
<<\ThriftTypeInfo(shape('uri' => 'apache.org/thrift/fixtures/types/ComplexString'))>>
class ComplexString implements \IThriftSyncStruct, \IThriftStructMetadata {
  use \ThriftSerializationTrait;

  const \ThriftStructTypes::TSpec SPEC = dict[
    1 => shape(
      'var' => 'a',
      'type' => \TType::STRING,
    ),
    2 => shape(
      'var' => 'b',
      'type' => \TType::MAP,
      'ktype' => \TType::STRING,
      'vtype' => \TType::I32,
      'key' => shape(
        'type' => \TType::STRING,
      ),
      'val' => shape(
        'type' => \TType::I32,
      ),
      'format' => 'collection',
    ),
  ];
  const dict<string, int> FIELDMAP = dict[
    'a' => 1,
    'b' => 2,
  ];

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

  const int STRUCTURAL_ID = 5460740530481786095;
  /**
   * Original thrift field:-
   * 1: string a
   */
  public string $a;
  /**
   * Original thrift field:-
   * 2: map<string, i32> b
   */
  public Map<string, int> $b;

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

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

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

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

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

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

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

  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, 'a') !== null) {
      $this->a = HH\FIXME\UNSAFE_CAST<mixed, string>($parsed['a']);
    }
    if (idx($parsed, 'b') !== null) {
      $_json3 = HH\FIXME\UNSAFE_CAST<mixed, Map<string, int>>($parsed['b']);
      $_container4 = Map {};
      foreach($_json3 as $_key1 => $_value2) {
        $_value5 = 0;
        $_tmp6 = (int)$_value2;
        if ($_tmp6 > 0x7fffffff) {
          throw new \TProtocolException("number exceeds limit in field");
        } else {
          $_value5 = (int)$_tmp6;
        }
        $_container4[$_key1] = $_value5;
      }
      $this->b = $_container4;
    }
  }

}

/**
 * Original thrift struct:-
 * ComplexNestedWithDefault
 */
<<\ThriftTypeInfo(shape('uri' => 'apache.org/thrift/fixtures/types/ComplexNestedWithDefault'))>>
class ComplexNestedWithDefault implements \IThriftSyncStruct, \IThriftStructMetadata {
  use \ThriftSerializationTrait;

  const \ThriftStructTypes::TSpec SPEC = dict[
    1 => shape(
      'var' => 'z',
      'type' => \TType::STRING,
    ),
    2 => shape(
      'var' => 'n',
      'type' => \TType::STRUCT,
      'class' => \apache\thrift\fixtures\types\ComplexString::class,
    ),
  ];
  const dict<string, int> FIELDMAP = dict[
    'z' => 1,
    'n' => 2,
  ];

  const type TConstructorShape = shape(
    ?'z' => ?string,
    ?'n' => ?\apache\thrift\fixtures\types\ComplexString,
  );

  const int STRUCTURAL_ID = 2913723608362321564;
  /**
   * Original thrift field:-
   * 1: string z
   */
  public string $z;
  /**
   * Original thrift field:-
   * 2: module.ComplexString n
   */
  public ?\apache\thrift\fixtures\types\ComplexString $n;

  public function __construct(?string $z = null, ?\apache\thrift\fixtures\types\ComplexString $n = null)[] {
    $this->z = $z ?? "4";
    $this->n = $n;
  }

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

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

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

  public static function getStructMetadata()[]: \tmeta_ThriftStruct {
    return \tmeta_ThriftStruct::fromShape(
      shape(
        "name" => "module.ComplexNestedWithDefault",
        "fields" => vec[
          \tmeta_ThriftField::fromShape(
            shape(
              "id" => 1,
              "type" => \tmeta_ThriftType::fromShape(
                shape(
                  "t_primitive" => \tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,
                )
              ),
              "name" => "z",
            )
          ),
          \tmeta_ThriftField::fromShape(
            shape(
              "id" => 2,
              "type" => \tmeta_ThriftType::fromShape(
                shape(
                  "t_struct" => \tmeta_ThriftStructType::fromShape(
                    shape(
                      "name" => "module.ComplexString",
                    )
                  ),
                )
              ),
              "name" => "n",
            )
          ),
        ],
        "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, 'z') !== null) {
      $this->z = HH\FIXME\UNSAFE_CAST<mixed, string>($parsed['z']);
    }
    if (idx($parsed, 'n') !== null) {
      $_tmp0 = \json_encode(HH\FIXME\UNSAFE_CAST<mixed, \apache\thrift\fixtures\types\ComplexString>($parsed['n']));
      $_tmp1 = \apache\thrift\fixtures\types\ComplexString::withDefaultValues();
      $_tmp1->readFromJson($_tmp0);
      $this->n = $_tmp1;
    }
  }

}

/**
 * Original thrift struct:-
 * MinPadding
 */
<<\ThriftTypeInfo(shape('uri' => 'apache.org/thrift/fixtures/types/MinPadding'))>>
class MinPadding implements \IThriftSyncStruct, \IThriftStructMetadata {
  use \ThriftSerializationTrait;

  const \ThriftStructTypes::TSpec SPEC = dict[
    1 => shape(
      'var' => 'small',
      'type' => \TType::BYTE,
    ),
    2 => shape(
      'var' => 'big',
      'type' => \TType::I64,
    ),
    3 => shape(
      'var' => 'medium',
      'type' => \TType::I16,
    ),
    4 => shape(
      'var' => 'biggish',
      'type' => \TType::I32,
    ),
    5 => shape(
      'var' => 'tiny',
      'type' => \TType::BYTE,
    ),
  ];
  const dict<string, int> FIELDMAP = dict[
    'small' => 1,
    'big' => 2,
    'medium' => 3,
    'biggish' => 4,
    'tiny' => 5,
  ];

  const type TConstructorShape = shape(
    ?'small' => ?int,
    ?'big' => ?int,
    ?'medium' => ?int,
    ?'biggish' => ?int,
    ?'tiny' => ?int,
  );

  const int STRUCTURAL_ID = 723753448680843528;
  /**
   * Original thrift field:-
   * 1: byte small
   */
  public int $small;
  /**
   * Original thrift field:-
   * 2: i64 big
   */
  public int $big;
  /**
   * Original thrift field:-
   * 3: i16 medium
   */
  public int $medium;
  /**
   * Original thrift field:-
   * 4: i32 biggish
   */
  public int $biggish;
  /**
   * Original thrift field:-
   * 5: byte tiny
   */
  public int $tiny;

  public function __construct(?int $small = null, ?int $big = null, ?int $medium = null, ?int $biggish = null, ?int $tiny = null)[] {
    $this->small = $small ?? 0;
    $this->big = $big ?? 0;
    $this->medium = $medium ?? 0;
    $this->biggish = $biggish ?? 0;
    $this->tiny = $tiny ?? 0;
  }

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

  public static function fromShape(self::TConstructorShape $shape)[]: this {
    return new static(
      Shapes::idx($shape, 'small'),
      Shapes::idx($shape, 'big'),
      Shapes::idx($shape, 'medium'),
      Shapes::idx($shape, 'biggish'),
      Shapes::idx($shape, 'tiny'),
    );
  }

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

  public static function getStructMetadata()[]: \tmeta_ThriftStruct {
    return \tmeta_ThriftStruct::fromShape(
      shape(
        "name" => "module.MinPadding",
        "fields" => vec[
          \tmeta_ThriftField::fromShape(
            shape(
              "id" => 1,
              "type" => \tmeta_ThriftType::fromShape(
                shape(
                  "t_primitive" => \tmeta_ThriftPrimitiveType::THRIFT_BYTE_TYPE,
                )
              ),
              "name" => "small",
            )
          ),
          \tmeta_ThriftField::fromShape(
            shape(
              "id" => 2,
              "type" => \tmeta_ThriftType::fromShape(
                shape(
                  "t_primitive" => \tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,
                )
              ),
              "name" => "big",
            )
          ),
          \tmeta_ThriftField::fromShape(
            shape(
              "id" => 3,
              "type" => \tmeta_ThriftType::fromShape(
                shape(
                  "t_primitive" => \tmeta_ThriftPrimitiveType::THRIFT_I16_TYPE,
                )
              ),
              "name" => "medium",
            )
          ),
          \tmeta_ThriftField::fromShape(
            shape(
              "id" => 4,
              "type" => \tmeta_ThriftType::fromShape(
                shape(
                  "t_primitive" => \tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,
                )
              ),
              "name" => "biggish",
            )
          ),
          \tmeta_ThriftField::fromShape(
            shape(
              "id" => 5,
              "type" => \tmeta_ThriftType::fromShape(
                shape(
                  "t_primitive" => \tmeta_ThriftPrimitiveType::THRIFT_BYTE_TYPE,
                )
              ),
              "name" => "tiny",
            )
          ),
        ],
        "is_union" => false,
      )
    );
  }

  public static function getAllStructuredAnnotations()[write_props]: \TStructAnnotations {
    return shape(
      'struct' => dict[
        '\facebook\thrift\annotation\cpp\MinimizePadding' => \facebook\thrift\annotation\cpp\MinimizePadding::fromShape(
          shape(
          )
        ),
      ],
      '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, 'small') !== null) {
      $_tmp0 = (int)HH\FIXME\UNSAFE_CAST<mixed, int>($parsed['small']);
      if ($_tmp0 > 0x7f) {
        throw new \TProtocolException("number exceeds limit in field");
      } else {
        $this->small = (int)$_tmp0;
      }
    } else {
      throw new \TProtocolException("Required field small cannot be found.");
    }
    if (idx($parsed, 'big') !== null) {
      $this->big = HH\FIXME\UNSAFE_CAST<mixed, int>($parsed['big']);
    } else {
      throw new \TProtocolException("Required field big cannot be found.");
    }
    if (idx($parsed, 'medium') !== null) {
      $_tmp1 = (int)HH\FIXME\UNSAFE_CAST<mixed, int>($parsed['medium']);
      if ($_tmp1 > 0x7fff) {
        throw new \TProtocolException("number exceeds limit in field");
      } else {
        $this->medium = (int)$_tmp1;
      }
    } else {
      throw new \TProtocolException("Required field medium cannot be found.");
    }
    if (idx($parsed, 'biggish') !== null) {
      $_tmp2 = (int)HH\FIXME\UNSAFE_CAST<mixed, int>($parsed['biggish']);
      if ($_tmp2 > 0x7fffffff) {
        throw new \TProtocolException("number exceeds limit in field");
      } else {
        $this->biggish = (int)$_tmp2;
      }
    } else {
      throw new \TProtocolException("Required field biggish cannot be found.");
    }
    if (idx($parsed, 'tiny') !== null) {
      $_tmp3 = (int)HH\FIXME\UNSAFE_CAST<mixed, int>($parsed['tiny']);
      if ($_tmp3 > 0x7f) {
        throw new \TProtocolException("number exceeds limit in field");
      } else {
        $this->tiny = (int)$_tmp3;
      }
    } else {
      throw new \TProtocolException("Required field tiny cannot be found.");
    }
  }

}

/**
 * Original thrift struct:-
 * MinPaddingWithCustomType
 */
<<\ThriftTypeInfo(shape('uri' => 'apache.org/thrift/fixtures/types/MinPaddingWithCustomType'))>>
class MinPaddingWithCustomType implements \IThriftSyncStruct, \IThriftStructMetadata, \IThriftStructWithClearTerseFields {
  use \ThriftSerializationTrait;

  const \ThriftStructTypes::TSpec SPEC = dict[
    1 => shape(
      'var' => 'small',
      'is_terse' => true,
      'type' => \TType::BYTE,
    ),
    2 => shape(
      'var' => 'big',
      'is_terse' => true,
      'type' => \TType::I64,
    ),
    3 => shape(
      'var' => 'medium',
      'is_terse' => true,
      'type' => \TType::I16,
    ),
    4 => shape(
      'var' => 'biggish',
      'is_terse' => true,
      'type' => \TType::I32,
    ),
    5 => shape(
      'var' => 'tiny',
      'is_terse' => true,
      'type' => \TType::BYTE,
    ),
  ];
  const dict<string, int> FIELDMAP = dict[
    'small' => 1,
    'big' => 2,
    'medium' => 3,
    'biggish' => 4,
    'tiny' => 5,
  ];

  const type TConstructorShape = shape(
    ?'small' => ?int,
    ?'big' => ?int,
    ?'medium' => ?int,
    ?'biggish' => ?int,
    ?'tiny' => ?int,
  );

  const int STRUCTURAL_ID = 7925816223011912416;
  /**
   * Original thrift field:-
   * 1: byte small
   */
  public int $small;
  /**
   * Original thrift field:-
   * 2: i64 big
   */
  public int $big;
  /**
   * Original thrift field:-
   * 3: i16 medium
   */
  public int $medium;
  /**
   * Original thrift field:-
   * 4: i32 biggish
   */
  public int $biggish;
  /**
   * Original thrift field:-
   * 5: byte tiny
   */
  public int $tiny;

  public function __construct(?int $small = null, ?int $big = null, ?int $medium = null, ?int $biggish = null, ?int $tiny = null)[] {
    $this->small = $small ?? 0;
    $this->big = $big ?? 0;
    $this->medium = $medium ?? 0;
    $this->biggish = $biggish ?? 0;
    $this->tiny = $tiny ?? 0;
  }

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

  public static function fromShape(self::TConstructorShape $shape)[]: this {
    return new static(
      Shapes::idx($shape, 'small'),
      Shapes::idx($shape, 'big'),
      Shapes::idx($shape, 'medium'),
      Shapes::idx($shape, 'biggish'),
      Shapes::idx($shape, 'tiny'),
    );
  }

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

  public function clearTerseFields()[write_props]: void {
    $this->small = 0;
    $this->big = 0;
    $this->medium = 0;
    $this->biggish = 0;
    $this->tiny = 0;
  }

  public static function getStructMetadata()[]: \tmeta_ThriftStruct {
    return \tmeta_ThriftStruct::fromShape(
      shape(
        "name" => "module.MinPaddingWithCustomType",
        "fields" => vec[
          \tmeta_ThriftField::fromShape(
            shape(
              "id" => 1,
              "type" => \tmeta_ThriftType::fromShape(
                shape(
                  "t_primitive" => \tmeta_ThriftPrimitiveType::THRIFT_BYTE_TYPE,
                )
              ),
              "name" => "small",
            )
          ),
          \tmeta_ThriftField::fromShape(
            shape(
              "id" => 2,
              "type" => \tmeta_ThriftType::fromShape(
                shape(
                  "t_primitive" => \tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,
                )
              ),
              "name" => "big",
            )
          ),
          \tmeta_ThriftField::fromShape(
            shape(
              "id" => 3,
              "type" => \tmeta_ThriftType::fromShape(
                shape(
                  "t_primitive" => \tmeta_ThriftPrimitiveType::THRIFT_I16_TYPE,
                )
              ),
              "name" => "medium",
            )
          ),
          \tmeta_ThriftField::fromShape(
            shape(
              "id" => 4,
              "type" => \tmeta_ThriftType::fromShape(
                shape(
                  "t_primitive" => \tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,
                )
              ),
              "name" => "biggish",
            )
          ),
          \tmeta_ThriftField::fromShape(
            shape(
              "id" => 5,
              "type" => \tmeta_ThriftType::fromShape(
                shape(
                  "t_primitive" => \tmeta_ThriftPrimitiveType::THRIFT_BYTE_TYPE,
                )
              ),
              "name" => "tiny",
            )
          ),
        ],
        "is_union" => false,
      )
    );
  }

  public static function getAllStructuredAnnotations()[write_props]: \TStructAnnotations {
    return shape(
      'struct' => dict[
        '\facebook\thrift\annotation\Experimental' => \facebook\thrift\annotation\Experimental::fromShape(
          shape(
          )
        ),
        '\facebook\thrift\annotation\cpp\MinimizePadding' => \facebook\thrift\annotation\cpp\MinimizePadding::fromShape(
          shape(
          )
        ),
        '\facebook\thrift\annotation\TerseWrite' => \facebook\thrift\annotation\TerseWrite::fromShape(
          shape(
          )
        ),
      ],
      'fields' => dict[
        'medium' => shape(
          'field' => dict[
            '\facebook\thrift\annotation\cpp\Adapter' => \facebook\thrift\annotation\cpp\Adapter::fromShape(
              shape(
                "name" => "::my::Adapter",
              )
            ),
          ],
          'type' => 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, 'small') !== null) {
      $_tmp0 = (int)HH\FIXME\UNSAFE_CAST<mixed, int>($parsed['small']);
      if ($_tmp0 > 0x7f) {
        throw new \TProtocolException("number exceeds limit in field");
      } else {
        $this->small = (int)$_tmp0;
      }
    }
    if (idx($parsed, 'big') !== null) {
      $this->big = HH\FIXME\UNSAFE_CAST<mixed, int>($parsed['big']);
    }
    if (idx($parsed, 'medium') !== null) {
      $_tmp1 = (int)HH\FIXME\UNSAFE_CAST<mixed, int>($parsed['medium']);
      if ($_tmp1 > 0x7fff) {
        throw new \TProtocolException("number exceeds limit in field");
      } else {
        $this->medium = (int)$_tmp1;
      }
    }
    if (idx($parsed, 'biggish') !== null) {
      $_tmp2 = (int)HH\FIXME\UNSAFE_CAST<mixed, int>($parsed['biggish']);
      if ($_tmp2 > 0x7fffffff) {
        throw new \TProtocolException("number exceeds limit in field");
      } else {
        $this->biggish = (int)$_tmp2;
      }
    }
    if (idx($parsed, 'tiny') !== null) {
      $_tmp3 = (int)HH\FIXME\UNSAFE_CAST<mixed, int>($parsed['tiny']);
      if ($_tmp3 > 0x7f) {
        throw new \TProtocolException("number exceeds limit in field");
      } else {
        $this->tiny = (int)$_tmp3;
      }
    }
  }

}

/**
 * Original thrift struct:-
 * MyStruct
 */
<<\ThriftTypeInfo(shape('uri' => 'apache.org/thrift/fixtures/types/MyStruct'))>>
class MyStruct implements \IThriftSyncStruct, \IThriftStructMetadata {
  use \ThriftSerializationTrait;

  const \ThriftStructTypes::TSpec SPEC = dict[
    1 => shape(
      'var' => 'MyIntField',
      'type' => \TType::I64,
    ),
    2 => shape(
      'var' => 'MyStringField',
      'type' => \TType::STRING,
    ),
    3 => shape(
      'var' => 'majorVer',
      'type' => \TType::I64,
    ),
    4 => shape(
      'var' => 'data',
      'type' => \TType::STRUCT,
      'class' => \apache\thrift\fixtures\types\MyDataItem::class,
    ),
  ];
  const dict<string, int> FIELDMAP = dict[
    'MyIntField' => 1,
    'MyStringField' => 2,
    'majorVer' => 3,
    'data' => 4,
  ];

  const type TConstructorShape = shape(
    ?'MyIntField' => ?int,
    ?'MyStringField' => ?string,
    ?'majorVer' => ?int,
    ?'data' => ?\apache\thrift\fixtures\types\MyDataItem,
  );

  const int STRUCTURAL_ID = 2472338421128341558;
  /**
   * Original thrift field:-
   * 1: i64 MyIntField
   */
  public int $MyIntField;
  /**
   * Original thrift field:-
   * 2: string MyStringField
   */
  public string $MyStringField;
  /**
   * Original thrift field:-
   * 3: i64 majorVer
   */
  public int $majorVer;
  /**
   * Original thrift field:-
   * 4: module.MyDataItem data
   */
  public ?\apache\thrift\fixtures\types\MyDataItem $data;

  public function __construct(?int $MyIntField = null, ?string $MyStringField = null, ?int $majorVer = null, ?\apache\thrift\fixtures\types\MyDataItem $data = null)[] {
    $this->MyIntField = $MyIntField ?? 0;
    $this->MyStringField = $MyStringField ?? '';
    $this->majorVer = $majorVer ?? 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, 'MyIntField'),
      Shapes::idx($shape, 'MyStringField'),
      Shapes::idx($shape, 'majorVer'),
      Shapes::idx($shape, 'data'),
    );
  }

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

  public static function getStructMetadata()[]: \tmeta_ThriftStruct {
    return \tmeta_ThriftStruct::fromShape(
      shape(
        "name" => "module.MyStruct",
        "fields" => vec[
          \tmeta_ThriftField::fromShape(
            shape(
              "id" => 1,
              "type" => \tmeta_ThriftType::fromShape(
                shape(
                  "t_primitive" => \tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,
                )
              ),
              "name" => "MyIntField",
            )
          ),
          \tmeta_ThriftField::fromShape(
            shape(
              "id" => 2,
              "type" => \tmeta_ThriftType::fromShape(
                shape(
                  "t_primitive" => \tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,
                )
              ),
              "name" => "MyStringField",
            )
          ),
          \tmeta_ThriftField::fromShape(
            shape(
              "id" => 3,
              "type" => \tmeta_ThriftType::fromShape(
                shape(
                  "t_primitive" => \tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,
                )
              ),
              "name" => "majorVer",
            )
          ),
          \tmeta_ThriftField::fromShape(
            shape(
              "id" => 4,
              "type" => \tmeta_ThriftType::fromShape(
                shape(
                  "t_struct" => \tmeta_ThriftStructType::fromShape(
                    shape(
                      "name" => "module.MyDataItem",
                    )
                  ),
                )
              ),
              "name" => "data",
            )
          ),
        ],
        "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, 'MyIntField') !== null) {
      $this->MyIntField = HH\FIXME\UNSAFE_CAST<mixed, int>($parsed['MyIntField']);
    }
    if (idx($parsed, 'MyStringField') !== null) {
      $this->MyStringField = HH\FIXME\UNSAFE_CAST<mixed, string>($parsed['MyStringField']);
    }
    if (idx($parsed, 'majorVer') !== null) {
      $this->majorVer = HH\FIXME\UNSAFE_CAST<mixed, int>($parsed['majorVer']);
    }
    if (idx($parsed, 'data') !== null) {
      $_tmp0 = \json_encode(HH\FIXME\UNSAFE_CAST<mixed, \apache\thrift\fixtures\types\MyDataItem>($parsed['data']));
      $_tmp1 = \apache\thrift\fixtures\types\MyDataItem::withDefaultValues();
      $_tmp1->readFromJson($_tmp0);
      $this->data = $_tmp1;
    }
  }

}

/**
 * Original thrift struct:-
 * MyDataItem
 */
<<\ThriftTypeInfo(shape('uri' => 'apache.org/thrift/fixtures/types/MyDataItem'))>>
class MyDataItem implements \IThriftSyncStruct, \IThriftStructMetadata {
  use \ThriftSerializationTrait;

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

  const type TConstructorShape = shape(
  );

  const int STRUCTURAL_ID = 957977401221134810;

  public function __construct()[] {
  }

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

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

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

  public static function getStructMetadata()[]: \tmeta_ThriftStruct {
    return \tmeta_ThriftStruct::fromShape(
      shape(
        "name" => "module.MyDataItem",
        "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.");
    }

  }

}

/**
 * Original thrift struct:-
 * Renaming
 */
<<\ThriftTypeInfo(shape('uri' => 'apache.org/thrift/fixtures/types/Renaming'))>>
class Renaming implements \IThriftSyncStruct, \IThriftStructMetadata {
  use \ThriftSerializationTrait;

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

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

  const int STRUCTURAL_ID = 2811793053530639830;
  /**
   * Original thrift field:-
   * 1: i64 foo
   */
  public int $foo;

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

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

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

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

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

  public static function getAllStructuredAnnotations()[write_props]: \TStructAnnotations {
    return shape(
      'struct' => dict[
        '\facebook\thrift\annotation\cpp\Name' => \facebook\thrift\annotation\cpp\Name::fromShape(
          shape(
            "value" => "Renamed",
          )
        ),
      ],
      'fields' => dict[
        'foo' => shape(
          'field' => dict[
            '\facebook\thrift\annotation\cpp\Name' => \facebook\thrift\annotation\cpp\Name::fromShape(
              shape(
                "value" => "bar",
              )
            ),
          ],
          'type' => 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, 'foo') !== null) {
      $this->foo = HH\FIXME\UNSAFE_CAST<mixed, int>($parsed['foo']);
    }
  }

}

/**
 * Original thrift struct:-
 * AnnotatedTypes
 */
<<\ThriftTypeInfo(shape('uri' => 'apache.org/thrift/fixtures/types/AnnotatedTypes'))>>
class AnnotatedTypes implements \IThriftSyncStruct, \IThriftStructMetadata {
  use \ThriftSerializationTrait;

  const \ThriftStructTypes::TSpec SPEC = dict[
    1 => shape(
      'var' => 'binary_field',
      'type' => \TType::STRING,
      'is_binary' => true,
    ),
    2 => shape(
      'var' => 'list_field',
      'type' => \TType::LST,
      'etype' => \TType::MAP,
      'elem' => shape(
        'type' => \TType::MAP,
        'ktype' => \TType::I32,
        'vtype' => \TType::STRING,
        'key' => shape(
          'type' => \TType::I32,
        ),
        'val' => shape(
          'type' => \TType::STRING,
        ),
        'format' => 'collection',
      ),
      'format' => 'collection',
    ),
  ];
  const dict<string, int> FIELDMAP = dict[
    'binary_field' => 1,
    'list_field' => 2,
  ];

  const type TConstructorShape = shape(
    ?'binary_field' => ?string,
    ?'list_field' => ?Vector<Map<int, string>>,
  );

  const int STRUCTURAL_ID = 1512355088623263223;
  /**
   * Original thrift field:-
   * 1: module.TBinary_8623 binary_field
   */
  public string $binary_field;
  /**
   * Original thrift field:-
   * 2: module.SomeListOfTypeMap_2468 list_field
   */
  public Vector<Map<int, string>> $list_field;

  public function __construct(?string $binary_field = null, ?Vector<Map<int, string>> $list_field = null)[] {
    $this->binary_field = $binary_field ?? '';
    $this->list_field = $list_field ?? Vector {};
  }

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

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

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

  public static function getStructMetadata()[]: \tmeta_ThriftStruct {
    return \tmeta_ThriftStruct::fromShape(
      shape(
        "name" => "module.AnnotatedTypes",
        "fields" => vec[
          \tmeta_ThriftField::fromShape(
            shape(
              "id" => 1,
              "type" => \tmeta_ThriftType::fromShape(
                shape(
                  "t_typedef" => \tmeta_ThriftTypedefType::fromShape(
                    shape(
                      "name" => "module.TBinary_8623",
                      "underlyingType" => \tmeta_ThriftType::fromShape(
                        shape(
                          "t_typedef" => \tmeta_ThriftTypedefType::fromShape(
                            shape(
                              "name" => "module.TBinary",
                              "underlyingType" => \tmeta_ThriftType::fromShape(
                                shape(
                                  "t_typedef" => \tmeta_ThriftTypedefType::fromShape(
                                    shape(
                                      "name" => "module.TBinary",
                                      "underlyingType" => \tmeta_ThriftType::fromShape(
                                        shape(
                                          "t_primitive" => \tmeta_ThriftPrimitiveType::THRIFT_BINARY_TYPE,
                                        )
                                      ),
                                    )
                                  ),
                                )
                              ),
                            )
                          ),
                        )
                      ),
                    )
                  ),
                )
              ),
              "name" => "binary_field",
            )
          ),
          \tmeta_ThriftField::fromShape(
            shape(
              "id" => 2,
              "type" => \tmeta_ThriftType::fromShape(
                shape(
                  "t_typedef" => \tmeta_ThriftTypedefType::fromShape(
                    shape(
                      "name" => "module.SomeListOfTypeMap_2468",
                      "underlyingType" => \tmeta_ThriftType::fromShape(
                        shape(
                          "t_typedef" => \tmeta_ThriftTypedefType::fromShape(
                            shape(
                              "name" => "included.SomeListOfTypeMap",
                              "underlyingType" => \tmeta_ThriftType::fromShape(
                                shape(
                                  "t_typedef" => \tmeta_ThriftTypedefType::fromShape(
                                    shape(
                                      "name" => "included.SomeListOfTypeMap",
                                      "underlyingType" => \tmeta_ThriftType::fromShape(
                                        shape(
                                          "t_list" => \tmeta_ThriftListType::fromShape(
                                            shape(
                                              "valueType" => \tmeta_ThriftType::fromShape(
                                                shape(
                                                  "t_typedef" => \tmeta_ThriftTypedefType::fromShape(
                                                    shape(
                                                      "name" => "included.SomeMap",
                                                      "underlyingType" => \tmeta_ThriftType::fromShape(
                                                        shape(
                                                          "t_map" => \tmeta_ThriftMapType::fromShape(
                                                            shape(
                                                              "keyType" => \tmeta_ThriftType::fromShape(
                                                                shape(
                                                                  "t_primitive" => \tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,
                                                                )
                                                              ),
                                                              "valueType" => \tmeta_ThriftType::fromShape(
                                                                shape(
                                                                  "t_primitive" => \tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,
                                                                )
                                                              ),
                                                            )
                                                          ),
                                                        )
                                                      ),
                                                    )
                                                  ),
                                                )
                                              ),
                                            )
                                          ),
                                        )
                                      ),
                                    )
                                  ),
                                )
                              ),
                            )
                          ),
                        )
                      ),
                    )
                  ),
                )
              ),
              "name" => "list_field",
            )
          ),
        ],
        "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, 'binary_field') !== null) {
      $this->binary_field = HH\FIXME\UNSAFE_CAST<mixed, string>($parsed['binary_field']);
    }
    if (idx($parsed, 'list_field') !== null) {
      $_json3 = HH\FIXME\UNSAFE_CAST<mixed, Vector<Map<int, string>>>($parsed['list_field']);
      $_container4 = Vector {};
      foreach($_json3 as $_key1 => $_value2) {
        $_elem5 = Map {};
        $_json9 = $_value2;
        $_container10 = Map {};
        foreach($_json9 as $_key7 => $_value8) {
          $_value11 = '';
          $_value11 = $_value8;
          $_container10[$_key7] = $_value11;
        }
        $_elem5 = $_container10;
        $_container4 []= $_elem5;
      }
      $this->list_field = $_container4;
    }
  }

}

/**
 * Original thrift struct:-
 * ForwardUsageRoot
 */
<<\ThriftTypeInfo(shape('uri' => 'apache.org/thrift/fixtures/types/ForwardUsageRoot'))>>
class ForwardUsageRoot implements \IThriftSyncStruct, \IThriftStructMetadata {
  use \ThriftSerializationTrait;

  const \ThriftStructTypes::TSpec SPEC = dict[
    1 => shape(
      'var' => 'ForwardUsageStruct',
      'type' => \TType::STRUCT,
      'class' => \apache\thrift\fixtures\types\ForwardUsageStruct::class,
    ),
    2 => shape(
      'var' => 'ForwardUsageByRef',
      'type' => \TType::STRUCT,
      'class' => \apache\thrift\fixtures\types\ForwardUsageByRef::class,
    ),
  ];
  const dict<string, int> FIELDMAP = dict[
    'ForwardUsageStruct' => 1,
    'ForwardUsageByRef' => 2,
  ];

  const type TConstructorShape = shape(
    ?'ForwardUsageStruct' => ?\apache\thrift\fixtures\types\ForwardUsageStruct,
    ?'ForwardUsageByRef' => ?\apache\thrift\fixtures\types\ForwardUsageByRef,
  );

  const int STRUCTURAL_ID = 839155360071855827;
  /**
   * Original thrift field:-
   * 1: module.ForwardUsageStruct ForwardUsageStruct
   */
  public ?\apache\thrift\fixtures\types\ForwardUsageStruct $ForwardUsageStruct;
  /**
   * Original thrift field:-
   * 2: module.ForwardUsageByRef ForwardUsageByRef
   */
  public ?\apache\thrift\fixtures\types\ForwardUsageByRef $ForwardUsageByRef;

  public function __construct(?\apache\thrift\fixtures\types\ForwardUsageStruct $ForwardUsageStruct = null, ?\apache\thrift\fixtures\types\ForwardUsageByRef $ForwardUsageByRef = null)[] {
    $this->ForwardUsageStruct = $ForwardUsageStruct;
    $this->ForwardUsageByRef = $ForwardUsageByRef;
  }

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

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

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

  public static function getStructMetadata()[]: \tmeta_ThriftStruct {
    return \tmeta_ThriftStruct::fromShape(
      shape(
        "name" => "module.ForwardUsageRoot",
        "fields" => vec[
          \tmeta_ThriftField::fromShape(
            shape(
              "id" => 1,
              "type" => \tmeta_ThriftType::fromShape(
                shape(
                  "t_struct" => \tmeta_ThriftStructType::fromShape(
                    shape(
                      "name" => "module.ForwardUsageStruct",
                    )
                  ),
                )
              ),
              "name" => "ForwardUsageStruct",
              "is_optional" => true,
            )
          ),
          \tmeta_ThriftField::fromShape(
            shape(
              "id" => 2,
              "type" => \tmeta_ThriftType::fromShape(
                shape(
                  "t_struct" => \tmeta_ThriftStructType::fromShape(
                    shape(
                      "name" => "module.ForwardUsageByRef",
                    )
                  ),
                )
              ),
              "name" => "ForwardUsageByRef",
              "is_optional" => true,
            )
          ),
        ],
        "is_union" => false,
      )
    );
  }

  public static function getAllStructuredAnnotations()[write_props]: \TStructAnnotations {
    return shape(
      'struct' => dict[],
      'fields' => dict[
        'ForwardUsageByRef' => shape(
          'field' => dict[
            '\facebook\thrift\annotation\cpp\Ref' => \facebook\thrift\annotation\cpp\Ref::fromShape(
              shape(
                "type" => \facebook\thrift\annotation\cpp\RefType::Unique,
              )
            ),
          ],
          'type' => 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, 'ForwardUsageStruct') !== null) {
      $_tmp0 = \json_encode(HH\FIXME\UNSAFE_CAST<mixed, \apache\thrift\fixtures\types\ForwardUsageStruct>($parsed['ForwardUsageStruct']));
      $_tmp1 = \apache\thrift\fixtures\types\ForwardUsageStruct::withDefaultValues();
      $_tmp1->readFromJson($_tmp0);
      $this->ForwardUsageStruct = $_tmp1;
    }
    if (idx($parsed, 'ForwardUsageByRef') !== null) {
      $_tmp2 = \json_encode(HH\FIXME\UNSAFE_CAST<mixed, \apache\thrift\fixtures\types\ForwardUsageByRef>($parsed['ForwardUsageByRef']));
      $_tmp3 = \apache\thrift\fixtures\types\ForwardUsageByRef::withDefaultValues();
      $_tmp3->readFromJson($_tmp2);
      $this->ForwardUsageByRef = $_tmp3;
    }
  }

}

/**
 * Original thrift struct:-
 * ForwardUsageStruct
 */
<<\ThriftTypeInfo(shape('uri' => 'apache.org/thrift/fixtures/types/ForwardUsageStruct'))>>
class ForwardUsageStruct implements \IThriftSyncStruct, \IThriftStructMetadata {
  use \ThriftSerializationTrait;

  const \ThriftStructTypes::TSpec SPEC = dict[
    1 => shape(
      'var' => 'foo',
      'type' => \TType::STRUCT,
      'class' => \apache\thrift\fixtures\types\ForwardUsageRoot::class,
    ),
  ];
  const dict<string, int> FIELDMAP = dict[
    'foo' => 1,
  ];

  const type TConstructorShape = shape(
    ?'foo' => ?\apache\thrift\fixtures\types\ForwardUsageRoot,
  );

  const int STRUCTURAL_ID = 7148256645166217470;
  /**
   * Original thrift field:-
   * 1: module.ForwardUsageRoot foo
   */
  public ?\apache\thrift\fixtures\types\ForwardUsageRoot $foo;

  public function __construct(?\apache\thrift\fixtures\types\ForwardUsageRoot $foo = null)[] {
    $this->foo = $foo;
  }

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

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

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

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

  public static function getAllStructuredAnnotations()[write_props]: \TStructAnnotations {
    return shape(
      'struct' => dict[],
      'fields' => dict[
        'foo' => shape(
          'field' => dict[
            '\facebook\thrift\annotation\cpp\Ref' => \facebook\thrift\annotation\cpp\Ref::fromShape(
              shape(
                "type" => \facebook\thrift\annotation\cpp\RefType::Unique,
              )
            ),
          ],
          'type' => 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, 'foo') !== null) {
      $_tmp0 = \json_encode(HH\FIXME\UNSAFE_CAST<mixed, \apache\thrift\fixtures\types\ForwardUsageRoot>($parsed['foo']));
      $_tmp1 = \apache\thrift\fixtures\types\ForwardUsageRoot::withDefaultValues();
      $_tmp1->readFromJson($_tmp0);
      $this->foo = $_tmp1;
    }
  }

}

/**
 * Original thrift struct:-
 * ForwardUsageByRef
 */
<<\ThriftTypeInfo(shape('uri' => 'apache.org/thrift/fixtures/types/ForwardUsageByRef'))>>
class ForwardUsageByRef implements \IThriftSyncStruct, \IThriftStructMetadata {
  use \ThriftSerializationTrait;

  const \ThriftStructTypes::TSpec SPEC = dict[
    1 => shape(
      'var' => 'foo',
      'type' => \TType::STRUCT,
      'class' => \apache\thrift\fixtures\types\ForwardUsageRoot::class,
    ),
  ];
  const dict<string, int> FIELDMAP = dict[
    'foo' => 1,
  ];

  const type TConstructorShape = shape(
    ?'foo' => ?\apache\thrift\fixtures\types\ForwardUsageRoot,
  );

  const int STRUCTURAL_ID = 7148256645166217470;
  /**
   * Original thrift field:-
   * 1: module.ForwardUsageRoot foo
   */
  public ?\apache\thrift\fixtures\types\ForwardUsageRoot $foo;

  public function __construct(?\apache\thrift\fixtures\types\ForwardUsageRoot $foo = null)[] {
    $this->foo = $foo;
  }

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

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

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

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

  public static function getAllStructuredAnnotations()[write_props]: \TStructAnnotations {
    return shape(
      'struct' => dict[],
      'fields' => dict[
        'foo' => shape(
          'field' => dict[
            '\facebook\thrift\annotation\cpp\Ref' => \facebook\thrift\annotation\cpp\Ref::fromShape(
              shape(
                "type" => \facebook\thrift\annotation\cpp\RefType::Unique,
              )
            ),
          ],
          'type' => 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, 'foo') !== null) {
      $_tmp0 = \json_encode(HH\FIXME\UNSAFE_CAST<mixed, \apache\thrift\fixtures\types\ForwardUsageRoot>($parsed['foo']));
      $_tmp1 = \apache\thrift\fixtures\types\ForwardUsageRoot::withDefaultValues();
      $_tmp1->readFromJson($_tmp0);
      $this->foo = $_tmp1;
    }
  }

}

/**
 * Original thrift struct:-
 * IncompleteMap
 */
<<\ThriftTypeInfo(shape('uri' => 'apache.org/thrift/fixtures/types/IncompleteMap'))>>
class IncompleteMap implements \IThriftSyncStruct, \IThriftStructMetadata {
  use \ThriftSerializationTrait;

  const \ThriftStructTypes::TSpec SPEC = dict[
    1 => shape(
      'var' => 'field',
      'type' => \TType::MAP,
      'ktype' => \TType::I32,
      'vtype' => \TType::STRUCT,
      'key' => shape(
        'type' => \TType::I32,
      ),
      'val' => shape(
        'type' => \TType::STRUCT,
        'class' => \apache\thrift\fixtures\types\IncompleteMapDep::class,
      ),
      'format' => 'collection',
    ),
  ];
  const dict<string, int> FIELDMAP = dict[
    'field' => 1,
  ];

  const type TConstructorShape = shape(
    ?'field' => ?Map<int, \apache\thrift\fixtures\types\IncompleteMapDep>,
  );

  const int STRUCTURAL_ID = 8146873538067102953;
  /**
   * Original thrift field:-
   * 1: map<i32, module.IncompleteMapDep> field
   */
  public ?Map<int, \apache\thrift\fixtures\types\IncompleteMapDep> $field;

  public function __construct(?Map<int, \apache\thrift\fixtures\types\IncompleteMapDep> $field = null)[] {
    $this->field = $field;
  }

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

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

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

  public static function getStructMetadata()[]: \tmeta_ThriftStruct {
    return \tmeta_ThriftStruct::fromShape(
      shape(
        "name" => "module.IncompleteMap",
        "fields" => vec[
          \tmeta_ThriftField::fromShape(
            shape(
              "id" => 1,
              "type" => \tmeta_ThriftType::fromShape(
                shape(
                  "t_map" => \tmeta_ThriftMapType::fromShape(
                    shape(
                      "keyType" => \tmeta_ThriftType::fromShape(
                        shape(
                          "t_primitive" => \tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,
                        )
                      ),
                      "valueType" => \tmeta_ThriftType::fromShape(
                        shape(
                          "t_struct" => \tmeta_ThriftStructType::fromShape(
                            shape(
                              "name" => "module.IncompleteMapDep",
                            )
                          ),
                        )
                      ),
                    )
                  ),
                )
              ),
              "name" => "field",
              "is_optional" => true,
            )
          ),
        ],
        "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, 'field') !== null) {
      $_json3 = HH\FIXME\UNSAFE_CAST<mixed, Map<int, \apache\thrift\fixtures\types\IncompleteMapDep>>($parsed['field']);
      $_container4 = Map {};
      foreach($_json3 as $_key1 => $_value2) {
        $_value5 = \apache\thrift\fixtures\types\IncompleteMapDep::withDefaultValues();
        $_tmp6 = \json_encode($_value2);
        $_tmp7 = \apache\thrift\fixtures\types\IncompleteMapDep::withDefaultValues();
        $_tmp7->readFromJson($_tmp6);
        $_value5 = $_tmp7;
        $_container4[$_key1] = $_value5;
      }
      $this->field = $_container4;
    }
  }

}

/**
 * Original thrift struct:-
 * IncompleteMapDep
 */
<<\ThriftTypeInfo(shape('uri' => 'apache.org/thrift/fixtures/types/IncompleteMapDep'))>>
class IncompleteMapDep implements \IThriftSyncStruct, \IThriftStructMetadata {
  use \ThriftSerializationTrait;

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

  const type TConstructorShape = shape(
  );

  const int STRUCTURAL_ID = 957977401221134810;

  public function __construct()[] {
  }

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

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

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

  public static function getStructMetadata()[]: \tmeta_ThriftStruct {
    return \tmeta_ThriftStruct::fromShape(
      shape(
        "name" => "module.IncompleteMapDep",
        "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.");
    }

  }

}

/**
 * Original thrift struct:-
 * CompleteMap
 */
<<\ThriftTypeInfo(shape('uri' => 'apache.org/thrift/fixtures/types/CompleteMap'))>>
class CompleteMap implements \IThriftSyncStruct, \IThriftStructMetadata {
  use \ThriftSerializationTrait;

  const \ThriftStructTypes::TSpec SPEC = dict[
    1 => shape(
      'var' => 'field',
      'type' => \TType::MAP,
      'ktype' => \TType::I32,
      'vtype' => \TType::STRUCT,
      'key' => shape(
        'type' => \TType::I32,
      ),
      'val' => shape(
        'type' => \TType::STRUCT,
        'class' => \apache\thrift\fixtures\types\CompleteMapDep::class,
      ),
      'format' => 'collection',
    ),
  ];
  const dict<string, int> FIELDMAP = dict[
    'field' => 1,
  ];

  const type TConstructorShape = shape(
    ?'field' => ?Map<int, \apache\thrift\fixtures\types\CompleteMapDep>,
  );

  const int STRUCTURAL_ID = 8146873538067102953;
  /**
   * Original thrift field:-
   * 1: map<i32, module.CompleteMapDep> field
   */
  public ?Map<int, \apache\thrift\fixtures\types\CompleteMapDep> $field;

  public function __construct(?Map<int, \apache\thrift\fixtures\types\CompleteMapDep> $field = null)[] {
    $this->field = $field;
  }

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

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

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

  public static function getStructMetadata()[]: \tmeta_ThriftStruct {
    return \tmeta_ThriftStruct::fromShape(
      shape(
        "name" => "module.CompleteMap",
        "fields" => vec[
          \tmeta_ThriftField::fromShape(
            shape(
              "id" => 1,
              "type" => \tmeta_ThriftType::fromShape(
                shape(
                  "t_map" => \tmeta_ThriftMapType::fromShape(
                    shape(
                      "keyType" => \tmeta_ThriftType::fromShape(
                        shape(
                          "t_primitive" => \tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,
                        )
                      ),
                      "valueType" => \tmeta_ThriftType::fromShape(
                        shape(
                          "t_struct" => \tmeta_ThriftStructType::fromShape(
                            shape(
                              "name" => "module.CompleteMapDep",
                            )
                          ),
                        )
                      ),
                    )
                  ),
                )
              ),
              "name" => "field",
              "is_optional" => true,
            )
          ),
        ],
        "is_union" => false,
      )
    );
  }

  public static function getAllStructuredAnnotations()[write_props]: \TStructAnnotations {
    return shape(
      'struct' => dict[],
      'fields' => dict[
        'field' => shape(
          'field' => dict[
            '\facebook\thrift\annotation\cpp\Type' => \facebook\thrift\annotation\cpp\Type::fromShape(
              shape(
                "template" => "std::unordered_map",
              )
            ),
          ],
          'type' => 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, 'field') !== null) {
      $_json3 = HH\FIXME\UNSAFE_CAST<mixed, Map<int, \apache\thrift\fixtures\types\CompleteMapDep>>($parsed['field']);
      $_container4 = Map {};
      foreach($_json3 as $_key1 => $_value2) {
        $_value5 = \apache\thrift\fixtures\types\CompleteMapDep::withDefaultValues();
        $_tmp6 = \json_encode($_value2);
        $_tmp7 = \apache\thrift\fixtures\types\CompleteMapDep::withDefaultValues();
        $_tmp7->readFromJson($_tmp6);
        $_value5 = $_tmp7;
        $_container4[$_key1] = $_value5;
      }
      $this->field = $_container4;
    }
  }

}

/**
 * Original thrift struct:-
 * CompleteMapDep
 */
<<\ThriftTypeInfo(shape('uri' => 'apache.org/thrift/fixtures/types/CompleteMapDep'))>>
class CompleteMapDep implements \IThriftSyncStruct, \IThriftStructMetadata {
  use \ThriftSerializationTrait;

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

  const type TConstructorShape = shape(
  );

  const int STRUCTURAL_ID = 957977401221134810;

  public function __construct()[] {
  }

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

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

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

  public static function getStructMetadata()[]: \tmeta_ThriftStruct {
    return \tmeta_ThriftStruct::fromShape(
      shape(
        "name" => "module.CompleteMapDep",
        "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.");
    }

  }

}

/**
 * Original thrift struct:-
 * IncompleteList
 */
<<\ThriftTypeInfo(shape('uri' => 'apache.org/thrift/fixtures/types/IncompleteList'))>>
class IncompleteList implements \IThriftSyncStruct, \IThriftStructMetadata {
  use \ThriftSerializationTrait;

  const \ThriftStructTypes::TSpec SPEC = dict[
    1 => shape(
      'var' => 'field',
      'type' => \TType::LST,
      'etype' => \TType::STRUCT,
      'elem' => shape(
        'type' => \TType::STRUCT,
        'class' => \apache\thrift\fixtures\types\IncompleteListDep::class,
      ),
      'format' => 'collection',
    ),
  ];
  const dict<string, int> FIELDMAP = dict[
    'field' => 1,
  ];

  const type TConstructorShape = shape(
    ?'field' => ?Vector<\apache\thrift\fixtures\types\IncompleteListDep>,
  );

  const int STRUCTURAL_ID = 8146873538067102953;
  /**
   * Original thrift field:-
   * 1: list<module.IncompleteListDep> field
   */
  public ?Vector<\apache\thrift\fixtures\types\IncompleteListDep> $field;

  public function __construct(?Vector<\apache\thrift\fixtures\types\IncompleteListDep> $field = null)[] {
    $this->field = $field;
  }

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

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

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

  public static function getStructMetadata()[]: \tmeta_ThriftStruct {
    return \tmeta_ThriftStruct::fromShape(
      shape(
        "name" => "module.IncompleteList",
        "fields" => vec[
          \tmeta_ThriftField::fromShape(
            shape(
              "id" => 1,
              "type" => \tmeta_ThriftType::fromShape(
                shape(
                  "t_list" => \tmeta_ThriftListType::fromShape(
                    shape(
                      "valueType" => \tmeta_ThriftType::fromShape(
                        shape(
                          "t_struct" => \tmeta_ThriftStructType::fromShape(
                            shape(
                              "name" => "module.IncompleteListDep",
                            )
                          ),
                        )
                      ),
                    )
                  ),
                )
              ),
              "name" => "field",
              "is_optional" => true,
            )
          ),
        ],
        "is_union" => false,
      )
    );
  }

  public static function getAllStructuredAnnotations()[write_props]: \TStructAnnotations {
    return shape(
      'struct' => dict[],
      'fields' => dict[
        'field' => shape(
          'field' => dict[
            '\facebook\thrift\annotation\cpp\Type' => \facebook\thrift\annotation\cpp\Type::fromShape(
              shape(
                "template" => "::std::list",
              )
            ),
          ],
          'type' => 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, 'field') !== null) {
      $_json3 = HH\FIXME\UNSAFE_CAST<mixed, Vector<\apache\thrift\fixtures\types\IncompleteListDep>>($parsed['field']);
      $_container4 = Vector {};
      foreach($_json3 as $_key1 => $_value2) {
        $_elem5 = \apache\thrift\fixtures\types\IncompleteListDep::withDefaultValues();
        $_tmp6 = \json_encode($_value2);
        $_tmp7 = \apache\thrift\fixtures\types\IncompleteListDep::withDefaultValues();
        $_tmp7->readFromJson($_tmp6);
        $_elem5 = $_tmp7;
        $_container4 []= $_elem5;
      }
      $this->field = $_container4;
    }
  }

}

/**
 * Original thrift struct:-
 * IncompleteListDep
 */
<<\ThriftTypeInfo(shape('uri' => 'apache.org/thrift/fixtures/types/IncompleteListDep'))>>
class IncompleteListDep implements \IThriftSyncStruct, \IThriftStructMetadata {
  use \ThriftSerializationTrait;

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

  const type TConstructorShape = shape(
  );

  const int STRUCTURAL_ID = 957977401221134810;

  public function __construct()[] {
  }

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

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

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

  public static function getStructMetadata()[]: \tmeta_ThriftStruct {
    return \tmeta_ThriftStruct::fromShape(
      shape(
        "name" => "module.IncompleteListDep",
        "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.");
    }

  }

}

/**
 * Original thrift struct:-
 * CompleteList
 */
<<\ThriftTypeInfo(shape('uri' => 'apache.org/thrift/fixtures/types/CompleteList'))>>
class CompleteList implements \IThriftSyncStruct, \IThriftStructMetadata {
  use \ThriftSerializationTrait;

  const \ThriftStructTypes::TSpec SPEC = dict[
    1 => shape(
      'var' => 'field',
      'type' => \TType::LST,
      'etype' => \TType::STRUCT,
      'elem' => shape(
        'type' => \TType::STRUCT,
        'class' => \apache\thrift\fixtures\types\CompleteListDep::class,
      ),
      'format' => 'collection',
    ),
  ];
  const dict<string, int> FIELDMAP = dict[
    'field' => 1,
  ];

  const type TConstructorShape = shape(
    ?'field' => ?Vector<\apache\thrift\fixtures\types\CompleteListDep>,
  );

  const int STRUCTURAL_ID = 8146873538067102953;
  /**
   * Original thrift field:-
   * 1: list<module.CompleteListDep> field
   */
  public ?Vector<\apache\thrift\fixtures\types\CompleteListDep> $field;

  public function __construct(?Vector<\apache\thrift\fixtures\types\CompleteListDep> $field = null)[] {
    $this->field = $field;
  }

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

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

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

  public static function getStructMetadata()[]: \tmeta_ThriftStruct {
    return \tmeta_ThriftStruct::fromShape(
      shape(
        "name" => "module.CompleteList",
        "fields" => vec[
          \tmeta_ThriftField::fromShape(
            shape(
              "id" => 1,
              "type" => \tmeta_ThriftType::fromShape(
                shape(
                  "t_list" => \tmeta_ThriftListType::fromShape(
                    shape(
                      "valueType" => \tmeta_ThriftType::fromShape(
                        shape(
                          "t_struct" => \tmeta_ThriftStructType::fromShape(
                            shape(
                              "name" => "module.CompleteListDep",
                            )
                          ),
                        )
                      ),
                    )
                  ),
                )
              ),
              "name" => "field",
              "is_optional" => true,
            )
          ),
        ],
        "is_union" => false,
      )
    );
  }

  public static function getAllStructuredAnnotations()[write_props]: \TStructAnnotations {
    return shape(
      'struct' => dict[],
      'fields' => dict[
        'field' => shape(
          'field' => dict[
            '\facebook\thrift\annotation\cpp\Type' => \facebook\thrift\annotation\cpp\Type::fromShape(
              shape(
                "template" => "folly::small_vector",
              )
            ),
          ],
          'type' => 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, 'field') !== null) {
      $_json3 = HH\FIXME\UNSAFE_CAST<mixed, Vector<\apache\thrift\fixtures\types\CompleteListDep>>($parsed['field']);
      $_container4 = Vector {};
      foreach($_json3 as $_key1 => $_value2) {
        $_elem5 = \apache\thrift\fixtures\types\CompleteListDep::withDefaultValues();
        $_tmp6 = \json_encode($_value2);
        $_tmp7 = \apache\thrift\fixtures\types\CompleteListDep::withDefaultValues();
        $_tmp7->readFromJson($_tmp6);
        $_elem5 = $_tmp7;
        $_container4 []= $_elem5;
      }
      $this->field = $_container4;
    }
  }

}

/**
 * Original thrift struct:-
 * CompleteListDep
 */
<<\ThriftTypeInfo(shape('uri' => 'apache.org/thrift/fixtures/types/CompleteListDep'))>>
class CompleteListDep implements \IThriftSyncStruct, \IThriftStructMetadata {
  use \ThriftSerializationTrait;

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

  const type TConstructorShape = shape(
  );

  const int STRUCTURAL_ID = 957977401221134810;

  public function __construct()[] {
  }

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

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

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

  public static function getStructMetadata()[]: \tmeta_ThriftStruct {
    return \tmeta_ThriftStruct::fromShape(
      shape(
        "name" => "module.CompleteListDep",
        "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.");
    }

  }

}

/**
 * Original thrift struct:-
 * AdaptedList
 */
<<\ThriftTypeInfo(shape('uri' => 'apache.org/thrift/fixtures/types/AdaptedList'))>>
class AdaptedList implements \IThriftSyncStruct, \IThriftStructMetadata {
  use \ThriftSerializationTrait;

  const \ThriftStructTypes::TSpec SPEC = dict[
    1 => shape(
      'var' => 'field',
      'type' => \TType::LST,
      'etype' => \TType::STRUCT,
      'elem' => shape(
        'type' => \TType::STRUCT,
        'class' => \apache\thrift\fixtures\types\AdaptedListDep::class,
      ),
      'format' => 'collection',
    ),
  ];
  const dict<string, int> FIELDMAP = dict[
    'field' => 1,
  ];

  const type TConstructorShape = shape(
    ?'field' => ?Vector<\apache\thrift\fixtures\types\AdaptedListDep>,
  );

  const int STRUCTURAL_ID = 8146873538067102953;
  /**
   * Original thrift field:-
   * 1: list<module.AdaptedListDep> field
   */
  public ?Vector<\apache\thrift\fixtures\types\AdaptedListDep> $field;

  public function __construct(?Vector<\apache\thrift\fixtures\types\AdaptedListDep> $field = null)[] {
    $this->field = $field;
  }

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

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

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

  public static function getStructMetadata()[]: \tmeta_ThriftStruct {
    return \tmeta_ThriftStruct::fromShape(
      shape(
        "name" => "module.AdaptedList",
        "fields" => vec[
          \tmeta_ThriftField::fromShape(
            shape(
              "id" => 1,
              "type" => \tmeta_ThriftType::fromShape(
                shape(
                  "t_list" => \tmeta_ThriftListType::fromShape(
                    shape(
                      "valueType" => \tmeta_ThriftType::fromShape(
                        shape(
                          "t_struct" => \tmeta_ThriftStructType::fromShape(
                            shape(
                              "name" => "module.AdaptedListDep",
                            )
                          ),
                        )
                      ),
                    )
                  ),
                )
              ),
              "name" => "field",
              "is_optional" => true,
            )
          ),
        ],
        "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, 'field') !== null) {
      $_json3 = HH\FIXME\UNSAFE_CAST<mixed, Vector<\apache\thrift\fixtures\types\AdaptedListDep>>($parsed['field']);
      $_container4 = Vector {};
      foreach($_json3 as $_key1 => $_value2) {
        $_elem5 = \apache\thrift\fixtures\types\AdaptedListDep::withDefaultValues();
        $_tmp6 = \json_encode($_value2);
        $_tmp7 = \apache\thrift\fixtures\types\AdaptedListDep::withDefaultValues();
        $_tmp7->readFromJson($_tmp6);
        $_elem5 = $_tmp7;
        $_container4 []= $_elem5;
      }
      $this->field = $_container4;
    }
  }

}

/**
 * Original thrift struct:-
 * AdaptedListDep
 */
<<\ThriftTypeInfo(shape('uri' => 'apache.org/thrift/fixtures/types/AdaptedListDep'))>>
class AdaptedListDep implements \IThriftSyncStruct, \IThriftStructMetadata {
  use \ThriftSerializationTrait;

  const \ThriftStructTypes::TSpec SPEC = dict[
    1 => shape(
      'var' => 'field',
      'type' => \TType::STRUCT,
      'class' => \apache\thrift\fixtures\types\AdaptedList::class,
    ),
  ];
  const dict<string, int> FIELDMAP = dict[
    'field' => 1,
  ];

  const type TConstructorShape = shape(
    ?'field' => ?\apache\thrift\fixtures\types\AdaptedList,
  );

  const int STRUCTURAL_ID = 4190573964717330521;
  /**
   * Original thrift field:-
   * 1: module.AdaptedList field
   */
  public ?\apache\thrift\fixtures\types\AdaptedList $field;

  public function __construct(?\apache\thrift\fixtures\types\AdaptedList $field = null)[] {
    $this->field = $field;
  }

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

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

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

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

  public static function getAllStructuredAnnotations()[write_props]: \TStructAnnotations {
    return shape(
      'struct' => dict[
        '\facebook\thrift\annotation\cpp\Adapter' => \facebook\thrift\annotation\cpp\Adapter::fromShape(
          shape(
            "name" => "IdentityAdapter<detail::AdaptedListDep>",
            "adaptedType" => "detail::AdaptedListDep",
          )
        ),
      ],
      '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, 'field') !== null) {
      $_tmp0 = \json_encode(HH\FIXME\UNSAFE_CAST<mixed, \apache\thrift\fixtures\types\AdaptedList>($parsed['field']));
      $_tmp1 = \apache\thrift\fixtures\types\AdaptedList::withDefaultValues();
      $_tmp1->readFromJson($_tmp0);
      $this->field = $_tmp1;
    }
  }

}

/**
 * Original thrift struct:-
 * DependentAdaptedList
 */
<<\ThriftTypeInfo(shape('uri' => 'apache.org/thrift/fixtures/types/DependentAdaptedList'))>>
class DependentAdaptedList implements \IThriftSyncStruct, \IThriftStructMetadata {
  use \ThriftSerializationTrait;

  const \ThriftStructTypes::TSpec SPEC = dict[
    1 => shape(
      'var' => 'field',
      'type' => \TType::LST,
      'etype' => \TType::STRUCT,
      'elem' => shape(
        'type' => \TType::STRUCT,
        'class' => \apache\thrift\fixtures\types\DependentAdaptedListDep::class,
      ),
      'format' => 'collection',
    ),
  ];
  const dict<string, int> FIELDMAP = dict[
    'field' => 1,
  ];

  const type TConstructorShape = shape(
    ?'field' => ?Vector<\apache\thrift\fixtures\types\DependentAdaptedListDep>,
  );

  const int STRUCTURAL_ID = 8146873538067102953;
  /**
   * Original thrift field:-
   * 1: list<module.DependentAdaptedListDep> field
   */
  public ?Vector<\apache\thrift\fixtures\types\DependentAdaptedListDep> $field;

  public function __construct(?Vector<\apache\thrift\fixtures\types\DependentAdaptedListDep> $field = null)[] {
    $this->field = $field;
  }

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

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

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

  public static function getStructMetadata()[]: \tmeta_ThriftStruct {
    return \tmeta_ThriftStruct::fromShape(
      shape(
        "name" => "module.DependentAdaptedList",
        "fields" => vec[
          \tmeta_ThriftField::fromShape(
            shape(
              "id" => 1,
              "type" => \tmeta_ThriftType::fromShape(
                shape(
                  "t_list" => \tmeta_ThriftListType::fromShape(
                    shape(
                      "valueType" => \tmeta_ThriftType::fromShape(
                        shape(
                          "t_struct" => \tmeta_ThriftStructType::fromShape(
                            shape(
                              "name" => "module.DependentAdaptedListDep",
                            )
                          ),
                        )
                      ),
                    )
                  ),
                )
              ),
              "name" => "field",
              "is_optional" => true,
            )
          ),
        ],
        "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, 'field') !== null) {
      $_json3 = HH\FIXME\UNSAFE_CAST<mixed, Vector<\apache\thrift\fixtures\types\DependentAdaptedListDep>>($parsed['field']);
      $_container4 = Vector {};
      foreach($_json3 as $_key1 => $_value2) {
        $_elem5 = \apache\thrift\fixtures\types\DependentAdaptedListDep::withDefaultValues();
        $_tmp6 = \json_encode($_value2);
        $_tmp7 = \apache\thrift\fixtures\types\DependentAdaptedListDep::withDefaultValues();
        $_tmp7->readFromJson($_tmp6);
        $_elem5 = $_tmp7;
        $_container4 []= $_elem5;
      }
      $this->field = $_container4;
    }
  }

}

/**
 * Original thrift struct:-
 * DependentAdaptedListDep
 */
<<\ThriftTypeInfo(shape('uri' => 'apache.org/thrift/fixtures/types/DependentAdaptedListDep'))>>
class DependentAdaptedListDep implements \IThriftSyncStruct, \IThriftStructMetadata {
  use \ThriftSerializationTrait;

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

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

  const int STRUCTURAL_ID = 4533421093368234312;
  /**
   * Original thrift field:-
   * 1: i16 field
   */
  public ?int $field;

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

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

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

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

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

  public static function getAllStructuredAnnotations()[write_props]: \TStructAnnotations {
    return shape(
      'struct' => dict[
        '\facebook\thrift\annotation\cpp\Adapter' => \facebook\thrift\annotation\cpp\Adapter::fromShape(
          shape(
            "name" => "IdentityAdapter<detail::DependentAdaptedListDep>",
          )
        ),
      ],
      'fields' => dict[
        'field' => shape(
          'field' => dict[
            '\facebook\thrift\annotation\Box' => \facebook\thrift\annotation\Box::fromShape(
              shape(
              )
            ),
          ],
          'type' => 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, 'field') !== null) {
      $_tmp0 = (int)HH\FIXME\UNSAFE_CAST<mixed, int>($parsed['field']);
      if ($_tmp0 > 0x7fff) {
        throw new \TProtocolException("number exceeds limit in field");
      } else {
        $this->field = (int)$_tmp0;
      }
    }
  }

}

/**
 * Original thrift struct:-
 * AllocatorAware
 */
<<\ThriftTypeInfo(shape('uri' => 'apache.org/thrift/fixtures/types/AllocatorAware'))>>
class AllocatorAware implements \IThriftSyncStruct, \IThriftStructMetadata {
  use \ThriftSerializationTrait;

  const \ThriftStructTypes::TSpec SPEC = dict[
    1 => shape(
      'var' => 'aa_list',
      'type' => \TType::LST,
      'etype' => \TType::I32,
      'elem' => shape(
        'type' => \TType::I32,
      ),
      'format' => 'collection',
    ),
    2 => shape(
      'var' => 'aa_set',
      'type' => \TType::SET,
      'etype' => \TType::I32,
      'elem' => shape(
        'type' => \TType::I32,
      ),
      'format' => 'collection',
    ),
    3 => shape(
      'var' => 'aa_map',
      'type' => \TType::MAP,
      'ktype' => \TType::I32,
      'vtype' => \TType::I32,
      'key' => shape(
        'type' => \TType::I32,
      ),
      'val' => shape(
        'type' => \TType::I32,
      ),
      'format' => 'collection',
    ),
    4 => shape(
      'var' => 'aa_string',
      'type' => \TType::STRING,
    ),
    5 => shape(
      'var' => 'not_a_container',
      'type' => \TType::I32,
    ),
    6 => shape(
      'var' => 'aa_unique',
      'type' => \TType::I32,
    ),
    7 => shape(
      'var' => 'aa_shared',
      'type' => \TType::I32,
    ),
  ];
  const dict<string, int> FIELDMAP = dict[
    'aa_list' => 1,
    'aa_set' => 2,
    'aa_map' => 3,
    'aa_string' => 4,
    'not_a_container' => 5,
    'aa_unique' => 6,
    'aa_shared' => 7,
  ];

  const type TConstructorShape = shape(
    ?'aa_list' => ?Vector<int>,
    ?'aa_set' => ?Set<int>,
    ?'aa_map' => ?Map<int, int>,
    ?'aa_string' => ?string,
    ?'not_a_container' => ?int,
    ?'aa_unique' => ?int,
    ?'aa_shared' => ?int,
  );

  const int STRUCTURAL_ID = 6091982818879931050;
  /**
   * Original thrift field:-
   * 1: module.list_i32_9187 aa_list
   */
  public Vector<int> $aa_list;
  /**
   * Original thrift field:-
   * 2: module.set_i32_7070 aa_set
   */
  public Set<int> $aa_set;
  /**
   * Original thrift field:-
   * 3: module.map_i32_i32_9565 aa_map
   */
  public Map<int, int> $aa_map;
  /**
   * Original thrift field:-
   * 4: module.string_5252 aa_string
   */
  public string $aa_string;
  /**
   * Original thrift field:-
   * 5: i32 not_a_container
   */
  public int $not_a_container;
  /**
   * Original thrift field:-
   * 6: module.i32_9314 aa_unique
   */
  public int $aa_unique;
  /**
   * Original thrift field:-
   * 7: module.i32_9314 aa_shared
   */
  public int $aa_shared;

  public function __construct(?Vector<int> $aa_list = null, ?Set<int> $aa_set = null, ?Map<int, int> $aa_map = null, ?string $aa_string = null, ?int $not_a_container = null, ?int $aa_unique = null, ?int $aa_shared = null)[] {
    $this->aa_list = $aa_list ?? Vector {};
    $this->aa_set = $aa_set ?? Set {};
    $this->aa_map = $aa_map ?? Map {};
    $this->aa_string = $aa_string ?? '';
    $this->not_a_container = $not_a_container ?? 0;
    $this->aa_unique = $aa_unique ?? 0;
    $this->aa_shared = $aa_shared ?? 0;
  }

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

  public static function fromShape(self::TConstructorShape $shape)[]: this {
    return new static(
      Shapes::idx($shape, 'aa_list'),
      Shapes::idx($shape, 'aa_set'),
      Shapes::idx($shape, 'aa_map'),
      Shapes::idx($shape, 'aa_string'),
      Shapes::idx($shape, 'not_a_container'),
      Shapes::idx($shape, 'aa_unique'),
      Shapes::idx($shape, 'aa_shared'),
    );
  }

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

  public static function getStructMetadata()[]: \tmeta_ThriftStruct {
    return \tmeta_ThriftStruct::fromShape(
      shape(
        "name" => "module.AllocatorAware",
        "fields" => vec[
          \tmeta_ThriftField::fromShape(
            shape(
              "id" => 1,
              "type" => \tmeta_ThriftType::fromShape(
                shape(
                  "t_typedef" => \tmeta_ThriftTypedefType::fromShape(
                    shape(
                      "name" => "module.list_i32_9187",
                      "underlyingType" => \tmeta_ThriftType::fromShape(
                        shape(
                          "t_list" => \tmeta_ThriftListType::fromShape(
                            shape(
                              "valueType" => \tmeta_ThriftType::fromShape(
                                shape(
                                  "t_primitive" => \tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,
                                )
                              ),
                            )
                          ),
                        )
                      ),
                    )
                  ),
                )
              ),
              "name" => "aa_list",
            )
          ),
          \tmeta_ThriftField::fromShape(
            shape(
              "id" => 2,
              "type" => \tmeta_ThriftType::fromShape(
                shape(
                  "t_typedef" => \tmeta_ThriftTypedefType::fromShape(
                    shape(
                      "name" => "module.set_i32_7070",
                      "underlyingType" => \tmeta_ThriftType::fromShape(
                        shape(
                          "t_set" => \tmeta_ThriftSetType::fromShape(
                            shape(
                              "valueType" => \tmeta_ThriftType::fromShape(
                                shape(
                                  "t_primitive" => \tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,
                                )
                              ),
                            )
                          ),
                        )
                      ),
                    )
                  ),
                )
              ),
              "name" => "aa_set",
            )
          ),
          \tmeta_ThriftField::fromShape(
            shape(
              "id" => 3,
              "type" => \tmeta_ThriftType::fromShape(
                shape(
                  "t_typedef" => \tmeta_ThriftTypedefType::fromShape(
                    shape(
                      "name" => "module.map_i32_i32_9565",
                      "underlyingType" => \tmeta_ThriftType::fromShape(
                        shape(
                          "t_map" => \tmeta_ThriftMapType::fromShape(
                            shape(
                              "keyType" => \tmeta_ThriftType::fromShape(
                                shape(
                                  "t_primitive" => \tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,
                                )
                              ),
                              "valueType" => \tmeta_ThriftType::fromShape(
                                shape(
                                  "t_primitive" => \tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,
                                )
                              ),
                            )
                          ),
                        )
                      ),
                    )
                  ),
                )
              ),
              "name" => "aa_map",
            )
          ),
          \tmeta_ThriftField::fromShape(
            shape(
              "id" => 4,
              "type" => \tmeta_ThriftType::fromShape(
                shape(
                  "t_typedef" => \tmeta_ThriftTypedefType::fromShape(
                    shape(
                      "name" => "module.string_5252",
                      "underlyingType" => \tmeta_ThriftType::fromShape(
                        shape(
                          "t_primitive" => \tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,
                        )
                      ),
                    )
                  ),
                )
              ),
              "name" => "aa_string",
            )
          ),
          \tmeta_ThriftField::fromShape(
            shape(
              "id" => 5,
              "type" => \tmeta_ThriftType::fromShape(
                shape(
                  "t_primitive" => \tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,
                )
              ),
              "name" => "not_a_container",
            )
          ),
          \tmeta_ThriftField::fromShape(
            shape(
              "id" => 6,
              "type" => \tmeta_ThriftType::fromShape(
                shape(
                  "t_typedef" => \tmeta_ThriftTypedefType::fromShape(
                    shape(
                      "name" => "module.i32_9314",
                      "underlyingType" => \tmeta_ThriftType::fromShape(
                        shape(
                          "t_primitive" => \tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,
                        )
                      ),
                    )
                  ),
                )
              ),
              "name" => "aa_unique",
            )
          ),
          \tmeta_ThriftField::fromShape(
            shape(
              "id" => 7,
              "type" => \tmeta_ThriftType::fromShape(
                shape(
                  "t_typedef" => \tmeta_ThriftTypedefType::fromShape(
                    shape(
                      "name" => "module.i32_9314",
                      "underlyingType" => \tmeta_ThriftType::fromShape(
                        shape(
                          "t_primitive" => \tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,
                        )
                      ),
                    )
                  ),
                )
              ),
              "name" => "aa_shared",
            )
          ),
        ],
        "is_union" => false,
      )
    );
  }

  public static function getAllStructuredAnnotations()[write_props]: \TStructAnnotations {
    return shape(
      'struct' => dict[],
      'fields' => dict[
        'aa_unique' => shape(
          'field' => dict[
            '\facebook\thrift\annotation\cpp\Ref' => \facebook\thrift\annotation\cpp\Ref::fromShape(
              shape(
                "type" => \facebook\thrift\annotation\cpp\RefType::Unique,
              )
            ),
          ],
          'type' => dict[],
        ),
        'aa_shared' => shape(
          'field' => dict[
            '\facebook\thrift\annotation\cpp\Ref' => \facebook\thrift\annotation\cpp\Ref::fromShape(
              shape(
                "type" => \facebook\thrift\annotation\cpp\RefType::SharedMutable,
              )
            ),
          ],
          'type' => 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, 'aa_list') !== null) {
      $_json3 = HH\FIXME\UNSAFE_CAST<mixed, Vector<int>>($parsed['aa_list']);
      $_container4 = Vector {};
      foreach($_json3 as $_key1 => $_value2) {
        $_elem5 = 0;
        $_tmp6 = (int)$_value2;
        if ($_tmp6 > 0x7fffffff) {
          throw new \TProtocolException("number exceeds limit in field");
        } else {
          $_elem5 = (int)$_tmp6;
        }
        $_container4 []= $_elem5;
      }
      $this->aa_list = $_container4;
    }
    if (idx($parsed, 'aa_set') !== null) {
      $_json10 = HH\FIXME\UNSAFE_CAST<mixed, Set<int>>($parsed['aa_set']);
      $_container11 = Set {};
      foreach($_json10 as $_key8 => $_value9) {
        $_elem12 = 0;
        $_tmp13 = (int)$_value9;
        if ($_tmp13 > 0x7fffffff) {
          throw new \TProtocolException("number exceeds limit in field");
        } else {
          $_elem12 = (int)$_tmp13;
        }
        $_container11->add($_elem12);
      }
      $this->aa_set = $_container11;
    }
    if (idx($parsed, 'aa_map') !== null) {
      $_json17 = HH\FIXME\UNSAFE_CAST<mixed, Map<int, int>>($parsed['aa_map']);
      $_container18 = Map {};
      foreach($_json17 as $_key15 => $_value16) {
        $_value19 = 0;
        $_tmp20 = (int)$_value16;
        if ($_tmp20 > 0x7fffffff) {
          throw new \TProtocolException("number exceeds limit in field");
        } else {
          $_value19 = (int)$_tmp20;
        }
        $_container18[$_key15] = $_value19;
      }
      $this->aa_map = $_container18;
    }
    if (idx($parsed, 'aa_string') !== null) {
      $this->aa_string = HH\FIXME\UNSAFE_CAST<mixed, string>($parsed['aa_string']);
    }
    if (idx($parsed, 'not_a_container') !== null) {
      $_tmp21 = (int)HH\FIXME\UNSAFE_CAST<mixed, int>($parsed['not_a_container']);
      if ($_tmp21 > 0x7fffffff) {
        throw new \TProtocolException("number exceeds limit in field");
      } else {
        $this->not_a_container = (int)$_tmp21;
      }
    }
    if (idx($parsed, 'aa_unique') !== null) {
      $_tmp22 = (int)HH\FIXME\UNSAFE_CAST<mixed, int>($parsed['aa_unique']);
      if ($_tmp22 > 0x7fffffff) {
        throw new \TProtocolException("number exceeds limit in field");
      } else {
        $this->aa_unique = (int)$_tmp22;
      }
    }
    if (idx($parsed, 'aa_shared') !== null) {
      $_tmp23 = (int)HH\FIXME\UNSAFE_CAST<mixed, int>($parsed['aa_shared']);
      if ($_tmp23 > 0x7fffffff) {
        throw new \TProtocolException("number exceeds limit in field");
      } else {
        $this->aa_shared = (int)$_tmp23;
      }
    }
  }

}

/**
 * Original thrift struct:-
 * AllocatorAware2
 */
<<\ThriftTypeInfo(shape('uri' => 'apache.org/thrift/fixtures/types/AllocatorAware2'))>>
class AllocatorAware2 implements \IThriftSyncStruct, \IThriftStructMetadata {
  use \ThriftSerializationTrait;

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

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

  const int STRUCTURAL_ID = 8535397751218300194;
  /**
   * Original thrift field:-
   * 1: i32 not_a_container
   */
  public int $not_a_container;
  /**
   * Original thrift field:-
   * 2: i32 box_field
   */
  public ?int $box_field;

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

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

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

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

  public static function getStructMetadata()[]: \tmeta_ThriftStruct {
    return \tmeta_ThriftStruct::fromShape(
      shape(
        "name" => "module.AllocatorAware2",
        "fields" => vec[
          \tmeta_ThriftField::fromShape(
            shape(
              "id" => 1,
              "type" => \tmeta_ThriftType::fromShape(
                shape(
                  "t_primitive" => \tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,
                )
              ),
              "name" => "not_a_container",
            )
          ),
          \tmeta_ThriftField::fromShape(
            shape(
              "id" => 2,
              "type" => \tmeta_ThriftType::fromShape(
                shape(
                  "t_primitive" => \tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,
                )
              ),
              "name" => "box_field",
              "is_optional" => true,
            )
          ),
        ],
        "is_union" => false,
      )
    );
  }

  public static function getAllStructuredAnnotations()[write_props]: \TStructAnnotations {
    return shape(
      'struct' => dict[],
      'fields' => dict[
        'box_field' => shape(
          'field' => dict[
            '\facebook\thrift\annotation\Box' => \facebook\thrift\annotation\Box::fromShape(
              shape(
              )
            ),
          ],
          'type' => 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, 'not_a_container') !== null) {
      $_tmp0 = (int)HH\FIXME\UNSAFE_CAST<mixed, int>($parsed['not_a_container']);
      if ($_tmp0 > 0x7fffffff) {
        throw new \TProtocolException("number exceeds limit in field");
      } else {
        $this->not_a_container = (int)$_tmp0;
      }
    }
    if (idx($parsed, 'box_field') !== null) {
      $_tmp1 = (int)HH\FIXME\UNSAFE_CAST<mixed, int>($parsed['box_field']);
      if ($_tmp1 > 0x7fffffff) {
        throw new \TProtocolException("number exceeds limit in field");
      } else {
        $this->box_field = (int)$_tmp1;
      }
    }
  }

}

/**
 * Original thrift struct:-
 * TypedefStruct
 */
<<\ThriftTypeInfo(shape('uri' => 'apache.org/thrift/fixtures/types/TypedefStruct'))>>
class TypedefStruct implements \IThriftSyncStruct, \IThriftStructMetadata {
  use \ThriftSerializationTrait;

  const \ThriftStructTypes::TSpec SPEC = dict[
    1 => shape(
      'var' => 'i32_field',
      'type' => \TType::I32,
    ),
    2 => shape(
      'var' => 'IntTypedef_field',
      'type' => \TType::I32,
    ),
    3 => shape(
      'var' => 'UintTypedef_field',
      'type' => \TType::I32,
    ),
  ];
  const dict<string, int> FIELDMAP = dict[
    'i32_field' => 1,
    'IntTypedef_field' => 2,
    'UintTypedef_field' => 3,
  ];

  const type TConstructorShape = shape(
    ?'i32_field' => ?int,
    ?'IntTypedef_field' => ?int,
    ?'UintTypedef_field' => ?int,
  );

  const int STRUCTURAL_ID = 9104074718450007174;
  /**
   * Original thrift field:-
   * 1: i32 i32_field
   */
  public int $i32_field;
  /**
   * Original thrift field:-
   * 2: module.IntTypedef IntTypedef_field
   */
  public int $IntTypedef_field;
  /**
   * Original thrift field:-
   * 3: module.UintTypedef UintTypedef_field
   */
  public int $UintTypedef_field;

  public function __construct(?int $i32_field = null, ?int $IntTypedef_field = null, ?int $UintTypedef_field = null)[] {
    $this->i32_field = $i32_field ?? 0;
    $this->IntTypedef_field = $IntTypedef_field ?? 0;
    $this->UintTypedef_field = $UintTypedef_field ?? 0;
  }

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

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

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

  public static function getStructMetadata()[]: \tmeta_ThriftStruct {
    return \tmeta_ThriftStruct::fromShape(
      shape(
        "name" => "module.TypedefStruct",
        "fields" => vec[
          \tmeta_ThriftField::fromShape(
            shape(
              "id" => 1,
              "type" => \tmeta_ThriftType::fromShape(
                shape(
                  "t_primitive" => \tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,
                )
              ),
              "name" => "i32_field",
            )
          ),
          \tmeta_ThriftField::fromShape(
            shape(
              "id" => 2,
              "type" => \tmeta_ThriftType::fromShape(
                shape(
                  "t_typedef" => \tmeta_ThriftTypedefType::fromShape(
                    shape(
                      "name" => "module.IntTypedef",
                      "underlyingType" => \tmeta_ThriftType::fromShape(
                        shape(
                          "t_primitive" => \tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,
                        )
                      ),
                    )
                  ),
                )
              ),
              "name" => "IntTypedef_field",
            )
          ),
          \tmeta_ThriftField::fromShape(
            shape(
              "id" => 3,
              "type" => \tmeta_ThriftType::fromShape(
                shape(
                  "t_typedef" => \tmeta_ThriftTypedefType::fromShape(
                    shape(
                      "name" => "module.UintTypedef",
                      "underlyingType" => \tmeta_ThriftType::fromShape(
                        shape(
                          "t_typedef" => \tmeta_ThriftTypedefType::fromShape(
                            shape(
                              "name" => "module.IntTypedef",
                              "underlyingType" => \tmeta_ThriftType::fromShape(
                                shape(
                                  "t_typedef" => \tmeta_ThriftTypedefType::fromShape(
                                    shape(
                                      "name" => "module.IntTypedef",
                                      "underlyingType" => \tmeta_ThriftType::fromShape(
                                        shape(
                                          "t_primitive" => \tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,
                                        )
                                      ),
                                    )
                                  ),
                                )
                              ),
                            )
                          ),
                        )
                      ),
                    )
                  ),
                )
              ),
              "name" => "UintTypedef_field",
            )
          ),
        ],
        "is_union" => false,
      )
    );
  }

  public static function getAllStructuredAnnotations()[write_props]: \TStructAnnotations {
    return shape(
      'struct' => dict[],
      'fields' => dict[
        'UintTypedef_field' => shape(
          'field' => dict[],
          'type' => dict[
            '\facebook\thrift\annotation\cpp\Type' => \facebook\thrift\annotation\cpp\Type::fromShape(
              shape(
                "name" => "std::uint32_t",
              )
            ),
          ],
        ),
      ],
    );
  }

  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, 'i32_field') !== null) {
      $_tmp0 = (int)HH\FIXME\UNSAFE_CAST<mixed, int>($parsed['i32_field']);
      if ($_tmp0 > 0x7fffffff) {
        throw new \TProtocolException("number exceeds limit in field");
      } else {
        $this->i32_field = (int)$_tmp0;
      }
    }
    if (idx($parsed, 'IntTypedef_field') !== null) {
      $_tmp1 = (int)HH\FIXME\UNSAFE_CAST<mixed, int>($parsed['IntTypedef_field']);
      if ($_tmp1 > 0x7fffffff) {
        throw new \TProtocolException("number exceeds limit in field");
      } else {
        $this->IntTypedef_field = (int)$_tmp1;
      }
    }
    if (idx($parsed, 'UintTypedef_field') !== null) {
      $_tmp2 = (int)HH\FIXME\UNSAFE_CAST<mixed, int>($parsed['UintTypedef_field']);
      if ($_tmp2 > 0x7fffffff) {
        throw new \TProtocolException("number exceeds limit in field");
      } else {
        $this->UintTypedef_field = (int)$_tmp2;
      }
    }
  }

}

/**
 * Original thrift struct:-
 * StructWithDoubleUnderscores
 */
<<\ThriftTypeInfo(shape('uri' => 'apache.org/thrift/fixtures/types/StructWithDoubleUnderscores'))>>
class StructWithDoubleUnderscores implements \IThriftSyncStruct, \IThriftStructMetadata {
  use \ThriftSerializationTrait;

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

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

  const int STRUCTURAL_ID = 8209484534723602012;
  /**
   * Original thrift field:-
   * 1: i32 __field
   */
  public int $__field;

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

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

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

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

  public static function getStructMetadata()[]: \tmeta_ThriftStruct {
    return \tmeta_ThriftStruct::fromShape(
      shape(
        "name" => "module.StructWithDoubleUnderscores",
        "fields" => vec[
          \tmeta_ThriftField::fromShape(
            shape(
              "id" => 1,
              "type" => \tmeta_ThriftType::fromShape(
                shape(
                  "t_primitive" => \tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,
                )
              ),
              "name" => "__field",
            )
          ),
        ],
        "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, '__field') !== null) {
      $_tmp0 = (int)HH\FIXME\UNSAFE_CAST<mixed, int>($parsed['__field']);
      if ($_tmp0 > 0x7fffffff) {
        throw new \TProtocolException("number exceeds limit in field");
      } else {
        $this->__field = (int)$_tmp0;
      }
    }
  }

}

