vsphere/resource_vsphere_datastore_cluster.go
func flattenStorageDrsAutomationConfig(d *schema.ResourceData, obj *types.StorageDrsAutomationConfig) error {
	attrs := map[string]interface{}{
		"sdrs_io_balance_automation_level":         obj.IoLoadBalanceAutomationMode,
		"sdrs_policy_enforcement_automation_level": obj.PolicyEnforcementAutomationMode,
		"sdrs_rule_enforcement_automation_level":   obj.RuleEnforcementAutomationMode,
		"sdrs_space_balance_automation_level":      obj.SpaceLoadBalanceAutomationMode,
		"sdrs_vm_evacuation_automation_level":      obj.VmEvacuationAutomationMode,
	}
	for k, v := range attrs {
		if err := d.Set(k, v); err != nil {
			return fmt.Errorf("error setting attribute %q: %s", k, err)
		}
	}
	return nil
}
func flattenStorageDrsAutomationConfig(d *schema.ResourceData, obj *types.StorageDrsAutomationConfig) error {
	attrs := map[string]interface{}{
		"sdrs_io_balance_automation_level":         obj.IoLoadBalanceAutomationMode,
		"sdrs_policy_enforcement_automation_level": obj.PolicyEnforcementAutomationMode,
		"sdrs_rule_enforcement_automation_level":   obj.RuleEnforcementAutomationMode,
		"sdrs_space_balance_automation_level":      obj.SpaceLoadBalanceAutomationMode,
		"sdrs_vm_evacuation_automation_level":      obj.VmEvacuationAutomationMode,
	}
	for k, v := range attrs {
		if err := d.Set(k, v); err != nil {
			return fmt.Errorf("error setting attribute %q: %s", k, err)
		}
	}
	return nil
}
func flattenStorageDrsAutomationConfig ( d * schema . ResourceData , obj * types . StorageDrsAutomationConfig ) error { attrs := map [ string ] interface { } { " " : obj . IoLoadBalanceAutomationMode , " " : obj . PolicyEnforcementAutomationMode , " " : obj . RuleEnforcementAutomationMode , " " : obj . SpaceLoadBalanceAutomationMode , " " : obj . VmEvacuationAutomationMode , } for k , v := range attrs { if err := d . Set ( k , v ) ; err != nil { return fmt . Errorf ( " " , k , err ) } } return nil }
// flattenStorageDrsAutomationConfig saves a StorageDrsAutomationConfig into
// the supplied ResourceData.
flattenStorageDrsAutomationConfig saves a StorageDrsAutomationConfig into the supplied ResourceData .