code: func (rule CloudWatchEventsRule) MarshalJSON() ([]byte, error) {
  	ruleJSON := map[string]interface{}{}
  
  	if rule.Description != "" {
  		ruleJSON["Description"] = rule.Description
  	}
  	if nil != rule.EventPattern {
  		eventPatternString, err := json.Marshal(rule.EventPattern)
  		if nil != err {
  			return nil, err
  		}
  		ruleJSON["EventPattern"] = string(eventPatternString)
  	}
  	if rule.ScheduleExpression != "" {
  		ruleJSON["ScheduleExpression"] = rule.ScheduleExpression
  	}
  	if nil != rule.RuleTarget {
  		ruleJSON["RuleTarget"] = rule.RuleTarget
  	}
  	return json.Marshal(ruleJSON)
  }
docs: // MarshalJSON customizes the JSON representation used when serializing to the
  // CloudFormation template representation.