I believe you're looking for 
oneof: https://developers.google.com/protocol-buffers/docs/proto#oneof

--Jordan

On Wednesday, September 14, 2016 at 2:44:40 PM UTC-5, Sachin Gole wrote:
>
> Hi All,
>
> I have one requirement where I wanted to pass request object either Socket 
> or GetHost
>
> Can any one know how to define that in Action message
>
> message Action {
>
>     uint32 protocol_version = 1; // protocol version
>     int64 request_uid = 2; // request uid
>     int64 socket_id = 3; // value 0 is reserved for static methods
>     uint32 service_type = 4; // type of service which should process 
> message
>     uint32 left_messages = 5;
>     message request_object = 6;
> }
>
> message Socket {
>    uint32 id = 1;
> }
>
> message GetHost {
>     string url = 1;
> }
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.

Reply via email to