// MarshalJSON method of ConfirmTemplate
190465
func (t *ConfirmTemplate) MarshalJSON() ([]byte, error) {
	return json.Marshal(&struct {
		Type    TemplateType     `json:"type"`
		Text    string           `json:"text"`
		Actions []TemplateAction `json:"actions"`
	}{
		Type:    TemplateTypeConfirm,
		Text:    t.Text,
		Actions: t.Actions,
	})
}
402086
func (c *ConfigPolicy) MarshalJSON() ([]byte, error) {
	return json.Marshal(&struct {
		Config *ctree.ConfigTree `json:"config"`
	}{
		Config: c.config,
	})
}
1197823
func (dt *DateTimeRFC2616) MarshalJSON() ([]byte, error) {
	return []byte(time.Time(*dt).Format(dateTimeRFC2616FmtTicked)), nil
}
432699
func (dto *DatetimeOnly) MarshalJSON() ([]byte, error) {
	return []byte(time.Time(*dto).Format(datetimeOnlyFmtTicked)), nil
}
22305
func (v Accepted) MarshalJSON() ([]byte, error) {
	w := jwriter.Writer{}
	easyjson692db02bEncodeGithubComMailgunMailgunGoEvents17(&w, v)
	return w.Buffer.BuildBytes(), w.Error
}
318018
func (step *CallFlowSayStep) MarshalJSON() ([]byte, error) {
	data := jsonCallFlowSayStep{}
	data.CallFlowStepBase = step.CallFlowStepBase
	data.Action = "say"
	data.Options.Payload = step.Payload
	data.Options.Voice = step.Voice
	data.Options.Language = step.Language
	data.Options.Repeat = step.Repeat
	data.Options.IfMachine = step.IfMachine
	data.Options.MachineTimeout = int(step.MachineTimeout / time.Millisecond)
	return json.Marshal(data)
}
1143569
func (n NullString) MarshalJSON() ([]byte, error) {
	if n.Valid {
		return json.Marshal(n.String)
	}
	return nullString, nil
}
30465
func (i IAMPrincipal) MarshalJSON() ([]byte, error) {
	// Special case for "*"
	if i.AWS != nil && len(i.AWS.Literal) == 1 && i.AWS.Literal[0].Literal == "*" {
		return json.Marshal(i.AWS.Literal[0].Literal)
	}

	c := iamPrincipalCopy(i)

	return json.Marshal(c)
}
591653
func (m *ImageMessage) MarshalJSON() ([]byte, error) {
	return json.Marshal(&struct {
		Type               MessageType      `json:"type"`
		OriginalContentURL string           `json:"originalContentUrl"`
		PreviewImageURL    string           `json:"previewImageUrl"`
		QuickReply         *QuickReplyItems `json:"quickReply,omitempty"`
	}{
		Type:               MessageTypeImage,
		OriginalContentURL: m.OriginalContentURL,
		PreviewImageURL:    m.PreviewImageURL,
		QuickReply:         m.quickReplyitems,
	})
}
306401
func (that *JSONNode) MarshalJSON() ([]byte, error) {
	var ret []byte
	var err error
	switch that.t {
	case TypeMap:
		ret, err = json.Marshal(that.m)
	case TypeArray:
		ret, err = json.Marshal(that.a)
	case TypeValue:
		ret, err = json.Marshal(that.v)
	default:
		ret, err = json.Marshal(nil)
	}
	if err != nil {
		return nil, err
	}
	return ret, err
}
116621
func (c FSChecksumInfoV1) MarshalJSON() ([]byte, error) {
	type checksuminfo struct {
		Algorithm string   `json:"algorithm"`
		Blocksize int64    `json:"blocksize"`
		Hashes    []string `json:"hashes"`
	}
	var hashes []string
	for _, h := range c.Hashes {
		hashes = append(hashes, hex.EncodeToString(h))
	}
	info := checksuminfo{
		Algorithm: c.Algorithm,
		Hashes:    hashes,
		Blocksize: c.Blocksize,
	}
	return json.Marshal(info)
}
1051093
func (u *Uint64) MarshalJSON() ([]byte, error) {
	if u == nil || !u.Valid {
		return []byte("null"), nil
	}

	return json.Marshal(u.Uint64)
}
262577
func NewConfirmTemplate(text string, left, right TemplateAction) *ConfirmTemplate {
	return &ConfirmTemplate{
		Text:    text,
		Actions: []TemplateAction{left, right},
	}
}
1042168
func (spt ServicePrincipalToken) MarshalTokenJSON() ([]byte, error) {
	return json.Marshal(spt.inner.Token)
}
1212123
func (fc FeatureCollection) MarshalJSON() ([]byte, error) {
	type tempFC FeatureCollection

	c := tempFC{
		Type:     featureCollection,
		BBox:     fc.BBox,
		Features: fc.Features,
	}

	if c.Features == nil {
		c.Features = []*Feature{}
	}
	return json.Marshal(c)
}
1231951
func (v EventSendFormatV2) MarshalJSON() ([]byte, error) {
	w := jwriter.Writer{}
	easyjson3b0ebf6aEncodeGithubComSignalfxGatewayProtocolSignalfxFormat6(&w, v)
	return w.Buffer.BuildBytes(), w.Error
}
789835
func (r *rawTemplate) MarshalJSON() ([]byte, error) {
	// Avoid recursion
	type rawTemplate_ rawTemplate
	out, _ := json.Marshal(rawTemplate_(*r))

	var m map[string]json.RawMessage
	_ = json.Unmarshal(out, &m)

	// Flatten Comments
	delete(m, "comments")
	for _, comment := range r.Comments {
		for k, v := range comment {
			out, _ = json.Marshal(v)
			m[k] = out
		}
	}

	return json.Marshal(m)
}