// MarshalConfig encodes a config to binary protobuf format.
507197
func MarshalConfig(c *chronograf.Config) ([]byte, error) {
	return MarshalConfigPB(&Config{
		Auth: &AuthConfig{
			SuperAdminNewUsers: c.Auth.SuperAdminNewUsers,
		},
	})
}
1167472
func MarshalIndent(v interface{}, prefix, indent string) ([]byte, error) {
	return ConfigDefault.MarshalIndent(v, prefix, indent)
}
147507
func (m *StatusResponseKubernetes) MarshalBinary() ([]byte, error) {
	if m == nil {
		return nil, nil
	}
	return swag.WriteJSON(m)
}
548661
func (m *WellKnown) MarshalBinary() ([]byte, error) {
	if m == nil {
		return nil, nil
	}
	return swag.WriteJSON(m)
}
1272660
func (m *DaemonConfiguration) MarshalBinary() ([]byte, error) {
	if m == nil {
		return nil, nil
	}
	return swag.WriteJSON(m)
}
1221015
func (c *Config) MarshalJSON() ([]byte, error) {
	stage0 := []interface{}{}

	for host, auth := range c.AuthPerHost {
		var typ string
		var credentials interface{}

		switch h := auth.(type) {
		case *basicAuthHeaderer:
			typ = "basic"
			credentials = h.auth
		case *oAuthBearerTokenHeaderer:
			typ = "oauth"
			credentials = h.auth
		case *awsAuthHeaderer:
			typ = "aws"
			credentials = h.auth
		default:
			return nil, errors.New("unknown headerer type")
		}

		auth := struct {
			RktVersion  string      `json:"rktVersion"`
			RktKind     string      `json:"rktKind"`
			Domains     []string    `json:"domains"`
			Type        string      `json:"type"`
			Credentials interface{} `json:"credentials"`
		}{
			RktVersion:  "v1",
			RktKind:     "auth",
			Domains:     []string{host},
			Type:        typ,
			Credentials: credentials,
		}

		stage0 = append(stage0, auth)
	}

	for registry, credentials := range c.DockerCredentialsPerRegistry {
		dockerAuth := struct {
			RktVersion  string           `json:"rktVersion"`
			RktKind     string           `json:"rktKind"`
			Registries  []string         `json:"registries"`
			Credentials BasicCredentials `json:"credentials"`
		}{
			RktVersion:  "v1",
			RktKind:     "dockerAuth",
			Registries:  []string{registry},
			Credentials: credentials,
		}

		stage0 = append(stage0, dockerAuth)
	}

	paths := struct {
		RktVersion   string `json:"rktVersion"`
		RktKind      string `json:"rktKind"`
		Data         string `json:"data"`
		Stage1Images string `json:"stage1-images"`
	}{
		RktVersion:   "v1",
		RktKind:      "paths",
		Data:         c.Paths.DataDir,
		Stage1Images: c.Paths.Stage1ImagesDir,
	}

	stage1 := struct {
		RktVersion string `json:"rktVersion"`
		RktKind    string `json:"rktKind"`
		Name       string `json:"name"`
		Version    string `json:"version"`
		Location   string `json:"location"`
	}{
		RktVersion: "v1",
		RktKind:    "stage1",
		Name:       c.Stage1.Name,
		Version:    c.Stage1.Version,
		Location:   c.Stage1.Location,
	}

	stage0 = append(stage0, paths, stage1)

	data := map[string]interface{}{"stage0": stage0}
	return json.Marshal(data)
}
1302956
func MarshalString(in interface{}) (out string, err error) {
	bufferString := bytes.NewBufferString(out)
	if err := Marshal(in, bufferString); err != nil {
		return "", err
	}
	return bufferString.String(), nil
}
994413
func (m *StatusResponseClusterNodesItems0PrimaryAddress) MarshalBinary() ([]byte, error) {
	if m == nil {
		return nil, nil
	}
	return swag.WriteJSON(m)
}
946698
func MarshalAndEncodeKubeConfig(cfg *KubeConfig) (string, error) {
	y, err := yaml.Marshal(cfg)
	if err != nil {
		return "", err
	}
	return base64.StdEncoding.EncodeToString(y), nil
}
1202883
func (m *LabelConfigurationSpec) MarshalBinary() ([]byte, error) {
	if m == nil {
		return nil, nil
	}
	return swag.WriteJSON(m)
}
1262486
func (t *TeleportTrustedClusterMarshaler) Marshal(c TrustedCluster, opts ...MarshalOption) ([]byte, error) {
	cfg, err := collectOptions(opts)
	if err != nil {
		return nil, trace.Wrap(err)
	}
	switch resource := c.(type) {
	case *TrustedClusterV2:
		if !cfg.PreserveResourceID {
			// avoid modifying the original object
			// to prevent unexpected data races
			copy := *resource
			copy.SetResourceID(0)
			resource = &copy
		}
		return utils.FastMarshal(resource)
	default:
		return nil, trace.BadParameter("unrecognized resource version %T", c)
	}
}
656573
func (m *ExtUserObjectFlat) MarshalBinary() ([]byte, error) {
	if m == nil {
		return nil, nil
	}
	return swag.WriteJSON(m)
}
309729
func (m *LabelConfigurationStatus) MarshalBinary() ([]byte, error) {
	if m == nil {
		return nil, nil
	}
	return swag.WriteJSON(m)
}
508831
func (e encodable) MarshalJSON() ([]byte, error) {
	return Encode(e.E, e.obj)
}
1001694
func (m *PrefilterSpec) MarshalBinary() ([]byte, error) {
	if m == nil {
		return nil, nil
	}
	return swag.WriteJSON(m)
}
878515
func (c Config) MarshalJSON() ([]byte, error) {
	m := map[string]interface{}{
		"version":  c.Version,
		"services": c.Services,
	}

	if len(c.Networks) > 0 {
		m["networks"] = c.Networks
	}
	if len(c.Volumes) > 0 {
		m["volumes"] = c.Volumes
	}
	if len(c.Secrets) > 0 {
		m["secrets"] = c.Secrets
	}
	if len(c.Configs) > 0 {
		m["configs"] = c.Configs
	}
	for k, v := range c.Extras {
		m[k] = v
	}
	return json.Marshal(m)
}
358961
func (b *Builder) MarshalJSON() ([]byte, error) {
	// Avoid recursion
	type Builder_ Builder
	out, _ := json.Marshal(Builder_(*b))

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

	// Flatten Config
	delete(m, "config")
	for k, v := range b.Config {
		out, _ = json.Marshal(v)
		m[k] = out
	}

	return json.Marshal(m)
}