title: How to generate algebraic data types in scala using scalaPB
body: <p>I want to generate below algebraic data types in scala using scalaPB.</p>
  
  <pre class="lang-scala prettyprint-override"><code>trait MyEventCmd
  case class MyEvent(mytype: Int, cp: Option[Double], value: Option[String] = None, id: Option[String] = None) extends MyEventCmd
  case object Flush extends MyEventCmd
  </code></pre>
  
  <p>I've defined below protobuf <code>myevent.proto</code>-</p>
  
  <pre class="lang-proto prettyprint-override"><code>syntax = "proto3";
  
  message MyEventCmd {
    oneof sealed_value {
      Flush lit = 1;
      MyEvent event = 2;
    }
  }
  
  message Flush {
  }
  
  message MyEvent {
    int32 eType = 1;
    double cp = 2;
    string value = 3;
    string id = 4;
  }
  </code></pre>
  
  <p>The problem with my definition is that <code>Flush</code> is generated as <code>case class</code> not <code>case object</code>.</p>
  
  <p>Also, I don't know how to make field optional and with default value.</p>