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

/**
 * Original thrift enum:-
 * Void
 */
<<\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/type/Void'))>>
enum apache_thrift_type_standard_Void: int {
  Unused = 0;
}

class apache_thrift_type_standard_Void_TEnumStaticMetadata implements \IThriftEnumStaticMetadata {
  public static function getEnumMetadata()[]: \tmeta_ThriftEnum {
    return tmeta_ThriftEnum::fromShape(
      shape(
        "name" => "standard.Void",
        "elements" => dict[
          0 => "Unused",
        ],
      )
    );
  }

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

/**
 * The standard Thrift protocols.
 *
 * Original thrift enum:-
 * StandardProtocol
 */
<<\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/type/StandardProtocol'))>>
enum apache_thrift_type_standard_StandardProtocol: int {
  Custom = 0;
  Binary = 1;
  Compact = 2;
  Json = 3;
  SimpleJson = 4;
}

class apache_thrift_type_standard_StandardProtocol_TEnumStaticMetadata implements \IThriftEnumStaticMetadata {
  public static function getEnumMetadata()[]: \tmeta_ThriftEnum {
    return tmeta_ThriftEnum::fromShape(
      shape(
        "name" => "standard.StandardProtocol",
        "elements" => dict[
          0 => "Custom",
          1 => "Binary",
          2 => "Compact",
          3 => "Json",
          4 => "SimpleJson",
        ],
      )
    );
  }

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

enum apache_thrift_type_standard_TypeUriEnum: int {
  _EMPTY_ = 0;
  uri = 1;
  typeHashPrefixSha2_256 = 2;
  scopedName = 3;
}

/**
 * The uri of an IDL defined type.
 *
 * Original thrift struct:-
 * TypeUri
 */
<<\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/type/TypeUri'))>>
class apache_thrift_type_standard_TypeUri implements \IThriftSyncStruct, \IThriftStructMetadata, \IThriftUnion<apache_thrift_type_standard_TypeUriEnum>, \IThriftShapishSyncStruct {
  use \ThriftUnionSerializationTrait;

  const \ThriftStructTypes::TSpec SPEC = dict[
    1 => shape(
      'var' => 'uri',
      'union' => true,
      'type' => \TType::STRING,
    ),
    2 => shape(
      'var' => 'typeHashPrefixSha2_256',
      'union' => true,
      'type' => \TType::STRING,
      'is_binary' => true,
    ),
    3 => shape(
      'var' => 'scopedName',
      'union' => true,
      'type' => \TType::STRING,
    ),
  ];
  const dict<string, int> FIELDMAP = dict[
    'uri' => 1,
    'typeHashPrefixSha2_256' => 2,
    'scopedName' => 3,
  ];

  const type TConstructorShape = shape(
    ?'uri' => ?string,
    ?'typeHashPrefixSha2_256' => ?string,
    ?'scopedName' => ?string,
  );

  const type TShape = shape(
    ?'uri' => ?string,
    ?'typeHashPrefixSha2_256' => ?string,
    ?'scopedName' => ?string,
    ...
  );
  const int STRUCTURAL_ID = 2998943141803441214;
  /**
   * The unique Thrift URI for this type.
   *
   * Original thrift field:-
   * 1: standard.Uri uri
   */
  public ?string $uri;
  /**
   * A prefix of the SHA2-256 hash of the URI.
   *
   * Original thrift field:-
   * 2: standard.ByteString typeHashPrefixSha2_256
   */
  public ?string $typeHashPrefixSha2_256;
  /**
   * The (potentially not unique) scoped name of this type.
   * Format is `filename.typename`, e.g. `standard.TypeUri`.
   * This is a fallback for types that do not have URIs yet.
   * Must be prepared for the active field to switch to `uri` as package statements are rolled out!
   *
   * Original thrift field:-
   * 3: string scopedName
   */
  public ?string $scopedName;
  protected apache_thrift_type_standard_TypeUriEnum $_type = apache_thrift_type_standard_TypeUriEnum::_EMPTY_;

  public function __construct(?string $uri = null, ?string $typeHashPrefixSha2_256 = null, ?string $scopedName = null)[] {
    $this->_type = apache_thrift_type_standard_TypeUriEnum::_EMPTY_;
    if ($uri !== null) {
      $this->uri = $uri;
      $this->_type = apache_thrift_type_standard_TypeUriEnum::uri;
    }
    if ($typeHashPrefixSha2_256 !== null) {
      $this->typeHashPrefixSha2_256 = $typeHashPrefixSha2_256;
      $this->_type = apache_thrift_type_standard_TypeUriEnum::typeHashPrefixSha2_256;
    }
    if ($scopedName !== null) {
      $this->scopedName = $scopedName;
      $this->_type = apache_thrift_type_standard_TypeUriEnum::scopedName;
    }
  }

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

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

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

  public function getType()[]: apache_thrift_type_standard_TypeUriEnum {
    return $this->_type;
  }

  public function reset()[write_props]: void {
    switch ($this->_type) {
      case apache_thrift_type_standard_TypeUriEnum::uri:
        $this->uri = null;
        break;
      case apache_thrift_type_standard_TypeUriEnum::typeHashPrefixSha2_256:
        $this->typeHashPrefixSha2_256 = null;
        break;
      case apache_thrift_type_standard_TypeUriEnum::scopedName:
        $this->scopedName = null;
        break;
      case apache_thrift_type_standard_TypeUriEnum::_EMPTY_:
        break;
    }
    $this->_type = apache_thrift_type_standard_TypeUriEnum::_EMPTY_;
  }

  public function set_uri(string $uri)[write_props]: this {
    $this->reset();
    $this->_type = apache_thrift_type_standard_TypeUriEnum::uri;
    $this->uri = $uri;
    return $this;
  }

  public function get_uri()[]: ?string {
    return $this->uri;
  }

  public function getx_uri()[]: string {
    invariant(
      $this->_type === apache_thrift_type_standard_TypeUriEnum::uri,
      'get_uri called on an instance of TypeUri whose current type is %s',
      (string)$this->_type,
    );
    return $this->uri as nonnull;
  }

  public function set_typeHashPrefixSha2_256(string $typeHashPrefixSha2_256)[write_props]: this {
    $this->reset();
    $this->_type = apache_thrift_type_standard_TypeUriEnum::typeHashPrefixSha2_256;
    $this->typeHashPrefixSha2_256 = $typeHashPrefixSha2_256;
    return $this;
  }

  public function get_typeHashPrefixSha2_256()[]: ?string {
    return $this->typeHashPrefixSha2_256;
  }

  public function getx_typeHashPrefixSha2_256()[]: string {
    invariant(
      $this->_type === apache_thrift_type_standard_TypeUriEnum::typeHashPrefixSha2_256,
      'get_typeHashPrefixSha2_256 called on an instance of TypeUri whose current type is %s',
      (string)$this->_type,
    );
    return $this->typeHashPrefixSha2_256 as nonnull;
  }

  public function set_scopedName(string $scopedName)[write_props]: this {
    $this->reset();
    $this->_type = apache_thrift_type_standard_TypeUriEnum::scopedName;
    $this->scopedName = $scopedName;
    return $this;
  }

  public function get_scopedName()[]: ?string {
    return $this->scopedName;
  }

  public function getx_scopedName()[]: string {
    invariant(
      $this->_type === apache_thrift_type_standard_TypeUriEnum::scopedName,
      'get_scopedName called on an instance of TypeUri whose current type is %s',
      (string)$this->_type,
    );
    return $this->scopedName as nonnull;
  }

  public function clearTerseFields()[write_props]: void {
  }

  public static function getStructMetadata()[]: \tmeta_ThriftStruct {
    return tmeta_ThriftStruct::fromShape(
      shape(
        "name" => "standard.TypeUri",
        "fields" => vec[
          tmeta_ThriftField::fromShape(
            shape(
              "id" => 1,
              "type" => tmeta_ThriftType::fromShape(
                shape(
                  "t_typedef" => tmeta_ThriftTypedefType::fromShape(
                    shape(
                      "name" => "standard.Uri",
                      "underlyingType" => tmeta_ThriftType::fromShape(
                        shape(
                          "t_primitive" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,
                        )
                      ),
                    )
                  ),
                )
              ),
              "name" => "uri",
            )
          ),
          tmeta_ThriftField::fromShape(
            shape(
              "id" => 2,
              "type" => tmeta_ThriftType::fromShape(
                shape(
                  "t_typedef" => tmeta_ThriftTypedefType::fromShape(
                    shape(
                      "name" => "standard.ByteString",
                      "underlyingType" => tmeta_ThriftType::fromShape(
                        shape(
                          "t_primitive" => tmeta_ThriftPrimitiveType::THRIFT_BINARY_TYPE,
                        )
                      ),
                    )
                  ),
                )
              ),
              "name" => "typeHashPrefixSha2_256",
            )
          ),
          tmeta_ThriftField::fromShape(
            shape(
              "id" => 3,
              "type" => tmeta_ThriftType::fromShape(
                shape(
                  "t_primitive" => tmeta_ThriftPrimitiveType::THRIFT_STRING_TYPE,
                )
              ),
              "name" => "scopedName",
            )
          ),
        ],
        "is_union" => true,
      )
    );
  }

  public static function getAllStructuredAnnotations()[write_props]: \TStructAnnotations {
    return shape(
      'struct' => dict[],
      'fields' => dict[
        'uri' => shape(
          'field' => dict[],
          'type' => dict[
            '\facebook\thrift\annotation\Experimental' => \facebook\thrift\annotation\Experimental::fromShape(
              shape(
              )
            ),
          ],
        ),
        'typeHashPrefixSha2_256' => shape(
          'field' => dict[],
          'type' => dict[
            '\facebook\thrift\annotation\java\Adapter' => \facebook\thrift\annotation\java\Adapter::fromShape(
              shape(
                "adapterClassName" => "com.facebook.thrift.adapter.common.UnpooledByteBufTypeAdapter",
                "typeClassName" => "io.netty.buffer.ByteBuf",
              )
            ),
          ],
        ),
      ],
    );
  }

  public static function __fromShape(self::TShape $shape)[]: this {
    return new static(
      Shapes::idx($shape, 'uri'),
      Shapes::idx($shape, 'typeHashPrefixSha2_256'),
      Shapes::idx($shape, 'scopedName'),
    );
  }

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

  public function readFromJson(string $jsonText): void {
    $this->_type = apache_thrift_type_standard_TypeUriEnum::_EMPTY_;
    $parsed = json_decode($jsonText, true);

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

    if (idx($parsed, 'uri') !== null) {
      $this->uri = HH\FIXME\UNSAFE_CAST<mixed, string>($parsed['uri']);
      $this->_type = apache_thrift_type_standard_TypeUriEnum::uri;
    }
    if (idx($parsed, 'typeHashPrefixSha2_256') !== null) {
      $this->typeHashPrefixSha2_256 = HH\FIXME\UNSAFE_CAST<mixed, string>($parsed['typeHashPrefixSha2_256']);
      $this->_type = apache_thrift_type_standard_TypeUriEnum::typeHashPrefixSha2_256;
    }
    if (idx($parsed, 'scopedName') !== null) {
      $this->scopedName = HH\FIXME\UNSAFE_CAST<mixed, string>($parsed['scopedName']);
      $this->_type = apache_thrift_type_standard_TypeUriEnum::scopedName;
    }
  }

}

enum apache_thrift_type_standard_TypeNameEnum: int {
  _EMPTY_ = 0;
  boolType = 1;
  byteType = 2;
  i16Type = 3;
  i32Type = 4;
  i64Type = 5;
  floatType = 6;
  doubleType = 7;
  stringType = 8;
  binaryType = 9;
  enumType = 10;
  typedefType = 17;
  structType = 11;
  unionType = 12;
  exceptionType = 13;
  listType = 14;
  setType = 15;
  mapType = 16;
}

/**
 * Uniquely identifies a Thrift type.
 *
 * Original thrift struct:-
 * TypeName
 */
<<\ThriftTypeInfo(shape('uri' => 'facebook.com/thrift/type/TypeName'))>>
class apache_thrift_type_standard_TypeName implements \IThriftSyncStruct, \IThriftStructMetadata, \IThriftUnion<apache_thrift_type_standard_TypeNameEnum>, \IThriftShapishSyncStruct {
  use \ThriftUnionSerializationTrait;

  const \ThriftStructTypes::TSpec SPEC = dict[
    1 => shape(
      'var' => 'boolType',
      'union' => true,
      'type' => \TType::I32,
      'enum' => apache_thrift_type_standard_Void::class,
    ),
    2 => shape(
      'var' => 'byteType',
      'union' => true,
      'type' => \TType::I32,
      'enum' => apache_thrift_type_standard_Void::class,
    ),
    3 => shape(
      'var' => 'i16Type',
      'union' => true,
      'type' => \TType::I32,
      'enum' => apache_thrift_type_standard_Void::class,
    ),
    4 => shape(
      'var' => 'i32Type',
      'union' => true,
      'type' => \TType::I32,
      'enum' => apache_thrift_type_standard_Void::class,
    ),
    5 => shape(
      'var' => 'i64Type',
      'union' => true,
      'type' => \TType::I32,
      'enum' => apache_thrift_type_standard_Void::class,
    ),
    6 => shape(
      'var' => 'floatType',
      'union' => true,
      'type' => \TType::I32,
      'enum' => apache_thrift_type_standard_Void::class,
    ),
    7 => shape(
      'var' => 'doubleType',
      'union' => true,
      'type' => \TType::I32,
      'enum' => apache_thrift_type_standard_Void::class,
    ),
    8 => shape(
      'var' => 'stringType',
      'union' => true,
      'type' => \TType::I32,
      'enum' => apache_thrift_type_standard_Void::class,
    ),
    9 => shape(
      'var' => 'binaryType',
      'union' => true,
      'type' => \TType::I32,
      'enum' => apache_thrift_type_standard_Void::class,
    ),
    10 => shape(
      'var' => 'enumType',
      'union' => true,
      'type' => \TType::STRUCT,
      'class' => apache_thrift_type_standard_TypeUri::class,
    ),
    17 => shape(
      'var' => 'typedefType',
      'union' => true,
      'type' => \TType::STRUCT,
      'class' => apache_thrift_type_standard_TypeUri::class,
    ),
    11 => shape(
      'var' => 'structType',
      'union' => true,
      'type' => \TType::STRUCT,
      'class' => apache_thrift_type_standard_TypeUri::class,
    ),
    12 => shape(
      'var' => 'unionType',
      'union' => true,
      'type' => \TType::STRUCT,
      'class' => apache_thrift_type_standard_TypeUri::class,
    ),
    13 => shape(
      'var' => 'exceptionType',
      'union' => true,
      'type' => \TType::STRUCT,
      'class' => apache_thrift_type_standard_TypeUri::class,
    ),
    14 => shape(
      'var' => 'listType',
      'union' => true,
      'type' => \TType::I32,
      'enum' => apache_thrift_type_standard_Void::class,
    ),
    15 => shape(
      'var' => 'setType',
      'union' => true,
      'type' => \TType::I32,
      'enum' => apache_thrift_type_standard_Void::class,
    ),
    16 => shape(
      'var' => 'mapType',
      'union' => true,
      'type' => \TType::I32,
      'enum' => apache_thrift_type_standard_Void::class,
    ),
  ];
  const dict<string, int> FIELDMAP = dict[
    'boolType' => 1,
    'byteType' => 2,
    'i16Type' => 3,
    'i32Type' => 4,
    'i64Type' => 5,
    'floatType' => 6,
    'doubleType' => 7,
    'stringType' => 8,
    'binaryType' => 9,
    'enumType' => 10,
    'typedefType' => 17,
    'structType' => 11,
    'unionType' => 12,
    'exceptionType' => 13,
    'listType' => 14,
    'setType' => 15,
    'mapType' => 16,
  ];

  const type TConstructorShape = shape(
    ?'boolType' => ?apache_thrift_type_standard_Void,
    ?'byteType' => ?apache_thrift_type_standard_Void,
    ?'i16Type' => ?apache_thrift_type_standard_Void,
    ?'i32Type' => ?apache_thrift_type_standard_Void,
    ?'i64Type' => ?apache_thrift_type_standard_Void,
    ?'floatType' => ?apache_thrift_type_standard_Void,
    ?'doubleType' => ?apache_thrift_type_standard_Void,
    ?'stringType' => ?apache_thrift_type_standard_Void,
    ?'binaryType' => ?apache_thrift_type_standard_Void,
    ?'enumType' => ?apache_thrift_type_standard_TypeUri,
    ?'typedefType' => ?apache_thrift_type_standard_TypeUri,
    ?'structType' => ?apache_thrift_type_standard_TypeUri,
    ?'unionType' => ?apache_thrift_type_standard_TypeUri,
    ?'exceptionType' => ?apache_thrift_type_standard_TypeUri,
    ?'listType' => ?apache_thrift_type_standard_Void,
    ?'setType' => ?apache_thrift_type_standard_Void,
    ?'mapType' => ?apache_thrift_type_standard_Void,
  );

  const type TShape = shape(
    ?'boolType' => ?apache_thrift_type_standard_Void,
    ?'byteType' => ?apache_thrift_type_standard_Void,
    ?'i16Type' => ?apache_thrift_type_standard_Void,
    ?'i32Type' => ?apache_thrift_type_standard_Void,
    ?'i64Type' => ?apache_thrift_type_standard_Void,
    ?'floatType' => ?apache_thrift_type_standard_Void,
    ?'doubleType' => ?apache_thrift_type_standard_Void,
    ?'stringType' => ?apache_thrift_type_standard_Void,
    ?'binaryType' => ?apache_thrift_type_standard_Void,
    ?'enumType' => ?apache_thrift_type_standard_TypeUri::TShape,
    ?'typedefType' => ?apache_thrift_type_standard_TypeUri::TShape,
    ?'structType' => ?apache_thrift_type_standard_TypeUri::TShape,
    ?'unionType' => ?apache_thrift_type_standard_TypeUri::TShape,
    ?'exceptionType' => ?apache_thrift_type_standard_TypeUri::TShape,
    ?'listType' => ?apache_thrift_type_standard_Void,
    ?'setType' => ?apache_thrift_type_standard_Void,
    ?'mapType' => ?apache_thrift_type_standard_Void,
    ...
  );
  const int STRUCTURAL_ID = 2966511906547332991;
  /**
   * True(1) or False(0)
   *
   * Original thrift field:-
   * 1: standard.Void boolType
   */
  public ?apache_thrift_type_standard_Void $boolType;
  /**
   * 8-bit signed integer
   *
   * Original thrift field:-
   * 2: standard.Void byteType
   */
  public ?apache_thrift_type_standard_Void $byteType;
  /**
   * 16-bit signed integer
   *
   * Original thrift field:-
   * 3: standard.Void i16Type
   */
  public ?apache_thrift_type_standard_Void $i16Type;
  /**
   * 32-bit signed integer
   *
   * Original thrift field:-
   * 4: standard.Void i32Type
   */
  public ?apache_thrift_type_standard_Void $i32Type;
  /**
   * 64-bit signed integer
   *
   * Original thrift field:-
   * 5: standard.Void i64Type
   */
  public ?apache_thrift_type_standard_Void $i64Type;
  /**
   * 32-bit floating point
   *
   * Original thrift field:-
   * 6: standard.Void floatType
   */
  public ?apache_thrift_type_standard_Void $floatType;
  /**
   * 64-bit floating point
   *
   * Original thrift field:-
   * 7: standard.Void doubleType
   */
  public ?apache_thrift_type_standard_Void $doubleType;
  /**
   * UTF-8 encoded string
   *
   * Original thrift field:-
   * 8: standard.Void stringType
   */
  public ?apache_thrift_type_standard_Void $stringType;
  /**
   * Arbitrary byte string
   *
   * Original thrift field:-
   * 9: standard.Void binaryType
   */
  public ?apache_thrift_type_standard_Void $binaryType;
  /**
   * 32-bit signed integer, with named values.
   *
   * Original thrift field:-
   * 10: standard.TypeUri enumType
   */
  public ?apache_thrift_type_standard_TypeUri $enumType;
  /**
   * `typedef` definition
   *
   * Original thrift field:-
   * 17: standard.TypeUri typedefType
   */
  public ?apache_thrift_type_standard_TypeUri $typedefType;
  /**
   * `struct` definition
   *
   * Original thrift field:-
   * 11: standard.TypeUri structType
   */
  public ?apache_thrift_type_standard_TypeUri $structType;
  /**
   * `union` definition
   *
   * Original thrift field:-
   * 12: standard.TypeUri unionType
   */
  public ?apache_thrift_type_standard_TypeUri $unionType;
  /**
   * `exception` definition
   *
   * Original thrift field:-
   * 13: standard.TypeUri exceptionType
   */
  public ?apache_thrift_type_standard_TypeUri $exceptionType;
  /**
   * `list<V>` definition
   *
   * Original thrift field:-
   * 14: standard.Void listType
   */
  public ?apache_thrift_type_standard_Void $listType;
  /**
   * `set<K>` definition
   *
   * Original thrift field:-
   * 15: standard.Void setType
   */
  public ?apache_thrift_type_standard_Void $setType;
  /**
   * `map<K, V>` definition
   *
   * Original thrift field:-
   * 16: standard.Void mapType
   */
  public ?apache_thrift_type_standard_Void $mapType;
  protected apache_thrift_type_standard_TypeNameEnum $_type = apache_thrift_type_standard_TypeNameEnum::_EMPTY_;

  public function __construct(?apache_thrift_type_standard_Void $boolType = null, ?apache_thrift_type_standard_Void $byteType = null, ?apache_thrift_type_standard_Void $i16Type = null, ?apache_thrift_type_standard_Void $i32Type = null, ?apache_thrift_type_standard_Void $i64Type = null, ?apache_thrift_type_standard_Void $floatType = null, ?apache_thrift_type_standard_Void $doubleType = null, ?apache_thrift_type_standard_Void $stringType = null, ?apache_thrift_type_standard_Void $binaryType = null, ?apache_thrift_type_standard_TypeUri $enumType = null, ?apache_thrift_type_standard_TypeUri $typedefType = null, ?apache_thrift_type_standard_TypeUri $structType = null, ?apache_thrift_type_standard_TypeUri $unionType = null, ?apache_thrift_type_standard_TypeUri $exceptionType = null, ?apache_thrift_type_standard_Void $listType = null, ?apache_thrift_type_standard_Void $setType = null, ?apache_thrift_type_standard_Void $mapType = null)[] {
    $this->_type = apache_thrift_type_standard_TypeNameEnum::_EMPTY_;
    if ($boolType !== null) {
      $this->boolType = $boolType;
      $this->_type = apache_thrift_type_standard_TypeNameEnum::boolType;
    }
    if ($byteType !== null) {
      $this->byteType = $byteType;
      $this->_type = apache_thrift_type_standard_TypeNameEnum::byteType;
    }
    if ($i16Type !== null) {
      $this->i16Type = $i16Type;
      $this->_type = apache_thrift_type_standard_TypeNameEnum::i16Type;
    }
    if ($i32Type !== null) {
      $this->i32Type = $i32Type;
      $this->_type = apache_thrift_type_standard_TypeNameEnum::i32Type;
    }
    if ($i64Type !== null) {
      $this->i64Type = $i64Type;
      $this->_type = apache_thrift_type_standard_TypeNameEnum::i64Type;
    }
    if ($floatType !== null) {
      $this->floatType = $floatType;
      $this->_type = apache_thrift_type_standard_TypeNameEnum::floatType;
    }
    if ($doubleType !== null) {
      $this->doubleType = $doubleType;
      $this->_type = apache_thrift_type_standard_TypeNameEnum::doubleType;
    }
    if ($stringType !== null) {
      $this->stringType = $stringType;
      $this->_type = apache_thrift_type_standard_TypeNameEnum::stringType;
    }
    if ($binaryType !== null) {
      $this->binaryType = $binaryType;
      $this->_type = apache_thrift_type_standard_TypeNameEnum::binaryType;
    }
    if ($enumType !== null) {
      $this->enumType = $enumType;
      $this->_type = apache_thrift_type_standard_TypeNameEnum::enumType;
    }
    if ($typedefType !== null) {
      $this->typedefType = $typedefType;
      $this->_type = apache_thrift_type_standard_TypeNameEnum::typedefType;
    }
    if ($structType !== null) {
      $this->structType = $structType;
      $this->_type = apache_thrift_type_standard_TypeNameEnum::structType;
    }
    if ($unionType !== null) {
      $this->unionType = $unionType;
      $this->_type = apache_thrift_type_standard_TypeNameEnum::unionType;
    }
    if ($exceptionType !== null) {
      $this->exceptionType = $exceptionType;
      $this->_type = apache_thrift_type_standard_TypeNameEnum::exceptionType;
    }
    if ($listType !== null) {
      $this->listType = $listType;
      $this->_type = apache_thrift_type_standard_TypeNameEnum::listType;
    }
    if ($setType !== null) {
      $this->setType = $setType;
      $this->_type = apache_thrift_type_standard_TypeNameEnum::setType;
    }
    if ($mapType !== null) {
      $this->mapType = $mapType;
      $this->_type = apache_thrift_type_standard_TypeNameEnum::mapType;
    }
  }

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

  public static function fromShape(self::TConstructorShape $shape)[]: this {
    return new static(
      Shapes::idx($shape, 'boolType'),
      Shapes::idx($shape, 'byteType'),
      Shapes::idx($shape, 'i16Type'),
      Shapes::idx($shape, 'i32Type'),
      Shapes::idx($shape, 'i64Type'),
      Shapes::idx($shape, 'floatType'),
      Shapes::idx($shape, 'doubleType'),
      Shapes::idx($shape, 'stringType'),
      Shapes::idx($shape, 'binaryType'),
      Shapes::idx($shape, 'enumType'),
      Shapes::idx($shape, 'typedefType'),
      Shapes::idx($shape, 'structType'),
      Shapes::idx($shape, 'unionType'),
      Shapes::idx($shape, 'exceptionType'),
      Shapes::idx($shape, 'listType'),
      Shapes::idx($shape, 'setType'),
      Shapes::idx($shape, 'mapType'),
    );
  }

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

  public function getType()[]: apache_thrift_type_standard_TypeNameEnum {
    return $this->_type;
  }

  public function reset()[write_props]: void {
    switch ($this->_type) {
      case apache_thrift_type_standard_TypeNameEnum::boolType:
        $this->boolType = null;
        break;
      case apache_thrift_type_standard_TypeNameEnum::byteType:
        $this->byteType = null;
        break;
      case apache_thrift_type_standard_TypeNameEnum::i16Type:
        $this->i16Type = null;
        break;
      case apache_thrift_type_standard_TypeNameEnum::i32Type:
        $this->i32Type = null;
        break;
      case apache_thrift_type_standard_TypeNameEnum::i64Type:
        $this->i64Type = null;
        break;
      case apache_thrift_type_standard_TypeNameEnum::floatType:
        $this->floatType = null;
        break;
      case apache_thrift_type_standard_TypeNameEnum::doubleType:
        $this->doubleType = null;
        break;
      case apache_thrift_type_standard_TypeNameEnum::stringType:
        $this->stringType = null;
        break;
      case apache_thrift_type_standard_TypeNameEnum::binaryType:
        $this->binaryType = null;
        break;
      case apache_thrift_type_standard_TypeNameEnum::enumType:
        $this->enumType = null;
        break;
      case apache_thrift_type_standard_TypeNameEnum::typedefType:
        $this->typedefType = null;
        break;
      case apache_thrift_type_standard_TypeNameEnum::structType:
        $this->structType = null;
        break;
      case apache_thrift_type_standard_TypeNameEnum::unionType:
        $this->unionType = null;
        break;
      case apache_thrift_type_standard_TypeNameEnum::exceptionType:
        $this->exceptionType = null;
        break;
      case apache_thrift_type_standard_TypeNameEnum::listType:
        $this->listType = null;
        break;
      case apache_thrift_type_standard_TypeNameEnum::setType:
        $this->setType = null;
        break;
      case apache_thrift_type_standard_TypeNameEnum::mapType:
        $this->mapType = null;
        break;
      case apache_thrift_type_standard_TypeNameEnum::_EMPTY_:
        break;
    }
    $this->_type = apache_thrift_type_standard_TypeNameEnum::_EMPTY_;
  }

  public function set_boolType(apache_thrift_type_standard_Void $boolType)[write_props]: this {
    $this->reset();
    $this->_type = apache_thrift_type_standard_TypeNameEnum::boolType;
    $this->boolType = $boolType;
    return $this;
  }

  public function get_boolType()[]: ?apache_thrift_type_standard_Void {
    return $this->boolType;
  }

  public function getx_boolType()[]: apache_thrift_type_standard_Void {
    invariant(
      $this->_type === apache_thrift_type_standard_TypeNameEnum::boolType,
      'get_boolType called on an instance of TypeName whose current type is %s',
      (string)$this->_type,
    );
    return $this->boolType as nonnull;
  }

  public function set_byteType(apache_thrift_type_standard_Void $byteType)[write_props]: this {
    $this->reset();
    $this->_type = apache_thrift_type_standard_TypeNameEnum::byteType;
    $this->byteType = $byteType;
    return $this;
  }

  public function get_byteType()[]: ?apache_thrift_type_standard_Void {
    return $this->byteType;
  }

  public function getx_byteType()[]: apache_thrift_type_standard_Void {
    invariant(
      $this->_type === apache_thrift_type_standard_TypeNameEnum::byteType,
      'get_byteType called on an instance of TypeName whose current type is %s',
      (string)$this->_type,
    );
    return $this->byteType as nonnull;
  }

  public function set_i16Type(apache_thrift_type_standard_Void $i16Type)[write_props]: this {
    $this->reset();
    $this->_type = apache_thrift_type_standard_TypeNameEnum::i16Type;
    $this->i16Type = $i16Type;
    return $this;
  }

  public function get_i16Type()[]: ?apache_thrift_type_standard_Void {
    return $this->i16Type;
  }

  public function getx_i16Type()[]: apache_thrift_type_standard_Void {
    invariant(
      $this->_type === apache_thrift_type_standard_TypeNameEnum::i16Type,
      'get_i16Type called on an instance of TypeName whose current type is %s',
      (string)$this->_type,
    );
    return $this->i16Type as nonnull;
  }

  public function set_i32Type(apache_thrift_type_standard_Void $i32Type)[write_props]: this {
    $this->reset();
    $this->_type = apache_thrift_type_standard_TypeNameEnum::i32Type;
    $this->i32Type = $i32Type;
    return $this;
  }

  public function get_i32Type()[]: ?apache_thrift_type_standard_Void {
    return $this->i32Type;
  }

  public function getx_i32Type()[]: apache_thrift_type_standard_Void {
    invariant(
      $this->_type === apache_thrift_type_standard_TypeNameEnum::i32Type,
      'get_i32Type called on an instance of TypeName whose current type is %s',
      (string)$this->_type,
    );
    return $this->i32Type as nonnull;
  }

  public function set_i64Type(apache_thrift_type_standard_Void $i64Type)[write_props]: this {
    $this->reset();
    $this->_type = apache_thrift_type_standard_TypeNameEnum::i64Type;
    $this->i64Type = $i64Type;
    return $this;
  }

  public function get_i64Type()[]: ?apache_thrift_type_standard_Void {
    return $this->i64Type;
  }

  public function getx_i64Type()[]: apache_thrift_type_standard_Void {
    invariant(
      $this->_type === apache_thrift_type_standard_TypeNameEnum::i64Type,
      'get_i64Type called on an instance of TypeName whose current type is %s',
      (string)$this->_type,
    );
    return $this->i64Type as nonnull;
  }

  public function set_floatType(apache_thrift_type_standard_Void $floatType)[write_props]: this {
    $this->reset();
    $this->_type = apache_thrift_type_standard_TypeNameEnum::floatType;
    $this->floatType = $floatType;
    return $this;
  }

  public function get_floatType()[]: ?apache_thrift_type_standard_Void {
    return $this->floatType;
  }

  public function getx_floatType()[]: apache_thrift_type_standard_Void {
    invariant(
      $this->_type === apache_thrift_type_standard_TypeNameEnum::floatType,
      'get_floatType called on an instance of TypeName whose current type is %s',
      (string)$this->_type,
    );
    return $this->floatType as nonnull;
  }

  public function set_doubleType(apache_thrift_type_standard_Void $doubleType)[write_props]: this {
    $this->reset();
    $this->_type = apache_thrift_type_standard_TypeNameEnum::doubleType;
    $this->doubleType = $doubleType;
    return $this;
  }

  public function get_doubleType()[]: ?apache_thrift_type_standard_Void {
    return $this->doubleType;
  }

  public function getx_doubleType()[]: apache_thrift_type_standard_Void {
    invariant(
      $this->_type === apache_thrift_type_standard_TypeNameEnum::doubleType,
      'get_doubleType called on an instance of TypeName whose current type is %s',
      (string)$this->_type,
    );
    return $this->doubleType as nonnull;
  }

  public function set_stringType(apache_thrift_type_standard_Void $stringType)[write_props]: this {
    $this->reset();
    $this->_type = apache_thrift_type_standard_TypeNameEnum::stringType;
    $this->stringType = $stringType;
    return $this;
  }

  public function get_stringType()[]: ?apache_thrift_type_standard_Void {
    return $this->stringType;
  }

  public function getx_stringType()[]: apache_thrift_type_standard_Void {
    invariant(
      $this->_type === apache_thrift_type_standard_TypeNameEnum::stringType,
      'get_stringType called on an instance of TypeName whose current type is %s',
      (string)$this->_type,
    );
    return $this->stringType as nonnull;
  }

  public function set_binaryType(apache_thrift_type_standard_Void $binaryType)[write_props]: this {
    $this->reset();
    $this->_type = apache_thrift_type_standard_TypeNameEnum::binaryType;
    $this->binaryType = $binaryType;
    return $this;
  }

  public function get_binaryType()[]: ?apache_thrift_type_standard_Void {
    return $this->binaryType;
  }

  public function getx_binaryType()[]: apache_thrift_type_standard_Void {
    invariant(
      $this->_type === apache_thrift_type_standard_TypeNameEnum::binaryType,
      'get_binaryType called on an instance of TypeName whose current type is %s',
      (string)$this->_type,
    );
    return $this->binaryType as nonnull;
  }

  public function set_enumType(apache_thrift_type_standard_TypeUri $enumType)[write_props]: this {
    $this->reset();
    $this->_type = apache_thrift_type_standard_TypeNameEnum::enumType;
    $this->enumType = $enumType;
    return $this;
  }

  public function get_enumType()[]: ?apache_thrift_type_standard_TypeUri {
    return $this->enumType;
  }

  public function getx_enumType()[]: apache_thrift_type_standard_TypeUri {
    invariant(
      $this->_type === apache_thrift_type_standard_TypeNameEnum::enumType,
      'get_enumType called on an instance of TypeName whose current type is %s',
      (string)$this->_type,
    );
    return $this->enumType as nonnull;
  }

  public function set_typedefType(apache_thrift_type_standard_TypeUri $typedefType)[write_props]: this {
    $this->reset();
    $this->_type = apache_thrift_type_standard_TypeNameEnum::typedefType;
    $this->typedefType = $typedefType;
    return $this;
  }

  public function get_typedefType()[]: ?apache_thrift_type_standard_TypeUri {
    return $this->typedefType;
  }

  public function getx_typedefType()[]: apache_thrift_type_standard_TypeUri {
    invariant(
      $this->_type === apache_thrift_type_standard_TypeNameEnum::typedefType,
      'get_typedefType called on an instance of TypeName whose current type is %s',
      (string)$this->_type,
    );
    return $this->typedefType as nonnull;
  }

  public function set_structType(apache_thrift_type_standard_TypeUri $structType)[write_props]: this {
    $this->reset();
    $this->_type = apache_thrift_type_standard_TypeNameEnum::structType;
    $this->structType = $structType;
    return $this;
  }

  public function get_structType()[]: ?apache_thrift_type_standard_TypeUri {
    return $this->structType;
  }

  public function getx_structType()[]: apache_thrift_type_standard_TypeUri {
    invariant(
      $this->_type === apache_thrift_type_standard_TypeNameEnum::structType,
      'get_structType called on an instance of TypeName whose current type is %s',
      (string)$this->_type,
    );
    return $this->structType as nonnull;
  }

  public function set_unionType(apache_thrift_type_standard_TypeUri $unionType)[write_props]: this {
    $this->reset();
    $this->_type = apache_thrift_type_standard_TypeNameEnum::unionType;
    $this->unionType = $unionType;
    return $this;
  }

  public function get_unionType()[]: ?apache_thrift_type_standard_TypeUri {
    return $this->unionType;
  }

  public function getx_unionType()[]: apache_thrift_type_standard_TypeUri {
    invariant(
      $this->_type === apache_thrift_type_standard_TypeNameEnum::unionType,
      'get_unionType called on an instance of TypeName whose current type is %s',
      (string)$this->_type,
    );
    return $this->unionType as nonnull;
  }

  public function set_exceptionType(apache_thrift_type_standard_TypeUri $exceptionType)[write_props]: this {
    $this->reset();
    $this->_type = apache_thrift_type_standard_TypeNameEnum::exceptionType;
    $this->exceptionType = $exceptionType;
    return $this;
  }

  public function get_exceptionType()[]: ?apache_thrift_type_standard_TypeUri {
    return $this->exceptionType;
  }

  public function getx_exceptionType()[]: apache_thrift_type_standard_TypeUri {
    invariant(
      $this->_type === apache_thrift_type_standard_TypeNameEnum::exceptionType,
      'get_exceptionType called on an instance of TypeName whose current type is %s',
      (string)$this->_type,
    );
    return $this->exceptionType as nonnull;
  }

  public function set_listType(apache_thrift_type_standard_Void $listType)[write_props]: this {
    $this->reset();
    $this->_type = apache_thrift_type_standard_TypeNameEnum::listType;
    $this->listType = $listType;
    return $this;
  }

  public function get_listType()[]: ?apache_thrift_type_standard_Void {
    return $this->listType;
  }

  public function getx_listType()[]: apache_thrift_type_standard_Void {
    invariant(
      $this->_type === apache_thrift_type_standard_TypeNameEnum::listType,
      'get_listType called on an instance of TypeName whose current type is %s',
      (string)$this->_type,
    );
    return $this->listType as nonnull;
  }

  public function set_setType(apache_thrift_type_standard_Void $setType)[write_props]: this {
    $this->reset();
    $this->_type = apache_thrift_type_standard_TypeNameEnum::setType;
    $this->setType = $setType;
    return $this;
  }

  public function get_setType()[]: ?apache_thrift_type_standard_Void {
    return $this->setType;
  }

  public function getx_setType()[]: apache_thrift_type_standard_Void {
    invariant(
      $this->_type === apache_thrift_type_standard_TypeNameEnum::setType,
      'get_setType called on an instance of TypeName whose current type is %s',
      (string)$this->_type,
    );
    return $this->setType as nonnull;
  }

  public function set_mapType(apache_thrift_type_standard_Void $mapType)[write_props]: this {
    $this->reset();
    $this->_type = apache_thrift_type_standard_TypeNameEnum::mapType;
    $this->mapType = $mapType;
    return $this;
  }

  public function get_mapType()[]: ?apache_thrift_type_standard_Void {
    return $this->mapType;
  }

  public function getx_mapType()[]: apache_thrift_type_standard_Void {
    invariant(
      $this->_type === apache_thrift_type_standard_TypeNameEnum::mapType,
      'get_mapType called on an instance of TypeName whose current type is %s',
      (string)$this->_type,
    );
    return $this->mapType as nonnull;
  }

  public function clearTerseFields()[write_props]: void {
  }

  public static function getStructMetadata()[]: \tmeta_ThriftStruct {
    return tmeta_ThriftStruct::fromShape(
      shape(
        "name" => "standard.TypeName",
        "fields" => vec[
          tmeta_ThriftField::fromShape(
            shape(
              "id" => 1,
              "type" => tmeta_ThriftType::fromShape(
                shape(
                  "t_enum" => tmeta_ThriftEnumType::fromShape(
                    shape(
                      "name" => "standard.Void",
                    )
                  ),
                )
              ),
              "name" => "boolType",
            )
          ),
          tmeta_ThriftField::fromShape(
            shape(
              "id" => 2,
              "type" => tmeta_ThriftType::fromShape(
                shape(
                  "t_enum" => tmeta_ThriftEnumType::fromShape(
                    shape(
                      "name" => "standard.Void",
                    )
                  ),
                )
              ),
              "name" => "byteType",
            )
          ),
          tmeta_ThriftField::fromShape(
            shape(
              "id" => 3,
              "type" => tmeta_ThriftType::fromShape(
                shape(
                  "t_enum" => tmeta_ThriftEnumType::fromShape(
                    shape(
                      "name" => "standard.Void",
                    )
                  ),
                )
              ),
              "name" => "i16Type",
            )
          ),
          tmeta_ThriftField::fromShape(
            shape(
              "id" => 4,
              "type" => tmeta_ThriftType::fromShape(
                shape(
                  "t_enum" => tmeta_ThriftEnumType::fromShape(
                    shape(
                      "name" => "standard.Void",
                    )
                  ),
                )
              ),
              "name" => "i32Type",
            )
          ),
          tmeta_ThriftField::fromShape(
            shape(
              "id" => 5,
              "type" => tmeta_ThriftType::fromShape(
                shape(
                  "t_enum" => tmeta_ThriftEnumType::fromShape(
                    shape(
                      "name" => "standard.Void",
                    )
                  ),
                )
              ),
              "name" => "i64Type",
            )
          ),
          tmeta_ThriftField::fromShape(
            shape(
              "id" => 6,
              "type" => tmeta_ThriftType::fromShape(
                shape(
                  "t_enum" => tmeta_ThriftEnumType::fromShape(
                    shape(
                      "name" => "standard.Void",
                    )
                  ),
                )
              ),
              "name" => "floatType",
            )
          ),
          tmeta_ThriftField::fromShape(
            shape(
              "id" => 7,
              "type" => tmeta_ThriftType::fromShape(
                shape(
                  "t_enum" => tmeta_ThriftEnumType::fromShape(
                    shape(
                      "name" => "standard.Void",
                    )
                  ),
                )
              ),
              "name" => "doubleType",
            )
          ),
          tmeta_ThriftField::fromShape(
            shape(
              "id" => 8,
              "type" => tmeta_ThriftType::fromShape(
                shape(
                  "t_enum" => tmeta_ThriftEnumType::fromShape(
                    shape(
                      "name" => "standard.Void",
                    )
                  ),
                )
              ),
              "name" => "stringType",
            )
          ),
          tmeta_ThriftField::fromShape(
            shape(
              "id" => 9,
              "type" => tmeta_ThriftType::fromShape(
                shape(
                  "t_enum" => tmeta_ThriftEnumType::fromShape(
                    shape(
                      "name" => "standard.Void",
                    )
                  ),
                )
              ),
              "name" => "binaryType",
            )
          ),
          tmeta_ThriftField::fromShape(
            shape(
              "id" => 10,
              "type" => tmeta_ThriftType::fromShape(
                shape(
                  "t_struct" => tmeta_ThriftStructType::fromShape(
                    shape(
                      "name" => "standard.TypeUri",
                    )
                  ),
                )
              ),
              "name" => "enumType",
            )
          ),
          tmeta_ThriftField::fromShape(
            shape(
              "id" => 17,
              "type" => tmeta_ThriftType::fromShape(
                shape(
                  "t_struct" => tmeta_ThriftStructType::fromShape(
                    shape(
                      "name" => "standard.TypeUri",
                    )
                  ),
                )
              ),
              "name" => "typedefType",
            )
          ),
          tmeta_ThriftField::fromShape(
            shape(
              "id" => 11,
              "type" => tmeta_ThriftType::fromShape(
                shape(
                  "t_struct" => tmeta_ThriftStructType::fromShape(
                    shape(
                      "name" => "standard.TypeUri",
                    )
                  ),
                )
              ),
              "name" => "structType",
            )
          ),
          tmeta_ThriftField::fromShape(
            shape(
              "id" => 12,
              "type" => tmeta_ThriftType::fromShape(
                shape(
                  "t_struct" => tmeta_ThriftStructType::fromShape(
                    shape(
                      "name" => "standard.TypeUri",
                    )
                  ),
                )
              ),
              "name" => "unionType",
            )
          ),
          tmeta_ThriftField::fromShape(
            shape(
              "id" => 13,
              "type" => tmeta_ThriftType::fromShape(
                shape(
                  "t_struct" => tmeta_ThriftStructType::fromShape(
                    shape(
                      "name" => "standard.TypeUri",
                    )
                  ),
                )
              ),
              "name" => "exceptionType",
            )
          ),
          tmeta_ThriftField::fromShape(
            shape(
              "id" => 14,
              "type" => tmeta_ThriftType::fromShape(
                shape(
                  "t_enum" => tmeta_ThriftEnumType::fromShape(
                    shape(
                      "name" => "standard.Void",
                    )
                  ),
                )
              ),
              "name" => "listType",
            )
          ),
          tmeta_ThriftField::fromShape(
            shape(
              "id" => 15,
              "type" => tmeta_ThriftType::fromShape(
                shape(
                  "t_enum" => tmeta_ThriftEnumType::fromShape(
                    shape(
                      "name" => "standard.Void",
                    )
                  ),
                )
              ),
              "name" => "setType",
            )
          ),
          tmeta_ThriftField::fromShape(
            shape(
              "id" => 16,
              "type" => tmeta_ThriftType::fromShape(
                shape(
                  "t_enum" => tmeta_ThriftEnumType::fromShape(
                    shape(
                      "name" => "standard.Void",
                    )
                  ),
                )
              ),
              "name" => "mapType",
            )
          ),
        ],
        "is_union" => true,
      )
    );
  }

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

  public static function __fromShape(self::TShape $shape)[]: this {
    return new static(
      Shapes::idx($shape, 'boolType'),
      Shapes::idx($shape, 'byteType'),
      Shapes::idx($shape, 'i16Type'),
      Shapes::idx($shape, 'i32Type'),
      Shapes::idx($shape, 'i64Type'),
      Shapes::idx($shape, 'floatType'),
      Shapes::idx($shape, 'doubleType'),
      Shapes::idx($shape, 'stringType'),
      Shapes::idx($shape, 'binaryType'),
      Shapes::idx($shape, 'enumType') === null ? null : (apache_thrift_type_standard_TypeUri::__fromShape($shape['enumType'])),
      Shapes::idx($shape, 'typedefType') === null ? null : (apache_thrift_type_standard_TypeUri::__fromShape($shape['typedefType'])),
      Shapes::idx($shape, 'structType') === null ? null : (apache_thrift_type_standard_TypeUri::__fromShape($shape['structType'])),
      Shapes::idx($shape, 'unionType') === null ? null : (apache_thrift_type_standard_TypeUri::__fromShape($shape['unionType'])),
      Shapes::idx($shape, 'exceptionType') === null ? null : (apache_thrift_type_standard_TypeUri::__fromShape($shape['exceptionType'])),
      Shapes::idx($shape, 'listType'),
      Shapes::idx($shape, 'setType'),
      Shapes::idx($shape, 'mapType'),
    );
  }

  public function __toShape()[]: self::TShape {
    return shape(
      'boolType' => $this->boolType,
      'byteType' => $this->byteType,
      'i16Type' => $this->i16Type,
      'i32Type' => $this->i32Type,
      'i64Type' => $this->i64Type,
      'floatType' => $this->floatType,
      'doubleType' => $this->doubleType,
      'stringType' => $this->stringType,
      'binaryType' => $this->binaryType,
      'enumType' => $this->enumType?->__toShape(),
      'typedefType' => $this->typedefType?->__toShape(),
      'structType' => $this->structType?->__toShape(),
      'unionType' => $this->unionType?->__toShape(),
      'exceptionType' => $this->exceptionType?->__toShape(),
      'listType' => $this->listType,
      'setType' => $this->setType,
      'mapType' => $this->mapType,
    );
  }
  public function getInstanceKey()[write_props]: string {
    return \TCompactSerializer::serialize($this);
  }

  public function readFromJson(string $jsonText): void {
    $this->_type = apache_thrift_type_standard_TypeNameEnum::_EMPTY_;
    $parsed = json_decode($jsonText, true);

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

    if (idx($parsed, 'boolType') !== null) {
      $this->boolType = apache_thrift_type_standard_Void::coerce(HH\FIXME\UNSAFE_CAST<mixed, apache_thrift_type_standard_Void>($parsed['boolType']));
      $this->_type = apache_thrift_type_standard_TypeNameEnum::boolType;
    }
    if (idx($parsed, 'byteType') !== null) {
      $this->byteType = apache_thrift_type_standard_Void::coerce(HH\FIXME\UNSAFE_CAST<mixed, apache_thrift_type_standard_Void>($parsed['byteType']));
      $this->_type = apache_thrift_type_standard_TypeNameEnum::byteType;
    }
    if (idx($parsed, 'i16Type') !== null) {
      $this->i16Type = apache_thrift_type_standard_Void::coerce(HH\FIXME\UNSAFE_CAST<mixed, apache_thrift_type_standard_Void>($parsed['i16Type']));
      $this->_type = apache_thrift_type_standard_TypeNameEnum::i16Type;
    }
    if (idx($parsed, 'i32Type') !== null) {
      $this->i32Type = apache_thrift_type_standard_Void::coerce(HH\FIXME\UNSAFE_CAST<mixed, apache_thrift_type_standard_Void>($parsed['i32Type']));
      $this->_type = apache_thrift_type_standard_TypeNameEnum::i32Type;
    }
    if (idx($parsed, 'i64Type') !== null) {
      $this->i64Type = apache_thrift_type_standard_Void::coerce(HH\FIXME\UNSAFE_CAST<mixed, apache_thrift_type_standard_Void>($parsed['i64Type']));
      $this->_type = apache_thrift_type_standard_TypeNameEnum::i64Type;
    }
    if (idx($parsed, 'floatType') !== null) {
      $this->floatType = apache_thrift_type_standard_Void::coerce(HH\FIXME\UNSAFE_CAST<mixed, apache_thrift_type_standard_Void>($parsed['floatType']));
      $this->_type = apache_thrift_type_standard_TypeNameEnum::floatType;
    }
    if (idx($parsed, 'doubleType') !== null) {
      $this->doubleType = apache_thrift_type_standard_Void::coerce(HH\FIXME\UNSAFE_CAST<mixed, apache_thrift_type_standard_Void>($parsed['doubleType']));
      $this->_type = apache_thrift_type_standard_TypeNameEnum::doubleType;
    }
    if (idx($parsed, 'stringType') !== null) {
      $this->stringType = apache_thrift_type_standard_Void::coerce(HH\FIXME\UNSAFE_CAST<mixed, apache_thrift_type_standard_Void>($parsed['stringType']));
      $this->_type = apache_thrift_type_standard_TypeNameEnum::stringType;
    }
    if (idx($parsed, 'binaryType') !== null) {
      $this->binaryType = apache_thrift_type_standard_Void::coerce(HH\FIXME\UNSAFE_CAST<mixed, apache_thrift_type_standard_Void>($parsed['binaryType']));
      $this->_type = apache_thrift_type_standard_TypeNameEnum::binaryType;
    }
    if (idx($parsed, 'enumType') !== null) {
      $_tmp0 = \json_encode(HH\FIXME\UNSAFE_CAST<mixed, apache_thrift_type_standard_TypeUri>($parsed['enumType']));
      $_tmp1 = apache_thrift_type_standard_TypeUri::withDefaultValues();
      $_tmp1->readFromJson($_tmp0);
      $this->enumType = $_tmp1;
      $this->_type = apache_thrift_type_standard_TypeNameEnum::enumType;
    }
    if (idx($parsed, 'typedefType') !== null) {
      $_tmp2 = \json_encode(HH\FIXME\UNSAFE_CAST<mixed, apache_thrift_type_standard_TypeUri>($parsed['typedefType']));
      $_tmp3 = apache_thrift_type_standard_TypeUri::withDefaultValues();
      $_tmp3->readFromJson($_tmp2);
      $this->typedefType = $_tmp3;
      $this->_type = apache_thrift_type_standard_TypeNameEnum::typedefType;
    }
    if (idx($parsed, 'structType') !== null) {
      $_tmp4 = \json_encode(HH\FIXME\UNSAFE_CAST<mixed, apache_thrift_type_standard_TypeUri>($parsed['structType']));
      $_tmp5 = apache_thrift_type_standard_TypeUri::withDefaultValues();
      $_tmp5->readFromJson($_tmp4);
      $this->structType = $_tmp5;
      $this->_type = apache_thrift_type_standard_TypeNameEnum::structType;
    }
    if (idx($parsed, 'unionType') !== null) {
      $_tmp6 = \json_encode(HH\FIXME\UNSAFE_CAST<mixed, apache_thrift_type_standard_TypeUri>($parsed['unionType']));
      $_tmp7 = apache_thrift_type_standard_TypeUri::withDefaultValues();
      $_tmp7->readFromJson($_tmp6);
      $this->unionType = $_tmp7;
      $this->_type = apache_thrift_type_standard_TypeNameEnum::unionType;
    }
    if (idx($parsed, 'exceptionType') !== null) {
      $_tmp8 = \json_encode(HH\FIXME\UNSAFE_CAST<mixed, apache_thrift_type_standard_TypeUri>($parsed['exceptionType']));
      $_tmp9 = apache_thrift_type_standard_TypeUri::withDefaultValues();
      $_tmp9->readFromJson($_tmp8);
      $this->exceptionType = $_tmp9;
      $this->_type = apache_thrift_type_standard_TypeNameEnum::exceptionType;
    }
    if (idx($parsed, 'listType') !== null) {
      $this->listType = apache_thrift_type_standard_Void::coerce(HH\FIXME\UNSAFE_CAST<mixed, apache_thrift_type_standard_Void>($parsed['listType']));
      $this->_type = apache_thrift_type_standard_TypeNameEnum::listType;
    }
    if (idx($parsed, 'setType') !== null) {
      $this->setType = apache_thrift_type_standard_Void::coerce(HH\FIXME\UNSAFE_CAST<mixed, apache_thrift_type_standard_Void>($parsed['setType']));
      $this->_type = apache_thrift_type_standard_TypeNameEnum::setType;
    }
    if (idx($parsed, 'mapType') !== null) {
      $this->mapType = apache_thrift_type_standard_Void::coerce(HH\FIXME\UNSAFE_CAST<mixed, apache_thrift_type_standard_Void>($parsed['mapType']));
      $this->_type = apache_thrift_type_standard_TypeNameEnum::mapType;
    }
  }

}