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

/**
 * Original thrift struct:-
 * Limits
 */
class Limits implements \IThriftSyncStruct, \IThriftStructMetadata {
  use \ThriftSerializationTrait;

  const \ThriftStructTypes::TSpec SPEC = dict[
    1 => shape(
      'var' => 'max_i64_field',
      'type' => \TType::I64,
    ),
    2 => shape(
      'var' => 'min_i64_field',
      'type' => \TType::I64,
    ),
    3 => shape(
      'var' => 'max_i32_field',
      'type' => \TType::I32,
    ),
    4 => shape(
      'var' => 'min_i32_field',
      'type' => \TType::I32,
    ),
    5 => shape(
      'var' => 'max_i16_field',
      'type' => \TType::I16,
    ),
    6 => shape(
      'var' => 'min_i16_field',
      'type' => \TType::I16,
    ),
    7 => shape(
      'var' => 'max_byte_field',
      'type' => \TType::BYTE,
    ),
    8 => shape(
      'var' => 'min_byte_field',
      'type' => \TType::BYTE,
    ),
  ];
  const dict<string, int> FIELDMAP = dict[
    'max_i64_field' => 1,
    'min_i64_field' => 2,
    'max_i32_field' => 3,
    'min_i32_field' => 4,
    'max_i16_field' => 5,
    'min_i16_field' => 6,
    'max_byte_field' => 7,
    'min_byte_field' => 8,
  ];

  const type TConstructorShape = shape(
    ?'max_i64_field' => ?int,
    ?'min_i64_field' => ?int,
    ?'max_i32_field' => ?int,
    ?'min_i32_field' => ?int,
    ?'max_i16_field' => ?int,
    ?'min_i16_field' => ?int,
    ?'max_byte_field' => ?int,
    ?'min_byte_field' => ?int,
  );

  const int STRUCTURAL_ID = 2407456192555467304;
  /**
   * Original thrift field:-
   * 1: i64 max_i64_field
   */
  public int $max_i64_field;
  /**
   * Original thrift field:-
   * 2: i64 min_i64_field
   */
  public int $min_i64_field;
  /**
   * Original thrift field:-
   * 3: i32 max_i32_field
   */
  public int $max_i32_field;
  /**
   * Original thrift field:-
   * 4: i32 min_i32_field
   */
  public int $min_i32_field;
  /**
   * Original thrift field:-
   * 5: i16 max_i16_field
   */
  public int $max_i16_field;
  /**
   * Original thrift field:-
   * 6: i16 min_i16_field
   */
  public int $min_i16_field;
  /**
   * Original thrift field:-
   * 7: byte max_byte_field
   */
  public int $max_byte_field;
  /**
   * Original thrift field:-
   * 8: byte min_byte_field
   */
  public int $min_byte_field;

  public function __construct(?int $max_i64_field = null, ?int $min_i64_field = null, ?int $max_i32_field = null, ?int $min_i32_field = null, ?int $max_i16_field = null, ?int $min_i16_field = null, ?int $max_byte_field = null, ?int $min_byte_field = null)[] {
    $this->max_i64_field = $max_i64_field ?? 9223372036854775807;
    $this->min_i64_field = $min_i64_field ?? -9223372036854775808;
    $this->max_i32_field = $max_i32_field ?? 2147483647;
    $this->min_i32_field = $min_i32_field ?? -2147483648;
    $this->max_i16_field = $max_i16_field ?? 32767;
    $this->min_i16_field = $min_i16_field ?? -32768;
    $this->max_byte_field = $max_byte_field ?? 127;
    $this->min_byte_field = $min_byte_field ?? -128;
  }

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

  public static function fromShape(self::TConstructorShape $shape)[]: this {
    return new static(
      Shapes::idx($shape, 'max_i64_field'),
      Shapes::idx($shape, 'min_i64_field'),
      Shapes::idx($shape, 'max_i32_field'),
      Shapes::idx($shape, 'min_i32_field'),
      Shapes::idx($shape, 'max_i16_field'),
      Shapes::idx($shape, 'min_i16_field'),
      Shapes::idx($shape, 'max_byte_field'),
      Shapes::idx($shape, 'min_byte_field'),
    );
  }

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

  public static function getStructMetadata()[]: \tmeta_ThriftStruct {
    return tmeta_ThriftStruct::fromShape(
      shape(
        "name" => "module.Limits",
        "fields" => vec[
          tmeta_ThriftField::fromShape(
            shape(
              "id" => 1,
              "type" => tmeta_ThriftType::fromShape(
                shape(
                  "t_primitive" => tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,
                )
              ),
              "name" => "max_i64_field",
            )
          ),
          tmeta_ThriftField::fromShape(
            shape(
              "id" => 2,
              "type" => tmeta_ThriftType::fromShape(
                shape(
                  "t_primitive" => tmeta_ThriftPrimitiveType::THRIFT_I64_TYPE,
                )
              ),
              "name" => "min_i64_field",
            )
          ),
          tmeta_ThriftField::fromShape(
            shape(
              "id" => 3,
              "type" => tmeta_ThriftType::fromShape(
                shape(
                  "t_primitive" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,
                )
              ),
              "name" => "max_i32_field",
            )
          ),
          tmeta_ThriftField::fromShape(
            shape(
              "id" => 4,
              "type" => tmeta_ThriftType::fromShape(
                shape(
                  "t_primitive" => tmeta_ThriftPrimitiveType::THRIFT_I32_TYPE,
                )
              ),
              "name" => "min_i32_field",
            )
          ),
          tmeta_ThriftField::fromShape(
            shape(
              "id" => 5,
              "type" => tmeta_ThriftType::fromShape(
                shape(
                  "t_primitive" => tmeta_ThriftPrimitiveType::THRIFT_I16_TYPE,
                )
              ),
              "name" => "max_i16_field",
            )
          ),
          tmeta_ThriftField::fromShape(
            shape(
              "id" => 6,
              "type" => tmeta_ThriftType::fromShape(
                shape(
                  "t_primitive" => tmeta_ThriftPrimitiveType::THRIFT_I16_TYPE,
                )
              ),
              "name" => "min_i16_field",
            )
          ),
          tmeta_ThriftField::fromShape(
            shape(
              "id" => 7,
              "type" => tmeta_ThriftType::fromShape(
                shape(
                  "t_primitive" => tmeta_ThriftPrimitiveType::THRIFT_BYTE_TYPE,
                )
              ),
              "name" => "max_byte_field",
            )
          ),
          tmeta_ThriftField::fromShape(
            shape(
              "id" => 8,
              "type" => tmeta_ThriftType::fromShape(
                shape(
                  "t_primitive" => tmeta_ThriftPrimitiveType::THRIFT_BYTE_TYPE,
                )
              ),
              "name" => "min_byte_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);
  }

}

