diff --git a/genesyscloud/telephony_providers_edges_phone/resource_genesyscloud_telephony_providers_edges_phone.go b/genesyscloud/telephony_providers_edges_phone/resource_genesyscloud_telephony_providers_edges_phone.go index 648f3f191..54e088882 100644 --- a/genesyscloud/telephony_providers_edges_phone/resource_genesyscloud_telephony_providers_edges_phone.go +++ b/genesyscloud/telephony_providers_edges_phone/resource_genesyscloud_telephony_providers_edges_phone.go @@ -43,10 +43,6 @@ func createPhone(ctx context.Context, d *schema.ResourceData, meta interface{}) if err != nil { return diag.Errorf("failed to create phone %v: %v", *phoneConfig.Name, err) } - _, err = validatePhoneHardwareIdRequirements(phoneConfig) - if err != nil { - return diag.Errorf("failed to create phone %v: %v", *phoneConfig.Name, err) - } log.Printf("Creating phone %s", *phoneConfig.Name) diagErr := util.RetryWhen(util.IsStatus404, func() (*platformclientv2.APIResponse, diag.Diagnostics) { phone, resp, err := pp.createPhone(ctx, phoneConfig) @@ -132,10 +128,6 @@ func updatePhone(ctx context.Context, d *schema.ResourceData, meta interface{}) if err != nil { return diag.Errorf("failed to updated phone %v: %v", *phoneConfig.Name, err) } - _, err = validatePhoneHardwareIdRequirements(phoneConfig) - if err != nil { - return diag.Errorf("failed to updated phone %v: %v", *phoneConfig.Name, err) - } log.Printf("Updating phone %s", *phoneConfig.Name) phone, err := pp.updatePhone(ctx, d.Id(), phoneConfig) if err != nil { diff --git a/genesyscloud/telephony_providers_edges_phone/resource_genesyscloud_telephony_providers_edges_phone_utils.go b/genesyscloud/telephony_providers_edges_phone/resource_genesyscloud_telephony_providers_edges_phone_utils.go index 2af2c59df..382ac62c4 100644 --- a/genesyscloud/telephony_providers_edges_phone/resource_genesyscloud_telephony_providers_edges_phone_utils.go +++ b/genesyscloud/telephony_providers_edges_phone/resource_genesyscloud_telephony_providers_edges_phone_utils.go @@ -382,35 +382,3 @@ func generatePhoneProperties(hardware_id string) string { )))), ) } - -func validatePhoneHardwareIdRequirements(phone *platformclientv2.Phone) (bool, error) { - var ( - hardwareIdType string - hardwareIdValue string - ) - hardwareIdRequiredTypes := map[string]bool{ - "mac": true, - "fqdn": true, - } - - if phone.Capabilities != nil && phone.Capabilities.HardwareIdType != nil { - hardwareIdType = *phone.Capabilities.HardwareIdType - } - - if phone.Properties != nil && (*phone.Properties)["phone_hardwareId"] != nil { - hardwareIdval, exists := (*phone.Properties)["phone_hardwareId"].(map[string]interface{})["value"].(map[string]interface{})["instance"] - if exists { - hardwareIdValue = hardwareIdval.(string) - } - } - - _, exists := hardwareIdRequiredTypes[hardwareIdType] - if exists && len(hardwareIdValue) <= 0 { - return false, fmt.Errorf("hardwareId is required based on the phone capabilities hardwareIdType: %s", hardwareIdType) - } - if (!exists) && len(hardwareIdValue) > 0 { - return false, fmt.Errorf("hardwareId is not required based on the phone capabilities hardwareIdType:%s", hardwareIdType) - } - return true, nil - -}