code: func (cs Conditions) UnmarshalJSON(data []byte) error {
  	if cs == nil {
  		return errors.New("Can not be nil")
  	}
  
  	var jcs map[string]jsonCondition
  	var dc Condition
  
  	if err := json.Unmarshal(data, &jcs); err != nil {
  		return errors.WithStack(err)
  	}
  
  	for k, jc := range jcs {
  		var found bool
  		for name, c := range ConditionFactories {
  			if name == jc.Type {
  				found = true
  				dc = c()
  
  				if len(jc.Options) == 0 {
  					cs[k] = dc
  					break
  				}
  
  				if err := json.Unmarshal(jc.Options, dc); err != nil {
  					return errors.WithStack(err)
  				}
  
  				cs[k] = dc
  				break
  			}
  		}
  
  		if !found {
  			return errors.Errorf("Could not find condition type %s", jc.Type)
  		}
  	}
  
  	return nil
  }
docs: // UnmarshalJSON unmarshals a list of conditions from json.