From 971b53c759cd4f3a279add8c21db6af40ff3fc03 Mon Sep 17 00:00:00 2001 From: taklei <61745633+taklei@users.noreply.github.com> Date: Sat, 2 May 2020 12:23:56 +0300 Subject: [PATCH] [PendingArmReview] Fixed Settings API (#9227) * fixed settings api. changed the dataexportsetting parameter name and the discriminator place * deleted propersties * ran prettier fix * fixed update test and added properties in Settings definition * deleting additionalproperties because of autorest errors * adding back additionalProperties * deleting a readonly property from the example * deleting another readonly property from the example --- .../examples/Settings/GetSetting_example.json | 2 +- .../examples/Settings/GetSettings_example.json | 4 ++-- .../examples/Settings/UpdateSetting_example.json | 7 ++----- .../stable/2019-01-01/settings.json | 15 ++++++++------- 4 files changed, 13 insertions(+), 15 deletions(-) diff --git a/specification/security/resource-manager/Microsoft.Security/stable/2019-01-01/examples/Settings/GetSetting_example.json b/specification/security/resource-manager/Microsoft.Security/stable/2019-01-01/examples/Settings/GetSetting_example.json index 31c7b88df1db..808d5e9e47c4 100644 --- a/specification/security/resource-manager/Microsoft.Security/stable/2019-01-01/examples/Settings/GetSetting_example.json +++ b/specification/security/resource-manager/Microsoft.Security/stable/2019-01-01/examples/Settings/GetSetting_example.json @@ -9,7 +9,7 @@ "body": { "id": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/settings/MCAS", "name": "MCAS", - "kind": "DataExportSetting", + "kind": "DataExportSettings", "type": "Microsoft.Security/settings", "properties": { "enabled": true diff --git a/specification/security/resource-manager/Microsoft.Security/stable/2019-01-01/examples/Settings/GetSettings_example.json b/specification/security/resource-manager/Microsoft.Security/stable/2019-01-01/examples/Settings/GetSettings_example.json index 87d7aa5a6c58..4def4e3f66c6 100644 --- a/specification/security/resource-manager/Microsoft.Security/stable/2019-01-01/examples/Settings/GetSettings_example.json +++ b/specification/security/resource-manager/Microsoft.Security/stable/2019-01-01/examples/Settings/GetSettings_example.json @@ -10,7 +10,7 @@ { "id": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/settings/MCAS", "name": "MCAS", - "kind": "DataExportSetting", + "kind": "DataExportSettings", "type": "Microsoft.Security/settings", "properties": { "enabled": true @@ -19,7 +19,7 @@ { "id": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/settings/WDATP", "name": "WDATP", - "kind": "DataExportSetting", + "kind": "DataExportSettings", "type": "Microsoft.Security/settings", "properties": { "enabled": false diff --git a/specification/security/resource-manager/Microsoft.Security/stable/2019-01-01/examples/Settings/UpdateSetting_example.json b/specification/security/resource-manager/Microsoft.Security/stable/2019-01-01/examples/Settings/UpdateSetting_example.json index 789ebb7d6219..f0f251081910 100644 --- a/specification/security/resource-manager/Microsoft.Security/stable/2019-01-01/examples/Settings/UpdateSetting_example.json +++ b/specification/security/resource-manager/Microsoft.Security/stable/2019-01-01/examples/Settings/UpdateSetting_example.json @@ -4,10 +4,7 @@ "subscriptionId": "20ff7fc3-e762-44dd-bd96-b71116dcdc23", "settingName": "MCAS", "setting": { - "id": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/settings/MCAS", - "name": "MCAS", - "kind": "DataExportSetting", - "type": "Microsoft.Security/settings", + "kind": "DataExportSettings", "properties": { "enabled": true } @@ -18,7 +15,7 @@ "body": { "id": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/settings/MCAS", "name": "MCAS", - "kind": "DataExportSetting", + "kind": "DataExportSettings", "type": "Microsoft.Security/settings", "properties": { "enabled": true diff --git a/specification/security/resource-manager/Microsoft.Security/stable/2019-01-01/settings.json b/specification/security/resource-manager/Microsoft.Security/stable/2019-01-01/settings.json index 15e9f74f8d87..d77c68b14de0 100644 --- a/specification/security/resource-manager/Microsoft.Security/stable/2019-01-01/settings.json +++ b/specification/security/resource-manager/Microsoft.Security/stable/2019-01-01/settings.json @@ -175,7 +175,6 @@ "Setting": { "type": "object", "description": "Represents a security setting in Azure Security Center.", - "discriminator": "kind", "properties": {}, "allOf": [ { @@ -183,10 +182,9 @@ } ] }, - "DataExportSetting": { + "DataExportSettings": { "type": "object", "description": "Represents a data export setting", - "x-ms-discriminator-value": "DataExportSetting", "properties": { "properties": { "x-ms-client-flatten": true, @@ -198,17 +196,19 @@ { "$ref": "#/definitions/Setting" } - ] + ], + "x-ms-discriminator-value": "DataExportSettings" }, "SettingResource": { "type": "object", "description": "The kind of the security setting", + "additionalProperties": true, "properties": { "kind": { "type": "string", - "description": "the kind of the settings string (DataExportSetting)", + "description": "the kind of the settings string (DataExportSettings)", "enum": [ - "DataExportSetting", + "DataExportSettings", "AlertSuppressionSetting" ], "x-ms-enum": { @@ -216,7 +216,7 @@ "modelAsString": true, "values": [ { - "value": "DataExportSetting" + "value": "DataExportSettings" }, { "value": "AlertSuppressionSetting" @@ -225,6 +225,7 @@ } } }, + "discriminator": "kind", "required": [ "kind" ],