code: func (r Resource) MarshalJSON() ([]byte, error) {
  	return json.Marshal(struct {
  		Type           string
  		CreationPolicy *CreationPolicy        `json:",omitempty"`
  		DeletionPolicy string                 `json:",omitempty"`
  		DependsOn      []string               `json:",omitempty"`
  		Metadata       map[string]interface{} `json:",omitempty"`
  		UpdatePolicy   *UpdatePolicy          `json:",omitempty"`
  		Condition      string                 `json:",omitempty"`
  		Properties     ResourceProperties
  	}{
  		Type:           r.Properties.CfnResourceType(),
  		CreationPolicy: r.CreationPolicy,
  		DeletionPolicy: r.DeletionPolicy,
  		DependsOn:      r.DependsOn,
  		Metadata:       r.Metadata,
  		UpdatePolicy:   r.UpdatePolicy,
  		Condition:      r.Condition,
  		Properties:     r.Properties,
  	})
  }
docs: // MarshalJSON returns a JSON representation of the object