code: func (errs *Errors) UnmarshalJSON(data []byte) error {
  	var tmpErrs struct {
  		Errors []Error
  	}
  
  	if err := json.Unmarshal(data, &tmpErrs); err != nil {
  		return err
  	}
  
  	var newErrs Errors
  	for _, daErr := range tmpErrs.Errors {
  		// If Message is empty or exactly matches the Code's message string
  		// then just use the Code, no need for a full Error struct
  		if daErr.Detail == nil && (daErr.Message == "" || daErr.Message == daErr.Code.Message()) {
  			// Error's w/o details get converted to ErrorCode
  			newErrs = append(newErrs, daErr.Code)
  		} else {
  			// Error's w/ details are untouched
  			newErrs = append(newErrs, Error{
  				Code:    daErr.Code,
  				Message: daErr.Message,
  				Detail:  daErr.Detail,
  			})
  		}
  	}
  
  	*errs = newErrs
  	return nil
  }
docs: // UnmarshalJSON deserializes []Error and then converts it into slice of
  // Error or ErrorCode