From 06c88f640454bd3023fd4121757655a9c31c8c59 Mon Sep 17 00:00:00 2001 From: yifat Date: Thu, 20 Oct 2022 11:15:25 +0300 Subject: [PATCH 1/8] [Security] Add directive definition to csharp to avoid .net conflicts --- specification/security/resource-manager/readme.csharp.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/specification/security/resource-manager/readme.csharp.md b/specification/security/resource-manager/readme.csharp.md index aa0c8faf23b7..7f3b79b768a6 100644 --- a/specification/security/resource-manager/readme.csharp.md +++ b/specification/security/resource-manager/readme.csharp.md @@ -11,6 +11,12 @@ csharp: license-header: MICROSOFT_MIT_NO_VERSION payload-flattening-threshold: 2 clear-output-folder: true + + directive: + - from: securityContacts.json + where: $.definitions.SecurityContactProperties.properties.alertNotifications.properties.state + transform: > + $['x-ms-enum']['name'] = 'stateEnum'; ``` ``` yaml $(csharp) && !$(multiapi) && !$(profile) From fb4445e9df1bb93ee56983ae0ab0f75a17715d58 Mon Sep 17 00:00:00 2001 From: yifat Date: Thu, 20 Oct 2022 11:42:54 +0300 Subject: [PATCH 2/8] Add declaration --- .../security/resource-manager/readme.csharp.md | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/specification/security/resource-manager/readme.csharp.md b/specification/security/resource-manager/readme.csharp.md index 7f3b79b768a6..aeb25f7abb02 100644 --- a/specification/security/resource-manager/readme.csharp.md +++ b/specification/security/resource-manager/readme.csharp.md @@ -13,15 +13,21 @@ csharp: clear-output-folder: true directive: - - from: securityContacts.json - where: $.definitions.SecurityContactProperties.properties.alertNotifications.properties.state - transform: > - $['x-ms-enum']['name'] = 'stateEnum'; + - from: securityContacts.json + where: $.definitions + transform: > + $.SecurityContactProperties.properties.alertNotifications.properties.state['x-ms-enum']['name'] = 'stateEnum'; ``` ``` yaml $(csharp) && !$(multiapi) && !$(profile) namespace: Microsoft.Azure.Management.Security output-folder: $(csharp-sdks-folder)/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated + + directive: + - from: securityContacts.json + where: $.definitions + transform: > + $.SecurityContactProperties.properties.alertNotifications.properties.state['x-ms-enum']['name'] = 'stateEnum'; ``` ## Batch settings From 58b716f06af1b379a00a54f50ad91f2464f13006 Mon Sep 17 00:00:00 2001 From: yifat Date: Thu, 20 Oct 2022 11:58:44 +0300 Subject: [PATCH 3/8] Fix --- .../security/resource-manager/readme.csharp.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/specification/security/resource-manager/readme.csharp.md b/specification/security/resource-manager/readme.csharp.md index aeb25f7abb02..02c5e90a17a9 100644 --- a/specification/security/resource-manager/readme.csharp.md +++ b/specification/security/resource-manager/readme.csharp.md @@ -13,10 +13,10 @@ csharp: clear-output-folder: true directive: - - from: securityContacts.json - where: $.definitions - transform: > - $.SecurityContactProperties.properties.alertNotifications.properties.state['x-ms-enum']['name'] = 'stateEnum'; + - from: securityContacts.json + where: $.definitions.SecurityContactProperties.properties.alertNotifications.properties.state + transform: > + $['x-ms-enum']['name'] = 'stateEnum'; ``` ``` yaml $(csharp) && !$(multiapi) && !$(profile) @@ -24,10 +24,10 @@ csharp: output-folder: $(csharp-sdks-folder)/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated directive: - - from: securityContacts.json - where: $.definitions - transform: > - $.SecurityContactProperties.properties.alertNotifications.properties.state['x-ms-enum']['name'] = 'stateEnum'; + - from: securityContacts.json + where: $.definitions.SecurityContactProperties.properties.alertNotifications.properties.state + transform: > + $['x-ms-enum']['name'] = 'stateEnum'; ``` ## Batch settings From d88cf3685a50be7deb050abcd34634385ccc1489 Mon Sep 17 00:00:00 2001 From: yifat Date: Mon, 24 Oct 2022 11:58:19 +0300 Subject: [PATCH 4/8] Add second renaming --- .../security/resource-manager/readme.csharp.md | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/specification/security/resource-manager/readme.csharp.md b/specification/security/resource-manager/readme.csharp.md index 02c5e90a17a9..fd58ba5f7523 100644 --- a/specification/security/resource-manager/readme.csharp.md +++ b/specification/security/resource-manager/readme.csharp.md @@ -12,22 +12,20 @@ csharp: payload-flattening-threshold: 2 clear-output-folder: true - directive: +directive: - from: securityContacts.json where: $.definitions.SecurityContactProperties.properties.alertNotifications.properties.state - transform: > - $['x-ms-enum']['name'] = 'stateEnum'; + transform: > + $['x-ms-enum']['name'] = 'SecurityAlertNotificationState'; + - from: securityContacts.json + where: $.definitions.SecurityContactProperties.properties.notificationsByRole.properties.state + transform: > + $['x-ms-enum']['name'] = 'SecurityAlertNotificationByRoleState'; ``` ``` yaml $(csharp) && !$(multiapi) && !$(profile) namespace: Microsoft.Azure.Management.Security output-folder: $(csharp-sdks-folder)/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated - - directive: - - from: securityContacts.json - where: $.definitions.SecurityContactProperties.properties.alertNotifications.properties.state - transform: > - $['x-ms-enum']['name'] = 'stateEnum'; ``` ## Batch settings From 762bcd6eda2362581f583b5a444d74f1c1624808 Mon Sep 17 00:00:00 2001 From: yifat Date: Mon, 24 Oct 2022 14:58:11 +0300 Subject: [PATCH 5/8] Fix Applications.json enum values --- .../preview/2022-07-01-preview/applications.json | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/specification/security/resource-manager/Microsoft.Security/preview/2022-07-01-preview/applications.json b/specification/security/resource-manager/Microsoft.Security/preview/2022-07-01-preview/applications.json index 37946c927f3e..5e34c8114020 100644 --- a/specification/security/resource-manager/Microsoft.Security/preview/2022-07-01-preview/applications.json +++ b/specification/security/resource-manager/Microsoft.Security/preview/2022-07-01-preview/applications.json @@ -485,6 +485,7 @@ "type": "string", "description": "The application Condition's Operator, for example Contains for id or In for list of possible IDs, see examples", "enum": [ + "Contains", "Equals", "In" ], @@ -496,6 +497,10 @@ "value": "Contains", "description": "Checks that the string value of the data defined in Property contains the given value" }, + { + "value": "Equals", + "description": "Checks that the string value of the data defined in Property equals the given value" + }, { "value": "In", "description": "Checks that the string value of the data defined in Property equals any of the given values (exact fit)" From 997ad48dfe79efc28b5d2416c20ffcf2b287a87e Mon Sep 17 00:00:00 2001 From: yifat Date: Wed, 26 Oct 2022 10:29:15 +0300 Subject: [PATCH 6/8] Rename x-ms-parameter-location value for not breaking the .net sdk --- specification/security/resource-manager/readme.csharp.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/specification/security/resource-manager/readme.csharp.md b/specification/security/resource-manager/readme.csharp.md index fd58ba5f7523..f3549397b54c 100644 --- a/specification/security/resource-manager/readme.csharp.md +++ b/specification/security/resource-manager/readme.csharp.md @@ -21,6 +21,10 @@ directive: where: $.definitions.SecurityContactProperties.properties.notificationsByRole.properties.state transform: > $['x-ms-enum']['name'] = 'SecurityAlertNotificationByRoleState'; + - from: types.json + where: $.parameters.AscLocation + transform: > + $['x-ms-parameter-location'] = 'client'; ``` ``` yaml $(csharp) && !$(multiapi) && !$(profile) From 5f86870471f03a2fc2b4f815697b9fa477c66da0 Mon Sep 17 00:00:00 2001 From: yifat Date: Wed, 26 Oct 2022 11:36:48 +0300 Subject: [PATCH 7/8] fix types path --- specification/security/resource-manager/readme.csharp.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/security/resource-manager/readme.csharp.md b/specification/security/resource-manager/readme.csharp.md index f3549397b54c..b4172ba4b0cc 100644 --- a/specification/security/resource-manager/readme.csharp.md +++ b/specification/security/resource-manager/readme.csharp.md @@ -21,7 +21,7 @@ directive: where: $.definitions.SecurityContactProperties.properties.notificationsByRole.properties.state transform: > $['x-ms-enum']['name'] = 'SecurityAlertNotificationByRoleState'; - - from: types.json + - from: common/v1/types.json where: $.parameters.AscLocation transform: > $['x-ms-parameter-location'] = 'client'; From 2ae26a0bd520295cca9591b8549856f5c6f45181 Mon Sep 17 00:00:00 2001 From: yifat Date: Wed, 26 Oct 2022 13:39:26 +0300 Subject: [PATCH 8/8] asclocation path --- specification/security/resource-manager/readme.csharp.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/security/resource-manager/readme.csharp.md b/specification/security/resource-manager/readme.csharp.md index b4172ba4b0cc..d834c9a42a4d 100644 --- a/specification/security/resource-manager/readme.csharp.md +++ b/specification/security/resource-manager/readme.csharp.md @@ -21,7 +21,7 @@ directive: where: $.definitions.SecurityContactProperties.properties.notificationsByRole.properties.state transform: > $['x-ms-enum']['name'] = 'SecurityAlertNotificationByRoleState'; - - from: common/v1/types.json + - from: swagger-document where: $.parameters.AscLocation transform: > $['x-ms-parameter-location'] = 'client';