// MarshalJSON will convert the MultiPoint into a GeoJSON MultiPoint geometry.
176417
func (mp MultiPoint) MarshalJSON() ([]byte, error) {
	return json.Marshal(Geometry{Coordinates: orb.MultiPoint(mp)})
}
504045
func (s Services) MarshalJSON() ([]byte, error) {
	data, err := s.MarshalYAML()
	if err != nil {
		return nil, err
	}
	return json.MarshalIndent(data, "", "  ")
}
366089
func (v InputSpanList) MarshalJSON() ([]byte, error) {
	w := jwriter.Writer{}
	easyjson3b0ebf6aEncodeGithubComSignalfxGatewayProtocolSignalfxFormat3(&w, v)
	return w.Buffer.BuildBytes(), w.Error
}
1036865
func (p Protected) MarshalJSON() ([]byte, error) {
	b, err := json.Marshal(map[string]interface{}(p))
	if err != nil {
		return nil, err
	}
	return EncodeEscape(b), nil
}
201062
func (l *Line) MarshalJSON() ([]byte, error) {
	return json.Marshal([2]Point{l.a, l.b})
}
974680
func (v LargePayload) MarshalJSON() ([]byte, error) {
	w := jwriter.Writer{}
	easyjsonCfe4e5f0EncodeGithubComFrancoispqtGojayBenchmarks(&w, v)
	return w.Buffer.BuildBytes(), w.Error
}
738683
func (v JSONDatapointV1) MarshalJSON() ([]byte, error) {
	w := jwriter.Writer{}
	easyjson3b0ebf6aEncodeGithubComSignalfxGatewayProtocolSignalfxFormat2(&w, v)
	return w.Buffer.BuildBytes(), w.Error
}
251645
func (args Args) MarshalJSON() ([]byte, error) {
	if len(args.fields) == 0 {
		return []byte{}, nil
	}
	return json.Marshal(args.fields)
}
1137036
func (s JSONMapSlice) MarshalJSON() ([]byte, error) {
	w := &jwriter.Writer{Flags: jwriter.NilMapAsEmpty | jwriter.NilSliceAsEmpty}
	s.MarshalEasyJSON(w)
	return w.BuildBytes()
}
14221
func (sf *ScalarFunction) MarshalJSON() ([]byte, error) {
	buffer := bytes.NewBufferString(fmt.Sprintf("\"%s\"", sf))
	return buffer.Bytes(), nil
}
323622
func (t String) MarshalJSON() ([]byte, error) {
	return json.Marshal(map[string]interface{}{
		"type": t.typeMarker(),
	})
}
1001001
func (c *Client) MarshalJSON() ([]byte, error) {
	b, err := json.Marshal(struct {
		Config  Config   `json:"config"`
		Cluster *Cluster `json:"cluster"`
	}{
		Config:  c.Config,
		Cluster: c.Cluster,
	})

	if err != nil {
		return nil, err
	}

	return b, nil
}
1003693
func (mp *MultiPoint) UnmarshalJSON(data []byte) error {
	g := &Geometry{}
	err := json.Unmarshal(data, &g)
	if err != nil {
		return err
	}

	multiPoint, ok := g.Coordinates.(orb.MultiPoint)
	if !ok {
		return errors.New("geojson: not a MultiPoint type")
	}

	*mp = MultiPoint(multiPoint)
	return nil
}
1199587
func (g Geometry) MarshalJSON() ([]byte, error) {
	// defining a struct here lets us define the order of the JSON elements.
	type geometry struct {
		Type        GeometryType           `json:"type"`
		BoundingBox []float64              `json:"bbox,omitempty"`
		Coordinates interface{}            `json:"coordinates,omitempty"`
		Geometries  interface{}            `json:"geometries,omitempty"`
		CRS         map[string]interface{} `json:"crs,omitempty"`
	}

	geo := &geometry{
		Type: g.Type,
	}

	if g.BoundingBox != nil && len(g.BoundingBox) != 0 {
		geo.BoundingBox = g.BoundingBox
	}

	switch g.Type {
	case GeometryPoint:
		geo.Coordinates = g.Point
	case GeometryMultiPoint:
		geo.Coordinates = g.MultiPoint
	case GeometryLineString:
		geo.Coordinates = g.LineString
	case GeometryMultiLineString:
		geo.Coordinates = g.MultiLineString
	case GeometryPolygon:
		geo.Coordinates = g.Polygon
	case GeometryMultiPolygon:
		geo.Coordinates = g.MultiPolygon
	case GeometryCollection:
		geo.Geometries = g.Geometries
	}

	return json.Marshal(geo)
}
865624
func (v Generic) MarshalJSON() ([]byte, error) {
	w := jwriter.Writer{}
	easyjson692db02bEncodeGithubComMailgunMailgunGoEvents11(&w, v)
	return w.Buffer.BuildBytes(), w.Error
}
387807
func (timestamp Timestamp) MarshalJSON() ([]byte, error) {
	return []byte(time.Time(timestamp).UTC().Format(timestampFormat)), nil
}
564982
func (aSpace *addrSpace) MarshalJSON() ([]byte, error) {
	aSpace.Lock()
	defer aSpace.Unlock()

	m := map[string]interface{}{
		"Scope": string(aSpace.scope),
	}

	if aSpace.subnets != nil {
		s := map[string]*PoolData{}
		for k, v := range aSpace.subnets {
			s[k.String()] = v
		}
		m["Subnets"] = s
	}

	return json.Marshal(m)
}