// MarshalYAML implements the yaml.Marshaler interface for URLs.
161754
func (u URL) MarshalYAML() (interface{}, error) {
	if u.URL != nil {
		return u.String(), nil
	}
	return nil, nil
}
270177
func (n Networks) MarshalYAML() (interface{}, error) {
	m := map[string]*Network{}
	for _, network := range n.Networks {
		m[network.Name] = network
	}
	return m, nil
}
863008
func (arn ARN) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
	return e.EncodeElement(arn.String(), start)
}
831589
func (v Values) YAML() (string, error) {
	b, err := yaml.Marshal(v)
	return string(b), err
}
942150
func (f *QueryStringFilter) MarshalJSON() ([]byte, error) {
	root := map[string]interface{}{
		"query_string": map[string]interface{}{
			"query":            f.Query,
			"analyze_wildcard": f.AnalyzeWildcard,
		},
	}

	return json.Marshal(root)
}
239381
func (mmap MarshalMap) Bool(key string) (bool, error) {
	val, exists := mmap.Value(key)
	if !exists {
		return false, fmt.Errorf(`"%s" is not set`, key)
	}

	boolValue, isBool := val.(bool)
	if !isBool {
		return false, fmt.Errorf(`"%s" is expected to be a boolean`, key)
	}
	return boolValue, nil
}
1190442
func (u Ulimit) MarshalYAML() (interface{}, error) {
	if u.Soft == u.Hard {
		return u.Soft, nil
	}
	return u.ulimitValues, nil
}
676842
func (c Config) MarshalTOML() (interface{}, error) {
	type Config struct {
		Genesis                 *core.Genesis `toml:",omitempty"`
		NetworkId               uint64
		SyncMode                downloader.SyncMode
		NoPruning               bool
		NoPrefetch              bool
		Whitelist               map[uint64]common.Hash `toml:"-"`
		LightServ               int                    `toml:",omitempty"`
		LightBandwidthIn        int                    `toml:",omitempty"`
		LightBandwidthOut       int                    `toml:",omitempty"`
		LightPeers              int                    `toml:",omitempty"`
		OnlyAnnounce            bool
		ULC                     *ULCConfig `toml:",omitempty"`
		SkipBcVersionCheck      bool       `toml:"-"`
		DatabaseHandles         int        `toml:"-"`
		DatabaseCache           int
		TrieCleanCache          int
		TrieDirtyCache          int
		TrieTimeout             time.Duration
		Miner                   miner.Config
		Ethash                  ethash.Config
		TxPool                  core.TxPoolConfig
		GPO                     gasprice.Config
		EnablePreimageRecording bool
		DocRoot                 string `toml:"-"`
		EWASMInterpreter        string
		EVMInterpreter          string
		ConstantinopleOverride  *big.Int
		RPCGasCap               *big.Int `toml:",omitempty"`
	}
	var enc Config
	enc.Genesis = c.Genesis
	enc.NetworkId = c.NetworkId
	enc.SyncMode = c.SyncMode
	enc.NoPruning = c.NoPruning
	enc.NoPrefetch = c.NoPrefetch
	enc.Whitelist = c.Whitelist
	enc.LightServ = c.LightServ
	enc.LightBandwidthIn = c.LightBandwidthIn
	enc.LightBandwidthOut = c.LightBandwidthOut
	enc.LightPeers = c.LightPeers
	enc.OnlyAnnounce = c.OnlyAnnounce
	enc.ULC = c.ULC
	enc.SkipBcVersionCheck = c.SkipBcVersionCheck
	enc.DatabaseHandles = c.DatabaseHandles
	enc.DatabaseCache = c.DatabaseCache
	enc.TrieCleanCache = c.TrieCleanCache
	enc.TrieDirtyCache = c.TrieDirtyCache
	enc.TrieTimeout = c.TrieTimeout
	enc.Miner = c.Miner
	enc.Ethash = c.Ethash
	enc.TxPool = c.TxPool
	enc.GPO = c.GPO
	enc.EnablePreimageRecording = c.EnablePreimageRecording
	enc.DocRoot = c.DocRoot
	enc.EWASMInterpreter = c.EWASMInterpreter
	enc.EVMInterpreter = c.EVMInterpreter
	enc.ConstantinopleOverride = c.ConstantinopleOverride
	enc.RPCGasCap = c.RPCGasCap
	return &enc, nil
}
186061
func (h Hash) MarshalBinary() (data []byte, err error) {
	if h == (Hash{}) {
		return nil, nil
	}

	if !h.IsValid() {
		return nil, errors.WithStack(InvalidHashError{h})
	}

	return []byte(h.h), nil
}
219658
func (s Strings) MarshalYAML() (interface{}, error) {
	if len(s) == 1 {
		return s[0], nil
	}
	return []string(s), nil
}
457627
func (m *IPAMResponse) MarshalBinary() ([]byte, error) {
	if m == nil {
		return nil, nil
	}
	return swag.WriteJSON(m)
}
1182124
func (u URL) MarshalBinary() ([]byte, error) {
	uu := url.URL(u)
	return []byte(uu.String()), nil
}
331001
func marshalYaml(obj runtime.Object) ([]byte, error) {
	y, err := kopscodecs.ToVersionedYaml(obj)
	if err != nil {
		return nil, fmt.Errorf("error marshaling yaml: %v", err)
	}
	return y, nil
}
2616
func (n *External) UnmarshalYAML(unmarshal func(interface{}) error) error {
	if err := unmarshal(&n.External); err == nil {
		return nil
	}
	var dummyExternal struct {
		Name string
	}

	err := unmarshal(&dummyExternal)
	if err != nil {
		return err
	}
	n.Name = dummyExternal.Name
	n.External = true

	return nil
}
266724
func (auth Auth) MarshalYAML() (interface{}, error) {
	if auth.Parameters() == nil {
		return auth.Type(), nil
	}
	return map[string]Parameters(auth), nil
}
310208
func (*yamlMarshaller) Unmarshal(data []byte, v interface{}) error {
	return yaml.Unmarshal(data, v)
}
368292
func MarshalLocalYAMLFile(path string, obj interface{}) error {
	yamlData, err := yaml.Marshal(obj)
	if err == nil {
		err = ioutil.WriteFile(path, yamlData, 0600)
	}
	return err
}