public Protocol(string name, string snamespace, string doc, IEnumerable<Schema> types, IEnumerable<Message> messages)
{
if (string.IsNullOrEmpty(name)) throw new ArgumentNullException("name", "name cannot be null.");
if (null == types) throw new ArgumentNullException("types", "types cannot be null.");
if (null == messages) throw new ArgumentNullException("messages", "messages cannot be null.");
this.Name = name;
this.Namespace = snamespace;
this.Doc = doc;
this.Types = new List<Schema>(types);
this.Messages = new List<Message>(messages);
}