code: func (r *AWSServerlessFunction_Events) UnmarshalJSON(b []byte) error {
  
  	// Unmarshal into interface{} to check it's type
  	var typecheck interface{}
  	if err := json.Unmarshal(b, &typecheck); err != nil {
  		return err
  	}
  
  	switch val := typecheck.(type) {
  
  	case string:
  		r.String = &val
  
  	case []string:
  		r.StringArray = &val
  
  	case map[string]interface{}:
  		val = val // This ensures val is used to stop an error
  
  	case []interface{}:
  
  		json.Unmarshal(b, &r.StringArray)
  
  	}
  
  	return nil
  }
docs: // Hook into the marshaller