code: func (n *Networks) UnmarshalYAML(unmarshal func(interface{}) error) error {
  	var sliceType []interface{}
  	if err := unmarshal(&sliceType); err == nil {
  		n.Networks = []*Network{}
  		for _, network := range sliceType {
  			name, ok := network.(string)
  			if !ok {
  				return fmt.Errorf("Cannot unmarshal '%v' to type %T into a string value", name, name)
  			}
  			n.Networks = append(n.Networks, &Network{
  				Name: name,
  			})
  		}
  		return nil
  	}
  
  	var mapType map[interface{}]interface{}
  	if err := unmarshal(&mapType); err == nil {
  		n.Networks = []*Network{}
  		for mapKey, mapValue := range mapType {
  			name, ok := mapKey.(string)
  			if !ok {
  				return fmt.Errorf("Cannot unmarshal '%v' to type %T into a string value", name, name)
  			}
  			network, err := handleNetwork(name, mapValue)
  			if err != nil {
  				return err
  			}
  			n.Networks = append(n.Networks, network)
  		}
  		return nil
  	}
  
  	return errors.New("Failed to unmarshal Networks")
  }
docs: // UnmarshalYAML implements the Unmarshaller interface.