in tfplan2cai/converters/google/resources/services/netapp/netapp_storage_pool.go [57:145]
func GetNetappStoragePoolApiObject(d tpgresource.TerraformResourceData, config *transport_tpg.Config) (map[string]interface{}, error) {
obj := make(map[string]interface{})
serviceLevelProp, err := expandNetappStoragePoolServiceLevel(d.Get("service_level"), d, config)
if err != nil {
return nil, err
} else if v, ok := d.GetOkExists("service_level"); !tpgresource.IsEmptyValue(reflect.ValueOf(serviceLevelProp)) && (ok || !reflect.DeepEqual(v, serviceLevelProp)) {
obj["serviceLevel"] = serviceLevelProp
}
capacityGibProp, err := expandNetappStoragePoolCapacityGib(d.Get("capacity_gib"), d, config)
if err != nil {
return nil, err
} else if v, ok := d.GetOkExists("capacity_gib"); !tpgresource.IsEmptyValue(reflect.ValueOf(capacityGibProp)) && (ok || !reflect.DeepEqual(v, capacityGibProp)) {
obj["capacityGib"] = capacityGibProp
}
descriptionProp, err := expandNetappStoragePoolDescription(d.Get("description"), d, config)
if err != nil {
return nil, err
} else if v, ok := d.GetOkExists("description"); !tpgresource.IsEmptyValue(reflect.ValueOf(descriptionProp)) && (ok || !reflect.DeepEqual(v, descriptionProp)) {
obj["description"] = descriptionProp
}
networkProp, err := expandNetappStoragePoolNetwork(d.Get("network"), d, config)
if err != nil {
return nil, err
} else if v, ok := d.GetOkExists("network"); !tpgresource.IsEmptyValue(reflect.ValueOf(networkProp)) && (ok || !reflect.DeepEqual(v, networkProp)) {
obj["network"] = networkProp
}
activeDirectoryProp, err := expandNetappStoragePoolActiveDirectory(d.Get("active_directory"), d, config)
if err != nil {
return nil, err
} else if v, ok := d.GetOkExists("active_directory"); !tpgresource.IsEmptyValue(reflect.ValueOf(activeDirectoryProp)) && (ok || !reflect.DeepEqual(v, activeDirectoryProp)) {
obj["activeDirectory"] = activeDirectoryProp
}
kmsConfigProp, err := expandNetappStoragePoolKmsConfig(d.Get("kms_config"), d, config)
if err != nil {
return nil, err
} else if v, ok := d.GetOkExists("kms_config"); !tpgresource.IsEmptyValue(reflect.ValueOf(kmsConfigProp)) && (ok || !reflect.DeepEqual(v, kmsConfigProp)) {
obj["kmsConfig"] = kmsConfigProp
}
ldapEnabledProp, err := expandNetappStoragePoolLdapEnabled(d.Get("ldap_enabled"), d, config)
if err != nil {
return nil, err
} else if v, ok := d.GetOkExists("ldap_enabled"); !tpgresource.IsEmptyValue(reflect.ValueOf(ldapEnabledProp)) && (ok || !reflect.DeepEqual(v, ldapEnabledProp)) {
obj["ldapEnabled"] = ldapEnabledProp
}
zoneProp, err := expandNetappStoragePoolZone(d.Get("zone"), d, config)
if err != nil {
return nil, err
} else if v, ok := d.GetOkExists("zone"); !tpgresource.IsEmptyValue(reflect.ValueOf(zoneProp)) && (ok || !reflect.DeepEqual(v, zoneProp)) {
obj["zone"] = zoneProp
}
replicaZoneProp, err := expandNetappStoragePoolReplicaZone(d.Get("replica_zone"), d, config)
if err != nil {
return nil, err
} else if v, ok := d.GetOkExists("replica_zone"); !tpgresource.IsEmptyValue(reflect.ValueOf(replicaZoneProp)) && (ok || !reflect.DeepEqual(v, replicaZoneProp)) {
obj["replicaZone"] = replicaZoneProp
}
allowAutoTieringProp, err := expandNetappStoragePoolAllowAutoTiering(d.Get("allow_auto_tiering"), d, config)
if err != nil {
return nil, err
} else if v, ok := d.GetOkExists("allow_auto_tiering"); !tpgresource.IsEmptyValue(reflect.ValueOf(allowAutoTieringProp)) && (ok || !reflect.DeepEqual(v, allowAutoTieringProp)) {
obj["allowAutoTiering"] = allowAutoTieringProp
}
customPerformanceEnabledProp, err := expandNetappStoragePoolCustomPerformanceEnabled(d.Get("custom_performance_enabled"), d, config)
if err != nil {
return nil, err
} else if v, ok := d.GetOkExists("custom_performance_enabled"); !tpgresource.IsEmptyValue(reflect.ValueOf(customPerformanceEnabledProp)) && (ok || !reflect.DeepEqual(v, customPerformanceEnabledProp)) {
obj["customPerformanceEnabled"] = customPerformanceEnabledProp
}
totalThroughputMibpsProp, err := expandNetappStoragePoolTotalThroughputMibps(d.Get("total_throughput_mibps"), d, config)
if err != nil {
return nil, err
} else if v, ok := d.GetOkExists("total_throughput_mibps"); !tpgresource.IsEmptyValue(reflect.ValueOf(totalThroughputMibpsProp)) && (ok || !reflect.DeepEqual(v, totalThroughputMibpsProp)) {
obj["totalThroughputMibps"] = totalThroughputMibpsProp
}
totalIopsProp, err := expandNetappStoragePoolTotalIops(d.Get("total_iops"), d, config)
if err != nil {
return nil, err
} else if v, ok := d.GetOkExists("total_iops"); !tpgresource.IsEmptyValue(reflect.ValueOf(totalIopsProp)) && (ok || !reflect.DeepEqual(v, totalIopsProp)) {
obj["totalIops"] = totalIopsProp
}
labelsProp, err := expandNetappStoragePoolEffectiveLabels(d.Get("effective_labels"), d, config)
if err != nil {
return nil, err
} else if v, ok := d.GetOkExists("effective_labels"); !tpgresource.IsEmptyValue(reflect.ValueOf(labelsProp)) && (ok || !reflect.DeepEqual(v, labelsProp)) {
obj["labels"] = labelsProp
}
return obj, nil
}