@@ -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"
@@ -1403,49 +1404,49 @@ func expandNetworkDeviceSecondary(devices []interface{}) *ne.Device {
14031404 }
14041405 device := devices [0 ].(map [string ]interface {})
14051406 transformed := & ne.Device {}
1406- if v , ok := device [neDeviceSchemaNames ["UUID" ]]; ok && ! isEmpty (v ) {
1407+ if v , ok := device [neDeviceSchemaNames ["UUID" ]]; ok && ! comparisons . IsEmpty (v ) {
14071408 transformed .UUID = ne .String (v .(string ))
14081409 }
1409- if v , ok := device [neDeviceSchemaNames ["Name" ]]; ok && ! isEmpty (v ) {
1410+ if v , ok := device [neDeviceSchemaNames ["Name" ]]; ok && ! comparisons . IsEmpty (v ) {
14101411 transformed .Name = ne .String (v .(string ))
14111412 }
1412- if v , ok := device [neDeviceSchemaNames ["ProjectID" ]]; ok && ! isEmpty (v ) {
1413+ if v , ok := device [neDeviceSchemaNames ["ProjectID" ]]; ok && ! comparisons . IsEmpty (v ) {
14131414 transformed .ProjectID = ne .String (v .(string ))
14141415 }
1415- if v , ok := device [neDeviceSchemaNames ["MetroCode" ]]; ok && ! isEmpty (v ) {
1416+ if v , ok := device [neDeviceSchemaNames ["MetroCode" ]]; ok && ! comparisons . IsEmpty (v ) {
14161417 transformed .MetroCode = ne .String (v .(string ))
14171418 }
1418- if v , ok := device [neDeviceSchemaNames ["HostName" ]]; ok && ! isEmpty (v ) {
1419+ if v , ok := device [neDeviceSchemaNames ["HostName" ]]; ok && ! comparisons . IsEmpty (v ) {
14191420 transformed .HostName = ne .String (v .(string ))
14201421 }
1421- if v , ok := device [neDeviceSchemaNames ["LicenseToken" ]]; ok && ! isEmpty (v ) {
1422+ if v , ok := device [neDeviceSchemaNames ["LicenseToken" ]]; ok && ! comparisons . IsEmpty (v ) {
14221423 transformed .LicenseToken = ne .String (v .(string ))
14231424 }
1424- if v , ok := device [neDeviceSchemaNames ["LicenseFile" ]]; ok && ! isEmpty (v ) {
1425+ if v , ok := device [neDeviceSchemaNames ["LicenseFile" ]]; ok && ! comparisons . IsEmpty (v ) {
14251426 transformed .LicenseFile = ne .String (v .(string ))
14261427 }
1427- if v , ok := device [neDeviceSchemaNames ["LicenseFileID" ]]; ok && ! isEmpty (v ) {
1428+ if v , ok := device [neDeviceSchemaNames ["LicenseFileID" ]]; ok && ! comparisons . IsEmpty (v ) {
14281429 transformed .LicenseFileID = ne .String (v .(string ))
14291430 }
1430- if v , ok := device [neDeviceSchemaNames ["CloudInitFileID" ]]; ok && ! isEmpty (v ) {
1431+ if v , ok := device [neDeviceSchemaNames ["CloudInitFileID" ]]; ok && ! comparisons . IsEmpty (v ) {
14311432 transformed .CloudInitFileID = ne .String (v .(string ))
14321433 }
1433- if v , ok := device [neDeviceSchemaNames ["ACLTemplateUUID" ]]; ok && ! isEmpty (v ) {
1434+ if v , ok := device [neDeviceSchemaNames ["ACLTemplateUUID" ]]; ok && ! comparisons . IsEmpty (v ) {
14341435 transformed .ACLTemplateUUID = ne .String (v .(string ))
14351436 }
1436- if v , ok := device [neDeviceSchemaNames ["MgmtAclTemplateUuid" ]]; ok && ! isEmpty (v ) {
1437+ if v , ok := device [neDeviceSchemaNames ["MgmtAclTemplateUuid" ]]; ok && ! comparisons . IsEmpty (v ) {
14371438 transformed .MgmtAclTemplateUuid = ne .String (v .(string ))
14381439 }
1439- if v , ok := device [neDeviceSchemaNames ["AccountNumber" ]]; ok && ! isEmpty (v ) {
1440+ if v , ok := device [neDeviceSchemaNames ["AccountNumber" ]]; ok && ! comparisons . IsEmpty (v ) {
14401441 transformed .AccountNumber = ne .String (v .(string ))
14411442 }
14421443 if v , ok := device [neDeviceSchemaNames ["Notifications" ]]; ok {
14431444 transformed .Notifications = converters .SetToStringList (v .(* schema.Set ))
14441445 }
1445- if v , ok := device [neDeviceSchemaNames ["AdditionalBandwidth" ]]; ok && ! isEmpty (v ) {
1446+ if v , ok := device [neDeviceSchemaNames ["AdditionalBandwidth" ]]; ok && ! comparisons . IsEmpty (v ) {
14461447 transformed .AdditionalBandwidth = ne .Int (v .(int ))
14471448 }
1448- if v , ok := device [neDeviceSchemaNames ["WanInterfaceId" ]]; ok && ! isEmpty (v ) {
1449+ if v , ok := device [neDeviceSchemaNames ["WanInterfaceId" ]]; ok && ! comparisons . IsEmpty (v ) {
14491450 transformed .WanInterfaceId = ne .String (v .(string ))
14501451 }
14511452 if v , ok := device [neDeviceSchemaNames ["VendorConfiguration" ]]; ok {
@@ -1574,7 +1575,7 @@ func expandNetworkDeviceClusterDetails(clusterDetails []interface{}) *ne.Cluster
15741575 }
15751576 clusterDetail := clusterDetails [0 ].(map [string ]interface {})
15761577 transformed := & ne.ClusterDetails {}
1577- if v , ok := clusterDetail [neDeviceClusterSchemaNames ["ClusterName" ]]; ok && ! isEmpty (v ) {
1578+ if v , ok := clusterDetail [neDeviceClusterSchemaNames ["ClusterName" ]]; ok && ! comparisons . IsEmpty (v ) {
15781579 transformed .ClusterName = ne .String (v .(string ))
15791580 }
15801581 if v , ok := clusterDetail [neDeviceClusterSchemaNames ["Node0" ]]; ok {
@@ -1596,10 +1597,10 @@ func expandNetworkDeviceClusterNodeDetail(clusterNodeDetails []interface{}) *ne.
15961597 if v , ok := clusterNodeDetail [neDeviceClusterNodeSchemaNames ["VendorConfiguration" ]]; ok {
15971598 transformed .VendorConfiguration = expandVendorConfiguration (v .([]interface {}))
15981599 }
1599- if v , ok := clusterNodeDetail [neDeviceClusterNodeSchemaNames ["LicenseFileId" ]]; ok && ! isEmpty (v ) {
1600+ if v , ok := clusterNodeDetail [neDeviceClusterNodeSchemaNames ["LicenseFileId" ]]; ok && ! comparisons . IsEmpty (v ) {
16001601 transformed .LicenseFileId = ne .String (v .(string ))
16011602 }
1602- if v , ok := clusterNodeDetail [neDeviceClusterNodeSchemaNames ["LicenseToken" ]]; ok && ! isEmpty (v ) {
1603+ if v , ok := clusterNodeDetail [neDeviceClusterNodeSchemaNames ["LicenseToken" ]]; ok && ! comparisons . IsEmpty (v ) {
16031604 transformed .LicenseToken = ne .String (v .(string ))
16041605 }
16051606 return transformed
@@ -1612,22 +1613,22 @@ func expandVendorConfiguration(vendorConfigs []interface{}) map[string]string {
16121613 }
16131614 vendorConfig := vendorConfigs [0 ].(map [string ]interface {})
16141615 transformed := make (map [string ]string )
1615- if v , ok := vendorConfig [neDeviceVendorConfigSchemaNames ["Hostname" ]]; ok && ! isEmpty (v ) {
1616+ if v , ok := vendorConfig [neDeviceVendorConfigSchemaNames ["Hostname" ]]; ok && ! comparisons . IsEmpty (v ) {
16161617 transformed ["hostname" ] = v .(string )
16171618 }
1618- if v , ok := vendorConfig [neDeviceVendorConfigSchemaNames ["AdminPassword" ]]; ok && ! isEmpty (v ) {
1619+ if v , ok := vendorConfig [neDeviceVendorConfigSchemaNames ["AdminPassword" ]]; ok && ! comparisons . IsEmpty (v ) {
16191620 transformed ["adminPassword" ] = v .(string )
16201621 }
1621- if v , ok := vendorConfig [neDeviceVendorConfigSchemaNames ["Controller1" ]]; ok && ! isEmpty (v ) {
1622+ if v , ok := vendorConfig [neDeviceVendorConfigSchemaNames ["Controller1" ]]; ok && ! comparisons . IsEmpty (v ) {
16221623 transformed ["controller1" ] = v .(string )
16231624 }
1624- if v , ok := vendorConfig [neDeviceVendorConfigSchemaNames ["ActivationKey" ]]; ok && ! isEmpty (v ) {
1625+ if v , ok := vendorConfig [neDeviceVendorConfigSchemaNames ["ActivationKey" ]]; ok && ! comparisons . IsEmpty (v ) {
16251626 transformed ["activationKey" ] = v .(string )
16261627 }
1627- if v , ok := vendorConfig [neDeviceVendorConfigSchemaNames ["ControllerFqdn" ]]; ok && ! isEmpty (v ) {
1628+ if v , ok := vendorConfig [neDeviceVendorConfigSchemaNames ["ControllerFqdn" ]]; ok && ! comparisons . IsEmpty (v ) {
16281629 transformed ["controllerFqdn" ] = v .(string )
16291630 }
1630- if v , ok := vendorConfig [neDeviceVendorConfigSchemaNames ["RootPassword" ]]; ok && ! isEmpty (v ) {
1631+ if v , ok := vendorConfig [neDeviceVendorConfigSchemaNames ["RootPassword" ]]; ok && ! comparisons . IsEmpty (v ) {
16311632 transformed ["rootPassword" ] = v .(string )
16321633 }
16331634 if v , ok := vendorConfig [neDeviceVendorConfigSchemaNames ["PrivateAddress" ]]; ok && ! isEmpty (v ) {
0 commit comments