From f2c807a88228722ba95183cd5963710e0b0676c2 Mon Sep 17 00:00:00 2001 From: Vikrant Balyan Date: Mon, 14 Mar 2022 14:03:30 +0530 Subject: [PATCH] refreshing the provider for intersight version 5517 (#185) --- CHANGELOG.md | 3 + GNUmakefile | 2 +- examples/sample_modules/os_install/main.tf | 2 +- .../server_configurations/main.tf | 2 +- .../sample_modules/server_deployment/main.tf | 2 +- intersight/flatten_functions_test.go | 2764 ++++++++--------- .../resource_intersight_server_profile.go | 1 + tests/common/main.tf | 2 +- tests/data_sources/main.tf | 2 +- tests/iks/main.tf | 2 +- tests/only_post/main.tf | 2 +- tests/server_configurations/main.tf | 2 +- website/docs/r/asset_target.html.markdown | 24 +- ...workflow_workflow_definition.html.markdown | 182 +- 14 files changed, 1498 insertions(+), 1494 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 685532763a..9d8716618d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Change Logs +## v1.0.25 +* Refreshes the terraform module to be in sync with the latest Cisco Intersight model (build 5517) + ## v1.0.24 * Refreshes the terraform module to be in sync with the latest Cisco Intersight model (build 5517) diff --git a/GNUmakefile b/GNUmakefile index 249b7f9ae6..532fb7f401 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -1,5 +1,5 @@ PKG_NAME=intersight -VERSION=1.0.24 +VERSION=1.0.25 TEST?=$$(go list ./... |grep -v 'vendor') GOFMT_FILES?=$$(find . -name '*.go' |grep -v vendor) WEBSITE_REPO=github.com/hashicorp/terraform-website diff --git a/examples/sample_modules/os_install/main.tf b/examples/sample_modules/os_install/main.tf index d5e09ad7c4..0f1bc3154e 100644 --- a/examples/sample_modules/os_install/main.tf +++ b/examples/sample_modules/os_install/main.tf @@ -2,7 +2,7 @@ terraform { required_providers { intersight = { source = "CiscoDevNet/intersight" - version = "1.0.24" + version = "1.0.25" } } } diff --git a/examples/sample_modules/server_configurations/main.tf b/examples/sample_modules/server_configurations/main.tf index 8e60085c24..d53be1b264 100644 --- a/examples/sample_modules/server_configurations/main.tf +++ b/examples/sample_modules/server_configurations/main.tf @@ -2,7 +2,7 @@ terraform { required_providers { intersight = { source = "CiscoDevNet/intersight" - version = "1.0.24" + version = "1.0.25" } } } diff --git a/examples/sample_modules/server_deployment/main.tf b/examples/sample_modules/server_deployment/main.tf index 698cdc1b06..00fe3cefea 100644 --- a/examples/sample_modules/server_deployment/main.tf +++ b/examples/sample_modules/server_deployment/main.tf @@ -2,7 +2,7 @@ terraform { required_providers { intersight = { source = "CiscoDevNet/intersight" - version = "1.0.24" + version = "1.0.25" } } } diff --git a/intersight/flatten_functions_test.go b/intersight/flatten_functions_test.go index 0d68d6b6d2..a741083942 100644 --- a/intersight/flatten_functions_test.go +++ b/intersight/flatten_functions_test.go @@ -56,7 +56,7 @@ func CheckError(t *testing.T, e error) { func TestFlattenListAdapterAdapterConfig(t *testing.T) { p := []models.AdapterAdapterConfig{} var d = &schema.ResourceData{} - c := `{"ObjectType":"adapter.AdapterConfig","SlotId":"SlotId %d","ClassId":"adapter.AdapterConfig"}` + c := `{"SlotId":"SlotId %d","ObjectType":"adapter.AdapterConfig","ClassId":"adapter.AdapterConfig"}` //test when the response is empty ffOpEmpty := flattenListAdapterAdapterConfig(p, d) @@ -71,7 +71,7 @@ func TestFlattenListAdapterAdapterConfig(t *testing.T) { p = append(p, x) } ffOp := flattenListAdapterAdapterConfig(p, d) - expectedOp := []map[string]interface{}{{"object_type": "adapter.AdapterConfig", "slot_id": "SlotId 1", "class_id": "adapter.AdapterConfig"}, {"object_type": "adapter.AdapterConfig", "slot_id": "SlotId 2", "class_id": "adapter.AdapterConfig"}} + expectedOp := []map[string]interface{}{{"slot_id": "SlotId 1", "object_type": "adapter.AdapterConfig", "class_id": "adapter.AdapterConfig"}, {"slot_id": "SlotId 2", "object_type": "adapter.AdapterConfig", "class_id": "adapter.AdapterConfig"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -104,7 +104,7 @@ func TestFlattenListAdapterExtEthInterfaceRelationship(t *testing.T) { func TestFlattenListAdapterHostEthInterfaceRelationship(t *testing.T) { p := []models.AdapterHostEthInterfaceRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenListAdapterHostEthInterfaceRelationship(p, d) @@ -119,7 +119,7 @@ func TestFlattenListAdapterHostEthInterfaceRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListAdapterHostEthInterfaceRelationship(p, d) - expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} + expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -128,7 +128,7 @@ func TestFlattenListAdapterHostEthInterfaceRelationship(t *testing.T) { func TestFlattenListAdapterHostFcInterfaceRelationship(t *testing.T) { p := []models.AdapterHostFcInterfaceRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenListAdapterHostFcInterfaceRelationship(p, d) @@ -143,7 +143,7 @@ func TestFlattenListAdapterHostFcInterfaceRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListAdapterHostFcInterfaceRelationship(p, d) - expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} + expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -152,7 +152,7 @@ func TestFlattenListAdapterHostFcInterfaceRelationship(t *testing.T) { func TestFlattenListAdapterHostIscsiInterfaceRelationship(t *testing.T) { p := []models.AdapterHostIscsiInterfaceRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListAdapterHostIscsiInterfaceRelationship(p, d) @@ -167,7 +167,7 @@ func TestFlattenListAdapterHostIscsiInterfaceRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListAdapterHostIscsiInterfaceRelationship(p, d) - expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"}, {"object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -176,7 +176,7 @@ func TestFlattenListAdapterHostIscsiInterfaceRelationship(t *testing.T) { func TestFlattenListAdapterUnitRelationship(t *testing.T) { p := []models.AdapterUnitRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListAdapterUnitRelationship(p, d) @@ -191,7 +191,7 @@ func TestFlattenListAdapterUnitRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListAdapterUnitRelationship(p, d) - expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"}, {"object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -200,7 +200,7 @@ func TestFlattenListAdapterUnitRelationship(t *testing.T) { func TestFlattenListApplianceApiStatus(t *testing.T) { p := []models.ApplianceApiStatus{} var d = &schema.ResourceData{} - c := `{"ObjectType":"appliance.ApiStatus","ClassId":"appliance.ApiStatus","Reason":"Reason %d","Response":32,"ElapsedTime":32.000000,"ObjectName":"ObjectName %d"}` + c := `{"ObjectType":"appliance.ApiStatus","ClassId":"appliance.ApiStatus","Response":32,"ElapsedTime":32.000000,"ObjectName":"ObjectName %d","Reason":"Reason %d"}` //test when the response is empty ffOpEmpty := flattenListApplianceApiStatus(p, d) @@ -215,7 +215,7 @@ func TestFlattenListApplianceApiStatus(t *testing.T) { p = append(p, x) } ffOp := flattenListApplianceApiStatus(p, d) - expectedOp := []map[string]interface{}{{"object_type": "appliance.ApiStatus", "class_id": "appliance.ApiStatus", "reason": "Reason 1", "response": 32, "elapsed_time": 32.000000, "object_name": "ObjectName 1"}, {"object_type": "appliance.ApiStatus", "class_id": "appliance.ApiStatus", "reason": "Reason 2", "response": 32, "elapsed_time": 32.000000, "object_name": "ObjectName 2"}} + expectedOp := []map[string]interface{}{{"object_type": "appliance.ApiStatus", "class_id": "appliance.ApiStatus", "response": 32, "elapsed_time": 32.000000, "object_name": "ObjectName 1", "reason": "Reason 1"}, {"object_type": "appliance.ApiStatus", "class_id": "appliance.ApiStatus", "response": 32, "elapsed_time": 32.000000, "object_name": "ObjectName 2", "reason": "Reason 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -248,7 +248,7 @@ func TestFlattenListApplianceAppStatusRelationship(t *testing.T) { func TestFlattenListApplianceCertRenewalPhase(t *testing.T) { p := []models.ApplianceCertRenewalPhase{} var d = &schema.ResourceData{} - c := `{"Name":"Name %d","ObjectType":"appliance.CertRenewalPhase","ClassId":"appliance.CertRenewalPhase","Failed":true,"Message":"Message %d"}` + c := `{"ObjectType":"appliance.CertRenewalPhase","ClassId":"appliance.CertRenewalPhase","Failed":true,"Message":"Message %d","Name":"Name %d"}` //test when the response is empty ffOpEmpty := flattenListApplianceCertRenewalPhase(p, d) @@ -263,7 +263,7 @@ func TestFlattenListApplianceCertRenewalPhase(t *testing.T) { p = append(p, x) } ffOp := flattenListApplianceCertRenewalPhase(p, d) - expectedOp := []map[string]interface{}{{"name": "Name 1", "object_type": "appliance.CertRenewalPhase", "class_id": "appliance.CertRenewalPhase", "failed": true, "message": "Message 1"}, {"name": "Name 2", "object_type": "appliance.CertRenewalPhase", "class_id": "appliance.CertRenewalPhase", "failed": true, "message": "Message 2"}} + expectedOp := []map[string]interface{}{{"object_type": "appliance.CertRenewalPhase", "class_id": "appliance.CertRenewalPhase", "failed": true, "message": "Message 1", "name": "Name 1"}, {"object_type": "appliance.CertRenewalPhase", "class_id": "appliance.CertRenewalPhase", "failed": true, "message": "Message 2", "name": "Name 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -368,7 +368,7 @@ func TestFlattenListApplianceKeyValuePair(t *testing.T) { func TestFlattenListApplianceStatusCheck(t *testing.T) { p := []models.ApplianceStatusCheck{} var d = &schema.ResourceData{} - c := `{"ObjectType":"appliance.StatusCheck","ClassId":"appliance.StatusCheck","Code":"Code %d","Result":"Result %d"}` + c := `{"Code":"Code %d","Result":"Result %d","ObjectType":"appliance.StatusCheck","ClassId":"appliance.StatusCheck"}` //test when the response is empty ffOpEmpty := flattenListApplianceStatusCheck(p, d) @@ -383,7 +383,7 @@ func TestFlattenListApplianceStatusCheck(t *testing.T) { p = append(p, x) } ffOp := flattenListApplianceStatusCheck(p, d) - expectedOp := []map[string]interface{}{{"object_type": "appliance.StatusCheck", "class_id": "appliance.StatusCheck", "code": "Code 1", "result": "Result 1"}, {"object_type": "appliance.StatusCheck", "class_id": "appliance.StatusCheck", "code": "Code 2", "result": "Result 2"}} + expectedOp := []map[string]interface{}{{"code": "Code 1", "result": "Result 1", "object_type": "appliance.StatusCheck", "class_id": "appliance.StatusCheck"}, {"code": "Code 2", "result": "Result 2", "object_type": "appliance.StatusCheck", "class_id": "appliance.StatusCheck"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -392,7 +392,7 @@ func TestFlattenListApplianceStatusCheck(t *testing.T) { func TestFlattenListAssetClusterMemberRelationship(t *testing.T) { p := []models.AssetClusterMemberRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListAssetClusterMemberRelationship(p, d) @@ -407,7 +407,7 @@ func TestFlattenListAssetClusterMemberRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListAssetClusterMemberRelationship(p, d) - expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} + expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -464,7 +464,7 @@ func TestFlattenListAssetDeploymentRelationship(t *testing.T) { func TestFlattenListAssetDeploymentDeviceRelationship(t *testing.T) { p := []models.AssetDeploymentDeviceRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListAssetDeploymentDeviceRelationship(p, d) @@ -479,7 +479,7 @@ func TestFlattenListAssetDeploymentDeviceRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListAssetDeploymentDeviceRelationship(p, d) - expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} + expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -488,7 +488,7 @@ func TestFlattenListAssetDeploymentDeviceRelationship(t *testing.T) { func TestFlattenListAssetDeviceRegistrationRelationship(t *testing.T) { p := []models.AssetDeviceRegistrationRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListAssetDeviceRegistrationRelationship(p, d) @@ -503,7 +503,7 @@ func TestFlattenListAssetDeviceRegistrationRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListAssetDeviceRegistrationRelationship(p, d) - expectedOp := []map[string]interface{}{{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"}, {"object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -512,7 +512,7 @@ func TestFlattenListAssetDeviceRegistrationRelationship(t *testing.T) { func TestFlattenListAssetMeteringType(t *testing.T) { p := []models.AssetMeteringType{} var d = &schema.ResourceData{} - c := `{"ClassId":"asset.MeteringType","ObjectType":"asset.MeteringType","Name":"Name %d","Unit":"Unit %d"}` + c := `{"ObjectType":"asset.MeteringType","ClassId":"asset.MeteringType","Name":"Name %d","Unit":"Unit %d"}` //test when the response is empty ffOpEmpty := flattenListAssetMeteringType(p, d) @@ -527,7 +527,7 @@ func TestFlattenListAssetMeteringType(t *testing.T) { p = append(p, x) } ffOp := flattenListAssetMeteringType(p, d) - expectedOp := []map[string]interface{}{{"class_id": "asset.MeteringType", "object_type": "asset.MeteringType", "name": "Name 1", "unit": "Unit 1"}, {"class_id": "asset.MeteringType", "object_type": "asset.MeteringType", "name": "Name 2", "unit": "Unit 2"}} + expectedOp := []map[string]interface{}{{"object_type": "asset.MeteringType", "class_id": "asset.MeteringType", "name": "Name 1", "unit": "Unit 1"}, {"object_type": "asset.MeteringType", "class_id": "asset.MeteringType", "name": "Name 2", "unit": "Unit 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -560,7 +560,7 @@ func TestFlattenListAssetService(t *testing.T) { func TestFlattenListBiosBootDeviceRelationship(t *testing.T) { p := []models.BiosBootDeviceRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenListBiosBootDeviceRelationship(p, d) @@ -575,7 +575,7 @@ func TestFlattenListBiosBootDeviceRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListBiosBootDeviceRelationship(p, d) - expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} + expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -584,7 +584,7 @@ func TestFlattenListBiosBootDeviceRelationship(t *testing.T) { func TestFlattenListBiosUnitRelationship(t *testing.T) { p := []models.BiosUnitRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenListBiosUnitRelationship(p, d) @@ -599,7 +599,7 @@ func TestFlattenListBiosUnitRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListBiosUnitRelationship(p, d) - expectedOp := []map[string]interface{}{{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"}, {"object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -632,7 +632,7 @@ func TestFlattenListBootCddDeviceRelationship(t *testing.T) { func TestFlattenListBootDeviceBase(t *testing.T) { p := []models.BootDeviceBase{} var d = &schema.ResourceData{} - c := `{"ObjectType":"boot.DeviceBase","ClassId":"boot.DeviceBase","Name":"Name %d","Enabled":true}` + c := `{"ObjectType":"boot.DeviceBase","ClassId":"boot.DeviceBase","Enabled":true,"Name":"Name %d"}` //test when the response is empty ffOpEmpty := flattenListBootDeviceBase(p, d) @@ -647,7 +647,7 @@ func TestFlattenListBootDeviceBase(t *testing.T) { p = append(p, x) } ffOp := flattenListBootDeviceBase(p, d) - expectedOp := []map[string]interface{}{{"object_type": "boot.DeviceBase", "class_id": "boot.DeviceBase", "name": "Name 1", "enabled": true}, {"object_type": "boot.DeviceBase", "class_id": "boot.DeviceBase", "name": "Name 2", "enabled": true}} + expectedOp := []map[string]interface{}{{"object_type": "boot.DeviceBase", "class_id": "boot.DeviceBase", "enabled": true, "name": "Name 1"}, {"object_type": "boot.DeviceBase", "class_id": "boot.DeviceBase", "enabled": true, "name": "Name 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -656,7 +656,7 @@ func TestFlattenListBootDeviceBase(t *testing.T) { func TestFlattenListBootHddDeviceRelationship(t *testing.T) { p := []models.BootHddDeviceRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListBootHddDeviceRelationship(p, d) @@ -671,7 +671,7 @@ func TestFlattenListBootHddDeviceRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListBootHddDeviceRelationship(p, d) - expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} + expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -704,7 +704,7 @@ func TestFlattenListBootIscsiDeviceRelationship(t *testing.T) { func TestFlattenListBootNvmeDeviceRelationship(t *testing.T) { p := []models.BootNvmeDeviceRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenListBootNvmeDeviceRelationship(p, d) @@ -719,7 +719,7 @@ func TestFlattenListBootNvmeDeviceRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListBootNvmeDeviceRelationship(p, d) - expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -776,7 +776,7 @@ func TestFlattenListBootPxeDeviceRelationship(t *testing.T) { func TestFlattenListBootSanDeviceRelationship(t *testing.T) { p := []models.BootSanDeviceRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenListBootSanDeviceRelationship(p, d) @@ -791,7 +791,7 @@ func TestFlattenListBootSanDeviceRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListBootSanDeviceRelationship(p, d) - expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} + expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -824,7 +824,7 @@ func TestFlattenListBootSdDeviceRelationship(t *testing.T) { func TestFlattenListBootUefiShellDeviceRelationship(t *testing.T) { p := []models.BootUefiShellDeviceRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListBootUefiShellDeviceRelationship(p, d) @@ -839,7 +839,7 @@ func TestFlattenListBootUefiShellDeviceRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListBootUefiShellDeviceRelationship(p, d) - expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} + expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -848,7 +848,7 @@ func TestFlattenListBootUefiShellDeviceRelationship(t *testing.T) { func TestFlattenListBootUsbDeviceRelationship(t *testing.T) { p := []models.BootUsbDeviceRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenListBootUsbDeviceRelationship(p, d) @@ -863,7 +863,7 @@ func TestFlattenListBootUsbDeviceRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListBootUsbDeviceRelationship(p, d) - expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -872,7 +872,7 @@ func TestFlattenListBootUsbDeviceRelationship(t *testing.T) { func TestFlattenListBootVmediaDeviceRelationship(t *testing.T) { p := []models.BootVmediaDeviceRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListBootVmediaDeviceRelationship(p, d) @@ -887,7 +887,7 @@ func TestFlattenListBootVmediaDeviceRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListBootVmediaDeviceRelationship(p, d) - expectedOp := []map[string]interface{}{{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"}, {"object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -896,7 +896,7 @@ func TestFlattenListBootVmediaDeviceRelationship(t *testing.T) { func TestFlattenListBulkApiResult(t *testing.T) { p := []models.BulkApiResult{} var d = &schema.ResourceData{} - c := `{"Status":32,"ObjectType":"bulk.ApiResult","ClassId":"bulk.ApiResult"}` + c := `{"ObjectType":"bulk.ApiResult","ClassId":"bulk.ApiResult","Status":32}` //test when the response is empty ffOpEmpty := flattenListBulkApiResult(p, d) @@ -911,7 +911,7 @@ func TestFlattenListBulkApiResult(t *testing.T) { p = append(p, x) } ffOp := flattenListBulkApiResult(p, d) - expectedOp := []map[string]interface{}{{"status": 32, "object_type": "bulk.ApiResult", "class_id": "bulk.ApiResult"}, {"status": 32, "object_type": "bulk.ApiResult", "class_id": "bulk.ApiResult"}} + expectedOp := []map[string]interface{}{{"object_type": "bulk.ApiResult", "class_id": "bulk.ApiResult", "status": 32}, {"object_type": "bulk.ApiResult", "class_id": "bulk.ApiResult", "status": 32}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -944,7 +944,7 @@ func TestFlattenListBulkExportedItemRelationship(t *testing.T) { func TestFlattenListBulkHttpHeader(t *testing.T) { p := []models.BulkHttpHeader{} var d = &schema.ResourceData{} - c := `{"ClassId":"bulk.HttpHeader","Name":"Name %d","Value":"Value %d","ObjectType":"bulk.HttpHeader"}` + c := `{"Name":"Name %d","Value":"Value %d","ObjectType":"bulk.HttpHeader","ClassId":"bulk.HttpHeader"}` //test when the response is empty ffOpEmpty := flattenListBulkHttpHeader(p, d) @@ -959,7 +959,7 @@ func TestFlattenListBulkHttpHeader(t *testing.T) { p = append(p, x) } ffOp := flattenListBulkHttpHeader(p, d) - expectedOp := []map[string]interface{}{{"class_id": "bulk.HttpHeader", "name": "Name 1", "value": "Value 1", "object_type": "bulk.HttpHeader"}, {"class_id": "bulk.HttpHeader", "name": "Name 2", "value": "Value 2", "object_type": "bulk.HttpHeader"}} + expectedOp := []map[string]interface{}{{"name": "Name 1", "value": "Value 1", "object_type": "bulk.HttpHeader", "class_id": "bulk.HttpHeader"}, {"name": "Name 2", "value": "Value 2", "object_type": "bulk.HttpHeader", "class_id": "bulk.HttpHeader"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -1016,7 +1016,7 @@ func TestFlattenListBulkSubRequestObjRelationship(t *testing.T) { func TestFlattenListCapabilityCapabilityRelationship(t *testing.T) { p := []models.CapabilityCapabilityRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenListCapabilityCapabilityRelationship(p, d) @@ -1031,7 +1031,7 @@ func TestFlattenListCapabilityCapabilityRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListCapabilityCapabilityRelationship(p, d) - expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} + expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -1040,7 +1040,7 @@ func TestFlattenListCapabilityCapabilityRelationship(t *testing.T) { func TestFlattenListCapabilityFeatureConfig(t *testing.T) { p := []models.CapabilityFeatureConfig{} var d = &schema.ResourceData{} - c := `{"ObjectType":"capability.FeatureConfig","ClassId":"capability.FeatureConfig","FeatureName":"FeatureName %d","MinFwVersion":"MinFwVersion %d"}` + c := `{"FeatureName":"FeatureName %d","MinFwVersion":"MinFwVersion %d","ObjectType":"capability.FeatureConfig","ClassId":"capability.FeatureConfig"}` //test when the response is empty ffOpEmpty := flattenListCapabilityFeatureConfig(p, d) @@ -1055,7 +1055,7 @@ func TestFlattenListCapabilityFeatureConfig(t *testing.T) { p = append(p, x) } ffOp := flattenListCapabilityFeatureConfig(p, d) - expectedOp := []map[string]interface{}{{"object_type": "capability.FeatureConfig", "class_id": "capability.FeatureConfig", "feature_name": "FeatureName 1", "min_fw_version": "MinFwVersion 1"}, {"object_type": "capability.FeatureConfig", "class_id": "capability.FeatureConfig", "feature_name": "FeatureName 2", "min_fw_version": "MinFwVersion 2"}} + expectedOp := []map[string]interface{}{{"feature_name": "FeatureName 1", "min_fw_version": "MinFwVersion 1", "object_type": "capability.FeatureConfig", "class_id": "capability.FeatureConfig"}, {"feature_name": "FeatureName 2", "min_fw_version": "MinFwVersion 2", "object_type": "capability.FeatureConfig", "class_id": "capability.FeatureConfig"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -1064,7 +1064,7 @@ func TestFlattenListCapabilityFeatureConfig(t *testing.T) { func TestFlattenListCapabilityPortRange(t *testing.T) { p := []models.CapabilityPortRange{} var d = &schema.ResourceData{} - c := `{"ObjectType":"capability.PortRange","ClassId":"capability.PortRange","EndSlotId":32,"StartPortId":32,"StartSlotId":32,"EndPortId":32}` + c := `{"ClassId":"capability.PortRange","ObjectType":"capability.PortRange","EndPortId":32,"EndSlotId":32,"StartPortId":32,"StartSlotId":32}` //test when the response is empty ffOpEmpty := flattenListCapabilityPortRange(p, d) @@ -1079,7 +1079,7 @@ func TestFlattenListCapabilityPortRange(t *testing.T) { p = append(p, x) } ffOp := flattenListCapabilityPortRange(p, d) - expectedOp := []map[string]interface{}{{"object_type": "capability.PortRange", "class_id": "capability.PortRange", "end_slot_id": 32, "start_port_id": 32, "start_slot_id": 32, "end_port_id": 32}, {"object_type": "capability.PortRange", "class_id": "capability.PortRange", "end_slot_id": 32, "start_port_id": 32, "start_slot_id": 32, "end_port_id": 32}} + expectedOp := []map[string]interface{}{{"class_id": "capability.PortRange", "object_type": "capability.PortRange", "end_port_id": 32, "end_slot_id": 32, "start_port_id": 32, "start_slot_id": 32}, {"class_id": "capability.PortRange", "object_type": "capability.PortRange", "end_port_id": 32, "end_slot_id": 32, "start_port_id": 32, "start_slot_id": 32}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -1088,7 +1088,7 @@ func TestFlattenListCapabilityPortRange(t *testing.T) { func TestFlattenListCapabilitySwitchingModeCapability(t *testing.T) { p := []models.CapabilitySwitchingModeCapability{} var d = &schema.ResourceData{} - c := `{"ClassId":"capability.SwitchingModeCapability","ObjectType":"capability.SwitchingModeCapability","SwitchingMode":"SwitchingMode %d","VpCompressionSupported":true}` + c := `{"VpCompressionSupported":true,"SwitchingMode":"SwitchingMode %d","ObjectType":"capability.SwitchingModeCapability","ClassId":"capability.SwitchingModeCapability"}` //test when the response is empty ffOpEmpty := flattenListCapabilitySwitchingModeCapability(p, d) @@ -1103,7 +1103,7 @@ func TestFlattenListCapabilitySwitchingModeCapability(t *testing.T) { p = append(p, x) } ffOp := flattenListCapabilitySwitchingModeCapability(p, d) - expectedOp := []map[string]interface{}{{"class_id": "capability.SwitchingModeCapability", "object_type": "capability.SwitchingModeCapability", "switching_mode": "SwitchingMode 1", "vp_compression_supported": true}, {"class_id": "capability.SwitchingModeCapability", "object_type": "capability.SwitchingModeCapability", "switching_mode": "SwitchingMode 2", "vp_compression_supported": true}} + expectedOp := []map[string]interface{}{{"vp_compression_supported": true, "switching_mode": "SwitchingMode 1", "object_type": "capability.SwitchingModeCapability", "class_id": "capability.SwitchingModeCapability"}, {"vp_compression_supported": true, "switching_mode": "SwitchingMode 2", "object_type": "capability.SwitchingModeCapability", "class_id": "capability.SwitchingModeCapability"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -1112,7 +1112,7 @@ func TestFlattenListCapabilitySwitchingModeCapability(t *testing.T) { func TestFlattenListCertificatemanagementCertificateBase(t *testing.T) { p := []models.CertificatemanagementCertificateBase{} var d = &schema.ResourceData{} - c := `{"ClassId":"certificatemanagement.CertificateBase","ObjectType":"certificatemanagement.CertificateBase","Enabled":true,"IsPrivatekeySet":true}` + c := `{"ObjectType":"certificatemanagement.CertificateBase","ClassId":"certificatemanagement.CertificateBase","Enabled":true,"IsPrivatekeySet":true}` //test when the response is empty ffOpEmpty := flattenListCertificatemanagementCertificateBase(p, d) @@ -1127,7 +1127,7 @@ func TestFlattenListCertificatemanagementCertificateBase(t *testing.T) { p = append(p, x) } ffOp := flattenListCertificatemanagementCertificateBase(p, d) - expectedOp := []map[string]interface{}{{"class_id": "certificatemanagement.CertificateBase", "object_type": "certificatemanagement.CertificateBase", "enabled": true, "is_privatekey_set": true}, {"class_id": "certificatemanagement.CertificateBase", "object_type": "certificatemanagement.CertificateBase", "enabled": true, "is_privatekey_set": true}} + expectedOp := []map[string]interface{}{{"object_type": "certificatemanagement.CertificateBase", "class_id": "certificatemanagement.CertificateBase", "enabled": true, "is_privatekey_set": true}, {"object_type": "certificatemanagement.CertificateBase", "class_id": "certificatemanagement.CertificateBase", "enabled": true, "is_privatekey_set": true}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -1136,7 +1136,7 @@ func TestFlattenListCertificatemanagementCertificateBase(t *testing.T) { func TestFlattenListChassisConfigChangeDetailRelationship(t *testing.T) { p := []models.ChassisConfigChangeDetailRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenListChassisConfigChangeDetailRelationship(p, d) @@ -1151,7 +1151,7 @@ func TestFlattenListChassisConfigChangeDetailRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListChassisConfigChangeDetailRelationship(p, d) - expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -1160,7 +1160,7 @@ func TestFlattenListChassisConfigChangeDetailRelationship(t *testing.T) { func TestFlattenListChassisConfigResultEntryRelationship(t *testing.T) { p := []models.ChassisConfigResultEntryRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenListChassisConfigResultEntryRelationship(p, d) @@ -1175,7 +1175,7 @@ func TestFlattenListChassisConfigResultEntryRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListChassisConfigResultEntryRelationship(p, d) - expectedOp := []map[string]interface{}{{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"}, {"object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -1184,7 +1184,7 @@ func TestFlattenListChassisConfigResultEntryRelationship(t *testing.T) { func TestFlattenListChassisIomProfileRelationship(t *testing.T) { p := []models.ChassisIomProfileRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListChassisIomProfileRelationship(p, d) @@ -1199,7 +1199,7 @@ func TestFlattenListChassisIomProfileRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListChassisIomProfileRelationship(p, d) - expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"}, {"object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -1232,7 +1232,7 @@ func TestFlattenListCloudAwsSecurityGroupRelationship(t *testing.T) { func TestFlattenListCloudCloudTag(t *testing.T) { p := []models.CloudCloudTag{} var d = &schema.ResourceData{} - c := `{"ObjectType":"cloud.CloudTag","ClassId":"cloud.CloudTag","Key":"Key %d","Value":"Value %d"}` + c := `{"ClassId":"cloud.CloudTag","Key":"Key %d","Value":"Value %d","ObjectType":"cloud.CloudTag"}` //test when the response is empty ffOpEmpty := flattenListCloudCloudTag(p, d) @@ -1247,7 +1247,7 @@ func TestFlattenListCloudCloudTag(t *testing.T) { p = append(p, x) } ffOp := flattenListCloudCloudTag(p, d) - expectedOp := []map[string]interface{}{{"object_type": "cloud.CloudTag", "class_id": "cloud.CloudTag", "key": "Key 1", "value": "Value 1"}, {"object_type": "cloud.CloudTag", "class_id": "cloud.CloudTag", "key": "Key 2", "value": "Value 2"}} + expectedOp := []map[string]interface{}{{"class_id": "cloud.CloudTag", "key": "Key 1", "value": "Value 1", "object_type": "cloud.CloudTag"}, {"class_id": "cloud.CloudTag", "key": "Key 2", "value": "Value 2", "object_type": "cloud.CloudTag"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -1256,7 +1256,7 @@ func TestFlattenListCloudCloudTag(t *testing.T) { func TestFlattenListCloudCustomAttributes(t *testing.T) { p := []models.CloudCustomAttributes{} var d = &schema.ResourceData{} - c := `{"AttributeType":"AttributeType %d","ObjectType":"cloud.CustomAttributes","ClassId":"cloud.CustomAttributes","AttributeValue":"AttributeValue %d","AttributeName":"AttributeName %d"}` + c := `{"ObjectType":"cloud.CustomAttributes","AttributeName":"AttributeName %d","AttributeType":"AttributeType %d","AttributeValue":"AttributeValue %d","ClassId":"cloud.CustomAttributes"}` //test when the response is empty ffOpEmpty := flattenListCloudCustomAttributes(p, d) @@ -1271,7 +1271,7 @@ func TestFlattenListCloudCustomAttributes(t *testing.T) { p = append(p, x) } ffOp := flattenListCloudCustomAttributes(p, d) - expectedOp := []map[string]interface{}{{"attribute_type": "AttributeType 1", "object_type": "cloud.CustomAttributes", "class_id": "cloud.CustomAttributes", "attribute_value": "AttributeValue 1", "attribute_name": "AttributeName 1"}, {"attribute_type": "AttributeType 2", "object_type": "cloud.CustomAttributes", "class_id": "cloud.CustomAttributes", "attribute_value": "AttributeValue 2", "attribute_name": "AttributeName 2"}} + expectedOp := []map[string]interface{}{{"object_type": "cloud.CustomAttributes", "attribute_name": "AttributeName 1", "attribute_type": "AttributeType 1", "attribute_value": "AttributeValue 1", "class_id": "cloud.CustomAttributes"}, {"object_type": "cloud.CustomAttributes", "attribute_name": "AttributeName 2", "attribute_type": "AttributeType 2", "attribute_value": "AttributeValue 2", "class_id": "cloud.CustomAttributes"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -1280,7 +1280,7 @@ func TestFlattenListCloudCustomAttributes(t *testing.T) { func TestFlattenListCloudNetworkInterfaceAttachment(t *testing.T) { p := []models.CloudNetworkInterfaceAttachment{} var d = &schema.ResourceData{} - c := `{"IpForwardingEnabled":true,"NetworkId":"NetworkId %d","ClassId":"cloud.NetworkInterfaceAttachment","SubNetworkName":"SubNetworkName %d","SubNetworkId":"SubNetworkId %d","NicIndex":32,"Identity":"Identity %d","NetworkName":"NetworkName %d","MacAddress":"MacAddress %d","ObjectType":"cloud.NetworkInterfaceAttachment"}` + c := `{"ClassId":"cloud.NetworkInterfaceAttachment","MacAddress":"MacAddress %d","SubNetworkName":"SubNetworkName %d","SubNetworkId":"SubNetworkId %d","NetworkId":"NetworkId %d","IpForwardingEnabled":true,"Identity":"Identity %d","ObjectType":"cloud.NetworkInterfaceAttachment","NetworkName":"NetworkName %d","NicIndex":32}` //test when the response is empty ffOpEmpty := flattenListCloudNetworkInterfaceAttachment(p, d) @@ -1295,7 +1295,7 @@ func TestFlattenListCloudNetworkInterfaceAttachment(t *testing.T) { p = append(p, x) } ffOp := flattenListCloudNetworkInterfaceAttachment(p, d) - expectedOp := []map[string]interface{}{{"ip_forwarding_enabled": true, "network_id": "NetworkId 1", "class_id": "cloud.NetworkInterfaceAttachment", "sub_network_name": "SubNetworkName 1", "sub_network_id": "SubNetworkId 1", "nic_index": 32, "identity": "Identity 1", "network_name": "NetworkName 1", "mac_address": "MacAddress 1", "object_type": "cloud.NetworkInterfaceAttachment"}, {"ip_forwarding_enabled": true, "network_id": "NetworkId 2", "class_id": "cloud.NetworkInterfaceAttachment", "sub_network_name": "SubNetworkName 2", "sub_network_id": "SubNetworkId 2", "nic_index": 32, "identity": "Identity 2", "network_name": "NetworkName 2", "mac_address": "MacAddress 2", "object_type": "cloud.NetworkInterfaceAttachment"}} + expectedOp := []map[string]interface{}{{"class_id": "cloud.NetworkInterfaceAttachment", "mac_address": "MacAddress 1", "sub_network_name": "SubNetworkName 1", "sub_network_id": "SubNetworkId 1", "network_id": "NetworkId 1", "ip_forwarding_enabled": true, "identity": "Identity 1", "object_type": "cloud.NetworkInterfaceAttachment", "network_name": "NetworkName 1", "nic_index": 32}, {"class_id": "cloud.NetworkInterfaceAttachment", "mac_address": "MacAddress 2", "sub_network_name": "SubNetworkName 2", "sub_network_id": "SubNetworkId 2", "network_id": "NetworkId 2", "ip_forwarding_enabled": true, "identity": "Identity 2", "object_type": "cloud.NetworkInterfaceAttachment", "network_name": "NetworkName 2", "nic_index": 32}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -1304,7 +1304,7 @@ func TestFlattenListCloudNetworkInterfaceAttachment(t *testing.T) { func TestFlattenListCloudSecurityGroupRule(t *testing.T) { p := []models.CloudSecurityGroupRule{} var d = &schema.ResourceData{} - c := `{"Description":"Description %d","StartPort":32,"Identity":"Identity %d","Index":32,"EtherType":"EtherType %d","ObjectType":"cloud.SecurityGroupRule","Protocol":"Protocol %d","EndPort":32,"Name":"Name %d","SourceSecurityGroup":"SourceSecurityGroup %d","ClassId":"cloud.SecurityGroupRule","Action":"Action %d"}` + c := `{"Description":"Description %d","Identity":"Identity %d","ClassId":"cloud.SecurityGroupRule","SourceSecurityGroup":"SourceSecurityGroup %d","EndPort":32,"Protocol":"Protocol %d","Index":32,"ObjectType":"cloud.SecurityGroupRule","Name":"Name %d","EtherType":"EtherType %d","StartPort":32,"Action":"Action %d"}` //test when the response is empty ffOpEmpty := flattenListCloudSecurityGroupRule(p, d) @@ -1319,7 +1319,7 @@ func TestFlattenListCloudSecurityGroupRule(t *testing.T) { p = append(p, x) } ffOp := flattenListCloudSecurityGroupRule(p, d) - expectedOp := []map[string]interface{}{{"description": "Description 1", "start_port": 32, "identity": "Identity 1", "index": 32, "ether_type": "EtherType 1", "object_type": "cloud.SecurityGroupRule", "protocol": "Protocol 1", "end_port": 32, "name": "Name 1", "source_security_group": "SourceSecurityGroup 1", "class_id": "cloud.SecurityGroupRule", "action": "Action 1"}, {"description": "Description 2", "start_port": 32, "identity": "Identity 2", "index": 32, "ether_type": "EtherType 2", "object_type": "cloud.SecurityGroupRule", "protocol": "Protocol 2", "end_port": 32, "name": "Name 2", "source_security_group": "SourceSecurityGroup 2", "class_id": "cloud.SecurityGroupRule", "action": "Action 2"}} + expectedOp := []map[string]interface{}{{"description": "Description 1", "identity": "Identity 1", "class_id": "cloud.SecurityGroupRule", "source_security_group": "SourceSecurityGroup 1", "end_port": 32, "protocol": "Protocol 1", "index": 32, "object_type": "cloud.SecurityGroupRule", "name": "Name 1", "ether_type": "EtherType 1", "start_port": 32, "action": "Action 1"}, {"description": "Description 2", "identity": "Identity 2", "class_id": "cloud.SecurityGroupRule", "source_security_group": "SourceSecurityGroup 2", "end_port": 32, "protocol": "Protocol 2", "index": 32, "object_type": "cloud.SecurityGroupRule", "name": "Name 2", "ether_type": "EtherType 2", "start_port": 32, "action": "Action 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -1328,7 +1328,7 @@ func TestFlattenListCloudSecurityGroupRule(t *testing.T) { func TestFlattenListCloudTfcWorkspaceVariables(t *testing.T) { p := []models.CloudTfcWorkspaceVariables{} var d = &schema.ResourceData{} - c := `{"Identity":"Identity %d","Key":"Key %d","Value":"Value %d","Category":"Category %d","Description":"Description %d","Hcl":true,"ObjectType":"cloud.TfcWorkspaceVariables","ClassId":"cloud.TfcWorkspaceVariables","Sensitive":true}` + c := `{"Category":"Category %d","Identity":"Identity %d","Description":"Description %d","Sensitive":true,"Value":"Value %d","ObjectType":"cloud.TfcWorkspaceVariables","ClassId":"cloud.TfcWorkspaceVariables","Key":"Key %d","Hcl":true}` //test when the response is empty ffOpEmpty := flattenListCloudTfcWorkspaceVariables(p, d) @@ -1343,7 +1343,7 @@ func TestFlattenListCloudTfcWorkspaceVariables(t *testing.T) { p = append(p, x) } ffOp := flattenListCloudTfcWorkspaceVariables(p, d) - expectedOp := []map[string]interface{}{{"identity": "Identity 1", "key": "Key 1", "value": "Value 1", "category": "Category 1", "description": "Description 1", "hcl": true, "object_type": "cloud.TfcWorkspaceVariables", "class_id": "cloud.TfcWorkspaceVariables", "sensitive": true}, {"identity": "Identity 2", "key": "Key 2", "value": "Value 2", "category": "Category 2", "description": "Description 2", "hcl": true, "object_type": "cloud.TfcWorkspaceVariables", "class_id": "cloud.TfcWorkspaceVariables", "sensitive": true}} + expectedOp := []map[string]interface{}{{"category": "Category 1", "identity": "Identity 1", "description": "Description 1", "sensitive": true, "value": "Value 1", "object_type": "cloud.TfcWorkspaceVariables", "class_id": "cloud.TfcWorkspaceVariables", "key": "Key 1", "hcl": true}, {"category": "Category 2", "identity": "Identity 2", "description": "Description 2", "sensitive": true, "value": "Value 2", "object_type": "cloud.TfcWorkspaceVariables", "class_id": "cloud.TfcWorkspaceVariables", "key": "Key 2", "hcl": true}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -1352,7 +1352,7 @@ func TestFlattenListCloudTfcWorkspaceVariables(t *testing.T) { func TestFlattenListCloudVolumeAttachment(t *testing.T) { p := []models.CloudVolumeAttachment{} var d = &schema.ResourceData{} - c := `{"DeviceName":"DeviceName %d","Index":32,"AutoDelete":true,"Identity":"Identity %d","ObjectType":"cloud.VolumeAttachment","ClassId":"cloud.VolumeAttachment","IsRoot":true}` + c := `{"ClassId":"cloud.VolumeAttachment","Identity":"Identity %d","IsRoot":true,"AutoDelete":true,"DeviceName":"DeviceName %d","ObjectType":"cloud.VolumeAttachment","Index":32}` //test when the response is empty ffOpEmpty := flattenListCloudVolumeAttachment(p, d) @@ -1367,7 +1367,7 @@ func TestFlattenListCloudVolumeAttachment(t *testing.T) { p = append(p, x) } ffOp := flattenListCloudVolumeAttachment(p, d) - expectedOp := []map[string]interface{}{{"device_name": "DeviceName 1", "index": 32, "auto_delete": true, "identity": "Identity 1", "object_type": "cloud.VolumeAttachment", "class_id": "cloud.VolumeAttachment", "is_root": true}, {"device_name": "DeviceName 2", "index": 32, "auto_delete": true, "identity": "Identity 2", "object_type": "cloud.VolumeAttachment", "class_id": "cloud.VolumeAttachment", "is_root": true}} + expectedOp := []map[string]interface{}{{"class_id": "cloud.VolumeAttachment", "identity": "Identity 1", "is_root": true, "auto_delete": true, "device_name": "DeviceName 1", "object_type": "cloud.VolumeAttachment", "index": 32}, {"class_id": "cloud.VolumeAttachment", "identity": "Identity 2", "is_root": true, "auto_delete": true, "device_name": "DeviceName 2", "object_type": "cloud.VolumeAttachment", "index": 32}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -1376,7 +1376,7 @@ func TestFlattenListCloudVolumeAttachment(t *testing.T) { func TestFlattenListCloudVolumeInstanceAttachment(t *testing.T) { p := []models.CloudVolumeInstanceAttachment{} var d = &schema.ResourceData{} - c := `{"AutoDelete":true,"ObjectType":"cloud.VolumeInstanceAttachment","ClassId":"cloud.VolumeInstanceAttachment","DeviceName":"DeviceName %d","InstanceId":"InstanceId %d","State":"State %d"}` + c := `{"State":"State %d","ObjectType":"cloud.VolumeInstanceAttachment","ClassId":"cloud.VolumeInstanceAttachment","AutoDelete":true,"DeviceName":"DeviceName %d","InstanceId":"InstanceId %d"}` //test when the response is empty ffOpEmpty := flattenListCloudVolumeInstanceAttachment(p, d) @@ -1391,7 +1391,7 @@ func TestFlattenListCloudVolumeInstanceAttachment(t *testing.T) { p = append(p, x) } ffOp := flattenListCloudVolumeInstanceAttachment(p, d) - expectedOp := []map[string]interface{}{{"auto_delete": true, "object_type": "cloud.VolumeInstanceAttachment", "class_id": "cloud.VolumeInstanceAttachment", "device_name": "DeviceName 1", "instance_id": "InstanceId 1", "state": "State 1"}, {"auto_delete": true, "object_type": "cloud.VolumeInstanceAttachment", "class_id": "cloud.VolumeInstanceAttachment", "device_name": "DeviceName 2", "instance_id": "InstanceId 2", "state": "State 2"}} + expectedOp := []map[string]interface{}{{"state": "State 1", "object_type": "cloud.VolumeInstanceAttachment", "class_id": "cloud.VolumeInstanceAttachment", "auto_delete": true, "device_name": "DeviceName 1", "instance_id": "InstanceId 1"}, {"state": "State 2", "object_type": "cloud.VolumeInstanceAttachment", "class_id": "cloud.VolumeInstanceAttachment", "auto_delete": true, "device_name": "DeviceName 2", "instance_id": "InstanceId 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -1400,7 +1400,7 @@ func TestFlattenListCloudVolumeInstanceAttachment(t *testing.T) { func TestFlattenListComputeBladeRelationship(t *testing.T) { p := []models.ComputeBladeRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenListComputeBladeRelationship(p, d) @@ -1415,7 +1415,7 @@ func TestFlattenListComputeBladeRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListComputeBladeRelationship(p, d) - expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -1424,7 +1424,7 @@ func TestFlattenListComputeBladeRelationship(t *testing.T) { func TestFlattenListComputeIpAddress(t *testing.T) { p := []models.ComputeIpAddress{} var d = &schema.ResourceData{} - c := `{"ClassId":"compute.IpAddress","Dn":"Dn %d","HttpPort":32,"Subnet":"Subnet %d","KvmVlan":32,"ObjectType":"compute.IpAddress","DefaultGateway":"DefaultGateway %d","Type":"Type %d","Address":"Address %d","KvmPort":32,"HttpsPort":32,"Name":"Name %d","Category":"Category %d"}` + c := `{"HttpsPort":32,"Category":"Category %d","Name":"Name %d","KvmVlan":32,"KvmPort":32,"ClassId":"compute.IpAddress","Subnet":"Subnet %d","HttpPort":32,"DefaultGateway":"DefaultGateway %d","Dn":"Dn %d","Type":"Type %d","Address":"Address %d","ObjectType":"compute.IpAddress"}` //test when the response is empty ffOpEmpty := flattenListComputeIpAddress(p, d) @@ -1439,7 +1439,7 @@ func TestFlattenListComputeIpAddress(t *testing.T) { p = append(p, x) } ffOp := flattenListComputeIpAddress(p, d) - expectedOp := []map[string]interface{}{{"class_id": "compute.IpAddress", "dn": "Dn 1", "http_port": 32, "subnet": "Subnet 1", "kvm_vlan": 32, "object_type": "compute.IpAddress", "default_gateway": "DefaultGateway 1", "type": "Type 1", "address": "Address 1", "kvm_port": 32, "https_port": 32, "name": "Name 1", "category": "Category 1"}, {"class_id": "compute.IpAddress", "dn": "Dn 2", "http_port": 32, "subnet": "Subnet 2", "kvm_vlan": 32, "object_type": "compute.IpAddress", "default_gateway": "DefaultGateway 2", "type": "Type 2", "address": "Address 2", "kvm_port": 32, "https_port": 32, "name": "Name 2", "category": "Category 2"}} + expectedOp := []map[string]interface{}{{"https_port": 32, "category": "Category 1", "name": "Name 1", "kvm_vlan": 32, "kvm_port": 32, "class_id": "compute.IpAddress", "subnet": "Subnet 1", "http_port": 32, "default_gateway": "DefaultGateway 1", "dn": "Dn 1", "type": "Type 1", "address": "Address 1", "object_type": "compute.IpAddress"}, {"https_port": 32, "category": "Category 2", "name": "Name 2", "kvm_vlan": 32, "kvm_port": 32, "class_id": "compute.IpAddress", "subnet": "Subnet 2", "http_port": 32, "default_gateway": "DefaultGateway 2", "dn": "Dn 2", "type": "Type 2", "address": "Address 2", "object_type": "compute.IpAddress"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -1448,7 +1448,7 @@ func TestFlattenListComputeIpAddress(t *testing.T) { func TestFlattenListComputeMappingRelationship(t *testing.T) { p := []models.ComputeMappingRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListComputeMappingRelationship(p, d) @@ -1463,7 +1463,7 @@ func TestFlattenListComputeMappingRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListComputeMappingRelationship(p, d) - expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} + expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -1472,7 +1472,7 @@ func TestFlattenListComputeMappingRelationship(t *testing.T) { func TestFlattenListComputePhysicalRelationship(t *testing.T) { p := []models.ComputePhysicalRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenListComputePhysicalRelationship(p, d) @@ -1487,7 +1487,7 @@ func TestFlattenListComputePhysicalRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListComputePhysicalRelationship(p, d) - expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -1496,7 +1496,7 @@ func TestFlattenListComputePhysicalRelationship(t *testing.T) { func TestFlattenListComputeRackUnitRelationship(t *testing.T) { p := []models.ComputeRackUnitRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenListComputeRackUnitRelationship(p, d) @@ -1511,7 +1511,7 @@ func TestFlattenListComputeRackUnitRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListComputeRackUnitRelationship(p, d) - expectedOp := []map[string]interface{}{{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"}, {"object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -1520,7 +1520,7 @@ func TestFlattenListComputeRackUnitRelationship(t *testing.T) { func TestFlattenListComputeServerOpStatus(t *testing.T) { p := []models.ComputeServerOpStatus{} var d = &schema.ResourceData{} - c := `{"ClassId":"compute.ServerOpStatus","ConfigState":"ConfigState %d","WorkflowType":"WorkflowType %d","ObjectType":"compute.ServerOpStatus"}` + c := `{"ConfigState":"ConfigState %d","WorkflowType":"WorkflowType %d","ObjectType":"compute.ServerOpStatus","ClassId":"compute.ServerOpStatus"}` //test when the response is empty ffOpEmpty := flattenListComputeServerOpStatus(p, d) @@ -1535,7 +1535,7 @@ func TestFlattenListComputeServerOpStatus(t *testing.T) { p = append(p, x) } ffOp := flattenListComputeServerOpStatus(p, d) - expectedOp := []map[string]interface{}{{"class_id": "compute.ServerOpStatus", "config_state": "ConfigState 1", "workflow_type": "WorkflowType 1", "object_type": "compute.ServerOpStatus"}, {"class_id": "compute.ServerOpStatus", "config_state": "ConfigState 2", "workflow_type": "WorkflowType 2", "object_type": "compute.ServerOpStatus"}} + expectedOp := []map[string]interface{}{{"config_state": "ConfigState 1", "workflow_type": "WorkflowType 1", "object_type": "compute.ServerOpStatus", "class_id": "compute.ServerOpStatus"}, {"config_state": "ConfigState 2", "workflow_type": "WorkflowType 2", "object_type": "compute.ServerOpStatus", "class_id": "compute.ServerOpStatus"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -1544,7 +1544,7 @@ func TestFlattenListComputeServerOpStatus(t *testing.T) { func TestFlattenListCondHclStatusDetailRelationship(t *testing.T) { p := []models.CondHclStatusDetailRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListCondHclStatusDetailRelationship(p, d) @@ -1559,7 +1559,7 @@ func TestFlattenListCondHclStatusDetailRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListCondHclStatusDetailRelationship(p, d) - expectedOp := []map[string]interface{}{{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"}, {"object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -1568,7 +1568,7 @@ func TestFlattenListCondHclStatusDetailRelationship(t *testing.T) { func TestFlattenListConnectorpackConnectorPackUpdate(t *testing.T) { p := []models.ConnectorpackConnectorPackUpdate{} var d = &schema.ResourceData{} - c := `{"ObjectType":"connectorpack.ConnectorPackUpdate","ClassId":"connectorpack.ConnectorPackUpdate","NewVersion":"NewVersion %d","CurrentVersion":"CurrentVersion %d","Name":"Name %d"}` + c := `{"ObjectType":"connectorpack.ConnectorPackUpdate","ClassId":"connectorpack.ConnectorPackUpdate","CurrentVersion":"CurrentVersion %d","Name":"Name %d","NewVersion":"NewVersion %d"}` //test when the response is empty ffOpEmpty := flattenListConnectorpackConnectorPackUpdate(p, d) @@ -1583,7 +1583,7 @@ func TestFlattenListConnectorpackConnectorPackUpdate(t *testing.T) { p = append(p, x) } ffOp := flattenListConnectorpackConnectorPackUpdate(p, d) - expectedOp := []map[string]interface{}{{"object_type": "connectorpack.ConnectorPackUpdate", "class_id": "connectorpack.ConnectorPackUpdate", "new_version": "NewVersion 1", "current_version": "CurrentVersion 1", "name": "Name 1"}, {"object_type": "connectorpack.ConnectorPackUpdate", "class_id": "connectorpack.ConnectorPackUpdate", "new_version": "NewVersion 2", "current_version": "CurrentVersion 2", "name": "Name 2"}} + expectedOp := []map[string]interface{}{{"object_type": "connectorpack.ConnectorPackUpdate", "class_id": "connectorpack.ConnectorPackUpdate", "current_version": "CurrentVersion 1", "name": "Name 1", "new_version": "NewVersion 1"}, {"object_type": "connectorpack.ConnectorPackUpdate", "class_id": "connectorpack.ConnectorPackUpdate", "current_version": "CurrentVersion 2", "name": "Name 2", "new_version": "NewVersion 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -1616,7 +1616,7 @@ func TestFlattenListContentComplexType(t *testing.T) { func TestFlattenListContentParameter(t *testing.T) { p := []models.ContentParameter{} var d = &schema.ResourceData{} - c := `{"ClassId":"content.Parameter","ObjectType":"content.Parameter","Secure":true,"Name":"Name %d","ItemType":"ItemType %d","ComplexType":"ComplexType %d","Path":"Path %d","Type":"Type %d","AcceptSingleValue":true}` + c := `{"Name":"Name %d","ItemType":"ItemType %d","Type":"Type %d","ComplexType":"ComplexType %d","AcceptSingleValue":true,"ObjectType":"content.Parameter","Secure":true,"ClassId":"content.Parameter","Path":"Path %d"}` //test when the response is empty ffOpEmpty := flattenListContentParameter(p, d) @@ -1631,7 +1631,7 @@ func TestFlattenListContentParameter(t *testing.T) { p = append(p, x) } ffOp := flattenListContentParameter(p, d) - expectedOp := []map[string]interface{}{{"class_id": "content.Parameter", "object_type": "content.Parameter", "secure": true, "name": "Name 1", "item_type": "ItemType 1", "complex_type": "ComplexType 1", "path": "Path 1", "type": "Type 1", "accept_single_value": true}, {"class_id": "content.Parameter", "object_type": "content.Parameter", "secure": true, "name": "Name 2", "item_type": "ItemType 2", "complex_type": "ComplexType 2", "path": "Path 2", "type": "Type 2", "accept_single_value": true}} + expectedOp := []map[string]interface{}{{"name": "Name 1", "item_type": "ItemType 1", "type": "Type 1", "complex_type": "ComplexType 1", "accept_single_value": true, "object_type": "content.Parameter", "secure": true, "class_id": "content.Parameter", "path": "Path 1"}, {"name": "Name 2", "item_type": "ItemType 2", "type": "Type 2", "complex_type": "ComplexType 2", "accept_single_value": true, "object_type": "content.Parameter", "secure": true, "class_id": "content.Parameter", "path": "Path 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -1640,7 +1640,7 @@ func TestFlattenListContentParameter(t *testing.T) { func TestFlattenListCrdCustomResourceConfigProperty(t *testing.T) { p := []models.CrdCustomResourceConfigProperty{} var d = &schema.ResourceData{} - c := `{"ObjectType":"crd.CustomResourceConfigProperty","Value":"Value %d","Key":"Key %d","ClassId":"crd.CustomResourceConfigProperty"}` + c := `{"Key":"Key %d","Value":"Value %d","ObjectType":"crd.CustomResourceConfigProperty","ClassId":"crd.CustomResourceConfigProperty"}` //test when the response is empty ffOpEmpty := flattenListCrdCustomResourceConfigProperty(p, d) @@ -1655,7 +1655,7 @@ func TestFlattenListCrdCustomResourceConfigProperty(t *testing.T) { p = append(p, x) } ffOp := flattenListCrdCustomResourceConfigProperty(p, d) - expectedOp := []map[string]interface{}{{"object_type": "crd.CustomResourceConfigProperty", "value": "Value 1", "key": "Key 1", "class_id": "crd.CustomResourceConfigProperty"}, {"object_type": "crd.CustomResourceConfigProperty", "value": "Value 2", "key": "Key 2", "class_id": "crd.CustomResourceConfigProperty"}} + expectedOp := []map[string]interface{}{{"key": "Key 1", "value": "Value 1", "object_type": "crd.CustomResourceConfigProperty", "class_id": "crd.CustomResourceConfigProperty"}, {"key": "Key 2", "value": "Value 2", "object_type": "crd.CustomResourceConfigProperty", "class_id": "crd.CustomResourceConfigProperty"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -1664,7 +1664,7 @@ func TestFlattenListCrdCustomResourceConfigProperty(t *testing.T) { func TestFlattenListEquipmentExpanderModuleRelationship(t *testing.T) { p := []models.EquipmentExpanderModuleRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListEquipmentExpanderModuleRelationship(p, d) @@ -1679,7 +1679,7 @@ func TestFlattenListEquipmentExpanderModuleRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListEquipmentExpanderModuleRelationship(p, d) - expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} + expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -1688,7 +1688,7 @@ func TestFlattenListEquipmentExpanderModuleRelationship(t *testing.T) { func TestFlattenListEquipmentFanRelationship(t *testing.T) { p := []models.EquipmentFanRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListEquipmentFanRelationship(p, d) @@ -1703,7 +1703,7 @@ func TestFlattenListEquipmentFanRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListEquipmentFanRelationship(p, d) - expectedOp := []map[string]interface{}{{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"}, {"object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -1712,7 +1712,7 @@ func TestFlattenListEquipmentFanRelationship(t *testing.T) { func TestFlattenListEquipmentFanModuleRelationship(t *testing.T) { p := []models.EquipmentFanModuleRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListEquipmentFanModuleRelationship(p, d) @@ -1727,7 +1727,7 @@ func TestFlattenListEquipmentFanModuleRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListEquipmentFanModuleRelationship(p, d) - expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} + expectedOp := []map[string]interface{}{{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"}, {"object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -1736,7 +1736,7 @@ func TestFlattenListEquipmentFanModuleRelationship(t *testing.T) { func TestFlattenListEquipmentIoCardRelationship(t *testing.T) { p := []models.EquipmentIoCardRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenListEquipmentIoCardRelationship(p, d) @@ -1751,7 +1751,7 @@ func TestFlattenListEquipmentIoCardRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListEquipmentIoCardRelationship(p, d) - expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} + expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -1760,7 +1760,7 @@ func TestFlattenListEquipmentIoCardRelationship(t *testing.T) { func TestFlattenListEquipmentIoCardIdentity(t *testing.T) { p := []models.EquipmentIoCardIdentity{} var d = &schema.ResourceData{} - c := `{"ObjectType":"equipment.IoCardIdentity","ClassId":"equipment.IoCardIdentity","IoCardMoid":"IoCardMoid %d","ModuleId":32,"NetworkElementMoid":"NetworkElementMoid %d","SwitchId":32}` + c := `{"SwitchId":32,"ObjectType":"equipment.IoCardIdentity","ClassId":"equipment.IoCardIdentity","IoCardMoid":"IoCardMoid %d","ModuleId":32,"NetworkElementMoid":"NetworkElementMoid %d"}` //test when the response is empty ffOpEmpty := flattenListEquipmentIoCardIdentity(p, d) @@ -1775,7 +1775,7 @@ func TestFlattenListEquipmentIoCardIdentity(t *testing.T) { p = append(p, x) } ffOp := flattenListEquipmentIoCardIdentity(p, d) - expectedOp := []map[string]interface{}{{"object_type": "equipment.IoCardIdentity", "class_id": "equipment.IoCardIdentity", "io_card_moid": "IoCardMoid 1", "module_id": 32, "network_element_moid": "NetworkElementMoid 1", "switch_id": 32}, {"object_type": "equipment.IoCardIdentity", "class_id": "equipment.IoCardIdentity", "io_card_moid": "IoCardMoid 2", "module_id": 32, "network_element_moid": "NetworkElementMoid 2", "switch_id": 32}} + expectedOp := []map[string]interface{}{{"switch_id": 32, "object_type": "equipment.IoCardIdentity", "class_id": "equipment.IoCardIdentity", "io_card_moid": "IoCardMoid 1", "module_id": 32, "network_element_moid": "NetworkElementMoid 1"}, {"switch_id": 32, "object_type": "equipment.IoCardIdentity", "class_id": "equipment.IoCardIdentity", "io_card_moid": "IoCardMoid 2", "module_id": 32, "network_element_moid": "NetworkElementMoid 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -1784,7 +1784,7 @@ func TestFlattenListEquipmentIoCardIdentity(t *testing.T) { func TestFlattenListEquipmentIoExpanderRelationship(t *testing.T) { p := []models.EquipmentIoExpanderRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenListEquipmentIoExpanderRelationship(p, d) @@ -1799,7 +1799,7 @@ func TestFlattenListEquipmentIoExpanderRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListEquipmentIoExpanderRelationship(p, d) - expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} + expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -1808,7 +1808,7 @@ func TestFlattenListEquipmentIoExpanderRelationship(t *testing.T) { func TestFlattenListEquipmentPsuRelationship(t *testing.T) { p := []models.EquipmentPsuRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListEquipmentPsuRelationship(p, d) @@ -1823,7 +1823,7 @@ func TestFlattenListEquipmentPsuRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListEquipmentPsuRelationship(p, d) - expectedOp := []map[string]interface{}{{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"}, {"object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -1832,7 +1832,7 @@ func TestFlattenListEquipmentPsuRelationship(t *testing.T) { func TestFlattenListEquipmentRackEnclosureSlotRelationship(t *testing.T) { p := []models.EquipmentRackEnclosureSlotRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenListEquipmentRackEnclosureSlotRelationship(p, d) @@ -1847,7 +1847,7 @@ func TestFlattenListEquipmentRackEnclosureSlotRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListEquipmentRackEnclosureSlotRelationship(p, d) - expectedOp := []map[string]interface{}{{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"}, {"object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -1856,7 +1856,7 @@ func TestFlattenListEquipmentRackEnclosureSlotRelationship(t *testing.T) { func TestFlattenListEquipmentSwitchCardRelationship(t *testing.T) { p := []models.EquipmentSwitchCardRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListEquipmentSwitchCardRelationship(p, d) @@ -1871,7 +1871,7 @@ func TestFlattenListEquipmentSwitchCardRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListEquipmentSwitchCardRelationship(p, d) - expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} + expectedOp := []map[string]interface{}{{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"}, {"object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -1880,7 +1880,7 @@ func TestFlattenListEquipmentSwitchCardRelationship(t *testing.T) { func TestFlattenListEquipmentSystemIoControllerRelationship(t *testing.T) { p := []models.EquipmentSystemIoControllerRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenListEquipmentSystemIoControllerRelationship(p, d) @@ -1895,7 +1895,7 @@ func TestFlattenListEquipmentSystemIoControllerRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListEquipmentSystemIoControllerRelationship(p, d) - expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -1904,7 +1904,7 @@ func TestFlattenListEquipmentSystemIoControllerRelationship(t *testing.T) { func TestFlattenListEquipmentTpmRelationship(t *testing.T) { p := []models.EquipmentTpmRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenListEquipmentTpmRelationship(p, d) @@ -1919,7 +1919,7 @@ func TestFlattenListEquipmentTpmRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListEquipmentTpmRelationship(p, d) - expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -1952,7 +1952,7 @@ func TestFlattenListEtherHostPortRelationship(t *testing.T) { func TestFlattenListEtherNetworkPortRelationship(t *testing.T) { p := []models.EtherNetworkPortRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenListEtherNetworkPortRelationship(p, d) @@ -1967,7 +1967,7 @@ func TestFlattenListEtherNetworkPortRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListEtherNetworkPortRelationship(p, d) - expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} + expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -1976,7 +1976,7 @@ func TestFlattenListEtherNetworkPortRelationship(t *testing.T) { func TestFlattenListEtherPhysicalPortRelationship(t *testing.T) { p := []models.EtherPhysicalPortRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenListEtherPhysicalPortRelationship(p, d) @@ -1991,7 +1991,7 @@ func TestFlattenListEtherPhysicalPortRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListEtherPhysicalPortRelationship(p, d) - expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} + expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -2000,7 +2000,7 @@ func TestFlattenListEtherPhysicalPortRelationship(t *testing.T) { func TestFlattenListEtherPortChannelRelationship(t *testing.T) { p := []models.EtherPortChannelRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenListEtherPortChannelRelationship(p, d) @@ -2015,7 +2015,7 @@ func TestFlattenListEtherPortChannelRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListEtherPortChannelRelationship(p, d) - expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} + expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -2024,7 +2024,7 @@ func TestFlattenListEtherPortChannelRelationship(t *testing.T) { func TestFlattenListFabricConfigChangeDetailRelationship(t *testing.T) { p := []models.FabricConfigChangeDetailRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenListFabricConfigChangeDetailRelationship(p, d) @@ -2039,7 +2039,7 @@ func TestFlattenListFabricConfigChangeDetailRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListFabricConfigChangeDetailRelationship(p, d) - expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -2048,7 +2048,7 @@ func TestFlattenListFabricConfigChangeDetailRelationship(t *testing.T) { func TestFlattenListFabricConfigResultEntryRelationship(t *testing.T) { p := []models.FabricConfigResultEntryRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenListFabricConfigResultEntryRelationship(p, d) @@ -2063,7 +2063,7 @@ func TestFlattenListFabricConfigResultEntryRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListFabricConfigResultEntryRelationship(p, d) - expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} + expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -2072,7 +2072,7 @@ func TestFlattenListFabricConfigResultEntryRelationship(t *testing.T) { func TestFlattenListFabricEthNetworkGroupPolicyRelationship(t *testing.T) { p := []models.FabricEthNetworkGroupPolicyRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListFabricEthNetworkGroupPolicyRelationship(p, d) @@ -2087,7 +2087,7 @@ func TestFlattenListFabricEthNetworkGroupPolicyRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListFabricEthNetworkGroupPolicyRelationship(p, d) - expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"}, {"object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -2096,7 +2096,7 @@ func TestFlattenListFabricEthNetworkGroupPolicyRelationship(t *testing.T) { func TestFlattenListFabricPortIdentifier(t *testing.T) { p := []models.FabricPortIdentifier{} var d = &schema.ResourceData{} - c := `{"PortId":32,"SlotId":32,"ObjectType":"fabric.PortIdentifier","ClassId":"fabric.PortIdentifier","AggregatePortId":32}` + c := `{"PortId":32,"SlotId":32,"AggregatePortId":32,"ObjectType":"fabric.PortIdentifier","ClassId":"fabric.PortIdentifier"}` //test when the response is empty ffOpEmpty := flattenListFabricPortIdentifier(p, d) @@ -2111,7 +2111,7 @@ func TestFlattenListFabricPortIdentifier(t *testing.T) { p = append(p, x) } ffOp := flattenListFabricPortIdentifier(p, d) - expectedOp := []map[string]interface{}{{"port_id": 32, "slot_id": 32, "object_type": "fabric.PortIdentifier", "class_id": "fabric.PortIdentifier", "aggregate_port_id": 32}, {"port_id": 32, "slot_id": 32, "object_type": "fabric.PortIdentifier", "class_id": "fabric.PortIdentifier", "aggregate_port_id": 32}} + expectedOp := []map[string]interface{}{{"port_id": 32, "slot_id": 32, "aggregate_port_id": 32, "object_type": "fabric.PortIdentifier", "class_id": "fabric.PortIdentifier"}, {"port_id": 32, "slot_id": 32, "aggregate_port_id": 32, "object_type": "fabric.PortIdentifier", "class_id": "fabric.PortIdentifier"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -2120,7 +2120,7 @@ func TestFlattenListFabricPortIdentifier(t *testing.T) { func TestFlattenListFabricQosClass(t *testing.T) { p := []models.FabricQosClass{} var d = &schema.ResourceData{} - c := `{"AdminState":"AdminState %d","Cos":32,"Mtu":32,"ClassId":"fabric.QosClass","PacketDrop":true,"MulticastOptimize":true,"BandwidthPercent":32,"Name":"Name %d","Weight":32,"ObjectType":"fabric.QosClass"}` + c := `{"Name":"Name %d","MulticastOptimize":true,"Weight":32,"PacketDrop":true,"AdminState":"AdminState %d","ClassId":"fabric.QosClass","Mtu":32,"BandwidthPercent":32,"Cos":32,"ObjectType":"fabric.QosClass"}` //test when the response is empty ffOpEmpty := flattenListFabricQosClass(p, d) @@ -2135,7 +2135,7 @@ func TestFlattenListFabricQosClass(t *testing.T) { p = append(p, x) } ffOp := flattenListFabricQosClass(p, d) - expectedOp := []map[string]interface{}{{"admin_state": "AdminState 1", "cos": 32, "mtu": 32, "class_id": "fabric.QosClass", "packet_drop": true, "multicast_optimize": true, "bandwidth_percent": 32, "name": "Name 1", "weight": 32, "object_type": "fabric.QosClass"}, {"admin_state": "AdminState 2", "cos": 32, "mtu": 32, "class_id": "fabric.QosClass", "packet_drop": true, "multicast_optimize": true, "bandwidth_percent": 32, "name": "Name 2", "weight": 32, "object_type": "fabric.QosClass"}} + expectedOp := []map[string]interface{}{{"name": "Name 1", "multicast_optimize": true, "weight": 32, "packet_drop": true, "admin_state": "AdminState 1", "class_id": "fabric.QosClass", "mtu": 32, "bandwidth_percent": 32, "cos": 32, "object_type": "fabric.QosClass"}, {"name": "Name 2", "multicast_optimize": true, "weight": 32, "packet_drop": true, "admin_state": "AdminState 2", "class_id": "fabric.QosClass", "mtu": 32, "bandwidth_percent": 32, "cos": 32, "object_type": "fabric.QosClass"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -2144,7 +2144,7 @@ func TestFlattenListFabricQosClass(t *testing.T) { func TestFlattenListFabricSwitchProfileRelationship(t *testing.T) { p := []models.FabricSwitchProfileRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenListFabricSwitchProfileRelationship(p, d) @@ -2159,7 +2159,7 @@ func TestFlattenListFabricSwitchProfileRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListFabricSwitchProfileRelationship(p, d) - expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -2168,7 +2168,7 @@ func TestFlattenListFabricSwitchProfileRelationship(t *testing.T) { func TestFlattenListFcPhysicalPortRelationship(t *testing.T) { p := []models.FcPhysicalPortRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListFcPhysicalPortRelationship(p, d) @@ -2183,7 +2183,7 @@ func TestFlattenListFcPhysicalPortRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListFcPhysicalPortRelationship(p, d) - expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} + expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -2216,7 +2216,7 @@ func TestFlattenListFcPortChannelRelationship(t *testing.T) { func TestFlattenListFcpoolBlock(t *testing.T) { p := []models.FcpoolBlock{} var d = &schema.ResourceData{} - c := `{"ObjectType":"fcpool.Block","ClassId":"fcpool.Block","Size":32,"To":"To %d","From":"From %d"}` + c := `{"From":"From %d","ObjectType":"fcpool.Block","ClassId":"fcpool.Block","Size":32,"To":"To %d"}` //test when the response is empty ffOpEmpty := flattenListFcpoolBlock(p, d) @@ -2231,7 +2231,7 @@ func TestFlattenListFcpoolBlock(t *testing.T) { p = append(p, x) } ffOp := flattenListFcpoolBlock(p, d) - expectedOp := []map[string]interface{}{{"object_type": "fcpool.Block", "class_id": "fcpool.Block", "size": 32, "to": "To 1", "from": "From 1"}, {"object_type": "fcpool.Block", "class_id": "fcpool.Block", "size": 32, "to": "To 2", "from": "From 2"}} + expectedOp := []map[string]interface{}{{"from": "From 1", "object_type": "fcpool.Block", "class_id": "fcpool.Block", "size": 32, "to": "To 1"}, {"from": "From 2", "object_type": "fcpool.Block", "class_id": "fcpool.Block", "size": 32, "to": "To 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -2264,7 +2264,7 @@ func TestFlattenListFcpoolFcBlockRelationship(t *testing.T) { func TestFlattenListFirmwareBaseImpact(t *testing.T) { p := []models.FirmwareBaseImpact{} var d = &schema.ResourceData{} - c := `{"ImpactType":"ImpactType %d","ClassId":"firmware.BaseImpact","ObjectType":"firmware.BaseImpact","ComputationError":"ComputationError %d","Model":"Model %d","DomainName":"DomainName %d","EndPoint":"EndPoint %d","TargetFirmwareVersion":"TargetFirmwareVersion %d","FirmwareVersion":"FirmwareVersion %d","VersionImpact":"VersionImpact %d","ComputationStatusDetail":"ComputationStatusDetail %d"}` + c := `{"FirmwareVersion":"FirmwareVersion %d","DomainName":"DomainName %d","VersionImpact":"VersionImpact %d","ComputationError":"ComputationError %d","ImpactType":"ImpactType %d","Model":"Model %d","ObjectType":"firmware.BaseImpact","ClassId":"firmware.BaseImpact","EndPoint":"EndPoint %d","TargetFirmwareVersion":"TargetFirmwareVersion %d","ComputationStatusDetail":"ComputationStatusDetail %d"}` //test when the response is empty ffOpEmpty := flattenListFirmwareBaseImpact(p, d) @@ -2279,7 +2279,7 @@ func TestFlattenListFirmwareBaseImpact(t *testing.T) { p = append(p, x) } ffOp := flattenListFirmwareBaseImpact(p, d) - expectedOp := []map[string]interface{}{{"impact_type": "ImpactType 1", "class_id": "firmware.BaseImpact", "object_type": "firmware.BaseImpact", "computation_error": "ComputationError 1", "model": "Model 1", "domain_name": "DomainName 1", "end_point": "EndPoint 1", "target_firmware_version": "TargetFirmwareVersion 1", "firmware_version": "FirmwareVersion 1", "version_impact": "VersionImpact 1", "computation_status_detail": "ComputationStatusDetail 1"}, {"impact_type": "ImpactType 2", "class_id": "firmware.BaseImpact", "object_type": "firmware.BaseImpact", "computation_error": "ComputationError 2", "model": "Model 2", "domain_name": "DomainName 2", "end_point": "EndPoint 2", "target_firmware_version": "TargetFirmwareVersion 2", "firmware_version": "FirmwareVersion 2", "version_impact": "VersionImpact 2", "computation_status_detail": "ComputationStatusDetail 2"}} + expectedOp := []map[string]interface{}{{"firmware_version": "FirmwareVersion 1", "domain_name": "DomainName 1", "version_impact": "VersionImpact 1", "computation_error": "ComputationError 1", "impact_type": "ImpactType 1", "model": "Model 1", "object_type": "firmware.BaseImpact", "class_id": "firmware.BaseImpact", "end_point": "EndPoint 1", "target_firmware_version": "TargetFirmwareVersion 1", "computation_status_detail": "ComputationStatusDetail 1"}, {"firmware_version": "FirmwareVersion 2", "domain_name": "DomainName 2", "version_impact": "VersionImpact 2", "computation_error": "ComputationError 2", "impact_type": "ImpactType 2", "model": "Model 2", "object_type": "firmware.BaseImpact", "class_id": "firmware.BaseImpact", "end_point": "EndPoint 2", "target_firmware_version": "TargetFirmwareVersion 2", "computation_status_detail": "ComputationStatusDetail 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -2288,7 +2288,7 @@ func TestFlattenListFirmwareBaseImpact(t *testing.T) { func TestFlattenListFirmwareComponentMeta(t *testing.T) { p := []models.FirmwareComponentMeta{} var d = &schema.ResourceData{} - c := `{"ClassId":"firmware.ComponentMeta","Description":"Description %d","ComponentLabel":"ComponentLabel %d","Disruption":"Disruption %d","PackedVersion":"PackedVersion %d","Model":"Model %d","IsOobSupported":true,"Vendor":"Vendor %d","ObjectType":"firmware.ComponentMeta","ImagePath":"ImagePath %d","ComponentType":"ComponentType %d","RedfishUrl":"RedfishUrl %d"}` + c := `{"Vendor":"Vendor %d","RedfishUrl":"RedfishUrl %d","ComponentLabel":"ComponentLabel %d","ClassId":"firmware.ComponentMeta","Description":"Description %d","IsOobSupported":true,"Disruption":"Disruption %d","Model":"Model %d","ObjectType":"firmware.ComponentMeta","ImagePath":"ImagePath %d","ComponentType":"ComponentType %d","PackedVersion":"PackedVersion %d"}` //test when the response is empty ffOpEmpty := flattenListFirmwareComponentMeta(p, d) @@ -2303,7 +2303,7 @@ func TestFlattenListFirmwareComponentMeta(t *testing.T) { p = append(p, x) } ffOp := flattenListFirmwareComponentMeta(p, d) - expectedOp := []map[string]interface{}{{"class_id": "firmware.ComponentMeta", "description": "Description 1", "component_label": "ComponentLabel 1", "disruption": "Disruption 1", "packed_version": "PackedVersion 1", "model": "Model 1", "is_oob_supported": true, "vendor": "Vendor 1", "object_type": "firmware.ComponentMeta", "image_path": "ImagePath 1", "component_type": "ComponentType 1", "redfish_url": "RedfishUrl 1"}, {"class_id": "firmware.ComponentMeta", "description": "Description 2", "component_label": "ComponentLabel 2", "disruption": "Disruption 2", "packed_version": "PackedVersion 2", "model": "Model 2", "is_oob_supported": true, "vendor": "Vendor 2", "object_type": "firmware.ComponentMeta", "image_path": "ImagePath 2", "component_type": "ComponentType 2", "redfish_url": "RedfishUrl 2"}} + expectedOp := []map[string]interface{}{{"vendor": "Vendor 1", "redfish_url": "RedfishUrl 1", "component_label": "ComponentLabel 1", "class_id": "firmware.ComponentMeta", "description": "Description 1", "is_oob_supported": true, "disruption": "Disruption 1", "model": "Model 1", "object_type": "firmware.ComponentMeta", "image_path": "ImagePath 1", "component_type": "ComponentType 1", "packed_version": "PackedVersion 1"}, {"vendor": "Vendor 2", "redfish_url": "RedfishUrl 2", "component_label": "ComponentLabel 2", "class_id": "firmware.ComponentMeta", "description": "Description 2", "is_oob_supported": true, "disruption": "Disruption 2", "model": "Model 2", "object_type": "firmware.ComponentMeta", "image_path": "ImagePath 2", "component_type": "ComponentType 2", "packed_version": "PackedVersion 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -2336,7 +2336,7 @@ func TestFlattenListFirmwareDistributableMetaRelationship(t *testing.T) { func TestFlattenListFirmwareFirmwareInventory(t *testing.T) { p := []models.FirmwareFirmwareInventory{} var d = &schema.ResourceData{} - c := `{"ObjectType":"firmware.FirmwareInventory","UpdateUri":"UpdateUri %d","Category":"Category %d","Label":"Label %d","Model":"Model %d","Vendor":"Vendor %d","Version":"Version %d","ClassId":"firmware.FirmwareInventory"}` + c := `{"Vendor":"Vendor %d","Version":"Version %d","Category":"Category %d","ClassId":"firmware.FirmwareInventory","Model":"Model %d","ObjectType":"firmware.FirmwareInventory","Label":"Label %d","UpdateUri":"UpdateUri %d"}` //test when the response is empty ffOpEmpty := flattenListFirmwareFirmwareInventory(p, d) @@ -2351,7 +2351,7 @@ func TestFlattenListFirmwareFirmwareInventory(t *testing.T) { p = append(p, x) } ffOp := flattenListFirmwareFirmwareInventory(p, d) - expectedOp := []map[string]interface{}{{"object_type": "firmware.FirmwareInventory", "update_uri": "UpdateUri 1", "category": "Category 1", "label": "Label 1", "model": "Model 1", "vendor": "Vendor 1", "nr_version": "Version 1", "class_id": "firmware.FirmwareInventory"}, {"object_type": "firmware.FirmwareInventory", "update_uri": "UpdateUri 2", "category": "Category 2", "label": "Label 2", "model": "Model 2", "vendor": "Vendor 2", "nr_version": "Version 2", "class_id": "firmware.FirmwareInventory"}} + expectedOp := []map[string]interface{}{{"vendor": "Vendor 1", "nr_version": "Version 1", "category": "Category 1", "class_id": "firmware.FirmwareInventory", "model": "Model 1", "object_type": "firmware.FirmwareInventory", "label": "Label 1", "update_uri": "UpdateUri 1"}, {"vendor": "Vendor 2", "nr_version": "Version 2", "category": "Category 2", "class_id": "firmware.FirmwareInventory", "model": "Model 2", "object_type": "firmware.FirmwareInventory", "label": "Label 2", "update_uri": "UpdateUri 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -2432,7 +2432,7 @@ func TestFlattenListGraphicsCardRelationship(t *testing.T) { func TestFlattenListGraphicsControllerRelationship(t *testing.T) { p := []models.GraphicsControllerRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListGraphicsControllerRelationship(p, d) @@ -2447,7 +2447,7 @@ func TestFlattenListGraphicsControllerRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListGraphicsControllerRelationship(p, d) - expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"}, {"object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -2456,7 +2456,7 @@ func TestFlattenListGraphicsControllerRelationship(t *testing.T) { func TestFlattenListHclConstraint(t *testing.T) { p := []models.HclConstraint{} var d = &schema.ResourceData{} - c := `{"ObjectType":"hcl.Constraint","ClassId":"hcl.Constraint","ConstraintName":"ConstraintName %d","ConstraintValue":"ConstraintValue %d"}` + c := `{"ConstraintName":"ConstraintName %d","ConstraintValue":"ConstraintValue %d","ObjectType":"hcl.Constraint","ClassId":"hcl.Constraint"}` //test when the response is empty ffOpEmpty := flattenListHclConstraint(p, d) @@ -2471,7 +2471,7 @@ func TestFlattenListHclConstraint(t *testing.T) { p = append(p, x) } ffOp := flattenListHclConstraint(p, d) - expectedOp := []map[string]interface{}{{"object_type": "hcl.Constraint", "class_id": "hcl.Constraint", "constraint_name": "ConstraintName 1", "constraint_value": "ConstraintValue 1"}, {"object_type": "hcl.Constraint", "class_id": "hcl.Constraint", "constraint_name": "ConstraintName 2", "constraint_value": "ConstraintValue 2"}} + expectedOp := []map[string]interface{}{{"constraint_name": "ConstraintName 1", "constraint_value": "ConstraintValue 1", "object_type": "hcl.Constraint", "class_id": "hcl.Constraint"}, {"constraint_name": "ConstraintName 2", "constraint_value": "ConstraintValue 2", "object_type": "hcl.Constraint", "class_id": "hcl.Constraint"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -2528,7 +2528,7 @@ func TestFlattenListHclOperatingSystemRelationship(t *testing.T) { func TestFlattenListHyperflexAlarmRelationship(t *testing.T) { p := []models.HyperflexAlarmRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenListHyperflexAlarmRelationship(p, d) @@ -2543,7 +2543,7 @@ func TestFlattenListHyperflexAlarmRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListHyperflexAlarmRelationship(p, d) - expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -2576,7 +2576,7 @@ func TestFlattenListHyperflexBaseClusterRelationship(t *testing.T) { func TestFlattenListHyperflexCapabilityInfoRelationship(t *testing.T) { p := []models.HyperflexCapabilityInfoRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListHyperflexCapabilityInfoRelationship(p, d) @@ -2591,7 +2591,7 @@ func TestFlattenListHyperflexCapabilityInfoRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListHyperflexCapabilityInfoRelationship(p, d) - expectedOp := []map[string]interface{}{{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"}, {"object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -2600,7 +2600,7 @@ func TestFlattenListHyperflexCapabilityInfoRelationship(t *testing.T) { func TestFlattenListHyperflexClusterProfileRelationship(t *testing.T) { p := []models.HyperflexClusterProfileRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenListHyperflexClusterProfileRelationship(p, d) @@ -2615,7 +2615,7 @@ func TestFlattenListHyperflexClusterProfileRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListHyperflexClusterProfileRelationship(p, d) - expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} + expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -2648,7 +2648,7 @@ func TestFlattenListHyperflexConfigResultEntryRelationship(t *testing.T) { func TestFlattenListHyperflexDriveRelationship(t *testing.T) { p := []models.HyperflexDriveRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListHyperflexDriveRelationship(p, d) @@ -2663,7 +2663,7 @@ func TestFlattenListHyperflexDriveRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListHyperflexDriveRelationship(p, d) - expectedOp := []map[string]interface{}{{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"}, {"object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -2696,7 +2696,7 @@ func TestFlattenListHyperflexFeatureLimitEntry(t *testing.T) { func TestFlattenListHyperflexHealthCheckScriptInfo(t *testing.T) { p := []models.HyperflexHealthCheckScriptInfo{} var d = &schema.ResourceData{} - c := `{"ClassId":"hyperflex.HealthCheckScriptInfo","ScriptInput":"ScriptInput %d","ScriptName":"ScriptName %d","AggregateScriptName":"AggregateScriptName %d","HyperflexVersion":"HyperflexVersion %d","ObjectType":"hyperflex.HealthCheckScriptInfo","Version":"Version %d","ScriptExecuteLocation":"ScriptExecuteLocation %d"}` + c := `{"ClassId":"hyperflex.HealthCheckScriptInfo","AggregateScriptName":"AggregateScriptName %d","HyperflexVersion":"HyperflexVersion %d","ScriptExecuteLocation":"ScriptExecuteLocation %d","ScriptInput":"ScriptInput %d","Version":"Version %d","ObjectType":"hyperflex.HealthCheckScriptInfo","ScriptName":"ScriptName %d"}` //test when the response is empty ffOpEmpty := flattenListHyperflexHealthCheckScriptInfo(p, d) @@ -2711,7 +2711,7 @@ func TestFlattenListHyperflexHealthCheckScriptInfo(t *testing.T) { p = append(p, x) } ffOp := flattenListHyperflexHealthCheckScriptInfo(p, d) - expectedOp := []map[string]interface{}{{"class_id": "hyperflex.HealthCheckScriptInfo", "script_input": "ScriptInput 1", "script_name": "ScriptName 1", "aggregate_script_name": "AggregateScriptName 1", "hyperflex_version": "HyperflexVersion 1", "object_type": "hyperflex.HealthCheckScriptInfo", "nr_version": "Version 1", "script_execute_location": "ScriptExecuteLocation 1"}, {"class_id": "hyperflex.HealthCheckScriptInfo", "script_input": "ScriptInput 2", "script_name": "ScriptName 2", "aggregate_script_name": "AggregateScriptName 2", "hyperflex_version": "HyperflexVersion 2", "object_type": "hyperflex.HealthCheckScriptInfo", "nr_version": "Version 2", "script_execute_location": "ScriptExecuteLocation 2"}} + expectedOp := []map[string]interface{}{{"class_id": "hyperflex.HealthCheckScriptInfo", "aggregate_script_name": "AggregateScriptName 1", "hyperflex_version": "HyperflexVersion 1", "script_execute_location": "ScriptExecuteLocation 1", "script_input": "ScriptInput 1", "nr_version": "Version 1", "object_type": "hyperflex.HealthCheckScriptInfo", "script_name": "ScriptName 1"}, {"class_id": "hyperflex.HealthCheckScriptInfo", "aggregate_script_name": "AggregateScriptName 2", "hyperflex_version": "HyperflexVersion 2", "script_execute_location": "ScriptExecuteLocation 2", "script_input": "ScriptInput 2", "nr_version": "Version 2", "object_type": "hyperflex.HealthCheckScriptInfo", "script_name": "ScriptName 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -2720,7 +2720,7 @@ func TestFlattenListHyperflexHealthCheckScriptInfo(t *testing.T) { func TestFlattenListHyperflexHxHostMountStatusDt(t *testing.T) { p := []models.HyperflexHxHostMountStatusDt{} var d = &schema.ResourceData{} - c := `{"ClassId":"hyperflex.HxHostMountStatusDt","ObjectType":"hyperflex.HxHostMountStatusDt","Accessibility":"Accessibility %d","HostName":"HostName %d","Mounted":true,"Reason":"Reason %d"}` + c := `{"Mounted":true,"Reason":"Reason %d","Accessibility":"Accessibility %d","ObjectType":"hyperflex.HxHostMountStatusDt","ClassId":"hyperflex.HxHostMountStatusDt","HostName":"HostName %d"}` //test when the response is empty ffOpEmpty := flattenListHyperflexHxHostMountStatusDt(p, d) @@ -2735,7 +2735,7 @@ func TestFlattenListHyperflexHxHostMountStatusDt(t *testing.T) { p = append(p, x) } ffOp := flattenListHyperflexHxHostMountStatusDt(p, d) - expectedOp := []map[string]interface{}{{"class_id": "hyperflex.HxHostMountStatusDt", "object_type": "hyperflex.HxHostMountStatusDt", "accessibility": "Accessibility 1", "host_name": "HostName 1", "mounted": true, "reason": "Reason 1"}, {"class_id": "hyperflex.HxHostMountStatusDt", "object_type": "hyperflex.HxHostMountStatusDt", "accessibility": "Accessibility 2", "host_name": "HostName 2", "mounted": true, "reason": "Reason 2"}} + expectedOp := []map[string]interface{}{{"mounted": true, "reason": "Reason 1", "accessibility": "Accessibility 1", "object_type": "hyperflex.HxHostMountStatusDt", "class_id": "hyperflex.HxHostMountStatusDt", "host_name": "HostName 1"}, {"mounted": true, "reason": "Reason 2", "accessibility": "Accessibility 2", "object_type": "hyperflex.HxHostMountStatusDt", "class_id": "hyperflex.HxHostMountStatusDt", "host_name": "HostName 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -2744,7 +2744,7 @@ func TestFlattenListHyperflexHxHostMountStatusDt(t *testing.T) { func TestFlattenListHyperflexHxZoneResiliencyInfoDt(t *testing.T) { p := []models.HyperflexHxZoneResiliencyInfoDt{} var d = &schema.ResourceData{} - c := `{"ObjectType":"hyperflex.HxZoneResiliencyInfoDt","ClassId":"hyperflex.HxZoneResiliencyInfoDt","Name":"Name %d"}` + c := `{"ClassId":"hyperflex.HxZoneResiliencyInfoDt","ObjectType":"hyperflex.HxZoneResiliencyInfoDt","Name":"Name %d"}` //test when the response is empty ffOpEmpty := flattenListHyperflexHxZoneResiliencyInfoDt(p, d) @@ -2759,7 +2759,7 @@ func TestFlattenListHyperflexHxZoneResiliencyInfoDt(t *testing.T) { p = append(p, x) } ffOp := flattenListHyperflexHxZoneResiliencyInfoDt(p, d) - expectedOp := []map[string]interface{}{{"object_type": "hyperflex.HxZoneResiliencyInfoDt", "class_id": "hyperflex.HxZoneResiliencyInfoDt", "name": "Name 1"}, {"object_type": "hyperflex.HxZoneResiliencyInfoDt", "class_id": "hyperflex.HxZoneResiliencyInfoDt", "name": "Name 2"}} + expectedOp := []map[string]interface{}{{"class_id": "hyperflex.HxZoneResiliencyInfoDt", "object_type": "hyperflex.HxZoneResiliencyInfoDt", "name": "Name 1"}, {"class_id": "hyperflex.HxZoneResiliencyInfoDt", "object_type": "hyperflex.HxZoneResiliencyInfoDt", "name": "Name 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -2768,7 +2768,7 @@ func TestFlattenListHyperflexHxZoneResiliencyInfoDt(t *testing.T) { func TestFlattenListHyperflexHxdpVersionRelationship(t *testing.T) { p := []models.HyperflexHxdpVersionRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenListHyperflexHxdpVersionRelationship(p, d) @@ -2783,7 +2783,7 @@ func TestFlattenListHyperflexHxdpVersionRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListHyperflexHxdpVersionRelationship(p, d) - expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} + expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -2792,7 +2792,7 @@ func TestFlattenListHyperflexHxdpVersionRelationship(t *testing.T) { func TestFlattenListHyperflexIpAddrRange(t *testing.T) { p := []models.HyperflexIpAddrRange{} var d = &schema.ResourceData{} - c := `{"ClassId":"hyperflex.IpAddrRange","Netmask":"Netmask %d","StartAddr":"StartAddr %d","EndAddr":"EndAddr %d","Gateway":"Gateway %d","ObjectType":"hyperflex.IpAddrRange"}` + c := `{"EndAddr":"EndAddr %d","Gateway":"Gateway %d","Netmask":"Netmask %d","StartAddr":"StartAddr %d","ObjectType":"hyperflex.IpAddrRange","ClassId":"hyperflex.IpAddrRange"}` //test when the response is empty ffOpEmpty := flattenListHyperflexIpAddrRange(p, d) @@ -2807,7 +2807,7 @@ func TestFlattenListHyperflexIpAddrRange(t *testing.T) { p = append(p, x) } ffOp := flattenListHyperflexIpAddrRange(p, d) - expectedOp := []map[string]interface{}{{"class_id": "hyperflex.IpAddrRange", "netmask": "Netmask 1", "start_addr": "StartAddr 1", "end_addr": "EndAddr 1", "gateway": "Gateway 1", "object_type": "hyperflex.IpAddrRange"}, {"class_id": "hyperflex.IpAddrRange", "netmask": "Netmask 2", "start_addr": "StartAddr 2", "end_addr": "EndAddr 2", "gateway": "Gateway 2", "object_type": "hyperflex.IpAddrRange"}} + expectedOp := []map[string]interface{}{{"end_addr": "EndAddr 1", "gateway": "Gateway 1", "netmask": "Netmask 1", "start_addr": "StartAddr 1", "object_type": "hyperflex.IpAddrRange", "class_id": "hyperflex.IpAddrRange"}, {"end_addr": "EndAddr 2", "gateway": "Gateway 2", "netmask": "Netmask 2", "start_addr": "StartAddr 2", "object_type": "hyperflex.IpAddrRange", "class_id": "hyperflex.IpAddrRange"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -2816,7 +2816,7 @@ func TestFlattenListHyperflexIpAddrRange(t *testing.T) { func TestFlattenListHyperflexMapClusterIdToProtectionInfo(t *testing.T) { p := []models.HyperflexMapClusterIdToProtectionInfo{} var d = &schema.ResourceData{} - c := `{"ClusterId":"ClusterId %d","ObjectType":"hyperflex.MapClusterIdToProtectionInfo","ClassId":"hyperflex.MapClusterIdToProtectionInfo"}` + c := `{"ObjectType":"hyperflex.MapClusterIdToProtectionInfo","ClassId":"hyperflex.MapClusterIdToProtectionInfo","ClusterId":"ClusterId %d"}` //test when the response is empty ffOpEmpty := flattenListHyperflexMapClusterIdToProtectionInfo(p, d) @@ -2831,7 +2831,7 @@ func TestFlattenListHyperflexMapClusterIdToProtectionInfo(t *testing.T) { p = append(p, x) } ffOp := flattenListHyperflexMapClusterIdToProtectionInfo(p, d) - expectedOp := []map[string]interface{}{{"cluster_id": "ClusterId 1", "object_type": "hyperflex.MapClusterIdToProtectionInfo", "class_id": "hyperflex.MapClusterIdToProtectionInfo"}, {"cluster_id": "ClusterId 2", "object_type": "hyperflex.MapClusterIdToProtectionInfo", "class_id": "hyperflex.MapClusterIdToProtectionInfo"}} + expectedOp := []map[string]interface{}{{"object_type": "hyperflex.MapClusterIdToProtectionInfo", "class_id": "hyperflex.MapClusterIdToProtectionInfo", "cluster_id": "ClusterId 1"}, {"object_type": "hyperflex.MapClusterIdToProtectionInfo", "class_id": "hyperflex.MapClusterIdToProtectionInfo", "cluster_id": "ClusterId 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -2864,7 +2864,7 @@ func TestFlattenListHyperflexMapClusterIdToStSnapshotPoint(t *testing.T) { func TestFlattenListHyperflexNamedVlan(t *testing.T) { p := []models.HyperflexNamedVlan{} var d = &schema.ResourceData{} - c := `{"VlanId":32,"ClassId":"hyperflex.NamedVlan","ObjectType":"hyperflex.NamedVlan","Name":"Name %d"}` + c := `{"ObjectType":"hyperflex.NamedVlan","Name":"Name %d","VlanId":32,"ClassId":"hyperflex.NamedVlan"}` //test when the response is empty ffOpEmpty := flattenListHyperflexNamedVlan(p, d) @@ -2879,7 +2879,7 @@ func TestFlattenListHyperflexNamedVlan(t *testing.T) { p = append(p, x) } ffOp := flattenListHyperflexNamedVlan(p, d) - expectedOp := []map[string]interface{}{{"vlan_id": 32, "class_id": "hyperflex.NamedVlan", "object_type": "hyperflex.NamedVlan", "name": "Name 1"}, {"vlan_id": 32, "class_id": "hyperflex.NamedVlan", "object_type": "hyperflex.NamedVlan", "name": "Name 2"}} + expectedOp := []map[string]interface{}{{"object_type": "hyperflex.NamedVlan", "name": "Name 1", "vlan_id": 32, "class_id": "hyperflex.NamedVlan"}, {"object_type": "hyperflex.NamedVlan", "name": "Name 2", "vlan_id": 32, "class_id": "hyperflex.NamedVlan"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -2912,7 +2912,7 @@ func TestFlattenListHyperflexNodeRelationship(t *testing.T) { func TestFlattenListHyperflexNodeProfileRelationship(t *testing.T) { p := []models.HyperflexNodeProfileRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListHyperflexNodeProfileRelationship(p, d) @@ -2927,7 +2927,7 @@ func TestFlattenListHyperflexNodeProfileRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListHyperflexNodeProfileRelationship(p, d) - expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"}, {"object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -2960,7 +2960,7 @@ func TestFlattenListHyperflexReplicationClusterReferenceToSchedule(t *testing.T) func TestFlattenListHyperflexServerFirmwareVersionEntryRelationship(t *testing.T) { p := []models.HyperflexServerFirmwareVersionEntryRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenListHyperflexServerFirmwareVersionEntryRelationship(p, d) @@ -2975,7 +2975,7 @@ func TestFlattenListHyperflexServerFirmwareVersionEntryRelationship(t *testing.T p = append(p, x) } ffOp := flattenListHyperflexServerFirmwareVersionEntryRelationship(p, d) - expectedOp := []map[string]interface{}{{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"}, {"object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -2984,7 +2984,7 @@ func TestFlattenListHyperflexServerFirmwareVersionEntryRelationship(t *testing.T func TestFlattenListHyperflexServerFirmwareVersionInfo(t *testing.T) { p := []models.HyperflexServerFirmwareVersionInfo{} var d = &schema.ResourceData{} - c := `{"ClassId":"hyperflex.ServerFirmwareVersionInfo","ObjectType":"hyperflex.ServerFirmwareVersionInfo","ServerPlatform":"ServerPlatform %d","Version":"Version %d"}` + c := `{"ClassId":"hyperflex.ServerFirmwareVersionInfo","ServerPlatform":"ServerPlatform %d","Version":"Version %d","ObjectType":"hyperflex.ServerFirmwareVersionInfo"}` //test when the response is empty ffOpEmpty := flattenListHyperflexServerFirmwareVersionInfo(p, d) @@ -2999,7 +2999,7 @@ func TestFlattenListHyperflexServerFirmwareVersionInfo(t *testing.T) { p = append(p, x) } ffOp := flattenListHyperflexServerFirmwareVersionInfo(p, d) - expectedOp := []map[string]interface{}{{"class_id": "hyperflex.ServerFirmwareVersionInfo", "object_type": "hyperflex.ServerFirmwareVersionInfo", "server_platform": "ServerPlatform 1", "nr_version": "Version 1"}, {"class_id": "hyperflex.ServerFirmwareVersionInfo", "object_type": "hyperflex.ServerFirmwareVersionInfo", "server_platform": "ServerPlatform 2", "nr_version": "Version 2"}} + expectedOp := []map[string]interface{}{{"class_id": "hyperflex.ServerFirmwareVersionInfo", "server_platform": "ServerPlatform 1", "nr_version": "Version 1", "object_type": "hyperflex.ServerFirmwareVersionInfo"}, {"class_id": "hyperflex.ServerFirmwareVersionInfo", "server_platform": "ServerPlatform 2", "nr_version": "Version 2", "object_type": "hyperflex.ServerFirmwareVersionInfo"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -3032,7 +3032,7 @@ func TestFlattenListHyperflexServerModelEntry(t *testing.T) { func TestFlattenListHyperflexSoftwareDistributionComponentRelationship(t *testing.T) { p := []models.HyperflexSoftwareDistributionComponentRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListHyperflexSoftwareDistributionComponentRelationship(p, d) @@ -3047,7 +3047,7 @@ func TestFlattenListHyperflexSoftwareDistributionComponentRelationship(t *testin p = append(p, x) } ffOp := flattenListHyperflexSoftwareDistributionComponentRelationship(p, d) - expectedOp := []map[string]interface{}{{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"}, {"object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -3056,7 +3056,7 @@ func TestFlattenListHyperflexSoftwareDistributionComponentRelationship(t *testin func TestFlattenListHyperflexSoftwareDistributionEntryRelationship(t *testing.T) { p := []models.HyperflexSoftwareDistributionEntryRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenListHyperflexSoftwareDistributionEntryRelationship(p, d) @@ -3071,7 +3071,7 @@ func TestFlattenListHyperflexSoftwareDistributionEntryRelationship(t *testing.T) p = append(p, x) } ffOp := flattenListHyperflexSoftwareDistributionEntryRelationship(p, d) - expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} + expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -3104,7 +3104,7 @@ func TestFlattenListHyperflexSoftwareDistributionVersionRelationship(t *testing. func TestFlattenListHyperflexVolumeRelationship(t *testing.T) { p := []models.HyperflexVolumeRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenListHyperflexVolumeRelationship(p, d) @@ -3119,7 +3119,7 @@ func TestFlattenListHyperflexVolumeRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListHyperflexVolumeRelationship(p, d) - expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} + expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -3128,7 +3128,7 @@ func TestFlattenListHyperflexVolumeRelationship(t *testing.T) { func TestFlattenListIaasConnectorPackRelationship(t *testing.T) { p := []models.IaasConnectorPackRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListIaasConnectorPackRelationship(p, d) @@ -3143,7 +3143,7 @@ func TestFlattenListIaasConnectorPackRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListIaasConnectorPackRelationship(p, d) - expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} + expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -3176,7 +3176,7 @@ func TestFlattenListIaasDeviceStatusRelationship(t *testing.T) { func TestFlattenListIaasLicenseKeysInfo(t *testing.T) { p := []models.IaasLicenseKeysInfo{} var d = &schema.ResourceData{} - c := `{"Count":32,"ExpirationDate":"ExpirationDate %d","LicenseId":"LicenseId %d","ObjectType":"iaas.LicenseKeysInfo","ClassId":"iaas.LicenseKeysInfo","Pid":"Pid %d"}` + c := `{"LicenseId":"LicenseId %d","Pid":"Pid %d","Count":32,"ObjectType":"iaas.LicenseKeysInfo","ClassId":"iaas.LicenseKeysInfo","ExpirationDate":"ExpirationDate %d"}` //test when the response is empty ffOpEmpty := flattenListIaasLicenseKeysInfo(p, d) @@ -3191,7 +3191,7 @@ func TestFlattenListIaasLicenseKeysInfo(t *testing.T) { p = append(p, x) } ffOp := flattenListIaasLicenseKeysInfo(p, d) - expectedOp := []map[string]interface{}{{"nr_count": 32, "expiration_date": "ExpirationDate 1", "license_id": "LicenseId 1", "object_type": "iaas.LicenseKeysInfo", "class_id": "iaas.LicenseKeysInfo", "pid": "Pid 1"}, {"nr_count": 32, "expiration_date": "ExpirationDate 2", "license_id": "LicenseId 2", "object_type": "iaas.LicenseKeysInfo", "class_id": "iaas.LicenseKeysInfo", "pid": "Pid 2"}} + expectedOp := []map[string]interface{}{{"license_id": "LicenseId 1", "pid": "Pid 1", "nr_count": 32, "object_type": "iaas.LicenseKeysInfo", "class_id": "iaas.LicenseKeysInfo", "expiration_date": "ExpirationDate 1"}, {"license_id": "LicenseId 2", "pid": "Pid 2", "nr_count": 32, "object_type": "iaas.LicenseKeysInfo", "class_id": "iaas.LicenseKeysInfo", "expiration_date": "ExpirationDate 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -3200,7 +3200,7 @@ func TestFlattenListIaasLicenseKeysInfo(t *testing.T) { func TestFlattenListIaasLicenseUtilizationInfo(t *testing.T) { p := []models.IaasLicenseUtilizationInfo{} var d = &schema.ResourceData{} - c := `{"LicensedLimit":"LicensedLimit %d","ObjectType":"iaas.LicenseUtilizationInfo","ClassId":"iaas.LicenseUtilizationInfo","Sku":"Sku %d","ActualUsed":32,"Label":"Label %d"}` + c := `{"Label":"Label %d","LicensedLimit":"LicensedLimit %d","Sku":"Sku %d","ActualUsed":32,"ObjectType":"iaas.LicenseUtilizationInfo","ClassId":"iaas.LicenseUtilizationInfo"}` //test when the response is empty ffOpEmpty := flattenListIaasLicenseUtilizationInfo(p, d) @@ -3215,7 +3215,7 @@ func TestFlattenListIaasLicenseUtilizationInfo(t *testing.T) { p = append(p, x) } ffOp := flattenListIaasLicenseUtilizationInfo(p, d) - expectedOp := []map[string]interface{}{{"licensed_limit": "LicensedLimit 1", "object_type": "iaas.LicenseUtilizationInfo", "class_id": "iaas.LicenseUtilizationInfo", "sku": "Sku 1", "actual_used": 32, "label": "Label 1"}, {"licensed_limit": "LicensedLimit 2", "object_type": "iaas.LicenseUtilizationInfo", "class_id": "iaas.LicenseUtilizationInfo", "sku": "Sku 2", "actual_used": 32, "label": "Label 2"}} + expectedOp := []map[string]interface{}{{"label": "Label 1", "licensed_limit": "LicensedLimit 1", "sku": "Sku 1", "actual_used": 32, "object_type": "iaas.LicenseUtilizationInfo", "class_id": "iaas.LicenseUtilizationInfo"}, {"label": "Label 2", "licensed_limit": "LicensedLimit 2", "sku": "Sku 2", "actual_used": 32, "object_type": "iaas.LicenseUtilizationInfo", "class_id": "iaas.LicenseUtilizationInfo"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -3248,7 +3248,7 @@ func TestFlattenListIaasMostRunTasksRelationship(t *testing.T) { func TestFlattenListIaasWorkflowSteps(t *testing.T) { p := []models.IaasWorkflowSteps{} var d = &schema.ResourceData{} - c := `{"ObjectType":"iaas.WorkflowSteps","ClassId":"iaas.WorkflowSteps","CompletedTime":"CompletedTime %d","Name":"Name %d","Status":"Status %d","StatusMessage":"StatusMessage %d"}` + c := `{"ClassId":"iaas.WorkflowSteps","CompletedTime":"CompletedTime %d","Name":"Name %d","Status":"Status %d","StatusMessage":"StatusMessage %d","ObjectType":"iaas.WorkflowSteps"}` //test when the response is empty ffOpEmpty := flattenListIaasWorkflowSteps(p, d) @@ -3263,7 +3263,7 @@ func TestFlattenListIaasWorkflowSteps(t *testing.T) { p = append(p, x) } ffOp := flattenListIaasWorkflowSteps(p, d) - expectedOp := []map[string]interface{}{{"object_type": "iaas.WorkflowSteps", "class_id": "iaas.WorkflowSteps", "completed_time": "CompletedTime 1", "name": "Name 1", "status": "Status 1", "status_message": "StatusMessage 1"}, {"object_type": "iaas.WorkflowSteps", "class_id": "iaas.WorkflowSteps", "completed_time": "CompletedTime 2", "name": "Name 2", "status": "Status 2", "status_message": "StatusMessage 2"}} + expectedOp := []map[string]interface{}{{"class_id": "iaas.WorkflowSteps", "completed_time": "CompletedTime 1", "name": "Name 1", "status": "Status 1", "status_message": "StatusMessage 1", "object_type": "iaas.WorkflowSteps"}, {"class_id": "iaas.WorkflowSteps", "completed_time": "CompletedTime 2", "name": "Name 2", "status": "Status 2", "status_message": "StatusMessage 2", "object_type": "iaas.WorkflowSteps"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -3272,7 +3272,7 @@ func TestFlattenListIaasWorkflowSteps(t *testing.T) { func TestFlattenListIamAccountPermissions(t *testing.T) { p := []models.IamAccountPermissions{} var d = &schema.ResourceData{} - c := `{"AccountIdentifier":"AccountIdentifier %d","AccountName":"AccountName %d","AccountStatus":"AccountStatus %d","ObjectType":"iam.AccountPermissions","ClassId":"iam.AccountPermissions"}` + c := `{"ClassId":"iam.AccountPermissions","AccountIdentifier":"AccountIdentifier %d","AccountName":"AccountName %d","AccountStatus":"AccountStatus %d","ObjectType":"iam.AccountPermissions"}` //test when the response is empty ffOpEmpty := flattenListIamAccountPermissions(p, d) @@ -3287,7 +3287,7 @@ func TestFlattenListIamAccountPermissions(t *testing.T) { p = append(p, x) } ffOp := flattenListIamAccountPermissions(p, d) - expectedOp := []map[string]interface{}{{"account_identifier": "AccountIdentifier 1", "account_name": "AccountName 1", "account_status": "AccountStatus 1", "object_type": "iam.AccountPermissions", "class_id": "iam.AccountPermissions"}, {"account_identifier": "AccountIdentifier 2", "account_name": "AccountName 2", "account_status": "AccountStatus 2", "object_type": "iam.AccountPermissions", "class_id": "iam.AccountPermissions"}} + expectedOp := []map[string]interface{}{{"class_id": "iam.AccountPermissions", "account_identifier": "AccountIdentifier 1", "account_name": "AccountName 1", "account_status": "AccountStatus 1", "object_type": "iam.AccountPermissions"}, {"class_id": "iam.AccountPermissions", "account_identifier": "AccountIdentifier 2", "account_name": "AccountName 2", "account_status": "AccountStatus 2", "object_type": "iam.AccountPermissions"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -3296,7 +3296,7 @@ func TestFlattenListIamAccountPermissions(t *testing.T) { func TestFlattenListIamApiKeyRelationship(t *testing.T) { p := []models.IamApiKeyRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenListIamApiKeyRelationship(p, d) @@ -3311,7 +3311,7 @@ func TestFlattenListIamApiKeyRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListIamApiKeyRelationship(p, d) - expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -3320,7 +3320,7 @@ func TestFlattenListIamApiKeyRelationship(t *testing.T) { func TestFlattenListIamAppRegistrationRelationship(t *testing.T) { p := []models.IamAppRegistrationRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenListIamAppRegistrationRelationship(p, d) @@ -3335,7 +3335,7 @@ func TestFlattenListIamAppRegistrationRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListIamAppRegistrationRelationship(p, d) - expectedOp := []map[string]interface{}{{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"}, {"object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -3344,7 +3344,7 @@ func TestFlattenListIamAppRegistrationRelationship(t *testing.T) { func TestFlattenListIamDomainGroupRelationship(t *testing.T) { p := []models.IamDomainGroupRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenListIamDomainGroupRelationship(p, d) @@ -3359,7 +3359,7 @@ func TestFlattenListIamDomainGroupRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListIamDomainGroupRelationship(p, d) - expectedOp := []map[string]interface{}{{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"}, {"object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -3368,7 +3368,7 @@ func TestFlattenListIamDomainGroupRelationship(t *testing.T) { func TestFlattenListIamEndPointPrivilegeRelationship(t *testing.T) { p := []models.IamEndPointPrivilegeRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListIamEndPointPrivilegeRelationship(p, d) @@ -3383,7 +3383,7 @@ func TestFlattenListIamEndPointPrivilegeRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListIamEndPointPrivilegeRelationship(p, d) - expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"}, {"object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -3392,7 +3392,7 @@ func TestFlattenListIamEndPointPrivilegeRelationship(t *testing.T) { func TestFlattenListIamEndPointRoleRelationship(t *testing.T) { p := []models.IamEndPointRoleRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenListIamEndPointRoleRelationship(p, d) @@ -3407,7 +3407,7 @@ func TestFlattenListIamEndPointRoleRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListIamEndPointRoleRelationship(p, d) - expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} + expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -3440,7 +3440,7 @@ func TestFlattenListIamEndPointUserRoleRelationship(t *testing.T) { func TestFlattenListIamFeatureDefinition(t *testing.T) { p := []models.IamFeatureDefinition{} var d = &schema.ResourceData{} - c := `{"ObjectType":"iam.FeatureDefinition","ClassId":"iam.FeatureDefinition","Feature":"Feature %d"}` + c := `{"ClassId":"iam.FeatureDefinition","Feature":"Feature %d","ObjectType":"iam.FeatureDefinition"}` //test when the response is empty ffOpEmpty := flattenListIamFeatureDefinition(p, d) @@ -3455,7 +3455,7 @@ func TestFlattenListIamFeatureDefinition(t *testing.T) { p = append(p, x) } ffOp := flattenListIamFeatureDefinition(p, d) - expectedOp := []map[string]interface{}{{"object_type": "iam.FeatureDefinition", "class_id": "iam.FeatureDefinition", "feature": "Feature 1"}, {"object_type": "iam.FeatureDefinition", "class_id": "iam.FeatureDefinition", "feature": "Feature 2"}} + expectedOp := []map[string]interface{}{{"class_id": "iam.FeatureDefinition", "feature": "Feature 1", "object_type": "iam.FeatureDefinition"}, {"class_id": "iam.FeatureDefinition", "feature": "Feature 2", "object_type": "iam.FeatureDefinition"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -3488,7 +3488,7 @@ func TestFlattenListIamGroupPermissionToRoles(t *testing.T) { func TestFlattenListIamIdpRelationship(t *testing.T) { p := []models.IamIdpRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenListIamIdpRelationship(p, d) @@ -3503,7 +3503,7 @@ func TestFlattenListIamIdpRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListIamIdpRelationship(p, d) - expectedOp := []map[string]interface{}{{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"}, {"object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -3512,7 +3512,7 @@ func TestFlattenListIamIdpRelationship(t *testing.T) { func TestFlattenListIamIdpReferenceRelationship(t *testing.T) { p := []models.IamIdpReferenceRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenListIamIdpReferenceRelationship(p, d) @@ -3527,7 +3527,7 @@ func TestFlattenListIamIdpReferenceRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListIamIdpReferenceRelationship(p, d) - expectedOp := []map[string]interface{}{{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"}, {"object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -3536,7 +3536,7 @@ func TestFlattenListIamIdpReferenceRelationship(t *testing.T) { func TestFlattenListIamIpAddressRelationship(t *testing.T) { p := []models.IamIpAddressRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListIamIpAddressRelationship(p, d) @@ -3551,7 +3551,7 @@ func TestFlattenListIamIpAddressRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListIamIpAddressRelationship(p, d) - expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} + expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -3584,7 +3584,7 @@ func TestFlattenListIamLdapGroupRelationship(t *testing.T) { func TestFlattenListIamLdapProviderRelationship(t *testing.T) { p := []models.IamLdapProviderRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenListIamLdapProviderRelationship(p, d) @@ -3599,7 +3599,7 @@ func TestFlattenListIamLdapProviderRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListIamLdapProviderRelationship(p, d) - expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -3608,7 +3608,7 @@ func TestFlattenListIamLdapProviderRelationship(t *testing.T) { func TestFlattenListIamOAuthTokenRelationship(t *testing.T) { p := []models.IamOAuthTokenRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenListIamOAuthTokenRelationship(p, d) @@ -3623,7 +3623,7 @@ func TestFlattenListIamOAuthTokenRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListIamOAuthTokenRelationship(p, d) - expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -3632,7 +3632,7 @@ func TestFlattenListIamOAuthTokenRelationship(t *testing.T) { func TestFlattenListIamPermissionRelationship(t *testing.T) { p := []models.IamPermissionRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenListIamPermissionRelationship(p, d) @@ -3647,7 +3647,7 @@ func TestFlattenListIamPermissionRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListIamPermissionRelationship(p, d) - expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} + expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -3656,7 +3656,7 @@ func TestFlattenListIamPermissionRelationship(t *testing.T) { func TestFlattenListIamPermissionToRoles(t *testing.T) { p := []models.IamPermissionToRoles{} var d = &schema.ResourceData{} - c := `{"ClassId":"iam.PermissionToRoles","ObjectType":"iam.PermissionToRoles"}` + c := `{"ObjectType":"iam.PermissionToRoles","ClassId":"iam.PermissionToRoles"}` //test when the response is empty ffOpEmpty := flattenListIamPermissionToRoles(p, d) @@ -3671,7 +3671,7 @@ func TestFlattenListIamPermissionToRoles(t *testing.T) { p = append(p, x) } ffOp := flattenListIamPermissionToRoles(p, d) - expectedOp := []map[string]interface{}{{"class_id": "iam.PermissionToRoles", "object_type": "iam.PermissionToRoles"}, {"class_id": "iam.PermissionToRoles", "object_type": "iam.PermissionToRoles"}} + expectedOp := []map[string]interface{}{{"object_type": "iam.PermissionToRoles", "class_id": "iam.PermissionToRoles"}, {"object_type": "iam.PermissionToRoles", "class_id": "iam.PermissionToRoles"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -3704,7 +3704,7 @@ func TestFlattenListIamPrivilegeRelationship(t *testing.T) { func TestFlattenListIamPrivilegeSetRelationship(t *testing.T) { p := []models.IamPrivilegeSetRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenListIamPrivilegeSetRelationship(p, d) @@ -3719,7 +3719,7 @@ func TestFlattenListIamPrivilegeSetRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListIamPrivilegeSetRelationship(p, d) - expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} + expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -3728,7 +3728,7 @@ func TestFlattenListIamPrivilegeSetRelationship(t *testing.T) { func TestFlattenListIamResourcePermissionRelationship(t *testing.T) { p := []models.IamResourcePermissionRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListIamResourcePermissionRelationship(p, d) @@ -3743,7 +3743,7 @@ func TestFlattenListIamResourcePermissionRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListIamResourcePermissionRelationship(p, d) - expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} + expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -3752,7 +3752,7 @@ func TestFlattenListIamResourcePermissionRelationship(t *testing.T) { func TestFlattenListIamResourceRolesRelationship(t *testing.T) { p := []models.IamResourceRolesRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListIamResourceRolesRelationship(p, d) @@ -3767,7 +3767,7 @@ func TestFlattenListIamResourceRolesRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListIamResourceRolesRelationship(p, d) - expectedOp := []map[string]interface{}{{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"}, {"object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -3776,7 +3776,7 @@ func TestFlattenListIamResourceRolesRelationship(t *testing.T) { func TestFlattenListIamRoleRelationship(t *testing.T) { p := []models.IamRoleRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListIamRoleRelationship(p, d) @@ -3791,7 +3791,7 @@ func TestFlattenListIamRoleRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListIamRoleRelationship(p, d) - expectedOp := []map[string]interface{}{{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"}, {"object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -3848,7 +3848,7 @@ func TestFlattenListIamUserRelationship(t *testing.T) { func TestFlattenListIamUserGroupRelationship(t *testing.T) { p := []models.IamUserGroupRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListIamUserGroupRelationship(p, d) @@ -3863,7 +3863,7 @@ func TestFlattenListIamUserGroupRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListIamUserGroupRelationship(p, d) - expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"}, {"object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -3920,7 +3920,7 @@ func TestFlattenListInfraBaseClusterRelationship(t *testing.T) { func TestFlattenListInfraMetaData(t *testing.T) { p := []models.InfraMetaData{} var d = &schema.ResourceData{} - c := `{"ObjectType":"infra.MetaData","ClassId":"infra.MetaData","Name":"Name %d","Value":"Value %d"}` + c := `{"Value":"Value %d","ObjectType":"infra.MetaData","ClassId":"infra.MetaData","Name":"Name %d"}` //test when the response is empty ffOpEmpty := flattenListInfraMetaData(p, d) @@ -3935,7 +3935,7 @@ func TestFlattenListInfraMetaData(t *testing.T) { p = append(p, x) } ffOp := flattenListInfraMetaData(p, d) - expectedOp := []map[string]interface{}{{"object_type": "infra.MetaData", "class_id": "infra.MetaData", "name": "Name 1", "value": "Value 1"}, {"object_type": "infra.MetaData", "class_id": "infra.MetaData", "name": "Name 2", "value": "Value 2"}} + expectedOp := []map[string]interface{}{{"value": "Value 1", "object_type": "infra.MetaData", "class_id": "infra.MetaData", "name": "Name 1"}, {"value": "Value 2", "object_type": "infra.MetaData", "class_id": "infra.MetaData", "name": "Name 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -3944,7 +3944,7 @@ func TestFlattenListInfraMetaData(t *testing.T) { func TestFlattenListInventoryGenericInventoryRelationship(t *testing.T) { p := []models.InventoryGenericInventoryRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListInventoryGenericInventoryRelationship(p, d) @@ -3959,7 +3959,7 @@ func TestFlattenListInventoryGenericInventoryRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListInventoryGenericInventoryRelationship(p, d) - expectedOp := []map[string]interface{}{{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"}, {"object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -3992,7 +3992,7 @@ func TestFlattenListInventoryGenericInventoryHolderRelationship(t *testing.T) { func TestFlattenListIppoolBlockLeaseRelationship(t *testing.T) { p := []models.IppoolBlockLeaseRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListIppoolBlockLeaseRelationship(p, d) @@ -4007,7 +4007,7 @@ func TestFlattenListIppoolBlockLeaseRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListIppoolBlockLeaseRelationship(p, d) - expectedOp := []map[string]interface{}{{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"}, {"object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -4040,7 +4040,7 @@ func TestFlattenListIppoolIpLeaseRelationship(t *testing.T) { func TestFlattenListIppoolIpV4Block(t *testing.T) { p := []models.IppoolIpV4Block{} var d = &schema.ResourceData{} - c := `{"ObjectType":"ippool.IpV4Block","ClassId":"ippool.IpV4Block","Size":32,"From":"From %d","To":"To %d"}` + c := `{"To":"To %d","ObjectType":"ippool.IpV4Block","ClassId":"ippool.IpV4Block","Size":32,"From":"From %d"}` //test when the response is empty ffOpEmpty := flattenListIppoolIpV4Block(p, d) @@ -4055,7 +4055,7 @@ func TestFlattenListIppoolIpV4Block(t *testing.T) { p = append(p, x) } ffOp := flattenListIppoolIpV4Block(p, d) - expectedOp := []map[string]interface{}{{"object_type": "ippool.IpV4Block", "class_id": "ippool.IpV4Block", "size": 32, "from": "From 1", "to": "To 1"}, {"object_type": "ippool.IpV4Block", "class_id": "ippool.IpV4Block", "size": 32, "from": "From 2", "to": "To 2"}} + expectedOp := []map[string]interface{}{{"to": "To 1", "object_type": "ippool.IpV4Block", "class_id": "ippool.IpV4Block", "size": 32, "from": "From 1"}, {"to": "To 2", "object_type": "ippool.IpV4Block", "class_id": "ippool.IpV4Block", "size": 32, "from": "From 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -4064,7 +4064,7 @@ func TestFlattenListIppoolIpV4Block(t *testing.T) { func TestFlattenListIppoolIpV6Block(t *testing.T) { p := []models.IppoolIpV6Block{} var d = &schema.ResourceData{} - c := `{"Size":32,"From":"From %d","To":"To %d","ObjectType":"ippool.IpV6Block","ClassId":"ippool.IpV6Block"}` + c := `{"To":"To %d","Size":32,"ObjectType":"ippool.IpV6Block","ClassId":"ippool.IpV6Block","From":"From %d"}` //test when the response is empty ffOpEmpty := flattenListIppoolIpV6Block(p, d) @@ -4079,7 +4079,7 @@ func TestFlattenListIppoolIpV6Block(t *testing.T) { p = append(p, x) } ffOp := flattenListIppoolIpV6Block(p, d) - expectedOp := []map[string]interface{}{{"size": 32, "from": "From 1", "to": "To 1", "object_type": "ippool.IpV6Block", "class_id": "ippool.IpV6Block"}, {"size": 32, "from": "From 2", "to": "To 2", "object_type": "ippool.IpV6Block", "class_id": "ippool.IpV6Block"}} + expectedOp := []map[string]interface{}{{"to": "To 1", "size": 32, "object_type": "ippool.IpV6Block", "class_id": "ippool.IpV6Block", "from": "From 1"}, {"to": "To 2", "size": 32, "object_type": "ippool.IpV6Block", "class_id": "ippool.IpV6Block", "from": "From 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -4088,7 +4088,7 @@ func TestFlattenListIppoolIpV6Block(t *testing.T) { func TestFlattenListIppoolPoolRelationship(t *testing.T) { p := []models.IppoolPoolRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListIppoolPoolRelationship(p, d) @@ -4103,7 +4103,7 @@ func TestFlattenListIppoolPoolRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListIppoolPoolRelationship(p, d) - expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} + expectedOp := []map[string]interface{}{{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"}, {"object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -4136,7 +4136,7 @@ func TestFlattenListIppoolShadowBlockRelationship(t *testing.T) { func TestFlattenListIppoolShadowPoolRelationship(t *testing.T) { p := []models.IppoolShadowPoolRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListIppoolShadowPoolRelationship(p, d) @@ -4151,7 +4151,7 @@ func TestFlattenListIppoolShadowPoolRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListIppoolShadowPoolRelationship(p, d) - expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} + expectedOp := []map[string]interface{}{{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"}, {"object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -4160,7 +4160,7 @@ func TestFlattenListIppoolShadowPoolRelationship(t *testing.T) { func TestFlattenListIqnpoolBlockRelationship(t *testing.T) { p := []models.IqnpoolBlockRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListIqnpoolBlockRelationship(p, d) @@ -4175,7 +4175,7 @@ func TestFlattenListIqnpoolBlockRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListIqnpoolBlockRelationship(p, d) - expectedOp := []map[string]interface{}{{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"}, {"object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -4184,7 +4184,7 @@ func TestFlattenListIqnpoolBlockRelationship(t *testing.T) { func TestFlattenListIqnpoolIqnSuffixBlock(t *testing.T) { p := []models.IqnpoolIqnSuffixBlock{} var d = &schema.ResourceData{} - c := `{"To":32,"ObjectType":"iqnpool.IqnSuffixBlock","ClassId":"iqnpool.IqnSuffixBlock","Size":32,"From":32,"Suffix":"Suffix %d"}` + c := `{"ObjectType":"iqnpool.IqnSuffixBlock","ClassId":"iqnpool.IqnSuffixBlock","Size":32,"From":32,"Suffix":"Suffix %d","To":32}` //test when the response is empty ffOpEmpty := flattenListIqnpoolIqnSuffixBlock(p, d) @@ -4199,7 +4199,7 @@ func TestFlattenListIqnpoolIqnSuffixBlock(t *testing.T) { p = append(p, x) } ffOp := flattenListIqnpoolIqnSuffixBlock(p, d) - expectedOp := []map[string]interface{}{{"to": 32, "object_type": "iqnpool.IqnSuffixBlock", "class_id": "iqnpool.IqnSuffixBlock", "size": 32, "from": 32, "suffix": "Suffix 1"}, {"to": 32, "object_type": "iqnpool.IqnSuffixBlock", "class_id": "iqnpool.IqnSuffixBlock", "size": 32, "from": 32, "suffix": "Suffix 2"}} + expectedOp := []map[string]interface{}{{"object_type": "iqnpool.IqnSuffixBlock", "class_id": "iqnpool.IqnSuffixBlock", "size": 32, "from": 32, "suffix": "Suffix 1", "to": 32}, {"object_type": "iqnpool.IqnSuffixBlock", "class_id": "iqnpool.IqnSuffixBlock", "size": 32, "from": 32, "suffix": "Suffix 2", "to": 32}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -4256,7 +4256,7 @@ func TestFlattenListKubernetesAciCniTenantClusterAllocationRelationship(t *testi func TestFlattenListKubernetesAddon(t *testing.T) { p := []models.KubernetesAddon{} var d = &schema.ResourceData{} - c := `{"Name":"Name %d","ObjectType":"kubernetes.Addon","ClassId":"kubernetes.Addon"}` + c := `{"ObjectType":"kubernetes.Addon","ClassId":"kubernetes.Addon","Name":"Name %d"}` //test when the response is empty ffOpEmpty := flattenListKubernetesAddon(p, d) @@ -4271,7 +4271,7 @@ func TestFlattenListKubernetesAddon(t *testing.T) { p = append(p, x) } ffOp := flattenListKubernetesAddon(p, d) - expectedOp := []map[string]interface{}{{"name": "Name 1", "object_type": "kubernetes.Addon", "class_id": "kubernetes.Addon"}, {"name": "Name 2", "object_type": "kubernetes.Addon", "class_id": "kubernetes.Addon"}} + expectedOp := []map[string]interface{}{{"object_type": "kubernetes.Addon", "class_id": "kubernetes.Addon", "name": "Name 1"}, {"object_type": "kubernetes.Addon", "class_id": "kubernetes.Addon", "name": "Name 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -4280,7 +4280,7 @@ func TestFlattenListKubernetesAddon(t *testing.T) { func TestFlattenListKubernetesClusterProfileRelationship(t *testing.T) { p := []models.KubernetesClusterProfileRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenListKubernetesClusterProfileRelationship(p, d) @@ -4295,7 +4295,7 @@ func TestFlattenListKubernetesClusterProfileRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListKubernetesClusterProfileRelationship(p, d) - expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -4328,7 +4328,7 @@ func TestFlattenListKubernetesConfigResultEntryRelationship(t *testing.T) { func TestFlattenListKubernetesEssentialAddon(t *testing.T) { p := []models.KubernetesEssentialAddon{} var d = &schema.ResourceData{} - c := `{"ClassId":"kubernetes.EssentialAddon","Name":"Name %d","ObjectType":"kubernetes.EssentialAddon"}` + c := `{"ObjectType":"kubernetes.EssentialAddon","ClassId":"kubernetes.EssentialAddon","Name":"Name %d"}` //test when the response is empty ffOpEmpty := flattenListKubernetesEssentialAddon(p, d) @@ -4343,7 +4343,7 @@ func TestFlattenListKubernetesEssentialAddon(t *testing.T) { p = append(p, x) } ffOp := flattenListKubernetesEssentialAddon(p, d) - expectedOp := []map[string]interface{}{{"class_id": "kubernetes.EssentialAddon", "name": "Name 1", "object_type": "kubernetes.EssentialAddon"}, {"class_id": "kubernetes.EssentialAddon", "name": "Name 2", "object_type": "kubernetes.EssentialAddon"}} + expectedOp := []map[string]interface{}{{"object_type": "kubernetes.EssentialAddon", "class_id": "kubernetes.EssentialAddon", "name": "Name 1"}, {"object_type": "kubernetes.EssentialAddon", "class_id": "kubernetes.EssentialAddon", "name": "Name 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -4352,7 +4352,7 @@ func TestFlattenListKubernetesEssentialAddon(t *testing.T) { func TestFlattenListKubernetesEthernet(t *testing.T) { p := []models.KubernetesEthernet{} var d = &schema.ResourceData{} - c := `{"Mtu":32,"ClassId":"kubernetes.Ethernet","ObjectType":"kubernetes.Ethernet","Gateway":"Gateway %d","Name":"Name %d","ProviderName":"ProviderName %d"}` + c := `{"Mtu":32,"ObjectType":"kubernetes.Ethernet","Gateway":"Gateway %d","Name":"Name %d","ProviderName":"ProviderName %d","ClassId":"kubernetes.Ethernet"}` //test when the response is empty ffOpEmpty := flattenListKubernetesEthernet(p, d) @@ -4367,7 +4367,7 @@ func TestFlattenListKubernetesEthernet(t *testing.T) { p = append(p, x) } ffOp := flattenListKubernetesEthernet(p, d) - expectedOp := []map[string]interface{}{{"mtu": 32, "class_id": "kubernetes.Ethernet", "object_type": "kubernetes.Ethernet", "gateway": "Gateway 1", "name": "Name 1", "provider_name": "ProviderName 1"}, {"mtu": 32, "class_id": "kubernetes.Ethernet", "object_type": "kubernetes.Ethernet", "gateway": "Gateway 2", "name": "Name 2", "provider_name": "ProviderName 2"}} + expectedOp := []map[string]interface{}{{"mtu": 32, "object_type": "kubernetes.Ethernet", "gateway": "Gateway 1", "name": "Name 1", "provider_name": "ProviderName 1", "class_id": "kubernetes.Ethernet"}, {"mtu": 32, "object_type": "kubernetes.Ethernet", "gateway": "Gateway 2", "name": "Name 2", "provider_name": "ProviderName 2", "class_id": "kubernetes.Ethernet"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -4424,7 +4424,7 @@ func TestFlattenListKubernetesNodeGroupLabel(t *testing.T) { func TestFlattenListKubernetesNodeGroupProfileRelationship(t *testing.T) { p := []models.KubernetesNodeGroupProfileRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenListKubernetesNodeGroupProfileRelationship(p, d) @@ -4439,7 +4439,7 @@ func TestFlattenListKubernetesNodeGroupProfileRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListKubernetesNodeGroupProfileRelationship(p, d) - expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} + expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -4448,7 +4448,7 @@ func TestFlattenListKubernetesNodeGroupProfileRelationship(t *testing.T) { func TestFlattenListKubernetesNodeGroupTaint(t *testing.T) { p := []models.KubernetesNodeGroupTaint{} var d = &schema.ResourceData{} - c := `{"ClassId":"kubernetes.NodeGroupTaint","ObjectType":"kubernetes.NodeGroupTaint","Key":"Key %d","Value":"Value %d","Effect":"Effect %d"}` + c := `{"ClassId":"kubernetes.NodeGroupTaint","Effect":"Effect %d","Key":"Key %d","Value":"Value %d","ObjectType":"kubernetes.NodeGroupTaint"}` //test when the response is empty ffOpEmpty := flattenListKubernetesNodeGroupTaint(p, d) @@ -4463,7 +4463,7 @@ func TestFlattenListKubernetesNodeGroupTaint(t *testing.T) { p = append(p, x) } ffOp := flattenListKubernetesNodeGroupTaint(p, d) - expectedOp := []map[string]interface{}{{"class_id": "kubernetes.NodeGroupTaint", "object_type": "kubernetes.NodeGroupTaint", "key": "Key 1", "value": "Value 1", "effect": "Effect 1"}, {"class_id": "kubernetes.NodeGroupTaint", "object_type": "kubernetes.NodeGroupTaint", "key": "Key 2", "value": "Value 2", "effect": "Effect 2"}} + expectedOp := []map[string]interface{}{{"class_id": "kubernetes.NodeGroupTaint", "effect": "Effect 1", "key": "Key 1", "value": "Value 1", "object_type": "kubernetes.NodeGroupTaint"}, {"class_id": "kubernetes.NodeGroupTaint", "effect": "Effect 2", "key": "Key 2", "value": "Value 2", "object_type": "kubernetes.NodeGroupTaint"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -4472,7 +4472,7 @@ func TestFlattenListKubernetesNodeGroupTaint(t *testing.T) { func TestFlattenListKubernetesNodeProfileRelationship(t *testing.T) { p := []models.KubernetesNodeProfileRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenListKubernetesNodeProfileRelationship(p, d) @@ -4487,7 +4487,7 @@ func TestFlattenListKubernetesNodeProfileRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListKubernetesNodeProfileRelationship(p, d) - expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} + expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -4520,7 +4520,7 @@ func TestFlattenListKubernetesNodeStatus(t *testing.T) { func TestFlattenListKubernetesTaint(t *testing.T) { p := []models.KubernetesTaint{} var d = &schema.ResourceData{} - c := `{"ObjectType":"kubernetes.Taint","ClassId":"kubernetes.Taint","Effect":"Effect %d","Key":"Key %d","Value":"Value %d"}` + c := `{"Effect":"Effect %d","Key":"Key %d","Value":"Value %d","ObjectType":"kubernetes.Taint","ClassId":"kubernetes.Taint"}` //test when the response is empty ffOpEmpty := flattenListKubernetesTaint(p, d) @@ -4535,7 +4535,7 @@ func TestFlattenListKubernetesTaint(t *testing.T) { p = append(p, x) } ffOp := flattenListKubernetesTaint(p, d) - expectedOp := []map[string]interface{}{{"object_type": "kubernetes.Taint", "class_id": "kubernetes.Taint", "effect": "Effect 1", "key": "Key 1", "value": "Value 1"}, {"object_type": "kubernetes.Taint", "class_id": "kubernetes.Taint", "effect": "Effect 2", "key": "Key 2", "value": "Value 2"}} + expectedOp := []map[string]interface{}{{"effect": "Effect 1", "key": "Key 1", "value": "Value 1", "object_type": "kubernetes.Taint", "class_id": "kubernetes.Taint"}, {"effect": "Effect 2", "key": "Key 2", "value": "Value 2", "object_type": "kubernetes.Taint", "class_id": "kubernetes.Taint"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -4544,7 +4544,7 @@ func TestFlattenListKubernetesTaint(t *testing.T) { func TestFlattenListKubernetesVirtualMachineInfrastructureProviderRelationship(t *testing.T) { p := []models.KubernetesVirtualMachineInfrastructureProviderRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListKubernetesVirtualMachineInfrastructureProviderRelationship(p, d) @@ -4559,7 +4559,7 @@ func TestFlattenListKubernetesVirtualMachineInfrastructureProviderRelationship(t p = append(p, x) } ffOp := flattenListKubernetesVirtualMachineInfrastructureProviderRelationship(p, d) - expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} + expectedOp := []map[string]interface{}{{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"}, {"object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -4568,7 +4568,7 @@ func TestFlattenListKubernetesVirtualMachineInfrastructureProviderRelationship(t func TestFlattenListLicenseLicenseInfoRelationship(t *testing.T) { p := []models.LicenseLicenseInfoRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListLicenseLicenseInfoRelationship(p, d) @@ -4583,7 +4583,7 @@ func TestFlattenListLicenseLicenseInfoRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListLicenseLicenseInfoRelationship(p, d) - expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} + expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -4592,7 +4592,7 @@ func TestFlattenListLicenseLicenseInfoRelationship(t *testing.T) { func TestFlattenListMacpoolBlock(t *testing.T) { p := []models.MacpoolBlock{} var d = &schema.ResourceData{} - c := `{"Size":32,"ObjectType":"macpool.Block","To":"To %d","From":"From %d","ClassId":"macpool.Block"}` + c := `{"Size":32,"From":"From %d","To":"To %d","ObjectType":"macpool.Block","ClassId":"macpool.Block"}` //test when the response is empty ffOpEmpty := flattenListMacpoolBlock(p, d) @@ -4607,7 +4607,7 @@ func TestFlattenListMacpoolBlock(t *testing.T) { p = append(p, x) } ffOp := flattenListMacpoolBlock(p, d) - expectedOp := []map[string]interface{}{{"size": 32, "object_type": "macpool.Block", "to": "To 1", "from": "From 1", "class_id": "macpool.Block"}, {"size": 32, "object_type": "macpool.Block", "to": "To 2", "from": "From 2", "class_id": "macpool.Block"}} + expectedOp := []map[string]interface{}{{"size": 32, "from": "From 1", "to": "To 1", "object_type": "macpool.Block", "class_id": "macpool.Block"}, {"size": 32, "from": "From 2", "to": "To 2", "object_type": "macpool.Block", "class_id": "macpool.Block"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -4616,7 +4616,7 @@ func TestFlattenListMacpoolBlock(t *testing.T) { func TestFlattenListMacpoolIdBlockRelationship(t *testing.T) { p := []models.MacpoolIdBlockRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenListMacpoolIdBlockRelationship(p, d) @@ -4631,7 +4631,7 @@ func TestFlattenListMacpoolIdBlockRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListMacpoolIdBlockRelationship(p, d) - expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} + expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -4664,7 +4664,7 @@ func TestFlattenListManagementInterfaceRelationship(t *testing.T) { func TestFlattenListMemoryArrayRelationship(t *testing.T) { p := []models.MemoryArrayRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenListMemoryArrayRelationship(p, d) @@ -4679,7 +4679,7 @@ func TestFlattenListMemoryArrayRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListMemoryArrayRelationship(p, d) - expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} + expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -4688,7 +4688,7 @@ func TestFlattenListMemoryArrayRelationship(t *testing.T) { func TestFlattenListMemoryPersistentMemoryGoal(t *testing.T) { p := []models.MemoryPersistentMemoryGoal{} var d = &schema.ResourceData{} - c := `{"PersistentMemoryType":"PersistentMemoryType %d","SocketId":"SocketId %d","MemoryModePercentage":32,"ObjectType":"memory.PersistentMemoryGoal","ClassId":"memory.PersistentMemoryGoal"}` + c := `{"MemoryModePercentage":32,"PersistentMemoryType":"PersistentMemoryType %d","SocketId":"SocketId %d","ObjectType":"memory.PersistentMemoryGoal","ClassId":"memory.PersistentMemoryGoal"}` //test when the response is empty ffOpEmpty := flattenListMemoryPersistentMemoryGoal(p, d) @@ -4703,7 +4703,7 @@ func TestFlattenListMemoryPersistentMemoryGoal(t *testing.T) { p = append(p, x) } ffOp := flattenListMemoryPersistentMemoryGoal(p, d) - expectedOp := []map[string]interface{}{{"persistent_memory_type": "PersistentMemoryType 1", "socket_id": "SocketId 1", "memory_mode_percentage": 32, "object_type": "memory.PersistentMemoryGoal", "class_id": "memory.PersistentMemoryGoal"}, {"persistent_memory_type": "PersistentMemoryType 2", "socket_id": "SocketId 2", "memory_mode_percentage": 32, "object_type": "memory.PersistentMemoryGoal", "class_id": "memory.PersistentMemoryGoal"}} + expectedOp := []map[string]interface{}{{"memory_mode_percentage": 32, "persistent_memory_type": "PersistentMemoryType 1", "socket_id": "SocketId 1", "object_type": "memory.PersistentMemoryGoal", "class_id": "memory.PersistentMemoryGoal"}, {"memory_mode_percentage": 32, "persistent_memory_type": "PersistentMemoryType 2", "socket_id": "SocketId 2", "object_type": "memory.PersistentMemoryGoal", "class_id": "memory.PersistentMemoryGoal"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -4712,7 +4712,7 @@ func TestFlattenListMemoryPersistentMemoryGoal(t *testing.T) { func TestFlattenListMemoryPersistentMemoryLogicalNamespace(t *testing.T) { p := []models.MemoryPersistentMemoryLogicalNamespace{} var d = &schema.ResourceData{} - c := `{"SocketMemoryId":"SocketMemoryId %d","Capacity":32,"ObjectType":"memory.PersistentMemoryLogicalNamespace","ClassId":"memory.PersistentMemoryLogicalNamespace","Mode":"Mode %d","Name":"Name %d","SocketId":32}` + c := `{"Mode":"Mode %d","ObjectType":"memory.PersistentMemoryLogicalNamespace","ClassId":"memory.PersistentMemoryLogicalNamespace","Name":"Name %d","SocketId":32,"SocketMemoryId":"SocketMemoryId %d","Capacity":32}` //test when the response is empty ffOpEmpty := flattenListMemoryPersistentMemoryLogicalNamespace(p, d) @@ -4727,7 +4727,7 @@ func TestFlattenListMemoryPersistentMemoryLogicalNamespace(t *testing.T) { p = append(p, x) } ffOp := flattenListMemoryPersistentMemoryLogicalNamespace(p, d) - expectedOp := []map[string]interface{}{{"socket_memory_id": "SocketMemoryId 1", "capacity": 32, "object_type": "memory.PersistentMemoryLogicalNamespace", "class_id": "memory.PersistentMemoryLogicalNamespace", "mode": "Mode 1", "name": "Name 1", "socket_id": 32}, {"socket_memory_id": "SocketMemoryId 2", "capacity": 32, "object_type": "memory.PersistentMemoryLogicalNamespace", "class_id": "memory.PersistentMemoryLogicalNamespace", "mode": "Mode 2", "name": "Name 2", "socket_id": 32}} + expectedOp := []map[string]interface{}{{"mode": "Mode 1", "object_type": "memory.PersistentMemoryLogicalNamespace", "class_id": "memory.PersistentMemoryLogicalNamespace", "name": "Name 1", "socket_id": 32, "socket_memory_id": "SocketMemoryId 1", "capacity": 32}, {"mode": "Mode 2", "object_type": "memory.PersistentMemoryLogicalNamespace", "class_id": "memory.PersistentMemoryLogicalNamespace", "name": "Name 2", "socket_id": 32, "socket_memory_id": "SocketMemoryId 2", "capacity": 32}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -4784,7 +4784,7 @@ func TestFlattenListMemoryPersistentMemoryNamespaceConfigResultRelationship(t *t func TestFlattenListMemoryPersistentMemoryRegionRelationship(t *testing.T) { p := []models.MemoryPersistentMemoryRegionRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListMemoryPersistentMemoryRegionRelationship(p, d) @@ -4799,7 +4799,7 @@ func TestFlattenListMemoryPersistentMemoryRegionRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListMemoryPersistentMemoryRegionRelationship(p, d) - expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"}, {"object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -4808,7 +4808,7 @@ func TestFlattenListMemoryPersistentMemoryRegionRelationship(t *testing.T) { func TestFlattenListMemoryPersistentMemoryUnitRelationship(t *testing.T) { p := []models.MemoryPersistentMemoryUnitRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenListMemoryPersistentMemoryUnitRelationship(p, d) @@ -4823,7 +4823,7 @@ func TestFlattenListMemoryPersistentMemoryUnitRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListMemoryPersistentMemoryUnitRelationship(p, d) - expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} + expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -4856,7 +4856,7 @@ func TestFlattenListMemoryUnitRelationship(t *testing.T) { func TestFlattenListMetaAccessPrivilege(t *testing.T) { p := []models.MetaAccessPrivilege{} var d = &schema.ResourceData{} - c := `{"Method":"Method %d","Privilege":"Privilege %d","ObjectType":"meta.AccessPrivilege","ClassId":"meta.AccessPrivilege"}` + c := `{"ClassId":"meta.AccessPrivilege","ObjectType":"meta.AccessPrivilege","Method":"Method %d","Privilege":"Privilege %d"}` //test when the response is empty ffOpEmpty := flattenListMetaAccessPrivilege(p, d) @@ -4871,7 +4871,7 @@ func TestFlattenListMetaAccessPrivilege(t *testing.T) { p = append(p, x) } ffOp := flattenListMetaAccessPrivilege(p, d) - expectedOp := []map[string]interface{}{{"method": "Method 1", "privilege": "Privilege 1", "object_type": "meta.AccessPrivilege", "class_id": "meta.AccessPrivilege"}, {"method": "Method 2", "privilege": "Privilege 2", "object_type": "meta.AccessPrivilege", "class_id": "meta.AccessPrivilege"}} + expectedOp := []map[string]interface{}{{"class_id": "meta.AccessPrivilege", "object_type": "meta.AccessPrivilege", "method": "Method 1", "privilege": "Privilege 1"}, {"class_id": "meta.AccessPrivilege", "object_type": "meta.AccessPrivilege", "method": "Method 2", "privilege": "Privilege 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -4928,7 +4928,7 @@ func TestFlattenListMetaIdentityDefinition(t *testing.T) { func TestFlattenListMetaPropDefinition(t *testing.T) { p := []models.MetaPropDefinition{} var d = &schema.ResourceData{} - c := `{"Name":"Name %d","ObjectType":"meta.PropDefinition","ApiAccess":"ApiAccess %d","Type":"Type %d","OpSecurity":"OpSecurity %d","IsCollection":true,"SearchWeight":32.000000,"Kind":"Kind %d","ClassId":"meta.PropDefinition","IsComplexType":true}` + c := `{"IsComplexType":true,"Type":"Type %d","IsCollection":true,"OpSecurity":"OpSecurity %d","SearchWeight":32.000000,"ObjectType":"meta.PropDefinition","Kind":"Kind %d","ApiAccess":"ApiAccess %d","Name":"Name %d","ClassId":"meta.PropDefinition"}` //test when the response is empty ffOpEmpty := flattenListMetaPropDefinition(p, d) @@ -4943,7 +4943,7 @@ func TestFlattenListMetaPropDefinition(t *testing.T) { p = append(p, x) } ffOp := flattenListMetaPropDefinition(p, d) - expectedOp := []map[string]interface{}{{"name": "Name 1", "object_type": "meta.PropDefinition", "api_access": "ApiAccess 1", "type": "Type 1", "op_security": "OpSecurity 1", "is_collection": true, "search_weight": 32.000000, "kind": "Kind 1", "class_id": "meta.PropDefinition", "is_complex_type": true}, {"name": "Name 2", "object_type": "meta.PropDefinition", "api_access": "ApiAccess 2", "type": "Type 2", "op_security": "OpSecurity 2", "is_collection": true, "search_weight": 32.000000, "kind": "Kind 2", "class_id": "meta.PropDefinition", "is_complex_type": true}} + expectedOp := []map[string]interface{}{{"is_complex_type": true, "type": "Type 1", "is_collection": true, "op_security": "OpSecurity 1", "search_weight": 32.000000, "object_type": "meta.PropDefinition", "kind": "Kind 1", "api_access": "ApiAccess 1", "name": "Name 1", "class_id": "meta.PropDefinition"}, {"is_complex_type": true, "type": "Type 2", "is_collection": true, "op_security": "OpSecurity 2", "search_weight": 32.000000, "object_type": "meta.PropDefinition", "kind": "Kind 2", "api_access": "ApiAccess 2", "name": "Name 2", "class_id": "meta.PropDefinition"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -4952,7 +4952,7 @@ func TestFlattenListMetaPropDefinition(t *testing.T) { func TestFlattenListMetaRelationshipDefinition(t *testing.T) { p := []models.MetaRelationshipDefinition{} var d = &schema.ResourceData{} - c := `{"ClassId":"meta.RelationshipDefinition","ApiAccess":"ApiAccess %d","Name":"Name %d","Collection":true,"ExportWithPeer":true,"PeerSync":true,"Type":"Type %d","ObjectType":"meta.RelationshipDefinition","Export":true,"PeerRelName":"PeerRelName %d"}` + c := `{"Name":"Name %d","ObjectType":"meta.RelationshipDefinition","ApiAccess":"ApiAccess %d","Collection":true,"ExportWithPeer":true,"PeerSync":true,"Type":"Type %d","Export":true,"ClassId":"meta.RelationshipDefinition","PeerRelName":"PeerRelName %d"}` //test when the response is empty ffOpEmpty := flattenListMetaRelationshipDefinition(p, d) @@ -4967,7 +4967,7 @@ func TestFlattenListMetaRelationshipDefinition(t *testing.T) { p = append(p, x) } ffOp := flattenListMetaRelationshipDefinition(p, d) - expectedOp := []map[string]interface{}{{"class_id": "meta.RelationshipDefinition", "api_access": "ApiAccess 1", "name": "Name 1", "collection": true, "export_with_peer": true, "peer_sync": true, "type": "Type 1", "object_type": "meta.RelationshipDefinition", "export": true, "peer_rel_name": "PeerRelName 1"}, {"class_id": "meta.RelationshipDefinition", "api_access": "ApiAccess 2", "name": "Name 2", "collection": true, "export_with_peer": true, "peer_sync": true, "type": "Type 2", "object_type": "meta.RelationshipDefinition", "export": true, "peer_rel_name": "PeerRelName 2"}} + expectedOp := []map[string]interface{}{{"name": "Name 1", "object_type": "meta.RelationshipDefinition", "api_access": "ApiAccess 1", "collection": true, "export_with_peer": true, "peer_sync": true, "type": "Type 1", "export": true, "class_id": "meta.RelationshipDefinition", "peer_rel_name": "PeerRelName 1"}, {"name": "Name 2", "object_type": "meta.RelationshipDefinition", "api_access": "ApiAccess 2", "collection": true, "export_with_peer": true, "peer_sync": true, "type": "Type 2", "export": true, "class_id": "meta.RelationshipDefinition", "peer_rel_name": "PeerRelName 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -4976,7 +4976,7 @@ func TestFlattenListMetaRelationshipDefinition(t *testing.T) { func TestFlattenListMoBaseMoRelationship(t *testing.T) { p := []models.MoBaseMoRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenListMoBaseMoRelationship(p, d) @@ -4991,7 +4991,7 @@ func TestFlattenListMoBaseMoRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListMoBaseMoRelationship(p, d) - expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -5000,7 +5000,7 @@ func TestFlattenListMoBaseMoRelationship(t *testing.T) { func TestFlattenListMoMoRef(t *testing.T) { p := []models.MoMoRef{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenListMoMoRef(p, d) @@ -5015,7 +5015,7 @@ func TestFlattenListMoMoRef(t *testing.T) { p = append(p, x) } ffOp := flattenListMoMoRef(p, d) - expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} + expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -5024,7 +5024,7 @@ func TestFlattenListMoMoRef(t *testing.T) { func TestFlattenListMoTag(t *testing.T) { p := []models.MoTag{} var d = &schema.ResourceData{} - c := `{"Key":"Key %d","Value":"Value %d"}` + c := `{"Value":"Value %d","Key":"Key %d"}` //test when the response is empty ffOpEmpty := flattenListMoTag(p, d) @@ -5039,7 +5039,7 @@ func TestFlattenListMoTag(t *testing.T) { p = append(p, x) } ffOp := flattenListMoTag(p, d) - expectedOp := []map[string]interface{}{{"key": "Key 1", "value": "Value 1"}, {"key": "Key 2", "value": "Value 2"}} + expectedOp := []map[string]interface{}{{"value": "Value 1", "key": "Key 1"}, {"value": "Value 2", "key": "Key 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -5048,7 +5048,7 @@ func TestFlattenListMoTag(t *testing.T) { func TestFlattenListNetworkElementRelationship(t *testing.T) { p := []models.NetworkElementRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenListNetworkElementRelationship(p, d) @@ -5063,7 +5063,7 @@ func TestFlattenListNetworkElementRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListNetworkElementRelationship(p, d) - expectedOp := []map[string]interface{}{{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"}, {"object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -5072,7 +5072,7 @@ func TestFlattenListNetworkElementRelationship(t *testing.T) { func TestFlattenListNiaapiDetail(t *testing.T) { p := []models.NiaapiDetail{} var d = &schema.ResourceData{} - c := `{"Filename":"Filename %d","ObjectType":"niaapi.Detail","ClassId":"niaapi.Detail","Name":"Name %d","Chksum":"Chksum %d"}` + c := `{"ObjectType":"niaapi.Detail","Chksum":"Chksum %d","Filename":"Filename %d","Name":"Name %d","ClassId":"niaapi.Detail"}` //test when the response is empty ffOpEmpty := flattenListNiaapiDetail(p, d) @@ -5087,7 +5087,7 @@ func TestFlattenListNiaapiDetail(t *testing.T) { p = append(p, x) } ffOp := flattenListNiaapiDetail(p, d) - expectedOp := []map[string]interface{}{{"filename": "Filename 1", "object_type": "niaapi.Detail", "class_id": "niaapi.Detail", "name": "Name 1", "chksum": "Chksum 1"}, {"filename": "Filename 2", "object_type": "niaapi.Detail", "class_id": "niaapi.Detail", "name": "Name 2", "chksum": "Chksum 2"}} + expectedOp := []map[string]interface{}{{"object_type": "niaapi.Detail", "chksum": "Chksum 1", "filename": "Filename 1", "name": "Name 1", "class_id": "niaapi.Detail"}, {"object_type": "niaapi.Detail", "chksum": "Chksum 2", "filename": "Filename 2", "name": "Name 2", "class_id": "niaapi.Detail"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -5096,7 +5096,7 @@ func TestFlattenListNiaapiDetail(t *testing.T) { func TestFlattenListNiaapiRevisionInfo(t *testing.T) { p := []models.NiaapiRevisionInfo{} var d = &schema.ResourceData{} - c := `{"ObjectType":"niaapi.RevisionInfo","ClassId":"niaapi.RevisionInfo","RevisionComment":"RevisionComment %d","RevisionNo":"RevisionNo %d"}` + c := `{"ClassId":"niaapi.RevisionInfo","RevisionNo":"RevisionNo %d","RevisionComment":"RevisionComment %d","ObjectType":"niaapi.RevisionInfo"}` //test when the response is empty ffOpEmpty := flattenListNiaapiRevisionInfo(p, d) @@ -5111,7 +5111,7 @@ func TestFlattenListNiaapiRevisionInfo(t *testing.T) { p = append(p, x) } ffOp := flattenListNiaapiRevisionInfo(p, d) - expectedOp := []map[string]interface{}{{"object_type": "niaapi.RevisionInfo", "class_id": "niaapi.RevisionInfo", "revision_comment": "RevisionComment 1", "revision_no": "RevisionNo 1"}, {"object_type": "niaapi.RevisionInfo", "class_id": "niaapi.RevisionInfo", "revision_comment": "RevisionComment 2", "revision_no": "RevisionNo 2"}} + expectedOp := []map[string]interface{}{{"class_id": "niaapi.RevisionInfo", "revision_no": "RevisionNo 1", "revision_comment": "RevisionComment 1", "object_type": "niaapi.RevisionInfo"}, {"class_id": "niaapi.RevisionInfo", "revision_no": "RevisionNo 2", "revision_comment": "RevisionComment 2", "object_type": "niaapi.RevisionInfo"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -5120,7 +5120,7 @@ func TestFlattenListNiaapiRevisionInfo(t *testing.T) { func TestFlattenListNiatelemetryDeploymentStatus(t *testing.T) { p := []models.NiatelemetryDeploymentStatus{} var d = &schema.ResourceData{} - c := `{"ObjectType":"niatelemetry.DeploymentStatus","ClassId":"niatelemetry.DeploymentStatus","Id":32,"Name":"Name %d","Status":"Status %d"}` + c := `{"ObjectType":"niatelemetry.DeploymentStatus","ClassId":"niatelemetry.DeploymentStatus","Status":"Status %d","Id":32,"Name":"Name %d"}` //test when the response is empty ffOpEmpty := flattenListNiatelemetryDeploymentStatus(p, d) @@ -5135,7 +5135,7 @@ func TestFlattenListNiatelemetryDeploymentStatus(t *testing.T) { p = append(p, x) } ffOp := flattenListNiatelemetryDeploymentStatus(p, d) - expectedOp := []map[string]interface{}{{"object_type": "niatelemetry.DeploymentStatus", "class_id": "niatelemetry.DeploymentStatus", "id": 32, "name": "Name 1", "status": "Status 1"}, {"object_type": "niatelemetry.DeploymentStatus", "class_id": "niatelemetry.DeploymentStatus", "id": 32, "name": "Name 2", "status": "Status 2"}} + expectedOp := []map[string]interface{}{{"object_type": "niatelemetry.DeploymentStatus", "class_id": "niatelemetry.DeploymentStatus", "status": "Status 1", "id": 32, "name": "Name 1"}, {"object_type": "niatelemetry.DeploymentStatus", "class_id": "niatelemetry.DeploymentStatus", "status": "Status 2", "id": 32, "name": "Name 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -5144,7 +5144,7 @@ func TestFlattenListNiatelemetryDeploymentStatus(t *testing.T) { func TestFlattenListNiatelemetryImageDetail(t *testing.T) { p := []models.NiatelemetryImageDetail{} var d = &schema.ResourceData{} - c := `{"ClassId":"niatelemetry.ImageDetail","Name":"Name %d","Version":"Version %d","ImageName":"ImageName %d","ObjectType":"niatelemetry.ImageDetail"}` + c := `{"Version":"Version %d","ObjectType":"niatelemetry.ImageDetail","ClassId":"niatelemetry.ImageDetail","ImageName":"ImageName %d","Name":"Name %d"}` //test when the response is empty ffOpEmpty := flattenListNiatelemetryImageDetail(p, d) @@ -5159,7 +5159,7 @@ func TestFlattenListNiatelemetryImageDetail(t *testing.T) { p = append(p, x) } ffOp := flattenListNiatelemetryImageDetail(p, d) - expectedOp := []map[string]interface{}{{"class_id": "niatelemetry.ImageDetail", "name": "Name 1", "nr_version": "Version 1", "image_name": "ImageName 1", "object_type": "niatelemetry.ImageDetail"}, {"class_id": "niatelemetry.ImageDetail", "name": "Name 2", "nr_version": "Version 2", "image_name": "ImageName 2", "object_type": "niatelemetry.ImageDetail"}} + expectedOp := []map[string]interface{}{{"nr_version": "Version 1", "object_type": "niatelemetry.ImageDetail", "class_id": "niatelemetry.ImageDetail", "image_name": "ImageName 1", "name": "Name 1"}, {"nr_version": "Version 2", "object_type": "niatelemetry.ImageDetail", "class_id": "niatelemetry.ImageDetail", "image_name": "ImageName 2", "name": "Name 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -5192,7 +5192,7 @@ func TestFlattenListNiatelemetryInterfaceElement(t *testing.T) { func TestFlattenListNiatelemetryJobDetail(t *testing.T) { p := []models.NiatelemetryJobDetail{} var d = &schema.ResourceData{} - c := `{"UpgStatus":"UpgStatus %d","ObjectType":"niatelemetry.JobDetail","ClassId":"niatelemetry.JobDetail","JobId":32}` + c := `{"ObjectType":"niatelemetry.JobDetail","ClassId":"niatelemetry.JobDetail","JobId":32,"UpgStatus":"UpgStatus %d"}` //test when the response is empty ffOpEmpty := flattenListNiatelemetryJobDetail(p, d) @@ -5207,7 +5207,7 @@ func TestFlattenListNiatelemetryJobDetail(t *testing.T) { p = append(p, x) } ffOp := flattenListNiatelemetryJobDetail(p, d) - expectedOp := []map[string]interface{}{{"upg_status": "UpgStatus 1", "object_type": "niatelemetry.JobDetail", "class_id": "niatelemetry.JobDetail", "job_id": 32}, {"upg_status": "UpgStatus 2", "object_type": "niatelemetry.JobDetail", "class_id": "niatelemetry.JobDetail", "job_id": 32}} + expectedOp := []map[string]interface{}{{"object_type": "niatelemetry.JobDetail", "class_id": "niatelemetry.JobDetail", "job_id": 32, "upg_status": "UpgStatus 1"}, {"object_type": "niatelemetry.JobDetail", "class_id": "niatelemetry.JobDetail", "job_id": 32, "upg_status": "UpgStatus 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -5216,7 +5216,7 @@ func TestFlattenListNiatelemetryJobDetail(t *testing.T) { func TestFlattenListNiatelemetryLogicalLink(t *testing.T) { p := []models.NiatelemetryLogicalLink{} var d = &schema.ResourceData{} - c := `{"ClassId":"niatelemetry.LogicalLink","DbId":32,"LinkState":"LinkState %d","LinkAddr2":"LinkAddr2 %d","ObjectType":"niatelemetry.LogicalLink","LinkType":"LinkType %d","Uptime":"Uptime %d","IsPresent":true,"LinkAddr1":"LinkAddr1 %d"}` + c := `{"ClassId":"niatelemetry.LogicalLink","DbId":32,"LinkAddr2":"LinkAddr2 %d","IsPresent":true,"LinkAddr1":"LinkAddr1 %d","ObjectType":"niatelemetry.LogicalLink","Uptime":"Uptime %d","LinkState":"LinkState %d","LinkType":"LinkType %d"}` //test when the response is empty ffOpEmpty := flattenListNiatelemetryLogicalLink(p, d) @@ -5231,7 +5231,7 @@ func TestFlattenListNiatelemetryLogicalLink(t *testing.T) { p = append(p, x) } ffOp := flattenListNiatelemetryLogicalLink(p, d) - expectedOp := []map[string]interface{}{{"class_id": "niatelemetry.LogicalLink", "db_id": 32, "link_state": "LinkState 1", "link_addr2": "LinkAddr2 1", "object_type": "niatelemetry.LogicalLink", "link_type": "LinkType 1", "uptime": "Uptime 1", "is_present": true, "link_addr1": "LinkAddr1 1"}, {"class_id": "niatelemetry.LogicalLink", "db_id": 32, "link_state": "LinkState 2", "link_addr2": "LinkAddr2 2", "object_type": "niatelemetry.LogicalLink", "link_type": "LinkType 2", "uptime": "Uptime 2", "is_present": true, "link_addr1": "LinkAddr1 2"}} + expectedOp := []map[string]interface{}{{"class_id": "niatelemetry.LogicalLink", "db_id": 32, "link_addr2": "LinkAddr2 1", "is_present": true, "link_addr1": "LinkAddr1 1", "object_type": "niatelemetry.LogicalLink", "uptime": "Uptime 1", "link_state": "LinkState 1", "link_type": "LinkType 1"}, {"class_id": "niatelemetry.LogicalLink", "db_id": 32, "link_addr2": "LinkAddr2 2", "is_present": true, "link_addr1": "LinkAddr1 2", "object_type": "niatelemetry.LogicalLink", "uptime": "Uptime 2", "link_state": "LinkState 2", "link_type": "LinkType 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -5240,7 +5240,7 @@ func TestFlattenListNiatelemetryLogicalLink(t *testing.T) { func TestFlattenListNiatelemetryVniStatus(t *testing.T) { p := []models.NiatelemetryVniStatus{} var d = &schema.ResourceData{} - c := `{"Vni":"Vni %d","ObjectType":"niatelemetry.VniStatus","ClassId":"niatelemetry.VniStatus","VniState":"VniState %d","VniType":"VniType %d"}` + c := `{"ObjectType":"niatelemetry.VniStatus","ClassId":"niatelemetry.VniStatus","Vni":"Vni %d","VniState":"VniState %d","VniType":"VniType %d"}` //test when the response is empty ffOpEmpty := flattenListNiatelemetryVniStatus(p, d) @@ -5255,7 +5255,7 @@ func TestFlattenListNiatelemetryVniStatus(t *testing.T) { p = append(p, x) } ffOp := flattenListNiatelemetryVniStatus(p, d) - expectedOp := []map[string]interface{}{{"vni": "Vni 1", "object_type": "niatelemetry.VniStatus", "class_id": "niatelemetry.VniStatus", "vni_state": "VniState 1", "vni_type": "VniType 1"}, {"vni": "Vni 2", "object_type": "niatelemetry.VniStatus", "class_id": "niatelemetry.VniStatus", "vni_state": "VniState 2", "vni_type": "VniType 2"}} + expectedOp := []map[string]interface{}{{"object_type": "niatelemetry.VniStatus", "class_id": "niatelemetry.VniStatus", "vni": "Vni 1", "vni_state": "VniState 1", "vni_type": "VniType 1"}, {"object_type": "niatelemetry.VniStatus", "class_id": "niatelemetry.VniStatus", "vni": "Vni 2", "vni_state": "VniState 2", "vni_type": "VniType 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -5264,7 +5264,7 @@ func TestFlattenListNiatelemetryVniStatus(t *testing.T) { func TestFlattenListNiatelemetryVpcDetails(t *testing.T) { p := []models.NiatelemetryVpcDetails{} var d = &schema.ResourceData{} - c := `{"ClassId":"niatelemetry.VpcDetails","IsVpcConfigured":true,"PeerSwitchDbId":32,"SwitchDbId":32,"ObjectType":"niatelemetry.VpcDetails"}` + c := `{"ObjectType":"niatelemetry.VpcDetails","IsVpcConfigured":true,"PeerSwitchDbId":32,"SwitchDbId":32,"ClassId":"niatelemetry.VpcDetails"}` //test when the response is empty ffOpEmpty := flattenListNiatelemetryVpcDetails(p, d) @@ -5279,7 +5279,7 @@ func TestFlattenListNiatelemetryVpcDetails(t *testing.T) { p = append(p, x) } ffOp := flattenListNiatelemetryVpcDetails(p, d) - expectedOp := []map[string]interface{}{{"class_id": "niatelemetry.VpcDetails", "is_vpc_configured": true, "peer_switch_db_id": 32, "switch_db_id": 32, "object_type": "niatelemetry.VpcDetails"}, {"class_id": "niatelemetry.VpcDetails", "is_vpc_configured": true, "peer_switch_db_id": 32, "switch_db_id": 32, "object_type": "niatelemetry.VpcDetails"}} + expectedOp := []map[string]interface{}{{"object_type": "niatelemetry.VpcDetails", "is_vpc_configured": true, "peer_switch_db_id": 32, "switch_db_id": 32, "class_id": "niatelemetry.VpcDetails"}, {"object_type": "niatelemetry.VpcDetails", "is_vpc_configured": true, "peer_switch_db_id": 32, "switch_db_id": 32, "class_id": "niatelemetry.VpcDetails"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -5288,7 +5288,7 @@ func TestFlattenListNiatelemetryVpcDetails(t *testing.T) { func TestFlattenListNotificationAbstractCondition(t *testing.T) { p := []models.NotificationAbstractCondition{} var d = &schema.ResourceData{} - c := `{"ObjectType":"notification.AbstractCondition","ClassId":"notification.AbstractCondition"}` + c := `{"ClassId":"notification.AbstractCondition","ObjectType":"notification.AbstractCondition"}` //test when the response is empty ffOpEmpty := flattenListNotificationAbstractCondition(p, d) @@ -5303,7 +5303,7 @@ func TestFlattenListNotificationAbstractCondition(t *testing.T) { p = append(p, x) } ffOp := flattenListNotificationAbstractCondition(p, d) - expectedOp := []map[string]interface{}{{"object_type": "notification.AbstractCondition", "class_id": "notification.AbstractCondition"}, {"object_type": "notification.AbstractCondition", "class_id": "notification.AbstractCondition"}} + expectedOp := []map[string]interface{}{{"class_id": "notification.AbstractCondition", "object_type": "notification.AbstractCondition"}, {"class_id": "notification.AbstractCondition", "object_type": "notification.AbstractCondition"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -5336,7 +5336,7 @@ func TestFlattenListNotificationAction(t *testing.T) { func TestFlattenListNtpAuthNtpServer(t *testing.T) { p := []models.NtpAuthNtpServer{} var d = &schema.ResourceData{} - c := `{"SymKeyId":32,"SymKeyValue":"SymKeyValue %d","KeyType":"KeyType %d","ServerName":"ServerName %d","ObjectType":"ntp.AuthNtpServer","ClassId":"ntp.AuthNtpServer"}` + c := `{"ServerName":"ServerName %d","ObjectType":"ntp.AuthNtpServer","ClassId":"ntp.AuthNtpServer","SymKeyId":32,"SymKeyValue":"SymKeyValue %d","KeyType":"KeyType %d"}` //test when the response is empty ffOpEmpty := flattenListNtpAuthNtpServer(p, d) @@ -5351,7 +5351,7 @@ func TestFlattenListNtpAuthNtpServer(t *testing.T) { p = append(p, x) } ffOp := flattenListNtpAuthNtpServer(p, d) - expectedOp := []map[string]interface{}{{"sym_key_id": 32, "sym_key_value": "SymKeyValue 1", "key_type": "KeyType 1", "server_name": "ServerName 1", "object_type": "ntp.AuthNtpServer", "class_id": "ntp.AuthNtpServer"}, {"sym_key_id": 32, "sym_key_value": "SymKeyValue 2", "key_type": "KeyType 2", "server_name": "ServerName 2", "object_type": "ntp.AuthNtpServer", "class_id": "ntp.AuthNtpServer"}} + expectedOp := []map[string]interface{}{{"server_name": "ServerName 1", "object_type": "ntp.AuthNtpServer", "class_id": "ntp.AuthNtpServer", "sym_key_id": 32, "sym_key_value": "SymKeyValue 1", "key_type": "KeyType 1"}, {"server_name": "ServerName 2", "object_type": "ntp.AuthNtpServer", "class_id": "ntp.AuthNtpServer", "sym_key_id": 32, "sym_key_value": "SymKeyValue 2", "key_type": "KeyType 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -5360,7 +5360,7 @@ func TestFlattenListNtpAuthNtpServer(t *testing.T) { func TestFlattenListOnpremImagePackage(t *testing.T) { p := []models.OnpremImagePackage{} var d = &schema.ResourceData{} - c := `{"Version":"Version %d","PackageType":"PackageType %d","FilePath":"FilePath %d","FileSize":32,"ClassId":"onprem.ImagePackage","Name":"Name %d","FileSha":"FileSha %d","Filename":"Filename %d","ObjectType":"onprem.ImagePackage"}` + c := `{"PackageType":"PackageType %d","FilePath":"FilePath %d","FileSha":"FileSha %d","Filename":"Filename %d","Name":"Name %d","ObjectType":"onprem.ImagePackage","ClassId":"onprem.ImagePackage","Version":"Version %d","FileSize":32}` //test when the response is empty ffOpEmpty := flattenListOnpremImagePackage(p, d) @@ -5375,7 +5375,7 @@ func TestFlattenListOnpremImagePackage(t *testing.T) { p = append(p, x) } ffOp := flattenListOnpremImagePackage(p, d) - expectedOp := []map[string]interface{}{{"nr_version": "Version 1", "package_type": "PackageType 1", "file_path": "FilePath 1", "file_size": 32, "class_id": "onprem.ImagePackage", "name": "Name 1", "file_sha": "FileSha 1", "filename": "Filename 1", "object_type": "onprem.ImagePackage"}, {"nr_version": "Version 2", "package_type": "PackageType 2", "file_path": "FilePath 2", "file_size": 32, "class_id": "onprem.ImagePackage", "name": "Name 2", "file_sha": "FileSha 2", "filename": "Filename 2", "object_type": "onprem.ImagePackage"}} + expectedOp := []map[string]interface{}{{"package_type": "PackageType 1", "file_path": "FilePath 1", "file_sha": "FileSha 1", "filename": "Filename 1", "name": "Name 1", "object_type": "onprem.ImagePackage", "class_id": "onprem.ImagePackage", "nr_version": "Version 1", "file_size": 32}, {"package_type": "PackageType 2", "file_path": "FilePath 2", "file_sha": "FileSha 2", "filename": "Filename 2", "name": "Name 2", "object_type": "onprem.ImagePackage", "class_id": "onprem.ImagePackage", "nr_version": "Version 2", "file_size": 32}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -5384,7 +5384,7 @@ func TestFlattenListOnpremImagePackage(t *testing.T) { func TestFlattenListOnpremUpgradeNote(t *testing.T) { p := []models.OnpremUpgradeNote{} var d = &schema.ResourceData{} - c := `{"ObjectType":"onprem.UpgradeNote","ClassId":"onprem.UpgradeNote","Message":"Message %d"}` + c := `{"Message":"Message %d","ObjectType":"onprem.UpgradeNote","ClassId":"onprem.UpgradeNote"}` //test when the response is empty ffOpEmpty := flattenListOnpremUpgradeNote(p, d) @@ -5399,7 +5399,7 @@ func TestFlattenListOnpremUpgradeNote(t *testing.T) { p = append(p, x) } ffOp := flattenListOnpremUpgradeNote(p, d) - expectedOp := []map[string]interface{}{{"object_type": "onprem.UpgradeNote", "class_id": "onprem.UpgradeNote", "message": "Message 1"}, {"object_type": "onprem.UpgradeNote", "class_id": "onprem.UpgradeNote", "message": "Message 2"}} + expectedOp := []map[string]interface{}{{"message": "Message 1", "object_type": "onprem.UpgradeNote", "class_id": "onprem.UpgradeNote"}, {"message": "Message 2", "object_type": "onprem.UpgradeNote", "class_id": "onprem.UpgradeNote"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -5408,7 +5408,7 @@ func TestFlattenListOnpremUpgradeNote(t *testing.T) { func TestFlattenListOnpremUpgradePhase(t *testing.T) { p := []models.OnpremUpgradePhase{} var d = &schema.ResourceData{} - c := `{"ObjectType":"onprem.UpgradePhase","Message":"Message %d","ClassId":"onprem.UpgradePhase","Failed":true,"Name":"Name %d","ElapsedTime":32}` + c := `{"ClassId":"onprem.UpgradePhase","Message":"Message %d","ObjectType":"onprem.UpgradePhase","ElapsedTime":32,"Failed":true,"Name":"Name %d"}` //test when the response is empty ffOpEmpty := flattenListOnpremUpgradePhase(p, d) @@ -5423,7 +5423,7 @@ func TestFlattenListOnpremUpgradePhase(t *testing.T) { p = append(p, x) } ffOp := flattenListOnpremUpgradePhase(p, d) - expectedOp := []map[string]interface{}{{"object_type": "onprem.UpgradePhase", "message": "Message 1", "class_id": "onprem.UpgradePhase", "failed": true, "name": "Name 1", "elapsed_time": 32}, {"object_type": "onprem.UpgradePhase", "message": "Message 2", "class_id": "onprem.UpgradePhase", "failed": true, "name": "Name 2", "elapsed_time": 32}} + expectedOp := []map[string]interface{}{{"class_id": "onprem.UpgradePhase", "message": "Message 1", "object_type": "onprem.UpgradePhase", "elapsed_time": 32, "failed": true, "name": "Name 1"}, {"class_id": "onprem.UpgradePhase", "message": "Message 2", "object_type": "onprem.UpgradePhase", "elapsed_time": 32, "failed": true, "name": "Name 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -5432,7 +5432,7 @@ func TestFlattenListOnpremUpgradePhase(t *testing.T) { func TestFlattenListOprsKvpair(t *testing.T) { p := []models.OprsKvpair{} var d = &schema.ResourceData{} - c := `{"Value":"Value %d","Key":"Key %d","ObjectType":"oprs.Kvpair","ClassId":"oprs.Kvpair"}` + c := `{"ObjectType":"oprs.Kvpair","ClassId":"oprs.Kvpair","Key":"Key %d","Value":"Value %d"}` //test when the response is empty ffOpEmpty := flattenListOprsKvpair(p, d) @@ -5447,7 +5447,7 @@ func TestFlattenListOprsKvpair(t *testing.T) { p = append(p, x) } ffOp := flattenListOprsKvpair(p, d) - expectedOp := []map[string]interface{}{{"value": "Value 1", "key": "Key 1", "object_type": "oprs.Kvpair", "class_id": "oprs.Kvpair"}, {"value": "Value 2", "key": "Key 2", "object_type": "oprs.Kvpair", "class_id": "oprs.Kvpair"}} + expectedOp := []map[string]interface{}{{"object_type": "oprs.Kvpair", "class_id": "oprs.Kvpair", "key": "Key 1", "value": "Value 1"}, {"object_type": "oprs.Kvpair", "class_id": "oprs.Kvpair", "key": "Key 2", "value": "Value 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -5456,7 +5456,7 @@ func TestFlattenListOprsKvpair(t *testing.T) { func TestFlattenListOrganizationOrganizationRelationship(t *testing.T) { p := []models.OrganizationOrganizationRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListOrganizationOrganizationRelationship(p, d) @@ -5471,7 +5471,7 @@ func TestFlattenListOrganizationOrganizationRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListOrganizationOrganizationRelationship(p, d) - expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} + expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -5480,7 +5480,7 @@ func TestFlattenListOrganizationOrganizationRelationship(t *testing.T) { func TestFlattenListOsConfigurationFileRelationship(t *testing.T) { p := []models.OsConfigurationFileRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenListOsConfigurationFileRelationship(p, d) @@ -5495,7 +5495,7 @@ func TestFlattenListOsConfigurationFileRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListOsConfigurationFileRelationship(p, d) - expectedOp := []map[string]interface{}{{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"}, {"object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -5504,7 +5504,7 @@ func TestFlattenListOsConfigurationFileRelationship(t *testing.T) { func TestFlattenListOsDistributionRelationship(t *testing.T) { p := []models.OsDistributionRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListOsDistributionRelationship(p, d) @@ -5519,7 +5519,7 @@ func TestFlattenListOsDistributionRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListOsDistributionRelationship(p, d) - expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} + expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -5528,7 +5528,7 @@ func TestFlattenListOsDistributionRelationship(t *testing.T) { func TestFlattenListOsPlaceHolder(t *testing.T) { p := []models.OsPlaceHolder{} var d = &schema.ResourceData{} - c := `{"ObjectType":"os.PlaceHolder","ClassId":"os.PlaceHolder","IsValueSet":true}` + c := `{"ClassId":"os.PlaceHolder","ObjectType":"os.PlaceHolder","IsValueSet":true}` //test when the response is empty ffOpEmpty := flattenListOsPlaceHolder(p, d) @@ -5543,7 +5543,7 @@ func TestFlattenListOsPlaceHolder(t *testing.T) { p = append(p, x) } ffOp := flattenListOsPlaceHolder(p, d) - expectedOp := []map[string]interface{}{{"object_type": "os.PlaceHolder", "class_id": "os.PlaceHolder", "is_value_set": true}, {"object_type": "os.PlaceHolder", "class_id": "os.PlaceHolder", "is_value_set": true}} + expectedOp := []map[string]interface{}{{"class_id": "os.PlaceHolder", "object_type": "os.PlaceHolder", "is_value_set": true}, {"class_id": "os.PlaceHolder", "object_type": "os.PlaceHolder", "is_value_set": true}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -5576,7 +5576,7 @@ func TestFlattenListOsServerConfig(t *testing.T) { func TestFlattenListOsValidationInformation(t *testing.T) { p := []models.OsValidationInformation{} var d = &schema.ResourceData{} - c := `{"ClassId":"os.ValidationInformation","ObjectType":"os.ValidationInformation","ErrorMsg":"ErrorMsg %d","Status":"Status %d","StepName":"StepName %d"}` + c := `{"StepName":"StepName %d","ClassId":"os.ValidationInformation","ObjectType":"os.ValidationInformation","ErrorMsg":"ErrorMsg %d","Status":"Status %d"}` //test when the response is empty ffOpEmpty := flattenListOsValidationInformation(p, d) @@ -5591,7 +5591,7 @@ func TestFlattenListOsValidationInformation(t *testing.T) { p = append(p, x) } ffOp := flattenListOsValidationInformation(p, d) - expectedOp := []map[string]interface{}{{"class_id": "os.ValidationInformation", "object_type": "os.ValidationInformation", "error_msg": "ErrorMsg 1", "status": "Status 1", "step_name": "StepName 1"}, {"class_id": "os.ValidationInformation", "object_type": "os.ValidationInformation", "error_msg": "ErrorMsg 2", "status": "Status 2", "step_name": "StepName 2"}} + expectedOp := []map[string]interface{}{{"step_name": "StepName 1", "class_id": "os.ValidationInformation", "object_type": "os.ValidationInformation", "error_msg": "ErrorMsg 1", "status": "Status 1"}, {"step_name": "StepName 2", "class_id": "os.ValidationInformation", "object_type": "os.ValidationInformation", "error_msg": "ErrorMsg 2", "status": "Status 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -5648,7 +5648,7 @@ func TestFlattenListPciDeviceRelationship(t *testing.T) { func TestFlattenListPciLinkRelationship(t *testing.T) { p := []models.PciLinkRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenListPciLinkRelationship(p, d) @@ -5663,7 +5663,7 @@ func TestFlattenListPciLinkRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListPciLinkRelationship(p, d) - expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -5672,7 +5672,7 @@ func TestFlattenListPciLinkRelationship(t *testing.T) { func TestFlattenListPciSwitchRelationship(t *testing.T) { p := []models.PciSwitchRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenListPciSwitchRelationship(p, d) @@ -5687,7 +5687,7 @@ func TestFlattenListPciSwitchRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListPciSwitchRelationship(p, d) - expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -5720,7 +5720,7 @@ func TestFlattenListPolicyAbstractConfigProfileRelationship(t *testing.T) { func TestFlattenListPolicyAbstractPolicyRelationship(t *testing.T) { p := []models.PolicyAbstractPolicyRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenListPolicyAbstractPolicyRelationship(p, d) @@ -5735,7 +5735,7 @@ func TestFlattenListPolicyAbstractPolicyRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListPolicyAbstractPolicyRelationship(p, d) - expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -5744,7 +5744,7 @@ func TestFlattenListPolicyAbstractPolicyRelationship(t *testing.T) { func TestFlattenListPolicyActionParam(t *testing.T) { p := []models.PolicyActionParam{} var d = &schema.ResourceData{} - c := `{"Name":"Name %d","Value":"Value %d","ObjectType":"policy.ActionParam","ClassId":"policy.ActionParam"}` + c := `{"ObjectType":"policy.ActionParam","ClassId":"policy.ActionParam","Name":"Name %d","Value":"Value %d"}` //test when the response is empty ffOpEmpty := flattenListPolicyActionParam(p, d) @@ -5759,7 +5759,7 @@ func TestFlattenListPolicyActionParam(t *testing.T) { p = append(p, x) } ffOp := flattenListPolicyActionParam(p, d) - expectedOp := []map[string]interface{}{{"name": "Name 1", "value": "Value 1", "object_type": "policy.ActionParam", "class_id": "policy.ActionParam"}, {"name": "Name 2", "value": "Value 2", "object_type": "policy.ActionParam", "class_id": "policy.ActionParam"}} + expectedOp := []map[string]interface{}{{"object_type": "policy.ActionParam", "class_id": "policy.ActionParam", "name": "Name 1", "value": "Value 1"}, {"object_type": "policy.ActionParam", "class_id": "policy.ActionParam", "name": "Name 2", "value": "Value 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -5792,7 +5792,7 @@ func TestFlattenListPolicyinventoryJobInfo(t *testing.T) { func TestFlattenListPortGroupRelationship(t *testing.T) { p := []models.PortGroupRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListPortGroupRelationship(p, d) @@ -5807,7 +5807,7 @@ func TestFlattenListPortGroupRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListPortGroupRelationship(p, d) - expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} + expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -5840,7 +5840,7 @@ func TestFlattenListPortMacBindingRelationship(t *testing.T) { func TestFlattenListPortSubGroupRelationship(t *testing.T) { p := []models.PortSubGroupRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListPortSubGroupRelationship(p, d) @@ -5855,7 +5855,7 @@ func TestFlattenListPortSubGroupRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListPortSubGroupRelationship(p, d) - expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} + expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -5864,7 +5864,7 @@ func TestFlattenListPortSubGroupRelationship(t *testing.T) { func TestFlattenListProcessorUnitRelationship(t *testing.T) { p := []models.ProcessorUnitRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenListProcessorUnitRelationship(p, d) @@ -5879,7 +5879,7 @@ func TestFlattenListProcessorUnitRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListProcessorUnitRelationship(p, d) - expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -5912,7 +5912,7 @@ func TestFlattenListRackUnitPersonalityRelationship(t *testing.T) { func TestFlattenListRecommendationPhysicalItemRelationship(t *testing.T) { p := []models.RecommendationPhysicalItemRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListRecommendationPhysicalItemRelationship(p, d) @@ -5927,7 +5927,7 @@ func TestFlattenListRecommendationPhysicalItemRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListRecommendationPhysicalItemRelationship(p, d) - expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} + expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -5936,7 +5936,7 @@ func TestFlattenListRecommendationPhysicalItemRelationship(t *testing.T) { func TestFlattenListRecoveryBackupProfileRelationship(t *testing.T) { p := []models.RecoveryBackupProfileRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenListRecoveryBackupProfileRelationship(p, d) @@ -5951,7 +5951,7 @@ func TestFlattenListRecoveryBackupProfileRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListRecoveryBackupProfileRelationship(p, d) - expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} + expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -6008,7 +6008,7 @@ func TestFlattenListResourceGroupRelationship(t *testing.T) { func TestFlattenListResourcePerTypeCombinedSelector(t *testing.T) { p := []models.ResourcePerTypeCombinedSelector{} var d = &schema.ResourceData{} - c := `{"CombinedSelector":"CombinedSelector %d","EmptyFilter":true,"SelectorObjectType":"SelectorObjectType %d","ClassId":"resource.PerTypeCombinedSelector","ObjectType":"resource.PerTypeCombinedSelector"}` + c := `{"ObjectType":"resource.PerTypeCombinedSelector","ClassId":"resource.PerTypeCombinedSelector","SelectorObjectType":"SelectorObjectType %d","CombinedSelector":"CombinedSelector %d","EmptyFilter":true}` //test when the response is empty ffOpEmpty := flattenListResourcePerTypeCombinedSelector(p, d) @@ -6023,7 +6023,7 @@ func TestFlattenListResourcePerTypeCombinedSelector(t *testing.T) { p = append(p, x) } ffOp := flattenListResourcePerTypeCombinedSelector(p, d) - expectedOp := []map[string]interface{}{{"combined_selector": "CombinedSelector 1", "empty_filter": true, "selector_object_type": "SelectorObjectType 1", "class_id": "resource.PerTypeCombinedSelector", "object_type": "resource.PerTypeCombinedSelector"}, {"combined_selector": "CombinedSelector 2", "empty_filter": true, "selector_object_type": "SelectorObjectType 2", "class_id": "resource.PerTypeCombinedSelector", "object_type": "resource.PerTypeCombinedSelector"}} + expectedOp := []map[string]interface{}{{"object_type": "resource.PerTypeCombinedSelector", "class_id": "resource.PerTypeCombinedSelector", "selector_object_type": "SelectorObjectType 1", "combined_selector": "CombinedSelector 1", "empty_filter": true}, {"object_type": "resource.PerTypeCombinedSelector", "class_id": "resource.PerTypeCombinedSelector", "selector_object_type": "SelectorObjectType 2", "combined_selector": "CombinedSelector 2", "empty_filter": true}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -6032,7 +6032,7 @@ func TestFlattenListResourcePerTypeCombinedSelector(t *testing.T) { func TestFlattenListResourceSelector(t *testing.T) { p := []models.ResourceSelector{} var d = &schema.ResourceData{} - c := `{"ObjectType":"resource.Selector","ClassId":"resource.Selector","Selector":"Selector %d"}` + c := `{"ClassId":"resource.Selector","Selector":"Selector %d","ObjectType":"resource.Selector"}` //test when the response is empty ffOpEmpty := flattenListResourceSelector(p, d) @@ -6047,7 +6047,7 @@ func TestFlattenListResourceSelector(t *testing.T) { p = append(p, x) } ffOp := flattenListResourceSelector(p, d) - expectedOp := []map[string]interface{}{{"object_type": "resource.Selector", "class_id": "resource.Selector", "selector": "Selector 1"}, {"object_type": "resource.Selector", "class_id": "resource.Selector", "selector": "Selector 2"}} + expectedOp := []map[string]interface{}{{"class_id": "resource.Selector", "selector": "Selector 1", "object_type": "resource.Selector"}, {"class_id": "resource.Selector", "selector": "Selector 2", "object_type": "resource.Selector"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -6056,7 +6056,7 @@ func TestFlattenListResourceSelector(t *testing.T) { func TestFlattenListSdcardPartition(t *testing.T) { p := []models.SdcardPartition{} var d = &schema.ResourceData{} - c := `{"ObjectType":"sdcard.Partition","Type":"Type %d","ClassId":"sdcard.Partition"}` + c := `{"ObjectType":"sdcard.Partition","ClassId":"sdcard.Partition","Type":"Type %d"}` //test when the response is empty ffOpEmpty := flattenListSdcardPartition(p, d) @@ -6071,7 +6071,7 @@ func TestFlattenListSdcardPartition(t *testing.T) { p = append(p, x) } ffOp := flattenListSdcardPartition(p, d) - expectedOp := []map[string]interface{}{{"object_type": "sdcard.Partition", "type": "Type 1", "class_id": "sdcard.Partition"}, {"object_type": "sdcard.Partition", "type": "Type 2", "class_id": "sdcard.Partition"}} + expectedOp := []map[string]interface{}{{"object_type": "sdcard.Partition", "class_id": "sdcard.Partition", "type": "Type 1"}, {"object_type": "sdcard.Partition", "class_id": "sdcard.Partition", "type": "Type 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -6080,7 +6080,7 @@ func TestFlattenListSdcardPartition(t *testing.T) { func TestFlattenListSecurityUnitRelationship(t *testing.T) { p := []models.SecurityUnitRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenListSecurityUnitRelationship(p, d) @@ -6095,7 +6095,7 @@ func TestFlattenListSecurityUnitRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListSecurityUnitRelationship(p, d) - expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} + expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -6104,7 +6104,7 @@ func TestFlattenListSecurityUnitRelationship(t *testing.T) { func TestFlattenListServerConfigChangeDetailRelationship(t *testing.T) { p := []models.ServerConfigChangeDetailRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListServerConfigChangeDetailRelationship(p, d) @@ -6119,7 +6119,7 @@ func TestFlattenListServerConfigChangeDetailRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListServerConfigChangeDetailRelationship(p, d) - expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"}, {"object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -6128,7 +6128,7 @@ func TestFlattenListServerConfigChangeDetailRelationship(t *testing.T) { func TestFlattenListServerConfigResultEntryRelationship(t *testing.T) { p := []models.ServerConfigResultEntryRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenListServerConfigResultEntryRelationship(p, d) @@ -6143,7 +6143,7 @@ func TestFlattenListServerConfigResultEntryRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListServerConfigResultEntryRelationship(p, d) - expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -6152,7 +6152,7 @@ func TestFlattenListServerConfigResultEntryRelationship(t *testing.T) { func TestFlattenListSnmpTrap(t *testing.T) { p := []models.SnmpTrap{} var d = &schema.ResourceData{} - c := `{"ObjectType":"snmp.Trap","Destination":"Destination %d","Enabled":true,"User":"User %d","Port":32,"Type":"Type %d","Community":"Community %d","ClassId":"snmp.Trap","Version":"Version %d"}` + c := `{"Version":"Version %d","ClassId":"snmp.Trap","User":"User %d","Destination":"Destination %d","Community":"Community %d","Port":32,"ObjectType":"snmp.Trap","Enabled":true,"Type":"Type %d"}` //test when the response is empty ffOpEmpty := flattenListSnmpTrap(p, d) @@ -6167,7 +6167,7 @@ func TestFlattenListSnmpTrap(t *testing.T) { p = append(p, x) } ffOp := flattenListSnmpTrap(p, d) - expectedOp := []map[string]interface{}{{"object_type": "snmp.Trap", "destination": "Destination 1", "enabled": true, "user": "User 1", "port": 32, "type": "Type 1", "community": "Community 1", "class_id": "snmp.Trap", "nr_version": "Version 1"}, {"object_type": "snmp.Trap", "destination": "Destination 2", "enabled": true, "user": "User 2", "port": 32, "type": "Type 2", "community": "Community 2", "class_id": "snmp.Trap", "nr_version": "Version 2"}} + expectedOp := []map[string]interface{}{{"nr_version": "Version 1", "class_id": "snmp.Trap", "user": "User 1", "destination": "Destination 1", "community": "Community 1", "port": 32, "object_type": "snmp.Trap", "enabled": true, "type": "Type 1"}, {"nr_version": "Version 2", "class_id": "snmp.Trap", "user": "User 2", "destination": "Destination 2", "community": "Community 2", "port": 32, "object_type": "snmp.Trap", "enabled": true, "type": "Type 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -6176,7 +6176,7 @@ func TestFlattenListSnmpTrap(t *testing.T) { func TestFlattenListSnmpUser(t *testing.T) { p := []models.SnmpUser{} var d = &schema.ResourceData{} - c := `{"IsPrivacyPasswordSet":true,"Name":"Name %d","ClassId":"snmp.User","PrivacyType":"PrivacyType %d","AuthType":"AuthType %d","IsAuthPasswordSet":true,"ObjectType":"snmp.User","SecurityLevel":"SecurityLevel %d"}` + c := `{"ClassId":"snmp.User","Name":"Name %d","IsPrivacyPasswordSet":true,"ObjectType":"snmp.User","AuthType":"AuthType %d","IsAuthPasswordSet":true,"PrivacyType":"PrivacyType %d","SecurityLevel":"SecurityLevel %d"}` //test when the response is empty ffOpEmpty := flattenListSnmpUser(p, d) @@ -6191,7 +6191,7 @@ func TestFlattenListSnmpUser(t *testing.T) { p = append(p, x) } ffOp := flattenListSnmpUser(p, d) - expectedOp := []map[string]interface{}{{"is_privacy_password_set": true, "name": "Name 1", "class_id": "snmp.User", "privacy_type": "PrivacyType 1", "auth_type": "AuthType 1", "is_auth_password_set": true, "object_type": "snmp.User", "security_level": "SecurityLevel 1"}, {"is_privacy_password_set": true, "name": "Name 2", "class_id": "snmp.User", "privacy_type": "PrivacyType 2", "auth_type": "AuthType 2", "is_auth_password_set": true, "object_type": "snmp.User", "security_level": "SecurityLevel 2"}} + expectedOp := []map[string]interface{}{{"class_id": "snmp.User", "name": "Name 1", "is_privacy_password_set": true, "object_type": "snmp.User", "auth_type": "AuthType 1", "is_auth_password_set": true, "privacy_type": "PrivacyType 1", "security_level": "SecurityLevel 1"}, {"class_id": "snmp.User", "name": "Name 2", "is_privacy_password_set": true, "object_type": "snmp.User", "auth_type": "AuthType 2", "is_auth_password_set": true, "privacy_type": "PrivacyType 2", "security_level": "SecurityLevel 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -6200,7 +6200,7 @@ func TestFlattenListSnmpUser(t *testing.T) { func TestFlattenListSoftwareHyperflexDistributableRelationship(t *testing.T) { p := []models.SoftwareHyperflexDistributableRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenListSoftwareHyperflexDistributableRelationship(p, d) @@ -6215,7 +6215,7 @@ func TestFlattenListSoftwareHyperflexDistributableRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListSoftwareHyperflexDistributableRelationship(p, d) - expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} + expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -6224,7 +6224,7 @@ func TestFlattenListSoftwareHyperflexDistributableRelationship(t *testing.T) { func TestFlattenListSoftwareUcsdDistributableRelationship(t *testing.T) { p := []models.SoftwareUcsdDistributableRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListSoftwareUcsdDistributableRelationship(p, d) @@ -6239,7 +6239,7 @@ func TestFlattenListSoftwareUcsdDistributableRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListSoftwareUcsdDistributableRelationship(p, d) - expectedOp := []map[string]interface{}{{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"}, {"object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -6248,7 +6248,7 @@ func TestFlattenListSoftwareUcsdDistributableRelationship(t *testing.T) { func TestFlattenListSoftwarerepositoryConstraintModels(t *testing.T) { p := []models.SoftwarerepositoryConstraintModels{} var d = &schema.ResourceData{} - c := `{"MinVersion":"MinVersion %d","Name":"Name %d","PlatformRegex":"PlatformRegex %d","ObjectType":"softwarerepository.ConstraintModels","ClassId":"softwarerepository.ConstraintModels"}` + c := `{"ObjectType":"softwarerepository.ConstraintModels","MinVersion":"MinVersion %d","Name":"Name %d","PlatformRegex":"PlatformRegex %d","ClassId":"softwarerepository.ConstraintModels"}` //test when the response is empty ffOpEmpty := flattenListSoftwarerepositoryConstraintModels(p, d) @@ -6263,7 +6263,7 @@ func TestFlattenListSoftwarerepositoryConstraintModels(t *testing.T) { p = append(p, x) } ffOp := flattenListSoftwarerepositoryConstraintModels(p, d) - expectedOp := []map[string]interface{}{{"min_version": "MinVersion 1", "name": "Name 1", "platform_regex": "PlatformRegex 1", "object_type": "softwarerepository.ConstraintModels", "class_id": "softwarerepository.ConstraintModels"}, {"min_version": "MinVersion 2", "name": "Name 2", "platform_regex": "PlatformRegex 2", "object_type": "softwarerepository.ConstraintModels", "class_id": "softwarerepository.ConstraintModels"}} + expectedOp := []map[string]interface{}{{"object_type": "softwarerepository.ConstraintModels", "min_version": "MinVersion 1", "name": "Name 1", "platform_regex": "PlatformRegex 1", "class_id": "softwarerepository.ConstraintModels"}, {"object_type": "softwarerepository.ConstraintModels", "min_version": "MinVersion 2", "name": "Name 2", "platform_regex": "PlatformRegex 2", "class_id": "softwarerepository.ConstraintModels"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -6296,7 +6296,7 @@ func TestFlattenListStorageBaseClusterRelationship(t *testing.T) { func TestFlattenListStorageBaseInitiator(t *testing.T) { p := []models.StorageBaseInitiator{} var d = &schema.ResourceData{} - c := `{"Name":"Name %d","Type":"Type %d","ObjectType":"storage.BaseInitiator","ClassId":"storage.BaseInitiator","Wwn":"Wwn %d","Iqn":"Iqn %d"}` + c := `{"Name":"Name %d","Type":"Type %d","Wwn":"Wwn %d","ObjectType":"storage.BaseInitiator","ClassId":"storage.BaseInitiator","Iqn":"Iqn %d"}` //test when the response is empty ffOpEmpty := flattenListStorageBaseInitiator(p, d) @@ -6311,7 +6311,7 @@ func TestFlattenListStorageBaseInitiator(t *testing.T) { p = append(p, x) } ffOp := flattenListStorageBaseInitiator(p, d) - expectedOp := []map[string]interface{}{{"name": "Name 1", "type": "Type 1", "object_type": "storage.BaseInitiator", "class_id": "storage.BaseInitiator", "wwn": "Wwn 1", "iqn": "Iqn 1"}, {"name": "Name 2", "type": "Type 2", "object_type": "storage.BaseInitiator", "class_id": "storage.BaseInitiator", "wwn": "Wwn 2", "iqn": "Iqn 2"}} + expectedOp := []map[string]interface{}{{"name": "Name 1", "type": "Type 1", "wwn": "Wwn 1", "object_type": "storage.BaseInitiator", "class_id": "storage.BaseInitiator", "iqn": "Iqn 1"}, {"name": "Name 2", "type": "Type 2", "wwn": "Wwn 2", "object_type": "storage.BaseInitiator", "class_id": "storage.BaseInitiator", "iqn": "Iqn 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -6320,7 +6320,7 @@ func TestFlattenListStorageBaseInitiator(t *testing.T) { func TestFlattenListStorageControllerRelationship(t *testing.T) { p := []models.StorageControllerRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListStorageControllerRelationship(p, d) @@ -6335,7 +6335,7 @@ func TestFlattenListStorageControllerRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListStorageControllerRelationship(p, d) - expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} + expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -6344,7 +6344,7 @@ func TestFlattenListStorageControllerRelationship(t *testing.T) { func TestFlattenListStorageDiskGroupRelationship(t *testing.T) { p := []models.StorageDiskGroupRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenListStorageDiskGroupRelationship(p, d) @@ -6359,7 +6359,7 @@ func TestFlattenListStorageDiskGroupRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListStorageDiskGroupRelationship(p, d) - expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} + expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -6368,7 +6368,7 @@ func TestFlattenListStorageDiskGroupRelationship(t *testing.T) { func TestFlattenListStorageDiskSlotRelationship(t *testing.T) { p := []models.StorageDiskSlotRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenListStorageDiskSlotRelationship(p, d) @@ -6383,7 +6383,7 @@ func TestFlattenListStorageDiskSlotRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListStorageDiskSlotRelationship(p, d) - expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -6392,7 +6392,7 @@ func TestFlattenListStorageDiskSlotRelationship(t *testing.T) { func TestFlattenListStorageDriveGroupRelationship(t *testing.T) { p := []models.StorageDriveGroupRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListStorageDriveGroupRelationship(p, d) @@ -6407,7 +6407,7 @@ func TestFlattenListStorageDriveGroupRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListStorageDriveGroupRelationship(p, d) - expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} + expectedOp := []map[string]interface{}{{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"}, {"object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -6416,7 +6416,7 @@ func TestFlattenListStorageDriveGroupRelationship(t *testing.T) { func TestFlattenListStorageEnclosureRelationship(t *testing.T) { p := []models.StorageEnclosureRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListStorageEnclosureRelationship(p, d) @@ -6431,7 +6431,7 @@ func TestFlattenListStorageEnclosureRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListStorageEnclosureRelationship(p, d) - expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} + expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -6440,7 +6440,7 @@ func TestFlattenListStorageEnclosureRelationship(t *testing.T) { func TestFlattenListStorageEnclosureDiskRelationship(t *testing.T) { p := []models.StorageEnclosureDiskRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenListStorageEnclosureDiskRelationship(p, d) @@ -6455,7 +6455,7 @@ func TestFlattenListStorageEnclosureDiskRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListStorageEnclosureDiskRelationship(p, d) - expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -6488,7 +6488,7 @@ func TestFlattenListStorageEnclosureDiskSlotEpRelationship(t *testing.T) { func TestFlattenListStorageFlexFlashControllerRelationship(t *testing.T) { p := []models.StorageFlexFlashControllerRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenListStorageFlexFlashControllerRelationship(p, d) @@ -6503,7 +6503,7 @@ func TestFlattenListStorageFlexFlashControllerRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListStorageFlexFlashControllerRelationship(p, d) - expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -6512,7 +6512,7 @@ func TestFlattenListStorageFlexFlashControllerRelationship(t *testing.T) { func TestFlattenListStorageFlexFlashControllerPropsRelationship(t *testing.T) { p := []models.StorageFlexFlashControllerPropsRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListStorageFlexFlashControllerPropsRelationship(p, d) @@ -6527,7 +6527,7 @@ func TestFlattenListStorageFlexFlashControllerPropsRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListStorageFlexFlashControllerPropsRelationship(p, d) - expectedOp := []map[string]interface{}{{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"}, {"object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -6536,7 +6536,7 @@ func TestFlattenListStorageFlexFlashControllerPropsRelationship(t *testing.T) { func TestFlattenListStorageFlexFlashPhysicalDriveRelationship(t *testing.T) { p := []models.StorageFlexFlashPhysicalDriveRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenListStorageFlexFlashPhysicalDriveRelationship(p, d) @@ -6551,7 +6551,7 @@ func TestFlattenListStorageFlexFlashPhysicalDriveRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListStorageFlexFlashPhysicalDriveRelationship(p, d) - expectedOp := []map[string]interface{}{{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"}, {"object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -6560,7 +6560,7 @@ func TestFlattenListStorageFlexFlashPhysicalDriveRelationship(t *testing.T) { func TestFlattenListStorageFlexFlashVirtualDriveRelationship(t *testing.T) { p := []models.StorageFlexFlashVirtualDriveRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenListStorageFlexFlashVirtualDriveRelationship(p, d) @@ -6575,7 +6575,7 @@ func TestFlattenListStorageFlexFlashVirtualDriveRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListStorageFlexFlashVirtualDriveRelationship(p, d) - expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -6608,7 +6608,7 @@ func TestFlattenListStorageFlexUtilControllerRelationship(t *testing.T) { func TestFlattenListStorageFlexUtilPhysicalDriveRelationship(t *testing.T) { p := []models.StorageFlexUtilPhysicalDriveRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListStorageFlexUtilPhysicalDriveRelationship(p, d) @@ -6623,7 +6623,7 @@ func TestFlattenListStorageFlexUtilPhysicalDriveRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListStorageFlexUtilPhysicalDriveRelationship(p, d) - expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} + expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -6632,7 +6632,7 @@ func TestFlattenListStorageFlexUtilPhysicalDriveRelationship(t *testing.T) { func TestFlattenListStorageFlexUtilVirtualDriveRelationship(t *testing.T) { p := []models.StorageFlexUtilVirtualDriveRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListStorageFlexUtilVirtualDriveRelationship(p, d) @@ -6647,7 +6647,7 @@ func TestFlattenListStorageFlexUtilVirtualDriveRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListStorageFlexUtilVirtualDriveRelationship(p, d) - expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} + expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -6656,7 +6656,7 @@ func TestFlattenListStorageFlexUtilVirtualDriveRelationship(t *testing.T) { func TestFlattenListStorageHitachiParityGroupRelationship(t *testing.T) { p := []models.StorageHitachiParityGroupRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListStorageHitachiParityGroupRelationship(p, d) @@ -6671,7 +6671,7 @@ func TestFlattenListStorageHitachiParityGroupRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListStorageHitachiParityGroupRelationship(p, d) - expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} + expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -6680,7 +6680,7 @@ func TestFlattenListStorageHitachiParityGroupRelationship(t *testing.T) { func TestFlattenListStorageHyperFlexStorageContainerRelationship(t *testing.T) { p := []models.StorageHyperFlexStorageContainerRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenListStorageHyperFlexStorageContainerRelationship(p, d) @@ -6695,7 +6695,7 @@ func TestFlattenListStorageHyperFlexStorageContainerRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListStorageHyperFlexStorageContainerRelationship(p, d) - expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -6704,7 +6704,7 @@ func TestFlattenListStorageHyperFlexStorageContainerRelationship(t *testing.T) { func TestFlattenListStorageHyperFlexVolumeRelationship(t *testing.T) { p := []models.StorageHyperFlexVolumeRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListStorageHyperFlexVolumeRelationship(p, d) @@ -6719,7 +6719,7 @@ func TestFlattenListStorageHyperFlexVolumeRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListStorageHyperFlexVolumeRelationship(p, d) - expectedOp := []map[string]interface{}{{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"}, {"object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -6728,7 +6728,7 @@ func TestFlattenListStorageHyperFlexVolumeRelationship(t *testing.T) { func TestFlattenListStorageItemRelationship(t *testing.T) { p := []models.StorageItemRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenListStorageItemRelationship(p, d) @@ -6743,7 +6743,7 @@ func TestFlattenListStorageItemRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListStorageItemRelationship(p, d) - expectedOp := []map[string]interface{}{{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"}, {"object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -6752,7 +6752,7 @@ func TestFlattenListStorageItemRelationship(t *testing.T) { func TestFlattenListStorageNetAppAggregateRelationship(t *testing.T) { p := []models.StorageNetAppAggregateRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenListStorageNetAppAggregateRelationship(p, d) @@ -6767,7 +6767,7 @@ func TestFlattenListStorageNetAppAggregateRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListStorageNetAppAggregateRelationship(p, d) - expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -6776,7 +6776,7 @@ func TestFlattenListStorageNetAppAggregateRelationship(t *testing.T) { func TestFlattenListStorageNetAppAggregateEventRelationship(t *testing.T) { p := []models.StorageNetAppAggregateEventRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenListStorageNetAppAggregateEventRelationship(p, d) @@ -6791,7 +6791,7 @@ func TestFlattenListStorageNetAppAggregateEventRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListStorageNetAppAggregateEventRelationship(p, d) - expectedOp := []map[string]interface{}{{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"}, {"object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -6800,7 +6800,7 @@ func TestFlattenListStorageNetAppAggregateEventRelationship(t *testing.T) { func TestFlattenListStorageNetAppClusterEventRelationship(t *testing.T) { p := []models.StorageNetAppClusterEventRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListStorageNetAppClusterEventRelationship(p, d) @@ -6815,7 +6815,7 @@ func TestFlattenListStorageNetAppClusterEventRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListStorageNetAppClusterEventRelationship(p, d) - expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} + expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -6824,7 +6824,7 @@ func TestFlattenListStorageNetAppClusterEventRelationship(t *testing.T) { func TestFlattenListStorageNetAppDiskEventRelationship(t *testing.T) { p := []models.StorageNetAppDiskEventRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListStorageNetAppDiskEventRelationship(p, d) @@ -6839,7 +6839,7 @@ func TestFlattenListStorageNetAppDiskEventRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListStorageNetAppDiskEventRelationship(p, d) - expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} + expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -6848,7 +6848,7 @@ func TestFlattenListStorageNetAppDiskEventRelationship(t *testing.T) { func TestFlattenListStorageNetAppEthernetPortEventRelationship(t *testing.T) { p := []models.StorageNetAppEthernetPortEventRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListStorageNetAppEthernetPortEventRelationship(p, d) @@ -6863,7 +6863,7 @@ func TestFlattenListStorageNetAppEthernetPortEventRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListStorageNetAppEthernetPortEventRelationship(p, d) - expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"}, {"object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -6872,7 +6872,7 @@ func TestFlattenListStorageNetAppEthernetPortEventRelationship(t *testing.T) { func TestFlattenListStorageNetAppExportPolicyRule(t *testing.T) { p := []models.StorageNetAppExportPolicyRule{} var d = &schema.ResourceData{} - c := `{"ClassId":"storage.NetAppExportPolicyRule","Index":32,"User":"User %d","ObjectType":"storage.NetAppExportPolicyRule"}` + c := `{"ClassId":"storage.NetAppExportPolicyRule","ObjectType":"storage.NetAppExportPolicyRule","User":"User %d","Index":32}` //test when the response is empty ffOpEmpty := flattenListStorageNetAppExportPolicyRule(p, d) @@ -6887,7 +6887,7 @@ func TestFlattenListStorageNetAppExportPolicyRule(t *testing.T) { p = append(p, x) } ffOp := flattenListStorageNetAppExportPolicyRule(p, d) - expectedOp := []map[string]interface{}{{"class_id": "storage.NetAppExportPolicyRule", "index": 32, "user": "User 1", "object_type": "storage.NetAppExportPolicyRule"}, {"class_id": "storage.NetAppExportPolicyRule", "index": 32, "user": "User 2", "object_type": "storage.NetAppExportPolicyRule"}} + expectedOp := []map[string]interface{}{{"class_id": "storage.NetAppExportPolicyRule", "object_type": "storage.NetAppExportPolicyRule", "user": "User 1", "index": 32}, {"class_id": "storage.NetAppExportPolicyRule", "object_type": "storage.NetAppExportPolicyRule", "user": "User 2", "index": 32}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -6992,7 +6992,7 @@ func TestFlattenListStorageNetAppIpInterfaceEventRelationship(t *testing.T) { func TestFlattenListStorageNetAppLunEventRelationship(t *testing.T) { p := []models.StorageNetAppLunEventRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListStorageNetAppLunEventRelationship(p, d) @@ -7007,7 +7007,7 @@ func TestFlattenListStorageNetAppLunEventRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListStorageNetAppLunEventRelationship(p, d) - expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} + expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -7016,7 +7016,7 @@ func TestFlattenListStorageNetAppLunEventRelationship(t *testing.T) { func TestFlattenListStorageNetAppNodeEventRelationship(t *testing.T) { p := []models.StorageNetAppNodeEventRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListStorageNetAppNodeEventRelationship(p, d) @@ -7031,7 +7031,7 @@ func TestFlattenListStorageNetAppNodeEventRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListStorageNetAppNodeEventRelationship(p, d) - expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} + expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -7040,7 +7040,7 @@ func TestFlattenListStorageNetAppNodeEventRelationship(t *testing.T) { func TestFlattenListStorageNetAppSvmEventRelationship(t *testing.T) { p := []models.StorageNetAppSvmEventRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenListStorageNetAppSvmEventRelationship(p, d) @@ -7055,7 +7055,7 @@ func TestFlattenListStorageNetAppSvmEventRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListStorageNetAppSvmEventRelationship(p, d) - expectedOp := []map[string]interface{}{{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"}, {"object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -7064,7 +7064,7 @@ func TestFlattenListStorageNetAppSvmEventRelationship(t *testing.T) { func TestFlattenListStorageNetAppVolumeEventRelationship(t *testing.T) { p := []models.StorageNetAppVolumeEventRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenListStorageNetAppVolumeEventRelationship(p, d) @@ -7079,7 +7079,7 @@ func TestFlattenListStorageNetAppVolumeEventRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListStorageNetAppVolumeEventRelationship(p, d) - expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -7112,7 +7112,7 @@ func TestFlattenListStoragePhysicalDiskRelationship(t *testing.T) { func TestFlattenListStoragePhysicalDiskExtensionRelationship(t *testing.T) { p := []models.StoragePhysicalDiskExtensionRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListStoragePhysicalDiskExtensionRelationship(p, d) @@ -7127,7 +7127,7 @@ func TestFlattenListStoragePhysicalDiskExtensionRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListStoragePhysicalDiskExtensionRelationship(p, d) - expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"}, {"object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -7136,7 +7136,7 @@ func TestFlattenListStoragePhysicalDiskExtensionRelationship(t *testing.T) { func TestFlattenListStoragePhysicalDiskUsageRelationship(t *testing.T) { p := []models.StoragePhysicalDiskUsageRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenListStoragePhysicalDiskUsageRelationship(p, d) @@ -7151,7 +7151,7 @@ func TestFlattenListStoragePhysicalDiskUsageRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListStoragePhysicalDiskUsageRelationship(p, d) - expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} + expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -7160,7 +7160,7 @@ func TestFlattenListStoragePhysicalDiskUsageRelationship(t *testing.T) { func TestFlattenListStoragePureHostRelationship(t *testing.T) { p := []models.StoragePureHostRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListStoragePureHostRelationship(p, d) @@ -7175,7 +7175,7 @@ func TestFlattenListStoragePureHostRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListStoragePureHostRelationship(p, d) - expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} + expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -7184,7 +7184,7 @@ func TestFlattenListStoragePureHostRelationship(t *testing.T) { func TestFlattenListStoragePureHostGroupRelationship(t *testing.T) { p := []models.StoragePureHostGroupRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenListStoragePureHostGroupRelationship(p, d) @@ -7199,7 +7199,7 @@ func TestFlattenListStoragePureHostGroupRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListStoragePureHostGroupRelationship(p, d) - expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -7208,7 +7208,7 @@ func TestFlattenListStoragePureHostGroupRelationship(t *testing.T) { func TestFlattenListStoragePureReplicationBlackout(t *testing.T) { p := []models.StoragePureReplicationBlackout{} var d = &schema.ResourceData{} - c := `{"ObjectType":"storage.PureReplicationBlackout","ClassId":"storage.PureReplicationBlackout","End":"End %d","Start":"Start %d"}` + c := `{"Start":"Start %d","ObjectType":"storage.PureReplicationBlackout","ClassId":"storage.PureReplicationBlackout","End":"End %d"}` //test when the response is empty ffOpEmpty := flattenListStoragePureReplicationBlackout(p, d) @@ -7223,7 +7223,7 @@ func TestFlattenListStoragePureReplicationBlackout(t *testing.T) { p = append(p, x) } ffOp := flattenListStoragePureReplicationBlackout(p, d) - expectedOp := []map[string]interface{}{{"object_type": "storage.PureReplicationBlackout", "class_id": "storage.PureReplicationBlackout", "end": "End 1", "start": "Start 1"}, {"object_type": "storage.PureReplicationBlackout", "class_id": "storage.PureReplicationBlackout", "end": "End 2", "start": "Start 2"}} + expectedOp := []map[string]interface{}{{"start": "Start 1", "object_type": "storage.PureReplicationBlackout", "class_id": "storage.PureReplicationBlackout", "end": "End 1"}, {"start": "Start 2", "object_type": "storage.PureReplicationBlackout", "class_id": "storage.PureReplicationBlackout", "end": "End 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -7232,7 +7232,7 @@ func TestFlattenListStoragePureReplicationBlackout(t *testing.T) { func TestFlattenListStoragePureVolumeRelationship(t *testing.T) { p := []models.StoragePureVolumeRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListStoragePureVolumeRelationship(p, d) @@ -7247,7 +7247,7 @@ func TestFlattenListStoragePureVolumeRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListStoragePureVolumeRelationship(p, d) - expectedOp := []map[string]interface{}{{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"}, {"object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -7256,7 +7256,7 @@ func TestFlattenListStoragePureVolumeRelationship(t *testing.T) { func TestFlattenListStorageSasExpanderRelationship(t *testing.T) { p := []models.StorageSasExpanderRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListStorageSasExpanderRelationship(p, d) @@ -7271,7 +7271,7 @@ func TestFlattenListStorageSasExpanderRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListStorageSasExpanderRelationship(p, d) - expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} + expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -7328,7 +7328,7 @@ func TestFlattenListStorageSpanRelationship(t *testing.T) { func TestFlattenListStorageStorageContainerHostMountStatus(t *testing.T) { p := []models.StorageStorageContainerHostMountStatus{} var d = &schema.ResourceData{} - c := `{"Accessibility":"Accessibility %d","HostName":"HostName %d","Mounted":true,"ObjectType":"storage.StorageContainerHostMountStatus","ClassId":"storage.StorageContainerHostMountStatus","Reason":"Reason %d"}` + c := `{"Mounted":true,"Reason":"Reason %d","ObjectType":"storage.StorageContainerHostMountStatus","ClassId":"storage.StorageContainerHostMountStatus","Accessibility":"Accessibility %d","HostName":"HostName %d"}` //test when the response is empty ffOpEmpty := flattenListStorageStorageContainerHostMountStatus(p, d) @@ -7343,7 +7343,7 @@ func TestFlattenListStorageStorageContainerHostMountStatus(t *testing.T) { p = append(p, x) } ffOp := flattenListStorageStorageContainerHostMountStatus(p, d) - expectedOp := []map[string]interface{}{{"accessibility": "Accessibility 1", "host_name": "HostName 1", "mounted": true, "object_type": "storage.StorageContainerHostMountStatus", "class_id": "storage.StorageContainerHostMountStatus", "reason": "Reason 1"}, {"accessibility": "Accessibility 2", "host_name": "HostName 2", "mounted": true, "object_type": "storage.StorageContainerHostMountStatus", "class_id": "storage.StorageContainerHostMountStatus", "reason": "Reason 2"}} + expectedOp := []map[string]interface{}{{"mounted": true, "reason": "Reason 1", "object_type": "storage.StorageContainerHostMountStatus", "class_id": "storage.StorageContainerHostMountStatus", "accessibility": "Accessibility 1", "host_name": "HostName 1"}, {"mounted": true, "reason": "Reason 2", "object_type": "storage.StorageContainerHostMountStatus", "class_id": "storage.StorageContainerHostMountStatus", "accessibility": "Accessibility 2", "host_name": "HostName 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -7376,7 +7376,7 @@ func TestFlattenListStorageVdMemberEpRelationship(t *testing.T) { func TestFlattenListStorageVirtualDriveRelationship(t *testing.T) { p := []models.StorageVirtualDriveRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListStorageVirtualDriveRelationship(p, d) @@ -7391,7 +7391,7 @@ func TestFlattenListStorageVirtualDriveRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListStorageVirtualDriveRelationship(p, d) - expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} + expectedOp := []map[string]interface{}{{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"}, {"object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -7400,7 +7400,7 @@ func TestFlattenListStorageVirtualDriveRelationship(t *testing.T) { func TestFlattenListStorageVirtualDriveConfiguration(t *testing.T) { p := []models.StorageVirtualDriveConfiguration{} var d = &schema.ResourceData{} - c := `{"ExpandToAvailable":true,"Name":"Name %d","Size":32,"BootDrive":true,"ObjectType":"storage.VirtualDriveConfiguration","ClassId":"storage.VirtualDriveConfiguration"}` + c := `{"BootDrive":true,"ExpandToAvailable":true,"Name":"Name %d","Size":32,"ObjectType":"storage.VirtualDriveConfiguration","ClassId":"storage.VirtualDriveConfiguration"}` //test when the response is empty ffOpEmpty := flattenListStorageVirtualDriveConfiguration(p, d) @@ -7415,7 +7415,7 @@ func TestFlattenListStorageVirtualDriveConfiguration(t *testing.T) { p = append(p, x) } ffOp := flattenListStorageVirtualDriveConfiguration(p, d) - expectedOp := []map[string]interface{}{{"expand_to_available": true, "name": "Name 1", "size": 32, "boot_drive": true, "object_type": "storage.VirtualDriveConfiguration", "class_id": "storage.VirtualDriveConfiguration"}, {"expand_to_available": true, "name": "Name 2", "size": 32, "boot_drive": true, "object_type": "storage.VirtualDriveConfiguration", "class_id": "storage.VirtualDriveConfiguration"}} + expectedOp := []map[string]interface{}{{"boot_drive": true, "expand_to_available": true, "name": "Name 1", "size": 32, "object_type": "storage.VirtualDriveConfiguration", "class_id": "storage.VirtualDriveConfiguration"}, {"boot_drive": true, "expand_to_available": true, "name": "Name 2", "size": 32, "object_type": "storage.VirtualDriveConfiguration", "class_id": "storage.VirtualDriveConfiguration"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -7424,7 +7424,7 @@ func TestFlattenListStorageVirtualDriveConfiguration(t *testing.T) { func TestFlattenListStorageVirtualDriveContainerRelationship(t *testing.T) { p := []models.StorageVirtualDriveContainerRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenListStorageVirtualDriveContainerRelationship(p, d) @@ -7439,7 +7439,7 @@ func TestFlattenListStorageVirtualDriveContainerRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListStorageVirtualDriveContainerRelationship(p, d) - expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -7448,7 +7448,7 @@ func TestFlattenListStorageVirtualDriveContainerRelationship(t *testing.T) { func TestFlattenListStorageVirtualDriveExtensionRelationship(t *testing.T) { p := []models.StorageVirtualDriveExtensionRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenListStorageVirtualDriveExtensionRelationship(p, d) @@ -7463,7 +7463,7 @@ func TestFlattenListStorageVirtualDriveExtensionRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListStorageVirtualDriveExtensionRelationship(p, d) - expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} + expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -7472,7 +7472,7 @@ func TestFlattenListStorageVirtualDriveExtensionRelationship(t *testing.T) { func TestFlattenListSyslogLocalClientBase(t *testing.T) { p := []models.SyslogLocalClientBase{} var d = &schema.ResourceData{} - c := `{"ObjectType":"syslog.LocalClientBase","ClassId":"syslog.LocalClientBase","MinSeverity":"MinSeverity %d"}` + c := `{"MinSeverity":"MinSeverity %d","ObjectType":"syslog.LocalClientBase","ClassId":"syslog.LocalClientBase"}` //test when the response is empty ffOpEmpty := flattenListSyslogLocalClientBase(p, d) @@ -7487,7 +7487,7 @@ func TestFlattenListSyslogLocalClientBase(t *testing.T) { p = append(p, x) } ffOp := flattenListSyslogLocalClientBase(p, d) - expectedOp := []map[string]interface{}{{"object_type": "syslog.LocalClientBase", "class_id": "syslog.LocalClientBase", "min_severity": "MinSeverity 1"}, {"object_type": "syslog.LocalClientBase", "class_id": "syslog.LocalClientBase", "min_severity": "MinSeverity 2"}} + expectedOp := []map[string]interface{}{{"min_severity": "MinSeverity 1", "object_type": "syslog.LocalClientBase", "class_id": "syslog.LocalClientBase"}, {"min_severity": "MinSeverity 2", "object_type": "syslog.LocalClientBase", "class_id": "syslog.LocalClientBase"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -7496,7 +7496,7 @@ func TestFlattenListSyslogLocalClientBase(t *testing.T) { func TestFlattenListSyslogRemoteClientBase(t *testing.T) { p := []models.SyslogRemoteClientBase{} var d = &schema.ResourceData{} - c := `{"Port":32,"Protocol":"Protocol %d","Enabled":true,"ObjectType":"syslog.RemoteClientBase","ClassId":"syslog.RemoteClientBase","Hostname":"Hostname %d","MinSeverity":"MinSeverity %d"}` + c := `{"Enabled":true,"ObjectType":"syslog.RemoteClientBase","ClassId":"syslog.RemoteClientBase","Hostname":"Hostname %d","MinSeverity":"MinSeverity %d","Port":32,"Protocol":"Protocol %d"}` //test when the response is empty ffOpEmpty := flattenListSyslogRemoteClientBase(p, d) @@ -7511,7 +7511,7 @@ func TestFlattenListSyslogRemoteClientBase(t *testing.T) { p = append(p, x) } ffOp := flattenListSyslogRemoteClientBase(p, d) - expectedOp := []map[string]interface{}{{"port": 32, "protocol": "Protocol 1", "enabled": true, "object_type": "syslog.RemoteClientBase", "class_id": "syslog.RemoteClientBase", "hostname": "Hostname 1", "min_severity": "MinSeverity 1"}, {"port": 32, "protocol": "Protocol 2", "enabled": true, "object_type": "syslog.RemoteClientBase", "class_id": "syslog.RemoteClientBase", "hostname": "Hostname 2", "min_severity": "MinSeverity 2"}} + expectedOp := []map[string]interface{}{{"enabled": true, "object_type": "syslog.RemoteClientBase", "class_id": "syslog.RemoteClientBase", "hostname": "Hostname 1", "min_severity": "MinSeverity 1", "port": 32, "protocol": "Protocol 1"}, {"enabled": true, "object_type": "syslog.RemoteClientBase", "class_id": "syslog.RemoteClientBase", "hostname": "Hostname 2", "min_severity": "MinSeverity 2", "port": 32, "protocol": "Protocol 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -7520,7 +7520,7 @@ func TestFlattenListSyslogRemoteClientBase(t *testing.T) { func TestFlattenListTamAction(t *testing.T) { p := []models.TamAction{} var d = &schema.ResourceData{} - c := `{"ClassId":"tam.Action","AffectedObjectType":"AffectedObjectType %d","OperationType":"OperationType %d","Type":"Type %d","ObjectType":"tam.Action","AlertType":"AlertType %d","Name":"Name %d"}` + c := `{"AlertType":"AlertType %d","AffectedObjectType":"AffectedObjectType %d","Name":"Name %d","OperationType":"OperationType %d","ObjectType":"tam.Action","ClassId":"tam.Action","Type":"Type %d"}` //test when the response is empty ffOpEmpty := flattenListTamAction(p, d) @@ -7535,7 +7535,7 @@ func TestFlattenListTamAction(t *testing.T) { p = append(p, x) } ffOp := flattenListTamAction(p, d) - expectedOp := []map[string]interface{}{{"class_id": "tam.Action", "affected_object_type": "AffectedObjectType 1", "operation_type": "OperationType 1", "type": "Type 1", "object_type": "tam.Action", "alert_type": "AlertType 1", "name": "Name 1"}, {"class_id": "tam.Action", "affected_object_type": "AffectedObjectType 2", "operation_type": "OperationType 2", "type": "Type 2", "object_type": "tam.Action", "alert_type": "AlertType 2", "name": "Name 2"}} + expectedOp := []map[string]interface{}{{"alert_type": "AlertType 1", "affected_object_type": "AffectedObjectType 1", "name": "Name 1", "operation_type": "OperationType 1", "object_type": "tam.Action", "class_id": "tam.Action", "type": "Type 1"}, {"alert_type": "AlertType 2", "affected_object_type": "AffectedObjectType 2", "name": "Name 2", "operation_type": "OperationType 2", "object_type": "tam.Action", "class_id": "tam.Action", "type": "Type 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -7544,7 +7544,7 @@ func TestFlattenListTamAction(t *testing.T) { func TestFlattenListTamApiDataSource(t *testing.T) { p := []models.TamApiDataSource{} var d = &schema.ResourceData{} - c := `{"MoType":"MoType %d","ObjectType":"tam.ApiDataSource","ClassId":"tam.ApiDataSource","Name":"Name %d","Type":"Type %d"}` + c := `{"ObjectType":"tam.ApiDataSource","ClassId":"tam.ApiDataSource","MoType":"MoType %d","Name":"Name %d","Type":"Type %d"}` //test when the response is empty ffOpEmpty := flattenListTamApiDataSource(p, d) @@ -7559,7 +7559,7 @@ func TestFlattenListTamApiDataSource(t *testing.T) { p = append(p, x) } ffOp := flattenListTamApiDataSource(p, d) - expectedOp := []map[string]interface{}{{"mo_type": "MoType 1", "object_type": "tam.ApiDataSource", "class_id": "tam.ApiDataSource", "name": "Name 1", "type": "Type 1"}, {"mo_type": "MoType 2", "object_type": "tam.ApiDataSource", "class_id": "tam.ApiDataSource", "name": "Name 2", "type": "Type 2"}} + expectedOp := []map[string]interface{}{{"object_type": "tam.ApiDataSource", "class_id": "tam.ApiDataSource", "mo_type": "MoType 1", "name": "Name 1", "type": "Type 1"}, {"object_type": "tam.ApiDataSource", "class_id": "tam.ApiDataSource", "mo_type": "MoType 2", "name": "Name 2", "type": "Type 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -7568,7 +7568,7 @@ func TestFlattenListTamApiDataSource(t *testing.T) { func TestFlattenListTamS3DataSource(t *testing.T) { p := []models.TamS3DataSource{} var d = &schema.ResourceData{} - c := `{"Name":"Name %d","Type":"Type %d","ObjectType":"tam.S3DataSource","ClassId":"tam.S3DataSource","S3Path":"S3Path %d"}` + c := `{"S3Path":"S3Path %d","Name":"Name %d","Type":"Type %d","ObjectType":"tam.S3DataSource","ClassId":"tam.S3DataSource"}` //test when the response is empty ffOpEmpty := flattenListTamS3DataSource(p, d) @@ -7583,7 +7583,7 @@ func TestFlattenListTamS3DataSource(t *testing.T) { p = append(p, x) } ffOp := flattenListTamS3DataSource(p, d) - expectedOp := []map[string]interface{}{{"name": "Name 1", "type": "Type 1", "object_type": "tam.S3DataSource", "class_id": "tam.S3DataSource", "s3_path": "S3Path 1"}, {"name": "Name 2", "type": "Type 2", "object_type": "tam.S3DataSource", "class_id": "tam.S3DataSource", "s3_path": "S3Path 2"}} + expectedOp := []map[string]interface{}{{"s3_path": "S3Path 1", "name": "Name 1", "type": "Type 1", "object_type": "tam.S3DataSource", "class_id": "tam.S3DataSource"}, {"s3_path": "S3Path 2", "name": "Name 2", "type": "Type 2", "object_type": "tam.S3DataSource", "class_id": "tam.S3DataSource"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -7592,7 +7592,7 @@ func TestFlattenListTamS3DataSource(t *testing.T) { func TestFlattenListTerraformCloudResource(t *testing.T) { p := []models.TerraformCloudResource{} var d = &schema.ResourceData{} - c := `{"ObjectType":"terraform.CloudResource","ClassId":"terraform.CloudResource","CurrentStatus":"CurrentStatus %d","DesiredStatus":"DesiredStatus %d","ResourceId":"ResourceId %d"}` + c := `{"ClassId":"terraform.CloudResource","ObjectType":"terraform.CloudResource","CurrentStatus":"CurrentStatus %d","DesiredStatus":"DesiredStatus %d","ResourceId":"ResourceId %d"}` //test when the response is empty ffOpEmpty := flattenListTerraformCloudResource(p, d) @@ -7607,7 +7607,7 @@ func TestFlattenListTerraformCloudResource(t *testing.T) { p = append(p, x) } ffOp := flattenListTerraformCloudResource(p, d) - expectedOp := []map[string]interface{}{{"object_type": "terraform.CloudResource", "class_id": "terraform.CloudResource", "current_status": "CurrentStatus 1", "desired_status": "DesiredStatus 1", "resource_id": "ResourceId 1"}, {"object_type": "terraform.CloudResource", "class_id": "terraform.CloudResource", "current_status": "CurrentStatus 2", "desired_status": "DesiredStatus 2", "resource_id": "ResourceId 2"}} + expectedOp := []map[string]interface{}{{"class_id": "terraform.CloudResource", "object_type": "terraform.CloudResource", "current_status": "CurrentStatus 1", "desired_status": "DesiredStatus 1", "resource_id": "ResourceId 1"}, {"class_id": "terraform.CloudResource", "object_type": "terraform.CloudResource", "current_status": "CurrentStatus 2", "desired_status": "DesiredStatus 2", "resource_id": "ResourceId 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -7616,7 +7616,7 @@ func TestFlattenListTerraformCloudResource(t *testing.T) { func TestFlattenListTerraformRunstate(t *testing.T) { p := []models.TerraformRunstate{} var d = &schema.ResourceData{} - c := `{"StateFile":"StateFile %d","ObjectType":"terraform.Runstate","ClassId":"terraform.Runstate","RunId":"RunId %d"}` + c := `{"RunId":"RunId %d","StateFile":"StateFile %d","ObjectType":"terraform.Runstate","ClassId":"terraform.Runstate"}` //test when the response is empty ffOpEmpty := flattenListTerraformRunstate(p, d) @@ -7631,7 +7631,7 @@ func TestFlattenListTerraformRunstate(t *testing.T) { p = append(p, x) } ffOp := flattenListTerraformRunstate(p, d) - expectedOp := []map[string]interface{}{{"state_file": "StateFile 1", "object_type": "terraform.Runstate", "class_id": "terraform.Runstate", "run_id": "RunId 1"}, {"state_file": "StateFile 2", "object_type": "terraform.Runstate", "class_id": "terraform.Runstate", "run_id": "RunId 2"}} + expectedOp := []map[string]interface{}{{"run_id": "RunId 1", "state_file": "StateFile 1", "object_type": "terraform.Runstate", "class_id": "terraform.Runstate"}, {"run_id": "RunId 2", "state_file": "StateFile 2", "object_type": "terraform.Runstate", "class_id": "terraform.Runstate"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -7640,7 +7640,7 @@ func TestFlattenListTerraformRunstate(t *testing.T) { func TestFlattenListUcsdConnectorPack(t *testing.T) { p := []models.UcsdConnectorPack{} var d = &schema.ResourceData{} - c := `{"ObjectType":"ucsd.ConnectorPack","DownloadedVersion":"DownloadedVersion %d","State":"State %d","ConnectorFeature":"ConnectorFeature %d","Version":"Version %d","ClassId":"ucsd.ConnectorPack","Name":"Name %d"}` + c := `{"ObjectType":"ucsd.ConnectorPack","ClassId":"ucsd.ConnectorPack","Name":"Name %d","Version":"Version %d","DownloadedVersion":"DownloadedVersion %d","ConnectorFeature":"ConnectorFeature %d","State":"State %d"}` //test when the response is empty ffOpEmpty := flattenListUcsdConnectorPack(p, d) @@ -7655,7 +7655,7 @@ func TestFlattenListUcsdConnectorPack(t *testing.T) { p = append(p, x) } ffOp := flattenListUcsdConnectorPack(p, d) - expectedOp := []map[string]interface{}{{"object_type": "ucsd.ConnectorPack", "downloaded_version": "DownloadedVersion 1", "state": "State 1", "connector_feature": "ConnectorFeature 1", "nr_version": "Version 1", "class_id": "ucsd.ConnectorPack", "name": "Name 1"}, {"object_type": "ucsd.ConnectorPack", "downloaded_version": "DownloadedVersion 2", "state": "State 2", "connector_feature": "ConnectorFeature 2", "nr_version": "Version 2", "class_id": "ucsd.ConnectorPack", "name": "Name 2"}} + expectedOp := []map[string]interface{}{{"object_type": "ucsd.ConnectorPack", "class_id": "ucsd.ConnectorPack", "name": "Name 1", "nr_version": "Version 1", "downloaded_version": "DownloadedVersion 1", "connector_feature": "ConnectorFeature 1", "state": "State 1"}, {"object_type": "ucsd.ConnectorPack", "class_id": "ucsd.ConnectorPack", "name": "Name 2", "nr_version": "Version 2", "downloaded_version": "DownloadedVersion 2", "connector_feature": "ConnectorFeature 2", "state": "State 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -7664,7 +7664,7 @@ func TestFlattenListUcsdConnectorPack(t *testing.T) { func TestFlattenListUuidpoolBlockRelationship(t *testing.T) { p := []models.UuidpoolBlockRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenListUuidpoolBlockRelationship(p, d) @@ -7679,7 +7679,7 @@ func TestFlattenListUuidpoolBlockRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListUuidpoolBlockRelationship(p, d) - expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -7688,7 +7688,7 @@ func TestFlattenListUuidpoolBlockRelationship(t *testing.T) { func TestFlattenListUuidpoolUuidBlock(t *testing.T) { p := []models.UuidpoolUuidBlock{} var d = &schema.ResourceData{} - c := `{"To":"To %d","ObjectType":"uuidpool.UuidBlock","ClassId":"uuidpool.UuidBlock","Size":32,"From":"From %d"}` + c := `{"Size":32,"ObjectType":"uuidpool.UuidBlock","ClassId":"uuidpool.UuidBlock","From":"From %d","To":"To %d"}` //test when the response is empty ffOpEmpty := flattenListUuidpoolUuidBlock(p, d) @@ -7703,7 +7703,7 @@ func TestFlattenListUuidpoolUuidBlock(t *testing.T) { p = append(p, x) } ffOp := flattenListUuidpoolUuidBlock(p, d) - expectedOp := []map[string]interface{}{{"to": "To 1", "object_type": "uuidpool.UuidBlock", "class_id": "uuidpool.UuidBlock", "size": 32, "from": "From 1"}, {"to": "To 2", "object_type": "uuidpool.UuidBlock", "class_id": "uuidpool.UuidBlock", "size": 32, "from": "From 2"}} + expectedOp := []map[string]interface{}{{"size": 32, "object_type": "uuidpool.UuidBlock", "class_id": "uuidpool.UuidBlock", "from": "From 1", "to": "To 1"}, {"size": 32, "object_type": "uuidpool.UuidBlock", "class_id": "uuidpool.UuidBlock", "from": "From 2", "to": "To 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -7712,7 +7712,7 @@ func TestFlattenListUuidpoolUuidBlock(t *testing.T) { func TestFlattenListVirtualizationBaseNetworkRelationship(t *testing.T) { p := []models.VirtualizationBaseNetworkRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListVirtualizationBaseNetworkRelationship(p, d) @@ -7727,7 +7727,7 @@ func TestFlattenListVirtualizationBaseNetworkRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListVirtualizationBaseNetworkRelationship(p, d) - expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} + expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -7760,7 +7760,7 @@ func TestFlattenListVirtualizationIweHostRelationship(t *testing.T) { func TestFlattenListVirtualizationIweHostInterfaceRelationship(t *testing.T) { p := []models.VirtualizationIweHostInterfaceRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListVirtualizationIweHostInterfaceRelationship(p, d) @@ -7775,7 +7775,7 @@ func TestFlattenListVirtualizationIweHostInterfaceRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListVirtualizationIweHostInterfaceRelationship(p, d) - expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} + expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -7784,7 +7784,7 @@ func TestFlattenListVirtualizationIweHostInterfaceRelationship(t *testing.T) { func TestFlattenListVirtualizationIweHostVswitchRelationship(t *testing.T) { p := []models.VirtualizationIweHostVswitchRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListVirtualizationIweHostVswitchRelationship(p, d) @@ -7799,7 +7799,7 @@ func TestFlattenListVirtualizationIweHostVswitchRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListVirtualizationIweHostVswitchRelationship(p, d) - expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} + expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -7808,7 +7808,7 @@ func TestFlattenListVirtualizationIweHostVswitchRelationship(t *testing.T) { func TestFlattenListVirtualizationNetworkInterface(t *testing.T) { p := []models.VirtualizationNetworkInterface{} var d = &schema.ResourceData{} - c := `{"PrivateIpAllocationMode":"PrivateIpAllocationMode %d","Name":"Name %d","DirectPathIo":true,"Order":32,"Bridge":"Bridge %d","ClassId":"virtualization.NetworkInterface","NetworkId":"NetworkId %d","PublicIpAllocate":true,"AdaptorType":"AdaptorType %d","IpForwardingEnabled":true,"SubnetId":"SubnetId %d","ConnectAtPowerOn":true,"MacAddress":"MacAddress %d","NicId":"NicId %d","ObjectType":"virtualization.NetworkInterface","Ipv6Address":true}` + c := `{"Bridge":"Bridge %d","IpForwardingEnabled":true,"NetworkId":"NetworkId %d","SubnetId":"SubnetId %d","PrivateIpAllocationMode":"PrivateIpAllocationMode %d","MacAddress":"MacAddress %d","ObjectType":"virtualization.NetworkInterface","Ipv6Address":true,"AdaptorType":"AdaptorType %d","PublicIpAllocate":true,"Order":32,"ClassId":"virtualization.NetworkInterface","ConnectAtPowerOn":true,"DirectPathIo":true,"NicId":"NicId %d","Name":"Name %d"}` //test when the response is empty ffOpEmpty := flattenListVirtualizationNetworkInterface(p, d) @@ -7823,7 +7823,7 @@ func TestFlattenListVirtualizationNetworkInterface(t *testing.T) { p = append(p, x) } ffOp := flattenListVirtualizationNetworkInterface(p, d) - expectedOp := []map[string]interface{}{{"private_ip_allocation_mode": "PrivateIpAllocationMode 1", "name": "Name 1", "direct_path_io": true, "order": 32, "bridge": "Bridge 1", "class_id": "virtualization.NetworkInterface", "network_id": "NetworkId 1", "public_ip_allocate": true, "adaptor_type": "AdaptorType 1", "ip_forwarding_enabled": true, "subnet_id": "SubnetId 1", "connect_at_power_on": true, "mac_address": "MacAddress 1", "nic_id": "NicId 1", "object_type": "virtualization.NetworkInterface", "ipv6_address": true}, {"private_ip_allocation_mode": "PrivateIpAllocationMode 2", "name": "Name 2", "direct_path_io": true, "order": 32, "bridge": "Bridge 2", "class_id": "virtualization.NetworkInterface", "network_id": "NetworkId 2", "public_ip_allocate": true, "adaptor_type": "AdaptorType 2", "ip_forwarding_enabled": true, "subnet_id": "SubnetId 2", "connect_at_power_on": true, "mac_address": "MacAddress 2", "nic_id": "NicId 2", "object_type": "virtualization.NetworkInterface", "ipv6_address": true}} + expectedOp := []map[string]interface{}{{"bridge": "Bridge 1", "ip_forwarding_enabled": true, "network_id": "NetworkId 1", "subnet_id": "SubnetId 1", "private_ip_allocation_mode": "PrivateIpAllocationMode 1", "mac_address": "MacAddress 1", "object_type": "virtualization.NetworkInterface", "ipv6_address": true, "adaptor_type": "AdaptorType 1", "public_ip_allocate": true, "order": 32, "class_id": "virtualization.NetworkInterface", "connect_at_power_on": true, "direct_path_io": true, "nic_id": "NicId 1", "name": "Name 1"}, {"bridge": "Bridge 2", "ip_forwarding_enabled": true, "network_id": "NetworkId 2", "subnet_id": "SubnetId 2", "private_ip_allocation_mode": "PrivateIpAllocationMode 2", "mac_address": "MacAddress 2", "object_type": "virtualization.NetworkInterface", "ipv6_address": true, "adaptor_type": "AdaptorType 2", "public_ip_allocate": true, "order": 32, "class_id": "virtualization.NetworkInterface", "connect_at_power_on": true, "direct_path_io": true, "nic_id": "NicId 2", "name": "Name 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -7856,7 +7856,7 @@ func TestFlattenListVirtualizationNetworkPort(t *testing.T) { func TestFlattenListVirtualizationVirtualMachineDisk(t *testing.T) { p := []models.VirtualizationVirtualMachineDisk{} var d = &schema.ResourceData{} - c := `{"ObjectType":"virtualization.VirtualMachineDisk","ClassId":"virtualization.VirtualMachineDisk","VirtualDiskReference":"VirtualDiskReference %d","Bus":"Bus %d","Name":"Name %d","Order":32,"Type":"Type %d"}` + c := `{"VirtualDiskReference":"VirtualDiskReference %d","ClassId":"virtualization.VirtualMachineDisk","Order":32,"Type":"Type %d","Name":"Name %d","ObjectType":"virtualization.VirtualMachineDisk","Bus":"Bus %d"}` //test when the response is empty ffOpEmpty := flattenListVirtualizationVirtualMachineDisk(p, d) @@ -7871,7 +7871,7 @@ func TestFlattenListVirtualizationVirtualMachineDisk(t *testing.T) { p = append(p, x) } ffOp := flattenListVirtualizationVirtualMachineDisk(p, d) - expectedOp := []map[string]interface{}{{"object_type": "virtualization.VirtualMachineDisk", "class_id": "virtualization.VirtualMachineDisk", "virtual_disk_reference": "VirtualDiskReference 1", "bus": "Bus 1", "name": "Name 1", "order": 32, "type": "Type 1"}, {"object_type": "virtualization.VirtualMachineDisk", "class_id": "virtualization.VirtualMachineDisk", "virtual_disk_reference": "VirtualDiskReference 2", "bus": "Bus 2", "name": "Name 2", "order": 32, "type": "Type 2"}} + expectedOp := []map[string]interface{}{{"virtual_disk_reference": "VirtualDiskReference 1", "class_id": "virtualization.VirtualMachineDisk", "order": 32, "type": "Type 1", "name": "Name 1", "object_type": "virtualization.VirtualMachineDisk", "bus": "Bus 1"}, {"virtual_disk_reference": "VirtualDiskReference 2", "class_id": "virtualization.VirtualMachineDisk", "order": 32, "type": "Type 2", "name": "Name 2", "object_type": "virtualization.VirtualMachineDisk", "bus": "Bus 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -7880,7 +7880,7 @@ func TestFlattenListVirtualizationVirtualMachineDisk(t *testing.T) { func TestFlattenListVirtualizationVmDisk(t *testing.T) { p := []models.VirtualizationVmDisk{} var d = &schema.ResourceData{} - c := `{"ObjectType":"virtualization.VmDisk","ClassId":"virtualization.VmDisk","VirtualDiskReference":"VirtualDiskReference %d","BootOrder":32,"Bus":"Bus %d","Name":"Name %d","Type":"Type %d"}` + c := `{"Type":"Type %d","BootOrder":32,"Name":"Name %d","Bus":"Bus %d","VirtualDiskReference":"VirtualDiskReference %d","ClassId":"virtualization.VmDisk","ObjectType":"virtualization.VmDisk"}` //test when the response is empty ffOpEmpty := flattenListVirtualizationVmDisk(p, d) @@ -7895,7 +7895,7 @@ func TestFlattenListVirtualizationVmDisk(t *testing.T) { p = append(p, x) } ffOp := flattenListVirtualizationVmDisk(p, d) - expectedOp := []map[string]interface{}{{"object_type": "virtualization.VmDisk", "class_id": "virtualization.VmDisk", "virtual_disk_reference": "VirtualDiskReference 1", "boot_order": 32, "bus": "Bus 1", "name": "Name 1", "type": "Type 1"}, {"object_type": "virtualization.VmDisk", "class_id": "virtualization.VmDisk", "virtual_disk_reference": "VirtualDiskReference 2", "boot_order": 32, "bus": "Bus 2", "name": "Name 2", "type": "Type 2"}} + expectedOp := []map[string]interface{}{{"type": "Type 1", "boot_order": 32, "name": "Name 1", "bus": "Bus 1", "virtual_disk_reference": "VirtualDiskReference 1", "class_id": "virtualization.VmDisk", "object_type": "virtualization.VmDisk"}, {"type": "Type 2", "boot_order": 32, "name": "Name 2", "bus": "Bus 2", "virtual_disk_reference": "VirtualDiskReference 2", "class_id": "virtualization.VmDisk", "object_type": "virtualization.VmDisk"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -7904,7 +7904,7 @@ func TestFlattenListVirtualizationVmDisk(t *testing.T) { func TestFlattenListVirtualizationVmInterface(t *testing.T) { p := []models.VirtualizationVmInterface{} var d = &schema.ResourceData{} - c := `{"ClassId":"virtualization.VmInterface","Model":"Model %d","Name":"Name %d","Bridge":"Bridge %d","MacAddress":"MacAddress %d","ObjectType":"virtualization.VmInterface"}` + c := `{"ClassId":"virtualization.VmInterface","Name":"Name %d","Bridge":"Bridge %d","MacAddress":"MacAddress %d","Model":"Model %d","ObjectType":"virtualization.VmInterface"}` //test when the response is empty ffOpEmpty := flattenListVirtualizationVmInterface(p, d) @@ -7919,7 +7919,7 @@ func TestFlattenListVirtualizationVmInterface(t *testing.T) { p = append(p, x) } ffOp := flattenListVirtualizationVmInterface(p, d) - expectedOp := []map[string]interface{}{{"class_id": "virtualization.VmInterface", "model": "Model 1", "name": "Name 1", "bridge": "Bridge 1", "mac_address": "MacAddress 1", "object_type": "virtualization.VmInterface"}, {"class_id": "virtualization.VmInterface", "model": "Model 2", "name": "Name 2", "bridge": "Bridge 2", "mac_address": "MacAddress 2", "object_type": "virtualization.VmInterface"}} + expectedOp := []map[string]interface{}{{"class_id": "virtualization.VmInterface", "name": "Name 1", "bridge": "Bridge 1", "mac_address": "MacAddress 1", "model": "Model 1", "object_type": "virtualization.VmInterface"}, {"class_id": "virtualization.VmInterface", "name": "Name 2", "bridge": "Bridge 2", "mac_address": "MacAddress 2", "model": "Model 2", "object_type": "virtualization.VmInterface"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -7928,7 +7928,7 @@ func TestFlattenListVirtualizationVmInterface(t *testing.T) { func TestFlattenListVirtualizationVmwareDatastoreRelationship(t *testing.T) { p := []models.VirtualizationVmwareDatastoreRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListVirtualizationVmwareDatastoreRelationship(p, d) @@ -7943,7 +7943,7 @@ func TestFlattenListVirtualizationVmwareDatastoreRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListVirtualizationVmwareDatastoreRelationship(p, d) - expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} + expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -7952,7 +7952,7 @@ func TestFlattenListVirtualizationVmwareDatastoreRelationship(t *testing.T) { func TestFlattenListVirtualizationVmwareDistributedNetworkRelationship(t *testing.T) { p := []models.VirtualizationVmwareDistributedNetworkRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenListVirtualizationVmwareDistributedNetworkRelationship(p, d) @@ -7967,7 +7967,7 @@ func TestFlattenListVirtualizationVmwareDistributedNetworkRelationship(t *testin p = append(p, x) } ffOp := flattenListVirtualizationVmwareDistributedNetworkRelationship(p, d) - expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -7976,7 +7976,7 @@ func TestFlattenListVirtualizationVmwareDistributedNetworkRelationship(t *testin func TestFlattenListVirtualizationVmwareDistributedSwitchRelationship(t *testing.T) { p := []models.VirtualizationVmwareDistributedSwitchRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenListVirtualizationVmwareDistributedSwitchRelationship(p, d) @@ -7991,7 +7991,7 @@ func TestFlattenListVirtualizationVmwareDistributedSwitchRelationship(t *testing p = append(p, x) } ffOp := flattenListVirtualizationVmwareDistributedSwitchRelationship(p, d) - expectedOp := []map[string]interface{}{{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"}, {"object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -8000,7 +8000,7 @@ func TestFlattenListVirtualizationVmwareDistributedSwitchRelationship(t *testing func TestFlattenListVirtualizationVmwareHostRelationship(t *testing.T) { p := []models.VirtualizationVmwareHostRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListVirtualizationVmwareHostRelationship(p, d) @@ -8015,7 +8015,7 @@ func TestFlattenListVirtualizationVmwareHostRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListVirtualizationVmwareHostRelationship(p, d) - expectedOp := []map[string]interface{}{{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"}, {"object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -8024,7 +8024,7 @@ func TestFlattenListVirtualizationVmwareHostRelationship(t *testing.T) { func TestFlattenListVirtualizationVmwareResourceAllocationSystemTrafficTypes(t *testing.T) { p := []models.VirtualizationVmwareResourceAllocationSystemTrafficTypes{} var d = &schema.ResourceData{} - c := `{"SharesValue":32,"TrafficType":"TrafficType %d","Limit":32,"Reservation":32,"Shares":"Shares %d","ObjectType":"virtualization.VmwareResourceAllocationSystemTrafficTypes","ClassId":"virtualization.VmwareResourceAllocationSystemTrafficTypes"}` + c := `{"ObjectType":"virtualization.VmwareResourceAllocationSystemTrafficTypes","ClassId":"virtualization.VmwareResourceAllocationSystemTrafficTypes","Limit":32,"Reservation":32,"Shares":"Shares %d","SharesValue":32,"TrafficType":"TrafficType %d"}` //test when the response is empty ffOpEmpty := flattenListVirtualizationVmwareResourceAllocationSystemTrafficTypes(p, d) @@ -8039,7 +8039,7 @@ func TestFlattenListVirtualizationVmwareResourceAllocationSystemTrafficTypes(t * p = append(p, x) } ffOp := flattenListVirtualizationVmwareResourceAllocationSystemTrafficTypes(p, d) - expectedOp := []map[string]interface{}{{"shares_value": 32, "traffic_type": "TrafficType 1", "limit": 32, "reservation": 32, "shares": "Shares 1", "object_type": "virtualization.VmwareResourceAllocationSystemTrafficTypes", "class_id": "virtualization.VmwareResourceAllocationSystemTrafficTypes"}, {"shares_value": 32, "traffic_type": "TrafficType 2", "limit": 32, "reservation": 32, "shares": "Shares 2", "object_type": "virtualization.VmwareResourceAllocationSystemTrafficTypes", "class_id": "virtualization.VmwareResourceAllocationSystemTrafficTypes"}} + expectedOp := []map[string]interface{}{{"object_type": "virtualization.VmwareResourceAllocationSystemTrafficTypes", "class_id": "virtualization.VmwareResourceAllocationSystemTrafficTypes", "limit": 32, "reservation": 32, "shares": "Shares 1", "shares_value": 32, "traffic_type": "TrafficType 1"}, {"object_type": "virtualization.VmwareResourceAllocationSystemTrafficTypes", "class_id": "virtualization.VmwareResourceAllocationSystemTrafficTypes", "limit": 32, "reservation": 32, "shares": "Shares 2", "shares_value": 32, "traffic_type": "TrafficType 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -8048,7 +8048,7 @@ func TestFlattenListVirtualizationVmwareResourceAllocationSystemTrafficTypes(t * func TestFlattenListVirtualizationVmwareVlanRange(t *testing.T) { p := []models.VirtualizationVmwareVlanRange{} var d = &schema.ResourceData{} - c := `{"ObjectType":"virtualization.VmwareVlanRange","VlanRangeStart":32,"VlanRangeEnd":32,"ClassId":"virtualization.VmwareVlanRange"}` + c := `{"VlanRangeEnd":32,"VlanRangeStart":32,"ObjectType":"virtualization.VmwareVlanRange","ClassId":"virtualization.VmwareVlanRange"}` //test when the response is empty ffOpEmpty := flattenListVirtualizationVmwareVlanRange(p, d) @@ -8063,7 +8063,7 @@ func TestFlattenListVirtualizationVmwareVlanRange(t *testing.T) { p = append(p, x) } ffOp := flattenListVirtualizationVmwareVlanRange(p, d) - expectedOp := []map[string]interface{}{{"object_type": "virtualization.VmwareVlanRange", "vlan_range_start": 32, "vlan_range_end": 32, "class_id": "virtualization.VmwareVlanRange"}, {"object_type": "virtualization.VmwareVlanRange", "vlan_range_start": 32, "vlan_range_end": 32, "class_id": "virtualization.VmwareVlanRange"}} + expectedOp := []map[string]interface{}{{"vlan_range_end": 32, "vlan_range_start": 32, "object_type": "virtualization.VmwareVlanRange", "class_id": "virtualization.VmwareVlanRange"}, {"vlan_range_end": 32, "vlan_range_start": 32, "object_type": "virtualization.VmwareVlanRange", "class_id": "virtualization.VmwareVlanRange"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -8072,7 +8072,7 @@ func TestFlattenListVirtualizationVmwareVlanRange(t *testing.T) { func TestFlattenListVmediaMapping(t *testing.T) { p := []models.VmediaMapping{} var d = &schema.ResourceData{} - c := `{"IsPasswordSet":true,"VolumeName":"VolumeName %d","AuthenticationProtocol":"AuthenticationProtocol %d","ClassId":"vmedia.Mapping","DeviceType":"DeviceType %d","HostName":"HostName %d","FileLocation":"FileLocation %d","RemoteFile":"RemoteFile %d","MountOptions":"MountOptions %d","SanitizedFileLocation":"SanitizedFileLocation %d","ObjectType":"vmedia.Mapping","Username":"Username %d","MountProtocol":"MountProtocol %d","RemotePath":"RemotePath %d"}` + c := `{"IsPasswordSet":true,"AuthenticationProtocol":"AuthenticationProtocol %d","MountOptions":"MountOptions %d","VolumeName":"VolumeName %d","ClassId":"vmedia.Mapping","DeviceType":"DeviceType %d","RemotePath":"RemotePath %d","Username":"Username %d","SanitizedFileLocation":"SanitizedFileLocation %d","ObjectType":"vmedia.Mapping","HostName":"HostName %d","MountProtocol":"MountProtocol %d","RemoteFile":"RemoteFile %d","FileLocation":"FileLocation %d"}` //test when the response is empty ffOpEmpty := flattenListVmediaMapping(p, d) @@ -8087,7 +8087,7 @@ func TestFlattenListVmediaMapping(t *testing.T) { p = append(p, x) } ffOp := flattenListVmediaMapping(p, d) - expectedOp := []map[string]interface{}{{"is_password_set": true, "volume_name": "VolumeName 1", "authentication_protocol": "AuthenticationProtocol 1", "class_id": "vmedia.Mapping", "device_type": "DeviceType 1", "host_name": "HostName 1", "file_location": "FileLocation 1", "remote_file": "RemoteFile 1", "mount_options": "MountOptions 1", "sanitized_file_location": "SanitizedFileLocation 1", "object_type": "vmedia.Mapping", "username": "Username 1", "mount_protocol": "MountProtocol 1", "remote_path": "RemotePath 1"}, {"is_password_set": true, "volume_name": "VolumeName 2", "authentication_protocol": "AuthenticationProtocol 2", "class_id": "vmedia.Mapping", "device_type": "DeviceType 2", "host_name": "HostName 2", "file_location": "FileLocation 2", "remote_file": "RemoteFile 2", "mount_options": "MountOptions 2", "sanitized_file_location": "SanitizedFileLocation 2", "object_type": "vmedia.Mapping", "username": "Username 2", "mount_protocol": "MountProtocol 2", "remote_path": "RemotePath 2"}} + expectedOp := []map[string]interface{}{{"is_password_set": true, "authentication_protocol": "AuthenticationProtocol 1", "mount_options": "MountOptions 1", "volume_name": "VolumeName 1", "class_id": "vmedia.Mapping", "device_type": "DeviceType 1", "remote_path": "RemotePath 1", "username": "Username 1", "sanitized_file_location": "SanitizedFileLocation 1", "object_type": "vmedia.Mapping", "host_name": "HostName 1", "mount_protocol": "MountProtocol 1", "remote_file": "RemoteFile 1", "file_location": "FileLocation 1"}, {"is_password_set": true, "authentication_protocol": "AuthenticationProtocol 2", "mount_options": "MountOptions 2", "volume_name": "VolumeName 2", "class_id": "vmedia.Mapping", "device_type": "DeviceType 2", "remote_path": "RemotePath 2", "username": "Username 2", "sanitized_file_location": "SanitizedFileLocation 2", "object_type": "vmedia.Mapping", "host_name": "HostName 2", "mount_protocol": "MountProtocol 2", "remote_file": "RemoteFile 2", "file_location": "FileLocation 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -8144,7 +8144,7 @@ func TestFlattenListVnicEthNetworkPolicyRelationship(t *testing.T) { func TestFlattenListVnicFcIfRelationship(t *testing.T) { p := []models.VnicFcIfRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListVnicFcIfRelationship(p, d) @@ -8159,7 +8159,7 @@ func TestFlattenListVnicFcIfRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListVnicFcIfRelationship(p, d) - expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} + expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -8168,7 +8168,7 @@ func TestFlattenListVnicFcIfRelationship(t *testing.T) { func TestFlattenListVnicVifStatus(t *testing.T) { p := []models.VnicVifStatus{} var d = &schema.ResourceData{} - c := `{"Name":"Name %d","Reason":"Reason %d","Status":"Status %d","ObjectType":"vnic.VifStatus","ClassId":"vnic.VifStatus"}` + c := `{"Reason":"Reason %d","Status":"Status %d","ObjectType":"vnic.VifStatus","ClassId":"vnic.VifStatus","Name":"Name %d"}` //test when the response is empty ffOpEmpty := flattenListVnicVifStatus(p, d) @@ -8183,7 +8183,7 @@ func TestFlattenListVnicVifStatus(t *testing.T) { p = append(p, x) } ffOp := flattenListVnicVifStatus(p, d) - expectedOp := []map[string]interface{}{{"name": "Name 1", "reason": "Reason 1", "status": "Status 1", "object_type": "vnic.VifStatus", "class_id": "vnic.VifStatus"}, {"name": "Name 2", "reason": "Reason 2", "status": "Status 2", "object_type": "vnic.VifStatus", "class_id": "vnic.VifStatus"}} + expectedOp := []map[string]interface{}{{"reason": "Reason 1", "status": "Status 1", "object_type": "vnic.VifStatus", "class_id": "vnic.VifStatus", "name": "Name 1"}, {"reason": "Reason 2", "status": "Status 2", "object_type": "vnic.VifStatus", "class_id": "vnic.VifStatus", "name": "Name 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -8192,7 +8192,7 @@ func TestFlattenListVnicVifStatus(t *testing.T) { func TestFlattenListWorkflowActionWorkflowDefinition(t *testing.T) { p := []models.WorkflowActionWorkflowDefinition{} var d = &schema.ResourceData{} - c := `{"ClassId":"workflow.ActionWorkflowDefinition","WorkflowDefinitionName":"WorkflowDefinitionName %d","Name":"Name %d","Label":"Label %d","ObjectType":"workflow.ActionWorkflowDefinition","Version":32,"Description":"Description %d","CatalogMoid":"CatalogMoid %d"}` + c := `{"ClassId":"workflow.ActionWorkflowDefinition","Name":"Name %d","Version":32,"WorkflowDefinitionName":"WorkflowDefinitionName %d","Description":"Description %d","ObjectType":"workflow.ActionWorkflowDefinition","CatalogMoid":"CatalogMoid %d","Label":"Label %d"}` //test when the response is empty ffOpEmpty := flattenListWorkflowActionWorkflowDefinition(p, d) @@ -8207,7 +8207,7 @@ func TestFlattenListWorkflowActionWorkflowDefinition(t *testing.T) { p = append(p, x) } ffOp := flattenListWorkflowActionWorkflowDefinition(p, d) - expectedOp := []map[string]interface{}{{"class_id": "workflow.ActionWorkflowDefinition", "workflow_definition_name": "WorkflowDefinitionName 1", "name": "Name 1", "label": "Label 1", "object_type": "workflow.ActionWorkflowDefinition", "nr_version": 32, "description": "Description 1", "catalog_moid": "CatalogMoid 1"}, {"class_id": "workflow.ActionWorkflowDefinition", "workflow_definition_name": "WorkflowDefinitionName 2", "name": "Name 2", "label": "Label 2", "object_type": "workflow.ActionWorkflowDefinition", "nr_version": 32, "description": "Description 2", "catalog_moid": "CatalogMoid 2"}} + expectedOp := []map[string]interface{}{{"class_id": "workflow.ActionWorkflowDefinition", "name": "Name 1", "nr_version": 32, "workflow_definition_name": "WorkflowDefinitionName 1", "description": "Description 1", "object_type": "workflow.ActionWorkflowDefinition", "catalog_moid": "CatalogMoid 1", "label": "Label 1"}, {"class_id": "workflow.ActionWorkflowDefinition", "name": "Name 2", "nr_version": 32, "workflow_definition_name": "WorkflowDefinitionName 2", "description": "Description 2", "object_type": "workflow.ActionWorkflowDefinition", "catalog_moid": "CatalogMoid 2", "label": "Label 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -8216,7 +8216,7 @@ func TestFlattenListWorkflowActionWorkflowDefinition(t *testing.T) { func TestFlattenListWorkflowApi(t *testing.T) { p := []models.WorkflowApi{} var d = &schema.ResourceData{} - c := `{"ErrorContentType":"ErrorContentType %d","AssetTargetMoid":"AssetTargetMoid %d","ObjectType":"workflow.Api","ClassId":"workflow.Api","Label":"Label %d","Body":"Body %d","StartDelay":32,"Name":"Name %d","Timeout":32,"ContentType":"ContentType %d","SkipOnCondition":"SkipOnCondition %d","Description":"Description %d"}` + c := `{"AssetTargetMoid":"AssetTargetMoid %d","StartDelay":32,"ObjectType":"workflow.Api","Name":"Name %d","Body":"Body %d","Timeout":32,"ContentType":"ContentType %d","Description":"Description %d","ErrorContentType":"ErrorContentType %d","Label":"Label %d","ClassId":"workflow.Api","SkipOnCondition":"SkipOnCondition %d"}` //test when the response is empty ffOpEmpty := flattenListWorkflowApi(p, d) @@ -8231,7 +8231,7 @@ func TestFlattenListWorkflowApi(t *testing.T) { p = append(p, x) } ffOp := flattenListWorkflowApi(p, d) - expectedOp := []map[string]interface{}{{"error_content_type": "ErrorContentType 1", "asset_target_moid": "AssetTargetMoid 1", "object_type": "workflow.Api", "class_id": "workflow.Api", "label": "Label 1", "body": "Body 1", "start_delay": 32, "name": "Name 1", "timeout": 32, "content_type": "ContentType 1", "skip_on_condition": "SkipOnCondition 1", "description": "Description 1"}, {"error_content_type": "ErrorContentType 2", "asset_target_moid": "AssetTargetMoid 2", "object_type": "workflow.Api", "class_id": "workflow.Api", "label": "Label 2", "body": "Body 2", "start_delay": 32, "name": "Name 2", "timeout": 32, "content_type": "ContentType 2", "skip_on_condition": "SkipOnCondition 2", "description": "Description 2"}} + expectedOp := []map[string]interface{}{{"asset_target_moid": "AssetTargetMoid 1", "start_delay": 32, "object_type": "workflow.Api", "name": "Name 1", "body": "Body 1", "timeout": 32, "content_type": "ContentType 1", "description": "Description 1", "error_content_type": "ErrorContentType 1", "label": "Label 1", "class_id": "workflow.Api", "skip_on_condition": "SkipOnCondition 1"}, {"asset_target_moid": "AssetTargetMoid 2", "start_delay": 32, "object_type": "workflow.Api", "name": "Name 2", "body": "Body 2", "timeout": 32, "content_type": "ContentType 2", "description": "Description 2", "error_content_type": "ErrorContentType 2", "label": "Label 2", "class_id": "workflow.Api", "skip_on_condition": "SkipOnCondition 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -8240,7 +8240,7 @@ func TestFlattenListWorkflowApi(t *testing.T) { func TestFlattenListWorkflowBaseDataType(t *testing.T) { p := []models.WorkflowBaseDataType{} var d = &schema.ResourceData{} - c := `{"Label":"Label %d","Name":"Name %d","ObjectType":"workflow.BaseDataType","ClassId":"workflow.BaseDataType","Description":"Description %d","Required":true}` + c := `{"Name":"Name %d","Description":"Description %d","Required":true,"ObjectType":"workflow.BaseDataType","ClassId":"workflow.BaseDataType","Label":"Label %d"}` //test when the response is empty ffOpEmpty := flattenListWorkflowBaseDataType(p, d) @@ -8255,7 +8255,7 @@ func TestFlattenListWorkflowBaseDataType(t *testing.T) { p = append(p, x) } ffOp := flattenListWorkflowBaseDataType(p, d) - expectedOp := []map[string]interface{}{{"label": "Label 1", "name": "Name 1", "object_type": "workflow.BaseDataType", "class_id": "workflow.BaseDataType", "description": "Description 1", "required": true}, {"label": "Label 2", "name": "Name 2", "object_type": "workflow.BaseDataType", "class_id": "workflow.BaseDataType", "description": "Description 2", "required": true}} + expectedOp := []map[string]interface{}{{"name": "Name 1", "description": "Description 1", "required": true, "object_type": "workflow.BaseDataType", "class_id": "workflow.BaseDataType", "label": "Label 1"}, {"name": "Name 2", "description": "Description 2", "required": true, "object_type": "workflow.BaseDataType", "class_id": "workflow.BaseDataType", "label": "Label 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -8264,7 +8264,7 @@ func TestFlattenListWorkflowBaseDataType(t *testing.T) { func TestFlattenListWorkflowDynamicWorkflowActionTaskList(t *testing.T) { p := []models.WorkflowDynamicWorkflowActionTaskList{} var d = &schema.ResourceData{} - c := `{"ObjectType":"workflow.DynamicWorkflowActionTaskList","ClassId":"workflow.DynamicWorkflowActionTaskList","Action":"Action %d"}` + c := `{"ClassId":"workflow.DynamicWorkflowActionTaskList","ObjectType":"workflow.DynamicWorkflowActionTaskList","Action":"Action %d"}` //test when the response is empty ffOpEmpty := flattenListWorkflowDynamicWorkflowActionTaskList(p, d) @@ -8279,7 +8279,7 @@ func TestFlattenListWorkflowDynamicWorkflowActionTaskList(t *testing.T) { p = append(p, x) } ffOp := flattenListWorkflowDynamicWorkflowActionTaskList(p, d) - expectedOp := []map[string]interface{}{{"object_type": "workflow.DynamicWorkflowActionTaskList", "class_id": "workflow.DynamicWorkflowActionTaskList", "action": "Action 1"}, {"object_type": "workflow.DynamicWorkflowActionTaskList", "class_id": "workflow.DynamicWorkflowActionTaskList", "action": "Action 2"}} + expectedOp := []map[string]interface{}{{"class_id": "workflow.DynamicWorkflowActionTaskList", "object_type": "workflow.DynamicWorkflowActionTaskList", "action": "Action 1"}, {"class_id": "workflow.DynamicWorkflowActionTaskList", "object_type": "workflow.DynamicWorkflowActionTaskList", "action": "Action 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -8288,7 +8288,7 @@ func TestFlattenListWorkflowDynamicWorkflowActionTaskList(t *testing.T) { func TestFlattenListWorkflowMessage(t *testing.T) { p := []models.WorkflowMessage{} var d = &schema.ResourceData{} - c := `{"ObjectType":"workflow.Message","ClassId":"workflow.Message","Message":"Message %d","Severity":"Severity %d"}` + c := `{"Severity":"Severity %d","ClassId":"workflow.Message","ObjectType":"workflow.Message","Message":"Message %d"}` //test when the response is empty ffOpEmpty := flattenListWorkflowMessage(p, d) @@ -8303,7 +8303,7 @@ func TestFlattenListWorkflowMessage(t *testing.T) { p = append(p, x) } ffOp := flattenListWorkflowMessage(p, d) - expectedOp := []map[string]interface{}{{"object_type": "workflow.Message", "class_id": "workflow.Message", "message": "Message 1", "severity": "Severity 1"}, {"object_type": "workflow.Message", "class_id": "workflow.Message", "message": "Message 2", "severity": "Severity 2"}} + expectedOp := []map[string]interface{}{{"severity": "Severity 1", "class_id": "workflow.Message", "object_type": "workflow.Message", "message": "Message 1"}, {"severity": "Severity 2", "class_id": "workflow.Message", "object_type": "workflow.Message", "message": "Message 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -8312,7 +8312,7 @@ func TestFlattenListWorkflowMessage(t *testing.T) { func TestFlattenListWorkflowParameterSet(t *testing.T) { p := []models.WorkflowParameterSet{} var d = &schema.ResourceData{} - c := `{"ControlParameter":"ControlParameter %d","Name":"Name %d","Value":"Value %d","ObjectType":"workflow.ParameterSet","ClassId":"workflow.ParameterSet","Condition":"Condition %d"}` + c := `{"ObjectType":"workflow.ParameterSet","ClassId":"workflow.ParameterSet","Condition":"Condition %d","ControlParameter":"ControlParameter %d","Name":"Name %d","Value":"Value %d"}` //test when the response is empty ffOpEmpty := flattenListWorkflowParameterSet(p, d) @@ -8327,7 +8327,7 @@ func TestFlattenListWorkflowParameterSet(t *testing.T) { p = append(p, x) } ffOp := flattenListWorkflowParameterSet(p, d) - expectedOp := []map[string]interface{}{{"control_parameter": "ControlParameter 1", "name": "Name 1", "value": "Value 1", "object_type": "workflow.ParameterSet", "class_id": "workflow.ParameterSet", "condition": "Condition 1"}, {"control_parameter": "ControlParameter 2", "name": "Name 2", "value": "Value 2", "object_type": "workflow.ParameterSet", "class_id": "workflow.ParameterSet", "condition": "Condition 2"}} + expectedOp := []map[string]interface{}{{"object_type": "workflow.ParameterSet", "class_id": "workflow.ParameterSet", "condition": "Condition 1", "control_parameter": "ControlParameter 1", "name": "Name 1", "value": "Value 1"}, {"object_type": "workflow.ParameterSet", "class_id": "workflow.ParameterSet", "condition": "Condition 2", "control_parameter": "ControlParameter 2", "name": "Name 2", "value": "Value 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -8336,7 +8336,7 @@ func TestFlattenListWorkflowParameterSet(t *testing.T) { func TestFlattenListWorkflowRollbackTask(t *testing.T) { p := []models.WorkflowRollbackTask{} var d = &schema.ResourceData{} - c := `{"Name":"Name %d","ObjectType":"workflow.RollbackTask","ClassId":"workflow.RollbackTask","Description":"Description %d","TaskMoid":"TaskMoid %d","Version":32,"CatalogMoid":"CatalogMoid %d","SkipCondition":"SkipCondition %d"}` + c := `{"ObjectType":"workflow.RollbackTask","Description":"Description %d","CatalogMoid":"CatalogMoid %d","Name":"Name %d","SkipCondition":"SkipCondition %d","ClassId":"workflow.RollbackTask","Version":32,"TaskMoid":"TaskMoid %d"}` //test when the response is empty ffOpEmpty := flattenListWorkflowRollbackTask(p, d) @@ -8351,7 +8351,7 @@ func TestFlattenListWorkflowRollbackTask(t *testing.T) { p = append(p, x) } ffOp := flattenListWorkflowRollbackTask(p, d) - expectedOp := []map[string]interface{}{{"name": "Name 1", "object_type": "workflow.RollbackTask", "class_id": "workflow.RollbackTask", "description": "Description 1", "task_moid": "TaskMoid 1", "nr_version": 32, "catalog_moid": "CatalogMoid 1", "skip_condition": "SkipCondition 1"}, {"name": "Name 2", "object_type": "workflow.RollbackTask", "class_id": "workflow.RollbackTask", "description": "Description 2", "task_moid": "TaskMoid 2", "nr_version": 32, "catalog_moid": "CatalogMoid 2", "skip_condition": "SkipCondition 2"}} + expectedOp := []map[string]interface{}{{"object_type": "workflow.RollbackTask", "description": "Description 1", "catalog_moid": "CatalogMoid 1", "name": "Name 1", "skip_condition": "SkipCondition 1", "class_id": "workflow.RollbackTask", "nr_version": 32, "task_moid": "TaskMoid 1"}, {"object_type": "workflow.RollbackTask", "description": "Description 2", "catalog_moid": "CatalogMoid 2", "name": "Name 2", "skip_condition": "SkipCondition 2", "class_id": "workflow.RollbackTask", "nr_version": 32, "task_moid": "TaskMoid 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -8360,7 +8360,7 @@ func TestFlattenListWorkflowRollbackTask(t *testing.T) { func TestFlattenListWorkflowRollbackWorkflowTask(t *testing.T) { p := []models.WorkflowRollbackWorkflowTask{} var d = &schema.ResourceData{} - c := `{"TaskPath":"TaskPath %d","RefName":"RefName %d","RollbackCompleted":true,"RollbackTaskName":"RollbackTaskName %d","Name":"Name %d","Status":"Status %d","Description":"Description %d","TaskInfoMoid":"TaskInfoMoid %d","ClassId":"workflow.RollbackWorkflowTask","ObjectType":"workflow.RollbackWorkflowTask"}` + c := `{"RefName":"RefName %d","RollbackTaskName":"RollbackTaskName %d","ClassId":"workflow.RollbackWorkflowTask","Status":"Status %d","RollbackCompleted":true,"TaskPath":"TaskPath %d","Description":"Description %d","ObjectType":"workflow.RollbackWorkflowTask","TaskInfoMoid":"TaskInfoMoid %d","Name":"Name %d"}` //test when the response is empty ffOpEmpty := flattenListWorkflowRollbackWorkflowTask(p, d) @@ -8375,7 +8375,7 @@ func TestFlattenListWorkflowRollbackWorkflowTask(t *testing.T) { p = append(p, x) } ffOp := flattenListWorkflowRollbackWorkflowTask(p, d) - expectedOp := []map[string]interface{}{{"task_path": "TaskPath 1", "ref_name": "RefName 1", "rollback_completed": true, "rollback_task_name": "RollbackTaskName 1", "name": "Name 1", "status": "Status 1", "description": "Description 1", "task_info_moid": "TaskInfoMoid 1", "class_id": "workflow.RollbackWorkflowTask", "object_type": "workflow.RollbackWorkflowTask"}, {"task_path": "TaskPath 2", "ref_name": "RefName 2", "rollback_completed": true, "rollback_task_name": "RollbackTaskName 2", "name": "Name 2", "status": "Status 2", "description": "Description 2", "task_info_moid": "TaskInfoMoid 2", "class_id": "workflow.RollbackWorkflowTask", "object_type": "workflow.RollbackWorkflowTask"}} + expectedOp := []map[string]interface{}{{"ref_name": "RefName 1", "rollback_task_name": "RollbackTaskName 1", "class_id": "workflow.RollbackWorkflowTask", "status": "Status 1", "rollback_completed": true, "task_path": "TaskPath 1", "description": "Description 1", "object_type": "workflow.RollbackWorkflowTask", "task_info_moid": "TaskInfoMoid 1", "name": "Name 1"}, {"ref_name": "RefName 2", "rollback_task_name": "RollbackTaskName 2", "class_id": "workflow.RollbackWorkflowTask", "status": "Status 2", "rollback_completed": true, "task_path": "TaskPath 2", "description": "Description 2", "object_type": "workflow.RollbackWorkflowTask", "task_info_moid": "TaskInfoMoid 2", "name": "Name 2"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -8384,7 +8384,7 @@ func TestFlattenListWorkflowRollbackWorkflowTask(t *testing.T) { func TestFlattenListWorkflowSolutionActionDefinitionRelationship(t *testing.T) { p := []models.WorkflowSolutionActionDefinitionRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListWorkflowSolutionActionDefinitionRelationship(p, d) @@ -8399,7 +8399,7 @@ func TestFlattenListWorkflowSolutionActionDefinitionRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListWorkflowSolutionActionDefinitionRelationship(p, d) - expectedOp := []map[string]interface{}{{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"}, {"selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2"}} + expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -8408,7 +8408,7 @@ func TestFlattenListWorkflowSolutionActionDefinitionRelationship(t *testing.T) { func TestFlattenListWorkflowTaskDefinitionRelationship(t *testing.T) { p := []models.WorkflowTaskDefinitionRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListWorkflowTaskDefinitionRelationship(p, d) @@ -8423,7 +8423,7 @@ func TestFlattenListWorkflowTaskDefinitionRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListWorkflowTaskDefinitionRelationship(p, d) - expectedOp := []map[string]interface{}{{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"}, {"object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef"}} + expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -8456,7 +8456,7 @@ func TestFlattenListWorkflowTaskInfoRelationship(t *testing.T) { func TestFlattenListWorkflowTaskRetryInfo(t *testing.T) { p := []models.WorkflowTaskRetryInfo{} var d = &schema.ResourceData{} - c := `{"ObjectType":"workflow.TaskRetryInfo","ClassId":"workflow.TaskRetryInfo","Status":"Status %d","TaskInstId":"TaskInstId %d"}` + c := `{"ClassId":"workflow.TaskRetryInfo","Status":"Status %d","TaskInstId":"TaskInstId %d","ObjectType":"workflow.TaskRetryInfo"}` //test when the response is empty ffOpEmpty := flattenListWorkflowTaskRetryInfo(p, d) @@ -8471,7 +8471,7 @@ func TestFlattenListWorkflowTaskRetryInfo(t *testing.T) { p = append(p, x) } ffOp := flattenListWorkflowTaskRetryInfo(p, d) - expectedOp := []map[string]interface{}{{"object_type": "workflow.TaskRetryInfo", "class_id": "workflow.TaskRetryInfo", "status": "Status 1", "task_inst_id": "TaskInstId 1"}, {"object_type": "workflow.TaskRetryInfo", "class_id": "workflow.TaskRetryInfo", "status": "Status 2", "task_inst_id": "TaskInstId 2"}} + expectedOp := []map[string]interface{}{{"class_id": "workflow.TaskRetryInfo", "status": "Status 1", "task_inst_id": "TaskInstId 1", "object_type": "workflow.TaskRetryInfo"}, {"class_id": "workflow.TaskRetryInfo", "status": "Status 2", "task_inst_id": "TaskInstId 2", "object_type": "workflow.TaskRetryInfo"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -8480,7 +8480,7 @@ func TestFlattenListWorkflowTaskRetryInfo(t *testing.T) { func TestFlattenListWorkflowUiInputFilter(t *testing.T) { p := []models.WorkflowUiInputFilter{} var d = &schema.ResourceData{} - c := `{"Name":"Name %d","UserHelpMessage":"UserHelpMessage %d","ObjectType":"workflow.UiInputFilter","ClassId":"workflow.UiInputFilter"}` + c := `{"ObjectType":"workflow.UiInputFilter","UserHelpMessage":"UserHelpMessage %d","Name":"Name %d","ClassId":"workflow.UiInputFilter"}` //test when the response is empty ffOpEmpty := flattenListWorkflowUiInputFilter(p, d) @@ -8495,7 +8495,7 @@ func TestFlattenListWorkflowUiInputFilter(t *testing.T) { p = append(p, x) } ffOp := flattenListWorkflowUiInputFilter(p, d) - expectedOp := []map[string]interface{}{{"name": "Name 1", "user_help_message": "UserHelpMessage 1", "object_type": "workflow.UiInputFilter", "class_id": "workflow.UiInputFilter"}, {"name": "Name 2", "user_help_message": "UserHelpMessage 2", "object_type": "workflow.UiInputFilter", "class_id": "workflow.UiInputFilter"}} + expectedOp := []map[string]interface{}{{"object_type": "workflow.UiInputFilter", "user_help_message": "UserHelpMessage 1", "name": "Name 1", "class_id": "workflow.UiInputFilter"}, {"object_type": "workflow.UiInputFilter", "user_help_message": "UserHelpMessage 2", "name": "Name 2", "class_id": "workflow.UiInputFilter"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -8504,7 +8504,7 @@ func TestFlattenListWorkflowUiInputFilter(t *testing.T) { func TestFlattenListWorkflowWorkflowInfoRelationship(t *testing.T) { p := []models.WorkflowWorkflowInfoRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenListWorkflowWorkflowInfoRelationship(p, d) @@ -8519,7 +8519,7 @@ func TestFlattenListWorkflowWorkflowInfoRelationship(t *testing.T) { p = append(p, x) } ffOp := flattenListWorkflowWorkflowInfoRelationship(p, d) - expectedOp := []map[string]interface{}{{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"}, {"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 2", "selector": "Selector 2"}} + expectedOp := []map[string]interface{}{{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}, {"moid": "Moid 2", "selector": "Selector 2", "class_id": "mo.MoRef", "object_type": "mo.MoRef"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -8528,7 +8528,7 @@ func TestFlattenListWorkflowWorkflowInfoRelationship(t *testing.T) { func TestFlattenListWorkflowWorkflowTask(t *testing.T) { p := []models.WorkflowWorkflowTask{} var d = &schema.ResourceData{} - c := `{"Label":"Label %d","ObjectType":"workflow.WorkflowTask","ClassId":"workflow.WorkflowTask","Name":"Name %d","Description":"Description %d"}` + c := `{"Description":"Description %d","Label":"Label %d","Name":"Name %d","ObjectType":"workflow.WorkflowTask","ClassId":"workflow.WorkflowTask"}` //test when the response is empty ffOpEmpty := flattenListWorkflowWorkflowTask(p, d) @@ -8543,7 +8543,7 @@ func TestFlattenListWorkflowWorkflowTask(t *testing.T) { p = append(p, x) } ffOp := flattenListWorkflowWorkflowTask(p, d) - expectedOp := []map[string]interface{}{{"label": "Label 1", "object_type": "workflow.WorkflowTask", "class_id": "workflow.WorkflowTask", "name": "Name 1", "description": "Description 1"}, {"label": "Label 2", "object_type": "workflow.WorkflowTask", "class_id": "workflow.WorkflowTask", "name": "Name 2", "description": "Description 2"}} + expectedOp := []map[string]interface{}{{"description": "Description 1", "label": "Label 1", "name": "Name 1", "object_type": "workflow.WorkflowTask", "class_id": "workflow.WorkflowTask"}, {"description": "Description 2", "label": "Label 2", "name": "Name 2", "object_type": "workflow.WorkflowTask", "class_id": "workflow.WorkflowTask"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -8552,7 +8552,7 @@ func TestFlattenListWorkflowWorkflowTask(t *testing.T) { func TestFlattenListX509Certificate(t *testing.T) { p := []models.X509Certificate{} var d = &schema.ResourceData{} - c := `{"PemCertificate":"PemCertificate %d","SignatureAlgorithm":"SignatureAlgorithm %d","Sha256Fingerprint":"Sha256Fingerprint %d","ObjectType":"x509.Certificate","ClassId":"x509.Certificate"}` + c := `{"SignatureAlgorithm":"SignatureAlgorithm %d","PemCertificate":"PemCertificate %d","Sha256Fingerprint":"Sha256Fingerprint %d","ClassId":"x509.Certificate","ObjectType":"x509.Certificate"}` //test when the response is empty ffOpEmpty := flattenListX509Certificate(p, d) @@ -8567,7 +8567,7 @@ func TestFlattenListX509Certificate(t *testing.T) { p = append(p, x) } ffOp := flattenListX509Certificate(p, d) - expectedOp := []map[string]interface{}{{"pem_certificate": "PemCertificate 1", "signature_algorithm": "SignatureAlgorithm 1", "sha256_fingerprint": "Sha256Fingerprint 1", "object_type": "x509.Certificate", "class_id": "x509.Certificate"}, {"pem_certificate": "PemCertificate 2", "signature_algorithm": "SignatureAlgorithm 2", "sha256_fingerprint": "Sha256Fingerprint 2", "object_type": "x509.Certificate", "class_id": "x509.Certificate"}} + expectedOp := []map[string]interface{}{{"signature_algorithm": "SignatureAlgorithm 1", "pem_certificate": "PemCertificate 1", "sha256_fingerprint": "Sha256Fingerprint 1", "class_id": "x509.Certificate", "object_type": "x509.Certificate"}, {"signature_algorithm": "SignatureAlgorithm 2", "pem_certificate": "PemCertificate 2", "sha256_fingerprint": "Sha256Fingerprint 2", "class_id": "x509.Certificate", "object_type": "x509.Certificate"}} for i := 0; i < len(expectedOp); i++ { err := compareMaps(expectedOp[i], ffOp[i], t) CheckError(t, err) @@ -8576,7 +8576,7 @@ func TestFlattenListX509Certificate(t *testing.T) { func TestFlattenMapAccessAddressType(t *testing.T) { p := models.AccessAddressType{} var d = &schema.ResourceData{} - c := `{"EnableIpV4":true,"EnableIpV6":true,"ObjectType":"access.AddressType","ClassId":"access.AddressType"}` + c := `{"ObjectType":"access.AddressType","ClassId":"access.AddressType","EnableIpV4":true,"EnableIpV6":true}` //test when the response is empty ffOpEmpty := flattenMapAccessAddressType(p, d) @@ -8587,14 +8587,14 @@ func TestFlattenMapAccessAddressType(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapAccessAddressType(p, d)[0] - expectedOp := map[string]interface{}{"enable_ip_v4": true, "enable_ip_v6": true, "object_type": "access.AddressType", "class_id": "access.AddressType"} + expectedOp := map[string]interface{}{"object_type": "access.AddressType", "class_id": "access.AddressType", "enable_ip_v4": true, "enable_ip_v6": true} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapAccessConfigurationType(t *testing.T) { p := models.AccessConfigurationType{} var d = &schema.ResourceData{} - c := `{"ObjectType":"access.ConfigurationType","ClassId":"access.ConfigurationType","ConfigureInband":true,"ConfigureOutOfBand":true}` + c := `{"ClassId":"access.ConfigurationType","ConfigureInband":true,"ConfigureOutOfBand":true,"ObjectType":"access.ConfigurationType"}` //test when the response is empty ffOpEmpty := flattenMapAccessConfigurationType(p, d) @@ -8605,14 +8605,14 @@ func TestFlattenMapAccessConfigurationType(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapAccessConfigurationType(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "access.ConfigurationType", "class_id": "access.ConfigurationType", "configure_inband": true, "configure_out_of_band": true} + expectedOp := map[string]interface{}{"class_id": "access.ConfigurationType", "configure_inband": true, "configure_out_of_band": true, "object_type": "access.ConfigurationType"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapAdapterUnitRelationship(t *testing.T) { p := models.AdapterUnitRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenMapAdapterUnitRelationship(p, d) @@ -8623,7 +8623,7 @@ func TestFlattenMapAdapterUnitRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapAdapterUnitRelationship(p, d)[0] - expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} + expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -8648,7 +8648,7 @@ func TestFlattenMapAdapterUnitExpanderRelationship(t *testing.T) { func TestFlattenMapApplianceCertRenewalPhase(t *testing.T) { p := models.ApplianceCertRenewalPhase{} var d = &schema.ResourceData{} - c := `{"ClassId":"appliance.CertRenewalPhase","Failed":true,"Message":"Message %d","Name":"Name %d","ObjectType":"appliance.CertRenewalPhase"}` + c := `{"Failed":true,"Message":"Message %d","Name":"Name %d","ObjectType":"appliance.CertRenewalPhase","ClassId":"appliance.CertRenewalPhase"}` //test when the response is empty ffOpEmpty := flattenMapApplianceCertRenewalPhase(p, d) @@ -8659,14 +8659,14 @@ func TestFlattenMapApplianceCertRenewalPhase(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapApplianceCertRenewalPhase(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "appliance.CertRenewalPhase", "failed": true, "message": "Message 1", "name": "Name 1", "object_type": "appliance.CertRenewalPhase"} + expectedOp := map[string]interface{}{"failed": true, "message": "Message 1", "name": "Name 1", "object_type": "appliance.CertRenewalPhase", "class_id": "appliance.CertRenewalPhase"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapApplianceDataExportPolicyRelationship(t *testing.T) { p := models.ApplianceDataExportPolicyRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenMapApplianceDataExportPolicyRelationship(p, d) @@ -8677,14 +8677,14 @@ func TestFlattenMapApplianceDataExportPolicyRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapApplianceDataExportPolicyRelationship(p, d)[0] - expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} + expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapApplianceGroupStatusRelationship(t *testing.T) { p := models.ApplianceGroupStatusRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapApplianceGroupStatusRelationship(p, d) @@ -8695,14 +8695,14 @@ func TestFlattenMapApplianceGroupStatusRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapApplianceGroupStatusRelationship(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapApplianceImageBundleRelationship(t *testing.T) { p := models.ApplianceImageBundleRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenMapApplianceImageBundleRelationship(p, d) @@ -8713,14 +8713,14 @@ func TestFlattenMapApplianceImageBundleRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapApplianceImageBundleRelationship(p, d)[0] - expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} + expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapApplianceNodeInfoRelationship(t *testing.T) { p := models.ApplianceNodeInfoRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapApplianceNodeInfoRelationship(p, d) @@ -8731,7 +8731,7 @@ func TestFlattenMapApplianceNodeInfoRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapApplianceNodeInfoRelationship(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -8756,7 +8756,7 @@ func TestFlattenMapApplianceNodeStatusRelationship(t *testing.T) { func TestFlattenMapApplianceSystemInfoRelationship(t *testing.T) { p := models.ApplianceSystemInfoRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapApplianceSystemInfoRelationship(p, d) @@ -8767,7 +8767,7 @@ func TestFlattenMapApplianceSystemInfoRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapApplianceSystemInfoRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -8828,7 +8828,7 @@ func TestFlattenMapAssetClusterMemberRelationship(t *testing.T) { func TestFlattenMapAssetContractInformation(t *testing.T) { p := models.AssetContractInformation{} var d = &schema.ResourceData{} - c := `{"ObjectType":"asset.ContractInformation","ClassId":"asset.ContractInformation","ContractNumber":"ContractNumber %d","LineStatus":"LineStatus %d"}` + c := `{"ContractNumber":"ContractNumber %d","LineStatus":"LineStatus %d","ObjectType":"asset.ContractInformation","ClassId":"asset.ContractInformation"}` //test when the response is empty ffOpEmpty := flattenMapAssetContractInformation(p, d) @@ -8839,14 +8839,14 @@ func TestFlattenMapAssetContractInformation(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapAssetContractInformation(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "asset.ContractInformation", "class_id": "asset.ContractInformation", "contract_number": "ContractNumber 1", "line_status": "LineStatus 1"} + expectedOp := map[string]interface{}{"contract_number": "ContractNumber 1", "line_status": "LineStatus 1", "object_type": "asset.ContractInformation", "class_id": "asset.ContractInformation"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapAssetCustomerInformation(t *testing.T) { p := models.AssetCustomerInformation{} var d = &schema.ResourceData{} - c := `{"Name":"Name %d","Id":"Id %d","ObjectType":"asset.CustomerInformation","ClassId":"asset.CustomerInformation"}` + c := `{"Id":"Id %d","Name":"Name %d","ObjectType":"asset.CustomerInformation","ClassId":"asset.CustomerInformation"}` //test when the response is empty ffOpEmpty := flattenMapAssetCustomerInformation(p, d) @@ -8857,14 +8857,14 @@ func TestFlattenMapAssetCustomerInformation(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapAssetCustomerInformation(p, d)[0] - expectedOp := map[string]interface{}{"name": "Name 1", "id": "Id 1", "object_type": "asset.CustomerInformation", "class_id": "asset.CustomerInformation"} + expectedOp := map[string]interface{}{"id": "Id 1", "name": "Name 1", "object_type": "asset.CustomerInformation", "class_id": "asset.CustomerInformation"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapAssetDeploymentRelationship(t *testing.T) { p := models.AssetDeploymentRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenMapAssetDeploymentRelationship(p, d) @@ -8875,7 +8875,7 @@ func TestFlattenMapAssetDeploymentRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapAssetDeploymentRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -8900,7 +8900,7 @@ func TestFlattenMapAssetDeploymentAlarmInfo(t *testing.T) { func TestFlattenMapAssetDeploymentDeviceAlarmInfo(t *testing.T) { p := models.AssetDeploymentDeviceAlarmInfo{} var d = &schema.ResourceData{} - c := `{"ObjectType":"asset.DeploymentDeviceAlarmInfo","ClassId":"asset.DeploymentDeviceAlarmInfo"}` + c := `{"ClassId":"asset.DeploymentDeviceAlarmInfo","ObjectType":"asset.DeploymentDeviceAlarmInfo"}` //test when the response is empty ffOpEmpty := flattenMapAssetDeploymentDeviceAlarmInfo(p, d) @@ -8911,14 +8911,14 @@ func TestFlattenMapAssetDeploymentDeviceAlarmInfo(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapAssetDeploymentDeviceAlarmInfo(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "asset.DeploymentDeviceAlarmInfo", "class_id": "asset.DeploymentDeviceAlarmInfo"} + expectedOp := map[string]interface{}{"class_id": "asset.DeploymentDeviceAlarmInfo", "object_type": "asset.DeploymentDeviceAlarmInfo"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapAssetDeploymentDeviceInformation(t *testing.T) { p := models.AssetDeploymentDeviceInformation{} var d = &schema.ResourceData{} - c := `{"Description":"Description %d","OldDeviceStatusDescription":"OldDeviceStatusDescription %d","OldDeviceStatusId":32,"ClassId":"asset.DeploymentDeviceInformation","OldInstanceId":"OldInstanceId %d","OldDeviceId":"OldDeviceId %d","InstanceId":"InstanceId %d","MlbProductId":32,"ApplicationName":"ApplicationName %d","MlbProductName":"MlbProductName %d","ObjectType":"asset.DeploymentDeviceInformation","ItemType":"ItemType %d"}` + c := `{"ClassId":"asset.DeploymentDeviceInformation","OldDeviceStatusDescription":"OldDeviceStatusDescription %d","Description":"Description %d","ItemType":"ItemType %d","ObjectType":"asset.DeploymentDeviceInformation","MlbProductId":32,"OldInstanceId":"OldInstanceId %d","ApplicationName":"ApplicationName %d","MlbProductName":"MlbProductName %d","OldDeviceStatusId":32,"InstanceId":"InstanceId %d","OldDeviceId":"OldDeviceId %d"}` //test when the response is empty ffOpEmpty := flattenMapAssetDeploymentDeviceInformation(p, d) @@ -8929,14 +8929,14 @@ func TestFlattenMapAssetDeploymentDeviceInformation(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapAssetDeploymentDeviceInformation(p, d)[0] - expectedOp := map[string]interface{}{"description": "Description 1", "old_device_status_description": "OldDeviceStatusDescription 1", "old_device_status_id": 32, "class_id": "asset.DeploymentDeviceInformation", "old_instance_id": "OldInstanceId 1", "old_device_id": "OldDeviceId 1", "instance_id": "InstanceId 1", "mlb_product_id": 32, "application_name": "ApplicationName 1", "mlb_product_name": "MlbProductName 1", "object_type": "asset.DeploymentDeviceInformation", "item_type": "ItemType 1"} + expectedOp := map[string]interface{}{"class_id": "asset.DeploymentDeviceInformation", "old_device_status_description": "OldDeviceStatusDescription 1", "description": "Description 1", "item_type": "ItemType 1", "object_type": "asset.DeploymentDeviceInformation", "mlb_product_id": 32, "old_instance_id": "OldInstanceId 1", "application_name": "ApplicationName 1", "mlb_product_name": "MlbProductName 1", "old_device_status_id": 32, "instance_id": "InstanceId 1", "old_device_id": "OldDeviceId 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapAssetDeviceClaimRelationship(t *testing.T) { p := models.AssetDeviceClaimRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapAssetDeviceClaimRelationship(p, d) @@ -8947,14 +8947,14 @@ func TestFlattenMapAssetDeviceClaimRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapAssetDeviceClaimRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapAssetDeviceConfigurationRelationship(t *testing.T) { p := models.AssetDeviceConfigurationRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapAssetDeviceConfigurationRelationship(p, d) @@ -8965,14 +8965,14 @@ func TestFlattenMapAssetDeviceConfigurationRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapAssetDeviceConfigurationRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapAssetDeviceConnectionRelationship(t *testing.T) { p := models.AssetDeviceConnectionRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapAssetDeviceConnectionRelationship(p, d) @@ -8983,7 +8983,7 @@ func TestFlattenMapAssetDeviceConnectionRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapAssetDeviceConnectionRelationship(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -9008,7 +9008,7 @@ func TestFlattenMapAssetDeviceContractInformationRelationship(t *testing.T) { func TestFlattenMapAssetDeviceInformation(t *testing.T) { p := models.AssetDeviceInformation{} var d = &schema.ResourceData{} - c := `{"ClassId":"asset.DeviceInformation","ApplicationName":"ApplicationName %d","OldDeviceStatusId":32,"MlbProductId":32,"ProductFamily":"ProductFamily %d","InstanceId":"InstanceId %d","OldDeviceId":"OldDeviceId %d","OldInstanceId":"OldInstanceId %d","UnitOfMeasure":"UnitOfMeasure %d","MlbOfferType":"MlbOfferType %d","ObjectType":"asset.DeviceInformation","ProductType":"ProductType %d","ItemType":"ItemType %d","OldDeviceStatusDescription":"OldDeviceStatusDescription %d","MlbProductName":"MlbProductName %d"}` + c := `{"MlbProductName":"MlbProductName %d","OldDeviceId":"OldDeviceId %d","InstanceId":"InstanceId %d","UnitOfMeasure":"UnitOfMeasure %d","MlbOfferType":"MlbOfferType %d","ProductType":"ProductType %d","ItemType":"ItemType %d","OldDeviceStatusId":32,"MlbProductId":32,"OldDeviceStatusDescription":"OldDeviceStatusDescription %d","ProductFamily":"ProductFamily %d","ClassId":"asset.DeviceInformation","ObjectType":"asset.DeviceInformation","OldInstanceId":"OldInstanceId %d","ApplicationName":"ApplicationName %d"}` //test when the response is empty ffOpEmpty := flattenMapAssetDeviceInformation(p, d) @@ -9019,14 +9019,14 @@ func TestFlattenMapAssetDeviceInformation(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapAssetDeviceInformation(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "asset.DeviceInformation", "application_name": "ApplicationName 1", "old_device_status_id": 32, "mlb_product_id": 32, "product_family": "ProductFamily 1", "instance_id": "InstanceId 1", "old_device_id": "OldDeviceId 1", "old_instance_id": "OldInstanceId 1", "unit_of_measure": "UnitOfMeasure 1", "mlb_offer_type": "MlbOfferType 1", "object_type": "asset.DeviceInformation", "product_type": "ProductType 1", "item_type": "ItemType 1", "old_device_status_description": "OldDeviceStatusDescription 1", "mlb_product_name": "MlbProductName 1"} + expectedOp := map[string]interface{}{"mlb_product_name": "MlbProductName 1", "old_device_id": "OldDeviceId 1", "instance_id": "InstanceId 1", "unit_of_measure": "UnitOfMeasure 1", "mlb_offer_type": "MlbOfferType 1", "product_type": "ProductType 1", "item_type": "ItemType 1", "old_device_status_id": 32, "mlb_product_id": 32, "old_device_status_description": "OldDeviceStatusDescription 1", "product_family": "ProductFamily 1", "class_id": "asset.DeviceInformation", "object_type": "asset.DeviceInformation", "old_instance_id": "OldInstanceId 1", "application_name": "ApplicationName 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapAssetDeviceRegistrationRelationship(t *testing.T) { p := models.AssetDeviceRegistrationRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapAssetDeviceRegistrationRelationship(p, d) @@ -9037,14 +9037,14 @@ func TestFlattenMapAssetDeviceRegistrationRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapAssetDeviceRegistrationRelationship(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapAssetDeviceStatistics(t *testing.T) { p := models.AssetDeviceStatistics{} var d = &schema.ResourceData{} - c := `{"Connected":32,"MemoryMirroringFactor":32.000000,"ClassId":"asset.DeviceStatistics","ObjectType":"asset.DeviceStatistics","MembershipRatio":32.000000,"ClusterDeploymentType":"ClusterDeploymentType %d","ClusterReplicationFactor":32,"ClusterDeviceMoid":"ClusterDeviceMoid %d","ClusterName":"ClusterName %d"}` + c := `{"ClusterDeploymentType":"ClusterDeploymentType %d","ClusterDeviceMoid":"ClusterDeviceMoid %d","MembershipRatio":32.000000,"ClassId":"asset.DeviceStatistics","ClusterReplicationFactor":32,"ClusterName":"ClusterName %d","Connected":32,"MemoryMirroringFactor":32.000000,"ObjectType":"asset.DeviceStatistics"}` //test when the response is empty ffOpEmpty := flattenMapAssetDeviceStatistics(p, d) @@ -9055,14 +9055,14 @@ func TestFlattenMapAssetDeviceStatistics(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapAssetDeviceStatistics(p, d)[0] - expectedOp := map[string]interface{}{"connected": 32, "memory_mirroring_factor": 32.000000, "class_id": "asset.DeviceStatistics", "object_type": "asset.DeviceStatistics", "membership_ratio": 32.000000, "cluster_deployment_type": "ClusterDeploymentType 1", "cluster_replication_factor": 32, "cluster_device_moid": "ClusterDeviceMoid 1", "cluster_name": "ClusterName 1"} + expectedOp := map[string]interface{}{"cluster_deployment_type": "ClusterDeploymentType 1", "cluster_device_moid": "ClusterDeviceMoid 1", "membership_ratio": 32.000000, "class_id": "asset.DeviceStatistics", "cluster_replication_factor": 32, "cluster_name": "ClusterName 1", "connected": 32, "memory_mirroring_factor": 32.000000, "object_type": "asset.DeviceStatistics"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapAssetGlobalUltimate(t *testing.T) { p := models.AssetGlobalUltimate{} var d = &schema.ResourceData{} - c := `{"Name":"Name %d","ObjectType":"asset.GlobalUltimate","ClassId":"asset.GlobalUltimate","Id":"Id %d"}` + c := `{"Name":"Name %d","Id":"Id %d","ObjectType":"asset.GlobalUltimate","ClassId":"asset.GlobalUltimate"}` //test when the response is empty ffOpEmpty := flattenMapAssetGlobalUltimate(p, d) @@ -9073,14 +9073,14 @@ func TestFlattenMapAssetGlobalUltimate(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapAssetGlobalUltimate(p, d)[0] - expectedOp := map[string]interface{}{"name": "Name 1", "object_type": "asset.GlobalUltimate", "class_id": "asset.GlobalUltimate", "id": "Id 1"} + expectedOp := map[string]interface{}{"name": "Name 1", "id": "Id 1", "object_type": "asset.GlobalUltimate", "class_id": "asset.GlobalUltimate"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapAssetProductInformation(t *testing.T) { p := models.AssetProductInformation{} var d = &schema.ResourceData{} - c := `{"Group":"Group %d","ObjectType":"asset.ProductInformation","ClassId":"asset.ProductInformation","Family":"Family %d","Number":"Number %d","SubType":"SubType %d","Description":"Description %d"}` + c := `{"ClassId":"asset.ProductInformation","SubType":"SubType %d","Description":"Description %d","ObjectType":"asset.ProductInformation","Family":"Family %d","Group":"Group %d","Number":"Number %d"}` //test when the response is empty ffOpEmpty := flattenMapAssetProductInformation(p, d) @@ -9091,14 +9091,14 @@ func TestFlattenMapAssetProductInformation(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapAssetProductInformation(p, d)[0] - expectedOp := map[string]interface{}{"group": "Group 1", "object_type": "asset.ProductInformation", "class_id": "asset.ProductInformation", "family": "Family 1", "number": "Number 1", "sub_type": "SubType 1", "description": "Description 1"} + expectedOp := map[string]interface{}{"class_id": "asset.ProductInformation", "sub_type": "SubType 1", "description": "Description 1", "object_type": "asset.ProductInformation", "family": "Family 1", "group": "Group 1", "number": "Number 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapAssetSubscriptionRelationship(t *testing.T) { p := models.AssetSubscriptionRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapAssetSubscriptionRelationship(p, d) @@ -9109,14 +9109,14 @@ func TestFlattenMapAssetSubscriptionRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapAssetSubscriptionRelationship(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapAssetSubscriptionAccountRelationship(t *testing.T) { p := models.AssetSubscriptionAccountRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapAssetSubscriptionAccountRelationship(p, d) @@ -9127,14 +9127,14 @@ func TestFlattenMapAssetSubscriptionAccountRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapAssetSubscriptionAccountRelationship(p, d)[0] - expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} + expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapAssetSudiInfo(t *testing.T) { p := models.AssetSudiInfo{} var d = &schema.ResourceData{} - c := `{"Pid":"Pid %d","SerialNumber":"SerialNumber %d","Signature":"Signature %d","Status":"Status %d","ObjectType":"asset.SudiInfo","ClassId":"asset.SudiInfo"}` + c := `{"Status":"Status %d","Pid":"Pid %d","SerialNumber":"SerialNumber %d","Signature":"Signature %d","ObjectType":"asset.SudiInfo","ClassId":"asset.SudiInfo"}` //test when the response is empty ffOpEmpty := flattenMapAssetSudiInfo(p, d) @@ -9145,7 +9145,7 @@ func TestFlattenMapAssetSudiInfo(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapAssetSudiInfo(p, d)[0] - expectedOp := map[string]interface{}{"pid": "Pid 1", "serial_number": "SerialNumber 1", "signature": "Signature 1", "status": "Status 1", "object_type": "asset.SudiInfo", "class_id": "asset.SudiInfo"} + expectedOp := map[string]interface{}{"status": "Status 1", "pid": "Pid 1", "serial_number": "SerialNumber 1", "signature": "Signature 1", "object_type": "asset.SudiInfo", "class_id": "asset.SudiInfo"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -9170,7 +9170,7 @@ func TestFlattenMapAssetTargetRelationship(t *testing.T) { func TestFlattenMapBiosBootModeRelationship(t *testing.T) { p := models.BiosBootModeRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapBiosBootModeRelationship(p, d) @@ -9181,14 +9181,14 @@ func TestFlattenMapBiosBootModeRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapBiosBootModeRelationship(p, d)[0] - expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} + expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapBiosSystemBootOrderRelationship(t *testing.T) { p := models.BiosSystemBootOrderRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenMapBiosSystemBootOrderRelationship(p, d) @@ -9199,7 +9199,7 @@ func TestFlattenMapBiosSystemBootOrderRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapBiosSystemBootOrderRelationship(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} + expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -9224,7 +9224,7 @@ func TestFlattenMapBiosTokenSettingsRelationship(t *testing.T) { func TestFlattenMapBiosUnitRelationship(t *testing.T) { p := models.BiosUnitRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenMapBiosUnitRelationship(p, d) @@ -9235,14 +9235,14 @@ func TestFlattenMapBiosUnitRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapBiosUnitRelationship(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} + expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapBiosVfSelectMemoryRasConfigurationRelationship(t *testing.T) { p := models.BiosVfSelectMemoryRasConfigurationRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapBiosVfSelectMemoryRasConfigurationRelationship(p, d) @@ -9253,14 +9253,14 @@ func TestFlattenMapBiosVfSelectMemoryRasConfigurationRelationship(t *testing.T) err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapBiosVfSelectMemoryRasConfigurationRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapBootDeviceBootModeRelationship(t *testing.T) { p := models.BootDeviceBootModeRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenMapBootDeviceBootModeRelationship(p, d) @@ -9271,14 +9271,14 @@ func TestFlattenMapBootDeviceBootModeRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapBootDeviceBootModeRelationship(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} + expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapBootDeviceBootSecurityRelationship(t *testing.T) { p := models.BootDeviceBootSecurityRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenMapBootDeviceBootSecurityRelationship(p, d) @@ -9289,14 +9289,14 @@ func TestFlattenMapBootDeviceBootSecurityRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapBootDeviceBootSecurityRelationship(p, d)[0] - expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} + expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapBulkApiResult(t *testing.T) { p := models.BulkApiResult{} var d = &schema.ResourceData{} - c := `{"ObjectType":"bulk.ApiResult","ClassId":"bulk.ApiResult","Status":32}` + c := `{"Status":32,"ObjectType":"bulk.ApiResult","ClassId":"bulk.ApiResult"}` //test when the response is empty ffOpEmpty := flattenMapBulkApiResult(p, d) @@ -9307,7 +9307,7 @@ func TestFlattenMapBulkApiResult(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapBulkApiResult(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "bulk.ApiResult", "class_id": "bulk.ApiResult", "status": 32} + expectedOp := map[string]interface{}{"status": 32, "object_type": "bulk.ApiResult", "class_id": "bulk.ApiResult"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -9332,7 +9332,7 @@ func TestFlattenMapBulkExportRelationship(t *testing.T) { func TestFlattenMapBulkExportedItemRelationship(t *testing.T) { p := models.BulkExportedItemRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenMapBulkExportedItemRelationship(p, d) @@ -9343,14 +9343,14 @@ func TestFlattenMapBulkExportedItemRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapBulkExportedItemRelationship(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} + expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapBulkRequestRelationship(t *testing.T) { p := models.BulkRequestRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapBulkRequestRelationship(p, d) @@ -9361,14 +9361,14 @@ func TestFlattenMapBulkRequestRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapBulkRequestRelationship(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapCapabilitySwitchNetworkLimits(t *testing.T) { p := models.CapabilitySwitchNetworkLimits{} var d = &schema.ResourceData{} - c := `{"MaximumSecondaryVlan":32,"MaximumFcPortChannels":32,"MaximumEthernetPortChannels":32,"MaximumPortChannelMembers":32,"MaximumVifs":32,"MaximumActiveTrafficMonitoringSessions":32,"MaxUncompressedPortVlanCount":32,"MaximumFcPortChannelMembers":32,"MaxCompressedPortVlanCount":32,"ObjectType":"capability.SwitchNetworkLimits","MaximumEthernetUplinkPorts":32,"MaximumVlans":32,"MaximumSecondaryVlanPerPrimary":32,"ClassId":"capability.SwitchNetworkLimits","MaximumIgmpGroups":32,"MinimumActiveFans":32,"MaximumPrimaryVlan":32}` + c := `{"MaxUncompressedPortVlanCount":32,"MaximumEthernetUplinkPorts":32,"MaximumPortChannelMembers":32,"MaximumActiveTrafficMonitoringSessions":32,"MaximumSecondaryVlanPerPrimary":32,"MaximumFcPortChannels":32,"MaximumVlans":32,"MaximumEthernetPortChannels":32,"MaximumSecondaryVlan":32,"MaxCompressedPortVlanCount":32,"MaximumPrimaryVlan":32,"MaximumVifs":32,"MinimumActiveFans":32,"ObjectType":"capability.SwitchNetworkLimits","ClassId":"capability.SwitchNetworkLimits","MaximumFcPortChannelMembers":32,"MaximumIgmpGroups":32}` //test when the response is empty ffOpEmpty := flattenMapCapabilitySwitchNetworkLimits(p, d) @@ -9379,14 +9379,14 @@ func TestFlattenMapCapabilitySwitchNetworkLimits(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapCapabilitySwitchNetworkLimits(p, d)[0] - expectedOp := map[string]interface{}{"maximum_secondary_vlan": 32, "maximum_fc_port_channels": 32, "maximum_ethernet_port_channels": 32, "maximum_port_channel_members": 32, "maximum_vifs": 32, "maximum_active_traffic_monitoring_sessions": 32, "max_uncompressed_port_vlan_count": 32, "maximum_fc_port_channel_members": 32, "max_compressed_port_vlan_count": 32, "object_type": "capability.SwitchNetworkLimits", "maximum_ethernet_uplink_ports": 32, "maximum_vlans": 32, "maximum_secondary_vlan_per_primary": 32, "class_id": "capability.SwitchNetworkLimits", "maximum_igmp_groups": 32, "minimum_active_fans": 32, "maximum_primary_vlan": 32} + expectedOp := map[string]interface{}{"max_uncompressed_port_vlan_count": 32, "maximum_ethernet_uplink_ports": 32, "maximum_port_channel_members": 32, "maximum_active_traffic_monitoring_sessions": 32, "maximum_secondary_vlan_per_primary": 32, "maximum_fc_port_channels": 32, "maximum_vlans": 32, "maximum_ethernet_port_channels": 32, "maximum_secondary_vlan": 32, "max_compressed_port_vlan_count": 32, "maximum_primary_vlan": 32, "maximum_vifs": 32, "minimum_active_fans": 32, "object_type": "capability.SwitchNetworkLimits", "class_id": "capability.SwitchNetworkLimits", "maximum_fc_port_channel_members": 32, "maximum_igmp_groups": 32} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapCapabilitySwitchStorageLimits(t *testing.T) { p := models.CapabilitySwitchStorageLimits{} var d = &schema.ResourceData{} - c := `{"MaximumVsans":32,"MaximumZoneCount":32,"ObjectType":"capability.SwitchStorageLimits","ClassId":"capability.SwitchStorageLimits","MaximumUserZoneCount":32,"MaximumVirtualFcInterfaces":32,"MaximumVirtualFcInterfacesPerBladeServer":32}` + c := `{"MaximumVsans":32,"MaximumZoneCount":32,"MaximumUserZoneCount":32,"ObjectType":"capability.SwitchStorageLimits","ClassId":"capability.SwitchStorageLimits","MaximumVirtualFcInterfaces":32,"MaximumVirtualFcInterfacesPerBladeServer":32}` //test when the response is empty ffOpEmpty := flattenMapCapabilitySwitchStorageLimits(p, d) @@ -9397,14 +9397,14 @@ func TestFlattenMapCapabilitySwitchStorageLimits(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapCapabilitySwitchStorageLimits(p, d)[0] - expectedOp := map[string]interface{}{"maximum_vsans": 32, "maximum_zone_count": 32, "object_type": "capability.SwitchStorageLimits", "class_id": "capability.SwitchStorageLimits", "maximum_user_zone_count": 32, "maximum_virtual_fc_interfaces": 32, "maximum_virtual_fc_interfaces_per_blade_server": 32} + expectedOp := map[string]interface{}{"maximum_vsans": 32, "maximum_zone_count": 32, "maximum_user_zone_count": 32, "object_type": "capability.SwitchStorageLimits", "class_id": "capability.SwitchStorageLimits", "maximum_virtual_fc_interfaces": 32, "maximum_virtual_fc_interfaces_per_blade_server": 32} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapCapabilitySwitchSystemLimits(t *testing.T) { p := models.CapabilitySwitchSystemLimits{} var d = &schema.ResourceData{} - c := `{"ClassId":"capability.SwitchSystemLimits","MaximumChassisCount":32,"MaximumFexPerDomain":32,"MaximumServersPerDomain":32,"ObjectType":"capability.SwitchSystemLimits"}` + c := `{"ObjectType":"capability.SwitchSystemLimits","ClassId":"capability.SwitchSystemLimits","MaximumFexPerDomain":32,"MaximumServersPerDomain":32,"MaximumChassisCount":32}` //test when the response is empty ffOpEmpty := flattenMapCapabilitySwitchSystemLimits(p, d) @@ -9415,14 +9415,14 @@ func TestFlattenMapCapabilitySwitchSystemLimits(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapCapabilitySwitchSystemLimits(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "capability.SwitchSystemLimits", "maximum_chassis_count": 32, "maximum_fex_per_domain": 32, "maximum_servers_per_domain": 32, "object_type": "capability.SwitchSystemLimits"} + expectedOp := map[string]interface{}{"object_type": "capability.SwitchSystemLimits", "class_id": "capability.SwitchSystemLimits", "maximum_fex_per_domain": 32, "maximum_servers_per_domain": 32, "maximum_chassis_count": 32} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapCertificatemanagementCertificateBase(t *testing.T) { p := models.CertificatemanagementCertificateBase{} var d = &schema.ResourceData{} - c := `{"ClassId":"certificatemanagement.CertificateBase","ObjectType":"certificatemanagement.CertificateBase","Enabled":true,"IsPrivatekeySet":true}` + c := `{"Enabled":true,"IsPrivatekeySet":true,"ObjectType":"certificatemanagement.CertificateBase","ClassId":"certificatemanagement.CertificateBase"}` //test when the response is empty ffOpEmpty := flattenMapCertificatemanagementCertificateBase(p, d) @@ -9433,7 +9433,7 @@ func TestFlattenMapCertificatemanagementCertificateBase(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapCertificatemanagementCertificateBase(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "certificatemanagement.CertificateBase", "object_type": "certificatemanagement.CertificateBase", "enabled": true, "is_privatekey_set": true} + expectedOp := map[string]interface{}{"enabled": true, "is_privatekey_set": true, "object_type": "certificatemanagement.CertificateBase", "class_id": "certificatemanagement.CertificateBase"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -9476,7 +9476,7 @@ func TestFlattenMapChassisProfileRelationship(t *testing.T) { func TestFlattenMapCloudAvailabilityZone(t *testing.T) { p := models.CloudAvailabilityZone{} var d = &schema.ResourceData{} - c := `{"ObjectType":"cloud.AvailabilityZone","ClassId":"cloud.AvailabilityZone","Name":"Name %d","ZoneId":"ZoneId %d"}` + c := `{"ZoneId":"ZoneId %d","ObjectType":"cloud.AvailabilityZone","ClassId":"cloud.AvailabilityZone","Name":"Name %d"}` //test when the response is empty ffOpEmpty := flattenMapCloudAvailabilityZone(p, d) @@ -9487,14 +9487,14 @@ func TestFlattenMapCloudAvailabilityZone(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapCloudAvailabilityZone(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "cloud.AvailabilityZone", "class_id": "cloud.AvailabilityZone", "name": "Name 1", "zone_id": "ZoneId 1"} + expectedOp := map[string]interface{}{"zone_id": "ZoneId 1", "object_type": "cloud.AvailabilityZone", "class_id": "cloud.AvailabilityZone", "name": "Name 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapCloudAwsBillingUnitRelationship(t *testing.T) { p := models.CloudAwsBillingUnitRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapCloudAwsBillingUnitRelationship(p, d) @@ -9505,7 +9505,7 @@ func TestFlattenMapCloudAwsBillingUnitRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapCloudAwsBillingUnitRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -9530,7 +9530,7 @@ func TestFlattenMapCloudAwsKeyPairRelationship(t *testing.T) { func TestFlattenMapCloudAwsOrganizationalUnitRelationship(t *testing.T) { p := models.CloudAwsOrganizationalUnitRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapCloudAwsOrganizationalUnitRelationship(p, d) @@ -9541,7 +9541,7 @@ func TestFlattenMapCloudAwsOrganizationalUnitRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapCloudAwsOrganizationalUnitRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -9566,7 +9566,7 @@ func TestFlattenMapCloudAwsSubnetRelationship(t *testing.T) { func TestFlattenMapCloudAwsVpcRelationship(t *testing.T) { p := models.CloudAwsVpcRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenMapCloudAwsVpcRelationship(p, d) @@ -9577,14 +9577,14 @@ func TestFlattenMapCloudAwsVpcRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapCloudAwsVpcRelationship(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} + expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapCloudBaseSkuRelationship(t *testing.T) { p := models.CloudBaseSkuRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapCloudBaseSkuRelationship(p, d) @@ -9595,14 +9595,14 @@ func TestFlattenMapCloudBaseSkuRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapCloudBaseSkuRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapCloudBillingUnit(t *testing.T) { p := models.CloudBillingUnit{} var d = &schema.ResourceData{} - c := `{"ObjectType":"cloud.BillingUnit","ClassId":"cloud.BillingUnit","Name":"Name %d","BillingId":"BillingId %d"}` + c := `{"ObjectType":"cloud.BillingUnit","ClassId":"cloud.BillingUnit","BillingId":"BillingId %d","Name":"Name %d"}` //test when the response is empty ffOpEmpty := flattenMapCloudBillingUnit(p, d) @@ -9613,14 +9613,14 @@ func TestFlattenMapCloudBillingUnit(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapCloudBillingUnit(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "cloud.BillingUnit", "class_id": "cloud.BillingUnit", "name": "Name 1", "billing_id": "BillingId 1"} + expectedOp := map[string]interface{}{"object_type": "cloud.BillingUnit", "class_id": "cloud.BillingUnit", "billing_id": "BillingId 1", "name": "Name 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapCloudCloudRegion(t *testing.T) { p := models.CloudCloudRegion{} var d = &schema.ResourceData{} - c := `{"Name":"Name %d","RegionId":"RegionId %d","ObjectType":"cloud.CloudRegion","ClassId":"cloud.CloudRegion"}` + c := `{"ObjectType":"cloud.CloudRegion","ClassId":"cloud.CloudRegion","Name":"Name %d","RegionId":"RegionId %d"}` //test when the response is empty ffOpEmpty := flattenMapCloudCloudRegion(p, d) @@ -9631,14 +9631,14 @@ func TestFlattenMapCloudCloudRegion(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapCloudCloudRegion(p, d)[0] - expectedOp := map[string]interface{}{"name": "Name 1", "region_id": "RegionId 1", "object_type": "cloud.CloudRegion", "class_id": "cloud.CloudRegion"} + expectedOp := map[string]interface{}{"object_type": "cloud.CloudRegion", "class_id": "cloud.CloudRegion", "name": "Name 1", "region_id": "RegionId 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapCloudImageReference(t *testing.T) { p := models.CloudImageReference{} var d = &schema.ResourceData{} - c := `{"Name":"Name %d","ObjectType":"cloud.ImageReference","ClassId":"cloud.ImageReference","ImageId":"ImageId %d"}` + c := `{"ClassId":"cloud.ImageReference","ObjectType":"cloud.ImageReference","ImageId":"ImageId %d","Name":"Name %d"}` //test when the response is empty ffOpEmpty := flattenMapCloudImageReference(p, d) @@ -9649,14 +9649,14 @@ func TestFlattenMapCloudImageReference(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapCloudImageReference(p, d)[0] - expectedOp := map[string]interface{}{"name": "Name 1", "object_type": "cloud.ImageReference", "class_id": "cloud.ImageReference", "image_id": "ImageId 1"} + expectedOp := map[string]interface{}{"class_id": "cloud.ImageReference", "object_type": "cloud.ImageReference", "image_id": "ImageId 1", "name": "Name 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapCloudInstanceType(t *testing.T) { p := models.CloudInstanceType{} var d = &schema.ResourceData{} - c := `{"Architecture":"Architecture %d","CpuSpeed":32,"Memory":32,"Name":"Name %d","InstanceTypeId":"InstanceTypeId %d","ObjectType":"cloud.InstanceType","ClassId":"cloud.InstanceType","Cpus":32,"Platform":"Platform %d"}` + c := `{"CpuSpeed":32,"Memory":32,"Cpus":32,"InstanceTypeId":"InstanceTypeId %d","ObjectType":"cloud.InstanceType","ClassId":"cloud.InstanceType","Platform":"Platform %d","Architecture":"Architecture %d","Name":"Name %d"}` //test when the response is empty ffOpEmpty := flattenMapCloudInstanceType(p, d) @@ -9667,7 +9667,7 @@ func TestFlattenMapCloudInstanceType(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapCloudInstanceType(p, d)[0] - expectedOp := map[string]interface{}{"architecture": "Architecture 1", "cpu_speed": 32, "memory": 32, "name": "Name 1", "instance_type_id": "InstanceTypeId 1", "object_type": "cloud.InstanceType", "class_id": "cloud.InstanceType", "cpus": 32, "platform": "Platform 1"} + expectedOp := map[string]interface{}{"cpu_speed": 32, "memory": 32, "cpus": 32, "instance_type_id": "InstanceTypeId 1", "object_type": "cloud.InstanceType", "class_id": "cloud.InstanceType", "platform": "Platform 1", "architecture": "Architecture 1", "name": "Name 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -9692,7 +9692,7 @@ func TestFlattenMapCloudNetworkInstanceAttachment(t *testing.T) { func TestFlattenMapCloudRegionsRelationship(t *testing.T) { p := models.CloudRegionsRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapCloudRegionsRelationship(p, d) @@ -9703,14 +9703,14 @@ func TestFlattenMapCloudRegionsRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapCloudRegionsRelationship(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapCloudTfcOrganizationRelationship(t *testing.T) { p := models.CloudTfcOrganizationRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapCloudTfcOrganizationRelationship(p, d) @@ -9721,14 +9721,14 @@ func TestFlattenMapCloudTfcOrganizationRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapCloudTfcOrganizationRelationship(p, d)[0] - expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} + expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapCloudVolumeIopsInfo(t *testing.T) { p := models.CloudVolumeIopsInfo{} var d = &schema.ResourceData{} - c := `{"ThroughputReadLimit":32,"ThroughputWriteLimit":32,"IopsReadLimit":32,"IopsWriteLimit":32,"ObjectType":"cloud.VolumeIopsInfo","ClassId":"cloud.VolumeIopsInfo"}` + c := `{"ObjectType":"cloud.VolumeIopsInfo","ClassId":"cloud.VolumeIopsInfo","IopsWriteLimit":32,"ThroughputReadLimit":32,"ThroughputWriteLimit":32,"IopsReadLimit":32}` //test when the response is empty ffOpEmpty := flattenMapCloudVolumeIopsInfo(p, d) @@ -9739,7 +9739,7 @@ func TestFlattenMapCloudVolumeIopsInfo(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapCloudVolumeIopsInfo(p, d)[0] - expectedOp := map[string]interface{}{"throughput_read_limit": 32, "throughput_write_limit": 32, "iops_read_limit": 32, "iops_write_limit": 32, "object_type": "cloud.VolumeIopsInfo", "class_id": "cloud.VolumeIopsInfo"} + expectedOp := map[string]interface{}{"object_type": "cloud.VolumeIopsInfo", "class_id": "cloud.VolumeIopsInfo", "iops_write_limit": 32, "throughput_read_limit": 32, "throughput_write_limit": 32, "iops_read_limit": 32} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -9764,7 +9764,7 @@ func TestFlattenMapCloudVolumeType(t *testing.T) { func TestFlattenMapCommHttpProxyPolicyRelationship(t *testing.T) { p := models.CommHttpProxyPolicyRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenMapCommHttpProxyPolicyRelationship(p, d) @@ -9775,14 +9775,14 @@ func TestFlattenMapCommHttpProxyPolicyRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapCommHttpProxyPolicyRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapCommIpV4Interface(t *testing.T) { p := models.CommIpV4Interface{} var d = &schema.ResourceData{} - c := `{"Netmask":"Netmask %d","ObjectType":"comm.IpV4Interface","ClassId":"comm.IpV4Interface","Gateway":"Gateway %d","IpAddress":"IpAddress %d"}` + c := `{"ObjectType":"comm.IpV4Interface","Gateway":"Gateway %d","IpAddress":"IpAddress %d","Netmask":"Netmask %d","ClassId":"comm.IpV4Interface"}` //test when the response is empty ffOpEmpty := flattenMapCommIpV4Interface(p, d) @@ -9793,14 +9793,14 @@ func TestFlattenMapCommIpV4Interface(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapCommIpV4Interface(p, d)[0] - expectedOp := map[string]interface{}{"netmask": "Netmask 1", "object_type": "comm.IpV4Interface", "class_id": "comm.IpV4Interface", "gateway": "Gateway 1", "ip_address": "IpAddress 1"} + expectedOp := map[string]interface{}{"object_type": "comm.IpV4Interface", "gateway": "Gateway 1", "ip_address": "IpAddress 1", "netmask": "Netmask 1", "class_id": "comm.IpV4Interface"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapCommIpV6Interface(t *testing.T) { p := models.CommIpV6Interface{} var d = &schema.ResourceData{} - c := `{"Prefix":"Prefix %d","ObjectType":"comm.IpV6Interface","ClassId":"comm.IpV6Interface","Gateway":"Gateway %d","IpAddress":"IpAddress %d"}` + c := `{"Gateway":"Gateway %d","IpAddress":"IpAddress %d","Prefix":"Prefix %d","ObjectType":"comm.IpV6Interface","ClassId":"comm.IpV6Interface"}` //test when the response is empty ffOpEmpty := flattenMapCommIpV6Interface(p, d) @@ -9811,14 +9811,14 @@ func TestFlattenMapCommIpV6Interface(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapCommIpV6Interface(p, d)[0] - expectedOp := map[string]interface{}{"prefix": "Prefix 1", "object_type": "comm.IpV6Interface", "class_id": "comm.IpV6Interface", "gateway": "Gateway 1", "ip_address": "IpAddress 1"} + expectedOp := map[string]interface{}{"gateway": "Gateway 1", "ip_address": "IpAddress 1", "prefix": "Prefix 1", "object_type": "comm.IpV6Interface", "class_id": "comm.IpV6Interface"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapComputeAlarmSummary(t *testing.T) { p := models.ComputeAlarmSummary{} var d = &schema.ResourceData{} - c := `{"ObjectType":"compute.AlarmSummary","ClassId":"compute.AlarmSummary","Warning":32,"Critical":32}` + c := `{"Warning":32,"ObjectType":"compute.AlarmSummary","ClassId":"compute.AlarmSummary","Critical":32}` //test when the response is empty ffOpEmpty := flattenMapComputeAlarmSummary(p, d) @@ -9829,14 +9829,14 @@ func TestFlattenMapComputeAlarmSummary(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapComputeAlarmSummary(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "compute.AlarmSummary", "class_id": "compute.AlarmSummary", "warning": 32, "critical": 32} + expectedOp := map[string]interface{}{"warning": 32, "object_type": "compute.AlarmSummary", "class_id": "compute.AlarmSummary", "critical": 32} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapComputeBaseClusterRelationship(t *testing.T) { p := models.ComputeBaseClusterRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenMapComputeBaseClusterRelationship(p, d) @@ -9847,7 +9847,7 @@ func TestFlattenMapComputeBaseClusterRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapComputeBaseClusterRelationship(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} + expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -9890,7 +9890,7 @@ func TestFlattenMapComputeBoardRelationship(t *testing.T) { func TestFlattenMapComputePersistentMemoryOperation(t *testing.T) { p := models.ComputePersistentMemoryOperation{} var d = &schema.ResourceData{} - c := `{"ObjectType":"compute.PersistentMemoryOperation","ClassId":"compute.PersistentMemoryOperation","AdminAction":"AdminAction %d","IsSecurePassphraseSet":true}` + c := `{"ObjectType":"compute.PersistentMemoryOperation","ClassId":"compute.PersistentMemoryOperation","IsSecurePassphraseSet":true,"AdminAction":"AdminAction %d"}` //test when the response is empty ffOpEmpty := flattenMapComputePersistentMemoryOperation(p, d) @@ -9901,14 +9901,14 @@ func TestFlattenMapComputePersistentMemoryOperation(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapComputePersistentMemoryOperation(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "compute.PersistentMemoryOperation", "class_id": "compute.PersistentMemoryOperation", "admin_action": "AdminAction 1", "is_secure_passphrase_set": true} + expectedOp := map[string]interface{}{"object_type": "compute.PersistentMemoryOperation", "class_id": "compute.PersistentMemoryOperation", "is_secure_passphrase_set": true, "admin_action": "AdminAction 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapComputePhysicalRelationship(t *testing.T) { p := models.ComputePhysicalRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenMapComputePhysicalRelationship(p, d) @@ -9919,7 +9919,7 @@ func TestFlattenMapComputePhysicalRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapComputePhysicalRelationship(p, d)[0] - expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} + expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -9944,7 +9944,7 @@ func TestFlattenMapComputePhysicalSummaryRelationship(t *testing.T) { func TestFlattenMapComputeRackUnitRelationship(t *testing.T) { p := models.ComputeRackUnitRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenMapComputeRackUnitRelationship(p, d) @@ -9955,7 +9955,7 @@ func TestFlattenMapComputeRackUnitRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapComputeRackUnitRelationship(p, d)[0] - expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} + expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -9980,7 +9980,7 @@ func TestFlattenMapComputeServerConfig(t *testing.T) { func TestFlattenMapComputeStorageControllerOperation(t *testing.T) { p := models.ComputeStorageControllerOperation{} var d = &schema.ResourceData{} - c := `{"ControllerId":"ControllerId %d","ClassId":"compute.StorageControllerOperation","ObjectType":"compute.StorageControllerOperation","AdminAction":"AdminAction %d"}` + c := `{"ObjectType":"compute.StorageControllerOperation","ClassId":"compute.StorageControllerOperation","AdminAction":"AdminAction %d","ControllerId":"ControllerId %d"}` //test when the response is empty ffOpEmpty := flattenMapComputeStorageControllerOperation(p, d) @@ -9991,14 +9991,14 @@ func TestFlattenMapComputeStorageControllerOperation(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapComputeStorageControllerOperation(p, d)[0] - expectedOp := map[string]interface{}{"controller_id": "ControllerId 1", "class_id": "compute.StorageControllerOperation", "object_type": "compute.StorageControllerOperation", "admin_action": "AdminAction 1"} + expectedOp := map[string]interface{}{"object_type": "compute.StorageControllerOperation", "class_id": "compute.StorageControllerOperation", "admin_action": "AdminAction 1", "controller_id": "ControllerId 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapComputeStoragePhysicalDriveOperation(t *testing.T) { p := models.ComputeStoragePhysicalDriveOperation{} var d = &schema.ResourceData{} - c := `{"AdminAction":"AdminAction %d","ControllerId":"ControllerId %d","ClassId":"compute.StoragePhysicalDriveOperation","ObjectType":"compute.StoragePhysicalDriveOperation"}` + c := `{"ObjectType":"compute.StoragePhysicalDriveOperation","ClassId":"compute.StoragePhysicalDriveOperation","AdminAction":"AdminAction %d","ControllerId":"ControllerId %d"}` //test when the response is empty ffOpEmpty := flattenMapComputeStoragePhysicalDriveOperation(p, d) @@ -10009,7 +10009,7 @@ func TestFlattenMapComputeStoragePhysicalDriveOperation(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapComputeStoragePhysicalDriveOperation(p, d)[0] - expectedOp := map[string]interface{}{"admin_action": "AdminAction 1", "controller_id": "ControllerId 1", "class_id": "compute.StoragePhysicalDriveOperation", "object_type": "compute.StoragePhysicalDriveOperation"} + expectedOp := map[string]interface{}{"object_type": "compute.StoragePhysicalDriveOperation", "class_id": "compute.StoragePhysicalDriveOperation", "admin_action": "AdminAction 1", "controller_id": "ControllerId 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -10034,7 +10034,7 @@ func TestFlattenMapComputeStorageVirtualDriveOperation(t *testing.T) { func TestFlattenMapComputeVmediaRelationship(t *testing.T) { p := models.ComputeVmediaRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapComputeVmediaRelationship(p, d) @@ -10045,14 +10045,14 @@ func TestFlattenMapComputeVmediaRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapComputeVmediaRelationship(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapCondAlarmSummary(t *testing.T) { p := models.CondAlarmSummary{} var d = &schema.ResourceData{} - c := `{"ClassId":"cond.AlarmSummary","ObjectType":"cond.AlarmSummary","Critical":32,"Warning":32}` + c := `{"Critical":32,"Warning":32,"ObjectType":"cond.AlarmSummary","ClassId":"cond.AlarmSummary"}` //test when the response is empty ffOpEmpty := flattenMapCondAlarmSummary(p, d) @@ -10063,7 +10063,7 @@ func TestFlattenMapCondAlarmSummary(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapCondAlarmSummary(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "cond.AlarmSummary", "object_type": "cond.AlarmSummary", "critical": 32, "warning": 32} + expectedOp := map[string]interface{}{"critical": 32, "warning": 32, "object_type": "cond.AlarmSummary", "class_id": "cond.AlarmSummary"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -10088,7 +10088,7 @@ func TestFlattenMapCondHclStatusRelationship(t *testing.T) { func TestFlattenMapConnectorFileChecksum(t *testing.T) { p := models.ConnectorFileChecksum{} var d = &schema.ResourceData{} - c := `{"HashAlgorithm":"HashAlgorithm %d","ObjectType":"connector.FileChecksum","ClassId":"connector.FileChecksum"}` + c := `{"ObjectType":"connector.FileChecksum","ClassId":"connector.FileChecksum","HashAlgorithm":"HashAlgorithm %d"}` //test when the response is empty ffOpEmpty := flattenMapConnectorFileChecksum(p, d) @@ -10099,7 +10099,7 @@ func TestFlattenMapConnectorFileChecksum(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapConnectorFileChecksum(p, d)[0] - expectedOp := map[string]interface{}{"hash_algorithm": "HashAlgorithm 1", "object_type": "connector.FileChecksum", "class_id": "connector.FileChecksum"} + expectedOp := map[string]interface{}{"object_type": "connector.FileChecksum", "class_id": "connector.FileChecksum", "hash_algorithm": "HashAlgorithm 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -10124,7 +10124,7 @@ func TestFlattenMapConnectorPlatformParamBase(t *testing.T) { func TestFlattenMapConvergedinfraHealthCheckDefinitionRelationship(t *testing.T) { p := models.ConvergedinfraHealthCheckDefinitionRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapConvergedinfraHealthCheckDefinitionRelationship(p, d) @@ -10135,14 +10135,14 @@ func TestFlattenMapConvergedinfraHealthCheckDefinitionRelationship(t *testing.T) err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapConvergedinfraHealthCheckDefinitionRelationship(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapConvergedinfraPodSummary(t *testing.T) { p := models.ConvergedinfraPodSummary{} var d = &schema.ResourceData{} - c := `{"VmCount":32,"StorageAvailable":32,"StorageCapacity":32,"NodeCount":32,"ObjectType":"convergedinfra.PodSummary","ActiveNodes":32,"StorageUtilization":32.000000,"ClassId":"convergedinfra.PodSummary"}` + c := `{"StorageCapacity":32,"ClassId":"convergedinfra.PodSummary","VmCount":32,"ActiveNodes":32,"StorageUtilization":32.000000,"NodeCount":32,"ObjectType":"convergedinfra.PodSummary","StorageAvailable":32}` //test when the response is empty ffOpEmpty := flattenMapConvergedinfraPodSummary(p, d) @@ -10153,7 +10153,7 @@ func TestFlattenMapConvergedinfraPodSummary(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapConvergedinfraPodSummary(p, d)[0] - expectedOp := map[string]interface{}{"vm_count": 32, "storage_available": 32, "storage_capacity": 32, "node_count": 32, "object_type": "convergedinfra.PodSummary", "active_nodes": 32, "storage_utilization": 32.000000, "class_id": "convergedinfra.PodSummary"} + expectedOp := map[string]interface{}{"storage_capacity": 32, "class_id": "convergedinfra.PodSummary", "vm_count": 32, "active_nodes": 32, "storage_utilization": 32.000000, "node_count": 32, "object_type": "convergedinfra.PodSummary", "storage_available": 32} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -10178,7 +10178,7 @@ func TestFlattenMapEquipmentBaseRelationship(t *testing.T) { func TestFlattenMapEquipmentChassisRelationship(t *testing.T) { p := models.EquipmentChassisRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenMapEquipmentChassisRelationship(p, d) @@ -10189,14 +10189,14 @@ func TestFlattenMapEquipmentChassisRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapEquipmentChassisRelationship(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} + expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapEquipmentExpanderModuleRelationship(t *testing.T) { p := models.EquipmentExpanderModuleRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapEquipmentExpanderModuleRelationship(p, d) @@ -10207,14 +10207,14 @@ func TestFlattenMapEquipmentExpanderModuleRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapEquipmentExpanderModuleRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapEquipmentFanControlRelationship(t *testing.T) { p := models.EquipmentFanControlRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapEquipmentFanControlRelationship(p, d) @@ -10225,14 +10225,14 @@ func TestFlattenMapEquipmentFanControlRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapEquipmentFanControlRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapEquipmentFanModuleRelationship(t *testing.T) { p := models.EquipmentFanModuleRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenMapEquipmentFanModuleRelationship(p, d) @@ -10243,14 +10243,14 @@ func TestFlattenMapEquipmentFanModuleRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapEquipmentFanModuleRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapEquipmentFexRelationship(t *testing.T) { p := models.EquipmentFexRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapEquipmentFexRelationship(p, d) @@ -10261,14 +10261,14 @@ func TestFlattenMapEquipmentFexRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapEquipmentFexRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapEquipmentFruRelationship(t *testing.T) { p := models.EquipmentFruRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapEquipmentFruRelationship(p, d) @@ -10279,14 +10279,14 @@ func TestFlattenMapEquipmentFruRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapEquipmentFruRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapEquipmentIoCardRelationship(t *testing.T) { p := models.EquipmentIoCardRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapEquipmentIoCardRelationship(p, d) @@ -10297,14 +10297,14 @@ func TestFlattenMapEquipmentIoCardRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapEquipmentIoCardRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapEquipmentIoCardBaseRelationship(t *testing.T) { p := models.EquipmentIoCardBaseRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenMapEquipmentIoCardBaseRelationship(p, d) @@ -10315,14 +10315,14 @@ func TestFlattenMapEquipmentIoCardBaseRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapEquipmentIoCardBaseRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapEquipmentLocatorLedRelationship(t *testing.T) { p := models.EquipmentLocatorLedRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenMapEquipmentLocatorLedRelationship(p, d) @@ -10333,14 +10333,14 @@ func TestFlattenMapEquipmentLocatorLedRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapEquipmentLocatorLedRelationship(p, d)[0] - expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} + expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapEquipmentPhysicalIdentityRelationship(t *testing.T) { p := models.EquipmentPhysicalIdentityRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapEquipmentPhysicalIdentityRelationship(p, d) @@ -10351,14 +10351,14 @@ func TestFlattenMapEquipmentPhysicalIdentityRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapEquipmentPhysicalIdentityRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapEquipmentPsuControlRelationship(t *testing.T) { p := models.EquipmentPsuControlRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenMapEquipmentPsuControlRelationship(p, d) @@ -10369,14 +10369,14 @@ func TestFlattenMapEquipmentPsuControlRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapEquipmentPsuControlRelationship(p, d)[0] - expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} + expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapEquipmentRackEnclosureRelationship(t *testing.T) { p := models.EquipmentRackEnclosureRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapEquipmentRackEnclosureRelationship(p, d) @@ -10387,7 +10387,7 @@ func TestFlattenMapEquipmentRackEnclosureRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapEquipmentRackEnclosureRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -10412,7 +10412,7 @@ func TestFlattenMapEquipmentRackEnclosureSlotRelationship(t *testing.T) { func TestFlattenMapEquipmentSharedIoModuleRelationship(t *testing.T) { p := models.EquipmentSharedIoModuleRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenMapEquipmentSharedIoModuleRelationship(p, d) @@ -10423,14 +10423,14 @@ func TestFlattenMapEquipmentSharedIoModuleRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapEquipmentSharedIoModuleRelationship(p, d)[0] - expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} + expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapEquipmentSwitchCardRelationship(t *testing.T) { p := models.EquipmentSwitchCardRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapEquipmentSwitchCardRelationship(p, d) @@ -10441,14 +10441,14 @@ func TestFlattenMapEquipmentSwitchCardRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapEquipmentSwitchCardRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapEquipmentSystemIoControllerRelationship(t *testing.T) { p := models.EquipmentSystemIoControllerRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenMapEquipmentSystemIoControllerRelationship(p, d) @@ -10459,14 +10459,14 @@ func TestFlattenMapEquipmentSystemIoControllerRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapEquipmentSystemIoControllerRelationship(p, d)[0] - expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} + expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapEtherPhysicalPortRelationship(t *testing.T) { p := models.EtherPhysicalPortRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenMapEtherPhysicalPortRelationship(p, d) @@ -10477,7 +10477,7 @@ func TestFlattenMapEtherPhysicalPortRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapEtherPhysicalPortRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -10520,7 +10520,7 @@ func TestFlattenMapFabricConfigResultRelationship(t *testing.T) { func TestFlattenMapFabricEthNetworkControlPolicyRelationship(t *testing.T) { p := models.FabricEthNetworkControlPolicyRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapFabricEthNetworkControlPolicyRelationship(p, d) @@ -10531,14 +10531,14 @@ func TestFlattenMapFabricEthNetworkControlPolicyRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapFabricEthNetworkControlPolicyRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapFabricEthNetworkGroupPolicyRelationship(t *testing.T) { p := models.FabricEthNetworkGroupPolicyRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapFabricEthNetworkGroupPolicyRelationship(p, d) @@ -10549,14 +10549,14 @@ func TestFlattenMapFabricEthNetworkGroupPolicyRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapFabricEthNetworkGroupPolicyRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapFabricEthNetworkPolicyRelationship(t *testing.T) { p := models.FabricEthNetworkPolicyRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenMapFabricEthNetworkPolicyRelationship(p, d) @@ -10567,14 +10567,14 @@ func TestFlattenMapFabricEthNetworkPolicyRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapFabricEthNetworkPolicyRelationship(p, d)[0] - expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} + expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapFabricFcNetworkPolicyRelationship(t *testing.T) { p := models.FabricFcNetworkPolicyRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapFabricFcNetworkPolicyRelationship(p, d) @@ -10585,14 +10585,14 @@ func TestFlattenMapFabricFcNetworkPolicyRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapFabricFcNetworkPolicyRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapFabricFlowControlPolicyRelationship(t *testing.T) { p := models.FabricFlowControlPolicyRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapFabricFlowControlPolicyRelationship(p, d) @@ -10603,7 +10603,7 @@ func TestFlattenMapFabricFlowControlPolicyRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapFabricFlowControlPolicyRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -10628,7 +10628,7 @@ func TestFlattenMapFabricLinkAggregationPolicyRelationship(t *testing.T) { func TestFlattenMapFabricLinkControlPolicyRelationship(t *testing.T) { p := models.FabricLinkControlPolicyRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapFabricLinkControlPolicyRelationship(p, d) @@ -10639,14 +10639,14 @@ func TestFlattenMapFabricLinkControlPolicyRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapFabricLinkControlPolicyRelationship(p, d)[0] - expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} + expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapFabricLldpSettings(t *testing.T) { p := models.FabricLldpSettings{} var d = &schema.ResourceData{} - c := `{"ObjectType":"fabric.LldpSettings","ClassId":"fabric.LldpSettings","ReceiveEnabled":true,"TransmitEnabled":true}` + c := `{"ClassId":"fabric.LldpSettings","TransmitEnabled":true,"ReceiveEnabled":true,"ObjectType":"fabric.LldpSettings"}` //test when the response is empty ffOpEmpty := flattenMapFabricLldpSettings(p, d) @@ -10657,14 +10657,14 @@ func TestFlattenMapFabricLldpSettings(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapFabricLldpSettings(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "fabric.LldpSettings", "class_id": "fabric.LldpSettings", "receive_enabled": true, "transmit_enabled": true} + expectedOp := map[string]interface{}{"class_id": "fabric.LldpSettings", "transmit_enabled": true, "receive_enabled": true, "object_type": "fabric.LldpSettings"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapFabricMacAgingSettings(t *testing.T) { p := models.FabricMacAgingSettings{} var d = &schema.ResourceData{} - c := `{"ClassId":"fabric.MacAgingSettings","ObjectType":"fabric.MacAgingSettings","MacAgingOption":"MacAgingOption %d","MacAgingTime":32}` + c := `{"ClassId":"fabric.MacAgingSettings","ObjectType":"fabric.MacAgingSettings","MacAgingTime":32,"MacAgingOption":"MacAgingOption %d"}` //test when the response is empty ffOpEmpty := flattenMapFabricMacAgingSettings(p, d) @@ -10675,14 +10675,14 @@ func TestFlattenMapFabricMacAgingSettings(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapFabricMacAgingSettings(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "fabric.MacAgingSettings", "object_type": "fabric.MacAgingSettings", "mac_aging_option": "MacAgingOption 1", "mac_aging_time": 32} + expectedOp := map[string]interface{}{"class_id": "fabric.MacAgingSettings", "object_type": "fabric.MacAgingSettings", "mac_aging_time": 32, "mac_aging_option": "MacAgingOption 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapFabricMulticastPolicyRelationship(t *testing.T) { p := models.FabricMulticastPolicyRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenMapFabricMulticastPolicyRelationship(p, d) @@ -10693,7 +10693,7 @@ func TestFlattenMapFabricMulticastPolicyRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapFabricMulticastPolicyRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -10718,7 +10718,7 @@ func TestFlattenMapFabricPortPolicyRelationship(t *testing.T) { func TestFlattenMapFabricSwitchClusterProfileRelationship(t *testing.T) { p := models.FabricSwitchClusterProfileRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapFabricSwitchClusterProfileRelationship(p, d) @@ -10729,14 +10729,14 @@ func TestFlattenMapFabricSwitchClusterProfileRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapFabricSwitchClusterProfileRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapFabricSwitchProfileRelationship(t *testing.T) { p := models.FabricSwitchProfileRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapFabricSwitchProfileRelationship(p, d) @@ -10747,14 +10747,14 @@ func TestFlattenMapFabricSwitchProfileRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapFabricSwitchProfileRelationship(p, d)[0] - expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} + expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapFabricUdldGlobalSettings(t *testing.T) { p := models.FabricUdldGlobalSettings{} var d = &schema.ResourceData{} - c := `{"ObjectType":"fabric.UdldGlobalSettings","ClassId":"fabric.UdldGlobalSettings","MessageInterval":32,"RecoveryAction":"RecoveryAction %d"}` + c := `{"MessageInterval":32,"RecoveryAction":"RecoveryAction %d","ObjectType":"fabric.UdldGlobalSettings","ClassId":"fabric.UdldGlobalSettings"}` //test when the response is empty ffOpEmpty := flattenMapFabricUdldGlobalSettings(p, d) @@ -10765,14 +10765,14 @@ func TestFlattenMapFabricUdldGlobalSettings(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapFabricUdldGlobalSettings(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "fabric.UdldGlobalSettings", "class_id": "fabric.UdldGlobalSettings", "message_interval": 32, "recovery_action": "RecoveryAction 1"} + expectedOp := map[string]interface{}{"message_interval": 32, "recovery_action": "RecoveryAction 1", "object_type": "fabric.UdldGlobalSettings", "class_id": "fabric.UdldGlobalSettings"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapFabricUdldSettings(t *testing.T) { p := models.FabricUdldSettings{} var d = &schema.ResourceData{} - c := `{"AdminState":"AdminState %d","Mode":"Mode %d","ObjectType":"fabric.UdldSettings","ClassId":"fabric.UdldSettings"}` + c := `{"ObjectType":"fabric.UdldSettings","ClassId":"fabric.UdldSettings","AdminState":"AdminState %d","Mode":"Mode %d"}` //test when the response is empty ffOpEmpty := flattenMapFabricUdldSettings(p, d) @@ -10783,14 +10783,14 @@ func TestFlattenMapFabricUdldSettings(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapFabricUdldSettings(p, d)[0] - expectedOp := map[string]interface{}{"admin_state": "AdminState 1", "mode": "Mode 1", "object_type": "fabric.UdldSettings", "class_id": "fabric.UdldSettings"} + expectedOp := map[string]interface{}{"object_type": "fabric.UdldSettings", "class_id": "fabric.UdldSettings", "admin_state": "AdminState 1", "mode": "Mode 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapFabricVlanSettings(t *testing.T) { p := models.FabricVlanSettings{} var d = &schema.ResourceData{} - c := `{"AllowedVlans":"AllowedVlans %d","NativeVlan":32,"ObjectType":"fabric.VlanSettings","ClassId":"fabric.VlanSettings"}` + c := `{"ObjectType":"fabric.VlanSettings","ClassId":"fabric.VlanSettings","AllowedVlans":"AllowedVlans %d","NativeVlan":32}` //test when the response is empty ffOpEmpty := flattenMapFabricVlanSettings(p, d) @@ -10801,14 +10801,14 @@ func TestFlattenMapFabricVlanSettings(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapFabricVlanSettings(p, d)[0] - expectedOp := map[string]interface{}{"allowed_vlans": "AllowedVlans 1", "native_vlan": 32, "object_type": "fabric.VlanSettings", "class_id": "fabric.VlanSettings"} + expectedOp := map[string]interface{}{"object_type": "fabric.VlanSettings", "class_id": "fabric.VlanSettings", "allowed_vlans": "AllowedVlans 1", "native_vlan": 32} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapFcpoolBlock(t *testing.T) { p := models.FcpoolBlock{} var d = &schema.ResourceData{} - c := `{"ClassId":"fcpool.Block","Size":32,"To":"To %d","From":"From %d","ObjectType":"fcpool.Block"}` + c := `{"To":"To %d","From":"From %d","ObjectType":"fcpool.Block","ClassId":"fcpool.Block","Size":32}` //test when the response is empty ffOpEmpty := flattenMapFcpoolBlock(p, d) @@ -10819,14 +10819,14 @@ func TestFlattenMapFcpoolBlock(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapFcpoolBlock(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "fcpool.Block", "size": 32, "to": "To 1", "from": "From 1", "object_type": "fcpool.Block"} + expectedOp := map[string]interface{}{"to": "To 1", "from": "From 1", "object_type": "fcpool.Block", "class_id": "fcpool.Block", "size": 32} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapFcpoolFcBlockRelationship(t *testing.T) { p := models.FcpoolFcBlockRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapFcpoolFcBlockRelationship(p, d) @@ -10837,14 +10837,14 @@ func TestFlattenMapFcpoolFcBlockRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapFcpoolFcBlockRelationship(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapFcpoolLeaseRelationship(t *testing.T) { p := models.FcpoolLeaseRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapFcpoolLeaseRelationship(p, d) @@ -10855,14 +10855,14 @@ func TestFlattenMapFcpoolLeaseRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapFcpoolLeaseRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapFcpoolPoolRelationship(t *testing.T) { p := models.FcpoolPoolRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapFcpoolPoolRelationship(p, d) @@ -10873,14 +10873,14 @@ func TestFlattenMapFcpoolPoolRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapFcpoolPoolRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapFcpoolPoolMemberRelationship(t *testing.T) { p := models.FcpoolPoolMemberRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapFcpoolPoolMemberRelationship(p, d) @@ -10891,14 +10891,14 @@ func TestFlattenMapFcpoolPoolMemberRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapFcpoolPoolMemberRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapFcpoolUniverseRelationship(t *testing.T) { p := models.FcpoolUniverseRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenMapFcpoolUniverseRelationship(p, d) @@ -10909,14 +10909,14 @@ func TestFlattenMapFcpoolUniverseRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapFcpoolUniverseRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapFirmwareBaseDistributableRelationship(t *testing.T) { p := models.FirmwareBaseDistributableRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenMapFirmwareBaseDistributableRelationship(p, d) @@ -10927,14 +10927,14 @@ func TestFlattenMapFirmwareBaseDistributableRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapFirmwareBaseDistributableRelationship(p, d)[0] - expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} + expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapFirmwareDirectDownload(t *testing.T) { p := models.FirmwareDirectDownload{} var d = &schema.ResourceData{} - c := `{"ImageSource":"ImageSource %d","Upgradeoption":"Upgradeoption %d","ClassId":"firmware.DirectDownload","ObjectType":"firmware.DirectDownload","Username":"Username %d","IsPasswordSet":true}` + c := `{"ClassId":"firmware.DirectDownload","Upgradeoption":"Upgradeoption %d","IsPasswordSet":true,"ImageSource":"ImageSource %d","ObjectType":"firmware.DirectDownload","Username":"Username %d"}` //test when the response is empty ffOpEmpty := flattenMapFirmwareDirectDownload(p, d) @@ -10945,14 +10945,14 @@ func TestFlattenMapFirmwareDirectDownload(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapFirmwareDirectDownload(p, d)[0] - expectedOp := map[string]interface{}{"image_source": "ImageSource 1", "upgradeoption": "Upgradeoption 1", "class_id": "firmware.DirectDownload", "object_type": "firmware.DirectDownload", "username": "Username 1", "is_password_set": true} + expectedOp := map[string]interface{}{"class_id": "firmware.DirectDownload", "upgradeoption": "Upgradeoption 1", "is_password_set": true, "image_source": "ImageSource 1", "object_type": "firmware.DirectDownload", "username": "Username 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapFirmwareDistributableRelationship(t *testing.T) { p := models.FirmwareDistributableRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapFirmwareDistributableRelationship(p, d) @@ -10963,14 +10963,14 @@ func TestFlattenMapFirmwareDistributableRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapFirmwareDistributableRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapFirmwareExcludeComponentPidListType(t *testing.T) { p := models.FirmwareExcludeComponentPidListType{} var d = &schema.ResourceData{} - c := `{"ClassId":"firmware.ExcludeComponentPidListType","ObjectType":"firmware.ExcludeComponentPidListType"}` + c := `{"ObjectType":"firmware.ExcludeComponentPidListType","ClassId":"firmware.ExcludeComponentPidListType"}` //test when the response is empty ffOpEmpty := flattenMapFirmwareExcludeComponentPidListType(p, d) @@ -10981,14 +10981,14 @@ func TestFlattenMapFirmwareExcludeComponentPidListType(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapFirmwareExcludeComponentPidListType(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "firmware.ExcludeComponentPidListType", "object_type": "firmware.ExcludeComponentPidListType"} + expectedOp := map[string]interface{}{"object_type": "firmware.ExcludeComponentPidListType", "class_id": "firmware.ExcludeComponentPidListType"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapFirmwareNetworkShare(t *testing.T) { p := models.FirmwareNetworkShare{} var d = &schema.ResourceData{} - c := `{"ObjectType":"firmware.NetworkShare","IsPasswordSet":true,"MapType":"MapType %d","Username":"Username %d","Upgradeoption":"Upgradeoption %d","ClassId":"firmware.NetworkShare"}` + c := `{"MapType":"MapType %d","Username":"Username %d","ObjectType":"firmware.NetworkShare","ClassId":"firmware.NetworkShare","IsPasswordSet":true,"Upgradeoption":"Upgradeoption %d"}` //test when the response is empty ffOpEmpty := flattenMapFirmwareNetworkShare(p, d) @@ -10999,14 +10999,14 @@ func TestFlattenMapFirmwareNetworkShare(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapFirmwareNetworkShare(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "firmware.NetworkShare", "is_password_set": true, "map_type": "MapType 1", "username": "Username 1", "upgradeoption": "Upgradeoption 1", "class_id": "firmware.NetworkShare"} + expectedOp := map[string]interface{}{"map_type": "MapType 1", "username": "Username 1", "object_type": "firmware.NetworkShare", "class_id": "firmware.NetworkShare", "is_password_set": true, "upgradeoption": "Upgradeoption 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapFirmwareRunningFirmwareRelationship(t *testing.T) { p := models.FirmwareRunningFirmwareRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenMapFirmwareRunningFirmwareRelationship(p, d) @@ -11017,14 +11017,14 @@ func TestFlattenMapFirmwareRunningFirmwareRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapFirmwareRunningFirmwareRelationship(p, d)[0] - expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} + expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapFirmwareServerConfigurationUtilityDistributableRelationship(t *testing.T) { p := models.FirmwareServerConfigurationUtilityDistributableRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenMapFirmwareServerConfigurationUtilityDistributableRelationship(p, d) @@ -11035,14 +11035,14 @@ func TestFlattenMapFirmwareServerConfigurationUtilityDistributableRelationship(t err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapFirmwareServerConfigurationUtilityDistributableRelationship(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} + expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapFirmwareUpgradeBaseRelationship(t *testing.T) { p := models.FirmwareUpgradeBaseRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenMapFirmwareUpgradeBaseRelationship(p, d) @@ -11053,7 +11053,7 @@ func TestFlattenMapFirmwareUpgradeBaseRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapFirmwareUpgradeBaseRelationship(p, d)[0] - expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} + expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -11078,7 +11078,7 @@ func TestFlattenMapFirmwareUpgradeImpactStatusRelationship(t *testing.T) { func TestFlattenMapFirmwareUpgradeStatusRelationship(t *testing.T) { p := models.FirmwareUpgradeStatusRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapFirmwareUpgradeStatusRelationship(p, d) @@ -11089,14 +11089,14 @@ func TestFlattenMapFirmwareUpgradeStatusRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapFirmwareUpgradeStatusRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapForecastCatalogRelationship(t *testing.T) { p := models.ForecastCatalogRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapForecastCatalogRelationship(p, d) @@ -11107,7 +11107,7 @@ func TestFlattenMapForecastCatalogRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapForecastCatalogRelationship(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -11132,7 +11132,7 @@ func TestFlattenMapForecastDefinitionRelationship(t *testing.T) { func TestFlattenMapForecastInstanceRelationship(t *testing.T) { p := models.ForecastInstanceRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapForecastInstanceRelationship(p, d) @@ -11143,14 +11143,14 @@ func TestFlattenMapForecastInstanceRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapForecastInstanceRelationship(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapForecastModel(t *testing.T) { p := models.ForecastModel{} var d = &schema.ResourceData{} - c := `{"ClassId":"forecast.Model","ObjectType":"forecast.Model","ModelType":"ModelType %d","Accuracy":32.000000}` + c := `{"ObjectType":"forecast.Model","ClassId":"forecast.Model","ModelType":"ModelType %d","Accuracy":32.000000}` //test when the response is empty ffOpEmpty := flattenMapForecastModel(p, d) @@ -11161,7 +11161,7 @@ func TestFlattenMapForecastModel(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapForecastModel(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "forecast.Model", "object_type": "forecast.Model", "model_type": "ModelType 1", "accuracy": 32.000000} + expectedOp := map[string]interface{}{"object_type": "forecast.Model", "class_id": "forecast.Model", "model_type": "ModelType 1", "accuracy": 32.000000} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -11186,7 +11186,7 @@ func TestFlattenMapGraphicsCardRelationship(t *testing.T) { func TestFlattenMapHclOperatingSystemRelationship(t *testing.T) { p := models.HclOperatingSystemRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapHclOperatingSystemRelationship(p, d) @@ -11197,7 +11197,7 @@ func TestFlattenMapHclOperatingSystemRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapHclOperatingSystemRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -11222,7 +11222,7 @@ func TestFlattenMapHclOperatingSystemVendorRelationship(t *testing.T) { func TestFlattenMapHyperflexAlarmSummary(t *testing.T) { p := models.HyperflexAlarmSummary{} var d = &schema.ResourceData{} - c := `{"Critical":32,"Warning":32,"ObjectType":"hyperflex.AlarmSummary","ClassId":"hyperflex.AlarmSummary"}` + c := `{"ClassId":"hyperflex.AlarmSummary","Critical":32,"Warning":32,"ObjectType":"hyperflex.AlarmSummary"}` //test when the response is empty ffOpEmpty := flattenMapHyperflexAlarmSummary(p, d) @@ -11233,14 +11233,14 @@ func TestFlattenMapHyperflexAlarmSummary(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapHyperflexAlarmSummary(p, d)[0] - expectedOp := map[string]interface{}{"critical": 32, "warning": 32, "object_type": "hyperflex.AlarmSummary", "class_id": "hyperflex.AlarmSummary"} + expectedOp := map[string]interface{}{"class_id": "hyperflex.AlarmSummary", "critical": 32, "warning": 32, "object_type": "hyperflex.AlarmSummary"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapHyperflexAppCatalogRelationship(t *testing.T) { p := models.HyperflexAppCatalogRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapHyperflexAppCatalogRelationship(p, d) @@ -11251,14 +11251,14 @@ func TestFlattenMapHyperflexAppCatalogRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapHyperflexAppCatalogRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapHyperflexAppSettingConstraint(t *testing.T) { p := models.HyperflexAppSettingConstraint{} var d = &schema.ResourceData{} - c := `{"ObjectType":"hyperflex.AppSettingConstraint","MgmtPlatform":"MgmtPlatform %d","ServerModel":"ServerModel %d","DeploymentType":"DeploymentType %d","HxdpVersion":"HxdpVersion %d","HypervisorType":"HypervisorType %d","ClassId":"hyperflex.AppSettingConstraint"}` + c := `{"ServerModel":"ServerModel %d","DeploymentType":"DeploymentType %d","ObjectType":"hyperflex.AppSettingConstraint","ClassId":"hyperflex.AppSettingConstraint","HxdpVersion":"HxdpVersion %d","HypervisorType":"HypervisorType %d","MgmtPlatform":"MgmtPlatform %d"}` //test when the response is empty ffOpEmpty := flattenMapHyperflexAppSettingConstraint(p, d) @@ -11269,14 +11269,14 @@ func TestFlattenMapHyperflexAppSettingConstraint(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapHyperflexAppSettingConstraint(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "hyperflex.AppSettingConstraint", "mgmt_platform": "MgmtPlatform 1", "server_model": "ServerModel 1", "deployment_type": "DeploymentType 1", "hxdp_version": "HxdpVersion 1", "hypervisor_type": "HypervisorType 1", "class_id": "hyperflex.AppSettingConstraint"} + expectedOp := map[string]interface{}{"server_model": "ServerModel 1", "deployment_type": "DeploymentType 1", "object_type": "hyperflex.AppSettingConstraint", "class_id": "hyperflex.AppSettingConstraint", "hxdp_version": "HxdpVersion 1", "hypervisor_type": "HypervisorType 1", "mgmt_platform": "MgmtPlatform 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapHyperflexAutoSupportPolicyRelationship(t *testing.T) { p := models.HyperflexAutoSupportPolicyRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenMapHyperflexAutoSupportPolicyRelationship(p, d) @@ -11287,14 +11287,14 @@ func TestFlattenMapHyperflexAutoSupportPolicyRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapHyperflexAutoSupportPolicyRelationship(p, d)[0] - expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} + expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapHyperflexBackupClusterRelationship(t *testing.T) { p := models.HyperflexBackupClusterRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapHyperflexBackupClusterRelationship(p, d) @@ -11305,14 +11305,14 @@ func TestFlattenMapHyperflexBackupClusterRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapHyperflexBackupClusterRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapHyperflexBackupPolicySettings(t *testing.T) { p := models.HyperflexBackupPolicySettings{} var d = &schema.ResourceData{} - c := `{"ObjectType":"hyperflex.BackupPolicySettings","DataStoreEncryptionEnabled":true,"ReplicationIntervalInMinutes":32,"BackupDataStoreName":"BackupDataStoreName %d","ClassId":"hyperflex.BackupPolicySettings","SnapshotRetentionCount":32,"BackupDataStoreSizeUnit":"BackupDataStoreSizeUnit %d","LocalSnapshotRetentionCount":32,"ReplicationPairNamePrefix":"ReplicationPairNamePrefix %d","BackupDataStoreSize":32}` + c := `{"DataStoreEncryptionEnabled":true,"ClassId":"hyperflex.BackupPolicySettings","ObjectType":"hyperflex.BackupPolicySettings","LocalSnapshotRetentionCount":32,"ReplicationIntervalInMinutes":32,"SnapshotRetentionCount":32,"BackupDataStoreName":"BackupDataStoreName %d","ReplicationPairNamePrefix":"ReplicationPairNamePrefix %d","BackupDataStoreSize":32,"BackupDataStoreSizeUnit":"BackupDataStoreSizeUnit %d"}` //test when the response is empty ffOpEmpty := flattenMapHyperflexBackupPolicySettings(p, d) @@ -11323,14 +11323,14 @@ func TestFlattenMapHyperflexBackupPolicySettings(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapHyperflexBackupPolicySettings(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "hyperflex.BackupPolicySettings", "data_store_encryption_enabled": true, "replication_interval_in_minutes": 32, "backup_data_store_name": "BackupDataStoreName 1", "class_id": "hyperflex.BackupPolicySettings", "snapshot_retention_count": 32, "backup_data_store_size_unit": "BackupDataStoreSizeUnit 1", "local_snapshot_retention_count": 32, "replication_pair_name_prefix": "ReplicationPairNamePrefix 1", "backup_data_store_size": 32} + expectedOp := map[string]interface{}{"data_store_encryption_enabled": true, "class_id": "hyperflex.BackupPolicySettings", "object_type": "hyperflex.BackupPolicySettings", "local_snapshot_retention_count": 32, "replication_interval_in_minutes": 32, "snapshot_retention_count": 32, "backup_data_store_name": "BackupDataStoreName 1", "replication_pair_name_prefix": "ReplicationPairNamePrefix 1", "backup_data_store_size": 32, "backup_data_store_size_unit": "BackupDataStoreSizeUnit 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapHyperflexClusterRelationship(t *testing.T) { p := models.HyperflexClusterRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapHyperflexClusterRelationship(p, d) @@ -11341,7 +11341,7 @@ func TestFlattenMapHyperflexClusterRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapHyperflexClusterRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -11366,7 +11366,7 @@ func TestFlattenMapHyperflexClusterBackupPolicyInventoryRelationship(t *testing. func TestFlattenMapHyperflexClusterNetworkPolicyRelationship(t *testing.T) { p := models.HyperflexClusterNetworkPolicyRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapHyperflexClusterNetworkPolicyRelationship(p, d) @@ -11377,14 +11377,14 @@ func TestFlattenMapHyperflexClusterNetworkPolicyRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapHyperflexClusterNetworkPolicyRelationship(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapHyperflexClusterProfileRelationship(t *testing.T) { p := models.HyperflexClusterProfileRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenMapHyperflexClusterProfileRelationship(p, d) @@ -11395,14 +11395,14 @@ func TestFlattenMapHyperflexClusterProfileRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapHyperflexClusterProfileRelationship(p, d)[0] - expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} + expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapHyperflexClusterStoragePolicyRelationship(t *testing.T) { p := models.HyperflexClusterStoragePolicyRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapHyperflexClusterStoragePolicyRelationship(p, d) @@ -11413,14 +11413,14 @@ func TestFlattenMapHyperflexClusterStoragePolicyRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapHyperflexClusterStoragePolicyRelationship(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapHyperflexConfigResultRelationship(t *testing.T) { p := models.HyperflexConfigResultRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenMapHyperflexConfigResultRelationship(p, d) @@ -11431,7 +11431,7 @@ func TestFlattenMapHyperflexConfigResultRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapHyperflexConfigResultRelationship(p, d)[0] - expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} + expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -11456,7 +11456,7 @@ func TestFlattenMapHyperflexDataProtectionPeerRelationship(t *testing.T) { func TestFlattenMapHyperflexDatastoreStatisticRelationship(t *testing.T) { p := models.HyperflexDatastoreStatisticRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapHyperflexDatastoreStatisticRelationship(p, d) @@ -11467,7 +11467,7 @@ func TestFlattenMapHyperflexDatastoreStatisticRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapHyperflexDatastoreStatisticRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -11492,7 +11492,7 @@ func TestFlattenMapHyperflexEncryptionRelationship(t *testing.T) { func TestFlattenMapHyperflexEntityReference(t *testing.T) { p := models.HyperflexEntityReference{} var d = &schema.ResourceData{} - c := `{"Type":"Type %d","Confignum":32,"Id":"Id %d","ObjectType":"hyperflex.EntityReference","ClassId":"hyperflex.EntityReference","Idtype":"Idtype %d","Name":"Name %d"}` + c := `{"Type":"Type %d","ObjectType":"hyperflex.EntityReference","ClassId":"hyperflex.EntityReference","Confignum":32,"Id":"Id %d","Idtype":"Idtype %d","Name":"Name %d"}` //test when the response is empty ffOpEmpty := flattenMapHyperflexEntityReference(p, d) @@ -11503,7 +11503,7 @@ func TestFlattenMapHyperflexEntityReference(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapHyperflexEntityReference(p, d)[0] - expectedOp := map[string]interface{}{"type": "Type 1", "confignum": 32, "id": "Id 1", "object_type": "hyperflex.EntityReference", "class_id": "hyperflex.EntityReference", "idtype": "Idtype 1", "name": "Name 1"} + expectedOp := map[string]interface{}{"type": "Type 1", "object_type": "hyperflex.EntityReference", "class_id": "hyperflex.EntityReference", "confignum": 32, "id": "Id 1", "idtype": "Idtype 1", "name": "Name 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -11528,7 +11528,7 @@ func TestFlattenMapHyperflexErrorStack(t *testing.T) { func TestFlattenMapHyperflexExtFcStoragePolicyRelationship(t *testing.T) { p := models.HyperflexExtFcStoragePolicyRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenMapHyperflexExtFcStoragePolicyRelationship(p, d) @@ -11539,7 +11539,7 @@ func TestFlattenMapHyperflexExtFcStoragePolicyRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapHyperflexExtFcStoragePolicyRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -11564,7 +11564,7 @@ func TestFlattenMapHyperflexExtIscsiStoragePolicyRelationship(t *testing.T) { func TestFlattenMapHyperflexFeatureLimitExternalRelationship(t *testing.T) { p := models.HyperflexFeatureLimitExternalRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenMapHyperflexFeatureLimitExternalRelationship(p, d) @@ -11575,7 +11575,7 @@ func TestFlattenMapHyperflexFeatureLimitExternalRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapHyperflexFeatureLimitExternalRelationship(p, d)[0] - expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} + expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -11600,7 +11600,7 @@ func TestFlattenMapHyperflexFeatureLimitInternalRelationship(t *testing.T) { func TestFlattenMapHyperflexHealthRelationship(t *testing.T) { p := models.HyperflexHealthRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenMapHyperflexHealthRelationship(p, d) @@ -11611,14 +11611,14 @@ func TestFlattenMapHyperflexHealthRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapHyperflexHealthRelationship(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} + expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapHyperflexHealthCheckDefinitionRelationship(t *testing.T) { p := models.HyperflexHealthCheckDefinitionRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapHyperflexHealthCheckDefinitionRelationship(p, d) @@ -11629,14 +11629,14 @@ func TestFlattenMapHyperflexHealthCheckDefinitionRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapHyperflexHealthCheckDefinitionRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapHyperflexHealthCheckScriptInfo(t *testing.T) { p := models.HyperflexHealthCheckScriptInfo{} var d = &schema.ResourceData{} - c := `{"ObjectType":"hyperflex.HealthCheckScriptInfo","Version":"Version %d","ScriptExecuteLocation":"ScriptExecuteLocation %d","ClassId":"hyperflex.HealthCheckScriptInfo","ScriptInput":"ScriptInput %d","ScriptName":"ScriptName %d","AggregateScriptName":"AggregateScriptName %d","HyperflexVersion":"HyperflexVersion %d"}` + c := `{"ObjectType":"hyperflex.HealthCheckScriptInfo","ScriptName":"ScriptName %d","ScriptExecuteLocation":"ScriptExecuteLocation %d","ScriptInput":"ScriptInput %d","Version":"Version %d","ClassId":"hyperflex.HealthCheckScriptInfo","AggregateScriptName":"AggregateScriptName %d","HyperflexVersion":"HyperflexVersion %d"}` //test when the response is empty ffOpEmpty := flattenMapHyperflexHealthCheckScriptInfo(p, d) @@ -11647,14 +11647,14 @@ func TestFlattenMapHyperflexHealthCheckScriptInfo(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapHyperflexHealthCheckScriptInfo(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "hyperflex.HealthCheckScriptInfo", "nr_version": "Version 1", "script_execute_location": "ScriptExecuteLocation 1", "class_id": "hyperflex.HealthCheckScriptInfo", "script_input": "ScriptInput 1", "script_name": "ScriptName 1", "aggregate_script_name": "AggregateScriptName 1", "hyperflex_version": "HyperflexVersion 1"} + expectedOp := map[string]interface{}{"object_type": "hyperflex.HealthCheckScriptInfo", "script_name": "ScriptName 1", "script_execute_location": "ScriptExecuteLocation 1", "script_input": "ScriptInput 1", "nr_version": "Version 1", "class_id": "hyperflex.HealthCheckScriptInfo", "aggregate_script_name": "AggregateScriptName 1", "hyperflex_version": "HyperflexVersion 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapHyperflexHxLicenseAuthorizationDetailsDt(t *testing.T) { p := models.HyperflexHxLicenseAuthorizationDetailsDt{} var d = &schema.ResourceData{} - c := `{"Status":"Status %d","CommunicationDeadlineDate":"CommunicationDeadlineDate %d","EvaluationPeriodExpiredAt":"EvaluationPeriodExpiredAt %d","ObjectType":"hyperflex.HxLicenseAuthorizationDetailsDt","NextCommunicationAttemptDate":"NextCommunicationAttemptDate %d","EvaluationPeriodRemaining":"EvaluationPeriodRemaining %d","LastCommunicationAttemptDate":"LastCommunicationAttemptDate %d","ClassId":"hyperflex.HxLicenseAuthorizationDetailsDt"}` + c := `{"Status":"Status %d","CommunicationDeadlineDate":"CommunicationDeadlineDate %d","EvaluationPeriodExpiredAt":"EvaluationPeriodExpiredAt %d","EvaluationPeriodRemaining":"EvaluationPeriodRemaining %d","LastCommunicationAttemptDate":"LastCommunicationAttemptDate %d","NextCommunicationAttemptDate":"NextCommunicationAttemptDate %d","ObjectType":"hyperflex.HxLicenseAuthorizationDetailsDt","ClassId":"hyperflex.HxLicenseAuthorizationDetailsDt"}` //test when the response is empty ffOpEmpty := flattenMapHyperflexHxLicenseAuthorizationDetailsDt(p, d) @@ -11665,14 +11665,14 @@ func TestFlattenMapHyperflexHxLicenseAuthorizationDetailsDt(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapHyperflexHxLicenseAuthorizationDetailsDt(p, d)[0] - expectedOp := map[string]interface{}{"status": "Status 1", "communication_deadline_date": "CommunicationDeadlineDate 1", "evaluation_period_expired_at": "EvaluationPeriodExpiredAt 1", "object_type": "hyperflex.HxLicenseAuthorizationDetailsDt", "next_communication_attempt_date": "NextCommunicationAttemptDate 1", "evaluation_period_remaining": "EvaluationPeriodRemaining 1", "last_communication_attempt_date": "LastCommunicationAttemptDate 1", "class_id": "hyperflex.HxLicenseAuthorizationDetailsDt"} + expectedOp := map[string]interface{}{"status": "Status 1", "communication_deadline_date": "CommunicationDeadlineDate 1", "evaluation_period_expired_at": "EvaluationPeriodExpiredAt 1", "evaluation_period_remaining": "EvaluationPeriodRemaining 1", "last_communication_attempt_date": "LastCommunicationAttemptDate 1", "next_communication_attempt_date": "NextCommunicationAttemptDate 1", "object_type": "hyperflex.HxLicenseAuthorizationDetailsDt", "class_id": "hyperflex.HxLicenseAuthorizationDetailsDt"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapHyperflexHxNetworkAddressDt(t *testing.T) { p := models.HyperflexHxNetworkAddressDt{} var d = &schema.ResourceData{} - c := `{"ObjectType":"hyperflex.HxNetworkAddressDt","ClassId":"hyperflex.HxNetworkAddressDt","Fqdn":"Fqdn %d","Ip":"Ip %d","Address":"Address %d"}` + c := `{"Address":"Address %d","Fqdn":"Fqdn %d","Ip":"Ip %d","ObjectType":"hyperflex.HxNetworkAddressDt","ClassId":"hyperflex.HxNetworkAddressDt"}` //test when the response is empty ffOpEmpty := flattenMapHyperflexHxNetworkAddressDt(p, d) @@ -11683,14 +11683,14 @@ func TestFlattenMapHyperflexHxNetworkAddressDt(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapHyperflexHxNetworkAddressDt(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "hyperflex.HxNetworkAddressDt", "class_id": "hyperflex.HxNetworkAddressDt", "fqdn": "Fqdn 1", "ip": "Ip 1", "address": "Address 1"} + expectedOp := map[string]interface{}{"address": "Address 1", "fqdn": "Fqdn 1", "ip": "Ip 1", "object_type": "hyperflex.HxNetworkAddressDt", "class_id": "hyperflex.HxNetworkAddressDt"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapHyperflexHxPlatformDatastoreConfigDt(t *testing.T) { p := models.HyperflexHxPlatformDatastoreConfigDt{} var d = &schema.ResourceData{} - c := `{"ObjectType":"hyperflex.HxPlatformDatastoreConfigDt","SystemDatastore":true,"UsageType":"UsageType %d","ClassId":"hyperflex.HxPlatformDatastoreConfigDt","DataBlockSize":32,"ProvisionedCapacity":32,"Name":"Name %d","NumStripesForLargeFiles":32,"NumMirrors":32}` + c := `{"DataBlockSize":32,"NumMirrors":32,"UsageType":"UsageType %d","SystemDatastore":true,"ClassId":"hyperflex.HxPlatformDatastoreConfigDt","ObjectType":"hyperflex.HxPlatformDatastoreConfigDt","NumStripesForLargeFiles":32,"Name":"Name %d","ProvisionedCapacity":32}` //test when the response is empty ffOpEmpty := flattenMapHyperflexHxPlatformDatastoreConfigDt(p, d) @@ -11701,14 +11701,14 @@ func TestFlattenMapHyperflexHxPlatformDatastoreConfigDt(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapHyperflexHxPlatformDatastoreConfigDt(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "hyperflex.HxPlatformDatastoreConfigDt", "system_datastore": true, "usage_type": "UsageType 1", "class_id": "hyperflex.HxPlatformDatastoreConfigDt", "data_block_size": 32, "provisioned_capacity": 32, "name": "Name 1", "num_stripes_for_large_files": 32, "num_mirrors": 32} + expectedOp := map[string]interface{}{"data_block_size": 32, "num_mirrors": 32, "usage_type": "UsageType 1", "system_datastore": true, "class_id": "hyperflex.HxPlatformDatastoreConfigDt", "object_type": "hyperflex.HxPlatformDatastoreConfigDt", "num_stripes_for_large_files": 32, "name": "Name 1", "provisioned_capacity": 32} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapHyperflexHxRegistrationDetailsDt(t *testing.T) { p := models.HyperflexHxRegistrationDetailsDt{} var d = &schema.ResourceData{} - c := `{"ClassId":"hyperflex.HxRegistrationDetailsDt","RegistrationFailedReason":"RegistrationFailedReason %d","VirtualAccount":"VirtualAccount %d","LastRenewalAttemptDate":"LastRenewalAttemptDate %d","ObjectType":"hyperflex.HxRegistrationDetailsDt","InitialRegistrationDate":"InitialRegistrationDate %d","SmartAccount":"SmartAccount %d","OutOfComplianceStartDate":"OutOfComplianceStartDate %d","RegistrationExpireDate":"RegistrationExpireDate %d","NextRenewalAttemptDate":"NextRenewalAttemptDate %d","Status":"Status %d"}` + c := `{"ObjectType":"hyperflex.HxRegistrationDetailsDt","ClassId":"hyperflex.HxRegistrationDetailsDt","Status":"Status %d","NextRenewalAttemptDate":"NextRenewalAttemptDate %d","RegistrationFailedReason":"RegistrationFailedReason %d","SmartAccount":"SmartAccount %d","InitialRegistrationDate":"InitialRegistrationDate %d","VirtualAccount":"VirtualAccount %d","OutOfComplianceStartDate":"OutOfComplianceStartDate %d","RegistrationExpireDate":"RegistrationExpireDate %d","LastRenewalAttemptDate":"LastRenewalAttemptDate %d"}` //test when the response is empty ffOpEmpty := flattenMapHyperflexHxRegistrationDetailsDt(p, d) @@ -11719,14 +11719,14 @@ func TestFlattenMapHyperflexHxRegistrationDetailsDt(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapHyperflexHxRegistrationDetailsDt(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "hyperflex.HxRegistrationDetailsDt", "registration_failed_reason": "RegistrationFailedReason 1", "virtual_account": "VirtualAccount 1", "last_renewal_attempt_date": "LastRenewalAttemptDate 1", "object_type": "hyperflex.HxRegistrationDetailsDt", "initial_registration_date": "InitialRegistrationDate 1", "smart_account": "SmartAccount 1", "out_of_compliance_start_date": "OutOfComplianceStartDate 1", "registration_expire_date": "RegistrationExpireDate 1", "next_renewal_attempt_date": "NextRenewalAttemptDate 1", "status": "Status 1"} + expectedOp := map[string]interface{}{"object_type": "hyperflex.HxRegistrationDetailsDt", "class_id": "hyperflex.HxRegistrationDetailsDt", "status": "Status 1", "next_renewal_attempt_date": "NextRenewalAttemptDate 1", "registration_failed_reason": "RegistrationFailedReason 1", "smart_account": "SmartAccount 1", "initial_registration_date": "InitialRegistrationDate 1", "virtual_account": "VirtualAccount 1", "out_of_compliance_start_date": "OutOfComplianceStartDate 1", "registration_expire_date": "RegistrationExpireDate 1", "last_renewal_attempt_date": "LastRenewalAttemptDate 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapHyperflexHxResiliencyInfoDt(t *testing.T) { p := models.HyperflexHxResiliencyInfoDt{} var d = &schema.ResourceData{} - c := `{"ClassId":"hyperflex.HxResiliencyInfoDt","PolicyCompliance":"PolicyCompliance %d","HddFailuresTolerable":32,"SsdFailuresTolerable":32,"ResiliencyState":"ResiliencyState %d","ObjectType":"hyperflex.HxResiliencyInfoDt","NodeFailuresTolerable":32,"DataReplicationFactor":"DataReplicationFactor %d"}` + c := `{"PolicyCompliance":"PolicyCompliance %d","DataReplicationFactor":"DataReplicationFactor %d","HddFailuresTolerable":32,"ResiliencyState":"ResiliencyState %d","SsdFailuresTolerable":32,"ObjectType":"hyperflex.HxResiliencyInfoDt","ClassId":"hyperflex.HxResiliencyInfoDt","NodeFailuresTolerable":32}` //test when the response is empty ffOpEmpty := flattenMapHyperflexHxResiliencyInfoDt(p, d) @@ -11737,7 +11737,7 @@ func TestFlattenMapHyperflexHxResiliencyInfoDt(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapHyperflexHxResiliencyInfoDt(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "hyperflex.HxResiliencyInfoDt", "policy_compliance": "PolicyCompliance 1", "hdd_failures_tolerable": 32, "ssd_failures_tolerable": 32, "resiliency_state": "ResiliencyState 1", "object_type": "hyperflex.HxResiliencyInfoDt", "node_failures_tolerable": 32, "data_replication_factor": "DataReplicationFactor 1"} + expectedOp := map[string]interface{}{"policy_compliance": "PolicyCompliance 1", "data_replication_factor": "DataReplicationFactor 1", "hdd_failures_tolerable": 32, "resiliency_state": "ResiliencyState 1", "ssd_failures_tolerable": 32, "object_type": "hyperflex.HxResiliencyInfoDt", "class_id": "hyperflex.HxResiliencyInfoDt", "node_failures_tolerable": 32} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -11780,7 +11780,7 @@ func TestFlattenMapHyperflexHxUuIdDt(t *testing.T) { func TestFlattenMapHyperflexHypervisorHostRelationship(t *testing.T) { p := models.HyperflexHypervisorHostRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapHyperflexHypervisorHostRelationship(p, d) @@ -11791,14 +11791,14 @@ func TestFlattenMapHyperflexHypervisorHostRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapHyperflexHypervisorHostRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapHyperflexIpAddrRange(t *testing.T) { p := models.HyperflexIpAddrRange{} var d = &schema.ResourceData{} - c := `{"Gateway":"Gateway %d","ObjectType":"hyperflex.IpAddrRange","ClassId":"hyperflex.IpAddrRange","Netmask":"Netmask %d","StartAddr":"StartAddr %d","EndAddr":"EndAddr %d"}` + c := `{"EndAddr":"EndAddr %d","Gateway":"Gateway %d","Netmask":"Netmask %d","StartAddr":"StartAddr %d","ObjectType":"hyperflex.IpAddrRange","ClassId":"hyperflex.IpAddrRange"}` //test when the response is empty ffOpEmpty := flattenMapHyperflexIpAddrRange(p, d) @@ -11809,14 +11809,14 @@ func TestFlattenMapHyperflexIpAddrRange(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapHyperflexIpAddrRange(p, d)[0] - expectedOp := map[string]interface{}{"gateway": "Gateway 1", "object_type": "hyperflex.IpAddrRange", "class_id": "hyperflex.IpAddrRange", "netmask": "Netmask 1", "start_addr": "StartAddr 1", "end_addr": "EndAddr 1"} + expectedOp := map[string]interface{}{"end_addr": "EndAddr 1", "gateway": "Gateway 1", "netmask": "Netmask 1", "start_addr": "StartAddr 1", "object_type": "hyperflex.IpAddrRange", "class_id": "hyperflex.IpAddrRange"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapHyperflexLicenseRelationship(t *testing.T) { p := models.HyperflexLicenseRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenMapHyperflexLicenseRelationship(p, d) @@ -11827,7 +11827,7 @@ func TestFlattenMapHyperflexLicenseRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapHyperflexLicenseRelationship(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} + expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -11852,7 +11852,7 @@ func TestFlattenMapHyperflexLocalCredentialPolicyRelationship(t *testing.T) { func TestFlattenMapHyperflexLogicalAvailabilityZone(t *testing.T) { p := models.HyperflexLogicalAvailabilityZone{} var d = &schema.ResourceData{} - c := `{"ObjectType":"hyperflex.LogicalAvailabilityZone","ClassId":"hyperflex.LogicalAvailabilityZone","AutoConfig":true}` + c := `{"AutoConfig":true,"ObjectType":"hyperflex.LogicalAvailabilityZone","ClassId":"hyperflex.LogicalAvailabilityZone"}` //test when the response is empty ffOpEmpty := flattenMapHyperflexLogicalAvailabilityZone(p, d) @@ -11863,14 +11863,14 @@ func TestFlattenMapHyperflexLogicalAvailabilityZone(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapHyperflexLogicalAvailabilityZone(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "hyperflex.LogicalAvailabilityZone", "class_id": "hyperflex.LogicalAvailabilityZone", "auto_config": true} + expectedOp := map[string]interface{}{"auto_config": true, "object_type": "hyperflex.LogicalAvailabilityZone", "class_id": "hyperflex.LogicalAvailabilityZone"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapHyperflexMacAddrPrefixRange(t *testing.T) { p := models.HyperflexMacAddrPrefixRange{} var d = &schema.ResourceData{} - c := `{"ObjectType":"hyperflex.MacAddrPrefixRange","ClassId":"hyperflex.MacAddrPrefixRange","EndAddr":"EndAddr %d","StartAddr":"StartAddr %d"}` + c := `{"ClassId":"hyperflex.MacAddrPrefixRange","EndAddr":"EndAddr %d","StartAddr":"StartAddr %d","ObjectType":"hyperflex.MacAddrPrefixRange"}` //test when the response is empty ffOpEmpty := flattenMapHyperflexMacAddrPrefixRange(p, d) @@ -11881,7 +11881,7 @@ func TestFlattenMapHyperflexMacAddrPrefixRange(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapHyperflexMacAddrPrefixRange(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "hyperflex.MacAddrPrefixRange", "class_id": "hyperflex.MacAddrPrefixRange", "end_addr": "EndAddr 1", "start_addr": "StartAddr 1"} + expectedOp := map[string]interface{}{"class_id": "hyperflex.MacAddrPrefixRange", "end_addr": "EndAddr 1", "start_addr": "StartAddr 1", "object_type": "hyperflex.MacAddrPrefixRange"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -11906,7 +11906,7 @@ func TestFlattenMapHyperflexNamedVlan(t *testing.T) { func TestFlattenMapHyperflexNamedVsan(t *testing.T) { p := models.HyperflexNamedVsan{} var d = &schema.ResourceData{} - c := `{"ObjectType":"hyperflex.NamedVsan","ClassId":"hyperflex.NamedVsan","Name":"Name %d","VsanId":32}` + c := `{"ObjectType":"hyperflex.NamedVsan","ClassId":"hyperflex.NamedVsan","VsanId":32,"Name":"Name %d"}` //test when the response is empty ffOpEmpty := flattenMapHyperflexNamedVsan(p, d) @@ -11917,14 +11917,14 @@ func TestFlattenMapHyperflexNamedVsan(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapHyperflexNamedVsan(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "hyperflex.NamedVsan", "class_id": "hyperflex.NamedVsan", "name": "Name 1", "vsan_id": 32} + expectedOp := map[string]interface{}{"object_type": "hyperflex.NamedVsan", "class_id": "hyperflex.NamedVsan", "vsan_id": 32, "name": "Name 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapHyperflexNodeRelationship(t *testing.T) { p := models.HyperflexNodeRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapHyperflexNodeRelationship(p, d) @@ -11935,14 +11935,14 @@ func TestFlattenMapHyperflexNodeRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapHyperflexNodeRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapHyperflexNodeConfigPolicyRelationship(t *testing.T) { p := models.HyperflexNodeConfigPolicyRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapHyperflexNodeConfigPolicyRelationship(p, d) @@ -11953,14 +11953,14 @@ func TestFlattenMapHyperflexNodeConfigPolicyRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapHyperflexNodeConfigPolicyRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapHyperflexProxySettingPolicyRelationship(t *testing.T) { p := models.HyperflexProxySettingPolicyRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapHyperflexProxySettingPolicyRelationship(p, d) @@ -11971,14 +11971,14 @@ func TestFlattenMapHyperflexProxySettingPolicyRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapHyperflexProxySettingPolicyRelationship(p, d)[0] - expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} + expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapHyperflexReplicationPeerInfo(t *testing.T) { p := models.HyperflexReplicationPeerInfo{} var d = &schema.ResourceData{} - c := `{"ObjectType":"hyperflex.ReplicationPeerInfo","Status":"Status %d","ReplCip":"ReplCip %d","ClassId":"hyperflex.ReplicationPeerInfo","Mcip":"Mcip %d","StatusDetails":"StatusDetails %d","Dcip":"Dcip %d"}` + c := `{"Status":"Status %d","ClassId":"hyperflex.ReplicationPeerInfo","Dcip":"Dcip %d","Mcip":"Mcip %d","ObjectType":"hyperflex.ReplicationPeerInfo","ReplCip":"ReplCip %d","StatusDetails":"StatusDetails %d"}` //test when the response is empty ffOpEmpty := flattenMapHyperflexReplicationPeerInfo(p, d) @@ -11989,14 +11989,14 @@ func TestFlattenMapHyperflexReplicationPeerInfo(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapHyperflexReplicationPeerInfo(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "hyperflex.ReplicationPeerInfo", "status": "Status 1", "repl_cip": "ReplCip 1", "class_id": "hyperflex.ReplicationPeerInfo", "mcip": "Mcip 1", "status_details": "StatusDetails 1", "dcip": "Dcip 1"} + expectedOp := map[string]interface{}{"status": "Status 1", "class_id": "hyperflex.ReplicationPeerInfo", "dcip": "Dcip 1", "mcip": "Mcip 1", "object_type": "hyperflex.ReplicationPeerInfo", "repl_cip": "ReplCip 1", "status_details": "StatusDetails 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapHyperflexReplicationSchedule(t *testing.T) { p := models.HyperflexReplicationSchedule{} var d = &schema.ResourceData{} - c := `{"BackupInterval":32,"ObjectType":"hyperflex.ReplicationSchedule","ClassId":"hyperflex.ReplicationSchedule"}` + c := `{"ObjectType":"hyperflex.ReplicationSchedule","ClassId":"hyperflex.ReplicationSchedule","BackupInterval":32}` //test when the response is empty ffOpEmpty := flattenMapHyperflexReplicationSchedule(p, d) @@ -12007,14 +12007,14 @@ func TestFlattenMapHyperflexReplicationSchedule(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapHyperflexReplicationSchedule(p, d)[0] - expectedOp := map[string]interface{}{"backup_interval": 32, "object_type": "hyperflex.ReplicationSchedule", "class_id": "hyperflex.ReplicationSchedule"} + expectedOp := map[string]interface{}{"object_type": "hyperflex.ReplicationSchedule", "class_id": "hyperflex.ReplicationSchedule", "backup_interval": 32} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapHyperflexServerFirmwareVersionRelationship(t *testing.T) { p := models.HyperflexServerFirmwareVersionRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapHyperflexServerFirmwareVersionRelationship(p, d) @@ -12025,14 +12025,14 @@ func TestFlattenMapHyperflexServerFirmwareVersionRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapHyperflexServerFirmwareVersionRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapHyperflexServerModelRelationship(t *testing.T) { p := models.HyperflexServerModelRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapHyperflexServerModelRelationship(p, d) @@ -12043,14 +12043,14 @@ func TestFlattenMapHyperflexServerModelRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapHyperflexServerModelRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapHyperflexSoftwareDistributionEntryRelationship(t *testing.T) { p := models.HyperflexSoftwareDistributionEntryRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapHyperflexSoftwareDistributionEntryRelationship(p, d) @@ -12061,14 +12061,14 @@ func TestFlattenMapHyperflexSoftwareDistributionEntryRelationship(t *testing.T) err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapHyperflexSoftwareDistributionEntryRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapHyperflexSoftwareDistributionVersionRelationship(t *testing.T) { p := models.HyperflexSoftwareDistributionVersionRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapHyperflexSoftwareDistributionVersionRelationship(p, d) @@ -12079,14 +12079,14 @@ func TestFlattenMapHyperflexSoftwareDistributionVersionRelationship(t *testing.T err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapHyperflexSoftwareDistributionVersionRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapHyperflexSoftwareVersionPolicyRelationship(t *testing.T) { p := models.HyperflexSoftwareVersionPolicyRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapHyperflexSoftwareVersionPolicyRelationship(p, d) @@ -12097,7 +12097,7 @@ func TestFlattenMapHyperflexSoftwareVersionPolicyRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapHyperflexSoftwareVersionPolicyRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -12122,7 +12122,7 @@ func TestFlattenMapHyperflexStorageContainerRelationship(t *testing.T) { func TestFlattenMapHyperflexSummary(t *testing.T) { p := models.HyperflexSummary{} var d = &schema.ResourceData{} - c := `{"DeduplicationSavings":32.000000,"DataReplicationCompliance":"DataReplicationCompliance %d","Downtime":"Downtime %d","ObjectType":"hyperflex.Summary","TotalSavings":32.000000,"TotalCapacity":32,"ClassId":"hyperflex.Summary","State":"State %d","ClusterAccessPolicy":"ClusterAccessPolicy %d","FreeCapacity":32,"Boottime":32,"Name":"Name %d","ActiveNodes":"ActiveNodes %d","SpaceStatus":"SpaceStatus %d","UsedCapacity":32,"DataReplicationFactor":"DataReplicationFactor %d","Address":"Address %d","ResiliencyDetailsSize":32,"CompressionSavings":32.000000,"Uptime":"Uptime %d"}` + c := `{"TotalSavings":32.000000,"Downtime":"Downtime %d","FreeCapacity":32,"ClassId":"hyperflex.Summary","ClusterAccessPolicy":"ClusterAccessPolicy %d","Name":"Name %d","State":"State %d","DeduplicationSavings":32.000000,"Address":"Address %d","DataReplicationCompliance":"DataReplicationCompliance %d","UsedCapacity":32,"TotalCapacity":32,"SpaceStatus":"SpaceStatus %d","ResiliencyDetailsSize":32,"ActiveNodes":"ActiveNodes %d","Boottime":32,"DataReplicationFactor":"DataReplicationFactor %d","CompressionSavings":32.000000,"ObjectType":"hyperflex.Summary","Uptime":"Uptime %d"}` //test when the response is empty ffOpEmpty := flattenMapHyperflexSummary(p, d) @@ -12133,14 +12133,14 @@ func TestFlattenMapHyperflexSummary(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapHyperflexSummary(p, d)[0] - expectedOp := map[string]interface{}{"deduplication_savings": 32.000000, "data_replication_compliance": "DataReplicationCompliance 1", "downtime": "Downtime 1", "object_type": "hyperflex.Summary", "total_savings": 32.000000, "total_capacity": 32, "class_id": "hyperflex.Summary", "state": "State 1", "cluster_access_policy": "ClusterAccessPolicy 1", "free_capacity": 32, "boottime": 32, "name": "Name 1", "active_nodes": "ActiveNodes 1", "space_status": "SpaceStatus 1", "used_capacity": 32, "data_replication_factor": "DataReplicationFactor 1", "address": "Address 1", "resiliency_details_size": 32, "compression_savings": 32.000000, "uptime": "Uptime 1"} + expectedOp := map[string]interface{}{"total_savings": 32.000000, "downtime": "Downtime 1", "free_capacity": 32, "class_id": "hyperflex.Summary", "cluster_access_policy": "ClusterAccessPolicy 1", "name": "Name 1", "state": "State 1", "deduplication_savings": 32.000000, "address": "Address 1", "data_replication_compliance": "DataReplicationCompliance 1", "used_capacity": 32, "total_capacity": 32, "space_status": "SpaceStatus 1", "resiliency_details_size": 32, "active_nodes": "ActiveNodes 1", "boottime": 32, "data_replication_factor": "DataReplicationFactor 1", "compression_savings": 32.000000, "object_type": "hyperflex.Summary", "uptime": "Uptime 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapHyperflexSysConfigPolicyRelationship(t *testing.T) { p := models.HyperflexSysConfigPolicyRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenMapHyperflexSysConfigPolicyRelationship(p, d) @@ -12151,14 +12151,14 @@ func TestFlattenMapHyperflexSysConfigPolicyRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapHyperflexSysConfigPolicyRelationship(p, d)[0] - expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} + expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapHyperflexUcsmConfigPolicyRelationship(t *testing.T) { p := models.HyperflexUcsmConfigPolicyRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapHyperflexUcsmConfigPolicyRelationship(p, d) @@ -12169,7 +12169,7 @@ func TestFlattenMapHyperflexUcsmConfigPolicyRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapHyperflexUcsmConfigPolicyRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -12194,7 +12194,7 @@ func TestFlattenMapHyperflexVcenterConfigPolicyRelationship(t *testing.T) { func TestFlattenMapHyperflexVirtualMachine(t *testing.T) { p := models.HyperflexVirtualMachine{} var d = &schema.ResourceData{} - c := `{"Uuid":"Uuid %d","ObjectType":"hyperflex.VirtualMachine","ClassId":"hyperflex.VirtualMachine","StatusCode":"StatusCode %d"}` + c := `{"ObjectType":"hyperflex.VirtualMachine","ClassId":"hyperflex.VirtualMachine","StatusCode":"StatusCode %d","Uuid":"Uuid %d"}` //test when the response is empty ffOpEmpty := flattenMapHyperflexVirtualMachine(p, d) @@ -12205,14 +12205,14 @@ func TestFlattenMapHyperflexVirtualMachine(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapHyperflexVirtualMachine(p, d)[0] - expectedOp := map[string]interface{}{"uuid": "Uuid 1", "object_type": "hyperflex.VirtualMachine", "class_id": "hyperflex.VirtualMachine", "status_code": "StatusCode 1"} + expectedOp := map[string]interface{}{"object_type": "hyperflex.VirtualMachine", "class_id": "hyperflex.VirtualMachine", "status_code": "StatusCode 1", "uuid": "Uuid 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapHyperflexVmBackupInfoRelationship(t *testing.T) { p := models.HyperflexVmBackupInfoRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenMapHyperflexVmBackupInfoRelationship(p, d) @@ -12223,14 +12223,14 @@ func TestFlattenMapHyperflexVmBackupInfoRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapHyperflexVmBackupInfoRelationship(p, d)[0] - expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} + expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapHyperflexVmSnapshotInfoRelationship(t *testing.T) { p := models.HyperflexVmSnapshotInfoRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenMapHyperflexVmSnapshotInfoRelationship(p, d) @@ -12241,14 +12241,14 @@ func TestFlattenMapHyperflexVmSnapshotInfoRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapHyperflexVmSnapshotInfoRelationship(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} + expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapHyperflexWwxnPrefixRange(t *testing.T) { p := models.HyperflexWwxnPrefixRange{} var d = &schema.ResourceData{} - c := `{"ClassId":"hyperflex.WwxnPrefixRange","ObjectType":"hyperflex.WwxnPrefixRange","EndAddr":"EndAddr %d","StartAddr":"StartAddr %d"}` + c := `{"EndAddr":"EndAddr %d","StartAddr":"StartAddr %d","ObjectType":"hyperflex.WwxnPrefixRange","ClassId":"hyperflex.WwxnPrefixRange"}` //test when the response is empty ffOpEmpty := flattenMapHyperflexWwxnPrefixRange(p, d) @@ -12259,7 +12259,7 @@ func TestFlattenMapHyperflexWwxnPrefixRange(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapHyperflexWwxnPrefixRange(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "hyperflex.WwxnPrefixRange", "object_type": "hyperflex.WwxnPrefixRange", "end_addr": "EndAddr 1", "start_addr": "StartAddr 1"} + expectedOp := map[string]interface{}{"end_addr": "EndAddr 1", "start_addr": "StartAddr 1", "object_type": "hyperflex.WwxnPrefixRange", "class_id": "hyperflex.WwxnPrefixRange"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -12284,7 +12284,7 @@ func TestFlattenMapIaasLicenseInfoRelationship(t *testing.T) { func TestFlattenMapIaasUcsdInfoRelationship(t *testing.T) { p := models.IaasUcsdInfoRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenMapIaasUcsdInfoRelationship(p, d) @@ -12295,7 +12295,7 @@ func TestFlattenMapIaasUcsdInfoRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapIaasUcsdInfoRelationship(p, d)[0] - expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} + expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -12374,7 +12374,7 @@ func TestFlattenMapIamCertificateRelationship(t *testing.T) { func TestFlattenMapIamCertificateRequestRelationship(t *testing.T) { p := models.IamCertificateRequestRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenMapIamCertificateRequestRelationship(p, d) @@ -12385,14 +12385,14 @@ func TestFlattenMapIamCertificateRequestRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapIamCertificateRequestRelationship(p, d)[0] - expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} + expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapIamClientMeta(t *testing.T) { p := models.IamClientMeta{} var d = &schema.ResourceData{} - c := `{"ClassId":"iam.ClientMeta","DeviceModel":"DeviceModel %d","UserAgent":"UserAgent %d","ObjectType":"iam.ClientMeta"}` + c := `{"ObjectType":"iam.ClientMeta","ClassId":"iam.ClientMeta","DeviceModel":"DeviceModel %d","UserAgent":"UserAgent %d"}` //test when the response is empty ffOpEmpty := flattenMapIamClientMeta(p, d) @@ -12403,14 +12403,14 @@ func TestFlattenMapIamClientMeta(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapIamClientMeta(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "iam.ClientMeta", "device_model": "DeviceModel 1", "user_agent": "UserAgent 1", "object_type": "iam.ClientMeta"} + expectedOp := map[string]interface{}{"object_type": "iam.ClientMeta", "class_id": "iam.ClientMeta", "device_model": "DeviceModel 1", "user_agent": "UserAgent 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapIamDomainGroupRelationship(t *testing.T) { p := models.IamDomainGroupRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenMapIamDomainGroupRelationship(p, d) @@ -12421,14 +12421,14 @@ func TestFlattenMapIamDomainGroupRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapIamDomainGroupRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapIamEndPointPasswordProperties(t *testing.T) { p := models.IamEndPointPasswordProperties{} var d = &schema.ResourceData{} - c := `{"PasswordExpiryDuration":32,"NotificationPeriod":32,"GracePeriod":32,"ClassId":"iam.EndPointPasswordProperties","EnforceStrongPassword":true,"PasswordHistory":32,"EnablePasswordExpiry":true,"ForceSendPassword":true,"ObjectType":"iam.EndPointPasswordProperties"}` + c := `{"EnablePasswordExpiry":true,"PasswordHistory":32,"PasswordExpiryDuration":32,"ObjectType":"iam.EndPointPasswordProperties","ClassId":"iam.EndPointPasswordProperties","GracePeriod":32,"EnforceStrongPassword":true,"ForceSendPassword":true,"NotificationPeriod":32}` //test when the response is empty ffOpEmpty := flattenMapIamEndPointPasswordProperties(p, d) @@ -12439,14 +12439,14 @@ func TestFlattenMapIamEndPointPasswordProperties(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapIamEndPointPasswordProperties(p, d)[0] - expectedOp := map[string]interface{}{"password_expiry_duration": 32, "notification_period": 32, "grace_period": 32, "class_id": "iam.EndPointPasswordProperties", "enforce_strong_password": true, "password_history": 32, "enable_password_expiry": true, "force_send_password": true, "object_type": "iam.EndPointPasswordProperties"} + expectedOp := map[string]interface{}{"enable_password_expiry": true, "password_history": 32, "password_expiry_duration": 32, "object_type": "iam.EndPointPasswordProperties", "class_id": "iam.EndPointPasswordProperties", "grace_period": 32, "enforce_strong_password": true, "force_send_password": true, "notification_period": 32} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapIamEndPointUserRelationship(t *testing.T) { p := models.IamEndPointUserRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenMapIamEndPointUserRelationship(p, d) @@ -12457,14 +12457,14 @@ func TestFlattenMapIamEndPointUserRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapIamEndPointUserRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapIamEndPointUserPolicyRelationship(t *testing.T) { p := models.IamEndPointUserPolicyRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapIamEndPointUserPolicyRelationship(p, d) @@ -12475,14 +12475,14 @@ func TestFlattenMapIamEndPointUserPolicyRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapIamEndPointUserPolicyRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapIamIdpRelationship(t *testing.T) { p := models.IamIdpRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenMapIamIdpRelationship(p, d) @@ -12493,7 +12493,7 @@ func TestFlattenMapIamIdpRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapIamIdpRelationship(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} + expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -12518,7 +12518,7 @@ func TestFlattenMapIamIdpReferenceRelationship(t *testing.T) { func TestFlattenMapIamIpAccessManagementRelationship(t *testing.T) { p := models.IamIpAccessManagementRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapIamIpAccessManagementRelationship(p, d) @@ -12529,14 +12529,14 @@ func TestFlattenMapIamIpAccessManagementRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapIamIpAccessManagementRelationship(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapIamLdapBaseProperties(t *testing.T) { p := models.IamLdapBaseProperties{} var d = &schema.ResourceData{} - c := `{"ObjectType":"iam.LdapBaseProperties","Domain":"Domain %d","Filter":"Filter %d","BindMethod":"BindMethod %d","EnableEncryption":true,"ClassId":"iam.LdapBaseProperties","NestedGroupSearchDepth":32,"BindDn":"BindDn %d","GroupAttribute":"GroupAttribute %d","IsPasswordSet":true,"Timeout":32,"EnableGroupAuthorization":true,"BaseDn":"BaseDn %d","Attribute":"Attribute %d"}` + c := `{"BindDn":"BindDn %d","ObjectType":"iam.LdapBaseProperties","NestedGroupSearchDepth":32,"EnableGroupAuthorization":true,"BaseDn":"BaseDn %d","BindMethod":"BindMethod %d","ClassId":"iam.LdapBaseProperties","Domain":"Domain %d","EnableEncryption":true,"Timeout":32,"IsPasswordSet":true,"Filter":"Filter %d","GroupAttribute":"GroupAttribute %d","Attribute":"Attribute %d"}` //test when the response is empty ffOpEmpty := flattenMapIamLdapBaseProperties(p, d) @@ -12547,14 +12547,14 @@ func TestFlattenMapIamLdapBaseProperties(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapIamLdapBaseProperties(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "iam.LdapBaseProperties", "domain": "Domain 1", "filter": "Filter 1", "bind_method": "BindMethod 1", "enable_encryption": true, "class_id": "iam.LdapBaseProperties", "nested_group_search_depth": 32, "bind_dn": "BindDn 1", "group_attribute": "GroupAttribute 1", "is_password_set": true, "timeout": 32, "enable_group_authorization": true, "base_dn": "BaseDn 1", "attribute": "Attribute 1"} + expectedOp := map[string]interface{}{"bind_dn": "BindDn 1", "object_type": "iam.LdapBaseProperties", "nested_group_search_depth": 32, "enable_group_authorization": true, "base_dn": "BaseDn 1", "bind_method": "BindMethod 1", "class_id": "iam.LdapBaseProperties", "domain": "Domain 1", "enable_encryption": true, "timeout": 32, "is_password_set": true, "filter": "Filter 1", "group_attribute": "GroupAttribute 1", "attribute": "Attribute 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapIamLdapDnsParameters(t *testing.T) { p := models.IamLdapDnsParameters{} var d = &schema.ResourceData{} - c := `{"ClassId":"iam.LdapDnsParameters","Source":"Source %d","SearchDomain":"SearchDomain %d","SearchForest":"SearchForest %d","ObjectType":"iam.LdapDnsParameters"}` + c := `{"ObjectType":"iam.LdapDnsParameters","ClassId":"iam.LdapDnsParameters","SearchDomain":"SearchDomain %d","SearchForest":"SearchForest %d","Source":"Source %d"}` //test when the response is empty ffOpEmpty := flattenMapIamLdapDnsParameters(p, d) @@ -12565,7 +12565,7 @@ func TestFlattenMapIamLdapDnsParameters(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapIamLdapDnsParameters(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "iam.LdapDnsParameters", "nr_source": "Source 1", "search_domain": "SearchDomain 1", "search_forest": "SearchForest 1", "object_type": "iam.LdapDnsParameters"} + expectedOp := map[string]interface{}{"object_type": "iam.LdapDnsParameters", "class_id": "iam.LdapDnsParameters", "search_domain": "SearchDomain 1", "search_forest": "SearchForest 1", "nr_source": "Source 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -12590,7 +12590,7 @@ func TestFlattenMapIamLdapPolicyRelationship(t *testing.T) { func TestFlattenMapIamLocalUserPasswordRelationship(t *testing.T) { p := models.IamLocalUserPasswordRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenMapIamLocalUserPasswordRelationship(p, d) @@ -12601,14 +12601,14 @@ func TestFlattenMapIamLocalUserPasswordRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapIamLocalUserPasswordRelationship(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} + expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapIamPermissionRelationship(t *testing.T) { p := models.IamPermissionRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapIamPermissionRelationship(p, d) @@ -12619,14 +12619,14 @@ func TestFlattenMapIamPermissionRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapIamPermissionRelationship(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapIamPrivateKeySpecRelationship(t *testing.T) { p := models.IamPrivateKeySpecRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenMapIamPrivateKeySpecRelationship(p, d) @@ -12637,7 +12637,7 @@ func TestFlattenMapIamPrivateKeySpecRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapIamPrivateKeySpecRelationship(p, d)[0] - expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} + expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -12698,7 +12698,7 @@ func TestFlattenMapIamSecurityHolderRelationship(t *testing.T) { func TestFlattenMapIamServiceProviderRelationship(t *testing.T) { p := models.IamServiceProviderRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapIamServiceProviderRelationship(p, d) @@ -12709,7 +12709,7 @@ func TestFlattenMapIamServiceProviderRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapIamServiceProviderRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -12770,7 +12770,7 @@ func TestFlattenMapIamSystemRelationship(t *testing.T) { func TestFlattenMapIamTrustPointRelationship(t *testing.T) { p := models.IamTrustPointRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenMapIamTrustPointRelationship(p, d) @@ -12781,14 +12781,14 @@ func TestFlattenMapIamTrustPointRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapIamTrustPointRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapIamUserRelationship(t *testing.T) { p := models.IamUserRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapIamUserRelationship(p, d) @@ -12799,14 +12799,14 @@ func TestFlattenMapIamUserRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapIamUserRelationship(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapIamUserGroupRelationship(t *testing.T) { p := models.IamUserGroupRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapIamUserGroupRelationship(p, d) @@ -12817,14 +12817,14 @@ func TestFlattenMapIamUserGroupRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapIamUserGroupRelationship(p, d)[0] - expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} + expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapInfraHardwareInfo(t *testing.T) { p := models.InfraHardwareInfo{} var d = &schema.ResourceData{} - c := `{"MemorySize":32,"ObjectType":"infra.HardwareInfo","ClassId":"infra.HardwareInfo","CpuCores":32,"CpuSpeed":32}` + c := `{"MemorySize":32,"CpuCores":32,"ObjectType":"infra.HardwareInfo","ClassId":"infra.HardwareInfo","CpuSpeed":32}` //test when the response is empty ffOpEmpty := flattenMapInfraHardwareInfo(p, d) @@ -12835,7 +12835,7 @@ func TestFlattenMapInfraHardwareInfo(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapInfraHardwareInfo(p, d)[0] - expectedOp := map[string]interface{}{"memory_size": 32, "object_type": "infra.HardwareInfo", "class_id": "infra.HardwareInfo", "cpu_cores": 32, "cpu_speed": 32} + expectedOp := map[string]interface{}{"memory_size": 32, "cpu_cores": 32, "object_type": "infra.HardwareInfo", "class_id": "infra.HardwareInfo", "cpu_speed": 32} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -12860,7 +12860,7 @@ func TestFlattenMapInventoryBaseRelationship(t *testing.T) { func TestFlattenMapInventoryDeviceInfoRelationship(t *testing.T) { p := models.InventoryDeviceInfoRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapInventoryDeviceInfoRelationship(p, d) @@ -12871,14 +12871,14 @@ func TestFlattenMapInventoryDeviceInfoRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapInventoryDeviceInfoRelationship(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapInventoryGenericInventoryHolderRelationship(t *testing.T) { p := models.InventoryGenericInventoryHolderRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenMapInventoryGenericInventoryHolderRelationship(p, d) @@ -12889,7 +12889,7 @@ func TestFlattenMapInventoryGenericInventoryHolderRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapInventoryGenericInventoryHolderRelationship(p, d)[0] - expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} + expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -12914,7 +12914,7 @@ func TestFlattenMapIppoolBlockLeaseRelationship(t *testing.T) { func TestFlattenMapIppoolIpLeaseRelationship(t *testing.T) { p := models.IppoolIpLeaseRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapIppoolIpLeaseRelationship(p, d) @@ -12925,14 +12925,14 @@ func TestFlattenMapIppoolIpLeaseRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapIppoolIpLeaseRelationship(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapIppoolIpV4Block(t *testing.T) { p := models.IppoolIpV4Block{} var d = &schema.ResourceData{} - c := `{"Size":32,"From":"From %d","To":"To %d","ObjectType":"ippool.IpV4Block","ClassId":"ippool.IpV4Block"}` + c := `{"From":"From %d","To":"To %d","ObjectType":"ippool.IpV4Block","ClassId":"ippool.IpV4Block","Size":32}` //test when the response is empty ffOpEmpty := flattenMapIppoolIpV4Block(p, d) @@ -12943,14 +12943,14 @@ func TestFlattenMapIppoolIpV4Block(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapIppoolIpV4Block(p, d)[0] - expectedOp := map[string]interface{}{"size": 32, "from": "From 1", "to": "To 1", "object_type": "ippool.IpV4Block", "class_id": "ippool.IpV4Block"} + expectedOp := map[string]interface{}{"from": "From 1", "to": "To 1", "object_type": "ippool.IpV4Block", "class_id": "ippool.IpV4Block", "size": 32} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapIppoolIpV4Config(t *testing.T) { p := models.IppoolIpV4Config{} var d = &schema.ResourceData{} - c := `{"Gateway":"Gateway %d","Netmask":"Netmask %d","ObjectType":"ippool.IpV4Config","ClassId":"ippool.IpV4Config","PrimaryDns":"PrimaryDns %d","SecondaryDns":"SecondaryDns %d"}` + c := `{"ObjectType":"ippool.IpV4Config","ClassId":"ippool.IpV4Config","PrimaryDns":"PrimaryDns %d","SecondaryDns":"SecondaryDns %d","Gateway":"Gateway %d","Netmask":"Netmask %d"}` //test when the response is empty ffOpEmpty := flattenMapIppoolIpV4Config(p, d) @@ -12961,14 +12961,14 @@ func TestFlattenMapIppoolIpV4Config(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapIppoolIpV4Config(p, d)[0] - expectedOp := map[string]interface{}{"gateway": "Gateway 1", "netmask": "Netmask 1", "object_type": "ippool.IpV4Config", "class_id": "ippool.IpV4Config", "primary_dns": "PrimaryDns 1", "secondary_dns": "SecondaryDns 1"} + expectedOp := map[string]interface{}{"object_type": "ippool.IpV4Config", "class_id": "ippool.IpV4Config", "primary_dns": "PrimaryDns 1", "secondary_dns": "SecondaryDns 1", "gateway": "Gateway 1", "netmask": "Netmask 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapIppoolIpV6Block(t *testing.T) { p := models.IppoolIpV6Block{} var d = &schema.ResourceData{} - c := `{"From":"From %d","To":"To %d","ObjectType":"ippool.IpV6Block","ClassId":"ippool.IpV6Block","Size":32}` + c := `{"Size":32,"ObjectType":"ippool.IpV6Block","ClassId":"ippool.IpV6Block","From":"From %d","To":"To %d"}` //test when the response is empty ffOpEmpty := flattenMapIppoolIpV6Block(p, d) @@ -12979,14 +12979,14 @@ func TestFlattenMapIppoolIpV6Block(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapIppoolIpV6Block(p, d)[0] - expectedOp := map[string]interface{}{"from": "From 1", "to": "To 1", "object_type": "ippool.IpV6Block", "class_id": "ippool.IpV6Block", "size": 32} + expectedOp := map[string]interface{}{"size": 32, "object_type": "ippool.IpV6Block", "class_id": "ippool.IpV6Block", "from": "From 1", "to": "To 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapIppoolIpV6Config(t *testing.T) { p := models.IppoolIpV6Config{} var d = &schema.ResourceData{} - c := `{"Gateway":"Gateway %d","Prefix":32,"PrimaryDns":"PrimaryDns %d","SecondaryDns":"SecondaryDns %d","ObjectType":"ippool.IpV6Config","ClassId":"ippool.IpV6Config"}` + c := `{"ObjectType":"ippool.IpV6Config","ClassId":"ippool.IpV6Config","Gateway":"Gateway %d","Prefix":32,"PrimaryDns":"PrimaryDns %d","SecondaryDns":"SecondaryDns %d"}` //test when the response is empty ffOpEmpty := flattenMapIppoolIpV6Config(p, d) @@ -12997,14 +12997,14 @@ func TestFlattenMapIppoolIpV6Config(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapIppoolIpV6Config(p, d)[0] - expectedOp := map[string]interface{}{"gateway": "Gateway 1", "prefix": 32, "primary_dns": "PrimaryDns 1", "secondary_dns": "SecondaryDns 1", "object_type": "ippool.IpV6Config", "class_id": "ippool.IpV6Config"} + expectedOp := map[string]interface{}{"object_type": "ippool.IpV6Config", "class_id": "ippool.IpV6Config", "gateway": "Gateway 1", "prefix": 32, "primary_dns": "PrimaryDns 1", "secondary_dns": "SecondaryDns 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapIppoolPoolRelationship(t *testing.T) { p := models.IppoolPoolRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapIppoolPoolRelationship(p, d) @@ -13015,7 +13015,7 @@ func TestFlattenMapIppoolPoolRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapIppoolPoolRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -13040,7 +13040,7 @@ func TestFlattenMapIppoolPoolMemberRelationship(t *testing.T) { func TestFlattenMapIppoolShadowBlockRelationship(t *testing.T) { p := models.IppoolShadowBlockRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapIppoolShadowBlockRelationship(p, d) @@ -13051,7 +13051,7 @@ func TestFlattenMapIppoolShadowBlockRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapIppoolShadowBlockRelationship(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -13076,7 +13076,7 @@ func TestFlattenMapIppoolShadowPoolRelationship(t *testing.T) { func TestFlattenMapIppoolUniverseRelationship(t *testing.T) { p := models.IppoolUniverseRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenMapIppoolUniverseRelationship(p, d) @@ -13087,14 +13087,14 @@ func TestFlattenMapIppoolUniverseRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapIppoolUniverseRelationship(p, d)[0] - expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} + expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapIqnpoolBlockRelationship(t *testing.T) { p := models.IqnpoolBlockRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapIqnpoolBlockRelationship(p, d) @@ -13105,14 +13105,14 @@ func TestFlattenMapIqnpoolBlockRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapIqnpoolBlockRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapIqnpoolIqnSuffixBlock(t *testing.T) { p := models.IqnpoolIqnSuffixBlock{} var d = &schema.ResourceData{} - c := `{"Size":32,"From":32,"Suffix":"Suffix %d","To":32,"ObjectType":"iqnpool.IqnSuffixBlock","ClassId":"iqnpool.IqnSuffixBlock"}` + c := `{"ObjectType":"iqnpool.IqnSuffixBlock","ClassId":"iqnpool.IqnSuffixBlock","Size":32,"From":32,"Suffix":"Suffix %d","To":32}` //test when the response is empty ffOpEmpty := flattenMapIqnpoolIqnSuffixBlock(p, d) @@ -13123,7 +13123,7 @@ func TestFlattenMapIqnpoolIqnSuffixBlock(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapIqnpoolIqnSuffixBlock(p, d)[0] - expectedOp := map[string]interface{}{"size": 32, "from": 32, "suffix": "Suffix 1", "to": 32, "object_type": "iqnpool.IqnSuffixBlock", "class_id": "iqnpool.IqnSuffixBlock"} + expectedOp := map[string]interface{}{"object_type": "iqnpool.IqnSuffixBlock", "class_id": "iqnpool.IqnSuffixBlock", "size": 32, "from": 32, "suffix": "Suffix 1", "to": 32} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -13166,7 +13166,7 @@ func TestFlattenMapIqnpoolPoolRelationship(t *testing.T) { func TestFlattenMapIqnpoolPoolMemberRelationship(t *testing.T) { p := models.IqnpoolPoolMemberRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenMapIqnpoolPoolMemberRelationship(p, d) @@ -13177,14 +13177,14 @@ func TestFlattenMapIqnpoolPoolMemberRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapIqnpoolPoolMemberRelationship(p, d)[0] - expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} + expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapIqnpoolUniverseRelationship(t *testing.T) { p := models.IqnpoolUniverseRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapIqnpoolUniverseRelationship(p, d) @@ -13195,14 +13195,14 @@ func TestFlattenMapIqnpoolUniverseRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapIqnpoolUniverseRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapKubernetesAciCniProfileRelationship(t *testing.T) { p := models.KubernetesAciCniProfileRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapKubernetesAciCniProfileRelationship(p, d) @@ -13213,14 +13213,14 @@ func TestFlattenMapKubernetesAciCniProfileRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapKubernetesAciCniProfileRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapKubernetesActionInfo(t *testing.T) { p := models.KubernetesActionInfo{} var d = &schema.ResourceData{} - c := `{"Status":"Status %d","FailureReason":"FailureReason %d","Name":"Name %d","ObjectType":"kubernetes.ActionInfo","ClassId":"kubernetes.ActionInfo"}` + c := `{"FailureReason":"FailureReason %d","Name":"Name %d","Status":"Status %d","ObjectType":"kubernetes.ActionInfo","ClassId":"kubernetes.ActionInfo"}` //test when the response is empty ffOpEmpty := flattenMapKubernetesActionInfo(p, d) @@ -13231,14 +13231,14 @@ func TestFlattenMapKubernetesActionInfo(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapKubernetesActionInfo(p, d)[0] - expectedOp := map[string]interface{}{"status": "Status 1", "failure_reason": "FailureReason 1", "name": "Name 1", "object_type": "kubernetes.ActionInfo", "class_id": "kubernetes.ActionInfo"} + expectedOp := map[string]interface{}{"failure_reason": "FailureReason 1", "name": "Name 1", "status": "Status 1", "object_type": "kubernetes.ActionInfo", "class_id": "kubernetes.ActionInfo"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapKubernetesAddonConfiguration(t *testing.T) { p := models.KubernetesAddonConfiguration{} var d = &schema.ResourceData{} - c := `{"UpgradeStrategy":"UpgradeStrategy %d","ObjectType":"kubernetes.AddonConfiguration","ClassId":"kubernetes.AddonConfiguration","InstallStrategy":"InstallStrategy %d","ReleaseName":"ReleaseName %d","ReleaseNamespace":"ReleaseNamespace %d","Overrides":"Overrides %d"}` + c := `{"InstallStrategy":"InstallStrategy %d","ObjectType":"kubernetes.AddonConfiguration","ReleaseName":"ReleaseName %d","UpgradeStrategy":"UpgradeStrategy %d","ClassId":"kubernetes.AddonConfiguration","Overrides":"Overrides %d","ReleaseNamespace":"ReleaseNamespace %d"}` //test when the response is empty ffOpEmpty := flattenMapKubernetesAddonConfiguration(p, d) @@ -13249,14 +13249,14 @@ func TestFlattenMapKubernetesAddonConfiguration(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapKubernetesAddonConfiguration(p, d)[0] - expectedOp := map[string]interface{}{"upgrade_strategy": "UpgradeStrategy 1", "object_type": "kubernetes.AddonConfiguration", "class_id": "kubernetes.AddonConfiguration", "install_strategy": "InstallStrategy 1", "release_name": "ReleaseName 1", "release_namespace": "ReleaseNamespace 1", "overrides": "Overrides 1"} + expectedOp := map[string]interface{}{"install_strategy": "InstallStrategy 1", "object_type": "kubernetes.AddonConfiguration", "release_name": "ReleaseName 1", "upgrade_strategy": "UpgradeStrategy 1", "class_id": "kubernetes.AddonConfiguration", "overrides": "Overrides 1", "release_namespace": "ReleaseNamespace 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapKubernetesAddonDefinitionRelationship(t *testing.T) { p := models.KubernetesAddonDefinitionRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenMapKubernetesAddonDefinitionRelationship(p, d) @@ -13267,14 +13267,14 @@ func TestFlattenMapKubernetesAddonDefinitionRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapKubernetesAddonDefinitionRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapKubernetesBaremetalNetworkInfo(t *testing.T) { p := models.KubernetesBaremetalNetworkInfo{} var d = &schema.ResourceData{} - c := `{"ObjectType":"kubernetes.BaremetalNetworkInfo","ClassId":"kubernetes.BaremetalNetworkInfo"}` + c := `{"ClassId":"kubernetes.BaremetalNetworkInfo","ObjectType":"kubernetes.BaremetalNetworkInfo"}` //test when the response is empty ffOpEmpty := flattenMapKubernetesBaremetalNetworkInfo(p, d) @@ -13285,7 +13285,7 @@ func TestFlattenMapKubernetesBaremetalNetworkInfo(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapKubernetesBaremetalNetworkInfo(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "kubernetes.BaremetalNetworkInfo", "class_id": "kubernetes.BaremetalNetworkInfo"} + expectedOp := map[string]interface{}{"class_id": "kubernetes.BaremetalNetworkInfo", "object_type": "kubernetes.BaremetalNetworkInfo"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -13310,7 +13310,7 @@ func TestFlattenMapKubernetesBaseInfrastructureProviderRelationship(t *testing.T func TestFlattenMapKubernetesBaseVirtualMachineInfraConfig(t *testing.T) { p := models.KubernetesBaseVirtualMachineInfraConfig{} var d = &schema.ResourceData{} - c := `{"ClassId":"kubernetes.BaseVirtualMachineInfraConfig","ObjectType":"kubernetes.BaseVirtualMachineInfraConfig"}` + c := `{"ObjectType":"kubernetes.BaseVirtualMachineInfraConfig","ClassId":"kubernetes.BaseVirtualMachineInfraConfig"}` //test when the response is empty ffOpEmpty := flattenMapKubernetesBaseVirtualMachineInfraConfig(p, d) @@ -13321,14 +13321,14 @@ func TestFlattenMapKubernetesBaseVirtualMachineInfraConfig(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapKubernetesBaseVirtualMachineInfraConfig(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "kubernetes.BaseVirtualMachineInfraConfig", "object_type": "kubernetes.BaseVirtualMachineInfraConfig"} + expectedOp := map[string]interface{}{"object_type": "kubernetes.BaseVirtualMachineInfraConfig", "class_id": "kubernetes.BaseVirtualMachineInfraConfig"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapKubernetesCatalogRelationship(t *testing.T) { p := models.KubernetesCatalogRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenMapKubernetesCatalogRelationship(p, d) @@ -13339,14 +13339,14 @@ func TestFlattenMapKubernetesCatalogRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapKubernetesCatalogRelationship(p, d)[0] - expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} + expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapKubernetesClusterRelationship(t *testing.T) { p := models.KubernetesClusterRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapKubernetesClusterRelationship(p, d) @@ -13357,7 +13357,7 @@ func TestFlattenMapKubernetesClusterRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapKubernetesClusterRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -13382,7 +13382,7 @@ func TestFlattenMapKubernetesClusterAddonProfileRelationship(t *testing.T) { func TestFlattenMapKubernetesClusterCertificateConfiguration(t *testing.T) { p := models.KubernetesClusterCertificateConfiguration{} var d = &schema.ResourceData{} - c := `{"EtcdCert":"EtcdCert %d","ClassId":"kubernetes.ClusterCertificateConfiguration","SaPublicKey":"SaPublicKey %d","CaCert":"CaCert %d","ObjectType":"kubernetes.ClusterCertificateConfiguration","FrontProxyCert":"FrontProxyCert %d"}` + c := `{"SaPublicKey":"SaPublicKey %d","FrontProxyCert":"FrontProxyCert %d","ClassId":"kubernetes.ClusterCertificateConfiguration","CaCert":"CaCert %d","ObjectType":"kubernetes.ClusterCertificateConfiguration","EtcdCert":"EtcdCert %d"}` //test when the response is empty ffOpEmpty := flattenMapKubernetesClusterCertificateConfiguration(p, d) @@ -13393,14 +13393,14 @@ func TestFlattenMapKubernetesClusterCertificateConfiguration(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapKubernetesClusterCertificateConfiguration(p, d)[0] - expectedOp := map[string]interface{}{"etcd_cert": "EtcdCert 1", "class_id": "kubernetes.ClusterCertificateConfiguration", "sa_public_key": "SaPublicKey 1", "ca_cert": "CaCert 1", "object_type": "kubernetes.ClusterCertificateConfiguration", "front_proxy_cert": "FrontProxyCert 1"} + expectedOp := map[string]interface{}{"sa_public_key": "SaPublicKey 1", "front_proxy_cert": "FrontProxyCert 1", "class_id": "kubernetes.ClusterCertificateConfiguration", "ca_cert": "CaCert 1", "object_type": "kubernetes.ClusterCertificateConfiguration", "etcd_cert": "EtcdCert 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapKubernetesClusterManagementConfig(t *testing.T) { p := models.KubernetesClusterManagementConfig{} var d = &schema.ResourceData{} - c := `{"LoadBalancerCount":32,"MasterVip":"MasterVip %d","ObjectType":"kubernetes.ClusterManagementConfig","IsTacPasswdSet":true,"SshUser":"SshUser %d","ClassId":"kubernetes.ClusterManagementConfig"}` + c := `{"ClassId":"kubernetes.ClusterManagementConfig","IsTacPasswdSet":true,"ObjectType":"kubernetes.ClusterManagementConfig","SshUser":"SshUser %d","LoadBalancerCount":32,"MasterVip":"MasterVip %d"}` //test when the response is empty ffOpEmpty := flattenMapKubernetesClusterManagementConfig(p, d) @@ -13411,7 +13411,7 @@ func TestFlattenMapKubernetesClusterManagementConfig(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapKubernetesClusterManagementConfig(p, d)[0] - expectedOp := map[string]interface{}{"load_balancer_count": 32, "master_vip": "MasterVip 1", "object_type": "kubernetes.ClusterManagementConfig", "is_tac_passwd_set": true, "ssh_user": "SshUser 1", "class_id": "kubernetes.ClusterManagementConfig"} + expectedOp := map[string]interface{}{"class_id": "kubernetes.ClusterManagementConfig", "is_tac_passwd_set": true, "object_type": "kubernetes.ClusterManagementConfig", "ssh_user": "SshUser 1", "load_balancer_count": 32, "master_vip": "MasterVip 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -13436,7 +13436,7 @@ func TestFlattenMapKubernetesClusterProfileRelationship(t *testing.T) { func TestFlattenMapKubernetesCniConfig(t *testing.T) { p := models.KubernetesCniConfig{} var d = &schema.ResourceData{} - c := `{"ClassId":"kubernetes.CniConfig","Registry":"Registry %d","Version":"Version %d","ObjectType":"kubernetes.CniConfig"}` + c := `{"Registry":"Registry %d","Version":"Version %d","ClassId":"kubernetes.CniConfig","ObjectType":"kubernetes.CniConfig"}` //test when the response is empty ffOpEmpty := flattenMapKubernetesCniConfig(p, d) @@ -13447,14 +13447,14 @@ func TestFlattenMapKubernetesCniConfig(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapKubernetesCniConfig(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "kubernetes.CniConfig", "registry": "Registry 1", "nr_version": "Version 1", "object_type": "kubernetes.CniConfig"} + expectedOp := map[string]interface{}{"registry": "Registry 1", "nr_version": "Version 1", "class_id": "kubernetes.CniConfig", "object_type": "kubernetes.CniConfig"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapKubernetesConfigResultRelationship(t *testing.T) { p := models.KubernetesConfigResultRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenMapKubernetesConfigResultRelationship(p, d) @@ -13465,14 +13465,14 @@ func TestFlattenMapKubernetesConfigResultRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapKubernetesConfigResultRelationship(p, d)[0] - expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} + expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapKubernetesConfiguration(t *testing.T) { p := models.KubernetesConfiguration{} var d = &schema.ResourceData{} - c := `{"ObjectType":"kubernetes.Configuration","ClassId":"kubernetes.Configuration","KubeConfig":"KubeConfig %d"}` + c := `{"ClassId":"kubernetes.Configuration","KubeConfig":"KubeConfig %d","ObjectType":"kubernetes.Configuration"}` //test when the response is empty ffOpEmpty := flattenMapKubernetesConfiguration(p, d) @@ -13483,14 +13483,14 @@ func TestFlattenMapKubernetesConfiguration(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapKubernetesConfiguration(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "kubernetes.Configuration", "class_id": "kubernetes.Configuration", "kube_config": "KubeConfig 1"} + expectedOp := map[string]interface{}{"class_id": "kubernetes.Configuration", "kube_config": "KubeConfig 1", "object_type": "kubernetes.Configuration"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapKubernetesContainerRuntimePolicyRelationship(t *testing.T) { p := models.KubernetesContainerRuntimePolicyRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenMapKubernetesContainerRuntimePolicyRelationship(p, d) @@ -13501,14 +13501,14 @@ func TestFlattenMapKubernetesContainerRuntimePolicyRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapKubernetesContainerRuntimePolicyRelationship(p, d)[0] - expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} + expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapKubernetesDaemonSetStatus(t *testing.T) { p := models.KubernetesDaemonSetStatus{} var d = &schema.ResourceData{} - c := `{"ObjectType":"kubernetes.DaemonSetStatus","ClassId":"kubernetes.DaemonSetStatus","NumberMisscheduled":32,"UpdatedNumberScheduled":"UpdatedNumberScheduled %d","NumberReady":32,"CurrentNumberScheduled":32,"NumberAvailable":"NumberAvailable %d","ObservedGeneration":32,"DesiredNumberScheduled":32}` + c := `{"NumberReady":32,"NumberMisscheduled":32,"ClassId":"kubernetes.DaemonSetStatus","ObservedGeneration":32,"DesiredNumberScheduled":32,"UpdatedNumberScheduled":"UpdatedNumberScheduled %d","CurrentNumberScheduled":32,"NumberAvailable":"NumberAvailable %d","ObjectType":"kubernetes.DaemonSetStatus"}` //test when the response is empty ffOpEmpty := flattenMapKubernetesDaemonSetStatus(p, d) @@ -13519,14 +13519,14 @@ func TestFlattenMapKubernetesDaemonSetStatus(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapKubernetesDaemonSetStatus(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "kubernetes.DaemonSetStatus", "class_id": "kubernetes.DaemonSetStatus", "number_misscheduled": 32, "updated_number_scheduled": "UpdatedNumberScheduled 1", "number_ready": 32, "current_number_scheduled": 32, "number_available": "NumberAvailable 1", "observed_generation": 32, "desired_number_scheduled": 32} + expectedOp := map[string]interface{}{"number_ready": 32, "number_misscheduled": 32, "class_id": "kubernetes.DaemonSetStatus", "observed_generation": 32, "desired_number_scheduled": 32, "updated_number_scheduled": "UpdatedNumberScheduled 1", "current_number_scheduled": 32, "number_available": "NumberAvailable 1", "object_type": "kubernetes.DaemonSetStatus"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapKubernetesDeploymentStatus(t *testing.T) { p := models.KubernetesDeploymentStatus{} var d = &schema.ResourceData{} - c := `{"ObservedGeneration":32,"ReadyReplicas":32,"Replicas":32,"ObjectType":"kubernetes.DeploymentStatus","ClassId":"kubernetes.DeploymentStatus","UpdatedReplicas":32,"AvailableReplicas":32}` + c := `{"ReadyReplicas":32,"Replicas":32,"UpdatedReplicas":32,"AvailableReplicas":32,"ObjectType":"kubernetes.DeploymentStatus","ClassId":"kubernetes.DeploymentStatus","ObservedGeneration":32}` //test when the response is empty ffOpEmpty := flattenMapKubernetesDeploymentStatus(p, d) @@ -13537,14 +13537,14 @@ func TestFlattenMapKubernetesDeploymentStatus(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapKubernetesDeploymentStatus(p, d)[0] - expectedOp := map[string]interface{}{"observed_generation": 32, "ready_replicas": 32, "replicas": 32, "object_type": "kubernetes.DeploymentStatus", "class_id": "kubernetes.DeploymentStatus", "updated_replicas": 32, "available_replicas": 32} + expectedOp := map[string]interface{}{"ready_replicas": 32, "replicas": 32, "updated_replicas": 32, "available_replicas": 32, "object_type": "kubernetes.DeploymentStatus", "class_id": "kubernetes.DeploymentStatus", "observed_generation": 32} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapKubernetesIngressStatus(t *testing.T) { p := models.KubernetesIngressStatus{} var d = &schema.ResourceData{} - c := `{"ClassId":"kubernetes.IngressStatus","ObjectType":"kubernetes.IngressStatus"}` + c := `{"ObjectType":"kubernetes.IngressStatus","ClassId":"kubernetes.IngressStatus"}` //test when the response is empty ffOpEmpty := flattenMapKubernetesIngressStatus(p, d) @@ -13555,14 +13555,14 @@ func TestFlattenMapKubernetesIngressStatus(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapKubernetesIngressStatus(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "kubernetes.IngressStatus", "object_type": "kubernetes.IngressStatus"} + expectedOp := map[string]interface{}{"object_type": "kubernetes.IngressStatus", "class_id": "kubernetes.IngressStatus"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapKubernetesNetworkPolicyRelationship(t *testing.T) { p := models.KubernetesNetworkPolicyRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenMapKubernetesNetworkPolicyRelationship(p, d) @@ -13573,14 +13573,14 @@ func TestFlattenMapKubernetesNetworkPolicyRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapKubernetesNetworkPolicyRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapKubernetesNodeGroupProfileRelationship(t *testing.T) { p := models.KubernetesNodeGroupProfileRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenMapKubernetesNodeGroupProfileRelationship(p, d) @@ -13591,14 +13591,14 @@ func TestFlattenMapKubernetesNodeGroupProfileRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapKubernetesNodeGroupProfileRelationship(p, d)[0] - expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} + expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapKubernetesNodeInfo(t *testing.T) { p := models.KubernetesNodeInfo{} var d = &schema.ResourceData{} - c := `{"OsImage":"OsImage %d","KernelVersion":"KernelVersion %d","MachineId":"MachineId %d","ClassId":"kubernetes.NodeInfo","ObjectType":"kubernetes.NodeInfo","KubeProxyVersion":"KubeProxyVersion %d","OperatingSystem":"OperatingSystem %d","Architecture":"Architecture %d","KubeletVersion":"KubeletVersion %d","BootId":"BootId %d","ContainerRuntimeVersion":"ContainerRuntimeVersion %d","SystemUuid":"SystemUuid %d"}` + c := `{"ContainerRuntimeVersion":"ContainerRuntimeVersion %d","KubeProxyVersion":"KubeProxyVersion %d","KubeletVersion":"KubeletVersion %d","SystemUuid":"SystemUuid %d","Architecture":"Architecture %d","OsImage":"OsImage %d","MachineId":"MachineId %d","ObjectType":"kubernetes.NodeInfo","KernelVersion":"KernelVersion %d","BootId":"BootId %d","OperatingSystem":"OperatingSystem %d","ClassId":"kubernetes.NodeInfo"}` //test when the response is empty ffOpEmpty := flattenMapKubernetesNodeInfo(p, d) @@ -13609,14 +13609,14 @@ func TestFlattenMapKubernetesNodeInfo(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapKubernetesNodeInfo(p, d)[0] - expectedOp := map[string]interface{}{"os_image": "OsImage 1", "kernel_version": "KernelVersion 1", "machine_id": "MachineId 1", "class_id": "kubernetes.NodeInfo", "object_type": "kubernetes.NodeInfo", "kube_proxy_version": "KubeProxyVersion 1", "operating_system": "OperatingSystem 1", "architecture": "Architecture 1", "kubelet_version": "KubeletVersion 1", "boot_id": "BootId 1", "container_runtime_version": "ContainerRuntimeVersion 1", "system_uuid": "SystemUuid 1"} + expectedOp := map[string]interface{}{"container_runtime_version": "ContainerRuntimeVersion 1", "kube_proxy_version": "KubeProxyVersion 1", "kubelet_version": "KubeletVersion 1", "system_uuid": "SystemUuid 1", "architecture": "Architecture 1", "os_image": "OsImage 1", "machine_id": "MachineId 1", "object_type": "kubernetes.NodeInfo", "kernel_version": "KernelVersion 1", "boot_id": "BootId 1", "operating_system": "OperatingSystem 1", "class_id": "kubernetes.NodeInfo"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapKubernetesNodeProfileRelationship(t *testing.T) { p := models.KubernetesNodeProfileRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenMapKubernetesNodeProfileRelationship(p, d) @@ -13627,14 +13627,14 @@ func TestFlattenMapKubernetesNodeProfileRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapKubernetesNodeProfileRelationship(p, d)[0] - expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} + expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapKubernetesNodeSpec(t *testing.T) { p := models.KubernetesNodeSpec{} var d = &schema.ResourceData{} - c := `{"PodCidr":"PodCidr %d","ProviderId":"ProviderId %d","ObjectType":"kubernetes.NodeSpec","ClassId":"kubernetes.NodeSpec"}` + c := `{"ClassId":"kubernetes.NodeSpec","ObjectType":"kubernetes.NodeSpec","PodCidr":"PodCidr %d","ProviderId":"ProviderId %d"}` //test when the response is empty ffOpEmpty := flattenMapKubernetesNodeSpec(p, d) @@ -13645,14 +13645,14 @@ func TestFlattenMapKubernetesNodeSpec(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapKubernetesNodeSpec(p, d)[0] - expectedOp := map[string]interface{}{"pod_cidr": "PodCidr 1", "provider_id": "ProviderId 1", "object_type": "kubernetes.NodeSpec", "class_id": "kubernetes.NodeSpec"} + expectedOp := map[string]interface{}{"class_id": "kubernetes.NodeSpec", "object_type": "kubernetes.NodeSpec", "pod_cidr": "PodCidr 1", "provider_id": "ProviderId 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapKubernetesObjectMeta(t *testing.T) { p := models.KubernetesObjectMeta{} var d = &schema.ResourceData{} - c := `{"ClassId":"kubernetes.ObjectMeta","Namespace":"Namespace %d","ResourceVersion":"ResourceVersion %d","Uuid":"Uuid %d","CreationTimestamp":"CreationTimestamp %d","Name":"Name %d","ObjectType":"kubernetes.ObjectMeta"}` + c := `{"CreationTimestamp":"CreationTimestamp %d","Name":"Name %d","Namespace":"Namespace %d","ResourceVersion":"ResourceVersion %d","Uuid":"Uuid %d","ObjectType":"kubernetes.ObjectMeta","ClassId":"kubernetes.ObjectMeta"}` //test when the response is empty ffOpEmpty := flattenMapKubernetesObjectMeta(p, d) @@ -13663,14 +13663,14 @@ func TestFlattenMapKubernetesObjectMeta(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapKubernetesObjectMeta(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "kubernetes.ObjectMeta", "namespace": "Namespace 1", "resource_version": "ResourceVersion 1", "uuid": "Uuid 1", "creation_timestamp": "CreationTimestamp 1", "name": "Name 1", "object_type": "kubernetes.ObjectMeta"} + expectedOp := map[string]interface{}{"creation_timestamp": "CreationTimestamp 1", "name": "Name 1", "namespace": "Namespace 1", "resource_version": "ResourceVersion 1", "uuid": "Uuid 1", "object_type": "kubernetes.ObjectMeta", "class_id": "kubernetes.ObjectMeta"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapKubernetesPodStatus(t *testing.T) { p := models.KubernetesPodStatus{} var d = &schema.ResourceData{} - c := `{"Phase":"Phase %d","PodIp":"PodIp %d","QosClass":"QosClass %d","StartTime":"StartTime %d","ObjectType":"kubernetes.PodStatus","ClassId":"kubernetes.PodStatus","HostIp":"HostIp %d"}` + c := `{"QosClass":"QosClass %d","StartTime":"StartTime %d","HostIp":"HostIp %d","Phase":"Phase %d","PodIp":"PodIp %d","ObjectType":"kubernetes.PodStatus","ClassId":"kubernetes.PodStatus"}` //test when the response is empty ffOpEmpty := flattenMapKubernetesPodStatus(p, d) @@ -13681,14 +13681,14 @@ func TestFlattenMapKubernetesPodStatus(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapKubernetesPodStatus(p, d)[0] - expectedOp := map[string]interface{}{"phase": "Phase 1", "pod_ip": "PodIp 1", "qos_class": "QosClass 1", "start_time": "StartTime 1", "object_type": "kubernetes.PodStatus", "class_id": "kubernetes.PodStatus", "host_ip": "HostIp 1"} + expectedOp := map[string]interface{}{"qos_class": "QosClass 1", "start_time": "StartTime 1", "host_ip": "HostIp 1", "phase": "Phase 1", "pod_ip": "PodIp 1", "object_type": "kubernetes.PodStatus", "class_id": "kubernetes.PodStatus"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapKubernetesProxyConfig(t *testing.T) { p := models.KubernetesProxyConfig{} var d = &schema.ResourceData{} - c := `{"Hostname":"Hostname %d","Protocol":"Protocol %d","Username":"Username %d","ClassId":"kubernetes.ProxyConfig","IsPasswordSet":true,"Port":32,"ObjectType":"kubernetes.ProxyConfig"}` + c := `{"IsPasswordSet":true,"ObjectType":"kubernetes.ProxyConfig","ClassId":"kubernetes.ProxyConfig","Username":"Username %d","Protocol":"Protocol %d","Hostname":"Hostname %d","Port":32}` //test when the response is empty ffOpEmpty := flattenMapKubernetesProxyConfig(p, d) @@ -13699,7 +13699,7 @@ func TestFlattenMapKubernetesProxyConfig(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapKubernetesProxyConfig(p, d)[0] - expectedOp := map[string]interface{}{"hostname": "Hostname 1", "protocol": "Protocol 1", "username": "Username 1", "class_id": "kubernetes.ProxyConfig", "is_password_set": true, "port": 32, "object_type": "kubernetes.ProxyConfig"} + expectedOp := map[string]interface{}{"is_password_set": true, "object_type": "kubernetes.ProxyConfig", "class_id": "kubernetes.ProxyConfig", "username": "Username 1", "protocol": "Protocol 1", "hostname": "Hostname 1", "port": 32} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -13724,7 +13724,7 @@ func TestFlattenMapKubernetesServiceStatus(t *testing.T) { func TestFlattenMapKubernetesStatefulSetStatus(t *testing.T) { p := models.KubernetesStatefulSetStatus{} var d = &schema.ResourceData{} - c := `{"UpdateRevision":"UpdateRevision %d","UpdatedReplicas":32,"AvailableReplicas":32,"CollisionCount":32,"ReadyReplicas":32,"ClassId":"kubernetes.StatefulSetStatus","CurrentRevision":"CurrentRevision %d","ObjectType":"kubernetes.StatefulSetStatus","ObservedGeneration":32,"Replicas":32}` + c := `{"CollisionCount":32,"ObservedGeneration":32,"UpdatedReplicas":32,"AvailableReplicas":32,"CurrentRevision":"CurrentRevision %d","ObjectType":"kubernetes.StatefulSetStatus","ClassId":"kubernetes.StatefulSetStatus","UpdateRevision":"UpdateRevision %d","Replicas":32,"ReadyReplicas":32}` //test when the response is empty ffOpEmpty := flattenMapKubernetesStatefulSetStatus(p, d) @@ -13735,14 +13735,14 @@ func TestFlattenMapKubernetesStatefulSetStatus(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapKubernetesStatefulSetStatus(p, d)[0] - expectedOp := map[string]interface{}{"update_revision": "UpdateRevision 1", "updated_replicas": 32, "available_replicas": 32, "collision_count": 32, "ready_replicas": 32, "class_id": "kubernetes.StatefulSetStatus", "current_revision": "CurrentRevision 1", "object_type": "kubernetes.StatefulSetStatus", "observed_generation": 32, "replicas": 32} + expectedOp := map[string]interface{}{"collision_count": 32, "observed_generation": 32, "updated_replicas": 32, "available_replicas": 32, "current_revision": "CurrentRevision 1", "object_type": "kubernetes.StatefulSetStatus", "class_id": "kubernetes.StatefulSetStatus", "update_revision": "UpdateRevision 1", "replicas": 32, "ready_replicas": 32} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapKubernetesSysConfigPolicyRelationship(t *testing.T) { p := models.KubernetesSysConfigPolicyRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenMapKubernetesSysConfigPolicyRelationship(p, d) @@ -13753,14 +13753,14 @@ func TestFlattenMapKubernetesSysConfigPolicyRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapKubernetesSysConfigPolicyRelationship(p, d)[0] - expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} + expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapKubernetesTrustedRegistriesPolicyRelationship(t *testing.T) { p := models.KubernetesTrustedRegistriesPolicyRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenMapKubernetesTrustedRegistriesPolicyRelationship(p, d) @@ -13771,14 +13771,14 @@ func TestFlattenMapKubernetesTrustedRegistriesPolicyRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapKubernetesTrustedRegistriesPolicyRelationship(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} + expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapKubernetesVersionRelationship(t *testing.T) { p := models.KubernetesVersionRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapKubernetesVersionRelationship(p, d) @@ -13789,14 +13789,14 @@ func TestFlattenMapKubernetesVersionRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapKubernetesVersionRelationship(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapKubernetesVersionPolicyRelationship(t *testing.T) { p := models.KubernetesVersionPolicyRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapKubernetesVersionPolicyRelationship(p, d) @@ -13807,14 +13807,14 @@ func TestFlattenMapKubernetesVersionPolicyRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapKubernetesVersionPolicyRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapKubernetesVirtualMachineInfraConfigPolicyRelationship(t *testing.T) { p := models.KubernetesVirtualMachineInfraConfigPolicyRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenMapKubernetesVirtualMachineInfraConfigPolicyRelationship(p, d) @@ -13825,14 +13825,14 @@ func TestFlattenMapKubernetesVirtualMachineInfraConfigPolicyRelationship(t *test err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapKubernetesVirtualMachineInfraConfigPolicyRelationship(p, d)[0] - expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} + expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapKubernetesVirtualMachineInstanceTypeRelationship(t *testing.T) { p := models.KubernetesVirtualMachineInstanceTypeRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenMapKubernetesVirtualMachineInstanceTypeRelationship(p, d) @@ -13843,14 +13843,14 @@ func TestFlattenMapKubernetesVirtualMachineInstanceTypeRelationship(t *testing.T err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapKubernetesVirtualMachineInstanceTypeRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapKvmSessionRelationship(t *testing.T) { p := models.KvmSessionRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenMapKvmSessionRelationship(p, d) @@ -13861,14 +13861,14 @@ func TestFlattenMapKvmSessionRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapKvmSessionRelationship(p, d)[0] - expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} + expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapKvmTunnelRelationship(t *testing.T) { p := models.KvmTunnelRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenMapKvmTunnelRelationship(p, d) @@ -13879,7 +13879,7 @@ func TestFlattenMapKvmTunnelRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapKvmTunnelRelationship(p, d)[0] - expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} + expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -13904,7 +13904,7 @@ func TestFlattenMapLicenseAccountLicenseDataRelationship(t *testing.T) { func TestFlattenMapLicenseCustomerOpRelationship(t *testing.T) { p := models.LicenseCustomerOpRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapLicenseCustomerOpRelationship(p, d) @@ -13915,14 +13915,14 @@ func TestFlattenMapLicenseCustomerOpRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapLicenseCustomerOpRelationship(p, d)[0] - expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} + expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapLicenseIksCustomerOpRelationship(t *testing.T) { p := models.LicenseIksCustomerOpRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenMapLicenseIksCustomerOpRelationship(p, d) @@ -13933,14 +13933,14 @@ func TestFlattenMapLicenseIksCustomerOpRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapLicenseIksCustomerOpRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapLicenseIksLicenseCountRelationship(t *testing.T) { p := models.LicenseIksLicenseCountRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenMapLicenseIksLicenseCountRelationship(p, d) @@ -13951,14 +13951,14 @@ func TestFlattenMapLicenseIksLicenseCountRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapLicenseIksLicenseCountRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapLicenseIwoCustomerOpRelationship(t *testing.T) { p := models.LicenseIwoCustomerOpRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenMapLicenseIwoCustomerOpRelationship(p, d) @@ -13969,14 +13969,14 @@ func TestFlattenMapLicenseIwoCustomerOpRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapLicenseIwoCustomerOpRelationship(p, d)[0] - expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} + expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapLicenseIwoLicenseCountRelationship(t *testing.T) { p := models.LicenseIwoLicenseCountRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenMapLicenseIwoLicenseCountRelationship(p, d) @@ -13987,14 +13987,14 @@ func TestFlattenMapLicenseIwoLicenseCountRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapLicenseIwoLicenseCountRelationship(p, d)[0] - expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} + expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapLicenseSmartlicenseTokenRelationship(t *testing.T) { p := models.LicenseSmartlicenseTokenRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapLicenseSmartlicenseTokenRelationship(p, d) @@ -14005,14 +14005,14 @@ func TestFlattenMapLicenseSmartlicenseTokenRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapLicenseSmartlicenseTokenRelationship(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapMacpoolBlock(t *testing.T) { p := models.MacpoolBlock{} var d = &schema.ResourceData{} - c := `{"ClassId":"macpool.Block","Size":32,"ObjectType":"macpool.Block","To":"To %d","From":"From %d"}` + c := `{"ObjectType":"macpool.Block","ClassId":"macpool.Block","Size":32,"From":"From %d","To":"To %d"}` //test when the response is empty ffOpEmpty := flattenMapMacpoolBlock(p, d) @@ -14023,7 +14023,7 @@ func TestFlattenMapMacpoolBlock(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapMacpoolBlock(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "macpool.Block", "size": 32, "object_type": "macpool.Block", "to": "To 1", "from": "From 1"} + expectedOp := map[string]interface{}{"object_type": "macpool.Block", "class_id": "macpool.Block", "size": 32, "from": "From 1", "to": "To 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -14120,7 +14120,7 @@ func TestFlattenMapMacpoolUniverseRelationship(t *testing.T) { func TestFlattenMapManagementControllerRelationship(t *testing.T) { p := models.ManagementControllerRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenMapManagementControllerRelationship(p, d) @@ -14131,14 +14131,14 @@ func TestFlattenMapManagementControllerRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapManagementControllerRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapManagementEntityRelationship(t *testing.T) { p := models.ManagementEntityRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapManagementEntityRelationship(p, d) @@ -14149,14 +14149,14 @@ func TestFlattenMapManagementEntityRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapManagementEntityRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapMemoryArrayRelationship(t *testing.T) { p := models.MemoryArrayRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenMapMemoryArrayRelationship(p, d) @@ -14167,7 +14167,7 @@ func TestFlattenMapMemoryArrayRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapMemoryArrayRelationship(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} + expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -14192,7 +14192,7 @@ func TestFlattenMapMemoryPersistentMemoryConfigResultRelationship(t *testing.T) func TestFlattenMapMemoryPersistentMemoryConfigurationRelationship(t *testing.T) { p := models.MemoryPersistentMemoryConfigurationRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenMapMemoryPersistentMemoryConfigurationRelationship(p, d) @@ -14203,14 +14203,14 @@ func TestFlattenMapMemoryPersistentMemoryConfigurationRelationship(t *testing.T) err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapMemoryPersistentMemoryConfigurationRelationship(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} + expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapMemoryPersistentMemoryLocalSecurity(t *testing.T) { p := models.MemoryPersistentMemoryLocalSecurity{} var d = &schema.ResourceData{} - c := `{"ClassId":"memory.PersistentMemoryLocalSecurity","Enabled":true,"IsSecurePassphraseSet":true,"ObjectType":"memory.PersistentMemoryLocalSecurity"}` + c := `{"ClassId":"memory.PersistentMemoryLocalSecurity","ObjectType":"memory.PersistentMemoryLocalSecurity","Enabled":true,"IsSecurePassphraseSet":true}` //test when the response is empty ffOpEmpty := flattenMapMemoryPersistentMemoryLocalSecurity(p, d) @@ -14221,14 +14221,14 @@ func TestFlattenMapMemoryPersistentMemoryLocalSecurity(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapMemoryPersistentMemoryLocalSecurity(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "memory.PersistentMemoryLocalSecurity", "enabled": true, "is_secure_passphrase_set": true, "object_type": "memory.PersistentMemoryLocalSecurity"} + expectedOp := map[string]interface{}{"class_id": "memory.PersistentMemoryLocalSecurity", "object_type": "memory.PersistentMemoryLocalSecurity", "enabled": true, "is_secure_passphrase_set": true} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapMemoryPersistentMemoryRegionRelationship(t *testing.T) { p := models.MemoryPersistentMemoryRegionRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenMapMemoryPersistentMemoryRegionRelationship(p, d) @@ -14239,14 +14239,14 @@ func TestFlattenMapMemoryPersistentMemoryRegionRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapMemoryPersistentMemoryRegionRelationship(p, d)[0] - expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} + expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapMoBaseMo(t *testing.T) { p := models.MoBaseMo{} var d = &schema.ResourceData{} - c := `{"AccountMoid":"AccountMoid %d","DomainGroupMoid":"DomainGroupMoid %d","SharedScope":"SharedScope %d","ObjectType":"mo.BaseMo","Moid":"Moid %d","ClassId":"mo.BaseMo"}` + c := `{"SharedScope":"SharedScope %d","ClassId":"mo.BaseMo","ObjectType":"mo.BaseMo","Moid":"Moid %d","DomainGroupMoid":"DomainGroupMoid %d","AccountMoid":"AccountMoid %d"}` //test when the response is empty ffOpEmpty := flattenMapMoBaseMo(p, d) @@ -14257,7 +14257,7 @@ func TestFlattenMapMoBaseMo(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapMoBaseMo(p, d)[0] - expectedOp := map[string]interface{}{"account_moid": "AccountMoid 1", "domain_group_moid": "DomainGroupMoid 1", "shared_scope": "SharedScope 1", "object_type": "mo.BaseMo", "moid": "Moid 1", "class_id": "mo.BaseMo"} + expectedOp := map[string]interface{}{"shared_scope": "SharedScope 1", "class_id": "mo.BaseMo", "object_type": "mo.BaseMo", "moid": "Moid 1", "domain_group_moid": "DomainGroupMoid 1", "account_moid": "AccountMoid 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -14282,7 +14282,7 @@ func TestFlattenMapMoBaseMoRelationship(t *testing.T) { func TestFlattenMapMoMoRef(t *testing.T) { p := models.MoMoRef{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenMapMoMoRef(p, d) @@ -14293,14 +14293,14 @@ func TestFlattenMapMoMoRef(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapMoMoRef(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapMoVersionContext(t *testing.T) { p := models.MoVersionContext{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.VersionContext","ClassId":"mo.VersionContext","Version":"Version %d","VersionType":"VersionType %d"}` + c := `{"VersionType":"VersionType %d","ObjectType":"mo.VersionContext","ClassId":"mo.VersionContext","Version":"Version %d"}` //test when the response is empty ffOpEmpty := flattenMapMoVersionContext(p, d) @@ -14311,14 +14311,14 @@ func TestFlattenMapMoVersionContext(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapMoVersionContext(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "mo.VersionContext", "class_id": "mo.VersionContext", "nr_version": "Version 1", "version_type": "VersionType 1"} + expectedOp := map[string]interface{}{"version_type": "VersionType 1", "object_type": "mo.VersionContext", "class_id": "mo.VersionContext", "nr_version": "Version 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapNetworkElementRelationship(t *testing.T) { p := models.NetworkElementRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenMapNetworkElementRelationship(p, d) @@ -14329,14 +14329,14 @@ func TestFlattenMapNetworkElementRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapNetworkElementRelationship(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} + expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapNetworkFcZoneInfoRelationship(t *testing.T) { p := models.NetworkFcZoneInfoRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapNetworkFcZoneInfoRelationship(p, d) @@ -14347,7 +14347,7 @@ func TestFlattenMapNetworkFcZoneInfoRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapNetworkFcZoneInfoRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -14390,7 +14390,7 @@ func TestFlattenMapNetworkVlanPortInfoRelationship(t *testing.T) { func TestFlattenMapNiaapiNewReleaseDetail(t *testing.T) { p := models.NiaapiNewReleaseDetail{} var d = &schema.ResourceData{} - c := `{"ReleaseNoteLink":"ReleaseNoteLink %d","Version":"Version %d","Description":"Description %d","ReleaseNoteLinkTitle":"ReleaseNoteLinkTitle %d","Title":"Title %d","ClassId":"niaapi.NewReleaseDetail","SoftwareDownloadLink":"SoftwareDownloadLink %d","SoftwareDownloadLinkTitle":"SoftwareDownloadLinkTitle %d","ObjectType":"niaapi.NewReleaseDetail","Link":"Link %d"}` + c := `{"ObjectType":"niaapi.NewReleaseDetail","ClassId":"niaapi.NewReleaseDetail","ReleaseNoteLink":"ReleaseNoteLink %d","SoftwareDownloadLink":"SoftwareDownloadLink %d","SoftwareDownloadLinkTitle":"SoftwareDownloadLinkTitle %d","Description":"Description %d","Title":"Title %d","Link":"Link %d","ReleaseNoteLinkTitle":"ReleaseNoteLinkTitle %d","Version":"Version %d"}` //test when the response is empty ffOpEmpty := flattenMapNiaapiNewReleaseDetail(p, d) @@ -14401,14 +14401,14 @@ func TestFlattenMapNiaapiNewReleaseDetail(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapNiaapiNewReleaseDetail(p, d)[0] - expectedOp := map[string]interface{}{"release_note_link": "ReleaseNoteLink 1", "nr_version": "Version 1", "description": "Description 1", "release_note_link_title": "ReleaseNoteLinkTitle 1", "title": "Title 1", "class_id": "niaapi.NewReleaseDetail", "software_download_link": "SoftwareDownloadLink 1", "software_download_link_title": "SoftwareDownloadLinkTitle 1", "object_type": "niaapi.NewReleaseDetail", "link": "Link 1"} + expectedOp := map[string]interface{}{"object_type": "niaapi.NewReleaseDetail", "class_id": "niaapi.NewReleaseDetail", "release_note_link": "ReleaseNoteLink 1", "software_download_link": "SoftwareDownloadLink 1", "software_download_link_title": "SoftwareDownloadLinkTitle 1", "description": "Description 1", "title": "Title 1", "link": "Link 1", "release_note_link_title": "ReleaseNoteLinkTitle 1", "nr_version": "Version 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapNiaapiVersionRegexPlatform(t *testing.T) { p := models.NiaapiVersionRegexPlatform{} var d = &schema.ResourceData{} - c := `{"Anyllregex":"Anyllregex %d","ObjectType":"niaapi.VersionRegexPlatform","ClassId":"niaapi.VersionRegexPlatform"}` + c := `{"ClassId":"niaapi.VersionRegexPlatform","ObjectType":"niaapi.VersionRegexPlatform","Anyllregex":"Anyllregex %d"}` //test when the response is empty ffOpEmpty := flattenMapNiaapiVersionRegexPlatform(p, d) @@ -14419,7 +14419,7 @@ func TestFlattenMapNiaapiVersionRegexPlatform(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapNiaapiVersionRegexPlatform(p, d)[0] - expectedOp := map[string]interface{}{"anyllregex": "Anyllregex 1", "object_type": "niaapi.VersionRegexPlatform", "class_id": "niaapi.VersionRegexPlatform"} + expectedOp := map[string]interface{}{"class_id": "niaapi.VersionRegexPlatform", "object_type": "niaapi.VersionRegexPlatform", "anyllregex": "Anyllregex 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -14444,7 +14444,7 @@ func TestFlattenMapNiatelemetryBootflashDetails(t *testing.T) { func TestFlattenMapNiatelemetryDiskinfo(t *testing.T) { p := models.NiatelemetryDiskinfo{} var d = &schema.ResourceData{} - c := `{"Free":32,"ObjectType":"niatelemetry.Diskinfo","ClassId":"niatelemetry.Diskinfo","Name":"Name %d","Total":32,"Used":32}` + c := `{"Used":32,"ObjectType":"niatelemetry.Diskinfo","ClassId":"niatelemetry.Diskinfo","Free":32,"Name":"Name %d","Total":32}` //test when the response is empty ffOpEmpty := flattenMapNiatelemetryDiskinfo(p, d) @@ -14455,14 +14455,14 @@ func TestFlattenMapNiatelemetryDiskinfo(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapNiatelemetryDiskinfo(p, d)[0] - expectedOp := map[string]interface{}{"free": 32, "object_type": "niatelemetry.Diskinfo", "class_id": "niatelemetry.Diskinfo", "name": "Name 1", "total": 32, "used": 32} + expectedOp := map[string]interface{}{"used": 32, "object_type": "niatelemetry.Diskinfo", "class_id": "niatelemetry.Diskinfo", "free": 32, "name": "Name 1", "total": 32} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapNiatelemetryInterface(t *testing.T) { p := models.NiatelemetryInterface{} var d = &schema.ResourceData{} - c := `{"InterfaceDownCount":32,"InterfaceUpCount":32,"ObjectType":"niatelemetry.Interface","ClassId":"niatelemetry.Interface"}` + c := `{"InterfaceDownCount":32,"ObjectType":"niatelemetry.Interface","ClassId":"niatelemetry.Interface","InterfaceUpCount":32}` //test when the response is empty ffOpEmpty := flattenMapNiatelemetryInterface(p, d) @@ -14473,14 +14473,14 @@ func TestFlattenMapNiatelemetryInterface(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapNiatelemetryInterface(p, d)[0] - expectedOp := map[string]interface{}{"interface_down_count": 32, "interface_up_count": 32, "object_type": "niatelemetry.Interface", "class_id": "niatelemetry.Interface"} + expectedOp := map[string]interface{}{"interface_down_count": 32, "object_type": "niatelemetry.Interface", "class_id": "niatelemetry.Interface", "interface_up_count": 32} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapNiatelemetryNetworkInfo(t *testing.T) { p := models.NiatelemetryNetworkInfo{} var d = &schema.ResourceData{} - c := `{"ClassId":"niatelemetry.NetworkInfo","Hostname":"Hostname %d","ManagementtIp":"ManagementtIp %d","OutofbandIp":"OutofbandIp %d","ObjectType":"niatelemetry.NetworkInfo"}` + c := `{"Hostname":"Hostname %d","ManagementtIp":"ManagementtIp %d","OutofbandIp":"OutofbandIp %d","ObjectType":"niatelemetry.NetworkInfo","ClassId":"niatelemetry.NetworkInfo"}` //test when the response is empty ffOpEmpty := flattenMapNiatelemetryNetworkInfo(p, d) @@ -14491,7 +14491,7 @@ func TestFlattenMapNiatelemetryNetworkInfo(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapNiatelemetryNetworkInfo(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "niatelemetry.NetworkInfo", "hostname": "Hostname 1", "managementt_ip": "ManagementtIp 1", "outofband_ip": "OutofbandIp 1", "object_type": "niatelemetry.NetworkInfo"} + expectedOp := map[string]interface{}{"hostname": "Hostname 1", "managementt_ip": "ManagementtIp 1", "outofband_ip": "OutofbandIp 1", "object_type": "niatelemetry.NetworkInfo", "class_id": "niatelemetry.NetworkInfo"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -14516,7 +14516,7 @@ func TestFlattenMapNiatelemetryNexusDashboardsRelationship(t *testing.T) { func TestFlattenMapNiatelemetryNiaInventoryRelationship(t *testing.T) { p := models.NiatelemetryNiaInventoryRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenMapNiatelemetryNiaInventoryRelationship(p, d) @@ -14527,14 +14527,14 @@ func TestFlattenMapNiatelemetryNiaInventoryRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapNiatelemetryNiaInventoryRelationship(p, d)[0] - expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} + expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapNiatelemetryNiaLicenseStateRelationship(t *testing.T) { p := models.NiatelemetryNiaLicenseStateRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenMapNiatelemetryNiaLicenseStateRelationship(p, d) @@ -14545,14 +14545,14 @@ func TestFlattenMapNiatelemetryNiaLicenseStateRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapNiatelemetryNiaLicenseStateRelationship(p, d)[0] - expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} + expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapNiatelemetryNvePacketCounters(t *testing.T) { p := models.NiatelemetryNvePacketCounters{} var d = &schema.ResourceData{} - c := `{"McastInpkts":32,"McastOutbytes":32,"UcastInpkts":32,"UcastOutpkts":32,"ObjectType":"niatelemetry.NvePacketCounters","ClassId":"niatelemetry.NvePacketCounters"}` + c := `{"McastInpkts":32,"ObjectType":"niatelemetry.NvePacketCounters","ClassId":"niatelemetry.NvePacketCounters","McastOutbytes":32,"UcastInpkts":32,"UcastOutpkts":32}` //test when the response is empty ffOpEmpty := flattenMapNiatelemetryNvePacketCounters(p, d) @@ -14563,14 +14563,14 @@ func TestFlattenMapNiatelemetryNvePacketCounters(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapNiatelemetryNvePacketCounters(p, d)[0] - expectedOp := map[string]interface{}{"mcast_inpkts": 32, "mcast_outbytes": 32, "ucast_inpkts": 32, "ucast_outpkts": 32, "object_type": "niatelemetry.NvePacketCounters", "class_id": "niatelemetry.NvePacketCounters"} + expectedOp := map[string]interface{}{"mcast_inpkts": 32, "object_type": "niatelemetry.NvePacketCounters", "class_id": "niatelemetry.NvePacketCounters", "mcast_outbytes": 32, "ucast_inpkts": 32, "ucast_outpkts": 32} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapNiatelemetryNveVni(t *testing.T) { p := models.NiatelemetryNveVni{} var d = &schema.ResourceData{} - c := `{"ObjectType":"niatelemetry.NveVni","DpVniUp":32,"CpVniUp":32,"DpVniCount":32,"ClassId":"niatelemetry.NveVni","DpVniDown":32,"CpVniCount":32,"CpVniDown":32}` + c := `{"ObjectType":"niatelemetry.NveVni","CpVniDown":32,"CpVniUp":32,"ClassId":"niatelemetry.NveVni","DpVniCount":32,"DpVniDown":32,"DpVniUp":32,"CpVniCount":32}` //test when the response is empty ffOpEmpty := flattenMapNiatelemetryNveVni(p, d) @@ -14581,14 +14581,14 @@ func TestFlattenMapNiatelemetryNveVni(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapNiatelemetryNveVni(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "niatelemetry.NveVni", "dp_vni_up": 32, "cp_vni_up": 32, "dp_vni_count": 32, "class_id": "niatelemetry.NveVni", "dp_vni_down": 32, "cp_vni_count": 32, "cp_vni_down": 32} + expectedOp := map[string]interface{}{"object_type": "niatelemetry.NveVni", "cp_vni_down": 32, "cp_vni_up": 32, "class_id": "niatelemetry.NveVni", "dp_vni_count": 32, "dp_vni_down": 32, "dp_vni_up": 32, "cp_vni_count": 32} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapNiatelemetryNxosBgpEvpn(t *testing.T) { p := models.NiatelemetryNxosBgpEvpn{} var d = &schema.ResourceData{} - c := `{"ClassId":"niatelemetry.NxosBgpEvpn","NxosEvpnMacCount":"NxosEvpnMacCount %d","TotalNetworks":32,"TotalPaths":32,"ObjectType":"niatelemetry.NxosBgpEvpn"}` + c := `{"TotalPaths":32,"NxosEvpnMacCount":"NxosEvpnMacCount %d","TotalNetworks":32,"ObjectType":"niatelemetry.NxosBgpEvpn","ClassId":"niatelemetry.NxosBgpEvpn"}` //test when the response is empty ffOpEmpty := flattenMapNiatelemetryNxosBgpEvpn(p, d) @@ -14599,14 +14599,14 @@ func TestFlattenMapNiatelemetryNxosBgpEvpn(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapNiatelemetryNxosBgpEvpn(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "niatelemetry.NxosBgpEvpn", "nxos_evpn_mac_count": "NxosEvpnMacCount 1", "total_networks": 32, "total_paths": 32, "object_type": "niatelemetry.NxosBgpEvpn"} + expectedOp := map[string]interface{}{"total_paths": 32, "nxos_evpn_mac_count": "NxosEvpnMacCount 1", "total_networks": 32, "object_type": "niatelemetry.NxosBgpEvpn", "class_id": "niatelemetry.NxosBgpEvpn"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapNiatelemetryNxosBgpMvpn(t *testing.T) { p := models.NiatelemetryNxosBgpMvpn{} var d = &schema.ResourceData{} - c := `{"NumberOfClusterLists":32,"NumberOfCommunities":32,"MemoryUsed":32,"TotalPaths":32,"ObjectType":"niatelemetry.NxosBgpMvpn","ClassId":"niatelemetry.NxosBgpMvpn","CapablePeers":32,"ConfiguredPeers":32,"TableVersion":32,"TotalNetworks":32}` + c := `{"NumberOfClusterLists":32,"NumberOfCommunities":32,"TotalPaths":32,"MemoryUsed":32,"ObjectType":"niatelemetry.NxosBgpMvpn","ClassId":"niatelemetry.NxosBgpMvpn","ConfiguredPeers":32,"TableVersion":32,"TotalNetworks":32,"CapablePeers":32}` //test when the response is empty ffOpEmpty := flattenMapNiatelemetryNxosBgpMvpn(p, d) @@ -14617,14 +14617,14 @@ func TestFlattenMapNiatelemetryNxosBgpMvpn(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapNiatelemetryNxosBgpMvpn(p, d)[0] - expectedOp := map[string]interface{}{"number_of_cluster_lists": 32, "number_of_communities": 32, "memory_used": 32, "total_paths": 32, "object_type": "niatelemetry.NxosBgpMvpn", "class_id": "niatelemetry.NxosBgpMvpn", "capable_peers": 32, "configured_peers": 32, "table_version": 32, "total_networks": 32} + expectedOp := map[string]interface{}{"number_of_cluster_lists": 32, "number_of_communities": 32, "total_paths": 32, "memory_used": 32, "object_type": "niatelemetry.NxosBgpMvpn", "class_id": "niatelemetry.NxosBgpMvpn", "configured_peers": 32, "table_version": 32, "total_networks": 32, "capable_peers": 32} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapNiatelemetryNxosVtp(t *testing.T) { p := models.NiatelemetryNxosVtp{} var d = &schema.ResourceData{} - c := `{"ObjectType":"niatelemetry.NxosVtp","ClassId":"niatelemetry.NxosVtp","RunningVersion":"RunningVersion %d","V2Mode":"V2Mode %d","PruningMode":"PruningMode %d","TrapEnabled":"TrapEnabled %d","Version":32,"OperMode":"OperMode %d"}` + c := `{"OperMode":"OperMode %d","PruningMode":"PruningMode %d","TrapEnabled":"TrapEnabled %d","ClassId":"niatelemetry.NxosVtp","ObjectType":"niatelemetry.NxosVtp","Version":32,"RunningVersion":"RunningVersion %d","V2Mode":"V2Mode %d"}` //test when the response is empty ffOpEmpty := flattenMapNiatelemetryNxosVtp(p, d) @@ -14635,14 +14635,14 @@ func TestFlattenMapNiatelemetryNxosVtp(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapNiatelemetryNxosVtp(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "niatelemetry.NxosVtp", "class_id": "niatelemetry.NxosVtp", "running_version": "RunningVersion 1", "v2_mode": "V2Mode 1", "pruning_mode": "PruningMode 1", "trap_enabled": "TrapEnabled 1", "nr_version": 32, "oper_mode": "OperMode 1"} + expectedOp := map[string]interface{}{"oper_mode": "OperMode 1", "pruning_mode": "PruningMode 1", "trap_enabled": "TrapEnabled 1", "class_id": "niatelemetry.NxosVtp", "object_type": "niatelemetry.NxosVtp", "nr_version": 32, "running_version": "RunningVersion 1", "v2_mode": "V2Mode 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapNiatelemetrySmartLicense(t *testing.T) { p := models.NiatelemetrySmartLicense{} var d = &schema.ResourceData{} - c := `{"ClassId":"niatelemetry.SmartLicense","ObjectType":"niatelemetry.SmartLicense","LicenseUdi":"LicenseUdi %d","SmartAccount":"SmartAccount %d","ActiveMode":"ActiveMode %d","AuthStatus":"AuthStatus %d"}` + c := `{"ObjectType":"niatelemetry.SmartLicense","ClassId":"niatelemetry.SmartLicense","ActiveMode":"ActiveMode %d","AuthStatus":"AuthStatus %d","LicenseUdi":"LicenseUdi %d","SmartAccount":"SmartAccount %d"}` //test when the response is empty ffOpEmpty := flattenMapNiatelemetrySmartLicense(p, d) @@ -14653,7 +14653,7 @@ func TestFlattenMapNiatelemetrySmartLicense(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapNiatelemetrySmartLicense(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "niatelemetry.SmartLicense", "object_type": "niatelemetry.SmartLicense", "license_udi": "LicenseUdi 1", "smart_account": "SmartAccount 1", "active_mode": "ActiveMode 1", "auth_status": "AuthStatus 1"} + expectedOp := map[string]interface{}{"object_type": "niatelemetry.SmartLicense", "class_id": "niatelemetry.SmartLicense", "active_mode": "ActiveMode 1", "auth_status": "AuthStatus 1", "license_udi": "LicenseUdi 1", "smart_account": "SmartAccount 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -14678,7 +14678,7 @@ func TestFlattenMapOauthAccessTokenRelationship(t *testing.T) { func TestFlattenMapOnpremSchedule(t *testing.T) { p := models.OnpremSchedule{} var d = &schema.ResourceData{} - c := `{"TimeOfDay":32,"ClassId":"onprem.Schedule","TimeZone":"TimeZone %d","DayOfWeek":32,"RepeatInterval":32,"ObjectType":"onprem.Schedule","DayOfMonth":32,"MonthOfYear":32,"WeekOfMonth":32}` + c := `{"MonthOfYear":32,"ObjectType":"onprem.Schedule","DayOfWeek":32,"TimeZone":"TimeZone %d","DayOfMonth":32,"WeekOfMonth":32,"RepeatInterval":32,"TimeOfDay":32,"ClassId":"onprem.Schedule"}` //test when the response is empty ffOpEmpty := flattenMapOnpremSchedule(p, d) @@ -14689,14 +14689,14 @@ func TestFlattenMapOnpremSchedule(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapOnpremSchedule(p, d)[0] - expectedOp := map[string]interface{}{"time_of_day": 32, "class_id": "onprem.Schedule", "time_zone": "TimeZone 1", "day_of_week": 32, "repeat_interval": 32, "object_type": "onprem.Schedule", "day_of_month": 32, "month_of_year": 32, "week_of_month": 32} + expectedOp := map[string]interface{}{"month_of_year": 32, "object_type": "onprem.Schedule", "day_of_week": 32, "time_zone": "TimeZone 1", "day_of_month": 32, "week_of_month": 32, "repeat_interval": 32, "time_of_day": 32, "class_id": "onprem.Schedule"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapOnpremUpgradePhase(t *testing.T) { p := models.OnpremUpgradePhase{} var d = &schema.ResourceData{} - c := `{"ElapsedTime":32,"ClassId":"onprem.UpgradePhase","Failed":true,"Name":"Name %d","ObjectType":"onprem.UpgradePhase","Message":"Message %d"}` + c := `{"ClassId":"onprem.UpgradePhase","Message":"Message %d","ObjectType":"onprem.UpgradePhase","ElapsedTime":32,"Failed":true,"Name":"Name %d"}` //test when the response is empty ffOpEmpty := flattenMapOnpremUpgradePhase(p, d) @@ -14707,7 +14707,7 @@ func TestFlattenMapOnpremUpgradePhase(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapOnpremUpgradePhase(p, d)[0] - expectedOp := map[string]interface{}{"elapsed_time": 32, "class_id": "onprem.UpgradePhase", "failed": true, "name": "Name 1", "object_type": "onprem.UpgradePhase", "message": "Message 1"} + expectedOp := map[string]interface{}{"class_id": "onprem.UpgradePhase", "message": "Message 1", "object_type": "onprem.UpgradePhase", "elapsed_time": 32, "failed": true, "name": "Name 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -14732,7 +14732,7 @@ func TestFlattenMapOrganizationOrganizationRelationship(t *testing.T) { func TestFlattenMapOsAnswers(t *testing.T) { p := models.OsAnswers{} var d = &schema.ResourceData{} - c := `{"IsAnswerFileSet":true,"IsRootPasswordSet":true,"NetworkDevice":"NetworkDevice %d","Hostname":"Hostname %d","ProductKey":"ProductKey %d","IsRootPasswordCrypted":true,"Source":"Source %d","ClassId":"os.Answers","Nameserver":"Nameserver %d","ObjectType":"os.Answers","IpConfigType":"IpConfigType %d"}` + c := `{"IpConfigType":"IpConfigType %d","IsRootPasswordSet":true,"IsRootPasswordCrypted":true,"NetworkDevice":"NetworkDevice %d","Source":"Source %d","Hostname":"Hostname %d","Nameserver":"Nameserver %d","IsAnswerFileSet":true,"ClassId":"os.Answers","ProductKey":"ProductKey %d","ObjectType":"os.Answers"}` //test when the response is empty ffOpEmpty := flattenMapOsAnswers(p, d) @@ -14743,7 +14743,7 @@ func TestFlattenMapOsAnswers(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapOsAnswers(p, d)[0] - expectedOp := map[string]interface{}{"is_answer_file_set": true, "is_root_password_set": true, "network_device": "NetworkDevice 1", "hostname": "Hostname 1", "product_key": "ProductKey 1", "is_root_password_crypted": true, "nr_source": "Source 1", "class_id": "os.Answers", "nameserver": "Nameserver 1", "object_type": "os.Answers", "ip_config_type": "IpConfigType 1"} + expectedOp := map[string]interface{}{"ip_config_type": "IpConfigType 1", "is_root_password_set": true, "is_root_password_crypted": true, "network_device": "NetworkDevice 1", "nr_source": "Source 1", "hostname": "Hostname 1", "nameserver": "Nameserver 1", "is_answer_file_set": true, "class_id": "os.Answers", "product_key": "ProductKey 1", "object_type": "os.Answers"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -14768,7 +14768,7 @@ func TestFlattenMapOsCatalogRelationship(t *testing.T) { func TestFlattenMapOsConfigurationFileRelationship(t *testing.T) { p := models.OsConfigurationFileRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenMapOsConfigurationFileRelationship(p, d) @@ -14779,14 +14779,14 @@ func TestFlattenMapOsConfigurationFileRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapOsConfigurationFileRelationship(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} + expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapOsGlobalConfig(t *testing.T) { p := models.OsGlobalConfig{} var d = &schema.ResourceData{} - c := `{"ClassId":"os.GlobalConfig","ObjectType":"os.GlobalConfig","ScuImageName":"ScuImageName %d","OsImageName":"OsImageName %d","InstallMethod":"InstallMethod %d","InstallTargetType":"InstallTargetType %d","WindowsEdition":"WindowsEdition %d","ConfigurationFileName":"ConfigurationFileName %d","ConfigurationSource":"ConfigurationSource %d"}` + c := `{"ObjectType":"os.GlobalConfig","OsImageName":"OsImageName %d","WindowsEdition":"WindowsEdition %d","ConfigurationSource":"ConfigurationSource %d","ClassId":"os.GlobalConfig","ScuImageName":"ScuImageName %d","InstallMethod":"InstallMethod %d","ConfigurationFileName":"ConfigurationFileName %d","InstallTargetType":"InstallTargetType %d"}` //test when the response is empty ffOpEmpty := flattenMapOsGlobalConfig(p, d) @@ -14797,14 +14797,14 @@ func TestFlattenMapOsGlobalConfig(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapOsGlobalConfig(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "os.GlobalConfig", "object_type": "os.GlobalConfig", "scu_image_name": "ScuImageName 1", "os_image_name": "OsImageName 1", "install_method": "InstallMethod 1", "install_target_type": "InstallTargetType 1", "windows_edition": "WindowsEdition 1", "configuration_file_name": "ConfigurationFileName 1", "configuration_source": "ConfigurationSource 1"} + expectedOp := map[string]interface{}{"object_type": "os.GlobalConfig", "os_image_name": "OsImageName 1", "windows_edition": "WindowsEdition 1", "configuration_source": "ConfigurationSource 1", "class_id": "os.GlobalConfig", "scu_image_name": "ScuImageName 1", "install_method": "InstallMethod 1", "configuration_file_name": "ConfigurationFileName 1", "install_target_type": "InstallTargetType 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapOsInstallTarget(t *testing.T) { p := models.OsInstallTarget{} var d = &schema.ResourceData{} - c := `{"ClassId":"os.InstallTarget","ObjectType":"os.InstallTarget"}` + c := `{"ObjectType":"os.InstallTarget","ClassId":"os.InstallTarget"}` //test when the response is empty ffOpEmpty := flattenMapOsInstallTarget(p, d) @@ -14815,14 +14815,14 @@ func TestFlattenMapOsInstallTarget(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapOsInstallTarget(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "os.InstallTarget", "object_type": "os.InstallTarget"} + expectedOp := map[string]interface{}{"object_type": "os.InstallTarget", "class_id": "os.InstallTarget"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapOsOperatingSystemParameters(t *testing.T) { p := models.OsOperatingSystemParameters{} var d = &schema.ResourceData{} - c := `{"ClassId":"os.OperatingSystemParameters","ObjectType":"os.OperatingSystemParameters"}` + c := `{"ObjectType":"os.OperatingSystemParameters","ClassId":"os.OperatingSystemParameters"}` //test when the response is empty ffOpEmpty := flattenMapOsOperatingSystemParameters(p, d) @@ -14833,14 +14833,14 @@ func TestFlattenMapOsOperatingSystemParameters(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapOsOperatingSystemParameters(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "os.OperatingSystemParameters", "object_type": "os.OperatingSystemParameters"} + expectedOp := map[string]interface{}{"object_type": "os.OperatingSystemParameters", "class_id": "os.OperatingSystemParameters"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapPciSwitchRelationship(t *testing.T) { p := models.PciSwitchRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapPciSwitchRelationship(p, d) @@ -14851,14 +14851,14 @@ func TestFlattenMapPciSwitchRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapPciSwitchRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapPkixDistinguishedName(t *testing.T) { p := models.PkixDistinguishedName{} var d = &schema.ResourceData{} - c := `{"ClassId":"pkix.DistinguishedName","CommonName":"CommonName %d","ObjectType":"pkix.DistinguishedName"}` + c := `{"ObjectType":"pkix.DistinguishedName","ClassId":"pkix.DistinguishedName","CommonName":"CommonName %d"}` //test when the response is empty ffOpEmpty := flattenMapPkixDistinguishedName(p, d) @@ -14869,14 +14869,14 @@ func TestFlattenMapPkixDistinguishedName(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapPkixDistinguishedName(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "pkix.DistinguishedName", "common_name": "CommonName 1", "object_type": "pkix.DistinguishedName"} + expectedOp := map[string]interface{}{"object_type": "pkix.DistinguishedName", "class_id": "pkix.DistinguishedName", "common_name": "CommonName 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapPkixKeyGenerationSpec(t *testing.T) { p := models.PkixKeyGenerationSpec{} var d = &schema.ResourceData{} - c := `{"ClassId":"pkix.KeyGenerationSpec","Name":"Name %d","ObjectType":"pkix.KeyGenerationSpec"}` + c := `{"Name":"Name %d","ObjectType":"pkix.KeyGenerationSpec","ClassId":"pkix.KeyGenerationSpec"}` //test when the response is empty ffOpEmpty := flattenMapPkixKeyGenerationSpec(p, d) @@ -14887,14 +14887,14 @@ func TestFlattenMapPkixKeyGenerationSpec(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapPkixKeyGenerationSpec(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "pkix.KeyGenerationSpec", "name": "Name 1", "object_type": "pkix.KeyGenerationSpec"} + expectedOp := map[string]interface{}{"name": "Name 1", "object_type": "pkix.KeyGenerationSpec", "class_id": "pkix.KeyGenerationSpec"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapPkixSubjectAlternateName(t *testing.T) { p := models.PkixSubjectAlternateName{} var d = &schema.ResourceData{} - c := `{"ObjectType":"pkix.SubjectAlternateName","ClassId":"pkix.SubjectAlternateName"}` + c := `{"ClassId":"pkix.SubjectAlternateName","ObjectType":"pkix.SubjectAlternateName"}` //test when the response is empty ffOpEmpty := flattenMapPkixSubjectAlternateName(p, d) @@ -14905,14 +14905,14 @@ func TestFlattenMapPkixSubjectAlternateName(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapPkixSubjectAlternateName(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "pkix.SubjectAlternateName", "class_id": "pkix.SubjectAlternateName"} + expectedOp := map[string]interface{}{"class_id": "pkix.SubjectAlternateName", "object_type": "pkix.SubjectAlternateName"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapPolicyAbstractConfigProfileRelationship(t *testing.T) { p := models.PolicyAbstractConfigProfileRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapPolicyAbstractConfigProfileRelationship(p, d) @@ -14923,14 +14923,14 @@ func TestFlattenMapPolicyAbstractConfigProfileRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapPolicyAbstractConfigProfileRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapPolicyAbstractProfileRelationship(t *testing.T) { p := models.PolicyAbstractProfileRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenMapPolicyAbstractProfileRelationship(p, d) @@ -14941,7 +14941,7 @@ func TestFlattenMapPolicyAbstractProfileRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapPolicyAbstractProfileRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -14966,7 +14966,7 @@ func TestFlattenMapPolicyConfigChange(t *testing.T) { func TestFlattenMapPolicyConfigChangeContext(t *testing.T) { p := models.PolicyConfigChangeContext{} var d = &schema.ResourceData{} - c := `{"ClassId":"policy.ConfigChangeContext","ConfigChangeError":"ConfigChangeError %d","ConfigChangeState":"ConfigChangeState %d","ObjectType":"policy.ConfigChangeContext"}` + c := `{"ObjectType":"policy.ConfigChangeContext","ClassId":"policy.ConfigChangeContext","ConfigChangeError":"ConfigChangeError %d","ConfigChangeState":"ConfigChangeState %d"}` //test when the response is empty ffOpEmpty := flattenMapPolicyConfigChangeContext(p, d) @@ -14977,14 +14977,14 @@ func TestFlattenMapPolicyConfigChangeContext(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapPolicyConfigChangeContext(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "policy.ConfigChangeContext", "config_change_error": "ConfigChangeError 1", "config_change_state": "ConfigChangeState 1", "object_type": "policy.ConfigChangeContext"} + expectedOp := map[string]interface{}{"object_type": "policy.ConfigChangeContext", "class_id": "policy.ConfigChangeContext", "config_change_error": "ConfigChangeError 1", "config_change_state": "ConfigChangeState 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapPolicyConfigContext(t *testing.T) { p := models.PolicyConfigContext{} var d = &schema.ResourceData{} - c := `{"ControlAction":"ControlAction %d","ErrorState":"ErrorState %d","OperState":"OperState %d","ObjectType":"policy.ConfigContext","ClassId":"policy.ConfigContext","ConfigState":"ConfigState %d","ConfigType":"ConfigType %d"}` + c := `{"ConfigState":"ConfigState %d","ConfigType":"ConfigType %d","ControlAction":"ControlAction %d","ObjectType":"policy.ConfigContext","ClassId":"policy.ConfigContext","ErrorState":"ErrorState %d","OperState":"OperState %d"}` //test when the response is empty ffOpEmpty := flattenMapPolicyConfigContext(p, d) @@ -14995,14 +14995,14 @@ func TestFlattenMapPolicyConfigContext(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapPolicyConfigContext(p, d)[0] - expectedOp := map[string]interface{}{"control_action": "ControlAction 1", "error_state": "ErrorState 1", "oper_state": "OperState 1", "object_type": "policy.ConfigContext", "class_id": "policy.ConfigContext", "config_state": "ConfigState 1", "config_type": "ConfigType 1"} + expectedOp := map[string]interface{}{"config_state": "ConfigState 1", "config_type": "ConfigType 1", "control_action": "ControlAction 1", "object_type": "policy.ConfigContext", "class_id": "policy.ConfigContext", "error_state": "ErrorState 1", "oper_state": "OperState 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapPolicyConfigResultContext(t *testing.T) { p := models.PolicyConfigResultContext{} var d = &schema.ResourceData{} - c := `{"EntityType":"EntityType %d","EntityMoid":"EntityMoid %d","ObjectType":"policy.ConfigResultContext","ClassId":"policy.ConfigResultContext","EntityName":"EntityName %d"}` + c := `{"ObjectType":"policy.ConfigResultContext","ClassId":"policy.ConfigResultContext","EntityMoid":"EntityMoid %d","EntityName":"EntityName %d","EntityType":"EntityType %d"}` //test when the response is empty ffOpEmpty := flattenMapPolicyConfigResultContext(p, d) @@ -15013,7 +15013,7 @@ func TestFlattenMapPolicyConfigResultContext(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapPolicyConfigResultContext(p, d)[0] - expectedOp := map[string]interface{}{"entity_type": "EntityType 1", "entity_moid": "EntityMoid 1", "object_type": "policy.ConfigResultContext", "class_id": "policy.ConfigResultContext", "entity_name": "EntityName 1"} + expectedOp := map[string]interface{}{"object_type": "policy.ConfigResultContext", "class_id": "policy.ConfigResultContext", "entity_moid": "EntityMoid 1", "entity_name": "EntityName 1", "entity_type": "EntityType 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -15038,7 +15038,7 @@ func TestFlattenMapPortGroupRelationship(t *testing.T) { func TestFlattenMapPortInterfaceBaseRelationship(t *testing.T) { p := models.PortInterfaceBaseRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenMapPortInterfaceBaseRelationship(p, d) @@ -15049,14 +15049,14 @@ func TestFlattenMapPortInterfaceBaseRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapPortInterfaceBaseRelationship(p, d)[0] - expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} + expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapPortSubGroupRelationship(t *testing.T) { p := models.PortSubGroupRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapPortSubGroupRelationship(p, d) @@ -15067,14 +15067,14 @@ func TestFlattenMapPortSubGroupRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapPortSubGroupRelationship(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapPowerControlStateRelationship(t *testing.T) { p := models.PowerControlStateRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapPowerControlStateRelationship(p, d) @@ -15085,7 +15085,7 @@ func TestFlattenMapPowerControlStateRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapPowerControlStateRelationship(p, d)[0] - expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} + expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -15110,7 +15110,7 @@ func TestFlattenMapRecommendationCapacityRunwayRelationship(t *testing.T) { func TestFlattenMapRecoveryAbstractBackupInfoRelationship(t *testing.T) { p := models.RecoveryAbstractBackupInfoRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapRecoveryAbstractBackupInfoRelationship(p, d) @@ -15121,14 +15121,14 @@ func TestFlattenMapRecoveryAbstractBackupInfoRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapRecoveryAbstractBackupInfoRelationship(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapRecoveryBackupConfigPolicyRelationship(t *testing.T) { p := models.RecoveryBackupConfigPolicyRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapRecoveryBackupConfigPolicyRelationship(p, d) @@ -15139,14 +15139,14 @@ func TestFlattenMapRecoveryBackupConfigPolicyRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapRecoveryBackupConfigPolicyRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapRecoveryBackupProfileRelationship(t *testing.T) { p := models.RecoveryBackupProfileRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenMapRecoveryBackupProfileRelationship(p, d) @@ -15157,14 +15157,14 @@ func TestFlattenMapRecoveryBackupProfileRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapRecoveryBackupProfileRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapRecoveryBackupSchedule(t *testing.T) { p := models.RecoveryBackupSchedule{} var d = &schema.ResourceData{} - c := `{"FrequencyUnit":"FrequencyUnit %d","Hours":32,"ObjectType":"recovery.BackupSchedule","ClassId":"recovery.BackupSchedule"}` + c := `{"FrequencyUnit":"FrequencyUnit %d","Hours":32,"ClassId":"recovery.BackupSchedule","ObjectType":"recovery.BackupSchedule"}` //test when the response is empty ffOpEmpty := flattenMapRecoveryBackupSchedule(p, d) @@ -15175,7 +15175,7 @@ func TestFlattenMapRecoveryBackupSchedule(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapRecoveryBackupSchedule(p, d)[0] - expectedOp := map[string]interface{}{"frequency_unit": "FrequencyUnit 1", "hours": 32, "object_type": "recovery.BackupSchedule", "class_id": "recovery.BackupSchedule"} + expectedOp := map[string]interface{}{"frequency_unit": "FrequencyUnit 1", "hours": 32, "class_id": "recovery.BackupSchedule", "object_type": "recovery.BackupSchedule"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -15200,7 +15200,7 @@ func TestFlattenMapRecoveryConfigParams(t *testing.T) { func TestFlattenMapRecoveryConfigResultRelationship(t *testing.T) { p := models.RecoveryConfigResultRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapRecoveryConfigResultRelationship(p, d) @@ -15211,14 +15211,14 @@ func TestFlattenMapRecoveryConfigResultRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapRecoveryConfigResultRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapRecoveryScheduleConfigPolicyRelationship(t *testing.T) { p := models.RecoveryScheduleConfigPolicyRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenMapRecoveryScheduleConfigPolicyRelationship(p, d) @@ -15229,14 +15229,14 @@ func TestFlattenMapRecoveryScheduleConfigPolicyRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapRecoveryScheduleConfigPolicyRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapResourceGroupRelationship(t *testing.T) { p := models.ResourceGroupRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapResourceGroupRelationship(p, d) @@ -15247,7 +15247,7 @@ func TestFlattenMapResourceGroupRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapResourceGroupRelationship(p, d)[0] - expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} + expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -15272,7 +15272,7 @@ func TestFlattenMapResourceMembershipHolderRelationship(t *testing.T) { func TestFlattenMapResourceReservationRelationship(t *testing.T) { p := models.ResourceReservationRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapResourceReservationRelationship(p, d) @@ -15283,7 +15283,7 @@ func TestFlattenMapResourceReservationRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapResourceReservationRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -15326,7 +15326,7 @@ func TestFlattenMapResourcepoolLeaseParameters(t *testing.T) { func TestFlattenMapResourcepoolLeaseResourceRelationship(t *testing.T) { p := models.ResourcepoolLeaseResourceRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenMapResourcepoolLeaseResourceRelationship(p, d) @@ -15337,14 +15337,14 @@ func TestFlattenMapResourcepoolLeaseResourceRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapResourcepoolLeaseResourceRelationship(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} + expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapResourcepoolPoolRelationship(t *testing.T) { p := models.ResourcepoolPoolRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenMapResourcepoolPoolRelationship(p, d) @@ -15355,7 +15355,7 @@ func TestFlattenMapResourcepoolPoolRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapResourcepoolPoolRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -15416,7 +15416,7 @@ func TestFlattenMapResourcepoolUniverseRelationship(t *testing.T) { func TestFlattenMapServerConfigResultRelationship(t *testing.T) { p := models.ServerConfigResultRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapServerConfigResultRelationship(p, d) @@ -15427,14 +15427,14 @@ func TestFlattenMapServerConfigResultRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapServerConfigResultRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapServerProfileRelationship(t *testing.T) { p := models.ServerProfileRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapServerProfileRelationship(p, d) @@ -15445,14 +15445,14 @@ func TestFlattenMapServerProfileRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapServerProfileRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapSessionAbstractSessionRelationship(t *testing.T) { p := models.SessionAbstractSessionRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapSessionAbstractSessionRelationship(p, d) @@ -15463,14 +15463,14 @@ func TestFlattenMapSessionAbstractSessionRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapSessionAbstractSessionRelationship(p, d)[0] - expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} + expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapSoftwareHyperflexDistributableRelationship(t *testing.T) { p := models.SoftwareHyperflexDistributableRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenMapSoftwareHyperflexDistributableRelationship(p, d) @@ -15481,14 +15481,14 @@ func TestFlattenMapSoftwareHyperflexDistributableRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapSoftwareHyperflexDistributableRelationship(p, d)[0] - expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} + expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapSoftwareSolutionDistributableRelationship(t *testing.T) { p := models.SoftwareSolutionDistributableRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenMapSoftwareSolutionDistributableRelationship(p, d) @@ -15499,7 +15499,7 @@ func TestFlattenMapSoftwareSolutionDistributableRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapSoftwareSolutionDistributableRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -15524,7 +15524,7 @@ func TestFlattenMapSoftwarerepositoryCatalogRelationship(t *testing.T) { func TestFlattenMapSoftwarerepositoryFileRelationship(t *testing.T) { p := models.SoftwarerepositoryFileRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenMapSoftwarerepositoryFileRelationship(p, d) @@ -15535,7 +15535,7 @@ func TestFlattenMapSoftwarerepositoryFileRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapSoftwarerepositoryFileRelationship(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} + expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -15560,7 +15560,7 @@ func TestFlattenMapSoftwarerepositoryFileServer(t *testing.T) { func TestFlattenMapSoftwarerepositoryOperatingSystemFileRelationship(t *testing.T) { p := models.SoftwarerepositoryOperatingSystemFileRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenMapSoftwarerepositoryOperatingSystemFileRelationship(p, d) @@ -15571,7 +15571,7 @@ func TestFlattenMapSoftwarerepositoryOperatingSystemFileRelationship(t *testing. err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapSoftwarerepositoryOperatingSystemFileRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -15596,7 +15596,7 @@ func TestFlattenMapSoftwarerepositoryReleaseRelationship(t *testing.T) { func TestFlattenMapStorageAutomaticDriveGroup(t *testing.T) { p := models.StorageAutomaticDriveGroup{} var d = &schema.ResourceData{} - c := `{"NumberOfSpans":32,"UseRemainingDrives":true,"DriveType":"DriveType %d","DrivesPerSpan":32,"MinimumDriveSize":32,"NumDedicatedHotSpares":"NumDedicatedHotSpares %d","ObjectType":"storage.AutomaticDriveGroup","ClassId":"storage.AutomaticDriveGroup"}` + c := `{"DrivesPerSpan":32,"NumDedicatedHotSpares":"NumDedicatedHotSpares %d","NumberOfSpans":32,"ClassId":"storage.AutomaticDriveGroup","ObjectType":"storage.AutomaticDriveGroup","DriveType":"DriveType %d","MinimumDriveSize":32,"UseRemainingDrives":true}` //test when the response is empty ffOpEmpty := flattenMapStorageAutomaticDriveGroup(p, d) @@ -15607,14 +15607,14 @@ func TestFlattenMapStorageAutomaticDriveGroup(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapStorageAutomaticDriveGroup(p, d)[0] - expectedOp := map[string]interface{}{"number_of_spans": 32, "use_remaining_drives": true, "drive_type": "DriveType 1", "drives_per_span": 32, "minimum_drive_size": 32, "num_dedicated_hot_spares": "NumDedicatedHotSpares 1", "object_type": "storage.AutomaticDriveGroup", "class_id": "storage.AutomaticDriveGroup"} + expectedOp := map[string]interface{}{"drives_per_span": 32, "num_dedicated_hot_spares": "NumDedicatedHotSpares 1", "number_of_spans": 32, "class_id": "storage.AutomaticDriveGroup", "object_type": "storage.AutomaticDriveGroup", "drive_type": "DriveType 1", "minimum_drive_size": 32, "use_remaining_drives": true} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapStorageBaseCapacity(t *testing.T) { p := models.StorageBaseCapacity{} var d = &schema.ResourceData{} - c := `{"Free":32,"Total":32,"Used":32,"ObjectType":"storage.BaseCapacity","ClassId":"storage.BaseCapacity","Available":32,"CapacityUtilization":32.000000}` + c := `{"ClassId":"storage.BaseCapacity","Used":32,"Available":32,"CapacityUtilization":32.000000,"Free":32,"Total":32,"ObjectType":"storage.BaseCapacity"}` //test when the response is empty ffOpEmpty := flattenMapStorageBaseCapacity(p, d) @@ -15625,14 +15625,14 @@ func TestFlattenMapStorageBaseCapacity(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapStorageBaseCapacity(p, d)[0] - expectedOp := map[string]interface{}{"free": 32, "total": 32, "used": 32, "object_type": "storage.BaseCapacity", "class_id": "storage.BaseCapacity", "available": 32, "capacity_utilization": 32.000000} + expectedOp := map[string]interface{}{"class_id": "storage.BaseCapacity", "used": 32, "available": 32, "capacity_utilization": 32.000000, "free": 32, "total": 32, "object_type": "storage.BaseCapacity"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapStorageBaseClusterRelationship(t *testing.T) { p := models.StorageBaseClusterRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapStorageBaseClusterRelationship(p, d) @@ -15643,14 +15643,14 @@ func TestFlattenMapStorageBaseClusterRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapStorageBaseClusterRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapStorageControllerRelationship(t *testing.T) { p := models.StorageControllerRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapStorageControllerRelationship(p, d) @@ -15661,14 +15661,14 @@ func TestFlattenMapStorageControllerRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapStorageControllerRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapStorageDiskGroupRelationship(t *testing.T) { p := models.StorageDiskGroupRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenMapStorageDiskGroupRelationship(p, d) @@ -15679,14 +15679,14 @@ func TestFlattenMapStorageDiskGroupRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapStorageDiskGroupRelationship(p, d)[0] - expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} + expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapStorageEnclosureRelationship(t *testing.T) { p := models.StorageEnclosureRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapStorageEnclosureRelationship(p, d) @@ -15697,14 +15697,14 @@ func TestFlattenMapStorageEnclosureRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapStorageEnclosureRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapStorageFlexFlashControllerRelationship(t *testing.T) { p := models.StorageFlexFlashControllerRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenMapStorageFlexFlashControllerRelationship(p, d) @@ -15715,7 +15715,7 @@ func TestFlattenMapStorageFlexFlashControllerRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapStorageFlexFlashControllerRelationship(p, d)[0] - expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} + expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -15758,7 +15758,7 @@ func TestFlattenMapStorageHitachiArrayRelationship(t *testing.T) { func TestFlattenMapStorageHitachiHostRelationship(t *testing.T) { p := models.StorageHitachiHostRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapStorageHitachiHostRelationship(p, d) @@ -15769,14 +15769,14 @@ func TestFlattenMapStorageHitachiHostRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapStorageHitachiHostRelationship(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapStorageHitachiParityGroupRelationship(t *testing.T) { p := models.StorageHitachiParityGroupRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenMapStorageHitachiParityGroupRelationship(p, d) @@ -15787,14 +15787,14 @@ func TestFlattenMapStorageHitachiParityGroupRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapStorageHitachiParityGroupRelationship(p, d)[0] - expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} + expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapStorageHitachiPoolRelationship(t *testing.T) { p := models.StorageHitachiPoolRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenMapStorageHitachiPoolRelationship(p, d) @@ -15805,14 +15805,14 @@ func TestFlattenMapStorageHitachiPoolRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapStorageHitachiPoolRelationship(p, d)[0] - expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} + expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapStorageHitachiVolumeRelationship(t *testing.T) { p := models.StorageHitachiVolumeRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenMapStorageHitachiVolumeRelationship(p, d) @@ -15823,14 +15823,14 @@ func TestFlattenMapStorageHitachiVolumeRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapStorageHitachiVolumeRelationship(p, d)[0] - expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} + expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapStorageHyperFlexStorageContainerRelationship(t *testing.T) { p := models.StorageHyperFlexStorageContainerRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenMapStorageHyperFlexStorageContainerRelationship(p, d) @@ -15841,7 +15841,7 @@ func TestFlattenMapStorageHyperFlexStorageContainerRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapStorageHyperFlexStorageContainerRelationship(p, d)[0] - expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} + expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -15866,7 +15866,7 @@ func TestFlattenMapStorageM2VirtualDriveConfig(t *testing.T) { func TestFlattenMapStorageManualDriveGroup(t *testing.T) { p := models.StorageManualDriveGroup{} var d = &schema.ResourceData{} - c := `{"DedicatedHotSpares":"DedicatedHotSpares %d","ObjectType":"storage.ManualDriveGroup","ClassId":"storage.ManualDriveGroup"}` + c := `{"ObjectType":"storage.ManualDriveGroup","DedicatedHotSpares":"DedicatedHotSpares %d","ClassId":"storage.ManualDriveGroup"}` //test when the response is empty ffOpEmpty := flattenMapStorageManualDriveGroup(p, d) @@ -15877,14 +15877,14 @@ func TestFlattenMapStorageManualDriveGroup(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapStorageManualDriveGroup(p, d)[0] - expectedOp := map[string]interface{}{"dedicated_hot_spares": "DedicatedHotSpares 1", "object_type": "storage.ManualDriveGroup", "class_id": "storage.ManualDriveGroup"} + expectedOp := map[string]interface{}{"object_type": "storage.ManualDriveGroup", "dedicated_hot_spares": "DedicatedHotSpares 1", "class_id": "storage.ManualDriveGroup"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapStorageNetAppAggregateRelationship(t *testing.T) { p := models.StorageNetAppAggregateRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapStorageNetAppAggregateRelationship(p, d) @@ -15895,14 +15895,14 @@ func TestFlattenMapStorageNetAppAggregateRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapStorageNetAppAggregateRelationship(p, d)[0] - expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} + expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapStorageNetAppBaseDiskRelationship(t *testing.T) { p := models.StorageNetAppBaseDiskRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapStorageNetAppBaseDiskRelationship(p, d) @@ -15913,7 +15913,7 @@ func TestFlattenMapStorageNetAppBaseDiskRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapStorageNetAppBaseDiskRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -15938,7 +15938,7 @@ func TestFlattenMapStorageNetAppClusterRelationship(t *testing.T) { func TestFlattenMapStorageNetAppEthernetPortRelationship(t *testing.T) { p := models.StorageNetAppEthernetPortRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenMapStorageNetAppEthernetPortRelationship(p, d) @@ -15949,14 +15949,14 @@ func TestFlattenMapStorageNetAppEthernetPortRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapStorageNetAppEthernetPortRelationship(p, d)[0] - expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} + expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapStorageNetAppEthernetPortLag(t *testing.T) { p := models.StorageNetAppEthernetPortLag{} var d = &schema.ResourceData{} - c := `{"Mode":"Mode %d","DistributionPolicy":"DistributionPolicy %d","ObjectType":"storage.NetAppEthernetPortLag","ClassId":"storage.NetAppEthernetPortLag"}` + c := `{"DistributionPolicy":"DistributionPolicy %d","ObjectType":"storage.NetAppEthernetPortLag","ClassId":"storage.NetAppEthernetPortLag","Mode":"Mode %d"}` //test when the response is empty ffOpEmpty := flattenMapStorageNetAppEthernetPortLag(p, d) @@ -15967,14 +15967,14 @@ func TestFlattenMapStorageNetAppEthernetPortLag(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapStorageNetAppEthernetPortLag(p, d)[0] - expectedOp := map[string]interface{}{"mode": "Mode 1", "distribution_policy": "DistributionPolicy 1", "object_type": "storage.NetAppEthernetPortLag", "class_id": "storage.NetAppEthernetPortLag"} + expectedOp := map[string]interface{}{"distribution_policy": "DistributionPolicy 1", "object_type": "storage.NetAppEthernetPortLag", "class_id": "storage.NetAppEthernetPortLag", "mode": "Mode 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapStorageNetAppEthernetPortVlan(t *testing.T) { p := models.StorageNetAppEthernetPortVlan{} var d = &schema.ResourceData{} - c := `{"ObjectType":"storage.NetAppEthernetPortVlan","ClassId":"storage.NetAppEthernetPortVlan","Tag":32}` + c := `{"Tag":32,"ObjectType":"storage.NetAppEthernetPortVlan","ClassId":"storage.NetAppEthernetPortVlan"}` //test when the response is empty ffOpEmpty := flattenMapStorageNetAppEthernetPortVlan(p, d) @@ -15985,14 +15985,14 @@ func TestFlattenMapStorageNetAppEthernetPortVlan(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapStorageNetAppEthernetPortVlan(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "storage.NetAppEthernetPortVlan", "class_id": "storage.NetAppEthernetPortVlan", "tag": 32} + expectedOp := map[string]interface{}{"tag": 32, "object_type": "storage.NetAppEthernetPortVlan", "class_id": "storage.NetAppEthernetPortVlan"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapStorageNetAppFcInterfaceRelationship(t *testing.T) { p := models.StorageNetAppFcInterfaceRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenMapStorageNetAppFcInterfaceRelationship(p, d) @@ -16003,14 +16003,14 @@ func TestFlattenMapStorageNetAppFcInterfaceRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapStorageNetAppFcInterfaceRelationship(p, d)[0] - expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} + expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapStorageNetAppFcPortRelationship(t *testing.T) { p := models.StorageNetAppFcPortRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenMapStorageNetAppFcPortRelationship(p, d) @@ -16021,14 +16021,14 @@ func TestFlattenMapStorageNetAppFcPortRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapStorageNetAppFcPortRelationship(p, d)[0] - expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} + expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapStorageNetAppHighAvailability(t *testing.T) { p := models.StorageNetAppHighAvailability{} var d = &schema.ResourceData{} - c := `{"TakeoverState":"TakeoverState %d","Enabled":true,"GivebackState":"GivebackState %d","PartnerName":"PartnerName %d","PartnerUuid":"PartnerUuid %d","ObjectType":"storage.NetAppHighAvailability","ClassId":"storage.NetAppHighAvailability"}` + c := `{"PartnerName":"PartnerName %d","PartnerUuid":"PartnerUuid %d","ObjectType":"storage.NetAppHighAvailability","ClassId":"storage.NetAppHighAvailability","TakeoverState":"TakeoverState %d","Enabled":true,"GivebackState":"GivebackState %d"}` //test when the response is empty ffOpEmpty := flattenMapStorageNetAppHighAvailability(p, d) @@ -16039,14 +16039,14 @@ func TestFlattenMapStorageNetAppHighAvailability(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapStorageNetAppHighAvailability(p, d)[0] - expectedOp := map[string]interface{}{"takeover_state": "TakeoverState 1", "enabled": true, "giveback_state": "GivebackState 1", "partner_name": "PartnerName 1", "partner_uuid": "PartnerUuid 1", "object_type": "storage.NetAppHighAvailability", "class_id": "storage.NetAppHighAvailability"} + expectedOp := map[string]interface{}{"partner_name": "PartnerName 1", "partner_uuid": "PartnerUuid 1", "object_type": "storage.NetAppHighAvailability", "class_id": "storage.NetAppHighAvailability", "takeover_state": "TakeoverState 1", "enabled": true, "giveback_state": "GivebackState 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapStorageNetAppIpInterfaceRelationship(t *testing.T) { p := models.StorageNetAppIpInterfaceRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenMapStorageNetAppIpInterfaceRelationship(p, d) @@ -16057,14 +16057,14 @@ func TestFlattenMapStorageNetAppIpInterfaceRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapStorageNetAppIpInterfaceRelationship(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} + expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapStorageNetAppLunRelationship(t *testing.T) { p := models.StorageNetAppLunRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapStorageNetAppLunRelationship(p, d) @@ -16075,14 +16075,14 @@ func TestFlattenMapStorageNetAppLunRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapStorageNetAppLunRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapStorageNetAppNodeRelationship(t *testing.T) { p := models.StorageNetAppNodeRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenMapStorageNetAppNodeRelationship(p, d) @@ -16093,14 +16093,14 @@ func TestFlattenMapStorageNetAppNodeRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapStorageNetAppNodeRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapStorageNetAppPerformanceMetricsAverage(t *testing.T) { p := models.StorageNetAppPerformanceMetricsAverage{} var d = &schema.ResourceData{} - c := `{"Throughput":32.000000,"Iops":32.000000,"Latency":32.000000,"Period":32,"ClassId":"storage.NetAppPerformanceMetricsAverage","ObjectType":"storage.NetAppPerformanceMetricsAverage"}` + c := `{"Latency":32.000000,"Period":32,"Throughput":32.000000,"Iops":32.000000,"ObjectType":"storage.NetAppPerformanceMetricsAverage","ClassId":"storage.NetAppPerformanceMetricsAverage"}` //test when the response is empty ffOpEmpty := flattenMapStorageNetAppPerformanceMetricsAverage(p, d) @@ -16111,14 +16111,14 @@ func TestFlattenMapStorageNetAppPerformanceMetricsAverage(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapStorageNetAppPerformanceMetricsAverage(p, d)[0] - expectedOp := map[string]interface{}{"throughput": 32.000000, "iops": 32.000000, "latency": 32.000000, "period": 32, "class_id": "storage.NetAppPerformanceMetricsAverage", "object_type": "storage.NetAppPerformanceMetricsAverage"} + expectedOp := map[string]interface{}{"latency": 32.000000, "period": 32, "throughput": 32.000000, "iops": 32.000000, "object_type": "storage.NetAppPerformanceMetricsAverage", "class_id": "storage.NetAppPerformanceMetricsAverage"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapStorageNetAppStorageClusterEfficiency(t *testing.T) { p := models.StorageNetAppStorageClusterEfficiency{} var d = &schema.ResourceData{} - c := `{"ClassId":"storage.NetAppStorageClusterEfficiency","ObjectType":"storage.NetAppStorageClusterEfficiency","LogicalUsed":32,"Ratio":32.000000,"Savings":32}` + c := `{"LogicalUsed":32,"Ratio":32.000000,"ObjectType":"storage.NetAppStorageClusterEfficiency","ClassId":"storage.NetAppStorageClusterEfficiency","Savings":32}` //test when the response is empty ffOpEmpty := flattenMapStorageNetAppStorageClusterEfficiency(p, d) @@ -16129,14 +16129,14 @@ func TestFlattenMapStorageNetAppStorageClusterEfficiency(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapStorageNetAppStorageClusterEfficiency(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "storage.NetAppStorageClusterEfficiency", "object_type": "storage.NetAppStorageClusterEfficiency", "logical_used": 32, "ratio": 32.000000, "savings": 32} + expectedOp := map[string]interface{}{"logical_used": 32, "ratio": 32.000000, "object_type": "storage.NetAppStorageClusterEfficiency", "class_id": "storage.NetAppStorageClusterEfficiency", "savings": 32} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapStorageNetAppStorageVmRelationship(t *testing.T) { p := models.StorageNetAppStorageVmRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenMapStorageNetAppStorageVmRelationship(p, d) @@ -16147,14 +16147,14 @@ func TestFlattenMapStorageNetAppStorageVmRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapStorageNetAppStorageVmRelationship(p, d)[0] - expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} + expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapStorageNetAppVolumeRelationship(t *testing.T) { p := models.StorageNetAppVolumeRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapStorageNetAppVolumeRelationship(p, d) @@ -16165,7 +16165,7 @@ func TestFlattenMapStorageNetAppVolumeRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapStorageNetAppVolumeRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -16208,7 +16208,7 @@ func TestFlattenMapStoragePureArrayRelationship(t *testing.T) { func TestFlattenMapStoragePureControllerRelationship(t *testing.T) { p := models.StoragePureControllerRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapStoragePureControllerRelationship(p, d) @@ -16219,7 +16219,7 @@ func TestFlattenMapStoragePureControllerRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapStoragePureControllerRelationship(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -16262,7 +16262,7 @@ func TestFlattenMapStoragePureHostGroupRelationship(t *testing.T) { func TestFlattenMapStoragePureProtectionGroupRelationship(t *testing.T) { p := models.StoragePureProtectionGroupRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapStoragePureProtectionGroupRelationship(p, d) @@ -16273,14 +16273,14 @@ func TestFlattenMapStoragePureProtectionGroupRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapStoragePureProtectionGroupRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapStoragePureProtectionGroupSnapshotRelationship(t *testing.T) { p := models.StoragePureProtectionGroupSnapshotRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapStoragePureProtectionGroupSnapshotRelationship(p, d) @@ -16291,14 +16291,14 @@ func TestFlattenMapStoragePureProtectionGroupSnapshotRelationship(t *testing.T) err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapStoragePureProtectionGroupSnapshotRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapStoragePureVolumeRelationship(t *testing.T) { p := models.StoragePureVolumeRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapStoragePureVolumeRelationship(p, d) @@ -16309,14 +16309,14 @@ func TestFlattenMapStoragePureVolumeRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapStoragePureVolumeRelationship(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapStorageR0Drive(t *testing.T) { p := models.StorageR0Drive{} var d = &schema.ResourceData{} - c := `{"ClassId":"storage.R0Drive","DriveSlots":"DriveSlots %d","DriveSlotsList":"DriveSlotsList %d","Enable":true,"ObjectType":"storage.R0Drive"}` + c := `{"ObjectType":"storage.R0Drive","ClassId":"storage.R0Drive","DriveSlots":"DriveSlots %d","DriveSlotsList":"DriveSlotsList %d","Enable":true}` //test when the response is empty ffOpEmpty := flattenMapStorageR0Drive(p, d) @@ -16327,14 +16327,14 @@ func TestFlattenMapStorageR0Drive(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapStorageR0Drive(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "storage.R0Drive", "drive_slots": "DriveSlots 1", "drive_slots_list": "DriveSlotsList 1", "enable": true, "object_type": "storage.R0Drive"} + expectedOp := map[string]interface{}{"object_type": "storage.R0Drive", "class_id": "storage.R0Drive", "drive_slots": "DriveSlots 1", "drive_slots_list": "DriveSlotsList 1", "enable": true} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapStorageSasExpanderRelationship(t *testing.T) { p := models.StorageSasExpanderRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapStorageSasExpanderRelationship(p, d) @@ -16345,14 +16345,14 @@ func TestFlattenMapStorageSasExpanderRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapStorageSasExpanderRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapStorageStoragePolicyRelationship(t *testing.T) { p := models.StorageStoragePolicyRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenMapStorageStoragePolicyRelationship(p, d) @@ -16363,7 +16363,7 @@ func TestFlattenMapStorageStoragePolicyRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapStorageStoragePolicyRelationship(p, d)[0] - expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} + expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -16388,7 +16388,7 @@ func TestFlattenMapStorageVirtualDriveRelationship(t *testing.T) { func TestFlattenMapStorageVirtualDriveContainerRelationship(t *testing.T) { p := models.StorageVirtualDriveContainerRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenMapStorageVirtualDriveContainerRelationship(p, d) @@ -16399,14 +16399,14 @@ func TestFlattenMapStorageVirtualDriveContainerRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapStorageVirtualDriveContainerRelationship(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} + expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapStorageVirtualDriveExtensionRelationship(t *testing.T) { p := models.StorageVirtualDriveExtensionRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapStorageVirtualDriveExtensionRelationship(p, d) @@ -16417,7 +16417,7 @@ func TestFlattenMapStorageVirtualDriveExtensionRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapStorageVirtualDriveExtensionRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -16478,7 +16478,7 @@ func TestFlattenMapTamSeverity(t *testing.T) { func TestFlattenMapTechsupportmanagementTechSupportBundleRelationship(t *testing.T) { p := models.TechsupportmanagementTechSupportBundleRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapTechsupportmanagementTechSupportBundleRelationship(p, d) @@ -16489,14 +16489,14 @@ func TestFlattenMapTechsupportmanagementTechSupportBundleRelationship(t *testing err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapTechsupportmanagementTechSupportBundleRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapTechsupportmanagementTechSupportStatusRelationship(t *testing.T) { p := models.TechsupportmanagementTechSupportStatusRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapTechsupportmanagementTechSupportStatusRelationship(p, d) @@ -16507,7 +16507,7 @@ func TestFlattenMapTechsupportmanagementTechSupportStatusRelationship(t *testing err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapTechsupportmanagementTechSupportStatusRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -16550,7 +16550,7 @@ func TestFlattenMapUuidpoolBlockRelationship(t *testing.T) { func TestFlattenMapUuidpoolPoolRelationship(t *testing.T) { p := models.UuidpoolPoolRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenMapUuidpoolPoolRelationship(p, d) @@ -16561,14 +16561,14 @@ func TestFlattenMapUuidpoolPoolRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapUuidpoolPoolRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapUuidpoolPoolMemberRelationship(t *testing.T) { p := models.UuidpoolPoolMemberRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenMapUuidpoolPoolMemberRelationship(p, d) @@ -16579,14 +16579,14 @@ func TestFlattenMapUuidpoolPoolMemberRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapUuidpoolPoolMemberRelationship(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} + expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapUuidpoolUniverseRelationship(t *testing.T) { p := models.UuidpoolUniverseRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapUuidpoolUniverseRelationship(p, d) @@ -16597,14 +16597,14 @@ func TestFlattenMapUuidpoolUniverseRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapUuidpoolUniverseRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapUuidpoolUuidBlock(t *testing.T) { p := models.UuidpoolUuidBlock{} var d = &schema.ResourceData{} - c := `{"Size":32,"From":"From %d","To":"To %d","ObjectType":"uuidpool.UuidBlock","ClassId":"uuidpool.UuidBlock"}` + c := `{"ClassId":"uuidpool.UuidBlock","From":"From %d","To":"To %d","Size":32,"ObjectType":"uuidpool.UuidBlock"}` //test when the response is empty ffOpEmpty := flattenMapUuidpoolUuidBlock(p, d) @@ -16615,7 +16615,7 @@ func TestFlattenMapUuidpoolUuidBlock(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapUuidpoolUuidBlock(p, d)[0] - expectedOp := map[string]interface{}{"size": 32, "from": "From 1", "to": "To 1", "object_type": "uuidpool.UuidBlock", "class_id": "uuidpool.UuidBlock"} + expectedOp := map[string]interface{}{"class_id": "uuidpool.UuidBlock", "from": "From 1", "to": "To 1", "size": 32, "object_type": "uuidpool.UuidBlock"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -16640,7 +16640,7 @@ func TestFlattenMapUuidpoolUuidLeaseRelationship(t *testing.T) { func TestFlattenMapVirtualizationActionInfo(t *testing.T) { p := models.VirtualizationActionInfo{} var d = &schema.ResourceData{} - c := `{"Status":"Status %d","FailureReason":"FailureReason %d","Name":"Name %d","ObjectType":"virtualization.ActionInfo","ClassId":"virtualization.ActionInfo"}` + c := `{"ObjectType":"virtualization.ActionInfo","ClassId":"virtualization.ActionInfo","FailureReason":"FailureReason %d","Name":"Name %d","Status":"Status %d"}` //test when the response is empty ffOpEmpty := flattenMapVirtualizationActionInfo(p, d) @@ -16651,14 +16651,14 @@ func TestFlattenMapVirtualizationActionInfo(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVirtualizationActionInfo(p, d)[0] - expectedOp := map[string]interface{}{"status": "Status 1", "failure_reason": "FailureReason 1", "name": "Name 1", "object_type": "virtualization.ActionInfo", "class_id": "virtualization.ActionInfo"} + expectedOp := map[string]interface{}{"object_type": "virtualization.ActionInfo", "class_id": "virtualization.ActionInfo", "failure_reason": "FailureReason 1", "name": "Name 1", "status": "Status 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapVirtualizationBaseClusterRelationship(t *testing.T) { p := models.VirtualizationBaseClusterRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapVirtualizationBaseClusterRelationship(p, d) @@ -16669,7 +16669,7 @@ func TestFlattenMapVirtualizationBaseClusterRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVirtualizationBaseClusterRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -16712,7 +16712,7 @@ func TestFlattenMapVirtualizationBaseHostConfiguration(t *testing.T) { func TestFlattenMapVirtualizationBaseNetworkRelationship(t *testing.T) { p := models.VirtualizationBaseNetworkRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapVirtualizationBaseNetworkRelationship(p, d) @@ -16723,7 +16723,7 @@ func TestFlattenMapVirtualizationBaseNetworkRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVirtualizationBaseNetworkRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -16802,7 +16802,7 @@ func TestFlattenMapVirtualizationBaseVmConfiguration(t *testing.T) { func TestFlattenMapVirtualizationBondState(t *testing.T) { p := models.VirtualizationBondState{} var d = &schema.ResourceData{} - c := `{"ClassId":"virtualization.BondState","ObjectType":"virtualization.BondState","ActiveSlave":"ActiveSlave %d","Mode":"Mode %d"}` + c := `{"Mode":"Mode %d","ObjectType":"virtualization.BondState","ClassId":"virtualization.BondState","ActiveSlave":"ActiveSlave %d"}` //test when the response is empty ffOpEmpty := flattenMapVirtualizationBondState(p, d) @@ -16813,14 +16813,14 @@ func TestFlattenMapVirtualizationBondState(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVirtualizationBondState(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "virtualization.BondState", "object_type": "virtualization.BondState", "active_slave": "ActiveSlave 1", "mode": "Mode 1"} + expectedOp := map[string]interface{}{"mode": "Mode 1", "object_type": "virtualization.BondState", "class_id": "virtualization.BondState", "active_slave": "ActiveSlave 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapVirtualizationCiscoHypervisorManagerRelationship(t *testing.T) { p := models.VirtualizationCiscoHypervisorManagerRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenMapVirtualizationCiscoHypervisorManagerRelationship(p, d) @@ -16831,14 +16831,14 @@ func TestFlattenMapVirtualizationCiscoHypervisorManagerRelationship(t *testing.T err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVirtualizationCiscoHypervisorManagerRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapVirtualizationCloudInitConfig(t *testing.T) { p := models.VirtualizationCloudInitConfig{} var d = &schema.ResourceData{} - c := `{"NetworkData":"NetworkData %d","NetworkDataBase64Encoded":true,"UserData":"UserData %d","ObjectType":"virtualization.CloudInitConfig","ClassId":"virtualization.CloudInitConfig","UserDataBase64Encoded":true,"ConfigType":"ConfigType %d"}` + c := `{"UserData":"UserData %d","UserDataBase64Encoded":true,"ConfigType":"ConfigType %d","NetworkData":"NetworkData %d","ObjectType":"virtualization.CloudInitConfig","ClassId":"virtualization.CloudInitConfig","NetworkDataBase64Encoded":true}` //test when the response is empty ffOpEmpty := flattenMapVirtualizationCloudInitConfig(p, d) @@ -16849,14 +16849,14 @@ func TestFlattenMapVirtualizationCloudInitConfig(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVirtualizationCloudInitConfig(p, d)[0] - expectedOp := map[string]interface{}{"network_data": "NetworkData 1", "network_data_base64_encoded": true, "user_data": "UserData 1", "object_type": "virtualization.CloudInitConfig", "class_id": "virtualization.CloudInitConfig", "user_data_base64_encoded": true, "config_type": "ConfigType 1"} + expectedOp := map[string]interface{}{"user_data": "UserData 1", "user_data_base64_encoded": true, "config_type": "ConfigType 1", "network_data": "NetworkData 1", "object_type": "virtualization.CloudInitConfig", "class_id": "virtualization.CloudInitConfig", "network_data_base64_encoded": true} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapVirtualizationComputeCapacity(t *testing.T) { p := models.VirtualizationComputeCapacity{} var d = &schema.ResourceData{} - c := `{"ObjectType":"virtualization.ComputeCapacity","ClassId":"virtualization.ComputeCapacity","Free":32,"Used":32,"Capacity":32}` + c := `{"ClassId":"virtualization.ComputeCapacity","ObjectType":"virtualization.ComputeCapacity","Capacity":32,"Free":32,"Used":32}` //test when the response is empty ffOpEmpty := flattenMapVirtualizationComputeCapacity(p, d) @@ -16867,14 +16867,14 @@ func TestFlattenMapVirtualizationComputeCapacity(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVirtualizationComputeCapacity(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "virtualization.ComputeCapacity", "class_id": "virtualization.ComputeCapacity", "free": 32, "used": 32, "capacity": 32} + expectedOp := map[string]interface{}{"class_id": "virtualization.ComputeCapacity", "object_type": "virtualization.ComputeCapacity", "capacity": 32, "free": 32, "used": 32} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapVirtualizationCpuAllocation(t *testing.T) { p := models.VirtualizationCpuAllocation{} var d = &schema.ResourceData{} - c := `{"Total":32,"Used":32,"Free":32,"Reserved":32,"ObjectType":"virtualization.CpuAllocation","ClassId":"virtualization.CpuAllocation"}` + c := `{"Free":32,"Reserved":32,"Total":32,"Used":32,"ObjectType":"virtualization.CpuAllocation","ClassId":"virtualization.CpuAllocation"}` //test when the response is empty ffOpEmpty := flattenMapVirtualizationCpuAllocation(p, d) @@ -16885,14 +16885,14 @@ func TestFlattenMapVirtualizationCpuAllocation(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVirtualizationCpuAllocation(p, d)[0] - expectedOp := map[string]interface{}{"total": 32, "used": 32, "free": 32, "reserved": 32, "object_type": "virtualization.CpuAllocation", "class_id": "virtualization.CpuAllocation"} + expectedOp := map[string]interface{}{"free": 32, "reserved": 32, "total": 32, "used": 32, "object_type": "virtualization.CpuAllocation", "class_id": "virtualization.CpuAllocation"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapVirtualizationCpuInfo(t *testing.T) { p := models.VirtualizationCpuInfo{} var d = &schema.ResourceData{} - c := `{"ObjectType":"virtualization.CpuInfo","ClassId":"virtualization.CpuInfo","Vendor":"Vendor %d","Cores":32,"Description":"Description %d","Sockets":32,"Speed":32}` + c := `{"Description":"Description %d","ObjectType":"virtualization.CpuInfo","ClassId":"virtualization.CpuInfo","Sockets":32,"Speed":32,"Vendor":"Vendor %d","Cores":32}` //test when the response is empty ffOpEmpty := flattenMapVirtualizationCpuInfo(p, d) @@ -16903,14 +16903,14 @@ func TestFlattenMapVirtualizationCpuInfo(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVirtualizationCpuInfo(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "virtualization.CpuInfo", "class_id": "virtualization.CpuInfo", "vendor": "Vendor 1", "cores": 32, "description": "Description 1", "sockets": 32, "speed": 32} + expectedOp := map[string]interface{}{"description": "Description 1", "object_type": "virtualization.CpuInfo", "class_id": "virtualization.CpuInfo", "sockets": 32, "speed": 32, "vendor": "Vendor 1", "cores": 32} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapVirtualizationDiskStatus(t *testing.T) { p := models.VirtualizationDiskStatus{} var d = &schema.ResourceData{} - c := `{"State":"State %d","VolumeName":"VolumeName %d","ObjectType":"virtualization.DiskStatus","VolumeVendor":"VolumeVendor %d","DownloadPercentage":"DownloadPercentage %d","Reason":"Reason %d","VolumeHandle":"VolumeHandle %d","ClassId":"virtualization.DiskStatus"}` + c := `{"State":"State %d","DownloadPercentage":"DownloadPercentage %d","ObjectType":"virtualization.DiskStatus","ClassId":"virtualization.DiskStatus","VolumeVendor":"VolumeVendor %d","Reason":"Reason %d","VolumeHandle":"VolumeHandle %d","VolumeName":"VolumeName %d"}` //test when the response is empty ffOpEmpty := flattenMapVirtualizationDiskStatus(p, d) @@ -16921,7 +16921,7 @@ func TestFlattenMapVirtualizationDiskStatus(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVirtualizationDiskStatus(p, d)[0] - expectedOp := map[string]interface{}{"state": "State 1", "volume_name": "VolumeName 1", "object_type": "virtualization.DiskStatus", "volume_vendor": "VolumeVendor 1", "download_percentage": "DownloadPercentage 1", "reason": "Reason 1", "volume_handle": "VolumeHandle 1", "class_id": "virtualization.DiskStatus"} + expectedOp := map[string]interface{}{"state": "State 1", "download_percentage": "DownloadPercentage 1", "object_type": "virtualization.DiskStatus", "class_id": "virtualization.DiskStatus", "volume_vendor": "VolumeVendor 1", "reason": "Reason 1", "volume_handle": "VolumeHandle 1", "volume_name": "VolumeName 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -16964,7 +16964,7 @@ func TestFlattenMapVirtualizationIweClusterRelationship(t *testing.T) { func TestFlattenMapVirtualizationIweDvUplinkRelationship(t *testing.T) { p := models.VirtualizationIweDvUplinkRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapVirtualizationIweDvUplinkRelationship(p, d) @@ -16975,14 +16975,14 @@ func TestFlattenMapVirtualizationIweDvUplinkRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVirtualizationIweDvUplinkRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapVirtualizationIweDvswitchRelationship(t *testing.T) { p := models.VirtualizationIweDvswitchRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenMapVirtualizationIweDvswitchRelationship(p, d) @@ -16993,14 +16993,14 @@ func TestFlattenMapVirtualizationIweDvswitchRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVirtualizationIweDvswitchRelationship(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} + expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapVirtualizationIweHostRelationship(t *testing.T) { p := models.VirtualizationIweHostRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapVirtualizationIweHostRelationship(p, d) @@ -17011,14 +17011,14 @@ func TestFlattenMapVirtualizationIweHostRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVirtualizationIweHostRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapVirtualizationIweNetworkRelationship(t *testing.T) { p := models.VirtualizationIweNetworkRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapVirtualizationIweNetworkRelationship(p, d) @@ -17029,14 +17029,14 @@ func TestFlattenMapVirtualizationIweNetworkRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVirtualizationIweNetworkRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapVirtualizationIweVirtualDiskRelationship(t *testing.T) { p := models.VirtualizationIweVirtualDiskRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapVirtualizationIweVirtualDiskRelationship(p, d) @@ -17047,14 +17047,14 @@ func TestFlattenMapVirtualizationIweVirtualDiskRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVirtualizationIweVirtualDiskRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapVirtualizationIweVirtualMachineRelationship(t *testing.T) { p := models.VirtualizationIweVirtualMachineRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapVirtualizationIweVirtualMachineRelationship(p, d) @@ -17065,14 +17065,14 @@ func TestFlattenMapVirtualizationIweVirtualMachineRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVirtualizationIweVirtualMachineRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapVirtualizationMemoryAllocation(t *testing.T) { p := models.VirtualizationMemoryAllocation{} var d = &schema.ResourceData{} - c := `{"Free":32,"Reserved":32,"Total":32,"Used":32,"ObjectType":"virtualization.MemoryAllocation","ClassId":"virtualization.MemoryAllocation"}` + c := `{"Used":32,"ObjectType":"virtualization.MemoryAllocation","ClassId":"virtualization.MemoryAllocation","Free":32,"Reserved":32,"Total":32}` //test when the response is empty ffOpEmpty := flattenMapVirtualizationMemoryAllocation(p, d) @@ -17083,14 +17083,14 @@ func TestFlattenMapVirtualizationMemoryAllocation(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVirtualizationMemoryAllocation(p, d)[0] - expectedOp := map[string]interface{}{"free": 32, "reserved": 32, "total": 32, "used": 32, "object_type": "virtualization.MemoryAllocation", "class_id": "virtualization.MemoryAllocation"} + expectedOp := map[string]interface{}{"used": 32, "object_type": "virtualization.MemoryAllocation", "class_id": "virtualization.MemoryAllocation", "free": 32, "reserved": 32, "total": 32} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapVirtualizationMemoryCapacity(t *testing.T) { p := models.VirtualizationMemoryCapacity{} var d = &schema.ResourceData{} - c := `{"ClassId":"virtualization.MemoryCapacity","Capacity":32,"Free":32,"Used":32,"ObjectType":"virtualization.MemoryCapacity"}` + c := `{"ObjectType":"virtualization.MemoryCapacity","ClassId":"virtualization.MemoryCapacity","Capacity":32,"Free":32,"Used":32}` //test when the response is empty ffOpEmpty := flattenMapVirtualizationMemoryCapacity(p, d) @@ -17101,14 +17101,14 @@ func TestFlattenMapVirtualizationMemoryCapacity(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVirtualizationMemoryCapacity(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "virtualization.MemoryCapacity", "capacity": 32, "free": 32, "used": 32, "object_type": "virtualization.MemoryCapacity"} + expectedOp := map[string]interface{}{"object_type": "virtualization.MemoryCapacity", "class_id": "virtualization.MemoryCapacity", "capacity": 32, "free": 32, "used": 32} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapVirtualizationProductInfo(t *testing.T) { p := models.VirtualizationProductInfo{} var d = &schema.ResourceData{} - c := `{"ProductType":"ProductType %d","ProductVendor":"ProductVendor %d","Version":"Version %d","ClassId":"virtualization.ProductInfo","ObjectType":"virtualization.ProductInfo","Build":"Build %d","ProductName":"ProductName %d"}` + c := `{"Version":"Version %d","Build":"Build %d","ProductName":"ProductName %d","ProductType":"ProductType %d","ObjectType":"virtualization.ProductInfo","ClassId":"virtualization.ProductInfo","ProductVendor":"ProductVendor %d"}` //test when the response is empty ffOpEmpty := flattenMapVirtualizationProductInfo(p, d) @@ -17119,14 +17119,14 @@ func TestFlattenMapVirtualizationProductInfo(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVirtualizationProductInfo(p, d)[0] - expectedOp := map[string]interface{}{"product_type": "ProductType 1", "product_vendor": "ProductVendor 1", "nr_version": "Version 1", "class_id": "virtualization.ProductInfo", "object_type": "virtualization.ProductInfo", "build": "Build 1", "product_name": "ProductName 1"} + expectedOp := map[string]interface{}{"nr_version": "Version 1", "build": "Build 1", "product_name": "ProductName 1", "product_type": "ProductType 1", "object_type": "virtualization.ProductInfo", "class_id": "virtualization.ProductInfo", "product_vendor": "ProductVendor 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapVirtualizationStorageCapacity(t *testing.T) { p := models.VirtualizationStorageCapacity{} var d = &schema.ResourceData{} - c := `{"ClassId":"virtualization.StorageCapacity","Capacity":32,"Free":32,"Used":32,"ObjectType":"virtualization.StorageCapacity"}` + c := `{"Used":32,"Capacity":32,"Free":32,"ObjectType":"virtualization.StorageCapacity","ClassId":"virtualization.StorageCapacity"}` //test when the response is empty ffOpEmpty := flattenMapVirtualizationStorageCapacity(p, d) @@ -17137,7 +17137,7 @@ func TestFlattenMapVirtualizationStorageCapacity(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVirtualizationStorageCapacity(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "virtualization.StorageCapacity", "capacity": 32, "free": 32, "used": 32, "object_type": "virtualization.StorageCapacity"} + expectedOp := map[string]interface{}{"used": 32, "capacity": 32, "free": 32, "object_type": "virtualization.StorageCapacity", "class_id": "virtualization.StorageCapacity"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -17162,7 +17162,7 @@ func TestFlattenMapVirtualizationVirtualMachineRelationship(t *testing.T) { func TestFlattenMapVirtualizationVmwareClusterRelationship(t *testing.T) { p := models.VirtualizationVmwareClusterRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapVirtualizationVmwareClusterRelationship(p, d) @@ -17173,14 +17173,14 @@ func TestFlattenMapVirtualizationVmwareClusterRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVirtualizationVmwareClusterRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapVirtualizationVmwareDatacenterRelationship(t *testing.T) { p := models.VirtualizationVmwareDatacenterRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenMapVirtualizationVmwareDatacenterRelationship(p, d) @@ -17191,14 +17191,14 @@ func TestFlattenMapVirtualizationVmwareDatacenterRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVirtualizationVmwareDatacenterRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapVirtualizationVmwareDatastoreRelationship(t *testing.T) { p := models.VirtualizationVmwareDatastoreRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapVirtualizationVmwareDatastoreRelationship(p, d) @@ -17209,14 +17209,14 @@ func TestFlattenMapVirtualizationVmwareDatastoreRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVirtualizationVmwareDatastoreRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapVirtualizationVmwareDatastoreClusterRelationship(t *testing.T) { p := models.VirtualizationVmwareDatastoreClusterRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapVirtualizationVmwareDatastoreClusterRelationship(p, d) @@ -17227,14 +17227,14 @@ func TestFlattenMapVirtualizationVmwareDatastoreClusterRelationship(t *testing.T err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVirtualizationVmwareDatastoreClusterRelationship(p, d)[0] - expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} + expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapVirtualizationVmwareDiscoveryProtocol(t *testing.T) { p := models.VirtualizationVmwareDiscoveryProtocol{} var d = &schema.ResourceData{} - c := `{"ClassId":"virtualization.VmwareDiscoveryProtocol","ObjectType":"virtualization.VmwareDiscoveryProtocol","Operation":"Operation %d","Type":"Type %d"}` + c := `{"ObjectType":"virtualization.VmwareDiscoveryProtocol","Operation":"Operation %d","Type":"Type %d","ClassId":"virtualization.VmwareDiscoveryProtocol"}` //test when the response is empty ffOpEmpty := flattenMapVirtualizationVmwareDiscoveryProtocol(p, d) @@ -17245,14 +17245,14 @@ func TestFlattenMapVirtualizationVmwareDiscoveryProtocol(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVirtualizationVmwareDiscoveryProtocol(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "virtualization.VmwareDiscoveryProtocol", "object_type": "virtualization.VmwareDiscoveryProtocol", "operation": "Operation 1", "type": "Type 1"} + expectedOp := map[string]interface{}{"object_type": "virtualization.VmwareDiscoveryProtocol", "operation": "Operation 1", "type": "Type 1", "class_id": "virtualization.VmwareDiscoveryProtocol"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapVirtualizationVmwareDistributedNetworkRelationship(t *testing.T) { p := models.VirtualizationVmwareDistributedNetworkRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenMapVirtualizationVmwareDistributedNetworkRelationship(p, d) @@ -17263,14 +17263,14 @@ func TestFlattenMapVirtualizationVmwareDistributedNetworkRelationship(t *testing err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVirtualizationVmwareDistributedNetworkRelationship(p, d)[0] - expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} + expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapVirtualizationVmwareDistributedSwitchRelationship(t *testing.T) { p := models.VirtualizationVmwareDistributedSwitchRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenMapVirtualizationVmwareDistributedSwitchRelationship(p, d) @@ -17281,14 +17281,14 @@ func TestFlattenMapVirtualizationVmwareDistributedSwitchRelationship(t *testing. err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVirtualizationVmwareDistributedSwitchRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapVirtualizationVmwareFolderRelationship(t *testing.T) { p := models.VirtualizationVmwareFolderRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapVirtualizationVmwareFolderRelationship(p, d) @@ -17299,7 +17299,7 @@ func TestFlattenMapVirtualizationVmwareFolderRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVirtualizationVmwareFolderRelationship(p, d)[0] - expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} + expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -17324,7 +17324,7 @@ func TestFlattenMapVirtualizationVmwareHostRelationship(t *testing.T) { func TestFlattenMapVirtualizationVmwareNetworkRelationship(t *testing.T) { p := models.VirtualizationVmwareNetworkRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapVirtualizationVmwareNetworkRelationship(p, d) @@ -17335,7 +17335,7 @@ func TestFlattenMapVirtualizationVmwareNetworkRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVirtualizationVmwareNetworkRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -17360,7 +17360,7 @@ func TestFlattenMapVirtualizationVmwarePhysicalNetworkInterfaceRelationship(t *t func TestFlattenMapVirtualizationVmwareRemoteDisplayInfo(t *testing.T) { p := models.VirtualizationVmwareRemoteDisplayInfo{} var d = &schema.ResourceData{} - c := `{"ObjectType":"virtualization.VmwareRemoteDisplayInfo","ClassId":"virtualization.VmwareRemoteDisplayInfo","RemoteDisplayPassword":"RemoteDisplayPassword %d","RemoteDisplayVncKey":"RemoteDisplayVncKey %d","RemoteDisplayVncPort":32}` + c := `{"ClassId":"virtualization.VmwareRemoteDisplayInfo","RemoteDisplayPassword":"RemoteDisplayPassword %d","RemoteDisplayVncKey":"RemoteDisplayVncKey %d","RemoteDisplayVncPort":32,"ObjectType":"virtualization.VmwareRemoteDisplayInfo"}` //test when the response is empty ffOpEmpty := flattenMapVirtualizationVmwareRemoteDisplayInfo(p, d) @@ -17371,7 +17371,7 @@ func TestFlattenMapVirtualizationVmwareRemoteDisplayInfo(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVirtualizationVmwareRemoteDisplayInfo(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "virtualization.VmwareRemoteDisplayInfo", "class_id": "virtualization.VmwareRemoteDisplayInfo", "remote_display_password": "RemoteDisplayPassword 1", "remote_display_vnc_key": "RemoteDisplayVncKey 1", "remote_display_vnc_port": 32} + expectedOp := map[string]interface{}{"class_id": "virtualization.VmwareRemoteDisplayInfo", "remote_display_password": "RemoteDisplayPassword 1", "remote_display_vnc_key": "RemoteDisplayVncKey 1", "remote_display_vnc_port": 32, "object_type": "virtualization.VmwareRemoteDisplayInfo"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -17396,7 +17396,7 @@ func TestFlattenMapVirtualizationVmwareResourceConsumption(t *testing.T) { func TestFlattenMapVirtualizationVmwareSharesInfo(t *testing.T) { p := models.VirtualizationVmwareSharesInfo{} var d = &schema.ResourceData{} - c := `{"ClassId":"virtualization.VmwareSharesInfo","Level":"Level %d","Shares":32,"ObjectType":"virtualization.VmwareSharesInfo"}` + c := `{"Shares":32,"ObjectType":"virtualization.VmwareSharesInfo","ClassId":"virtualization.VmwareSharesInfo","Level":"Level %d"}` //test when the response is empty ffOpEmpty := flattenMapVirtualizationVmwareSharesInfo(p, d) @@ -17407,14 +17407,14 @@ func TestFlattenMapVirtualizationVmwareSharesInfo(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVirtualizationVmwareSharesInfo(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "virtualization.VmwareSharesInfo", "level": "Level 1", "shares": 32, "object_type": "virtualization.VmwareSharesInfo"} + expectedOp := map[string]interface{}{"shares": 32, "object_type": "virtualization.VmwareSharesInfo", "class_id": "virtualization.VmwareSharesInfo", "level": "Level 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapVirtualizationVmwareTeamingAndFailover(t *testing.T) { p := models.VirtualizationVmwareTeamingAndFailover{} var d = &schema.ResourceData{} - c := `{"ClassId":"virtualization.VmwareTeamingAndFailover","ObjectType":"virtualization.VmwareTeamingAndFailover","NotifySwitches":true,"Name":"Name %d","LoadBalancing":"LoadBalancing %d","NetworkFailureDetection":"NetworkFailureDetection %d","Failback":true}` + c := `{"LoadBalancing":"LoadBalancing %d","NotifySwitches":true,"ObjectType":"virtualization.VmwareTeamingAndFailover","ClassId":"virtualization.VmwareTeamingAndFailover","Name":"Name %d","NetworkFailureDetection":"NetworkFailureDetection %d","Failback":true}` //test when the response is empty ffOpEmpty := flattenMapVirtualizationVmwareTeamingAndFailover(p, d) @@ -17425,14 +17425,14 @@ func TestFlattenMapVirtualizationVmwareTeamingAndFailover(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVirtualizationVmwareTeamingAndFailover(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "virtualization.VmwareTeamingAndFailover", "object_type": "virtualization.VmwareTeamingAndFailover", "notify_switches": true, "name": "Name 1", "load_balancing": "LoadBalancing 1", "network_failure_detection": "NetworkFailureDetection 1", "failback": true} + expectedOp := map[string]interface{}{"load_balancing": "LoadBalancing 1", "notify_switches": true, "object_type": "virtualization.VmwareTeamingAndFailover", "class_id": "virtualization.VmwareTeamingAndFailover", "name": "Name 1", "network_failure_detection": "NetworkFailureDetection 1", "failback": true} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapVirtualizationVmwareVcenterRelationship(t *testing.T) { p := models.VirtualizationVmwareVcenterRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapVirtualizationVmwareVcenterRelationship(p, d) @@ -17443,7 +17443,7 @@ func TestFlattenMapVirtualizationVmwareVcenterRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVirtualizationVmwareVcenterRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -17468,7 +17468,7 @@ func TestFlattenMapVirtualizationVmwareVirtualMachineRelationship(t *testing.T) func TestFlattenMapVirtualizationVmwareVirtualSwitchRelationship(t *testing.T) { p := models.VirtualizationVmwareVirtualSwitchRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenMapVirtualizationVmwareVirtualSwitchRelationship(p, d) @@ -17479,14 +17479,14 @@ func TestFlattenMapVirtualizationVmwareVirtualSwitchRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVirtualizationVmwareVirtualSwitchRelationship(p, d)[0] - expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} + expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapVirtualizationVmwareVmCpuShareInfo(t *testing.T) { p := models.VirtualizationVmwareVmCpuShareInfo{} var d = &schema.ResourceData{} - c := `{"CpuOverheadLimit":32,"CpuReservation":32,"CpuShares":32,"ObjectType":"virtualization.VmwareVmCpuShareInfo","ClassId":"virtualization.VmwareVmCpuShareInfo","CpuLimit":32}` + c := `{"CpuReservation":32,"CpuShares":32,"CpuLimit":32,"CpuOverheadLimit":32,"ObjectType":"virtualization.VmwareVmCpuShareInfo","ClassId":"virtualization.VmwareVmCpuShareInfo"}` //test when the response is empty ffOpEmpty := flattenMapVirtualizationVmwareVmCpuShareInfo(p, d) @@ -17497,14 +17497,14 @@ func TestFlattenMapVirtualizationVmwareVmCpuShareInfo(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVirtualizationVmwareVmCpuShareInfo(p, d)[0] - expectedOp := map[string]interface{}{"cpu_overhead_limit": 32, "cpu_reservation": 32, "cpu_shares": 32, "object_type": "virtualization.VmwareVmCpuShareInfo", "class_id": "virtualization.VmwareVmCpuShareInfo", "cpu_limit": 32} + expectedOp := map[string]interface{}{"cpu_reservation": 32, "cpu_shares": 32, "cpu_limit": 32, "cpu_overhead_limit": 32, "object_type": "virtualization.VmwareVmCpuShareInfo", "class_id": "virtualization.VmwareVmCpuShareInfo"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapVirtualizationVmwareVmCpuSocketInfo(t *testing.T) { p := models.VirtualizationVmwareVmCpuSocketInfo{} var d = &schema.ResourceData{} - c := `{"NumCpus":32,"NumSockets":32,"CoresPerSocket":32,"ObjectType":"virtualization.VmwareVmCpuSocketInfo","ClassId":"virtualization.VmwareVmCpuSocketInfo"}` + c := `{"NumSockets":32,"ObjectType":"virtualization.VmwareVmCpuSocketInfo","ClassId":"virtualization.VmwareVmCpuSocketInfo","CoresPerSocket":32,"NumCpus":32}` //test when the response is empty ffOpEmpty := flattenMapVirtualizationVmwareVmCpuSocketInfo(p, d) @@ -17515,14 +17515,14 @@ func TestFlattenMapVirtualizationVmwareVmCpuSocketInfo(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVirtualizationVmwareVmCpuSocketInfo(p, d)[0] - expectedOp := map[string]interface{}{"num_cpus": 32, "num_sockets": 32, "cores_per_socket": 32, "object_type": "virtualization.VmwareVmCpuSocketInfo", "class_id": "virtualization.VmwareVmCpuSocketInfo"} + expectedOp := map[string]interface{}{"num_sockets": 32, "object_type": "virtualization.VmwareVmCpuSocketInfo", "class_id": "virtualization.VmwareVmCpuSocketInfo", "cores_per_socket": 32, "num_cpus": 32} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapVirtualizationVmwareVmDiskCommitInfo(t *testing.T) { p := models.VirtualizationVmwareVmDiskCommitInfo{} var d = &schema.ResourceData{} - c := `{"UnCommittedDisk":32,"UnsharedDisk":32,"ObjectType":"virtualization.VmwareVmDiskCommitInfo","ClassId":"virtualization.VmwareVmDiskCommitInfo","CommittedDisk":32}` + c := `{"ObjectType":"virtualization.VmwareVmDiskCommitInfo","ClassId":"virtualization.VmwareVmDiskCommitInfo","CommittedDisk":32,"UnCommittedDisk":32,"UnsharedDisk":32}` //test when the response is empty ffOpEmpty := flattenMapVirtualizationVmwareVmDiskCommitInfo(p, d) @@ -17533,14 +17533,14 @@ func TestFlattenMapVirtualizationVmwareVmDiskCommitInfo(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVirtualizationVmwareVmDiskCommitInfo(p, d)[0] - expectedOp := map[string]interface{}{"un_committed_disk": 32, "unshared_disk": 32, "object_type": "virtualization.VmwareVmDiskCommitInfo", "class_id": "virtualization.VmwareVmDiskCommitInfo", "committed_disk": 32} + expectedOp := map[string]interface{}{"object_type": "virtualization.VmwareVmDiskCommitInfo", "class_id": "virtualization.VmwareVmDiskCommitInfo", "committed_disk": 32, "un_committed_disk": 32, "unshared_disk": 32} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapVirtualizationVmwareVmMemoryShareInfo(t *testing.T) { p := models.VirtualizationVmwareVmMemoryShareInfo{} var d = &schema.ResourceData{} - c := `{"MemOverheadLimit":32,"MemReservation":32,"MemShares":32,"ObjectType":"virtualization.VmwareVmMemoryShareInfo","ClassId":"virtualization.VmwareVmMemoryShareInfo","MemLimit":32}` + c := `{"ObjectType":"virtualization.VmwareVmMemoryShareInfo","ClassId":"virtualization.VmwareVmMemoryShareInfo","MemReservation":32,"MemShares":32,"MemLimit":32,"MemOverheadLimit":32}` //test when the response is empty ffOpEmpty := flattenMapVirtualizationVmwareVmMemoryShareInfo(p, d) @@ -17551,14 +17551,14 @@ func TestFlattenMapVirtualizationVmwareVmMemoryShareInfo(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVirtualizationVmwareVmMemoryShareInfo(p, d)[0] - expectedOp := map[string]interface{}{"mem_overhead_limit": 32, "mem_reservation": 32, "mem_shares": 32, "object_type": "virtualization.VmwareVmMemoryShareInfo", "class_id": "virtualization.VmwareVmMemoryShareInfo", "mem_limit": 32} + expectedOp := map[string]interface{}{"object_type": "virtualization.VmwareVmMemoryShareInfo", "class_id": "virtualization.VmwareVmMemoryShareInfo", "mem_reservation": 32, "mem_shares": 32, "mem_limit": 32, "mem_overhead_limit": 32} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapVnicArfsSettings(t *testing.T) { p := models.VnicArfsSettings{} var d = &schema.ResourceData{} - c := `{"ObjectType":"vnic.ArfsSettings","ClassId":"vnic.ArfsSettings","Enabled":true}` + c := `{"ClassId":"vnic.ArfsSettings","Enabled":true,"ObjectType":"vnic.ArfsSettings"}` //test when the response is empty ffOpEmpty := flattenMapVnicArfsSettings(p, d) @@ -17569,14 +17569,14 @@ func TestFlattenMapVnicArfsSettings(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVnicArfsSettings(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "vnic.ArfsSettings", "class_id": "vnic.ArfsSettings", "enabled": true} + expectedOp := map[string]interface{}{"class_id": "vnic.ArfsSettings", "enabled": true, "object_type": "vnic.ArfsSettings"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapVnicCdn(t *testing.T) { p := models.VnicCdn{} var d = &schema.ResourceData{} - c := `{"Value":"Value %d","ObjectType":"vnic.Cdn","ClassId":"vnic.Cdn","Source":"Source %d"}` + c := `{"Source":"Source %d","Value":"Value %d","ObjectType":"vnic.Cdn","ClassId":"vnic.Cdn"}` //test when the response is empty ffOpEmpty := flattenMapVnicCdn(p, d) @@ -17587,14 +17587,14 @@ func TestFlattenMapVnicCdn(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVnicCdn(p, d)[0] - expectedOp := map[string]interface{}{"value": "Value 1", "object_type": "vnic.Cdn", "class_id": "vnic.Cdn", "nr_source": "Source 1"} + expectedOp := map[string]interface{}{"nr_source": "Source 1", "value": "Value 1", "object_type": "vnic.Cdn", "class_id": "vnic.Cdn"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapVnicCompletionQueueSettings(t *testing.T) { p := models.VnicCompletionQueueSettings{} var d = &schema.ResourceData{} - c := `{"Count":32,"ClassId":"vnic.CompletionQueueSettings","ObjectType":"vnic.CompletionQueueSettings","RingSize":32}` + c := `{"ObjectType":"vnic.CompletionQueueSettings","ClassId":"vnic.CompletionQueueSettings","Count":32,"RingSize":32}` //test when the response is empty ffOpEmpty := flattenMapVnicCompletionQueueSettings(p, d) @@ -17605,14 +17605,14 @@ func TestFlattenMapVnicCompletionQueueSettings(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVnicCompletionQueueSettings(p, d)[0] - expectedOp := map[string]interface{}{"nr_count": 32, "class_id": "vnic.CompletionQueueSettings", "object_type": "vnic.CompletionQueueSettings", "ring_size": 32} + expectedOp := map[string]interface{}{"object_type": "vnic.CompletionQueueSettings", "class_id": "vnic.CompletionQueueSettings", "nr_count": 32, "ring_size": 32} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapVnicEthAdapterPolicyRelationship(t *testing.T) { p := models.VnicEthAdapterPolicyRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenMapVnicEthAdapterPolicyRelationship(p, d) @@ -17623,14 +17623,14 @@ func TestFlattenMapVnicEthAdapterPolicyRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVnicEthAdapterPolicyRelationship(p, d)[0] - expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} + expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapVnicEthIfRelationship(t *testing.T) { p := models.VnicEthIfRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapVnicEthIfRelationship(p, d) @@ -17641,14 +17641,14 @@ func TestFlattenMapVnicEthIfRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVnicEthIfRelationship(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapVnicEthInterruptSettings(t *testing.T) { p := models.VnicEthInterruptSettings{} var d = &schema.ResourceData{} - c := `{"ObjectType":"vnic.EthInterruptSettings","ClassId":"vnic.EthInterruptSettings","CoalescingTime":32,"CoalescingType":"CoalescingType %d","Count":32,"Mode":"Mode %d"}` + c := `{"Mode":"Mode %d","ObjectType":"vnic.EthInterruptSettings","ClassId":"vnic.EthInterruptSettings","CoalescingTime":32,"CoalescingType":"CoalescingType %d","Count":32}` //test when the response is empty ffOpEmpty := flattenMapVnicEthInterruptSettings(p, d) @@ -17659,7 +17659,7 @@ func TestFlattenMapVnicEthInterruptSettings(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVnicEthInterruptSettings(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "vnic.EthInterruptSettings", "class_id": "vnic.EthInterruptSettings", "coalescing_time": 32, "coalescing_type": "CoalescingType 1", "nr_count": 32, "mode": "Mode 1"} + expectedOp := map[string]interface{}{"mode": "Mode 1", "object_type": "vnic.EthInterruptSettings", "class_id": "vnic.EthInterruptSettings", "coalescing_time": 32, "coalescing_type": "CoalescingType 1", "nr_count": 32} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -17702,7 +17702,7 @@ func TestFlattenMapVnicEthQosPolicyRelationship(t *testing.T) { func TestFlattenMapVnicEthRxQueueSettings(t *testing.T) { p := models.VnicEthRxQueueSettings{} var d = &schema.ResourceData{} - c := `{"ClassId":"vnic.EthRxQueueSettings","Count":32,"RingSize":32,"ObjectType":"vnic.EthRxQueueSettings"}` + c := `{"Count":32,"RingSize":32,"ObjectType":"vnic.EthRxQueueSettings","ClassId":"vnic.EthRxQueueSettings"}` //test when the response is empty ffOpEmpty := flattenMapVnicEthRxQueueSettings(p, d) @@ -17713,14 +17713,14 @@ func TestFlattenMapVnicEthRxQueueSettings(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVnicEthRxQueueSettings(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "vnic.EthRxQueueSettings", "nr_count": 32, "ring_size": 32, "object_type": "vnic.EthRxQueueSettings"} + expectedOp := map[string]interface{}{"nr_count": 32, "ring_size": 32, "object_type": "vnic.EthRxQueueSettings", "class_id": "vnic.EthRxQueueSettings"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapVnicEthTxQueueSettings(t *testing.T) { p := models.VnicEthTxQueueSettings{} var d = &schema.ResourceData{} - c := `{"ClassId":"vnic.EthTxQueueSettings","Count":32,"RingSize":32,"ObjectType":"vnic.EthTxQueueSettings"}` + c := `{"Count":32,"RingSize":32,"ObjectType":"vnic.EthTxQueueSettings","ClassId":"vnic.EthTxQueueSettings"}` //test when the response is empty ffOpEmpty := flattenMapVnicEthTxQueueSettings(p, d) @@ -17731,14 +17731,14 @@ func TestFlattenMapVnicEthTxQueueSettings(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVnicEthTxQueueSettings(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "vnic.EthTxQueueSettings", "nr_count": 32, "ring_size": 32, "object_type": "vnic.EthTxQueueSettings"} + expectedOp := map[string]interface{}{"nr_count": 32, "ring_size": 32, "object_type": "vnic.EthTxQueueSettings", "class_id": "vnic.EthTxQueueSettings"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapVnicFcAdapterPolicyRelationship(t *testing.T) { p := models.VnicFcAdapterPolicyRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapVnicFcAdapterPolicyRelationship(p, d) @@ -17749,14 +17749,14 @@ func TestFlattenMapVnicFcAdapterPolicyRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVnicFcAdapterPolicyRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapVnicFcErrorRecoverySettings(t *testing.T) { p := models.VnicFcErrorRecoverySettings{} var d = &schema.ResourceData{} - c := `{"PortDownTimeout":32,"ClassId":"vnic.FcErrorRecoverySettings","ObjectType":"vnic.FcErrorRecoverySettings","Enabled":true,"IoRetryCount":32,"IoRetryTimeout":32,"LinkDownTimeout":32}` + c := `{"ObjectType":"vnic.FcErrorRecoverySettings","ClassId":"vnic.FcErrorRecoverySettings","Enabled":true,"IoRetryCount":32,"IoRetryTimeout":32,"LinkDownTimeout":32,"PortDownTimeout":32}` //test when the response is empty ffOpEmpty := flattenMapVnicFcErrorRecoverySettings(p, d) @@ -17767,14 +17767,14 @@ func TestFlattenMapVnicFcErrorRecoverySettings(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVnicFcErrorRecoverySettings(p, d)[0] - expectedOp := map[string]interface{}{"port_down_timeout": 32, "class_id": "vnic.FcErrorRecoverySettings", "object_type": "vnic.FcErrorRecoverySettings", "enabled": true, "io_retry_count": 32, "io_retry_timeout": 32, "link_down_timeout": 32} + expectedOp := map[string]interface{}{"object_type": "vnic.FcErrorRecoverySettings", "class_id": "vnic.FcErrorRecoverySettings", "enabled": true, "io_retry_count": 32, "io_retry_timeout": 32, "link_down_timeout": 32, "port_down_timeout": 32} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapVnicFcIfRelationship(t *testing.T) { p := models.VnicFcIfRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenMapVnicFcIfRelationship(p, d) @@ -17785,14 +17785,14 @@ func TestFlattenMapVnicFcIfRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVnicFcIfRelationship(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} + expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapVnicFcInterruptSettings(t *testing.T) { p := models.VnicFcInterruptSettings{} var d = &schema.ResourceData{} - c := `{"ObjectType":"vnic.FcInterruptSettings","ClassId":"vnic.FcInterruptSettings","Mode":"Mode %d"}` + c := `{"Mode":"Mode %d","ObjectType":"vnic.FcInterruptSettings","ClassId":"vnic.FcInterruptSettings"}` //test when the response is empty ffOpEmpty := flattenMapVnicFcInterruptSettings(p, d) @@ -17803,14 +17803,14 @@ func TestFlattenMapVnicFcInterruptSettings(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVnicFcInterruptSettings(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "vnic.FcInterruptSettings", "class_id": "vnic.FcInterruptSettings", "mode": "Mode 1"} + expectedOp := map[string]interface{}{"mode": "Mode 1", "object_type": "vnic.FcInterruptSettings", "class_id": "vnic.FcInterruptSettings"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapVnicFcNetworkPolicyRelationship(t *testing.T) { p := models.VnicFcNetworkPolicyRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenMapVnicFcNetworkPolicyRelationship(p, d) @@ -17821,14 +17821,14 @@ func TestFlattenMapVnicFcNetworkPolicyRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVnicFcNetworkPolicyRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapVnicFcQosPolicyRelationship(t *testing.T) { p := models.VnicFcQosPolicyRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapVnicFcQosPolicyRelationship(p, d) @@ -17839,14 +17839,14 @@ func TestFlattenMapVnicFcQosPolicyRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVnicFcQosPolicyRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapVnicFcQueueSettings(t *testing.T) { p := models.VnicFcQueueSettings{} var d = &schema.ResourceData{} - c := `{"ObjectType":"vnic.FcQueueSettings","ClassId":"vnic.FcQueueSettings","Count":32,"RingSize":32}` + c := `{"ClassId":"vnic.FcQueueSettings","RingSize":32,"Count":32,"ObjectType":"vnic.FcQueueSettings"}` //test when the response is empty ffOpEmpty := flattenMapVnicFcQueueSettings(p, d) @@ -17857,7 +17857,7 @@ func TestFlattenMapVnicFcQueueSettings(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVnicFcQueueSettings(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "vnic.FcQueueSettings", "class_id": "vnic.FcQueueSettings", "nr_count": 32, "ring_size": 32} + expectedOp := map[string]interface{}{"class_id": "vnic.FcQueueSettings", "ring_size": 32, "nr_count": 32, "object_type": "vnic.FcQueueSettings"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -17900,7 +17900,7 @@ func TestFlattenMapVnicIscsiAdapterPolicyRelationship(t *testing.T) { func TestFlattenMapVnicIscsiAuthProfile(t *testing.T) { p := models.VnicIscsiAuthProfile{} var d = &schema.ResourceData{} - c := `{"UserId":"UserId %d","ObjectType":"vnic.IscsiAuthProfile","ClassId":"vnic.IscsiAuthProfile","IsPasswordSet":true}` + c := `{"IsPasswordSet":true,"UserId":"UserId %d","ObjectType":"vnic.IscsiAuthProfile","ClassId":"vnic.IscsiAuthProfile"}` //test when the response is empty ffOpEmpty := flattenMapVnicIscsiAuthProfile(p, d) @@ -17911,14 +17911,14 @@ func TestFlattenMapVnicIscsiAuthProfile(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVnicIscsiAuthProfile(p, d)[0] - expectedOp := map[string]interface{}{"user_id": "UserId 1", "object_type": "vnic.IscsiAuthProfile", "class_id": "vnic.IscsiAuthProfile", "is_password_set": true} + expectedOp := map[string]interface{}{"is_password_set": true, "user_id": "UserId 1", "object_type": "vnic.IscsiAuthProfile", "class_id": "vnic.IscsiAuthProfile"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapVnicIscsiBootPolicyRelationship(t *testing.T) { p := models.VnicIscsiBootPolicyRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapVnicIscsiBootPolicyRelationship(p, d) @@ -17929,14 +17929,14 @@ func TestFlattenMapVnicIscsiBootPolicyRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVnicIscsiBootPolicyRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapVnicIscsiStaticTargetPolicyRelationship(t *testing.T) { p := models.VnicIscsiStaticTargetPolicyRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenMapVnicIscsiStaticTargetPolicyRelationship(p, d) @@ -17947,7 +17947,7 @@ func TestFlattenMapVnicIscsiStaticTargetPolicyRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVnicIscsiStaticTargetPolicyRelationship(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} + expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -17972,7 +17972,7 @@ func TestFlattenMapVnicLanConnectivityPolicyRelationship(t *testing.T) { func TestFlattenMapVnicLun(t *testing.T) { p := models.VnicLun{} var d = &schema.ResourceData{} - c := `{"LunId":32,"ObjectType":"vnic.Lun","ClassId":"vnic.Lun","Bootable":true}` + c := `{"Bootable":true,"ObjectType":"vnic.Lun","ClassId":"vnic.Lun","LunId":32}` //test when the response is empty ffOpEmpty := flattenMapVnicLun(p, d) @@ -17983,7 +17983,7 @@ func TestFlattenMapVnicLun(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVnicLun(p, d)[0] - expectedOp := map[string]interface{}{"lun_id": 32, "object_type": "vnic.Lun", "class_id": "vnic.Lun", "bootable": true} + expectedOp := map[string]interface{}{"bootable": true, "object_type": "vnic.Lun", "class_id": "vnic.Lun", "lun_id": 32} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -18008,7 +18008,7 @@ func TestFlattenMapVnicNvgreSettings(t *testing.T) { func TestFlattenMapVnicPlacementSettings(t *testing.T) { p := models.VnicPlacementSettings{} var d = &schema.ResourceData{} - c := `{"ObjectType":"vnic.PlacementSettings","ClassId":"vnic.PlacementSettings","Uplink":32,"Id":"Id %d","PciLink":32,"SwitchId":"SwitchId %d"}` + c := `{"Id":"Id %d","PciLink":32,"SwitchId":"SwitchId %d","Uplink":32,"ObjectType":"vnic.PlacementSettings","ClassId":"vnic.PlacementSettings"}` //test when the response is empty ffOpEmpty := flattenMapVnicPlacementSettings(p, d) @@ -18019,7 +18019,7 @@ func TestFlattenMapVnicPlacementSettings(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVnicPlacementSettings(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "vnic.PlacementSettings", "class_id": "vnic.PlacementSettings", "uplink": 32, "id": "Id 1", "pci_link": 32, "switch_id": "SwitchId 1"} + expectedOp := map[string]interface{}{"id": "Id 1", "pci_link": 32, "switch_id": "SwitchId 1", "uplink": 32, "object_type": "vnic.PlacementSettings", "class_id": "vnic.PlacementSettings"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -18062,7 +18062,7 @@ func TestFlattenMapVnicPtpSettings(t *testing.T) { func TestFlattenMapVnicRoceSettings(t *testing.T) { p := models.VnicRoceSettings{} var d = &schema.ResourceData{} - c := `{"ObjectType":"vnic.RoceSettings","MemoryRegions":32,"QueuePairs":32,"ResourceGroups":32,"Version":32,"ClassId":"vnic.RoceSettings","ClassOfService":32,"Enabled":true}` + c := `{"ClassId":"vnic.RoceSettings","ResourceGroups":32,"Version":32,"Enabled":true,"MemoryRegions":32,"QueuePairs":32,"ObjectType":"vnic.RoceSettings","ClassOfService":32}` //test when the response is empty ffOpEmpty := flattenMapVnicRoceSettings(p, d) @@ -18073,14 +18073,14 @@ func TestFlattenMapVnicRoceSettings(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVnicRoceSettings(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "vnic.RoceSettings", "memory_regions": 32, "queue_pairs": 32, "resource_groups": 32, "nr_version": 32, "class_id": "vnic.RoceSettings", "class_of_service": 32, "enabled": true} + expectedOp := map[string]interface{}{"class_id": "vnic.RoceSettings", "resource_groups": 32, "nr_version": 32, "enabled": true, "memory_regions": 32, "queue_pairs": 32, "object_type": "vnic.RoceSettings", "class_of_service": 32} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapVnicRssHashSettings(t *testing.T) { p := models.VnicRssHashSettings{} var d = &schema.ResourceData{} - c := `{"Ipv4Hash":true,"TcpIpv4Hash":true,"UdpIpv6Hash":true,"TcpIpv6ExtHash":true,"Ipv6ExtHash":true,"TcpIpv6Hash":true,"UdpIpv4Hash":true,"ObjectType":"vnic.RssHashSettings","ClassId":"vnic.RssHashSettings","Ipv6Hash":true}` + c := `{"UdpIpv6Hash":true,"Ipv6Hash":true,"TcpIpv6ExtHash":true,"ObjectType":"vnic.RssHashSettings","TcpIpv4Hash":true,"UdpIpv4Hash":true,"Ipv6ExtHash":true,"Ipv4Hash":true,"ClassId":"vnic.RssHashSettings","TcpIpv6Hash":true}` //test when the response is empty ffOpEmpty := flattenMapVnicRssHashSettings(p, d) @@ -18091,14 +18091,14 @@ func TestFlattenMapVnicRssHashSettings(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVnicRssHashSettings(p, d)[0] - expectedOp := map[string]interface{}{"ipv4_hash": true, "tcp_ipv4_hash": true, "udp_ipv6_hash": true, "tcp_ipv6_ext_hash": true, "ipv6_ext_hash": true, "tcp_ipv6_hash": true, "udp_ipv4_hash": true, "object_type": "vnic.RssHashSettings", "class_id": "vnic.RssHashSettings", "ipv6_hash": true} + expectedOp := map[string]interface{}{"udp_ipv6_hash": true, "ipv6_hash": true, "tcp_ipv6_ext_hash": true, "object_type": "vnic.RssHashSettings", "tcp_ipv4_hash": true, "udp_ipv4_hash": true, "ipv6_ext_hash": true, "ipv4_hash": true, "class_id": "vnic.RssHashSettings", "tcp_ipv6_hash": true} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapVnicSanConnectivityPolicyRelationship(t *testing.T) { p := models.VnicSanConnectivityPolicyRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenMapVnicSanConnectivityPolicyRelationship(p, d) @@ -18109,14 +18109,14 @@ func TestFlattenMapVnicSanConnectivityPolicyRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVnicSanConnectivityPolicyRelationship(p, d)[0] - expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} + expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapVnicScsiQueueSettings(t *testing.T) { p := models.VnicScsiQueueSettings{} var d = &schema.ResourceData{} - c := `{"ClassId":"vnic.ScsiQueueSettings","ObjectType":"vnic.ScsiQueueSettings","Count":32,"RingSize":32}` + c := `{"ObjectType":"vnic.ScsiQueueSettings","ClassId":"vnic.ScsiQueueSettings","Count":32,"RingSize":32}` //test when the response is empty ffOpEmpty := flattenMapVnicScsiQueueSettings(p, d) @@ -18127,14 +18127,14 @@ func TestFlattenMapVnicScsiQueueSettings(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVnicScsiQueueSettings(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "vnic.ScsiQueueSettings", "object_type": "vnic.ScsiQueueSettings", "nr_count": 32, "ring_size": 32} + expectedOp := map[string]interface{}{"object_type": "vnic.ScsiQueueSettings", "class_id": "vnic.ScsiQueueSettings", "nr_count": 32, "ring_size": 32} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapVnicTcpOffloadSettings(t *testing.T) { p := models.VnicTcpOffloadSettings{} var d = &schema.ResourceData{} - c := `{"LargeReceive":true,"LargeSend":true,"RxChecksum":true,"TxChecksum":true,"ObjectType":"vnic.TcpOffloadSettings","ClassId":"vnic.TcpOffloadSettings"}` + c := `{"ClassId":"vnic.TcpOffloadSettings","LargeReceive":true,"LargeSend":true,"RxChecksum":true,"TxChecksum":true,"ObjectType":"vnic.TcpOffloadSettings"}` //test when the response is empty ffOpEmpty := flattenMapVnicTcpOffloadSettings(p, d) @@ -18145,14 +18145,14 @@ func TestFlattenMapVnicTcpOffloadSettings(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVnicTcpOffloadSettings(p, d)[0] - expectedOp := map[string]interface{}{"large_receive": true, "large_send": true, "rx_checksum": true, "tx_checksum": true, "object_type": "vnic.TcpOffloadSettings", "class_id": "vnic.TcpOffloadSettings"} + expectedOp := map[string]interface{}{"class_id": "vnic.TcpOffloadSettings", "large_receive": true, "large_send": true, "rx_checksum": true, "tx_checksum": true, "object_type": "vnic.TcpOffloadSettings"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapVnicUsnicSettings(t *testing.T) { p := models.VnicUsnicSettings{} var d = &schema.ResourceData{} - c := `{"Count":32,"ObjectType":"vnic.UsnicSettings","ClassId":"vnic.UsnicSettings","UsnicAdapterPolicy":"UsnicAdapterPolicy %d","Cos":32}` + c := `{"ObjectType":"vnic.UsnicSettings","ClassId":"vnic.UsnicSettings","Cos":32,"Count":32,"UsnicAdapterPolicy":"UsnicAdapterPolicy %d"}` //test when the response is empty ffOpEmpty := flattenMapVnicUsnicSettings(p, d) @@ -18163,14 +18163,14 @@ func TestFlattenMapVnicUsnicSettings(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVnicUsnicSettings(p, d)[0] - expectedOp := map[string]interface{}{"nr_count": 32, "object_type": "vnic.UsnicSettings", "class_id": "vnic.UsnicSettings", "usnic_adapter_policy": "UsnicAdapterPolicy 1", "cos": 32} + expectedOp := map[string]interface{}{"object_type": "vnic.UsnicSettings", "class_id": "vnic.UsnicSettings", "cos": 32, "nr_count": 32, "usnic_adapter_policy": "UsnicAdapterPolicy 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapVnicVlanSettings(t *testing.T) { p := models.VnicVlanSettings{} var d = &schema.ResourceData{} - c := `{"ClassId":"vnic.VlanSettings","Mode":"Mode %d","AllowedVlans":"AllowedVlans %d","DefaultVlan":32,"ObjectType":"vnic.VlanSettings"}` + c := `{"ObjectType":"vnic.VlanSettings","ClassId":"vnic.VlanSettings","DefaultVlan":32,"Mode":"Mode %d","AllowedVlans":"AllowedVlans %d"}` //test when the response is empty ffOpEmpty := flattenMapVnicVlanSettings(p, d) @@ -18181,14 +18181,14 @@ func TestFlattenMapVnicVlanSettings(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVnicVlanSettings(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "vnic.VlanSettings", "mode": "Mode 1", "allowed_vlans": "AllowedVlans 1", "default_vlan": 32, "object_type": "vnic.VlanSettings"} + expectedOp := map[string]interface{}{"object_type": "vnic.VlanSettings", "class_id": "vnic.VlanSettings", "default_vlan": 32, "mode": "Mode 1", "allowed_vlans": "AllowedVlans 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapVnicVmqSettings(t *testing.T) { p := models.VnicVmqSettings{} var d = &schema.ResourceData{} - c := `{"ObjectType":"vnic.VmqSettings","ClassId":"vnic.VmqSettings","NumInterrupts":32,"NumSubVnics":32,"NumVmqs":32,"Enabled":true,"MultiQueueSupport":true,"VmmqAdapterPolicy":"VmmqAdapterPolicy %d"}` + c := `{"ClassId":"vnic.VmqSettings","Enabled":true,"NumInterrupts":32,"NumSubVnics":32,"NumVmqs":32,"ObjectType":"vnic.VmqSettings","MultiQueueSupport":true,"VmmqAdapterPolicy":"VmmqAdapterPolicy %d"}` //test when the response is empty ffOpEmpty := flattenMapVnicVmqSettings(p, d) @@ -18199,14 +18199,14 @@ func TestFlattenMapVnicVmqSettings(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVnicVmqSettings(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "vnic.VmqSettings", "class_id": "vnic.VmqSettings", "num_interrupts": 32, "num_sub_vnics": 32, "num_vmqs": 32, "enabled": true, "multi_queue_support": true, "vmmq_adapter_policy": "VmmqAdapterPolicy 1"} + expectedOp := map[string]interface{}{"class_id": "vnic.VmqSettings", "enabled": true, "num_interrupts": 32, "num_sub_vnics": 32, "num_vmqs": 32, "object_type": "vnic.VmqSettings", "multi_queue_support": true, "vmmq_adapter_policy": "VmmqAdapterPolicy 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapVnicVsanSettings(t *testing.T) { p := models.VnicVsanSettings{} var d = &schema.ResourceData{} - c := `{"DefaultVlanId":32,"Id":32,"ObjectType":"vnic.VsanSettings","ClassId":"vnic.VsanSettings"}` + c := `{"ObjectType":"vnic.VsanSettings","ClassId":"vnic.VsanSettings","DefaultVlanId":32,"Id":32}` //test when the response is empty ffOpEmpty := flattenMapVnicVsanSettings(p, d) @@ -18217,7 +18217,7 @@ func TestFlattenMapVnicVsanSettings(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVnicVsanSettings(p, d)[0] - expectedOp := map[string]interface{}{"default_vlan_id": 32, "id": 32, "object_type": "vnic.VsanSettings", "class_id": "vnic.VsanSettings"} + expectedOp := map[string]interface{}{"object_type": "vnic.VsanSettings", "class_id": "vnic.VsanSettings", "default_vlan_id": 32, "id": 32} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -18242,7 +18242,7 @@ func TestFlattenMapVnicVxlanSettings(t *testing.T) { func TestFlattenMapVrfVrfRelationship(t *testing.T) { p := models.VrfVrfRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenMapVrfVrfRelationship(p, d) @@ -18253,14 +18253,14 @@ func TestFlattenMapVrfVrfRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapVrfVrfRelationship(p, d)[0] - expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} + expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapWorkflowCatalogRelationship(t *testing.T) { p := models.WorkflowCatalogRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenMapWorkflowCatalogRelationship(p, d) @@ -18271,14 +18271,14 @@ func TestFlattenMapWorkflowCatalogRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapWorkflowCatalogRelationship(p, d)[0] - expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} + expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapWorkflowComments(t *testing.T) { p := models.WorkflowComments{} var d = &schema.ResourceData{} - c := `{"Description":"Description %d","ObjectType":"workflow.Comments","ClassId":"workflow.Comments"}` + c := `{"ClassId":"workflow.Comments","Description":"Description %d","ObjectType":"workflow.Comments"}` //test when the response is empty ffOpEmpty := flattenMapWorkflowComments(p, d) @@ -18289,14 +18289,14 @@ func TestFlattenMapWorkflowComments(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapWorkflowComments(p, d)[0] - expectedOp := map[string]interface{}{"description": "Description 1", "object_type": "workflow.Comments", "class_id": "workflow.Comments"} + expectedOp := map[string]interface{}{"class_id": "workflow.Comments", "description": "Description 1", "object_type": "workflow.Comments"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapWorkflowCustomDataTypeDefinitionRelationship(t *testing.T) { p := models.WorkflowCustomDataTypeDefinitionRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenMapWorkflowCustomDataTypeDefinitionRelationship(p, d) @@ -18307,7 +18307,7 @@ func TestFlattenMapWorkflowCustomDataTypeDefinitionRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapWorkflowCustomDataTypeDefinitionRelationship(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} + expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -18332,7 +18332,7 @@ func TestFlattenMapWorkflowCustomDataTypeProperties(t *testing.T) { func TestFlattenMapWorkflowErrorResponseHandlerRelationship(t *testing.T) { p := models.WorkflowErrorResponseHandlerRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapWorkflowErrorResponseHandlerRelationship(p, d) @@ -18343,14 +18343,14 @@ func TestFlattenMapWorkflowErrorResponseHandlerRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapWorkflowErrorResponseHandlerRelationship(p, d)[0] - expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} + expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapWorkflowInternalProperties(t *testing.T) { p := models.WorkflowInternalProperties{} var d = &schema.ResourceData{} - c := `{"BaseTaskType":"BaseTaskType %d","Internal":true,"Owner":"Owner %d","ObjectType":"workflow.InternalProperties","ClassId":"workflow.InternalProperties"}` + c := `{"ClassId":"workflow.InternalProperties","Internal":true,"Owner":"Owner %d","BaseTaskType":"BaseTaskType %d","ObjectType":"workflow.InternalProperties"}` //test when the response is empty ffOpEmpty := flattenMapWorkflowInternalProperties(p, d) @@ -18361,14 +18361,14 @@ func TestFlattenMapWorkflowInternalProperties(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapWorkflowInternalProperties(p, d)[0] - expectedOp := map[string]interface{}{"base_task_type": "BaseTaskType 1", "internal": true, "owner": "Owner 1", "object_type": "workflow.InternalProperties", "class_id": "workflow.InternalProperties"} + expectedOp := map[string]interface{}{"class_id": "workflow.InternalProperties", "internal": true, "owner": "Owner 1", "base_task_type": "BaseTaskType 1", "object_type": "workflow.InternalProperties"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapWorkflowPendingDynamicWorkflowInfoRelationship(t *testing.T) { p := models.WorkflowPendingDynamicWorkflowInfoRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenMapWorkflowPendingDynamicWorkflowInfoRelationship(p, d) @@ -18379,14 +18379,14 @@ func TestFlattenMapWorkflowPendingDynamicWorkflowInfoRelationship(t *testing.T) err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapWorkflowPendingDynamicWorkflowInfoRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapWorkflowProperties(t *testing.T) { p := models.WorkflowProperties{} var d = &schema.ResourceData{} - c := `{"RetryCount":32,"TimeoutPolicy":"TimeoutPolicy %d","ExternalMeta":true,"ClassId":"workflow.Properties","StartsWorkflow":true,"Timeout":32,"SupportStatus":"SupportStatus %d","RetryDelay":32,"Cloneable":true,"RetryPolicy":"RetryPolicy %d","ObjectType":"workflow.Properties"}` + c := `{"ClassId":"workflow.Properties","RetryDelay":32,"SupportStatus":"SupportStatus %d","ObjectType":"workflow.Properties","RetryCount":32,"TimeoutPolicy":"TimeoutPolicy %d","Cloneable":true,"StartsWorkflow":true,"Timeout":32,"ExternalMeta":true,"RetryPolicy":"RetryPolicy %d"}` //test when the response is empty ffOpEmpty := flattenMapWorkflowProperties(p, d) @@ -18397,14 +18397,14 @@ func TestFlattenMapWorkflowProperties(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapWorkflowProperties(p, d)[0] - expectedOp := map[string]interface{}{"retry_count": 32, "timeout_policy": "TimeoutPolicy 1", "external_meta": true, "class_id": "workflow.Properties", "starts_workflow": true, "timeout": 32, "support_status": "SupportStatus 1", "retry_delay": 32, "cloneable": true, "retry_policy": "RetryPolicy 1", "object_type": "workflow.Properties"} + expectedOp := map[string]interface{}{"class_id": "workflow.Properties", "retry_delay": 32, "support_status": "SupportStatus 1", "object_type": "workflow.Properties", "retry_count": 32, "timeout_policy": "TimeoutPolicy 1", "cloneable": true, "starts_workflow": true, "timeout": 32, "external_meta": true, "retry_policy": "RetryPolicy 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapWorkflowSolutionActionDefinitionRelationship(t *testing.T) { p := models.WorkflowSolutionActionDefinitionRelationship{} var d = &schema.ResourceData{} - c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapWorkflowSolutionActionDefinitionRelationship(p, d) @@ -18415,7 +18415,7 @@ func TestFlattenMapWorkflowSolutionActionDefinitionRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapWorkflowSolutionActionDefinitionRelationship(p, d)[0] - expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -18440,7 +18440,7 @@ func TestFlattenMapWorkflowSolutionDefinitionRelationship(t *testing.T) { func TestFlattenMapWorkflowSolutionInstanceRelationship(t *testing.T) { p := models.WorkflowSolutionInstanceRelationship{} var d = &schema.ResourceData{} - c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapWorkflowSolutionInstanceRelationship(p, d) @@ -18451,7 +18451,7 @@ func TestFlattenMapWorkflowSolutionInstanceRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapWorkflowSolutionInstanceRelationship(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -18476,7 +18476,7 @@ func TestFlattenMapWorkflowTaskConstraints(t *testing.T) { func TestFlattenMapWorkflowTaskDefinitionRelationship(t *testing.T) { p := models.WorkflowTaskDefinitionRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d"}` //test when the response is empty ffOpEmpty := flattenMapWorkflowTaskDefinitionRelationship(p, d) @@ -18487,7 +18487,7 @@ func TestFlattenMapWorkflowTaskDefinitionRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapWorkflowTaskDefinitionRelationship(p, d)[0] - expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} + expectedOp := map[string]interface{}{"selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -18512,7 +18512,7 @@ func TestFlattenMapWorkflowTaskInfoRelationship(t *testing.T) { func TestFlattenMapWorkflowTaskLoopInfo(t *testing.T) { p := models.WorkflowTaskLoopInfo{} var d = &schema.ResourceData{} - c := `{"ClassId":"workflow.TaskLoopInfo","LoopType":"LoopType %d","Iteration":32,"LoopTaskLabel":"LoopTaskLabel %d","LoopTaskName":"LoopTaskName %d","ObjectType":"workflow.TaskLoopInfo"}` + c := `{"LoopTaskName":"LoopTaskName %d","ObjectType":"workflow.TaskLoopInfo","ClassId":"workflow.TaskLoopInfo","LoopType":"LoopType %d","Iteration":32,"LoopTaskLabel":"LoopTaskLabel %d"}` //test when the response is empty ffOpEmpty := flattenMapWorkflowTaskLoopInfo(p, d) @@ -18523,14 +18523,14 @@ func TestFlattenMapWorkflowTaskLoopInfo(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapWorkflowTaskLoopInfo(p, d)[0] - expectedOp := map[string]interface{}{"class_id": "workflow.TaskLoopInfo", "loop_type": "LoopType 1", "iteration": 32, "loop_task_label": "LoopTaskLabel 1", "loop_task_name": "LoopTaskName 1", "object_type": "workflow.TaskLoopInfo"} + expectedOp := map[string]interface{}{"loop_task_name": "LoopTaskName 1", "object_type": "workflow.TaskLoopInfo", "class_id": "workflow.TaskLoopInfo", "loop_type": "LoopType 1", "iteration": 32, "loop_task_label": "LoopTaskLabel 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapWorkflowTaskMetadataRelationship(t *testing.T) { p := models.WorkflowTaskMetadataRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` //test when the response is empty ffOpEmpty := flattenMapWorkflowTaskMetadataRelationship(p, d) @@ -18541,14 +18541,14 @@ func TestFlattenMapWorkflowTaskMetadataRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapWorkflowTaskMetadataRelationship(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} + expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapWorkflowValidationInformation(t *testing.T) { p := models.WorkflowValidationInformation{} var d = &schema.ResourceData{} - c := `{"State":"State %d","ObjectType":"workflow.ValidationInformation","ClassId":"workflow.ValidationInformation"}` + c := `{"ObjectType":"workflow.ValidationInformation","ClassId":"workflow.ValidationInformation","State":"State %d"}` //test when the response is empty ffOpEmpty := flattenMapWorkflowValidationInformation(p, d) @@ -18559,14 +18559,14 @@ func TestFlattenMapWorkflowValidationInformation(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapWorkflowValidationInformation(p, d)[0] - expectedOp := map[string]interface{}{"state": "State 1", "object_type": "workflow.ValidationInformation", "class_id": "workflow.ValidationInformation"} + expectedOp := map[string]interface{}{"object_type": "workflow.ValidationInformation", "class_id": "workflow.ValidationInformation", "state": "State 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapWorkflowWorkflowCtx(t *testing.T) { p := models.WorkflowWorkflowCtx{} var d = &schema.ResourceData{} - c := `{"WorkflowMetaName":"WorkflowMetaName %d","WorkflowSubtype":"WorkflowSubtype %d","ObjectType":"workflow.WorkflowCtx","ClassId":"workflow.WorkflowCtx","WorkflowType":"WorkflowType %d"}` + c := `{"ObjectType":"workflow.WorkflowCtx","ClassId":"workflow.WorkflowCtx","WorkflowMetaName":"WorkflowMetaName %d","WorkflowSubtype":"WorkflowSubtype %d","WorkflowType":"WorkflowType %d"}` //test when the response is empty ffOpEmpty := flattenMapWorkflowWorkflowCtx(p, d) @@ -18577,14 +18577,14 @@ func TestFlattenMapWorkflowWorkflowCtx(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapWorkflowWorkflowCtx(p, d)[0] - expectedOp := map[string]interface{}{"workflow_meta_name": "WorkflowMetaName 1", "workflow_subtype": "WorkflowSubtype 1", "object_type": "workflow.WorkflowCtx", "class_id": "workflow.WorkflowCtx", "workflow_type": "WorkflowType 1"} + expectedOp := map[string]interface{}{"object_type": "workflow.WorkflowCtx", "class_id": "workflow.WorkflowCtx", "workflow_meta_name": "WorkflowMetaName 1", "workflow_subtype": "WorkflowSubtype 1", "workflow_type": "WorkflowType 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapWorkflowWorkflowDefinitionRelationship(t *testing.T) { p := models.WorkflowWorkflowDefinitionRelationship{} var d = &schema.ResourceData{} - c := `{"Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef","ObjectType":"mo.MoRef"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenMapWorkflowWorkflowDefinitionRelationship(p, d) @@ -18595,7 +18595,7 @@ func TestFlattenMapWorkflowWorkflowDefinitionRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapWorkflowWorkflowDefinitionRelationship(p, d)[0] - expectedOp := map[string]interface{}{"moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef", "object_type": "mo.MoRef"} + expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } @@ -18620,7 +18620,7 @@ func TestFlattenMapWorkflowWorkflowInfoRelationship(t *testing.T) { func TestFlattenMapWorkflowWorkflowInfoProperties(t *testing.T) { p := models.WorkflowWorkflowInfoProperties{} var d = &schema.ResourceData{} - c := `{"RollbackAction":"RollbackAction %d","ClassId":"workflow.WorkflowInfoProperties","ObjectType":"workflow.WorkflowInfoProperties","Retryable":true}` + c := `{"Retryable":true,"RollbackAction":"RollbackAction %d","ObjectType":"workflow.WorkflowInfoProperties","ClassId":"workflow.WorkflowInfoProperties"}` //test when the response is empty ffOpEmpty := flattenMapWorkflowWorkflowInfoProperties(p, d) @@ -18631,14 +18631,14 @@ func TestFlattenMapWorkflowWorkflowInfoProperties(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapWorkflowWorkflowInfoProperties(p, d)[0] - expectedOp := map[string]interface{}{"rollback_action": "RollbackAction 1", "class_id": "workflow.WorkflowInfoProperties", "object_type": "workflow.WorkflowInfoProperties", "retryable": true} + expectedOp := map[string]interface{}{"retryable": true, "rollback_action": "RollbackAction 1", "object_type": "workflow.WorkflowInfoProperties", "class_id": "workflow.WorkflowInfoProperties"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapWorkflowWorkflowMetadataRelationship(t *testing.T) { p := models.WorkflowWorkflowMetadataRelationship{} var d = &schema.ResourceData{} - c := `{"ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d","ClassId":"mo.MoRef"}` + c := `{"ClassId":"mo.MoRef","ObjectType":"mo.MoRef","Moid":"Moid %d","Selector":"Selector %d"}` //test when the response is empty ffOpEmpty := flattenMapWorkflowWorkflowMetadataRelationship(p, d) @@ -18649,14 +18649,14 @@ func TestFlattenMapWorkflowWorkflowMetadataRelationship(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapWorkflowWorkflowMetadataRelationship(p, d)[0] - expectedOp := map[string]interface{}{"object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1", "class_id": "mo.MoRef"} + expectedOp := map[string]interface{}{"class_id": "mo.MoRef", "object_type": "mo.MoRef", "moid": "Moid 1", "selector": "Selector 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapWorkflowWorkflowProperties(t *testing.T) { p := models.WorkflowWorkflowProperties{} var d = &schema.ResourceData{} - c := `{"SupportStatus":"SupportStatus %d","ObjectType":"workflow.WorkflowProperties","ClassId":"workflow.WorkflowProperties","Cloneable":true,"EnableDebug":true,"ExternalMeta":true,"Retryable":true}` + c := `{"Retryable":true,"SupportStatus":"SupportStatus %d","ObjectType":"workflow.WorkflowProperties","ClassId":"workflow.WorkflowProperties","Cloneable":true,"EnableDebug":true,"ExternalMeta":true}` //test when the response is empty ffOpEmpty := flattenMapWorkflowWorkflowProperties(p, d) @@ -18667,14 +18667,14 @@ func TestFlattenMapWorkflowWorkflowProperties(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapWorkflowWorkflowProperties(p, d)[0] - expectedOp := map[string]interface{}{"support_status": "SupportStatus 1", "object_type": "workflow.WorkflowProperties", "class_id": "workflow.WorkflowProperties", "cloneable": true, "enable_debug": true, "external_meta": true, "retryable": true} + expectedOp := map[string]interface{}{"retryable": true, "support_status": "SupportStatus 1", "object_type": "workflow.WorkflowProperties", "class_id": "workflow.WorkflowProperties", "cloneable": true, "enable_debug": true, "external_meta": true} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } func TestFlattenMapX509Certificate(t *testing.T) { p := models.X509Certificate{} var d = &schema.ResourceData{} - c := `{"SignatureAlgorithm":"SignatureAlgorithm %d","Sha256Fingerprint":"Sha256Fingerprint %d","ObjectType":"x509.Certificate","ClassId":"x509.Certificate","PemCertificate":"PemCertificate %d"}` + c := `{"ObjectType":"x509.Certificate","ClassId":"x509.Certificate","SignatureAlgorithm":"SignatureAlgorithm %d","PemCertificate":"PemCertificate %d","Sha256Fingerprint":"Sha256Fingerprint %d"}` //test when the response is empty ffOpEmpty := flattenMapX509Certificate(p, d) @@ -18685,7 +18685,7 @@ func TestFlattenMapX509Certificate(t *testing.T) { err := p.UnmarshalJSON([]byte(strings.Replace(c, "%d", "1", -1))) CheckError(t, err) ffOp := flattenMapX509Certificate(p, d)[0] - expectedOp := map[string]interface{}{"signature_algorithm": "SignatureAlgorithm 1", "sha256_fingerprint": "Sha256Fingerprint 1", "object_type": "x509.Certificate", "class_id": "x509.Certificate", "pem_certificate": "PemCertificate 1"} + expectedOp := map[string]interface{}{"object_type": "x509.Certificate", "class_id": "x509.Certificate", "signature_algorithm": "SignatureAlgorithm 1", "pem_certificate": "PemCertificate 1", "sha256_fingerprint": "Sha256Fingerprint 1"} err = compareMaps(expectedOp, ffOp, t) CheckError(t, err) } diff --git a/intersight/resource_intersight_server_profile.go b/intersight/resource_intersight_server_profile.go index d569d085da..22f5ba7808 100644 --- a/intersight/resource_intersight_server_profile.go +++ b/intersight/resource_intersight_server_profile.go @@ -1917,6 +1917,7 @@ func resourceServerProfileCreate(c context.Context, d *schema.ResourceData, meta log.Printf("Moid: %s", resultMo.GetMoid()) d.SetId(resultMo.GetMoid()) if deploy_flag { + time.Sleep(5 * time.Second) o.SetAction("Deploy") r := conn.ApiClient.ServerApi.UpdateServerProfile(conn.ctx, d.Id()).ServerProfile(*o) result, _, responseErr := r.Execute() diff --git a/tests/common/main.tf b/tests/common/main.tf index 8e60085c24..d53be1b264 100644 --- a/tests/common/main.tf +++ b/tests/common/main.tf @@ -2,7 +2,7 @@ terraform { required_providers { intersight = { source = "CiscoDevNet/intersight" - version = "1.0.24" + version = "1.0.25" } } } diff --git a/tests/data_sources/main.tf b/tests/data_sources/main.tf index d5e09ad7c4..0f1bc3154e 100644 --- a/tests/data_sources/main.tf +++ b/tests/data_sources/main.tf @@ -2,7 +2,7 @@ terraform { required_providers { intersight = { source = "CiscoDevNet/intersight" - version = "1.0.24" + version = "1.0.25" } } } diff --git a/tests/iks/main.tf b/tests/iks/main.tf index d5e09ad7c4..0f1bc3154e 100644 --- a/tests/iks/main.tf +++ b/tests/iks/main.tf @@ -2,7 +2,7 @@ terraform { required_providers { intersight = { source = "CiscoDevNet/intersight" - version = "1.0.24" + version = "1.0.25" } } } diff --git a/tests/only_post/main.tf b/tests/only_post/main.tf index 705da2c901..91ad89f7b8 100644 --- a/tests/only_post/main.tf +++ b/tests/only_post/main.tf @@ -2,7 +2,7 @@ terraform { required_providers { intersight = { source = "CiscoDevNet/intersight" - version = "1.0.24" + version = "1.0.25" } } } diff --git a/tests/server_configurations/main.tf b/tests/server_configurations/main.tf index 8e60085c24..d53be1b264 100644 --- a/tests/server_configurations/main.tf +++ b/tests/server_configurations/main.tf @@ -2,7 +2,7 @@ terraform { required_providers { intersight = { source = "CiscoDevNet/intersight" - version = "1.0.24" + version = "1.0.25" } } } diff --git a/website/docs/r/asset_target.html.markdown b/website/docs/r/asset_target.html.markdown index 5a843bc998..658944596e 100644 --- a/website/docs/r/asset_target.html.markdown +++ b/website/docs/r/asset_target.html.markdown @@ -156,6 +156,18 @@ $ terraform import intersight_asset_target.example 1234567890987654321abcde ``` ## Allowed Types in `AdditionalProperties` +### [asset.OrchestrationService](#argument-reference) +OrchestrationService provides the necessary configuration details to enable Intersight Orchestration on the selected managed target. Subject to licensing. + +### [asset.TerraformIntegrationService](#argument-reference) +TerraformIntegrationService provides the necessary configuration details to enable Intersight Cloud Region on the selected Terraform Cloud. + +### [asset.VirtualizationService](#argument-reference) +The necessary configuration details to enable Intersight Virtualization features on the selected managed target. + +### [asset.WorkloadOptimizerService](#argument-reference) +WorkloadOptimizerService provides the necessary configuration details to enable Intersight Workflow Optimizer on the selected managed target. Subject to licensing. + ### [asset.CloudConnection](#argument-reference) CloudConnection provides the necessary details for Intersight to connect to and authenticate with a target at a well-known service address. The service address is inferred based upon the target type. For example Amazon Web Services. @@ -179,16 +191,4 @@ ScopedTargetConnection provides the necessary details for Intersight to connect SshConnection provides the necessary details for Intersight to connect and authenticate with a managed target over an SSH connection. * `management_address`:(string) The DNS hostname or IP Address, either IPv4 or IPv6, to be used to connect to the managed target. * `port`:(int) The port number to be used to connect to the managed target. Valid values are 1 - 65535. If not provided, a default port of 22 is used to establish the SSH connection to the given target. - -### [asset.OrchestrationService](#argument-reference) -OrchestrationService provides the necessary configuration details to enable Intersight Orchestration on the selected managed target. Subject to licensing. - -### [asset.TerraformIntegrationService](#argument-reference) -TerraformIntegrationService provides the necessary configuration details to enable Intersight Cloud Region on the selected Terraform Cloud. - -### [asset.VirtualizationService](#argument-reference) -The necessary configuration details to enable Intersight Virtualization features on the selected managed target. - -### [asset.WorkloadOptimizerService](#argument-reference) -WorkloadOptimizerService provides the necessary configuration details to enable Intersight Workflow Optimizer on the selected managed target. Subject to licensing. \ No newline at end of file diff --git a/website/docs/r/workflow_workflow_definition.html.markdown b/website/docs/r/workflow_workflow_definition.html.markdown index 9b1d25d906..a51d471c33 100644 --- a/website/docs/r/workflow_workflow_definition.html.markdown +++ b/website/docs/r/workflow_workflow_definition.html.markdown @@ -284,97 +284,6 @@ $ terraform import intersight_workflow_workflow_definition.example 1234567890987 ``` ## Allowed Types in `AdditionalProperties` -### [workflow.ArrayDataType](#argument-reference) -This data type represents an array of a given type. It can be an array of primitive data or of custom data. -* `array_item_type`:(HashMap) - Data item within the array data type. -This complex property has following sub-properties: - + `object_type`:(string) The fully-qualified name of the instantiated, concrete type.The value should be the same as the 'ClassId' property.The enum values provides the list of concrete types that can be instantiated from this abstract type. -* `max`:(int) Specify the maximum value of the array. -* `min`:(int) Specify the minimum value of the array. - -### [workflow.CustomDataType](#argument-reference) -This data type represents a custom data object. -* `properties`:(HashMap) - Captures the custom data type properties. -This complex property has following sub-properties: - + `catalog_moid`:(string) Specify the catalog moid that this custom data type belongs. - + `custom_data_type_id`:(string)(ReadOnly) The resolved custom data type definition managed object. - + `custom_data_type_name`:(string) Name of the custom data type for this input. - + `object_type`:(string) The fully-qualified name of the instantiated, concrete type.The value should be the same as the 'ClassId' property. - -### [workflow.MoReferenceDataType](#argument-reference) -Data type to capture an Intersight Managed object reference. -* `properties`:(Array) -This complex property has following sub-properties: - + `display_attributes`: - (Array of schema.TypeString) - - + `object_type`:(string) The fully-qualified name of the instantiated, concrete type.The value should be the same as the 'ClassId' property. - + `selector`:(string) Field to hold an Intersight API along with an optional filter to narrow down the search options. - + `selector_property`:(HashMap) - Selector properties to define HTTP method and 'body' in case of upsert operation. -This complex property has following sub-properties: - + `body`:(JSON as string) Content of the request body to send for POST request. - + `method`:(string) The HTTP method to be used.* `GET` - The HTTP GET method requests a representation of the specified resource.* `POST` - The HTTP POST method sends data to the server. - + `object_type`:(string) The fully-qualified name of the instantiated, concrete type.The value should be the same as the 'ClassId' property. - + `value_attribute`:(string) A property from the Intersight object, value of which can be used as value for referenced input definition. - -### [workflow.PrimitiveDataType](#argument-reference) -This data type is used to represent primitives like string, floats and integers. -* `properties`:(HashMap) - Primitive data type properties. -This complex property has following sub-properties: - + `constraints`:(HashMap) - Constraints that must be applied to the parameter value supplied for this data type. -This complex property has following sub-properties: - + `enum_list`:(Array) -This complex property has following sub-properties: - + `label`:(string) Label for the enum value. A user friendly short string to identify the enum value. Label can only contain letters (a-z, A-Z), numbers (0-9), hyphen (-), period (.), colon (:), space ( ), single quote ('), forward slash (/), or an underscore (_) and must be at least 2 characters. - + `object_type`:(string) The fully-qualified name of the instantiated, concrete type.The value should be the same as the 'ClassId' property. - + `value`:(string) Enum value for this enum entry. Value will be passed to the workflow as string type for execution. Value can only contain letters (a-z, A-Z), numbers (0-9), hyphen (-), period (.), colon (:), space ( ), forward slash (/), or an underscore (_). - + `max`:(float) Allowed maximum value of the parameter if parameter is integer/float or maximum length of the parameter if the parameter is string. When max and min are set to 0, then the limits are not checked. If parameter is integer/float, then maximum number supported is 1.797693134862315708145274237317043567981e+308 or (2**1023 * (2**53 - 1) / 2**52). When a number bigger than this is given as Maximum value, the constraints will not be enforced. - + `min`:(float) Allowed minimum value of the parameter if parameter is integer/float or minimum length of the parameter if the parameter is string. When max and min are set to 0, then the limits are not checked. If parameter is integer/float, then minimum number supported is 4.940656458412465441765687928682213723651e-324 or (1 / 2 ** (1023 - 1 + 52)). When a number smaller than this is given as minimum value, the constraints will not be enforced. - + `object_type`:(string) The fully-qualified name of the instantiated, concrete type.The value should be the same as the 'ClassId' property. - + `regex`:(string) When the parameter is a string this regular expression is used to ensure the value is valid. - + `inventory_selector`:(Array) -This complex property has following sub-properties: - + `display_attributes`: - (Array of schema.TypeString) - - + `object_type`:(string) The fully-qualified name of the instantiated, concrete type.The value should be the same as the 'ClassId' property. - + `selector`:(string) Field to hold an Intersight API along with an optional filter to narrow down the search options. - + `selector_property`:(HashMap) - Selector properties to define HTTP method and 'body' in case of upsert operation. -This complex property has following sub-properties: - + `body`:(JSON as string) Content of the request body to send for POST request. - + `method`:(string) The HTTP method to be used.* `GET` - The HTTP GET method requests a representation of the specified resource.* `POST` - The HTTP POST method sends data to the server. - + `object_type`:(string) The fully-qualified name of the instantiated, concrete type.The value should be the same as the 'ClassId' property. - + `value_attribute`:(string) A property from the Intersight object, value of which can be used as value for referenced input definition. - + `object_type`:(string) The fully-qualified name of the instantiated, concrete type.The value should be the same as the 'ClassId' property. - + `secure`:(bool) Intersight supports secure properties as task input/output. The values ofthese properties are encrypted and stored in Intersight.This flag marks the property to be secure when it is set to true. - + `type`:(string) Specify the enum type for primitive data type.* `string` - Enum to specify a string data type.* `integer` - Enum to specify an integer32 data type.* `float` - Enum to specify a float64 data type.* `boolean` - Enum to specify a boolean data type.* `json` - Enum to specify a json data type.* `enum` - Enum to specify a enum data type which is a list of pre-defined strings. - -### [workflow.TargetDataType](#argument-reference) -Data type to capture a target endpoint or device. -* `custom_data_type_properties`:(HashMap) - Reference to custom data type definition. -This complex property has following sub-properties: - + `catalog_moid`:(string) Specify the catalog moid that this custom data type belongs. - + `custom_data_type_id`:(string)(ReadOnly) The resolved custom data type definition managed object. - + `custom_data_type_name`:(string) Name of the custom data type for this input. - + `object_type`:(string) The fully-qualified name of the instantiated, concrete type.The value should be the same as the 'ClassId' property. -* `is_array`:(bool) When this property is true then an array of targets can be passed as input. -* `max`:(int) Specify the maximum value of the array. -* `min`:(int) Specify the minimum value of the array. -* `properties`:(Array) -This complex property has following sub-properties: - + `connector_attribute`:(string) A singleton value which will contain the path to connector object from the selected object. - + `constraint_attributes`: - (Array of schema.TypeString) - - + `display_attributes`: - (Array of schema.TypeString) - - + `object_type`:(string) The fully-qualified name of the instantiated, concrete type.The value should be the same as the 'ClassId' property. - + `selector`:(string) Field to hold an Intersight API along with an optional filter to narrow down the search options for target device. - + `selector_property`:(HashMap) - Selector properties to define HTTP method and 'body' in case of upsert operation. -This complex property has following sub-properties: - + `body`:(JSON as string) Content of the request body to send for POST request. - + `method`:(string) The HTTP method to be used.* `GET` - The HTTP GET method requests a representation of the specified resource.* `POST` - The HTTP POST method sends data to the server. - + `object_type`:(string) The fully-qualified name of the instantiated, concrete type.The value should be the same as the 'ClassId' property. - + `supported_objects`: - (Array of schema.TypeString) - - ### [workflow.DecisionTask](#argument-reference) A DecisionTask is a control task that executes a sequence of WorkflowTasks based off decision provided and evaluated by this task. * `condition`:(string) The condition to evaluate for this decision task. The condition can be a workflow or task variable or an JavaScript expression. Example value for condition could be a variable like \ ${task1.output.var1} or ${workflow.input.var2}\ which evaluates to a value matching any of the decision case values. Example value for condition if it's an expression - \ if ( ${task1.output.var1} ! = null && ${task1.output.var1} > 0 ) 'true'; else 'false'; \ which evaluates to 'true' or 'false' and will match one of the decision case values. You can also use JavaScript functions like indexOf, toUpperCase in the expression which will be evaluated by the expression evaluator. @@ -647,4 +556,95 @@ This complex property has following sub-properties: + `object_type`:(string) The fully-qualified name of the instantiated, concrete type.The value should be the same as the 'ClassId' property. + `supported_objects`: (Array of schema.TypeString) - + +### [workflow.ArrayDataType](#argument-reference) +This data type represents an array of a given type. It can be an array of primitive data or of custom data. +* `array_item_type`:(HashMap) - Data item within the array data type. +This complex property has following sub-properties: + + `object_type`:(string) The fully-qualified name of the instantiated, concrete type.The value should be the same as the 'ClassId' property.The enum values provides the list of concrete types that can be instantiated from this abstract type. +* `max`:(int) Specify the maximum value of the array. +* `min`:(int) Specify the minimum value of the array. + +### [workflow.CustomDataType](#argument-reference) +This data type represents a custom data object. +* `properties`:(HashMap) - Captures the custom data type properties. +This complex property has following sub-properties: + + `catalog_moid`:(string) Specify the catalog moid that this custom data type belongs. + + `custom_data_type_id`:(string)(ReadOnly) The resolved custom data type definition managed object. + + `custom_data_type_name`:(string) Name of the custom data type for this input. + + `object_type`:(string) The fully-qualified name of the instantiated, concrete type.The value should be the same as the 'ClassId' property. + +### [workflow.MoReferenceDataType](#argument-reference) +Data type to capture an Intersight Managed object reference. +* `properties`:(Array) +This complex property has following sub-properties: + + `display_attributes`: + (Array of schema.TypeString) - + + `object_type`:(string) The fully-qualified name of the instantiated, concrete type.The value should be the same as the 'ClassId' property. + + `selector`:(string) Field to hold an Intersight API along with an optional filter to narrow down the search options. + + `selector_property`:(HashMap) - Selector properties to define HTTP method and 'body' in case of upsert operation. +This complex property has following sub-properties: + + `body`:(JSON as string) Content of the request body to send for POST request. + + `method`:(string) The HTTP method to be used.* `GET` - The HTTP GET method requests a representation of the specified resource.* `POST` - The HTTP POST method sends data to the server. + + `object_type`:(string) The fully-qualified name of the instantiated, concrete type.The value should be the same as the 'ClassId' property. + + `value_attribute`:(string) A property from the Intersight object, value of which can be used as value for referenced input definition. + +### [workflow.PrimitiveDataType](#argument-reference) +This data type is used to represent primitives like string, floats and integers. +* `properties`:(HashMap) - Primitive data type properties. +This complex property has following sub-properties: + + `constraints`:(HashMap) - Constraints that must be applied to the parameter value supplied for this data type. +This complex property has following sub-properties: + + `enum_list`:(Array) +This complex property has following sub-properties: + + `label`:(string) Label for the enum value. A user friendly short string to identify the enum value. Label can only contain letters (a-z, A-Z), numbers (0-9), hyphen (-), period (.), colon (:), space ( ), single quote ('), forward slash (/), or an underscore (_) and must be at least 2 characters. + + `object_type`:(string) The fully-qualified name of the instantiated, concrete type.The value should be the same as the 'ClassId' property. + + `value`:(string) Enum value for this enum entry. Value will be passed to the workflow as string type for execution. Value can only contain letters (a-z, A-Z), numbers (0-9), hyphen (-), period (.), colon (:), space ( ), forward slash (/), or an underscore (_). + + `max`:(float) Allowed maximum value of the parameter if parameter is integer/float or maximum length of the parameter if the parameter is string. When max and min are set to 0, then the limits are not checked. If parameter is integer/float, then maximum number supported is 1.797693134862315708145274237317043567981e+308 or (2**1023 * (2**53 - 1) / 2**52). When a number bigger than this is given as Maximum value, the constraints will not be enforced. + + `min`:(float) Allowed minimum value of the parameter if parameter is integer/float or minimum length of the parameter if the parameter is string. When max and min are set to 0, then the limits are not checked. If parameter is integer/float, then minimum number supported is 4.940656458412465441765687928682213723651e-324 or (1 / 2 ** (1023 - 1 + 52)). When a number smaller than this is given as minimum value, the constraints will not be enforced. + + `object_type`:(string) The fully-qualified name of the instantiated, concrete type.The value should be the same as the 'ClassId' property. + + `regex`:(string) When the parameter is a string this regular expression is used to ensure the value is valid. + + `inventory_selector`:(Array) +This complex property has following sub-properties: + + `display_attributes`: + (Array of schema.TypeString) - + + `object_type`:(string) The fully-qualified name of the instantiated, concrete type.The value should be the same as the 'ClassId' property. + + `selector`:(string) Field to hold an Intersight API along with an optional filter to narrow down the search options. + + `selector_property`:(HashMap) - Selector properties to define HTTP method and 'body' in case of upsert operation. +This complex property has following sub-properties: + + `body`:(JSON as string) Content of the request body to send for POST request. + + `method`:(string) The HTTP method to be used.* `GET` - The HTTP GET method requests a representation of the specified resource.* `POST` - The HTTP POST method sends data to the server. + + `object_type`:(string) The fully-qualified name of the instantiated, concrete type.The value should be the same as the 'ClassId' property. + + `value_attribute`:(string) A property from the Intersight object, value of which can be used as value for referenced input definition. + + `object_type`:(string) The fully-qualified name of the instantiated, concrete type.The value should be the same as the 'ClassId' property. + + `secure`:(bool) Intersight supports secure properties as task input/output. The values ofthese properties are encrypted and stored in Intersight.This flag marks the property to be secure when it is set to true. + + `type`:(string) Specify the enum type for primitive data type.* `string` - Enum to specify a string data type.* `integer` - Enum to specify an integer32 data type.* `float` - Enum to specify a float64 data type.* `boolean` - Enum to specify a boolean data type.* `json` - Enum to specify a json data type.* `enum` - Enum to specify a enum data type which is a list of pre-defined strings. + +### [workflow.TargetDataType](#argument-reference) +Data type to capture a target endpoint or device. +* `custom_data_type_properties`:(HashMap) - Reference to custom data type definition. +This complex property has following sub-properties: + + `catalog_moid`:(string) Specify the catalog moid that this custom data type belongs. + + `custom_data_type_id`:(string)(ReadOnly) The resolved custom data type definition managed object. + + `custom_data_type_name`:(string) Name of the custom data type for this input. + + `object_type`:(string) The fully-qualified name of the instantiated, concrete type.The value should be the same as the 'ClassId' property. +* `is_array`:(bool) When this property is true then an array of targets can be passed as input. +* `max`:(int) Specify the maximum value of the array. +* `min`:(int) Specify the minimum value of the array. +* `properties`:(Array) +This complex property has following sub-properties: + + `connector_attribute`:(string) A singleton value which will contain the path to connector object from the selected object. + + `constraint_attributes`: + (Array of schema.TypeString) - + + `display_attributes`: + (Array of schema.TypeString) - + + `object_type`:(string) The fully-qualified name of the instantiated, concrete type.The value should be the same as the 'ClassId' property. + + `selector`:(string) Field to hold an Intersight API along with an optional filter to narrow down the search options for target device. + + `selector_property`:(HashMap) - Selector properties to define HTTP method and 'body' in case of upsert operation. +This complex property has following sub-properties: + + `body`:(JSON as string) Content of the request body to send for POST request. + + `method`:(string) The HTTP method to be used.* `GET` - The HTTP GET method requests a representation of the specified resource.* `POST` - The HTTP POST method sends data to the server. + + `object_type`:(string) The fully-qualified name of the instantiated, concrete type.The value should be the same as the 'ClassId' property. + + `supported_objects`: + (Array of schema.TypeString) - \ No newline at end of file