code: func (d *LogStreamDescriptor) Validate(prefix bool) error {
  	if d == nil {
  		return errors.New("descriptor is nil")
  	}
  
  	if prefix {
  		if err := types.StreamName(d.Prefix).Validate(); err != nil {
  			return fmt.Errorf("invalid prefix: %s", err)
  		}
  	}
  	if err := types.StreamName(d.Name).Validate(); err != nil {
  		return fmt.Errorf("invalid name: %s", err)
  	}
  
  	switch d.StreamType {
  	case StreamType_TEXT, StreamType_BINARY, StreamType_DATAGRAM:
  		break
  
  	default:
  		return fmt.Errorf("invalid stream type: %v", d.StreamType)
  	}
  
  	if d.ContentType == "" {
  		return errors.New("missing content type")
  	}
  
  	if d.Timestamp == nil {
  		return errors.New("missing timestamp")
  	}
  	for k, v := range d.GetTags() {
  		if err := types.ValidateTag(k, v); err != nil {
  			return fmt.Errorf("invalid tag %q: %v", k, err)
  		}
  	}
  	return nil
  }
docs: // Validate returns an error if the supplied LogStreamDescriptor is not complete
  // and valid.
  //
  // If prefix is true, the Prefix field will be validated; otherwise, it will
  // be ignored. This can be useful when attempting to validate a
  // LogStreamDescriptor before the application-assigned Prefix is known.