use Moose; has id => ( is => 'ro', isa => 'Int' ); has field1 => ( is => 'rw', isa => 'Str' ); has field2 => ( is => 'rw', isa => 'Str' );