@@ -10,6 +10,7 @@ import (
1010 "slices"
1111 "time"
1212
13+ "github.com/equinix/terraform-provider-equinix/internal/comparisons"
1314 "github.com/equinix/terraform-provider-equinix/internal/config"
1415 "github.com/equinix/terraform-provider-equinix/internal/converters"
1516 equinix_schema "github.com/equinix/terraform-provider-equinix/internal/schema"
@@ -1343,49 +1344,49 @@ func expandNetworkDeviceSecondary(devices []interface{}) *ne.Device {
13431344 }
13441345 device := devices [0 ].(map [string ]interface {})
13451346 transformed := & ne.Device {}
1346- if v , ok := device [neDeviceSchemaNames ["UUID" ]]; ok && ! isEmpty (v ) {
1347+ if v , ok := device [neDeviceSchemaNames ["UUID" ]]; ok && ! comparisons . IsEmpty (v ) {
13471348 transformed .UUID = ne .String (v .(string ))
13481349 }
1349- if v , ok := device [neDeviceSchemaNames ["Name" ]]; ok && ! isEmpty (v ) {
1350+ if v , ok := device [neDeviceSchemaNames ["Name" ]]; ok && ! comparisons . IsEmpty (v ) {
13501351 transformed .Name = ne .String (v .(string ))
13511352 }
1352- if v , ok := device [neDeviceSchemaNames ["ProjectID" ]]; ok && ! isEmpty (v ) {
1353+ if v , ok := device [neDeviceSchemaNames ["ProjectID" ]]; ok && ! comparisons . IsEmpty (v ) {
13531354 transformed .ProjectID = ne .String (v .(string ))
13541355 }
1355- if v , ok := device [neDeviceSchemaNames ["MetroCode" ]]; ok && ! isEmpty (v ) {
1356+ if v , ok := device [neDeviceSchemaNames ["MetroCode" ]]; ok && ! comparisons . IsEmpty (v ) {
13561357 transformed .MetroCode = ne .String (v .(string ))
13571358 }
1358- if v , ok := device [neDeviceSchemaNames ["HostName" ]]; ok && ! isEmpty (v ) {
1359+ if v , ok := device [neDeviceSchemaNames ["HostName" ]]; ok && ! comparisons . IsEmpty (v ) {
13591360 transformed .HostName = ne .String (v .(string ))
13601361 }
1361- if v , ok := device [neDeviceSchemaNames ["LicenseToken" ]]; ok && ! isEmpty (v ) {
1362+ if v , ok := device [neDeviceSchemaNames ["LicenseToken" ]]; ok && ! comparisons . IsEmpty (v ) {
13621363 transformed .LicenseToken = ne .String (v .(string ))
13631364 }
1364- if v , ok := device [neDeviceSchemaNames ["LicenseFile" ]]; ok && ! isEmpty (v ) {
1365+ if v , ok := device [neDeviceSchemaNames ["LicenseFile" ]]; ok && ! comparisons . IsEmpty (v ) {
13651366 transformed .LicenseFile = ne .String (v .(string ))
13661367 }
1367- if v , ok := device [neDeviceSchemaNames ["LicenseFileID" ]]; ok && ! isEmpty (v ) {
1368+ if v , ok := device [neDeviceSchemaNames ["LicenseFileID" ]]; ok && ! comparisons . IsEmpty (v ) {
13681369 transformed .LicenseFileID = ne .String (v .(string ))
13691370 }
1370- if v , ok := device [neDeviceSchemaNames ["CloudInitFileID" ]]; ok && ! isEmpty (v ) {
1371+ if v , ok := device [neDeviceSchemaNames ["CloudInitFileID" ]]; ok && ! comparisons . IsEmpty (v ) {
13711372 transformed .CloudInitFileID = ne .String (v .(string ))
13721373 }
1373- if v , ok := device [neDeviceSchemaNames ["ACLTemplateUUID" ]]; ok && ! isEmpty (v ) {
1374+ if v , ok := device [neDeviceSchemaNames ["ACLTemplateUUID" ]]; ok && ! comparisons . IsEmpty (v ) {
13741375 transformed .ACLTemplateUUID = ne .String (v .(string ))
13751376 }
1376- if v , ok := device [neDeviceSchemaNames ["MgmtAclTemplateUuid" ]]; ok && ! isEmpty (v ) {
1377+ if v , ok := device [neDeviceSchemaNames ["MgmtAclTemplateUuid" ]]; ok && ! comparisons . IsEmpty (v ) {
13771378 transformed .MgmtAclTemplateUuid = ne .String (v .(string ))
13781379 }
1379- if v , ok := device [neDeviceSchemaNames ["AccountNumber" ]]; ok && ! isEmpty (v ) {
1380+ if v , ok := device [neDeviceSchemaNames ["AccountNumber" ]]; ok && ! comparisons . IsEmpty (v ) {
13801381 transformed .AccountNumber = ne .String (v .(string ))
13811382 }
13821383 if v , ok := device [neDeviceSchemaNames ["Notifications" ]]; ok {
13831384 transformed .Notifications = converters .SetToStringList (v .(* schema.Set ))
13841385 }
1385- if v , ok := device [neDeviceSchemaNames ["AdditionalBandwidth" ]]; ok && ! isEmpty (v ) {
1386+ if v , ok := device [neDeviceSchemaNames ["AdditionalBandwidth" ]]; ok && ! comparisons . IsEmpty (v ) {
13861387 transformed .AdditionalBandwidth = ne .Int (v .(int ))
13871388 }
1388- if v , ok := device [neDeviceSchemaNames ["WanInterfaceId" ]]; ok && ! isEmpty (v ) {
1389+ if v , ok := device [neDeviceSchemaNames ["WanInterfaceId" ]]; ok && ! comparisons . IsEmpty (v ) {
13891390 transformed .WanInterfaceId = ne .String (v .(string ))
13901391 }
13911392 if v , ok := device [neDeviceSchemaNames ["VendorConfiguration" ]]; ok {
@@ -1493,7 +1494,7 @@ func expandNetworkDeviceClusterDetails(clusterDetails []interface{}) *ne.Cluster
14931494 }
14941495 clusterDetail := clusterDetails [0 ].(map [string ]interface {})
14951496 transformed := & ne.ClusterDetails {}
1496- if v , ok := clusterDetail [neDeviceClusterSchemaNames ["ClusterName" ]]; ok && ! isEmpty (v ) {
1497+ if v , ok := clusterDetail [neDeviceClusterSchemaNames ["ClusterName" ]]; ok && ! comparisons . IsEmpty (v ) {
14971498 transformed .ClusterName = ne .String (v .(string ))
14981499 }
14991500 if v , ok := clusterDetail [neDeviceClusterSchemaNames ["Node0" ]]; ok {
@@ -1515,10 +1516,10 @@ func expandNetworkDeviceClusterNodeDetail(clusterNodeDetails []interface{}) *ne.
15151516 if v , ok := clusterNodeDetail [neDeviceClusterNodeSchemaNames ["VendorConfiguration" ]]; ok {
15161517 transformed .VendorConfiguration = expandVendorConfiguration (v .([]interface {}))
15171518 }
1518- if v , ok := clusterNodeDetail [neDeviceClusterNodeSchemaNames ["LicenseFileId" ]]; ok && ! isEmpty (v ) {
1519+ if v , ok := clusterNodeDetail [neDeviceClusterNodeSchemaNames ["LicenseFileId" ]]; ok && ! comparisons . IsEmpty (v ) {
15191520 transformed .LicenseFileId = ne .String (v .(string ))
15201521 }
1521- if v , ok := clusterNodeDetail [neDeviceClusterNodeSchemaNames ["LicenseToken" ]]; ok && ! isEmpty (v ) {
1522+ if v , ok := clusterNodeDetail [neDeviceClusterNodeSchemaNames ["LicenseToken" ]]; ok && ! comparisons . IsEmpty (v ) {
15221523 transformed .LicenseToken = ne .String (v .(string ))
15231524 }
15241525 return transformed
@@ -1531,22 +1532,22 @@ func expandVendorConfiguration(vendorConfigs []interface{}) map[string]string {
15311532 }
15321533 vendorConfig := vendorConfigs [0 ].(map [string ]interface {})
15331534 transformed := make (map [string ]string )
1534- if v , ok := vendorConfig [neDeviceVendorConfigSchemaNames ["Hostname" ]]; ok && ! isEmpty (v ) {
1535+ if v , ok := vendorConfig [neDeviceVendorConfigSchemaNames ["Hostname" ]]; ok && ! comparisons . IsEmpty (v ) {
15351536 transformed ["hostname" ] = v .(string )
15361537 }
1537- if v , ok := vendorConfig [neDeviceVendorConfigSchemaNames ["AdminPassword" ]]; ok && ! isEmpty (v ) {
1538+ if v , ok := vendorConfig [neDeviceVendorConfigSchemaNames ["AdminPassword" ]]; ok && ! comparisons . IsEmpty (v ) {
15381539 transformed ["adminPassword" ] = v .(string )
15391540 }
1540- if v , ok := vendorConfig [neDeviceVendorConfigSchemaNames ["Controller1" ]]; ok && ! isEmpty (v ) {
1541+ if v , ok := vendorConfig [neDeviceVendorConfigSchemaNames ["Controller1" ]]; ok && ! comparisons . IsEmpty (v ) {
15411542 transformed ["controller1" ] = v .(string )
15421543 }
1543- if v , ok := vendorConfig [neDeviceVendorConfigSchemaNames ["ActivationKey" ]]; ok && ! isEmpty (v ) {
1544+ if v , ok := vendorConfig [neDeviceVendorConfigSchemaNames ["ActivationKey" ]]; ok && ! comparisons . IsEmpty (v ) {
15441545 transformed ["activationKey" ] = v .(string )
15451546 }
1546- if v , ok := vendorConfig [neDeviceVendorConfigSchemaNames ["ControllerFqdn" ]]; ok && ! isEmpty (v ) {
1547+ if v , ok := vendorConfig [neDeviceVendorConfigSchemaNames ["ControllerFqdn" ]]; ok && ! comparisons . IsEmpty (v ) {
15471548 transformed ["controllerFqdn" ] = v .(string )
15481549 }
1549- if v , ok := vendorConfig [neDeviceVendorConfigSchemaNames ["RootPassword" ]]; ok && ! isEmpty (v ) {
1550+ if v , ok := vendorConfig [neDeviceVendorConfigSchemaNames ["RootPassword" ]]; ok && ! comparisons . IsEmpty (v ) {
15501551 transformed ["rootPassword" ] = v .(string )
15511552 }
15521553 return transformed
0 commit comments