// MarshalJSON encodes a view to JSON bytes.
198210
func (c View) MarshalJSON() ([]byte, error) {
	vis, err := MarshalViewPropertiesJSON(c.Properties)
	if err != nil {
		return nil, err
	}

	return json.Marshal(struct {
		ViewContents
		ViewProperties json.RawMessage `json:"properties"`
	}{
		ViewContents:   c.ViewContents,
		ViewProperties: vis,
	})
}
90283
func (t *Function) MarshalJSON() ([]byte, error) {
	repr := map[string]interface{}{
		"type": t.typeMarker(),
	}
	if len(t.args) > 0 {
		repr["args"] = t.args
	}
	if t.result != nil {
		repr["result"] = t.result
	}
	return json.Marshal(repr)
}
918180
func (v Failed) MarshalJSON() ([]byte, error) {
	w := jwriter.Writer{}
	easyjson692db02bEncodeGithubComMailgunMailgunGoEvents12(&w, v)
	return w.Buffer.BuildBytes(), w.Error
}
1241785
func (p StreamPath) MarshalJSON() ([]byte, error) {
	v := string(p)
	return json.Marshal(&v)
}
1081221
func (v Paging) MarshalJSON() ([]byte, error) {
	w := jwriter.Writer{}
	easyjson692db02bEncodeGithubComMailgunMailgunGoEvents4(&w, v)
	return w.Buffer.BuildBytes(), w.Error
}
299368
func (sf *ScalarFunction) MarshalJSON() ([]byte, error) {
	return []byte(fmt.Sprintf("\"%s\"", sf)), nil
}
1277491
func (actionSet ActionSet) MarshalJSON() ([]byte, error) {
	if len(actionSet) == 0 {
		return nil, fmt.Errorf("empty action set")
	}

	return json.Marshal(actionSet.ToSlice())
}
488682
func (s *SourceNetwork) MarshalJSON() ([]byte, error) {
	if s == nil {
		return []byte(""), nil
	}

	list := []string(*s)
	if len(list) == 0 || (len(list) == 1 && list[0] == "") {
		return []byte(`""`), nil
	}

	return json.Marshal(list)
}
821866
func (fa *Float32Array) MarshalJSON() ([]byte, error) {
	if fa == nil || !fa.Valid {
		return []byte("null"), nil
	}
	return json.Marshal(fa.Float32Array)
}
478804
func (e JSONError) MarshalJSON() ([]byte, error) {
	if e.error == nil {
		return []byte("null"), nil
	}
	return json.Marshal(e.Error())
}
402086
func (c *ConfigPolicy) MarshalJSON() ([]byte, error) {
	return json.Marshal(&struct {
		Config *ctree.ConfigTree `json:"config"`
	}{
		Config: c.config,
	})
}
1332101
func (c Cid) MarshalJSON() ([]byte, error) {
	if !c.Defined() {
		return []byte("null"), nil
	}
	return []byte(fmt.Sprintf("{\"/\":\"%s\"}", c.String())), nil
}
281339
func (results Results) MarshalJSON() ([]byte, error) {
	for _, result := range results {
		if result.ResultID() == "" {
			result.SetResultID(fmt.Sprintf("%d", &result))
		}

		if err := inferIQR(result); err != nil {
			return nil, err
		}
	}

	return json.Marshal([]Result(results))
}
1051093
func (u *Uint64) MarshalJSON() ([]byte, error) {
	if u == nil || !u.Valid {
		return []byte("null"), nil
	}

	return json.Marshal(u.Uint64)
}
863293
func (m *marshalableError) MarshalJSON() ([]byte, error) {
	return json.Marshal(m.err.Error())
}
504045
func (s Services) MarshalJSON() ([]byte, error) {
	data, err := s.MarshalYAML()
	if err != nil {
		return nil, err
	}
	return json.MarshalIndent(data, "", "  ")
}
1009402
func (a *URIAction) MarshalJSON() ([]byte, error) {
	return json.Marshal(&struct {
		Type   ActionType       `json:"type"`
		Label  string           `json:"label,omitempty"`
		URI    string           `json:"uri"`
		AltURI *URIActionAltURI `json:"altUri,omitempty"`
	}{
		Type:   ActionTypeURI,
		Label:  a.Label,
		URI:    a.URI,
		AltURI: a.AltURI,
	})
}