// FromConfig creates the copy struct based on the provided config data
FromConfig creates the copy struct based on the provided config data
// FromConfig creates the copy struct based on the provided config data
func (copy *Copy) FromConfig(stepConfig map[string]interface{}) error {
	copy.Kind = KindCopy
	if description, ok := stepConfig["Description"].(string); ok {
		copy.Description = description
	}
	if preferencesYaml, ok := stepConfig["Preferences"].(map[string]interface{}); ok {
		if source, ok := preferencesYaml["Source"].(string); ok {
			copy.Source = source
		} else {
			return fmt.Errorf("preference \"Source\" (string) must be set for %s step", copy.GetKind())
		}
		if destination, ok := preferencesYaml["Destination"].(string); ok {
			copy.Destination = destination
		} else {
			return fmt.Errorf("preference \"Destination\" (string) must be set for %s step", copy.GetKind())
		}
	} else {
		return fmt.Errorf("preferences must be set for %s step", copy.GetKind())
	}
	return nil
}
func ( copy * Copy ) FromConfig ( stepConfig map [ string ] interface { } ) error { copy . Kind = KindCopy if description , ok := stepConfig [ " " ] . ( string ) ; ok { copy . Description = description } if preferencesYaml , ok := stepConfig [ " " ] . ( map [ string ] interface { } ) ; ok { if source , ok := preferencesYaml [ " " ] . ( string ) ; ok { copy . Source = source } else { return fmt . Errorf ( " \" \" " , copy . GetKind ( ) ) } if destination , ok := preferencesYaml [ " " ] . ( string ) ; ok { copy . Destination = destination } else { return fmt . Errorf ( " \" \" " , copy . GetKind ( ) ) } } else { return fmt . Errorf ( " " , copy . GetKind ( ) ) } return nil }
FromConfig creates the copy struct based on the provided config data
FromConfig creates the copy struct based on the provided config data
// Read source preference // Read destination preference