diff --git a/sdk/security/azure-resourcemanager-security/CHANGELOG.md b/sdk/security/azure-resourcemanager-security/CHANGELOG.md index 94e033f5fe1d3..6192e1323f072 100644 --- a/sdk/security/azure-resourcemanager-security/CHANGELOG.md +++ b/sdk/security/azure-resourcemanager-security/CHANGELOG.md @@ -1,6 +1,8 @@ # Release History -## 1.0.0-beta.4 (Unreleased) +## 1.0.0-beta.1 (2023-03-14) + +- Azure Resource Manager Security client library for Java. This package contains Microsoft Azure SDK for Security Management SDK. API spec for Microsoft.Security (Azure Security Center) resource provider. Package tag package-composite-v3. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ### Features Added diff --git a/sdk/security/azure-resourcemanager-security/README.md b/sdk/security/azure-resourcemanager-security/README.md index 56feefc413ff4..d5a2f20c8a879 100644 --- a/sdk/security/azure-resourcemanager-security/README.md +++ b/sdk/security/azure-resourcemanager-security/README.md @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-security - 1.0.0-beta.3 + 1.0.0-beta.4 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/security/azure-resourcemanager-security/SAMPLE.md b/sdk/security/azure-resourcemanager-security/SAMPLE.md index 4a430c8205e50..8165f46c2faca 100644 --- a/sdk/security/azure-resourcemanager-security/SAMPLE.md +++ b/sdk/security/azure-resourcemanager-security/SAMPLE.md @@ -163,17 +163,22 @@ - [Get](#governanceassignments_get) - [List](#governanceassignments_list) -## GovernanceRule +## GovernanceRules -- [List](#governancerule_list) +- [CreateOrUpdate](#governancerules_createorupdate) +- [Delete](#governancerules_delete) +- [Execute](#governancerules_execute) +- [Get](#governancerules_get) +- [List](#governancerules_list) +- [OperationResults](#governancerules_operationresults) -## GovernanceRulesOperation +## HealthReportOperation -- [CreateOrUpdate](#governancerulesoperation_createorupdate) -- [Delete](#governancerulesoperation_delete) -- [Get](#governancerulesoperation_get) -- [RuleIdExecuteSingleSecurityConnector](#governancerulesoperation_ruleidexecutesinglesecurityconnector) -- [RuleIdExecuteSingleSubscription](#governancerulesoperation_ruleidexecutesinglesubscription) +- [Get](#healthreportoperation_get) + +## HealthReports + +- [List](#healthreports_list) ## InformationProtectionPolicies @@ -282,20 +287,6 @@ - [List](#securityconnectorapplications_list) -## SecurityConnectorGovernanceRule - -- [List](#securityconnectorgovernancerule_list) - -## SecurityConnectorGovernanceRulesExecuteStatus - -- [Get](#securityconnectorgovernancerulesexecutestatus_get) - -## SecurityConnectorGovernanceRulesOperation - -- [CreateOrUpdate](#securityconnectorgovernancerulesoperation_createorupdate) -- [Delete](#securityconnectorgovernancerulesoperation_delete) -- [Get](#securityconnectorgovernancerulesoperation_get) - ## SecurityConnectors - [CreateOrUpdate](#securityconnectors_createorupdate) @@ -365,10 +356,6 @@ - [List](#subassessments_list) - [ListAll](#subassessments_listall) -## SubscriptionGovernanceRulesExecuteStatus - -- [Get](#subscriptiongovernancerulesexecutestatus_get) - ## Tasks - [GetResourceGroupLevelTask](#tasks_getresourcegroupleveltask) @@ -395,8 +382,6 @@ ### AdaptiveApplicationControls_Delete ```java -import com.azure.core.util.Context; - /** Samples for AdaptiveApplicationControls Delete. */ public final class AdaptiveApplicationControlsDeleteSamples { /* @@ -409,7 +394,9 @@ public final class AdaptiveApplicationControlsDeleteSamples { */ public static void deleteAnApplicationControlMachineGroup( com.azure.resourcemanager.security.SecurityManager manager) { - manager.adaptiveApplicationControls().deleteByResourceGroupWithResponse("centralus", "GROUP1", Context.NONE); + manager + .adaptiveApplicationControls() + .deleteByResourceGroupWithResponse("centralus", "GROUP1", com.azure.core.util.Context.NONE); } } ``` @@ -417,8 +404,6 @@ public final class AdaptiveApplicationControlsDeleteSamples { ### AdaptiveApplicationControls_Get ```java -import com.azure.core.util.Context; - /** Samples for AdaptiveApplicationControls Get. */ public final class AdaptiveApplicationControlsGetSamples { /* @@ -431,7 +416,9 @@ public final class AdaptiveApplicationControlsGetSamples { */ public static void getsAConfiguredApplicationControlVMServerGroup( com.azure.resourcemanager.security.SecurityManager manager) { - manager.adaptiveApplicationControls().getWithResponse("centralus", "ERELGROUP1", Context.NONE); + manager + .adaptiveApplicationControls() + .getWithResponse("centralus", "ERELGROUP1", com.azure.core.util.Context.NONE); } } ``` @@ -439,8 +426,6 @@ public final class AdaptiveApplicationControlsGetSamples { ### AdaptiveApplicationControls_List ```java -import com.azure.core.util.Context; - /** Samples for AdaptiveApplicationControls List. */ public final class AdaptiveApplicationControlsListSamples { /* @@ -453,7 +438,7 @@ public final class AdaptiveApplicationControlsListSamples { */ public static void getsAListOfApplicationControlGroupsOfMachinesForTheSubscription( com.azure.resourcemanager.security.SecurityManager manager) { - manager.adaptiveApplicationControls().listWithResponse(true, false, Context.NONE); + manager.adaptiveApplicationControls().listWithResponse(true, false, com.azure.core.util.Context.NONE); } } ``` @@ -461,7 +446,6 @@ public final class AdaptiveApplicationControlsListSamples { ### AdaptiveApplicationControls_Put ```java -import com.azure.core.util.Context; import com.azure.resourcemanager.security.models.AdaptiveApplicationControlGroup; import com.azure.resourcemanager.security.models.ConfigurationStatus; import com.azure.resourcemanager.security.models.EnforcementMode; @@ -489,7 +473,10 @@ public final class AdaptiveApplicationControlsPutSamples { public static void updateAnApplicationControlMachineGroupByAddingANewApplication( com.azure.resourcemanager.security.SecurityManager manager) { AdaptiveApplicationControlGroup resource = - manager.adaptiveApplicationControls().getWithResponse("centralus", "ERELGROUP1", Context.NONE).getValue(); + manager + .adaptiveApplicationControls() + .getWithResponse("centralus", "ERELGROUP1", com.azure.core.util.Context.NONE) + .getValue(); resource .update() .withEnforcementMode(EnforcementMode.AUDIT) @@ -589,7 +576,6 @@ public final class AdaptiveApplicationControlsPutSamples { ### AdaptiveNetworkHardenings_Enforce ```java -import com.azure.core.util.Context; import com.azure.resourcemanager.security.models.AdaptiveNetworkHardeningEnforceRequest; import com.azure.resourcemanager.security.models.Direction; import com.azure.resourcemanager.security.models.Rule; @@ -637,7 +623,7 @@ public final class AdaptiveNetworkHardeningsEnforceSamples { .asList( "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg1", "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/rg2/providers/Microsoft.Network/networkSecurityGroups/nsg2")), - Context.NONE); + com.azure.core.util.Context.NONE); } } ``` @@ -645,8 +631,6 @@ public final class AdaptiveNetworkHardeningsEnforceSamples { ### AdaptiveNetworkHardenings_Get ```java -import com.azure.core.util.Context; - /** Samples for AdaptiveNetworkHardenings Get. */ public final class AdaptiveNetworkHardeningsGetSamples { /* @@ -661,7 +645,8 @@ public final class AdaptiveNetworkHardeningsGetSamples { com.azure.resourcemanager.security.SecurityManager manager) { manager .adaptiveNetworkHardenings() - .getWithResponse("rg1", "Microsoft.Compute", "virtualMachines", "vm1", "default", Context.NONE); + .getWithResponse( + "rg1", "Microsoft.Compute", "virtualMachines", "vm1", "default", com.azure.core.util.Context.NONE); } } ``` @@ -669,8 +654,6 @@ public final class AdaptiveNetworkHardeningsGetSamples { ### AdaptiveNetworkHardenings_ListByExtendedResource ```java -import com.azure.core.util.Context; - /** Samples for AdaptiveNetworkHardenings ListByExtendedResource. */ public final class AdaptiveNetworkHardeningsListByExtendedResourceSamples { /* @@ -685,7 +668,8 @@ public final class AdaptiveNetworkHardeningsListByExtendedResourceSamples { com.azure.resourcemanager.security.SecurityManager manager) { manager .adaptiveNetworkHardenings() - .listByExtendedResource("rg1", "Microsoft.Compute", "virtualMachines", "vm1", Context.NONE); + .listByExtendedResource( + "rg1", "Microsoft.Compute", "virtualMachines", "vm1", com.azure.core.util.Context.NONE); } } ``` @@ -719,8 +703,6 @@ public final class AdvancedThreatProtectionCreateSamples { ### AdvancedThreatProtection_Get ```java -import com.azure.core.util.Context; - /** Samples for AdvancedThreatProtection Get. */ public final class AdvancedThreatProtectionGetSamples { /* @@ -737,7 +719,7 @@ public final class AdvancedThreatProtectionGetSamples { .advancedThreatProtections() .getWithResponse( "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Storage/storageAccounts/samplestorageaccount", - Context.NONE); + com.azure.core.util.Context.NONE); } } ``` @@ -745,8 +727,6 @@ public final class AdvancedThreatProtectionGetSamples { ### Alerts_GetResourceGroupLevel ```java -import com.azure.core.util.Context; - /** Samples for Alerts GetResourceGroupLevel. */ public final class AlertsGetResourceGroupLevelSamples { /* @@ -762,7 +742,10 @@ public final class AlertsGetResourceGroupLevelSamples { manager .alerts() .getResourceGroupLevelWithResponse( - "myRg1", "westeurope", "2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a", Context.NONE); + "myRg1", + "westeurope", + "2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a", + com.azure.core.util.Context.NONE); } } ``` @@ -770,8 +753,6 @@ public final class AlertsGetResourceGroupLevelSamples { ### Alerts_GetSubscriptionLevel ```java -import com.azure.core.util.Context; - /** Samples for Alerts GetSubscriptionLevel. */ public final class AlertsGetSubscriptionLevelSamples { /* @@ -787,7 +768,9 @@ public final class AlertsGetSubscriptionLevelSamples { manager .alerts() .getSubscriptionLevelWithResponse( - "westeurope", "2518770965529163669_F144EE95-A3E5-42DA-A279-967D115809AA", Context.NONE); + "westeurope", + "2518770965529163669_F144EE95-A3E5-42DA-A279-967D115809AA", + com.azure.core.util.Context.NONE); } } ``` @@ -795,8 +778,6 @@ public final class AlertsGetSubscriptionLevelSamples { ### Alerts_List ```java -import com.azure.core.util.Context; - /** Samples for Alerts List. */ public final class AlertsListSamples { /* @@ -808,7 +789,7 @@ public final class AlertsListSamples { * @param manager Entry point to SecurityManager. */ public static void getSecurityAlertsOnASubscription(com.azure.resourcemanager.security.SecurityManager manager) { - manager.alerts().list(Context.NONE); + manager.alerts().list(com.azure.core.util.Context.NONE); } } ``` @@ -816,8 +797,6 @@ public final class AlertsListSamples { ### Alerts_ListByResourceGroup ```java -import com.azure.core.util.Context; - /** Samples for Alerts ListByResourceGroup. */ public final class AlertsListByResourceGroupSamples { /* @@ -829,7 +808,7 @@ public final class AlertsListByResourceGroupSamples { * @param manager Entry point to SecurityManager. */ public static void getSecurityAlertsOnAResourceGroup(com.azure.resourcemanager.security.SecurityManager manager) { - manager.alerts().listByResourceGroup("myRg1", Context.NONE); + manager.alerts().listByResourceGroup("myRg1", com.azure.core.util.Context.NONE); } } ``` @@ -837,8 +816,6 @@ public final class AlertsListByResourceGroupSamples { ### Alerts_ListResourceGroupLevelByRegion ```java -import com.azure.core.util.Context; - /** Samples for Alerts ListResourceGroupLevelByRegion. */ public final class AlertsListResourceGroupLevelByRegionSamples { /* @@ -851,7 +828,7 @@ public final class AlertsListResourceGroupLevelByRegionSamples { */ public static void getSecurityAlertsOnAResourceGroupFromASecurityDataLocation( com.azure.resourcemanager.security.SecurityManager manager) { - manager.alerts().listResourceGroupLevelByRegion("westeurope", "myRg1", Context.NONE); + manager.alerts().listResourceGroupLevelByRegion("westeurope", "myRg1", com.azure.core.util.Context.NONE); } } ``` @@ -859,8 +836,6 @@ public final class AlertsListResourceGroupLevelByRegionSamples { ### Alerts_ListSubscriptionLevelByRegion ```java -import com.azure.core.util.Context; - /** Samples for Alerts ListSubscriptionLevelByRegion. */ public final class AlertsListSubscriptionLevelByRegionSamples { /* @@ -873,7 +848,7 @@ public final class AlertsListSubscriptionLevelByRegionSamples { */ public static void getSecurityAlertsOnASubscriptionFromASecurityDataLocation( com.azure.resourcemanager.security.SecurityManager manager) { - manager.alerts().listSubscriptionLevelByRegion("westeurope", Context.NONE); + manager.alerts().listSubscriptionLevelByRegion("westeurope", com.azure.core.util.Context.NONE); } } ``` @@ -881,7 +856,6 @@ public final class AlertsListSubscriptionLevelByRegionSamples { ### Alerts_Simulate ```java -import com.azure.core.util.Context; import com.azure.resourcemanager.security.models.AlertSimulatorBundlesRequestProperties; import com.azure.resourcemanager.security.models.AlertSimulatorRequestBody; import com.azure.resourcemanager.security.models.BundleType; @@ -918,7 +892,7 @@ public final class AlertsSimulateSamples { BundleType.STORAGE_ACCOUNTS, BundleType.VIRTUAL_MACHINES, BundleType.COSMOS_DBS))), - Context.NONE); + com.azure.core.util.Context.NONE); } } ``` @@ -926,8 +900,6 @@ public final class AlertsSimulateSamples { ### Alerts_UpdateResourceGroupLevelStateToActivate ```java -import com.azure.core.util.Context; - /** Samples for Alerts UpdateResourceGroupLevelStateToActivate. */ public final class AlertsUpdateResourceGroupLevelStateToActivateSamples { /* @@ -943,7 +915,10 @@ public final class AlertsUpdateResourceGroupLevelStateToActivateSamples { manager .alerts() .updateResourceGroupLevelStateToActivateWithResponse( - "myRg2", "westeurope", "2518765996949954086_2325cf9e-42a2-4f72-ae7f-9b863cba2d22", Context.NONE); + "myRg2", + "westeurope", + "2518765996949954086_2325cf9e-42a2-4f72-ae7f-9b863cba2d22", + com.azure.core.util.Context.NONE); } } ``` @@ -951,8 +926,6 @@ public final class AlertsUpdateResourceGroupLevelStateToActivateSamples { ### Alerts_UpdateResourceGroupLevelStateToDismiss ```java -import com.azure.core.util.Context; - /** Samples for Alerts UpdateResourceGroupLevelStateToDismiss. */ public final class AlertsUpdateResourceGroupLevelStateToDismissSamples { /* @@ -968,7 +941,10 @@ public final class AlertsUpdateResourceGroupLevelStateToDismissSamples { manager .alerts() .updateResourceGroupLevelStateToDismissWithResponse( - "myRg2", "westeurope", "2518765996949954086_2325cf9e-42a2-4f72-ae7f-9b863cba2d22", Context.NONE); + "myRg2", + "westeurope", + "2518765996949954086_2325cf9e-42a2-4f72-ae7f-9b863cba2d22", + com.azure.core.util.Context.NONE); } } ``` @@ -976,8 +952,6 @@ public final class AlertsUpdateResourceGroupLevelStateToDismissSamples { ### Alerts_UpdateResourceGroupLevelStateToInProgress ```java -import com.azure.core.util.Context; - /** Samples for Alerts UpdateResourceGroupLevelStateToInProgress. */ public final class AlertsUpdateResourceGroupLevelStateToInProgressSamples { /* @@ -993,7 +967,10 @@ public final class AlertsUpdateResourceGroupLevelStateToInProgressSamples { manager .alerts() .updateResourceGroupLevelStateToInProgressWithResponse( - "myRg2", "westeurope", "2518765996949954086_2325cf9e-42a2-4f72-ae7f-9b863cba2d22", Context.NONE); + "myRg2", + "westeurope", + "2518765996949954086_2325cf9e-42a2-4f72-ae7f-9b863cba2d22", + com.azure.core.util.Context.NONE); } } ``` @@ -1001,8 +978,6 @@ public final class AlertsUpdateResourceGroupLevelStateToInProgressSamples { ### Alerts_UpdateResourceGroupLevelStateToResolve ```java -import com.azure.core.util.Context; - /** Samples for Alerts UpdateResourceGroupLevelStateToResolve. */ public final class AlertsUpdateResourceGroupLevelStateToResolveSamples { /* @@ -1018,7 +993,10 @@ public final class AlertsUpdateResourceGroupLevelStateToResolveSamples { manager .alerts() .updateResourceGroupLevelStateToResolveWithResponse( - "myRg2", "westeurope", "2518765996949954086_2325cf9e-42a2-4f72-ae7f-9b863cba2d22", Context.NONE); + "myRg2", + "westeurope", + "2518765996949954086_2325cf9e-42a2-4f72-ae7f-9b863cba2d22", + com.azure.core.util.Context.NONE); } } ``` @@ -1026,8 +1004,6 @@ public final class AlertsUpdateResourceGroupLevelStateToResolveSamples { ### Alerts_UpdateSubscriptionLevelStateToActivate ```java -import com.azure.core.util.Context; - /** Samples for Alerts UpdateSubscriptionLevelStateToActivate. */ public final class AlertsUpdateSubscriptionLevelStateToActivateSamples { /* @@ -1043,7 +1019,9 @@ public final class AlertsUpdateSubscriptionLevelStateToActivateSamples { manager .alerts() .updateSubscriptionLevelStateToActivateWithResponse( - "westeurope", "2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a", Context.NONE); + "westeurope", + "2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a", + com.azure.core.util.Context.NONE); } } ``` @@ -1051,8 +1029,6 @@ public final class AlertsUpdateSubscriptionLevelStateToActivateSamples { ### Alerts_UpdateSubscriptionLevelStateToDismiss ```java -import com.azure.core.util.Context; - /** Samples for Alerts UpdateSubscriptionLevelStateToDismiss. */ public final class AlertsUpdateSubscriptionLevelStateToDismissSamples { /* @@ -1068,7 +1044,9 @@ public final class AlertsUpdateSubscriptionLevelStateToDismissSamples { manager .alerts() .updateSubscriptionLevelStateToDismissWithResponse( - "westeurope", "2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a", Context.NONE); + "westeurope", + "2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a", + com.azure.core.util.Context.NONE); } } ``` @@ -1076,8 +1054,6 @@ public final class AlertsUpdateSubscriptionLevelStateToDismissSamples { ### Alerts_UpdateSubscriptionLevelStateToInProgress ```java -import com.azure.core.util.Context; - /** Samples for Alerts UpdateSubscriptionLevelStateToInProgress. */ public final class AlertsUpdateSubscriptionLevelStateToInProgressSamples { /* @@ -1093,7 +1069,9 @@ public final class AlertsUpdateSubscriptionLevelStateToInProgressSamples { manager .alerts() .updateSubscriptionLevelStateToInProgressWithResponse( - "westeurope", "2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a", Context.NONE); + "westeurope", + "2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a", + com.azure.core.util.Context.NONE); } } ``` @@ -1101,8 +1079,6 @@ public final class AlertsUpdateSubscriptionLevelStateToInProgressSamples { ### Alerts_UpdateSubscriptionLevelStateToResolve ```java -import com.azure.core.util.Context; - /** Samples for Alerts UpdateSubscriptionLevelStateToResolve. */ public final class AlertsUpdateSubscriptionLevelStateToResolveSamples { /* @@ -1118,7 +1094,9 @@ public final class AlertsUpdateSubscriptionLevelStateToResolveSamples { manager .alerts() .updateSubscriptionLevelStateToResolveWithResponse( - "westeurope", "2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a", Context.NONE); + "westeurope", + "2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a", + com.azure.core.util.Context.NONE); } } ``` @@ -1126,8 +1104,6 @@ public final class AlertsUpdateSubscriptionLevelStateToResolveSamples { ### AlertsSuppressionRules_Delete ```java -import com.azure.core.util.Context; - /** Samples for AlertsSuppressionRules Delete. */ public final class AlertsSuppressionRulesDeleteSamples { /* @@ -1140,7 +1116,7 @@ public final class AlertsSuppressionRulesDeleteSamples { */ public static void deleteSuppressionRuleDataForASubscription( com.azure.resourcemanager.security.SecurityManager manager) { - manager.alertsSuppressionRules().deleteWithResponse("dismissIpAnomalyAlerts", Context.NONE); + manager.alertsSuppressionRules().deleteWithResponse("dismissIpAnomalyAlerts", com.azure.core.util.Context.NONE); } } ``` @@ -1148,8 +1124,6 @@ public final class AlertsSuppressionRulesDeleteSamples { ### AlertsSuppressionRules_Get ```java -import com.azure.core.util.Context; - /** Samples for AlertsSuppressionRules Get. */ public final class AlertsSuppressionRulesGetSamples { /* @@ -1162,7 +1136,7 @@ public final class AlertsSuppressionRulesGetSamples { */ public static void getSuppressionAlertRuleForSubscription( com.azure.resourcemanager.security.SecurityManager manager) { - manager.alertsSuppressionRules().getWithResponse("dismissIpAnomalyAlerts", Context.NONE); + manager.alertsSuppressionRules().getWithResponse("dismissIpAnomalyAlerts", com.azure.core.util.Context.NONE); } } ``` @@ -1170,8 +1144,6 @@ public final class AlertsSuppressionRulesGetSamples { ### AlertsSuppressionRules_List ```java -import com.azure.core.util.Context; - /** Samples for AlertsSuppressionRules List. */ public final class AlertsSuppressionRulesListSamples { /* @@ -1183,7 +1155,7 @@ public final class AlertsSuppressionRulesListSamples { * @param manager Entry point to SecurityManager. */ public static void getSuppressionRulesForSubscription(com.azure.resourcemanager.security.SecurityManager manager) { - manager.alertsSuppressionRules().list(null, Context.NONE); + manager.alertsSuppressionRules().list(null, com.azure.core.util.Context.NONE); } /* @@ -1196,7 +1168,7 @@ public final class AlertsSuppressionRulesListSamples { */ public static void getSuppressionAlertRuleForSubscriptionFilteredByAlertType( com.azure.resourcemanager.security.SecurityManager manager) { - manager.alertsSuppressionRules().list("IpAnomaly", Context.NONE); + manager.alertsSuppressionRules().list("IpAnomaly", com.azure.core.util.Context.NONE); } } ``` @@ -1205,7 +1177,6 @@ public final class AlertsSuppressionRulesListSamples { ```java import com.azure.core.management.serializer.SerializerFactory; -import com.azure.core.util.Context; import com.azure.core.util.serializer.SerializerEncoding; import com.azure.resourcemanager.security.fluent.models.AlertsSuppressionRuleInner; import com.azure.resourcemanager.security.models.RuleState; @@ -1258,7 +1229,7 @@ public final class AlertsSuppressionRulesUpdateSamples { new ScopeElement() .withField("entities.process.commandline") .withAdditionalProperties(mapOf("contains", "POWERSHELL.EXE"))))), - Context.NONE); + com.azure.core.util.Context.NONE); } @SuppressWarnings("unchecked") @@ -1277,7 +1248,6 @@ public final class AlertsSuppressionRulesUpdateSamples { ### AllowedConnections_Get ```java -import com.azure.core.util.Context; import com.azure.resourcemanager.security.models.ConnectionType; /** Samples for AllowedConnections Get. */ @@ -1293,7 +1263,7 @@ public final class AllowedConnectionsGetSamples { public static void getAllowedConnections(com.azure.resourcemanager.security.SecurityManager manager) { manager .allowedConnections() - .getWithResponse("myResourceGroup", "centralus", ConnectionType.INTERNAL, Context.NONE); + .getWithResponse("myResourceGroup", "centralus", ConnectionType.INTERNAL, com.azure.core.util.Context.NONE); } } ``` @@ -1301,8 +1271,6 @@ public final class AllowedConnectionsGetSamples { ### AllowedConnections_List ```java -import com.azure.core.util.Context; - /** Samples for AllowedConnections List. */ public final class AllowedConnectionsListSamples { /* @@ -1315,7 +1283,7 @@ public final class AllowedConnectionsListSamples { */ public static void getAllowedConnectionsOnASubscription( com.azure.resourcemanager.security.SecurityManager manager) { - manager.allowedConnections().list(Context.NONE); + manager.allowedConnections().list(com.azure.core.util.Context.NONE); } } ``` @@ -1323,8 +1291,6 @@ public final class AllowedConnectionsListSamples { ### AllowedConnections_ListByHomeRegion ```java -import com.azure.core.util.Context; - /** Samples for AllowedConnections ListByHomeRegion. */ public final class AllowedConnectionsListByHomeRegionSamples { /* @@ -1337,7 +1303,7 @@ public final class AllowedConnectionsListByHomeRegionSamples { */ public static void getAllowedConnectionsOnASubscriptionFromSecurityDataLocation( com.azure.resourcemanager.security.SecurityManager manager) { - manager.allowedConnections().listByHomeRegion("centralus", Context.NONE); + manager.allowedConnections().listByHomeRegion("centralus", com.azure.core.util.Context.NONE); } } ``` @@ -1345,8 +1311,6 @@ public final class AllowedConnectionsListByHomeRegionSamples { ### ApiCollection_Get ```java -import com.azure.core.util.Context; - /** Samples for ApiCollection Get. */ public final class ApiCollectionGetSamples { /* @@ -1359,7 +1323,7 @@ public final class ApiCollectionGetSamples { */ public static void getsAnAzureAPIManagementAPIIfItHasBeenOnboardedToDefenderForAPIs( com.azure.resourcemanager.security.SecurityManager manager) { - manager.apiCollections().getWithResponse("rg1", "apimService1", "echo-api", Context.NONE); + manager.apiCollections().getWithResponse("rg1", "apimService1", "echo-api", com.azure.core.util.Context.NONE); } } ``` @@ -1367,8 +1331,6 @@ public final class ApiCollectionGetSamples { ### ApiCollection_List ```java -import com.azure.core.util.Context; - /** Samples for ApiCollection List. */ public final class ApiCollectionListSamples { /* @@ -1381,7 +1343,7 @@ public final class ApiCollectionListSamples { */ public static void getsAListOfAzureAPIManagementAPIsThatHaveBeenOnboardedToDefenderForAPIs( com.azure.resourcemanager.security.SecurityManager manager) { - manager.apiCollections().list("rg1", "apimService1", Context.NONE); + manager.apiCollections().list("rg1", "apimService1", com.azure.core.util.Context.NONE); } } ``` @@ -1389,8 +1351,6 @@ public final class ApiCollectionListSamples { ### ApiCollectionOffboarding_Delete ```java -import com.azure.core.util.Context; - /** Samples for ApiCollectionOffboarding Delete. */ public final class ApiCollectionOffboardingDeleteSamples { /* @@ -1403,7 +1363,9 @@ public final class ApiCollectionOffboardingDeleteSamples { */ public static void deleteASecurityRecommendationTaskOnAResource( com.azure.resourcemanager.security.SecurityManager manager) { - manager.apiCollectionOffboardings().deleteWithResponse("rg1", "apimService1", "echo-api", Context.NONE); + manager + .apiCollectionOffboardings() + .deleteWithResponse("rg1", "apimService1", "echo-api", com.azure.core.util.Context.NONE); } } ``` @@ -1411,8 +1373,6 @@ public final class ApiCollectionOffboardingDeleteSamples { ### ApiCollectionOnboarding_Create ```java -import com.azure.core.util.Context; - /** Samples for ApiCollectionOnboarding Create. */ public final class ApiCollectionOnboardingCreateSamples { /* @@ -1425,7 +1385,9 @@ public final class ApiCollectionOnboardingCreateSamples { */ public static void onboardAnAzureAPIManagementAPIToDefenderForAPIs( com.azure.resourcemanager.security.SecurityManager manager) { - manager.apiCollectionOnboardings().createWithResponse("rg1", "apimService1", "echo-api", Context.NONE); + manager + .apiCollectionOnboardings() + .createWithResponse("rg1", "apimService1", "echo-api", com.azure.core.util.Context.NONE); } } ``` @@ -1474,8 +1436,6 @@ public final class ApplicationOperationCreateOrUpdateSamples { ### ApplicationOperation_Delete ```java -import com.azure.core.util.Context; - /** Samples for ApplicationOperation Delete. */ public final class ApplicationOperationDeleteSamples { /* @@ -1487,7 +1447,9 @@ public final class ApplicationOperationDeleteSamples { * @param manager Entry point to SecurityManager. */ public static void deleteSecurityApplication(com.azure.resourcemanager.security.SecurityManager manager) { - manager.applicationOperations().deleteWithResponse("ad9a8e26-29d9-4829-bb30-e597a58cdbb8", Context.NONE); + manager + .applicationOperations() + .deleteWithResponse("ad9a8e26-29d9-4829-bb30-e597a58cdbb8", com.azure.core.util.Context.NONE); } } ``` @@ -1495,8 +1457,6 @@ public final class ApplicationOperationDeleteSamples { ### ApplicationOperation_Get ```java -import com.azure.core.util.Context; - /** Samples for ApplicationOperation Get. */ public final class ApplicationOperationGetSamples { /* @@ -1509,7 +1469,9 @@ public final class ApplicationOperationGetSamples { */ public static void getSecurityApplicationBySpecificApplicationId( com.azure.resourcemanager.security.SecurityManager manager) { - manager.applicationOperations().getWithResponse("ad9a8e26-29d9-4829-bb30-e597a58cdbb8", Context.NONE); + manager + .applicationOperations() + .getWithResponse("ad9a8e26-29d9-4829-bb30-e597a58cdbb8", com.azure.core.util.Context.NONE); } } ``` @@ -1517,8 +1479,6 @@ public final class ApplicationOperationGetSamples { ### Applications_List ```java -import com.azure.core.util.Context; - /** Samples for Applications List. */ public final class ApplicationsListSamples { /* @@ -1531,7 +1491,7 @@ public final class ApplicationsListSamples { */ public static void listApplicationsSecurityBySubscriptionLevelScope( com.azure.resourcemanager.security.SecurityManager manager) { - manager.applications().list(Context.NONE); + manager.applications().list(com.azure.core.util.Context.NONE); } } ``` @@ -1570,8 +1530,6 @@ public final class AssessmentsCreateOrUpdateSamples { ### Assessments_Delete ```java -import com.azure.core.util.Context; - /** Samples for Assessments Delete. */ public final class AssessmentsDeleteSamples { /* @@ -1589,7 +1547,7 @@ public final class AssessmentsDeleteSamples { .deleteByResourceGroupWithResponse( "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachineScaleSets/vmss2", "8bb8be0a-6010-4789-812f-e4d661c4ed0e", - Context.NONE); + com.azure.core.util.Context.NONE); } } ``` @@ -1597,7 +1555,6 @@ public final class AssessmentsDeleteSamples { ### Assessments_Get ```java -import com.azure.core.util.Context; import com.azure.resourcemanager.security.models.ExpandEnum; /** Samples for Assessments Get. */ @@ -1618,7 +1575,7 @@ public final class AssessmentsGetSamples { "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachineScaleSets/vmss2", "21300918-b2e3-0346-785f-c77ff57d243b", ExpandEnum.LINKS, - Context.NONE); + com.azure.core.util.Context.NONE); } /* @@ -1637,7 +1594,7 @@ public final class AssessmentsGetSamples { "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachineScaleSets/vmss2", "21300918-b2e3-0346-785f-c77ff57d243b", null, - Context.NONE); + com.azure.core.util.Context.NONE); } } ``` @@ -1645,8 +1602,6 @@ public final class AssessmentsGetSamples { ### Assessments_List ```java -import com.azure.core.util.Context; - /** Samples for Assessments List. */ public final class AssessmentsListSamples { /* @@ -1658,7 +1613,9 @@ public final class AssessmentsListSamples { * @param manager Entry point to SecurityManager. */ public static void listSecurityAssessments(com.azure.resourcemanager.security.SecurityManager manager) { - manager.assessments().list("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", Context.NONE); + manager + .assessments() + .list("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", com.azure.core.util.Context.NONE); } } ``` @@ -1711,8 +1668,6 @@ public final class AssessmentsMetadataCreateInSubscriptionSamples { ### AssessmentsMetadata_DeleteInSubscription ```java -import com.azure.core.util.Context; - /** Samples for AssessmentsMetadata DeleteInSubscription. */ public final class AssessmentsMetadataDeleteInSubscriptionSamples { /* @@ -1727,7 +1682,7 @@ public final class AssessmentsMetadataDeleteInSubscriptionSamples { com.azure.resourcemanager.security.SecurityManager manager) { manager .assessmentsMetadatas() - .deleteInSubscriptionWithResponse("ca039e75-a276-4175-aebc-bcd41e4b14b7", Context.NONE); + .deleteInSubscriptionWithResponse("ca039e75-a276-4175-aebc-bcd41e4b14b7", com.azure.core.util.Context.NONE); } } ``` @@ -1735,8 +1690,6 @@ public final class AssessmentsMetadataDeleteInSubscriptionSamples { ### AssessmentsMetadata_Get ```java -import com.azure.core.util.Context; - /** Samples for AssessmentsMetadata Get. */ public final class AssessmentsMetadataGetSamples { /* @@ -1748,7 +1701,9 @@ public final class AssessmentsMetadataGetSamples { * @param manager Entry point to SecurityManager. */ public static void getSecurityAssessmentMetadata(com.azure.resourcemanager.security.SecurityManager manager) { - manager.assessmentsMetadatas().getWithResponse("21300918-b2e3-0346-785f-c77ff57d243b", Context.NONE); + manager + .assessmentsMetadatas() + .getWithResponse("21300918-b2e3-0346-785f-c77ff57d243b", com.azure.core.util.Context.NONE); } } ``` @@ -1756,8 +1711,6 @@ public final class AssessmentsMetadataGetSamples { ### AssessmentsMetadata_GetInSubscription ```java -import com.azure.core.util.Context; - /** Samples for AssessmentsMetadata GetInSubscription. */ public final class AssessmentsMetadataGetInSubscriptionSamples { /* @@ -1772,7 +1725,7 @@ public final class AssessmentsMetadataGetInSubscriptionSamples { com.azure.resourcemanager.security.SecurityManager manager) { manager .assessmentsMetadatas() - .getInSubscriptionWithResponse("21300918-b2e3-0346-785f-c77ff57d243b", Context.NONE); + .getInSubscriptionWithResponse("21300918-b2e3-0346-785f-c77ff57d243b", com.azure.core.util.Context.NONE); } } ``` @@ -1780,8 +1733,6 @@ public final class AssessmentsMetadataGetInSubscriptionSamples { ### AssessmentsMetadata_List ```java -import com.azure.core.util.Context; - /** Samples for AssessmentsMetadata List. */ public final class AssessmentsMetadataListSamples { /* @@ -1793,7 +1744,7 @@ public final class AssessmentsMetadataListSamples { * @param manager Entry point to SecurityManager. */ public static void listSecurityAssessmentMetadata(com.azure.resourcemanager.security.SecurityManager manager) { - manager.assessmentsMetadatas().list(Context.NONE); + manager.assessmentsMetadatas().list(com.azure.core.util.Context.NONE); } } ``` @@ -1801,8 +1752,6 @@ public final class AssessmentsMetadataListSamples { ### AssessmentsMetadata_ListBySubscription ```java -import com.azure.core.util.Context; - /** Samples for AssessmentsMetadata ListBySubscription. */ public final class AssessmentsMetadataListBySubscriptionSamples { /* @@ -1815,7 +1764,7 @@ public final class AssessmentsMetadataListBySubscriptionSamples { */ public static void listSecurityAssessmentMetadataForSubscription( com.azure.resourcemanager.security.SecurityManager manager) { - manager.assessmentsMetadatas().listBySubscription(Context.NONE); + manager.assessmentsMetadatas().listBySubscription(com.azure.core.util.Context.NONE); } } ``` @@ -1845,8 +1794,6 @@ public final class AutoProvisioningSettingsCreateSamples { ### AutoProvisioningSettings_Get ```java -import com.azure.core.util.Context; - /** Samples for AutoProvisioningSettings Get. */ public final class AutoProvisioningSettingsGetSamples { /* @@ -1859,7 +1806,7 @@ public final class AutoProvisioningSettingsGetSamples { */ public static void getAnAutoProvisioningSettingForSubscription( com.azure.resourcemanager.security.SecurityManager manager) { - manager.autoProvisioningSettings().getWithResponse("default", Context.NONE); + manager.autoProvisioningSettings().getWithResponse("default", com.azure.core.util.Context.NONE); } } ``` @@ -1867,8 +1814,6 @@ public final class AutoProvisioningSettingsGetSamples { ### AutoProvisioningSettings_List ```java -import com.azure.core.util.Context; - /** Samples for AutoProvisioningSettings List. */ public final class AutoProvisioningSettingsListSamples { /* @@ -1881,7 +1826,7 @@ public final class AutoProvisioningSettingsListSamples { */ public static void getAutoProvisioningSettingsForSubscription( com.azure.resourcemanager.security.SecurityManager manager) { - manager.autoProvisioningSettings().list(Context.NONE); + manager.autoProvisioningSettings().list(com.azure.core.util.Context.NONE); } } ``` @@ -1897,8 +1842,6 @@ import com.azure.resourcemanager.security.models.AutomationTriggeringRule; import com.azure.resourcemanager.security.models.EventSource; import com.azure.resourcemanager.security.models.Operator; import com.azure.resourcemanager.security.models.PropertyType; -import java.io.IOException; -import java.net.URL; import java.util.Arrays; import java.util.HashMap; import java.util.Map; @@ -1914,7 +1857,7 @@ public final class AutomationsCreateOrUpdateSamples { * @param manager Entry point to SecurityManager. */ public static void createOrUpdateASecurityAutomationForAllAssessmentsIncludingAllSeverities( - com.azure.resourcemanager.security.SecurityManager manager) throws IOException { + com.azure.resourcemanager.security.SecurityManager manager) { manager .automations() .define("exampleAutomation") @@ -1942,7 +1885,7 @@ public final class AutomationsCreateOrUpdateSamples { new AutomationActionLogicApp() .withLogicAppResourceId( "/subscriptions/e54a4a18-5b94-4f90-9471-bd3decad8a2e/resourceGroups/sample/providers/Microsoft.Logic/workflows/MyTest1") - .withUri(new URL("https://exampleTriggerUri1.com")))) + .withUri("https://exampleTriggerUri1.com"))) .create(); } @@ -1954,8 +1897,7 @@ public final class AutomationsCreateOrUpdateSamples { * * @param manager Entry point to SecurityManager. */ - public static void disableOrEnableASecurityAutomation(com.azure.resourcemanager.security.SecurityManager manager) - throws IOException { + public static void disableOrEnableASecurityAutomation(com.azure.resourcemanager.security.SecurityManager manager) { manager .automations() .define("exampleAutomation") @@ -1999,7 +1941,7 @@ public final class AutomationsCreateOrUpdateSamples { new AutomationActionLogicApp() .withLogicAppResourceId( "/subscriptions/e54a4a18-5b94-4f90-9471-bd3decad8a2e/resourceGroups/sample/providers/Microsoft.Logic/workflows/MyTest1") - .withUri(new URL("https://exampleTriggerUri1.com")))) + .withUri("https://exampleTriggerUri1.com"))) .create(); } @@ -2012,7 +1954,7 @@ public final class AutomationsCreateOrUpdateSamples { * @param manager Entry point to SecurityManager. */ public static void createOrUpdateASecurityAutomationForAllHighSeverityAssessments( - com.azure.resourcemanager.security.SecurityManager manager) throws IOException { + com.azure.resourcemanager.security.SecurityManager manager) { manager .automations() .define("exampleAutomation") @@ -2056,7 +1998,7 @@ public final class AutomationsCreateOrUpdateSamples { new AutomationActionLogicApp() .withLogicAppResourceId( "/subscriptions/e54a4a18-5b94-4f90-9471-bd3decad8a2e/resourceGroups/sample/providers/Microsoft.Logic/workflows/MyTest1") - .withUri(new URL("https://exampleTriggerUri1.com")))) + .withUri("https://exampleTriggerUri1.com"))) .create(); } @@ -2076,8 +2018,6 @@ public final class AutomationsCreateOrUpdateSamples { ### Automations_Delete ```java -import com.azure.core.util.Context; - /** Samples for Automations Delete. */ public final class AutomationsDeleteSamples { /* @@ -2089,7 +2029,9 @@ public final class AutomationsDeleteSamples { * @param manager Entry point to SecurityManager. */ public static void deleteASecurityAutomation(com.azure.resourcemanager.security.SecurityManager manager) { - manager.automations().deleteByResourceGroupWithResponse("myRg", "myAutomationName", Context.NONE); + manager + .automations() + .deleteByResourceGroupWithResponse("myRg", "myAutomationName", com.azure.core.util.Context.NONE); } } ``` @@ -2097,8 +2039,6 @@ public final class AutomationsDeleteSamples { ### Automations_GetByResourceGroup ```java -import com.azure.core.util.Context; - /** Samples for Automations GetByResourceGroup. */ public final class AutomationsGetByResourceGroupSamples { /* @@ -2110,7 +2050,10 @@ public final class AutomationsGetByResourceGroupSamples { * @param manager Entry point to SecurityManager. */ public static void retrieveASecurityAutomation(com.azure.resourcemanager.security.SecurityManager manager) { - manager.automations().getByResourceGroupWithResponse("exampleResourceGroup", "exampleAutomation", Context.NONE); + manager + .automations() + .getByResourceGroupWithResponse( + "exampleResourceGroup", "exampleAutomation", com.azure.core.util.Context.NONE); } } ``` @@ -2118,8 +2061,6 @@ public final class AutomationsGetByResourceGroupSamples { ### Automations_List ```java -import com.azure.core.util.Context; - /** Samples for Automations List. */ public final class AutomationsListSamples { /* @@ -2132,7 +2073,7 @@ public final class AutomationsListSamples { */ public static void listAllSecurityAutomationsOfASpecifiedSubscription( com.azure.resourcemanager.security.SecurityManager manager) { - manager.automations().list(Context.NONE); + manager.automations().list(com.azure.core.util.Context.NONE); } } ``` @@ -2140,8 +2081,6 @@ public final class AutomationsListSamples { ### Automations_ListByResourceGroup ```java -import com.azure.core.util.Context; - /** Samples for Automations ListByResourceGroup. */ public final class AutomationsListByResourceGroupSamples { /* @@ -2154,7 +2093,7 @@ public final class AutomationsListByResourceGroupSamples { */ public static void listAllSecurityAutomationsOfASpecifiedResourceGroup( com.azure.resourcemanager.security.SecurityManager manager) { - manager.automations().listByResourceGroup("exampleResourceGroup", Context.NONE); + manager.automations().listByResourceGroup("exampleResourceGroup", com.azure.core.util.Context.NONE); } } ``` @@ -2162,7 +2101,6 @@ public final class AutomationsListByResourceGroupSamples { ### Automations_Validate ```java -import com.azure.core.util.Context; import com.azure.resourcemanager.security.fluent.models.AutomationInner; import com.azure.resourcemanager.security.models.AutomationActionLogicApp; import com.azure.resourcemanager.security.models.AutomationRuleSet; @@ -2172,8 +2110,6 @@ import com.azure.resourcemanager.security.models.AutomationTriggeringRule; import com.azure.resourcemanager.security.models.EventSource; import com.azure.resourcemanager.security.models.Operator; import com.azure.resourcemanager.security.models.PropertyType; -import java.io.IOException; -import java.net.URL; import java.util.Arrays; import java.util.HashMap; import java.util.Map; @@ -2189,7 +2125,7 @@ public final class AutomationsValidateSamples { * @param manager Entry point to SecurityManager. */ public static void validateTheSecurityAutomationModelBeforeCreateOrUpdate( - com.azure.resourcemanager.security.SecurityManager manager) throws IOException { + com.azure.resourcemanager.security.SecurityManager manager) { manager .automations() .validateWithResponse( @@ -2235,8 +2171,8 @@ public final class AutomationsValidateSamples { new AutomationActionLogicApp() .withLogicAppResourceId( "/subscriptions/e54a4a18-5b94-4f90-9471-bd3decad8a2e/resourceGroups/sample/providers/Microsoft.Logic/workflows/MyTest1") - .withUri(new URL("https://exampleTriggerUri1.com")))), - Context.NONE); + .withUri("https://exampleTriggerUri1.com"))), + com.azure.core.util.Context.NONE); } @SuppressWarnings("unchecked") @@ -2255,8 +2191,6 @@ public final class AutomationsValidateSamples { ### ComplianceResults_Get ```java -import com.azure.core.util.Context; - /** Samples for ComplianceResults Get. */ public final class ComplianceResultsGetSamples { /* @@ -2271,7 +2205,9 @@ public final class ComplianceResultsGetSamples { manager .complianceResults() .getWithResponse( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", "DesignateMoreThanOneOwner", Context.NONE); + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", + "DesignateMoreThanOneOwner", + com.azure.core.util.Context.NONE); } } ``` @@ -2279,8 +2215,6 @@ public final class ComplianceResultsGetSamples { ### ComplianceResults_List ```java -import com.azure.core.util.Context; - /** Samples for ComplianceResults List. */ public final class ComplianceResultsListSamples { /* @@ -2292,7 +2226,9 @@ public final class ComplianceResultsListSamples { * @param manager Entry point to SecurityManager. */ public static void getComplianceResultsOnSubscription(com.azure.resourcemanager.security.SecurityManager manager) { - manager.complianceResults().list("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", Context.NONE); + manager + .complianceResults() + .list("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", com.azure.core.util.Context.NONE); } } ``` @@ -2300,8 +2236,6 @@ public final class ComplianceResultsListSamples { ### Compliances_Get ```java -import com.azure.core.util.Context; - /** Samples for Compliances Get. */ public final class CompliancesGetSamples { /* @@ -2315,7 +2249,8 @@ public final class CompliancesGetSamples { public static void getSecurityComplianceDataForADay(com.azure.resourcemanager.security.SecurityManager manager) { manager .compliances() - .getWithResponse("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", "2018-01-01Z", Context.NONE); + .getWithResponse( + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", "2018-01-01Z", com.azure.core.util.Context.NONE); } } ``` @@ -2323,8 +2258,6 @@ public final class CompliancesGetSamples { ### Compliances_List ```java -import com.azure.core.util.Context; - /** Samples for Compliances List. */ public final class CompliancesListSamples { /* @@ -2336,7 +2269,9 @@ public final class CompliancesListSamples { * @param manager Entry point to SecurityManager. */ public static void getSecurityComplianceDataOverTime(com.azure.resourcemanager.security.SecurityManager manager) { - manager.compliances().list("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", Context.NONE); + manager + .compliances() + .list("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", com.azure.core.util.Context.NONE); } } ``` @@ -2450,8 +2385,6 @@ public final class ConnectorsCreateOrUpdateSamples { ### Connectors_Delete ```java -import com.azure.core.util.Context; - /** Samples for Connectors Delete. */ public final class ConnectorsDeleteSamples { /* @@ -2464,7 +2397,7 @@ public final class ConnectorsDeleteSamples { */ public static void deleteACloudAccountConnectorFromASubscription( com.azure.resourcemanager.security.SecurityManager manager) { - manager.connectors().deleteWithResponse("aws_dev1", Context.NONE); + manager.connectors().deleteWithResponse("aws_dev1", com.azure.core.util.Context.NONE); } } ``` @@ -2472,8 +2405,6 @@ public final class ConnectorsDeleteSamples { ### Connectors_Get ```java -import com.azure.core.util.Context; - /** Samples for Connectors Get. */ public final class ConnectorsGetSamples { /* @@ -2486,7 +2417,7 @@ public final class ConnectorsGetSamples { */ public static void detailsOfASpecificCloudAccountConnector( com.azure.resourcemanager.security.SecurityManager manager) { - manager.connectors().getWithResponse("aws_dev1", Context.NONE); + manager.connectors().getWithResponse("aws_dev1", com.azure.core.util.Context.NONE); } } ``` @@ -2494,8 +2425,6 @@ public final class ConnectorsGetSamples { ### Connectors_List ```java -import com.azure.core.util.Context; - /** Samples for Connectors List. */ public final class ConnectorsListSamples { /* @@ -2508,7 +2437,7 @@ public final class ConnectorsListSamples { */ public static void getAllCloudAccountsConnectorsOfASubscription( com.azure.resourcemanager.security.SecurityManager manager) { - manager.connectors().list(Context.NONE); + manager.connectors().list(com.azure.core.util.Context.NONE); } } ``` @@ -2549,8 +2478,6 @@ public final class CustomAssessmentAutomationsCreateSamples { ### CustomAssessmentAutomations_Delete ```java -import com.azure.core.util.Context; - /** Samples for CustomAssessmentAutomations Delete. */ public final class CustomAssessmentAutomationsDeleteSamples { /* @@ -2564,7 +2491,8 @@ public final class CustomAssessmentAutomationsDeleteSamples { public static void deleteACustomAssessmentAutomation(com.azure.resourcemanager.security.SecurityManager manager) { manager .customAssessmentAutomations() - .deleteByResourceGroupWithResponse("TestResourceGroup", "MyCustomAssessmentAutomation", Context.NONE); + .deleteByResourceGroupWithResponse( + "TestResourceGroup", "MyCustomAssessmentAutomation", com.azure.core.util.Context.NONE); } } ``` @@ -2572,8 +2500,6 @@ public final class CustomAssessmentAutomationsDeleteSamples { ### CustomAssessmentAutomations_GetByResourceGroup ```java -import com.azure.core.util.Context; - /** Samples for CustomAssessmentAutomations GetByResourceGroup. */ public final class CustomAssessmentAutomationsGetByResourceGroupSamples { /* @@ -2587,7 +2513,8 @@ public final class CustomAssessmentAutomationsGetByResourceGroupSamples { public static void getACustomAssessmentAutomation(com.azure.resourcemanager.security.SecurityManager manager) { manager .customAssessmentAutomations() - .getByResourceGroupWithResponse("TestResourceGroup", "MyCustomAssessmentAutomation", Context.NONE); + .getByResourceGroupWithResponse( + "TestResourceGroup", "MyCustomAssessmentAutomation", com.azure.core.util.Context.NONE); } } ``` @@ -2595,8 +2522,6 @@ public final class CustomAssessmentAutomationsGetByResourceGroupSamples { ### CustomAssessmentAutomations_List ```java -import com.azure.core.util.Context; - /** Samples for CustomAssessmentAutomations List. */ public final class CustomAssessmentAutomationsListSamples { /* @@ -2609,7 +2534,7 @@ public final class CustomAssessmentAutomationsListSamples { */ public static void listCustomAssessmentAutomationsInASubscription( com.azure.resourcemanager.security.SecurityManager manager) { - manager.customAssessmentAutomations().list(Context.NONE); + manager.customAssessmentAutomations().list(com.azure.core.util.Context.NONE); } } ``` @@ -2617,8 +2542,6 @@ public final class CustomAssessmentAutomationsListSamples { ### CustomAssessmentAutomations_ListByResourceGroup ```java -import com.azure.core.util.Context; - /** Samples for CustomAssessmentAutomations ListByResourceGroup. */ public final class CustomAssessmentAutomationsListByResourceGroupSamples { /* @@ -2631,7 +2554,9 @@ public final class CustomAssessmentAutomationsListByResourceGroupSamples { */ public static void listCustomAssessmentAutomationsInASubscriptionAndAResourceGroup( com.azure.resourcemanager.security.SecurityManager manager) { - manager.customAssessmentAutomations().listByResourceGroup("TestResourceGroup", Context.NONE); + manager + .customAssessmentAutomations() + .listByResourceGroup("TestResourceGroup", com.azure.core.util.Context.NONE); } } ``` @@ -2663,8 +2588,6 @@ public final class CustomEntityStoreAssignmentsCreateSamples { ### CustomEntityStoreAssignments_Delete ```java -import com.azure.core.util.Context; - /** Samples for CustomEntityStoreAssignments Delete. */ public final class CustomEntityStoreAssignmentsDeleteSamples { /* @@ -2679,7 +2602,7 @@ public final class CustomEntityStoreAssignmentsDeleteSamples { manager .customEntityStoreAssignments() .deleteByResourceGroupWithResponse( - "TestResourceGroup", "33e7cc6e-a139-4723-a0e5-76993aee0771", Context.NONE); + "TestResourceGroup", "33e7cc6e-a139-4723-a0e5-76993aee0771", com.azure.core.util.Context.NONE); } } ``` @@ -2687,8 +2610,6 @@ public final class CustomEntityStoreAssignmentsDeleteSamples { ### CustomEntityStoreAssignments_GetByResourceGroup ```java -import com.azure.core.util.Context; - /** Samples for CustomEntityStoreAssignments GetByResourceGroup. */ public final class CustomEntityStoreAssignmentsGetByResourceGroupSamples { /* @@ -2702,7 +2623,8 @@ public final class CustomEntityStoreAssignmentsGetByResourceGroupSamples { public static void getACustomEntityStoreAssignment(com.azure.resourcemanager.security.SecurityManager manager) { manager .customEntityStoreAssignments() - .getByResourceGroupWithResponse("TestResourceGroup", "33e7cc6e-a139-4723-a0e5-76993aee0771", Context.NONE); + .getByResourceGroupWithResponse( + "TestResourceGroup", "33e7cc6e-a139-4723-a0e5-76993aee0771", com.azure.core.util.Context.NONE); } } ``` @@ -2710,8 +2632,6 @@ public final class CustomEntityStoreAssignmentsGetByResourceGroupSamples { ### CustomEntityStoreAssignments_List ```java -import com.azure.core.util.Context; - /** Samples for CustomEntityStoreAssignments List. */ public final class CustomEntityStoreAssignmentsListSamples { /* @@ -2724,7 +2644,7 @@ public final class CustomEntityStoreAssignmentsListSamples { */ public static void listCustomEntityStoreAssignmentsInASubscription( com.azure.resourcemanager.security.SecurityManager manager) { - manager.customEntityStoreAssignments().list(Context.NONE); + manager.customEntityStoreAssignments().list(com.azure.core.util.Context.NONE); } } ``` @@ -2732,8 +2652,6 @@ public final class CustomEntityStoreAssignmentsListSamples { ### CustomEntityStoreAssignments_ListByResourceGroup ```java -import com.azure.core.util.Context; - /** Samples for CustomEntityStoreAssignments ListByResourceGroup. */ public final class CustomEntityStoreAssignmentsListByResourceGroupSamples { /* @@ -2746,7 +2664,9 @@ public final class CustomEntityStoreAssignmentsListByResourceGroupSamples { */ public static void listCustomEntityStoreAssignmentsInASubscriptionAndAResourceGroup( com.azure.resourcemanager.security.SecurityManager manager) { - manager.customEntityStoreAssignments().listByResourceGroup("TestResourceGroup", Context.NONE); + manager + .customEntityStoreAssignments() + .listByResourceGroup("TestResourceGroup", com.azure.core.util.Context.NONE); } } ``` @@ -2791,8 +2711,6 @@ public final class DeviceSecurityGroupsCreateOrUpdateSamples { ### DeviceSecurityGroups_Delete ```java -import com.azure.core.util.Context; - /** Samples for DeviceSecurityGroups Delete. */ public final class DeviceSecurityGroupsDeleteSamples { /* @@ -2810,7 +2728,7 @@ public final class DeviceSecurityGroupsDeleteSamples { .deleteByResourceGroupWithResponse( "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Devices/iotHubs/sampleiothub", "samplesecuritygroup", - Context.NONE); + com.azure.core.util.Context.NONE); } } ``` @@ -2818,8 +2736,6 @@ public final class DeviceSecurityGroupsDeleteSamples { ### DeviceSecurityGroups_Get ```java -import com.azure.core.util.Context; - /** Samples for DeviceSecurityGroups Get. */ public final class DeviceSecurityGroupsGetSamples { /* @@ -2837,7 +2753,7 @@ public final class DeviceSecurityGroupsGetSamples { .getWithResponse( "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Devices/iotHubs/sampleiothub", "samplesecuritygroup", - Context.NONE); + com.azure.core.util.Context.NONE); } } ``` @@ -2845,8 +2761,6 @@ public final class DeviceSecurityGroupsGetSamples { ### DeviceSecurityGroups_List ```java -import com.azure.core.util.Context; - /** Samples for DeviceSecurityGroups List. */ public final class DeviceSecurityGroupsListSamples { /* @@ -2863,7 +2777,7 @@ public final class DeviceSecurityGroupsListSamples { .deviceSecurityGroups() .list( "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Devices/iotHubs/sampleiothub", - Context.NONE); + com.azure.core.util.Context.NONE); } } ``` @@ -2871,8 +2785,6 @@ public final class DeviceSecurityGroupsListSamples { ### DiscoveredSecuritySolutions_Get ```java -import com.azure.core.util.Context; - /** Samples for DiscoveredSecuritySolutions Get. */ public final class DiscoveredSecuritySolutionsGetSamples { /* @@ -2885,7 +2797,9 @@ public final class DiscoveredSecuritySolutionsGetSamples { */ public static void getDiscoveredSecuritySolutionFromASecurityDataLocation( com.azure.resourcemanager.security.SecurityManager manager) { - manager.discoveredSecuritySolutions().getWithResponse("myRg2", "centralus", "paloalto7", Context.NONE); + manager + .discoveredSecuritySolutions() + .getWithResponse("myRg2", "centralus", "paloalto7", com.azure.core.util.Context.NONE); } } ``` @@ -2893,8 +2807,6 @@ public final class DiscoveredSecuritySolutionsGetSamples { ### DiscoveredSecuritySolutions_List ```java -import com.azure.core.util.Context; - /** Samples for DiscoveredSecuritySolutions List. */ public final class DiscoveredSecuritySolutionsListSamples { /* @@ -2906,7 +2818,7 @@ public final class DiscoveredSecuritySolutionsListSamples { * @param manager Entry point to SecurityManager. */ public static void getDiscoveredSecuritySolutions(com.azure.resourcemanager.security.SecurityManager manager) { - manager.discoveredSecuritySolutions().list(Context.NONE); + manager.discoveredSecuritySolutions().list(com.azure.core.util.Context.NONE); } } ``` @@ -2914,8 +2826,6 @@ public final class DiscoveredSecuritySolutionsListSamples { ### DiscoveredSecuritySolutions_ListByHomeRegion ```java -import com.azure.core.util.Context; - /** Samples for DiscoveredSecuritySolutions ListByHomeRegion. */ public final class DiscoveredSecuritySolutionsListByHomeRegionSamples { /* @@ -2928,7 +2838,7 @@ public final class DiscoveredSecuritySolutionsListByHomeRegionSamples { */ public static void getDiscoveredSecuritySolutionsFromASecurityDataLocation( com.azure.resourcemanager.security.SecurityManager manager) { - manager.discoveredSecuritySolutions().listByHomeRegion("centralus", Context.NONE); + manager.discoveredSecuritySolutions().listByHomeRegion("centralus", com.azure.core.util.Context.NONE); } } ``` @@ -2936,8 +2846,6 @@ public final class DiscoveredSecuritySolutionsListByHomeRegionSamples { ### ExternalSecuritySolutions_Get ```java -import com.azure.core.util.Context; - /** Samples for ExternalSecuritySolutions Get. */ public final class ExternalSecuritySolutionsGetSamples { /* @@ -2955,7 +2863,7 @@ public final class ExternalSecuritySolutionsGetSamples { "defaultresourcegroup-eus", "centralus", "aad_defaultworkspace-20ff7fc3-e762-44dd-bd96-b71116dcdc23-eus", - Context.NONE); + com.azure.core.util.Context.NONE); } } ``` @@ -2963,8 +2871,6 @@ public final class ExternalSecuritySolutionsGetSamples { ### ExternalSecuritySolutions_List ```java -import com.azure.core.util.Context; - /** Samples for ExternalSecuritySolutions List. */ public final class ExternalSecuritySolutionsListSamples { /* @@ -2977,7 +2883,7 @@ public final class ExternalSecuritySolutionsListSamples { */ public static void getExternalSecuritySolutionsOnASubscription( com.azure.resourcemanager.security.SecurityManager manager) { - manager.externalSecuritySolutions().list(Context.NONE); + manager.externalSecuritySolutions().list(com.azure.core.util.Context.NONE); } } ``` @@ -2985,8 +2891,6 @@ public final class ExternalSecuritySolutionsListSamples { ### ExternalSecuritySolutions_ListByHomeRegion ```java -import com.azure.core.util.Context; - /** Samples for ExternalSecuritySolutions ListByHomeRegion. */ public final class ExternalSecuritySolutionsListByHomeRegionSamples { /* @@ -2999,7 +2903,7 @@ public final class ExternalSecuritySolutionsListByHomeRegionSamples { */ public static void getExternalSecuritySolutionsOnASubscriptionFromSecurityDataLocation( com.azure.resourcemanager.security.SecurityManager manager) { - manager.externalSecuritySolutions().listByHomeRegion("centralus", Context.NONE); + manager.externalSecuritySolutions().listByHomeRegion("centralus", com.azure.core.util.Context.NONE); } } ``` @@ -3053,8 +2957,6 @@ public final class GovernanceAssignmentsCreateOrUpdateSamples { ### GovernanceAssignments_Delete ```java -import com.azure.core.util.Context; - /** Samples for GovernanceAssignments Delete. */ public final class GovernanceAssignmentsDeleteSamples { /* @@ -3072,7 +2974,7 @@ public final class GovernanceAssignmentsDeleteSamples { "subscriptions/c32e05d9-7207-4e22-bdf4-4f7d9c72e5fd/resourceGroups/compute_servers/providers/Microsoft.Compute/virtualMachines/win2012", "6b9421dd-5555-2251-9b3d-2be58e2f82cd", "6634ff9f-127b-4bf2-8e6e-b1737f5e789c", - Context.NONE); + com.azure.core.util.Context.NONE); } } ``` @@ -3080,19 +2982,17 @@ public final class GovernanceAssignmentsDeleteSamples { ### GovernanceAssignments_Get ```java -import com.azure.core.util.Context; - /** Samples for GovernanceAssignments Get. */ public final class GovernanceAssignmentsGetSamples { /* * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceAssignments/GetGovernanceAssignment_example.json */ /** - * Sample code: Get security governanceAssignment by specific governanceAssignmentKey. + * Sample code: Get governanceAssignment by specific governanceAssignmentKey. * * @param manager Entry point to SecurityManager. */ - public static void getSecurityGovernanceAssignmentBySpecificGovernanceAssignmentKey( + public static void getGovernanceAssignmentBySpecificGovernanceAssignmentKey( com.azure.resourcemanager.security.SecurityManager manager) { manager .governanceAssignments() @@ -3100,7 +3000,7 @@ public final class GovernanceAssignmentsGetSamples { "subscriptions/c32e05d9-7207-4e22-bdf4-4f7d9c72e5fd/resourceGroups/compute_servers/providers/Microsoft.Compute/virtualMachines/win2012", "6b9421dd-5555-2251-9b3d-2be58e2f82cd", "6634ff9f-127b-4bf2-8e6e-b1737f5e789c", - Context.NONE); + com.azure.core.util.Context.NONE); } } ``` @@ -3108,52 +3008,28 @@ public final class GovernanceAssignmentsGetSamples { ### GovernanceAssignments_List ```java -import com.azure.core.util.Context; - /** Samples for GovernanceAssignments List. */ public final class GovernanceAssignmentsListSamples { /* * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceAssignments/ListGovernanceAssignments_example.json */ /** - * Sample code: List security governanceAssignments. + * Sample code: List governance assignments. * * @param manager Entry point to SecurityManager. */ - public static void listSecurityGovernanceAssignments(com.azure.resourcemanager.security.SecurityManager manager) { + public static void listGovernanceAssignments(com.azure.resourcemanager.security.SecurityManager manager) { manager .governanceAssignments() .list( "subscriptions/c32e05d9-7207-4e22-bdf4-4f7d9c72e5fd", "6b9421dd-5555-2251-9b3d-2be58e2f82cd", - Context.NONE); - } -} -``` - -### GovernanceRule_List - -```java -import com.azure.core.util.Context; - -/** Samples for GovernanceRule List. */ -public final class GovernanceRuleListSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/ListBySubscriptionGovernanceRules_example.json - */ - /** - * Sample code: List security governanceRules by subscription level scope. - * - * @param manager Entry point to SecurityManager. - */ - public static void listSecurityGovernanceRulesBySubscriptionLevelScope( - com.azure.resourcemanager.security.SecurityManager manager) { - manager.governanceRules().list(Context.NONE); + com.azure.core.util.Context.NONE); } } ``` -### GovernanceRulesOperation_CreateOrUpdate +### GovernanceRules_CreateOrUpdate ```java import com.azure.core.management.serializer.SerializerFactory; @@ -3166,23 +3042,112 @@ import com.azure.resourcemanager.security.models.GovernanceRuleType; import java.io.IOException; import java.util.Arrays; -/** Samples for GovernanceRulesOperation CreateOrUpdate. */ -public final class GovernanceRulesOperationCreateOrUpdateSamples { +/** Samples for GovernanceRules CreateOrUpdate. */ +public final class GovernanceRulesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/PutManagementGroupGovernanceRule_example.json + */ + /** + * Sample code: Create or update governance rule over management group scope. + * + * @param manager Entry point to SecurityManager. + */ + public static void createOrUpdateGovernanceRuleOverManagementGroupScope( + com.azure.resourcemanager.security.SecurityManager manager) throws IOException { + manager + .governanceRules() + .define("ad9a8e26-29d9-4829-bb30-e597a58cdbb8") + .withExistingScope("providers/Microsoft.Management/managementGroups/contoso") + .withDisplayName("Management group rule") + .withDescription("A rule for a management group") + .withRemediationTimeframe("7.00:00:00") + .withIsGracePeriod(true) + .withRulePriority(200) + .withIsDisabled(false) + .withRuleType(GovernanceRuleType.INTEGRATED) + .withSourceResourceType(GovernanceRuleSourceResourceType.ASSESSMENTS) + .withExcludedScopes(Arrays.asList("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23")) + .withConditionSets( + Arrays + .asList( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize( + "{\"conditions\":[{\"operator\":\"In\",\"property\":\"$.AssessmentKey\",\"value\":\"[\\\"b1cd27e0-4ecc-4246-939f-49c426d9d72f\\\"," + + " \\\"fe83f80b-073d-4ccf-93d9-6797eb870201\\\"]\"}]}", + Object.class, + SerializerEncoding.JSON))) + .withOwnerSource( + new GovernanceRuleOwnerSource() + .withType(GovernanceRuleOwnerSourceType.MANUALLY) + .withValue("user@contoso.com")) + .withGovernanceEmailNotification( + new GovernanceRuleEmailNotification() + .withDisableManagerEmailNotification(true) + .withDisableOwnerEmailNotification(false)) + .create(); + } + + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/PutSecurityConnectorGovernanceRule_example.json + */ + /** + * Sample code: Create or update governance rule over security connector scope. + * + * @param manager Entry point to SecurityManager. + */ + public static void createOrUpdateGovernanceRuleOverSecurityConnectorScope( + com.azure.resourcemanager.security.SecurityManager manager) throws IOException { + manager + .governanceRules() + .define("ad9a8e26-29d9-4829-bb30-e597a58cdbb8") + .withExistingScope( + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/gcpResourceGroup/providers/Microsoft.Security/securityConnectors/gcpconnector") + .withDisplayName("GCP Admin's rule") + .withDescription("A rule on critical GCP recommendations") + .withRemediationTimeframe("7.00:00:00") + .withIsGracePeriod(true) + .withRulePriority(200) + .withIsDisabled(false) + .withRuleType(GovernanceRuleType.INTEGRATED) + .withSourceResourceType(GovernanceRuleSourceResourceType.ASSESSMENTS) + .withConditionSets( + Arrays + .asList( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize( + "{\"conditions\":[{\"operator\":\"In\",\"property\":\"$.AssessmentKey\",\"value\":\"[\\\"b1cd27e0-4ecc-4246-939f-49c426d9d72f\\\"," + + " \\\"fe83f80b-073d-4ccf-93d9-6797eb870201\\\"]\"}]}", + Object.class, + SerializerEncoding.JSON))) + .withOwnerSource( + new GovernanceRuleOwnerSource() + .withType(GovernanceRuleOwnerSourceType.MANUALLY) + .withValue("user@contoso.com")) + .withGovernanceEmailNotification( + new GovernanceRuleEmailNotification() + .withDisableManagerEmailNotification(true) + .withDisableOwnerEmailNotification(false)) + .create(); + } + /* * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/PutGovernanceRule_example.json */ /** - * Sample code: Create Governance rule. + * Sample code: Create or update governance rule over subscription scope. * * @param manager Entry point to SecurityManager. */ - public static void createGovernanceRule(com.azure.resourcemanager.security.SecurityManager manager) - throws IOException { + public static void createOrUpdateGovernanceRuleOverSubscriptionScope( + com.azure.resourcemanager.security.SecurityManager manager) throws IOException { manager - .governanceRulesOperations() + .governanceRules() .define("ad9a8e26-29d9-4829-bb30-e597a58cdbb8") + .withExistingScope("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23") .withDisplayName("Admin's rule") - .withDescription("A rule on critical recommendations") + .withDescription("A rule for critical recommendations") .withRemediationTimeframe("7.00:00:00") .withIsGracePeriod(true) .withRulePriority(200) @@ -3212,94 +3177,353 @@ public final class GovernanceRulesOperationCreateOrUpdateSamples { } ``` -### GovernanceRulesOperation_Delete +### GovernanceRules_Delete ```java -import com.azure.core.util.Context; +/** Samples for GovernanceRules Delete. */ +public final class GovernanceRulesDeleteSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/DeleteManagementGroupGovernanceRule_example.json + */ + /** + * Sample code: Delete a Governance rule over management group scope. + * + * @param manager Entry point to SecurityManager. + */ + public static void deleteAGovernanceRuleOverManagementGroupScope( + com.azure.resourcemanager.security.SecurityManager manager) { + manager + .governanceRules() + .delete( + "providers/Microsoft.Management/managementGroups/contoso", + "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", + com.azure.core.util.Context.NONE); + } -/** Samples for GovernanceRulesOperation Delete. */ -public final class GovernanceRulesOperationDeleteSamples { /* * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/DeleteGovernanceRule_example.json */ /** - * Sample code: Delete security GovernanceRule. + * Sample code: Delete a Governance rule over subscription scope. * * @param manager Entry point to SecurityManager. */ - public static void deleteSecurityGovernanceRule(com.azure.resourcemanager.security.SecurityManager manager) { - manager.governanceRulesOperations().deleteWithResponse("ad9a8e26-29d9-4829-bb30-e597a58cdbb8", Context.NONE); + public static void deleteAGovernanceRuleOverSubscriptionScope( + com.azure.resourcemanager.security.SecurityManager manager) { + manager + .governanceRules() + .delete( + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", + "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", + com.azure.core.util.Context.NONE); } -} -``` - -### GovernanceRulesOperation_Get - -```java -import com.azure.core.util.Context; -/** Samples for GovernanceRulesOperation Get. */ -public final class GovernanceRulesOperationGetSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/GetGovernanceRule_example.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/DeleteSecurityConnectorGovernanceRule_example.json */ /** - * Sample code: Get security governanceRules by specific governanceRuleId. + * Sample code: Delete a Governance rule over security connector scope. * * @param manager Entry point to SecurityManager. */ - public static void getSecurityGovernanceRulesBySpecificGovernanceRuleId( + public static void deleteAGovernanceRuleOverSecurityConnectorScope( com.azure.resourcemanager.security.SecurityManager manager) { - manager.governanceRulesOperations().getWithResponse("ad9a8e26-29d9-4829-bb30-e597a58cdbb8", Context.NONE); + manager + .governanceRules() + .delete( + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/gcpResourceGroup/providers/Microsoft.Security/securityConnectors/gcpconnector", + "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", + com.azure.core.util.Context.NONE); } } ``` -### GovernanceRulesOperation_RuleIdExecuteSingleSecurityConnector +### GovernanceRules_Execute ```java -import com.azure.core.util.Context; - -/** Samples for GovernanceRulesOperation RuleIdExecuteSingleSecurityConnector. */ -public final class GovernanceRulesOperationRuleIdExecuteSingleSecurityConnectorSamples { +/** Samples for GovernanceRules Execute. */ +public final class GovernanceRulesExecuteSamples { /* * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/PostSecurityConnectorGovernanceRule_example.json */ /** - * Sample code: Execute Governance rule. + * Sample code: Execute governance rule over security connector scope. * * @param manager Entry point to SecurityManager. */ - public static void executeGovernanceRule(com.azure.resourcemanager.security.SecurityManager manager) { + public static void executeGovernanceRuleOverSecurityConnectorScope( + com.azure.resourcemanager.security.SecurityManager manager) { manager - .governanceRulesOperations() - .ruleIdExecuteSingleSecurityConnector( - "gcpResourceGroup", "gcpconnector", "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", null, Context.NONE); + .governanceRules() + .execute( + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/gcpResourceGroup/providers/Microsoft.Security/securityConnectors/gcpconnector", + "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", + null, + com.azure.core.util.Context.NONE); } -} -``` - -### GovernanceRulesOperation_RuleIdExecuteSingleSubscription - -```java -import com.azure.core.util.Context; -/** Samples for GovernanceRulesOperation RuleIdExecuteSingleSubscription. */ -public final class GovernanceRulesOperationRuleIdExecuteSingleSubscriptionSamples { /* * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/PostGovernanceRule_example.json */ /** - * Sample code: Execute Governance rule. + * Sample code: Execute Governance rule over subscription scope. * * @param manager Entry point to SecurityManager. */ - public static void executeGovernanceRule(com.azure.resourcemanager.security.SecurityManager manager) { + public static void executeGovernanceRuleOverSubscriptionScope( + com.azure.resourcemanager.security.SecurityManager manager) { manager - .governanceRulesOperations() - .ruleIdExecuteSingleSubscription("ad9a8e26-29d9-4829-bb30-e597a58cdbb8", null, Context.NONE); - } -} + .governanceRules() + .execute( + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", + "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", + null, + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/PostManagementGroupGovernanceRule_example.json + */ + /** + * Sample code: Execute governance rule over management group scope. + * + * @param manager Entry point to SecurityManager. + */ + public static void executeGovernanceRuleOverManagementGroupScope( + com.azure.resourcemanager.security.SecurityManager manager) { + manager + .governanceRules() + .execute( + "providers/Microsoft.Management/managementGroups/contoso", + "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", + null, + com.azure.core.util.Context.NONE); + } +} +``` + +### GovernanceRules_Get + +```java +/** Samples for GovernanceRules Get. */ +public final class GovernanceRulesGetSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/GetManagementGroupGovernanceRule_example.json + */ + /** + * Sample code: Get a governance rule over management group scope. + * + * @param manager Entry point to SecurityManager. + */ + public static void getAGovernanceRuleOverManagementGroupScope( + com.azure.resourcemanager.security.SecurityManager manager) { + manager + .governanceRules() + .getWithResponse( + "providers/Microsoft.Management/managementGroups/contoso", + "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/GetGovernanceRule_example.json + */ + /** + * Sample code: Get a governance rule over subscription scope. + * + * @param manager Entry point to SecurityManager. + */ + public static void getAGovernanceRuleOverSubscriptionScope( + com.azure.resourcemanager.security.SecurityManager manager) { + manager + .governanceRules() + .getWithResponse( + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", + "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/GetSecurityConnectorGovernanceRule_example.json + */ + /** + * Sample code: Get a governance rule over security connector scope. + * + * @param manager Entry point to SecurityManager. + */ + public static void getAGovernanceRuleOverSecurityConnectorScope( + com.azure.resourcemanager.security.SecurityManager manager) { + manager + .governanceRules() + .getWithResponse( + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/gcpResourceGroup/providers/Microsoft.Security/securityConnectors/gcpconnector", + "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", + com.azure.core.util.Context.NONE); + } +} +``` + +### GovernanceRules_List + +```java +/** Samples for GovernanceRules List. */ +public final class GovernanceRulesListSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/ListBySubscriptionGovernanceRules_example.json + */ + /** + * Sample code: List governance rules by subscription scope. + * + * @param manager Entry point to SecurityManager. + */ + public static void listGovernanceRulesBySubscriptionScope( + com.azure.resourcemanager.security.SecurityManager manager) { + manager + .governanceRules() + .list("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/ListBySecurityConnectorGovernanceRules_example.json + */ + /** + * Sample code: List governance rules by security connector scope. + * + * @param manager Entry point to SecurityManager. + */ + public static void listGovernanceRulesBySecurityConnectorScope( + com.azure.resourcemanager.security.SecurityManager manager) { + manager + .governanceRules() + .list( + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/gcpResourceGroup/providers/Microsoft.Security/securityConnectors/gcpconnector", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/ListByManagementGroupGovernanceRules_example.json + */ + /** + * Sample code: List governance rules by management group scope. + * + * @param manager Entry point to SecurityManager. + */ + public static void listGovernanceRulesByManagementGroupScope( + com.azure.resourcemanager.security.SecurityManager manager) { + manager + .governanceRules() + .list("providers/Microsoft.Management/managementGroups/contoso", com.azure.core.util.Context.NONE); + } +} +``` + +### GovernanceRules_OperationResults + +```java +/** Samples for GovernanceRules OperationResults. */ +public final class GovernanceRulesOperationResultsSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/GetManagementGroupGovernanceRuleExecuteStatus_example.json + */ + /** + * Sample code: Get governance rules long run operation result over management group. + * + * @param manager Entry point to SecurityManager. + */ + public static void getGovernanceRulesLongRunOperationResultOverManagementGroup( + com.azure.resourcemanager.security.SecurityManager manager) { + manager + .governanceRules() + .operationResultsWithResponse( + "providers/Microsoft.Management/managementGroups/contoso", + "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", + "58b33f4f-c8c7-4b01-99cc-d437db4d40dd", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/GetSecurityConnectorGovernanceRuleExecuteStatus_example.json + */ + /** + * Sample code: Get governance rules long run operation result over security connector. + * + * @param manager Entry point to SecurityManager. + */ + public static void getGovernanceRulesLongRunOperationResultOverSecurityConnector( + com.azure.resourcemanager.security.SecurityManager manager) { + manager + .governanceRules() + .operationResultsWithResponse( + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/gcpResourceGroup/providers/Microsoft.Security/securityConnectors/gcpconnector", + "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", + "58b33f4f-c8c7-4b01-99cc-d437db4d40dd", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/GetGovernanceRuleExecuteStatus_example.json + */ + /** + * Sample code: Get governance rules long run operation result over subscription. + * + * @param manager Entry point to SecurityManager. + */ + public static void getGovernanceRulesLongRunOperationResultOverSubscription( + com.azure.resourcemanager.security.SecurityManager manager) { + manager + .governanceRules() + .operationResultsWithResponse( + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", + "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", + "58b33f4f-c8c7-4b01-99cc-d437db4d40dd", + com.azure.core.util.Context.NONE); + } +} +``` + +### HealthReportOperation_Get + +```java +/** Samples for HealthReportOperation Get. */ +public final class HealthReportOperationGetSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-02-01-preview/examples/HealthReports/GetHealthReport_example.json + */ + /** + * Sample code: Get health report of resource. + * + * @param manager Entry point to SecurityManager. + */ + public static void getHealthReportOfResource(com.azure.resourcemanager.security.SecurityManager manager) { + manager + .healthReportOperations() + .getWithResponse( + "subscriptions/a1efb6ca-fbc5-4782-9aaa-5c7daded1ce2/resourcegroups/E2E-IBB0WX/providers/Microsoft.Security/securityconnectors/AwsConnectorAllOfferings", + "909c629a-bf39-4521-8e4f-10b443a0bc02", + com.azure.core.util.Context.NONE); + } +} +``` + +### HealthReports_List + +```java +/** Samples for HealthReports List. */ +public final class HealthReportsListSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-02-01-preview/examples/HealthReports/ListHealthReports_example.json + */ + /** + * Sample code: List health reports. + * + * @param manager Entry point to SecurityManager. + */ + public static void listHealthReports(com.azure.resourcemanager.security.SecurityManager manager) { + manager + .healthReports() + .list("subscriptions/a1efb6ca-fbc5-4782-9aaa-5c7daded1ce2", com.azure.core.util.Context.NONE); + } +} ``` ### InformationProtectionPolicies_CreateOrUpdate @@ -3387,7 +3611,6 @@ public final class InformationProtectionPoliciesCreateOrUpdateSamples { ### InformationProtectionPolicies_Get ```java -import com.azure.core.util.Context; import com.azure.resourcemanager.security.models.InformationProtectionPolicyName; /** Samples for InformationProtectionPolicies Get. */ @@ -3407,7 +3630,7 @@ public final class InformationProtectionPoliciesGetSamples { .getWithResponse( "providers/Microsoft.Management/managementGroups/148059f7-faf3-49a6-ba35-85122112291e", InformationProtectionPolicyName.CUSTOM, - Context.NONE); + com.azure.core.util.Context.NONE); } /* @@ -3425,7 +3648,7 @@ public final class InformationProtectionPoliciesGetSamples { .getWithResponse( "providers/Microsoft.Management/managementGroups/148059f7-faf3-49a6-ba35-85122112291e", InformationProtectionPolicyName.EFFECTIVE, - Context.NONE); + com.azure.core.util.Context.NONE); } } ``` @@ -3433,8 +3656,6 @@ public final class InformationProtectionPoliciesGetSamples { ### InformationProtectionPolicies_List ```java -import com.azure.core.util.Context; - /** Samples for InformationProtectionPolicies List. */ public final class InformationProtectionPoliciesListSamples { /* @@ -3448,7 +3669,9 @@ public final class InformationProtectionPoliciesListSamples { public static void getInformationProtectionPolicies(com.azure.resourcemanager.security.SecurityManager manager) { manager .informationProtectionPolicies() - .list("providers/Microsoft.Management/managementGroups/148059f7-faf3-49a6-ba35-85122112291e", Context.NONE); + .list( + "providers/Microsoft.Management/managementGroups/148059f7-faf3-49a6-ba35-85122112291e", + com.azure.core.util.Context.NONE); } } ``` @@ -3476,8 +3699,6 @@ public final class IngestionSettingsCreateSamples { ### IngestionSettings_Delete ```java -import com.azure.core.util.Context; - /** Samples for IngestionSettings Delete. */ public final class IngestionSettingsDeleteSamples { /* @@ -3490,7 +3711,7 @@ public final class IngestionSettingsDeleteSamples { */ public static void deleteAnIngestionSettingForTheSubscription( com.azure.resourcemanager.security.SecurityManager manager) { - manager.ingestionSettings().deleteWithResponse("default", Context.NONE); + manager.ingestionSettings().deleteWithResponse("default", com.azure.core.util.Context.NONE); } } ``` @@ -3498,8 +3719,6 @@ public final class IngestionSettingsDeleteSamples { ### IngestionSettings_Get ```java -import com.azure.core.util.Context; - /** Samples for IngestionSettings Get. */ public final class IngestionSettingsGetSamples { /* @@ -3511,7 +3730,7 @@ public final class IngestionSettingsGetSamples { * @param manager Entry point to SecurityManager. */ public static void getAIngestionSettingOnSubscription(com.azure.resourcemanager.security.SecurityManager manager) { - manager.ingestionSettings().getWithResponse("default", Context.NONE); + manager.ingestionSettings().getWithResponse("default", com.azure.core.util.Context.NONE); } } ``` @@ -3519,8 +3738,6 @@ public final class IngestionSettingsGetSamples { ### IngestionSettings_List ```java -import com.azure.core.util.Context; - /** Samples for IngestionSettings List. */ public final class IngestionSettingsListSamples { /* @@ -3532,7 +3749,7 @@ public final class IngestionSettingsListSamples { * @param manager Entry point to SecurityManager. */ public static void getIngestionSettingsOnSubscription(com.azure.resourcemanager.security.SecurityManager manager) { - manager.ingestionSettings().list(Context.NONE); + manager.ingestionSettings().list(com.azure.core.util.Context.NONE); } } ``` @@ -3540,8 +3757,6 @@ public final class IngestionSettingsListSamples { ### IngestionSettings_ListConnectionStrings ```java -import com.azure.core.util.Context; - /** Samples for IngestionSettings ListConnectionStrings. */ public final class IngestionSettingsListConnectionStringsSamples { /* @@ -3554,7 +3769,7 @@ public final class IngestionSettingsListConnectionStringsSamples { */ public static void listConnectionStringsForIngestingSecurityDataAndLogs( com.azure.resourcemanager.security.SecurityManager manager) { - manager.ingestionSettings().listConnectionStringsWithResponse("default", Context.NONE); + manager.ingestionSettings().listConnectionStringsWithResponse("default", com.azure.core.util.Context.NONE); } } ``` @@ -3562,8 +3777,6 @@ public final class IngestionSettingsListConnectionStringsSamples { ### IngestionSettings_ListTokens ```java -import com.azure.core.util.Context; - /** Samples for IngestionSettings ListTokens. */ public final class IngestionSettingsListTokensSamples { /* @@ -3575,7 +3788,7 @@ public final class IngestionSettingsListTokensSamples { * @param manager Entry point to SecurityManager. */ public static void listIngestionSettingTokens(com.azure.resourcemanager.security.SecurityManager manager) { - manager.ingestionSettings().listTokensWithResponse("default", Context.NONE); + manager.ingestionSettings().listTokensWithResponse("default", com.azure.core.util.Context.NONE); } } ``` @@ -3653,8 +3866,6 @@ public final class IotSecuritySolutionCreateOrUpdateSamples { ### IotSecuritySolution_Delete ```java -import com.azure.core.util.Context; - /** Samples for IotSecuritySolution Delete. */ public final class IotSecuritySolutionDeleteSamples { /* @@ -3666,7 +3877,9 @@ public final class IotSecuritySolutionDeleteSamples { * @param manager Entry point to SecurityManager. */ public static void deleteAnIoTSecuritySolution(com.azure.resourcemanager.security.SecurityManager manager) { - manager.iotSecuritySolutions().deleteByResourceGroupWithResponse("MyGroup", "default", Context.NONE); + manager + .iotSecuritySolutions() + .deleteByResourceGroupWithResponse("MyGroup", "default", com.azure.core.util.Context.NONE); } } ``` @@ -3674,8 +3887,6 @@ public final class IotSecuritySolutionDeleteSamples { ### IotSecuritySolution_GetByResourceGroup ```java -import com.azure.core.util.Context; - /** Samples for IotSecuritySolution GetByResourceGroup. */ public final class IotSecuritySolutionGetByResourceGroupSamples { /* @@ -3687,7 +3898,9 @@ public final class IotSecuritySolutionGetByResourceGroupSamples { * @param manager Entry point to SecurityManager. */ public static void getAIoTSecuritySolution(com.azure.resourcemanager.security.SecurityManager manager) { - manager.iotSecuritySolutions().getByResourceGroupWithResponse("MyGroup", "default", Context.NONE); + manager + .iotSecuritySolutions() + .getByResourceGroupWithResponse("MyGroup", "default", com.azure.core.util.Context.NONE); } } ``` @@ -3695,8 +3908,6 @@ public final class IotSecuritySolutionGetByResourceGroupSamples { ### IotSecuritySolution_List ```java -import com.azure.core.util.Context; - /** Samples for IotSecuritySolution List. */ public final class IotSecuritySolutionListSamples { /* @@ -3709,7 +3920,7 @@ public final class IotSecuritySolutionListSamples { */ public static void listIoTSecuritySolutionsBySubscription( com.azure.resourcemanager.security.SecurityManager manager) { - manager.iotSecuritySolutions().list(null, Context.NONE); + manager.iotSecuritySolutions().list(null, com.azure.core.util.Context.NONE); } /* @@ -3726,7 +3937,7 @@ public final class IotSecuritySolutionListSamples { .list( "properties.iotHubs/any(i eq" + " \"/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/FirstIotHub\")", - Context.NONE); + com.azure.core.util.Context.NONE); } } ``` @@ -3734,8 +3945,6 @@ public final class IotSecuritySolutionListSamples { ### IotSecuritySolution_ListByResourceGroup ```java -import com.azure.core.util.Context; - /** Samples for IotSecuritySolution ListByResourceGroup. */ public final class IotSecuritySolutionListByResourceGroupSamples { /* @@ -3754,7 +3963,7 @@ public final class IotSecuritySolutionListByResourceGroupSamples { "MyRg", "properties.iotHubs/any(i eq" + " \"/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/FirstIotHub\")", - Context.NONE); + com.azure.core.util.Context.NONE); } /* @@ -3767,7 +3976,7 @@ public final class IotSecuritySolutionListByResourceGroupSamples { */ public static void listIoTSecuritySolutionsByResourceGroup( com.azure.resourcemanager.security.SecurityManager manager) { - manager.iotSecuritySolutions().listByResourceGroup("MyGroup", null, Context.NONE); + manager.iotSecuritySolutions().listByResourceGroup("MyGroup", null, com.azure.core.util.Context.NONE); } } ``` @@ -3775,7 +3984,6 @@ public final class IotSecuritySolutionListByResourceGroupSamples { ### IotSecuritySolution_Update ```java -import com.azure.core.util.Context; import com.azure.resourcemanager.security.models.IoTSecuritySolutionModel; import com.azure.resourcemanager.security.models.RecommendationConfigStatus; import com.azure.resourcemanager.security.models.RecommendationConfigurationProperties; @@ -3798,7 +4006,10 @@ public final class IotSecuritySolutionUpdateSamples { public static void useThisMethodToUpdateExistingIoTSecuritySolution( com.azure.resourcemanager.security.SecurityManager manager) { IoTSecuritySolutionModel resource = - manager.iotSecuritySolutions().getByResourceGroupWithResponse("myRg", "default", Context.NONE).getValue(); + manager + .iotSecuritySolutions() + .getByResourceGroupWithResponse("myRg", "default", com.azure.core.util.Context.NONE) + .getValue(); resource .update() .withTags(mapOf("foo", "bar")) @@ -3834,8 +4045,6 @@ public final class IotSecuritySolutionUpdateSamples { ### IotSecuritySolutionAnalytics_Get ```java -import com.azure.core.util.Context; - /** Samples for IotSecuritySolutionAnalytics Get. */ public final class IotSecuritySolutionAnalyticsGetSamples { /* @@ -3847,7 +4056,7 @@ public final class IotSecuritySolutionAnalyticsGetSamples { * @param manager Entry point to SecurityManager. */ public static void getSecuritySolutionAnalytics(com.azure.resourcemanager.security.SecurityManager manager) { - manager.iotSecuritySolutionAnalytics().getWithResponse("MyGroup", "default", Context.NONE); + manager.iotSecuritySolutionAnalytics().getWithResponse("MyGroup", "default", com.azure.core.util.Context.NONE); } } ``` @@ -3855,8 +4064,6 @@ public final class IotSecuritySolutionAnalyticsGetSamples { ### IotSecuritySolutionAnalytics_List ```java -import com.azure.core.util.Context; - /** Samples for IotSecuritySolutionAnalytics List. */ public final class IotSecuritySolutionAnalyticsListSamples { /* @@ -3868,7 +4075,7 @@ public final class IotSecuritySolutionAnalyticsListSamples { * @param manager Entry point to SecurityManager. */ public static void getSecuritySolutionAnalytics(com.azure.resourcemanager.security.SecurityManager manager) { - manager.iotSecuritySolutionAnalytics().listWithResponse("MyGroup", "default", Context.NONE); + manager.iotSecuritySolutionAnalytics().listWithResponse("MyGroup", "default", com.azure.core.util.Context.NONE); } } ``` @@ -3876,8 +4083,6 @@ public final class IotSecuritySolutionAnalyticsListSamples { ### IotSecuritySolutionsAnalyticsAggregatedAlert_Dismiss ```java -import com.azure.core.util.Context; - /** Samples for IotSecuritySolutionsAnalyticsAggregatedAlert Dismiss. */ public final class IotSecuritySolutionsAnalyticsAggregatedAlertDismissSamples { /* @@ -3892,7 +4097,11 @@ public final class IotSecuritySolutionsAnalyticsAggregatedAlertDismissSamples { com.azure.resourcemanager.security.SecurityManager manager) { manager .iotSecuritySolutionsAnalyticsAggregatedAlerts() - .dismissWithResponse("IoTEdgeResources", "default", "IoT_Bruteforce_Fail/2019-02-02/dismiss", Context.NONE); + .dismissWithResponse( + "IoTEdgeResources", + "default", + "IoT_Bruteforce_Fail/2019-02-02/dismiss", + com.azure.core.util.Context.NONE); } } ``` @@ -3900,8 +4109,6 @@ public final class IotSecuritySolutionsAnalyticsAggregatedAlertDismissSamples { ### IotSecuritySolutionsAnalyticsAggregatedAlert_Get ```java -import com.azure.core.util.Context; - /** Samples for IotSecuritySolutionsAnalyticsAggregatedAlert Get. */ public final class IotSecuritySolutionsAnalyticsAggregatedAlertGetSamples { /* @@ -3918,7 +4125,7 @@ public final class IotSecuritySolutionsAnalyticsAggregatedAlertGetSamples { com.azure.resourcemanager.security.SecurityManager manager) { manager .iotSecuritySolutionsAnalyticsAggregatedAlerts() - .getWithResponse("MyGroup", "default", "IoT_Bruteforce_Fail/2019-02-02", Context.NONE); + .getWithResponse("MyGroup", "default", "IoT_Bruteforce_Fail/2019-02-02", com.azure.core.util.Context.NONE); } } ``` @@ -3926,8 +4133,6 @@ public final class IotSecuritySolutionsAnalyticsAggregatedAlertGetSamples { ### IotSecuritySolutionsAnalyticsAggregatedAlert_List ```java -import com.azure.core.util.Context; - /** Samples for IotSecuritySolutionsAnalyticsAggregatedAlert List. */ public final class IotSecuritySolutionsAnalyticsAggregatedAlertListSamples { /* @@ -3940,7 +4145,9 @@ public final class IotSecuritySolutionsAnalyticsAggregatedAlertListSamples { */ public static void getTheAggregatedAlertListOfYoursIoTSecuritySolution( com.azure.resourcemanager.security.SecurityManager manager) { - manager.iotSecuritySolutionsAnalyticsAggregatedAlerts().list("MyGroup", "default", null, Context.NONE); + manager + .iotSecuritySolutionsAnalyticsAggregatedAlerts() + .list("MyGroup", "default", null, com.azure.core.util.Context.NONE); } } ``` @@ -3948,8 +4155,6 @@ public final class IotSecuritySolutionsAnalyticsAggregatedAlertListSamples { ### IotSecuritySolutionsAnalyticsRecommendation_Get ```java -import com.azure.core.util.Context; - /** Samples for IotSecuritySolutionsAnalyticsRecommendation Get. */ public final class IotSecuritySolutionsAnalyticsRecommendationGetSamples { /* @@ -3964,7 +4169,7 @@ public final class IotSecuritySolutionsAnalyticsRecommendationGetSamples { com.azure.resourcemanager.security.SecurityManager manager) { manager .iotSecuritySolutionsAnalyticsRecommendations() - .getWithResponse("IoTEdgeResources", "default", "OpenPortsOnDevice", Context.NONE); + .getWithResponse("IoTEdgeResources", "default", "OpenPortsOnDevice", com.azure.core.util.Context.NONE); } } ``` @@ -3972,8 +4177,6 @@ public final class IotSecuritySolutionsAnalyticsRecommendationGetSamples { ### IotSecuritySolutionsAnalyticsRecommendation_List ```java -import com.azure.core.util.Context; - /** Samples for IotSecuritySolutionsAnalyticsRecommendation List. */ public final class IotSecuritySolutionsAnalyticsRecommendationListSamples { /* @@ -3986,7 +4189,9 @@ public final class IotSecuritySolutionsAnalyticsRecommendationListSamples { */ public static void getTheListOfAggregatedSecurityAnalyticsRecommendationsOfYoursIoTSecuritySolution( com.azure.resourcemanager.security.SecurityManager manager) { - manager.iotSecuritySolutionsAnalyticsRecommendations().list("IoTEdgeResources", "default", null, Context.NONE); + manager + .iotSecuritySolutionsAnalyticsRecommendations() + .list("IoTEdgeResources", "default", null, com.azure.core.util.Context.NONE); } } ``` @@ -4070,8 +4275,6 @@ public final class JitNetworkAccessPoliciesCreateOrUpdateSamples { ### JitNetworkAccessPolicies_Delete ```java -import com.azure.core.util.Context; - /** Samples for JitNetworkAccessPolicies Delete. */ public final class JitNetworkAccessPoliciesDeleteSamples { /* @@ -4083,7 +4286,9 @@ public final class JitNetworkAccessPoliciesDeleteSamples { * @param manager Entry point to SecurityManager. */ public static void deleteAJITNetworkAccessPolicy(com.azure.resourcemanager.security.SecurityManager manager) { - manager.jitNetworkAccessPolicies().deleteWithResponse("myRg1", "westeurope", "default", Context.NONE); + manager + .jitNetworkAccessPolicies() + .deleteWithResponse("myRg1", "westeurope", "default", com.azure.core.util.Context.NONE); } } ``` @@ -4091,8 +4296,6 @@ public final class JitNetworkAccessPoliciesDeleteSamples { ### JitNetworkAccessPolicies_Get ```java -import com.azure.core.util.Context; - /** Samples for JitNetworkAccessPolicies Get. */ public final class JitNetworkAccessPoliciesGetSamples { /* @@ -4104,7 +4307,9 @@ public final class JitNetworkAccessPoliciesGetSamples { * @param manager Entry point to SecurityManager. */ public static void getJITNetworkAccessPolicy(com.azure.resourcemanager.security.SecurityManager manager) { - manager.jitNetworkAccessPolicies().getWithResponse("myRg1", "westeurope", "default", Context.NONE); + manager + .jitNetworkAccessPolicies() + .getWithResponse("myRg1", "westeurope", "default", com.azure.core.util.Context.NONE); } } ``` @@ -4112,7 +4317,6 @@ public final class JitNetworkAccessPoliciesGetSamples { ### JitNetworkAccessPolicies_Initiate ```java -import com.azure.core.util.Context; import com.azure.resourcemanager.security.models.JitNetworkAccessPolicyInitiatePort; import com.azure.resourcemanager.security.models.JitNetworkAccessPolicyInitiateRequest; import com.azure.resourcemanager.security.models.JitNetworkAccessPolicyInitiateVirtualMachine; @@ -4150,7 +4354,7 @@ public final class JitNetworkAccessPoliciesInitiateSamples { .withNumber(3389) .withAllowedSourceAddressPrefix("192.127.0.2"))))) .withJustification("testing a new version of the product"), - Context.NONE); + com.azure.core.util.Context.NONE); } } ``` @@ -4158,8 +4362,6 @@ public final class JitNetworkAccessPoliciesInitiateSamples { ### JitNetworkAccessPolicies_List ```java -import com.azure.core.util.Context; - /** Samples for JitNetworkAccessPolicies List. */ public final class JitNetworkAccessPoliciesListSamples { /* @@ -4172,7 +4374,7 @@ public final class JitNetworkAccessPoliciesListSamples { */ public static void getJITNetworkAccessPoliciesOnASubscription( com.azure.resourcemanager.security.SecurityManager manager) { - manager.jitNetworkAccessPolicies().list(Context.NONE); + manager.jitNetworkAccessPolicies().list(com.azure.core.util.Context.NONE); } } ``` @@ -4180,8 +4382,6 @@ public final class JitNetworkAccessPoliciesListSamples { ### JitNetworkAccessPolicies_ListByRegion ```java -import com.azure.core.util.Context; - /** Samples for JitNetworkAccessPolicies ListByRegion. */ public final class JitNetworkAccessPoliciesListByRegionSamples { /* @@ -4194,7 +4394,7 @@ public final class JitNetworkAccessPoliciesListByRegionSamples { */ public static void getJITNetworkAccessPoliciesOnASubscriptionFromASecurityDataLocation( com.azure.resourcemanager.security.SecurityManager manager) { - manager.jitNetworkAccessPolicies().listByRegion("westeurope", Context.NONE); + manager.jitNetworkAccessPolicies().listByRegion("westeurope", com.azure.core.util.Context.NONE); } } ``` @@ -4202,8 +4402,6 @@ public final class JitNetworkAccessPoliciesListByRegionSamples { ### JitNetworkAccessPolicies_ListByResourceGroup ```java -import com.azure.core.util.Context; - /** Samples for JitNetworkAccessPolicies ListByResourceGroup. */ public final class JitNetworkAccessPoliciesListByResourceGroupSamples { /* @@ -4216,7 +4414,7 @@ public final class JitNetworkAccessPoliciesListByResourceGroupSamples { */ public static void getJITNetworkAccessPoliciesOnAResourceGroup( com.azure.resourcemanager.security.SecurityManager manager) { - manager.jitNetworkAccessPolicies().listByResourceGroup("myRg1", Context.NONE); + manager.jitNetworkAccessPolicies().listByResourceGroup("myRg1", com.azure.core.util.Context.NONE); } } ``` @@ -4224,8 +4422,6 @@ public final class JitNetworkAccessPoliciesListByResourceGroupSamples { ### JitNetworkAccessPolicies_ListByResourceGroupAndRegion ```java -import com.azure.core.util.Context; - /** Samples for JitNetworkAccessPolicies ListByResourceGroupAndRegion. */ public final class JitNetworkAccessPoliciesListByResourceGroupAndRegionSamples { /* @@ -4238,7 +4434,9 @@ public final class JitNetworkAccessPoliciesListByResourceGroupAndRegionSamples { */ public static void getJITNetworkAccessPoliciesOnAResourceGroupFromASecurityDataLocation( com.azure.resourcemanager.security.SecurityManager manager) { - manager.jitNetworkAccessPolicies().listByResourceGroupAndRegion("myRg1", "westeurope", Context.NONE); + manager + .jitNetworkAccessPolicies() + .listByResourceGroupAndRegion("myRg1", "westeurope", com.azure.core.util.Context.NONE); } } ``` @@ -4246,8 +4444,6 @@ public final class JitNetworkAccessPoliciesListByResourceGroupAndRegionSamples { ### Locations_Get ```java -import com.azure.core.util.Context; - /** Samples for Locations Get. */ public final class LocationsGetSamples { /* @@ -4259,7 +4455,7 @@ public final class LocationsGetSamples { * @param manager Entry point to SecurityManager. */ public static void getSecurityDataLocation(com.azure.resourcemanager.security.SecurityManager manager) { - manager.locations().getWithResponse("centralus", Context.NONE); + manager.locations().getWithResponse("centralus", com.azure.core.util.Context.NONE); } } ``` @@ -4267,8 +4463,6 @@ public final class LocationsGetSamples { ### Locations_List ```java -import com.azure.core.util.Context; - /** Samples for Locations List. */ public final class LocationsListSamples { /* @@ -4280,7 +4474,7 @@ public final class LocationsListSamples { * @param manager Entry point to SecurityManager. */ public static void getSecurityDataLocations(com.azure.resourcemanager.security.SecurityManager manager) { - manager.locations().list(Context.NONE); + manager.locations().list(com.azure.core.util.Context.NONE); } } ``` @@ -4288,8 +4482,6 @@ public final class LocationsListSamples { ### MdeOnboardings_Get ```java -import com.azure.core.util.Context; - /** Samples for MdeOnboardings Get. */ public final class MdeOnboardingsGetSamples { /* @@ -4302,7 +4494,7 @@ public final class MdeOnboardingsGetSamples { */ public static void theDefaultConfigurationOrDataNeededToOnboardTheMachineToMDE( com.azure.resourcemanager.security.SecurityManager manager) { - manager.mdeOnboardings().getWithResponse(Context.NONE); + manager.mdeOnboardings().getWithResponse(com.azure.core.util.Context.NONE); } } ``` @@ -4310,8 +4502,6 @@ public final class MdeOnboardingsGetSamples { ### MdeOnboardings_List ```java -import com.azure.core.util.Context; - /** Samples for MdeOnboardings List. */ public final class MdeOnboardingsListSamples { /* @@ -4324,7 +4514,7 @@ public final class MdeOnboardingsListSamples { */ public static void theConfigurationOrDataNeededToOnboardTheMachineToMDE( com.azure.resourcemanager.security.SecurityManager manager) { - manager.mdeOnboardings().listWithResponse(Context.NONE); + manager.mdeOnboardings().listWithResponse(com.azure.core.util.Context.NONE); } } ``` @@ -4332,8 +4522,6 @@ public final class MdeOnboardingsListSamples { ### Pricings_Get ```java -import com.azure.core.util.Context; - /** Samples for Pricings Get. */ public final class PricingsGetSamples { /* @@ -4345,7 +4533,7 @@ public final class PricingsGetSamples { * @param manager Entry point to SecurityManager. */ public static void getPricingsOnSubscription(com.azure.resourcemanager.security.SecurityManager manager) { - manager.pricings().getWithResponse("VirtualMachines", Context.NONE); + manager.pricings().getWithResponse("VirtualMachines", com.azure.core.util.Context.NONE); } } ``` @@ -4353,8 +4541,6 @@ public final class PricingsGetSamples { ### Pricings_List ```java -import com.azure.core.util.Context; - /** Samples for Pricings List. */ public final class PricingsListSamples { /* @@ -4366,7 +4552,7 @@ public final class PricingsListSamples { * @param manager Entry point to SecurityManager. */ public static void getPricingsOnSubscription(com.azure.resourcemanager.security.SecurityManager manager) { - manager.pricings().listWithResponse(Context.NONE); + manager.pricings().listWithResponse(com.azure.core.util.Context.NONE); } } ``` @@ -4374,7 +4560,6 @@ public final class PricingsListSamples { ### Pricings_Update ```java -import com.azure.core.util.Context; import com.azure.resourcemanager.security.fluent.models.PricingInner; import com.azure.resourcemanager.security.models.PricingTier; @@ -4394,7 +4579,7 @@ public final class PricingsUpdateSamples { .updateWithResponse( "VirtualMachines", new PricingInner().withPricingTier(PricingTier.STANDARD).withSubPlan("P2"), - Context.NONE); + com.azure.core.util.Context.NONE); } } ``` @@ -4402,8 +4587,6 @@ public final class PricingsUpdateSamples { ### RegulatoryComplianceAssessments_Get ```java -import com.azure.core.util.Context; - /** Samples for RegulatoryComplianceAssessments Get. */ public final class RegulatoryComplianceAssessmentsGetSamples { /* @@ -4418,7 +4601,8 @@ public final class RegulatoryComplianceAssessmentsGetSamples { com.azure.resourcemanager.security.SecurityManager manager) { manager .regulatoryComplianceAssessments() - .getWithResponse("PCI-DSS-3.2", "1.1", "968548cb-02b3-8cd2-11f8-0cf64ab1a347", Context.NONE); + .getWithResponse( + "PCI-DSS-3.2", "1.1", "968548cb-02b3-8cd2-11f8-0cf64ab1a347", com.azure.core.util.Context.NONE); } } ``` @@ -4426,8 +4610,6 @@ public final class RegulatoryComplianceAssessmentsGetSamples { ### RegulatoryComplianceAssessments_List ```java -import com.azure.core.util.Context; - /** Samples for RegulatoryComplianceAssessments List. */ public final class RegulatoryComplianceAssessmentsListSamples { /* @@ -4440,7 +4622,7 @@ public final class RegulatoryComplianceAssessmentsListSamples { */ public static void getAllAssessmentsMappedToSelectedRegulatoryComplianceControl( com.azure.resourcemanager.security.SecurityManager manager) { - manager.regulatoryComplianceAssessments().list("PCI-DSS-3.2", "1.1", null, Context.NONE); + manager.regulatoryComplianceAssessments().list("PCI-DSS-3.2", "1.1", null, com.azure.core.util.Context.NONE); } } ``` @@ -4448,8 +4630,6 @@ public final class RegulatoryComplianceAssessmentsListSamples { ### RegulatoryComplianceControls_Get ```java -import com.azure.core.util.Context; - /** Samples for RegulatoryComplianceControls Get. */ public final class RegulatoryComplianceControlsGetSamples { /* @@ -4462,7 +4642,7 @@ public final class RegulatoryComplianceControlsGetSamples { */ public static void getSelectedRegulatoryComplianceControlDetailsAndState( com.azure.resourcemanager.security.SecurityManager manager) { - manager.regulatoryComplianceControls().getWithResponse("PCI-DSS-3.2", "1.1", Context.NONE); + manager.regulatoryComplianceControls().getWithResponse("PCI-DSS-3.2", "1.1", com.azure.core.util.Context.NONE); } } ``` @@ -4470,8 +4650,6 @@ public final class RegulatoryComplianceControlsGetSamples { ### RegulatoryComplianceControls_List ```java -import com.azure.core.util.Context; - /** Samples for RegulatoryComplianceControls List. */ public final class RegulatoryComplianceControlsListSamples { /* @@ -4484,7 +4662,7 @@ public final class RegulatoryComplianceControlsListSamples { */ public static void getAllRegulatoryComplianceControlsDetailsAndStateForSelectedStandard( com.azure.resourcemanager.security.SecurityManager manager) { - manager.regulatoryComplianceControls().list("PCI-DSS-3.2", null, Context.NONE); + manager.regulatoryComplianceControls().list("PCI-DSS-3.2", null, com.azure.core.util.Context.NONE); } } ``` @@ -4492,8 +4670,6 @@ public final class RegulatoryComplianceControlsListSamples { ### RegulatoryComplianceStandards_Get ```java -import com.azure.core.util.Context; - /** Samples for RegulatoryComplianceStandards Get. */ public final class RegulatoryComplianceStandardsGetSamples { /* @@ -4506,7 +4682,7 @@ public final class RegulatoryComplianceStandardsGetSamples { */ public static void getSelectedRegulatoryComplianceStandardDetailsAndState( com.azure.resourcemanager.security.SecurityManager manager) { - manager.regulatoryComplianceStandards().getWithResponse("PCI-DSS-3.2", Context.NONE); + manager.regulatoryComplianceStandards().getWithResponse("PCI-DSS-3.2", com.azure.core.util.Context.NONE); } } ``` @@ -4514,8 +4690,6 @@ public final class RegulatoryComplianceStandardsGetSamples { ### RegulatoryComplianceStandards_List ```java -import com.azure.core.util.Context; - /** Samples for RegulatoryComplianceStandards List. */ public final class RegulatoryComplianceStandardsListSamples { /* @@ -4528,7 +4702,7 @@ public final class RegulatoryComplianceStandardsListSamples { */ public static void getAllSupportedRegulatoryComplianceStandardsDetailsAndState( com.azure.resourcemanager.security.SecurityManager manager) { - manager.regulatoryComplianceStandards().list(null, Context.NONE); + manager.regulatoryComplianceStandards().list(null, com.azure.core.util.Context.NONE); } } ``` @@ -4536,8 +4710,6 @@ public final class RegulatoryComplianceStandardsListSamples { ### SecureScoreControlDefinitions_List ```java -import com.azure.core.util.Context; - /** Samples for SecureScoreControlDefinitions List. */ public final class SecureScoreControlDefinitionsListSamples { /* @@ -4549,7 +4721,7 @@ public final class SecureScoreControlDefinitionsListSamples { * @param manager Entry point to SecurityManager. */ public static void listSecurityControlsDefinition(com.azure.resourcemanager.security.SecurityManager manager) { - manager.secureScoreControlDefinitions().list(Context.NONE); + manager.secureScoreControlDefinitions().list(com.azure.core.util.Context.NONE); } } ``` @@ -4557,8 +4729,6 @@ public final class SecureScoreControlDefinitionsListSamples { ### SecureScoreControlDefinitions_ListBySubscription ```java -import com.azure.core.util.Context; - /** Samples for SecureScoreControlDefinitions ListBySubscription. */ public final class SecureScoreControlDefinitionsListBySubscriptionSamples { /* @@ -4571,7 +4741,7 @@ public final class SecureScoreControlDefinitionsListBySubscriptionSamples { */ public static void listSecurityControlsDefinitionBySubscription( com.azure.resourcemanager.security.SecurityManager manager) { - manager.secureScoreControlDefinitions().listBySubscription(Context.NONE); + manager.secureScoreControlDefinitions().listBySubscription(com.azure.core.util.Context.NONE); } } ``` @@ -4579,8 +4749,6 @@ public final class SecureScoreControlDefinitionsListBySubscriptionSamples { ### SecureScoreControls_List ```java -import com.azure.core.util.Context; - /** Samples for SecureScoreControls List. */ public final class SecureScoreControlsListSamples { /* @@ -4592,7 +4760,7 @@ public final class SecureScoreControlsListSamples { * @param manager Entry point to SecurityManager. */ public static void listAllSecureScoresControls(com.azure.resourcemanager.security.SecurityManager manager) { - manager.secureScoreControls().list(null, Context.NONE); + manager.secureScoreControls().list(null, com.azure.core.util.Context.NONE); } } ``` @@ -4600,7 +4768,6 @@ public final class SecureScoreControlsListSamples { ### SecureScoreControls_ListBySecureScore ```java -import com.azure.core.util.Context; import com.azure.resourcemanager.security.models.ExpandControlsEnum; /** Samples for SecureScoreControls ListBySecureScore. */ @@ -4616,7 +4783,9 @@ public final class SecureScoreControlsListBySecureScoreSamples { */ public static void getSecurityControlsAndTheirCurrentScoreForTheSpecifiedInitiativeWithTheExpandParameter( com.azure.resourcemanager.security.SecurityManager manager) { - manager.secureScoreControls().listBySecureScore("ascScore", ExpandControlsEnum.DEFINITION, Context.NONE); + manager + .secureScoreControls() + .listBySecureScore("ascScore", ExpandControlsEnum.DEFINITION, com.azure.core.util.Context.NONE); } /* @@ -4629,7 +4798,7 @@ public final class SecureScoreControlsListBySecureScoreSamples { */ public static void getSecurityControlsAndTheirCurrentScoreForTheSpecifiedInitiative( com.azure.resourcemanager.security.SecurityManager manager) { - manager.secureScoreControls().listBySecureScore("ascScore", null, Context.NONE); + manager.secureScoreControls().listBySecureScore("ascScore", null, com.azure.core.util.Context.NONE); } } ``` @@ -4637,8 +4806,6 @@ public final class SecureScoreControlsListBySecureScoreSamples { ### SecureScores_Get ```java -import com.azure.core.util.Context; - /** Samples for SecureScores Get. */ public final class SecureScoresGetSamples { /* @@ -4650,7 +4817,7 @@ public final class SecureScoresGetSamples { * @param manager Entry point to SecurityManager. */ public static void getSingleSecureScore(com.azure.resourcemanager.security.SecurityManager manager) { - manager.secureScores().getWithResponse("ascScore", Context.NONE); + manager.secureScores().getWithResponse("ascScore", com.azure.core.util.Context.NONE); } } ``` @@ -4658,8 +4825,6 @@ public final class SecureScoresGetSamples { ### SecureScores_List ```java -import com.azure.core.util.Context; - /** Samples for SecureScores List. */ public final class SecureScoresListSamples { /* @@ -4671,7 +4836,7 @@ public final class SecureScoresListSamples { * @param manager Entry point to SecurityManager. */ public static void listSecureScores(com.azure.resourcemanager.security.SecurityManager manager) { - manager.secureScores().list(Context.NONE); + manager.secureScores().list(com.azure.core.util.Context.NONE); } } ``` @@ -4680,7 +4845,6 @@ public final class SecureScoresListSamples { ```java import com.azure.core.management.serializer.SerializerFactory; -import com.azure.core.util.Context; import com.azure.core.util.serializer.SerializerEncoding; import com.azure.resourcemanager.security.fluent.models.ApplicationInner; import com.azure.resourcemanager.security.models.ApplicationSourceResourceType; @@ -4718,7 +4882,7 @@ public final class SecurityConnectorApplicationOperationCreateOrUpdateSamples { "{\"conditions\":[{\"operator\":\"contains\",\"property\":\"$.Id\",\"value\":\"-prod-\"}]}", Object.class, SerializerEncoding.JSON))), - Context.NONE); + com.azure.core.util.Context.NONE); } } ``` @@ -4726,8 +4890,6 @@ public final class SecurityConnectorApplicationOperationCreateOrUpdateSamples { ### SecurityConnectorApplicationOperation_Delete ```java -import com.azure.core.util.Context; - /** Samples for SecurityConnectorApplicationOperation Delete. */ public final class SecurityConnectorApplicationOperationDeleteSamples { /* @@ -4742,7 +4904,10 @@ public final class SecurityConnectorApplicationOperationDeleteSamples { manager .securityConnectorApplicationOperations() .deleteWithResponse( - "gcpResourceGroup", "gcpconnector", "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", Context.NONE); + "gcpResourceGroup", + "gcpconnector", + "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", + com.azure.core.util.Context.NONE); } } ``` @@ -4750,8 +4915,6 @@ public final class SecurityConnectorApplicationOperationDeleteSamples { ### SecurityConnectorApplicationOperation_Get ```java -import com.azure.core.util.Context; - /** Samples for SecurityConnectorApplicationOperation Get. */ public final class SecurityConnectorApplicationOperationGetSamples { /* @@ -4766,7 +4929,11 @@ public final class SecurityConnectorApplicationOperationGetSamples { com.azure.resourcemanager.security.SecurityManager manager) { manager .securityConnectorApplicationOperations() - .getWithResponse("gcpResourceGroup", "gcpconnector", "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", Context.NONE); + .getWithResponse( + "gcpResourceGroup", + "gcpconnector", + "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", + com.azure.core.util.Context.NONE); } } ``` @@ -4774,8 +4941,6 @@ public final class SecurityConnectorApplicationOperationGetSamples { ### SecurityConnectorApplications_List ```java -import com.azure.core.util.Context; - /** Samples for SecurityConnectorApplications List. */ public final class SecurityConnectorApplicationsListSamples { /* @@ -4787,172 +4952,10 @@ public final class SecurityConnectorApplicationsListSamples { * @param manager Entry point to SecurityManager. */ public static void listSecurityApplicationsBySecurityConnectorLevelScope( - com.azure.resourcemanager.security.SecurityManager manager) { - manager.securityConnectorApplications().list("gcpResourceGroup", "gcpconnector", Context.NONE); - } -} -``` - -### SecurityConnectorGovernanceRule_List - -```java -import com.azure.core.util.Context; - -/** Samples for SecurityConnectorGovernanceRule List. */ -public final class SecurityConnectorGovernanceRuleListSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/ListBySecurityConnectorGovernanceRules_example.json - */ - /** - * Sample code: List security governanceRules by security connector level scope. - * - * @param manager Entry point to SecurityManager. - */ - public static void listSecurityGovernanceRulesBySecurityConnectorLevelScope( - com.azure.resourcemanager.security.SecurityManager manager) { - manager.securityConnectorGovernanceRules().list("gcpResourceGroup", "gcpconnector", Context.NONE); - } -} -``` - -### SecurityConnectorGovernanceRulesExecuteStatus_Get - -```java -import com.azure.core.util.Context; - -/** Samples for SecurityConnectorGovernanceRulesExecuteStatus Get. */ -public final class SecurityConnectorGovernanceRulesExecuteStatusGetSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/GetSecurityConnectorGovernanceRuleExecuteStatus_example.json - */ - /** - * Sample code: Get security governanceRules execution status by specific governanceRuleId. - * - * @param manager Entry point to SecurityManager. - */ - public static void getSecurityGovernanceRulesExecutionStatusBySpecificGovernanceRuleId( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .securityConnectorGovernanceRulesExecuteStatus() - .get( - "gcpResourceGroup", - "gcpconnector", - "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", - "58b33f4f-c8c7-4b01-99cc-d437db4d40dd", - Context.NONE); - } -} -``` - -### SecurityConnectorGovernanceRulesOperation_CreateOrUpdate - -```java -import com.azure.core.management.serializer.SerializerFactory; -import com.azure.core.util.Context; -import com.azure.core.util.serializer.SerializerEncoding; -import com.azure.resourcemanager.security.fluent.models.GovernanceRuleInner; -import com.azure.resourcemanager.security.models.GovernanceRuleEmailNotification; -import com.azure.resourcemanager.security.models.GovernanceRuleOwnerSource; -import com.azure.resourcemanager.security.models.GovernanceRuleOwnerSourceType; -import com.azure.resourcemanager.security.models.GovernanceRuleSourceResourceType; -import com.azure.resourcemanager.security.models.GovernanceRuleType; -import java.io.IOException; -import java.util.Arrays; - -/** Samples for SecurityConnectorGovernanceRulesOperation CreateOrUpdate. */ -public final class SecurityConnectorGovernanceRulesOperationCreateOrUpdateSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/PutSecurityConnectorGovernanceRule_example.json - */ - /** - * Sample code: Create Governance rule. - * - * @param manager Entry point to SecurityManager. - */ - public static void createGovernanceRule(com.azure.resourcemanager.security.SecurityManager manager) - throws IOException { - manager - .securityConnectorGovernanceRulesOperations() - .createOrUpdateWithResponse( - "gcpResourceGroup", - "gcpconnector", - "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", - new GovernanceRuleInner() - .withDisplayName("GCP Admin's rule") - .withDescription("A rule on critical GCP recommendations") - .withRemediationTimeframe("7.00:00:00") - .withIsGracePeriod(true) - .withRulePriority(200) - .withIsDisabled(false) - .withRuleType(GovernanceRuleType.INTEGRATED) - .withSourceResourceType(GovernanceRuleSourceResourceType.ASSESSMENTS) - .withConditionSets( - Arrays - .asList( - SerializerFactory - .createDefaultManagementSerializerAdapter() - .deserialize( - "{\"conditions\":[{\"operator\":\"In\",\"property\":\"$.AssessmentKey\",\"value\":\"[\\\"b1cd27e0-4ecc-4246-939f-49c426d9d72f\\\"," - + " \\\"fe83f80b-073d-4ccf-93d9-6797eb870201\\\"]\"}]}", - Object.class, - SerializerEncoding.JSON))) - .withOwnerSource( - new GovernanceRuleOwnerSource() - .withType(GovernanceRuleOwnerSourceType.MANUALLY) - .withValue("user@contoso.com")) - .withGovernanceEmailNotification( - new GovernanceRuleEmailNotification() - .withDisableManagerEmailNotification(true) - .withDisableOwnerEmailNotification(false)), - Context.NONE); - } -} -``` - -### SecurityConnectorGovernanceRulesOperation_Delete - -```java -import com.azure.core.util.Context; - -/** Samples for SecurityConnectorGovernanceRulesOperation Delete. */ -public final class SecurityConnectorGovernanceRulesOperationDeleteSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/DeleteSecurityConnectorGovernanceRule_example.json - */ - /** - * Sample code: Delete security GovernanceRule. - * - * @param manager Entry point to SecurityManager. - */ - public static void deleteSecurityGovernanceRule(com.azure.resourcemanager.security.SecurityManager manager) { - manager - .securityConnectorGovernanceRulesOperations() - .deleteWithResponse( - "gcpResourceGroup", "gcpconnector", "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", Context.NONE); - } -} -``` - -### SecurityConnectorGovernanceRulesOperation_Get - -```java -import com.azure.core.util.Context; - -/** Samples for SecurityConnectorGovernanceRulesOperation Get. */ -public final class SecurityConnectorGovernanceRulesOperationGetSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/GetSecurityConnectorGovernanceRule_example.json - */ - /** - * Sample code: Get security governanceRules by specific governanceRuleId. - * - * @param manager Entry point to SecurityManager. - */ - public static void getSecurityGovernanceRulesBySpecificGovernanceRuleId( com.azure.resourcemanager.security.SecurityManager manager) { manager - .securityConnectorGovernanceRulesOperations() - .getWithResponse("gcpResourceGroup", "gcpconnector", "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", Context.NONE); + .securityConnectorApplications() + .list("gcpResourceGroup", "gcpconnector", com.azure.core.util.Context.NONE); } } ``` @@ -5014,8 +5017,6 @@ public final class SecurityConnectorsCreateOrUpdateSamples { ### SecurityConnectors_Delete ```java -import com.azure.core.util.Context; - /** Samples for SecurityConnectors Delete. */ public final class SecurityConnectorsDeleteSamples { /* @@ -5027,7 +5028,9 @@ public final class SecurityConnectorsDeleteSamples { * @param manager Entry point to SecurityManager. */ public static void deleteASecurityConnector(com.azure.resourcemanager.security.SecurityManager manager) { - manager.securityConnectors().deleteByResourceGroupWithResponse("myRg", "mySecurityConnectorName", Context.NONE); + manager + .securityConnectors() + .deleteByResourceGroupWithResponse("myRg", "mySecurityConnectorName", com.azure.core.util.Context.NONE); } } ``` @@ -5035,8 +5038,6 @@ public final class SecurityConnectorsDeleteSamples { ### SecurityConnectors_GetByResourceGroup ```java -import com.azure.core.util.Context; - /** Samples for SecurityConnectors GetByResourceGroup. */ public final class SecurityConnectorsGetByResourceGroupSamples { /* @@ -5050,7 +5051,8 @@ public final class SecurityConnectorsGetByResourceGroupSamples { public static void retrieveASecurityConnector(com.azure.resourcemanager.security.SecurityManager manager) { manager .securityConnectors() - .getByResourceGroupWithResponse("exampleResourceGroup", "exampleSecurityConnectorName", Context.NONE); + .getByResourceGroupWithResponse( + "exampleResourceGroup", "exampleSecurityConnectorName", com.azure.core.util.Context.NONE); } } ``` @@ -5058,8 +5060,6 @@ public final class SecurityConnectorsGetByResourceGroupSamples { ### SecurityConnectors_List ```java -import com.azure.core.util.Context; - /** Samples for SecurityConnectors List. */ public final class SecurityConnectorsListSamples { /* @@ -5072,7 +5072,7 @@ public final class SecurityConnectorsListSamples { */ public static void listAllSecurityConnectorsOfASpecifiedSubscription( com.azure.resourcemanager.security.SecurityManager manager) { - manager.securityConnectors().list(Context.NONE); + manager.securityConnectors().list(com.azure.core.util.Context.NONE); } } ``` @@ -5080,8 +5080,6 @@ public final class SecurityConnectorsListSamples { ### SecurityConnectors_ListByResourceGroup ```java -import com.azure.core.util.Context; - /** Samples for SecurityConnectors ListByResourceGroup. */ public final class SecurityConnectorsListByResourceGroupSamples { /* @@ -5094,7 +5092,7 @@ public final class SecurityConnectorsListByResourceGroupSamples { */ public static void listAllSecurityConnectorsOfASpecifiedResourceGroup( com.azure.resourcemanager.security.SecurityManager manager) { - manager.securityConnectors().listByResourceGroup("exampleResourceGroup", Context.NONE); + manager.securityConnectors().listByResourceGroup("exampleResourceGroup", com.azure.core.util.Context.NONE); } } ``` @@ -5102,7 +5100,6 @@ public final class SecurityConnectorsListByResourceGroupSamples { ### SecurityConnectors_Update ```java -import com.azure.core.util.Context; import com.azure.resourcemanager.security.models.AwsEnvironmentData; import com.azure.resourcemanager.security.models.CloudName; import com.azure.resourcemanager.security.models.CspmMonitorAwsOffering; @@ -5126,7 +5123,8 @@ public final class SecurityConnectorsUpdateSamples { SecurityConnector resource = manager .securityConnectors() - .getByResourceGroupWithResponse("exampleResourceGroup", "exampleSecurityConnectorName", Context.NONE) + .getByResourceGroupWithResponse( + "exampleResourceGroup", "exampleSecurityConnectorName", com.azure.core.util.Context.NONE) .getValue(); resource .update() @@ -5199,8 +5197,6 @@ public final class SecurityContactsCreateSamples { ### SecurityContacts_Delete ```java -import com.azure.core.util.Context; - /** Samples for SecurityContacts Delete. */ public final class SecurityContactsDeleteSamples { /* @@ -5212,7 +5208,7 @@ public final class SecurityContactsDeleteSamples { * @param manager Entry point to SecurityManager. */ public static void deletesASecurityContactData(com.azure.resourcemanager.security.SecurityManager manager) { - manager.securityContacts().deleteWithResponse("default", Context.NONE); + manager.securityContacts().deleteWithResponse("default", com.azure.core.util.Context.NONE); } } ``` @@ -5220,8 +5216,6 @@ public final class SecurityContactsDeleteSamples { ### SecurityContacts_Get ```java -import com.azure.core.util.Context; - /** Samples for SecurityContacts Get. */ public final class SecurityContactsGetSamples { /* @@ -5233,7 +5227,7 @@ public final class SecurityContactsGetSamples { * @param manager Entry point to SecurityManager. */ public static void getASecurityContact(com.azure.resourcemanager.security.SecurityManager manager) { - manager.securityContacts().getWithResponse("default", Context.NONE); + manager.securityContacts().getWithResponse("default", com.azure.core.util.Context.NONE); } } ``` @@ -5241,8 +5235,6 @@ public final class SecurityContactsGetSamples { ### SecurityContacts_List ```java -import com.azure.core.util.Context; - /** Samples for SecurityContacts List. */ public final class SecurityContactsListSamples { /* @@ -5254,7 +5246,7 @@ public final class SecurityContactsListSamples { * @param manager Entry point to SecurityManager. */ public static void listSecurityContactData(com.azure.resourcemanager.security.SecurityManager manager) { - manager.securityContacts().list(Context.NONE); + manager.securityContacts().list(com.azure.core.util.Context.NONE); } } ``` @@ -5262,8 +5254,6 @@ public final class SecurityContactsListSamples { ### SecuritySolutions_Get ```java -import com.azure.core.util.Context; - /** Samples for SecuritySolutions Get. */ public final class SecuritySolutionsGetSamples { /* @@ -5276,7 +5266,9 @@ public final class SecuritySolutionsGetSamples { */ public static void getASecuritySolutionFromASecurityDataLocation( com.azure.resourcemanager.security.SecurityManager manager) { - manager.securitySolutions().getWithResponse("myRg2", "centralus", "paloalto7", Context.NONE); + manager + .securitySolutions() + .getWithResponse("myRg2", "centralus", "paloalto7", com.azure.core.util.Context.NONE); } } ``` @@ -5284,8 +5276,6 @@ public final class SecuritySolutionsGetSamples { ### SecuritySolutions_List ```java -import com.azure.core.util.Context; - /** Samples for SecuritySolutions List. */ public final class SecuritySolutionsListSamples { /* @@ -5297,7 +5287,7 @@ public final class SecuritySolutionsListSamples { * @param manager Entry point to SecurityManager. */ public static void getSecuritySolutions(com.azure.resourcemanager.security.SecurityManager manager) { - manager.securitySolutions().list(Context.NONE); + manager.securitySolutions().list(com.azure.core.util.Context.NONE); } } ``` @@ -5305,8 +5295,6 @@ public final class SecuritySolutionsListSamples { ### SecuritySolutionsReferenceData_List ```java -import com.azure.core.util.Context; - /** Samples for SecuritySolutionsReferenceData List. */ public final class SecuritySolutionsReferenceDataListSamples { /* @@ -5318,7 +5306,7 @@ public final class SecuritySolutionsReferenceDataListSamples { * @param manager Entry point to SecurityManager. */ public static void getSecuritySolutions(com.azure.resourcemanager.security.SecurityManager manager) { - manager.securitySolutionsReferenceDatas().listWithResponse(Context.NONE); + manager.securitySolutionsReferenceDatas().listWithResponse(com.azure.core.util.Context.NONE); } } ``` @@ -5326,8 +5314,6 @@ public final class SecuritySolutionsReferenceDataListSamples { ### SecuritySolutionsReferenceData_ListByHomeRegion ```java -import com.azure.core.util.Context; - /** Samples for SecuritySolutionsReferenceData ListByHomeRegion. */ public final class SecuritySolutionsReferenceDataListByHomeRegionSamples { /* @@ -5340,7 +5326,9 @@ public final class SecuritySolutionsReferenceDataListByHomeRegionSamples { */ public static void getSecuritySolutionsFromASecurityDataLocation( com.azure.resourcemanager.security.SecurityManager manager) { - manager.securitySolutionsReferenceDatas().listByHomeRegionWithResponse("westcentralus", Context.NONE); + manager + .securitySolutionsReferenceDatas() + .listByHomeRegionWithResponse("westcentralus", com.azure.core.util.Context.NONE); } } ``` @@ -5348,8 +5336,6 @@ public final class SecuritySolutionsReferenceDataListByHomeRegionSamples { ### ServerVulnerabilityAssessment_CreateOrUpdate ```java -import com.azure.core.util.Context; - /** Samples for ServerVulnerabilityAssessment CreateOrUpdate. */ public final class ServerVulnerabilityAssessmentCreateOrUpdateSamples { /* @@ -5366,7 +5352,8 @@ public final class ServerVulnerabilityAssessmentCreateOrUpdateSamples { com.azure.resourcemanager.security.SecurityManager manager) { manager .serverVulnerabilityAssessments() - .createOrUpdateWithResponse("rg1", "Microsoft.Compute", "virtualMachines", "vm1", Context.NONE); + .createOrUpdateWithResponse( + "rg1", "Microsoft.Compute", "virtualMachines", "vm1", com.azure.core.util.Context.NONE); } } ``` @@ -5374,8 +5361,6 @@ public final class ServerVulnerabilityAssessmentCreateOrUpdateSamples { ### ServerVulnerabilityAssessment_Delete ```java -import com.azure.core.util.Context; - /** Samples for ServerVulnerabilityAssessment Delete. */ public final class ServerVulnerabilityAssessmentDeleteSamples { /* @@ -5392,7 +5377,7 @@ public final class ServerVulnerabilityAssessmentDeleteSamples { com.azure.resourcemanager.security.SecurityManager manager) { manager .serverVulnerabilityAssessments() - .delete("rg1", "Microsoft.Compute", "virtualMachines", "vm1", Context.NONE); + .delete("rg1", "Microsoft.Compute", "virtualMachines", "vm1", com.azure.core.util.Context.NONE); } } ``` @@ -5400,8 +5385,6 @@ public final class ServerVulnerabilityAssessmentDeleteSamples { ### ServerVulnerabilityAssessment_Get ```java -import com.azure.core.util.Context; - /** Samples for ServerVulnerabilityAssessment Get. */ public final class ServerVulnerabilityAssessmentGetSamples { /* @@ -5418,7 +5401,7 @@ public final class ServerVulnerabilityAssessmentGetSamples { com.azure.resourcemanager.security.SecurityManager manager) { manager .serverVulnerabilityAssessments() - .getWithResponse("rg1", "Microsoft.Compute", "virtualMachines", "vm1", Context.NONE); + .getWithResponse("rg1", "Microsoft.Compute", "virtualMachines", "vm1", com.azure.core.util.Context.NONE); } } ``` @@ -5426,8 +5409,6 @@ public final class ServerVulnerabilityAssessmentGetSamples { ### ServerVulnerabilityAssessment_ListByExtendedResource ```java -import com.azure.core.util.Context; - /** Samples for ServerVulnerabilityAssessment ListByExtendedResource. */ public final class ServerVulnerabilityAssessmentListByExtendedResourceSamples { /* @@ -5444,7 +5425,8 @@ public final class ServerVulnerabilityAssessmentListByExtendedResourceSamples { com.azure.resourcemanager.security.SecurityManager manager) { manager .serverVulnerabilityAssessments() - .listByExtendedResourceWithResponse("rg1", "Microsoft.Compute", "virtualMachines", "vm1", Context.NONE); + .listByExtendedResourceWithResponse( + "rg1", "Microsoft.Compute", "virtualMachines", "vm1", com.azure.core.util.Context.NONE); } } ``` @@ -5452,7 +5434,6 @@ public final class ServerVulnerabilityAssessmentListByExtendedResourceSamples { ### Settings_Get ```java -import com.azure.core.util.Context; import com.azure.resourcemanager.security.models.SettingName; /** Samples for Settings Get. */ @@ -5466,7 +5447,7 @@ public final class SettingsGetSamples { * @param manager Entry point to SecurityManager. */ public static void getASettingOnSubscription(com.azure.resourcemanager.security.SecurityManager manager) { - manager.settings().getWithResponse(SettingName.MCAS, Context.NONE); + manager.settings().getWithResponse(SettingName.WDATP, com.azure.core.util.Context.NONE); } } ``` @@ -5474,8 +5455,6 @@ public final class SettingsGetSamples { ### Settings_List ```java -import com.azure.core.util.Context; - /** Samples for Settings List. */ public final class SettingsListSamples { /* @@ -5487,7 +5466,7 @@ public final class SettingsListSamples { * @param manager Entry point to SecurityManager. */ public static void getSettingsOfSubscription(com.azure.resourcemanager.security.SecurityManager manager) { - manager.settings().list(Context.NONE); + manager.settings().list(com.azure.core.util.Context.NONE); } } ``` @@ -5495,7 +5474,6 @@ public final class SettingsListSamples { ### Settings_Update ```java -import com.azure.core.util.Context; import com.azure.resourcemanager.security.models.DataExportSettings; import com.azure.resourcemanager.security.models.SettingName; @@ -5512,7 +5490,8 @@ public final class SettingsUpdateSamples { public static void updateASettingForSubscription(com.azure.resourcemanager.security.SecurityManager manager) { manager .settings() - .updateWithResponse(SettingName.MCAS, new DataExportSettings().withEnabled(true), Context.NONE); + .updateWithResponse( + SettingName.WDATP, new DataExportSettings().withEnabled(true), com.azure.core.util.Context.NONE); } } ``` @@ -5520,8 +5499,6 @@ public final class SettingsUpdateSamples { ### SoftwareInventories_Get ```java -import com.azure.core.util.Context; - /** Samples for SoftwareInventories Get. */ public final class SoftwareInventoriesGetSamples { /* @@ -5542,7 +5519,7 @@ public final class SoftwareInventoriesGetSamples { "virtualMachines", "Eitan-Test1", "outlook_16.0.10371.20060", - Context.NONE); + com.azure.core.util.Context.NONE); } } ``` @@ -5550,8 +5527,6 @@ public final class SoftwareInventoriesGetSamples { ### SoftwareInventories_List ```java -import com.azure.core.util.Context; - /** Samples for SoftwareInventories List. */ public final class SoftwareInventoriesListSamples { /* @@ -5564,7 +5539,7 @@ public final class SoftwareInventoriesListSamples { */ public static void getsTheSoftwareInventoryOfAllVirtualMachinesInTheSubscriptions( com.azure.resourcemanager.security.SecurityManager manager) { - manager.softwareInventories().list(Context.NONE); + manager.softwareInventories().list(com.azure.core.util.Context.NONE); } } ``` @@ -5572,8 +5547,6 @@ public final class SoftwareInventoriesListSamples { ### SoftwareInventories_ListByExtendedResource ```java -import com.azure.core.util.Context; - /** Samples for SoftwareInventories ListByExtendedResource. */ public final class SoftwareInventoriesListByExtendedResourceSamples { /* @@ -5588,7 +5561,8 @@ public final class SoftwareInventoriesListByExtendedResourceSamples { com.azure.resourcemanager.security.SecurityManager manager) { manager .softwareInventories() - .listByExtendedResource("EITAN-TESTS", "Microsoft.Compute", "virtualMachines", "Eitan-Test1", Context.NONE); + .listByExtendedResource( + "EITAN-TESTS", "Microsoft.Compute", "virtualMachines", "Eitan-Test1", com.azure.core.util.Context.NONE); } } ``` @@ -5596,7 +5570,6 @@ public final class SoftwareInventoriesListByExtendedResourceSamples { ### SqlVulnerabilityAssessmentBaselineRules_Add ```java -import com.azure.core.util.Context; import com.azure.resourcemanager.security.models.RulesResultsInput; import java.util.Arrays; import java.util.HashMap; @@ -5605,7 +5578,7 @@ import java.util.Map; /** Samples for SqlVulnerabilityAssessmentBaselineRules Add. */ public final class SqlVulnerabilityAssessmentBaselineRulesAddSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2020-07-01-preview/examples/sqlVulnerabilityAssessmentsBaselineRuleOperations/ArcMachineBaselineRules_Add.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-02-01-preview/examples/sqlVulnerabilityAssessmentsBaselineRuleOperations/ArcMachineBaselineRules_Add.json */ /** * Sample code: Create a baseline for all rules. @@ -5626,11 +5599,11 @@ public final class SqlVulnerabilityAssessmentBaselineRulesAddSamples { Arrays.asList(Arrays.asList("userA", "SELECT"), Arrays.asList("userB", "SELECT")), "VA5678", Arrays.asList(Arrays.asList("Test", "0.0.0.0", "125.125.125.125")))), - Context.NONE); + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2020-07-01-preview/examples/sqlVulnerabilityAssessmentsBaselineRuleOperations/ArcMachineBaselineRules_AddLatest.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-02-01-preview/examples/sqlVulnerabilityAssessmentsBaselineRuleOperations/ArcMachineBaselineRules_AddLatest.json */ /** * Sample code: Create a baseline for all rules using the latest scan results. @@ -5645,7 +5618,7 @@ public final class SqlVulnerabilityAssessmentBaselineRulesAddSamples { "55555555-6666-7777-8888-999999999999", "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", new RulesResultsInput().withLatestScan(true).withResults(mapOf()), - Context.NONE); + com.azure.core.util.Context.NONE); } @SuppressWarnings("unchecked") @@ -5669,7 +5642,7 @@ import java.util.Arrays; /** Samples for SqlVulnerabilityAssessmentBaselineRules CreateOrUpdate. */ public final class SqlVulnerabilityAssessmentBaselineRulesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2020-07-01-preview/examples/sqlVulnerabilityAssessmentsBaselineRuleOperations/ArcMachineBaselineRules_PutLatest.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-02-01-preview/examples/sqlVulnerabilityAssessmentsBaselineRuleOperations/ArcMachineBaselineRules_PutLatest.json */ /** * Sample code: Create a baseline using the latest scan results. @@ -5690,7 +5663,7 @@ public final class SqlVulnerabilityAssessmentBaselineRulesCreateOrUpdateSamples } /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2020-07-01-preview/examples/sqlVulnerabilityAssessmentsBaselineRuleOperations/ArcMachineBaselineRules_Put.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-02-01-preview/examples/sqlVulnerabilityAssessmentsBaselineRuleOperations/ArcMachineBaselineRules_Put.json */ /** * Sample code: Create a baseline. @@ -5714,12 +5687,10 @@ public final class SqlVulnerabilityAssessmentBaselineRulesCreateOrUpdateSamples ### SqlVulnerabilityAssessmentBaselineRules_Delete ```java -import com.azure.core.util.Context; - /** Samples for SqlVulnerabilityAssessmentBaselineRules Delete. */ public final class SqlVulnerabilityAssessmentBaselineRulesDeleteSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2020-07-01-preview/examples/sqlVulnerabilityAssessmentsBaselineRuleOperations/ArcMachineBaselineRules_Delete.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-02-01-preview/examples/sqlVulnerabilityAssessmentsBaselineRuleOperations/ArcMachineBaselineRules_Delete.json */ /** * Sample code: Delete the baseline. @@ -5733,7 +5704,7 @@ public final class SqlVulnerabilityAssessmentBaselineRulesDeleteSamples { "VA1234", "55555555-6666-7777-8888-999999999999", "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", - Context.NONE); + com.azure.core.util.Context.NONE); } } ``` @@ -5741,12 +5712,10 @@ public final class SqlVulnerabilityAssessmentBaselineRulesDeleteSamples { ### SqlVulnerabilityAssessmentBaselineRules_Get ```java -import com.azure.core.util.Context; - /** Samples for SqlVulnerabilityAssessmentBaselineRules Get. */ public final class SqlVulnerabilityAssessmentBaselineRulesGetSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2020-07-01-preview/examples/sqlVulnerabilityAssessmentsBaselineRuleOperations/ArcMachineBaselineRules_Get.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-02-01-preview/examples/sqlVulnerabilityAssessmentsBaselineRuleOperations/ArcMachineBaselineRules_Get.json */ /** * Sample code: Get the baseline. @@ -5760,7 +5729,7 @@ public final class SqlVulnerabilityAssessmentBaselineRulesGetSamples { "VA1234", "55555555-6666-7777-8888-999999999999", "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", - Context.NONE); + com.azure.core.util.Context.NONE); } } ``` @@ -5768,12 +5737,10 @@ public final class SqlVulnerabilityAssessmentBaselineRulesGetSamples { ### SqlVulnerabilityAssessmentBaselineRules_List ```java -import com.azure.core.util.Context; - /** Samples for SqlVulnerabilityAssessmentBaselineRules List. */ public final class SqlVulnerabilityAssessmentBaselineRulesListSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2020-07-01-preview/examples/sqlVulnerabilityAssessmentsBaselineRuleOperations/ArcMachineBaselineRules_List.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-02-01-preview/examples/sqlVulnerabilityAssessmentsBaselineRuleOperations/ArcMachineBaselineRules_List.json */ /** * Sample code: List baseline for all rules. @@ -5786,7 +5753,7 @@ public final class SqlVulnerabilityAssessmentBaselineRulesListSamples { .listWithResponse( "55555555-6666-7777-8888-999999999999", "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", - Context.NONE); + com.azure.core.util.Context.NONE); } } ``` @@ -5794,12 +5761,10 @@ public final class SqlVulnerabilityAssessmentBaselineRulesListSamples { ### SqlVulnerabilityAssessmentScanResults_Get ```java -import com.azure.core.util.Context; - /** Samples for SqlVulnerabilityAssessmentScanResults Get. */ public final class SqlVulnerabilityAssessmentScanResultsGetSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2020-07-01-preview/examples/sqlVulnerabilityAssessmentsScanResultsOperations/ArcMachineScanResults_Get.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-02-01-preview/examples/sqlVulnerabilityAssessmentsScanResultsOperations/ArcMachineScanResults_Get.json */ /** * Sample code: Get scan details of a scan record. @@ -5814,11 +5779,11 @@ public final class SqlVulnerabilityAssessmentScanResultsGetSamples { "VA2063", "55555555-6666-7777-8888-999999999999", "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", - Context.NONE); + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2020-07-01-preview/examples/sqlVulnerabilityAssessmentsScanResultsOperations/ArcMachineScanResults_GetLatest.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-02-01-preview/examples/sqlVulnerabilityAssessmentsScanResultsOperations/ArcMachineScanResults_GetLatest.json */ /** * Sample code: Get scan details of the latest scan record. @@ -5833,7 +5798,7 @@ public final class SqlVulnerabilityAssessmentScanResultsGetSamples { "VA2063", "55555555-6666-7777-8888-999999999999", "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", - Context.NONE); + com.azure.core.util.Context.NONE); } } ``` @@ -5841,12 +5806,10 @@ public final class SqlVulnerabilityAssessmentScanResultsGetSamples { ### SqlVulnerabilityAssessmentScanResults_List ```java -import com.azure.core.util.Context; - /** Samples for SqlVulnerabilityAssessmentScanResults List. */ public final class SqlVulnerabilityAssessmentScanResultsListSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2020-07-01-preview/examples/sqlVulnerabilityAssessmentsScanResultsOperations/ArcMachineScanResults_ListLatest.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-02-01-preview/examples/sqlVulnerabilityAssessmentsScanResultsOperations/ArcMachineScanResults_ListLatest.json */ /** * Sample code: List scan results of the latest scan. @@ -5860,11 +5823,11 @@ public final class SqlVulnerabilityAssessmentScanResultsListSamples { "latest", "55555555-6666-7777-8888-999999999999", "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", - Context.NONE); + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2020-07-01-preview/examples/sqlVulnerabilityAssessmentsScanResultsOperations/ArcMachineScanResults_List.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-02-01-preview/examples/sqlVulnerabilityAssessmentsScanResultsOperations/ArcMachineScanResults_List.json */ /** * Sample code: List scan results. @@ -5878,7 +5841,7 @@ public final class SqlVulnerabilityAssessmentScanResultsListSamples { "Scheduled-20200623", "55555555-6666-7777-8888-999999999999", "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", - Context.NONE); + com.azure.core.util.Context.NONE); } } ``` @@ -5886,12 +5849,10 @@ public final class SqlVulnerabilityAssessmentScanResultsListSamples { ### SqlVulnerabilityAssessmentScans_Get ```java -import com.azure.core.util.Context; - /** Samples for SqlVulnerabilityAssessmentScans Get. */ public final class SqlVulnerabilityAssessmentScansGetSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2020-07-01-preview/examples/sqlVulnerabilityAssessmentScanOperations/ArcMachineScans_Get.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-02-01-preview/examples/sqlVulnerabilityAssessmentScanOperations/ArcMachineScans_Get.json */ /** * Sample code: Get scan details of a scan record. @@ -5905,11 +5866,11 @@ public final class SqlVulnerabilityAssessmentScansGetSamples { "Scheduled-20200623", "55555555-6666-7777-8888-999999999999", "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", - Context.NONE); + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2020-07-01-preview/examples/sqlVulnerabilityAssessmentScanOperations/ArcMachineScans_GetLatest.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-02-01-preview/examples/sqlVulnerabilityAssessmentScanOperations/ArcMachineScans_GetLatest.json */ /** * Sample code: Get scan details of the latest scan record. @@ -5923,7 +5884,7 @@ public final class SqlVulnerabilityAssessmentScansGetSamples { "latest", "55555555-6666-7777-8888-999999999999", "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", - Context.NONE); + com.azure.core.util.Context.NONE); } } ``` @@ -5931,12 +5892,10 @@ public final class SqlVulnerabilityAssessmentScansGetSamples { ### SqlVulnerabilityAssessmentScans_List ```java -import com.azure.core.util.Context; - /** Samples for SqlVulnerabilityAssessmentScans List. */ public final class SqlVulnerabilityAssessmentScansListSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2020-07-01-preview/examples/sqlVulnerabilityAssessmentScanOperations/ArcMachineScans_List.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-02-01-preview/examples/sqlVulnerabilityAssessmentScanOperations/ArcMachineScans_List.json */ /** * Sample code: List scan details. @@ -5949,7 +5908,7 @@ public final class SqlVulnerabilityAssessmentScansListSamples { .listWithResponse( "55555555-6666-7777-8888-999999999999", "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", - Context.NONE); + com.azure.core.util.Context.NONE); } } ``` @@ -5957,8 +5916,6 @@ public final class SqlVulnerabilityAssessmentScansListSamples { ### SubAssessments_Get ```java -import com.azure.core.util.Context; - /** Samples for SubAssessments Get. */ public final class SubAssessmentsGetSamples { /* @@ -5977,7 +5934,7 @@ public final class SubAssessmentsGetSamples { "subscriptions/212f9889-769e-45ae-ab43-6da33674bd26/resourceGroups/DEMORG/providers/Microsoft.Compute/virtualMachines/vm2", "1195afff-c881-495e-9bc5-1486211ae03f", "95f7da9c-a2a4-1322-0758-fcd24ef09b85", - Context.NONE); + com.azure.core.util.Context.NONE); } } ``` @@ -5985,8 +5942,6 @@ public final class SubAssessmentsGetSamples { ### SubAssessments_List ```java -import com.azure.core.util.Context; - /** Samples for SubAssessments List. */ public final class SubAssessmentsListSamples { /* @@ -6003,7 +5958,7 @@ public final class SubAssessmentsListSamples { .list( "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", "82e20e14-edc5-4373-bfc4-f13121257c37", - Context.NONE); + com.azure.core.util.Context.NONE); } } ``` @@ -6011,8 +5966,6 @@ public final class SubAssessmentsListSamples { ### SubAssessments_ListAll ```java -import com.azure.core.util.Context; - /** Samples for SubAssessments ListAll. */ public final class SubAssessmentsListAllSamples { /* @@ -6024,31 +5977,9 @@ public final class SubAssessmentsListAllSamples { * @param manager Entry point to SecurityManager. */ public static void listSecuritySubAssessments(com.azure.resourcemanager.security.SecurityManager manager) { - manager.subAssessments().listAll("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", Context.NONE); - } -} -``` - -### SubscriptionGovernanceRulesExecuteStatus_Get - -```java -import com.azure.core.util.Context; - -/** Samples for SubscriptionGovernanceRulesExecuteStatus Get. */ -public final class SubscriptionGovernanceRulesExecuteStatusGetSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/GetGovernanceRuleExecuteStatus_example.json - */ - /** - * Sample code: Get security governanceRules execution status by specific governanceRuleId. - * - * @param manager Entry point to SecurityManager. - */ - public static void getSecurityGovernanceRulesExecutionStatusBySpecificGovernanceRuleId( - com.azure.resourcemanager.security.SecurityManager manager) { manager - .subscriptionGovernanceRulesExecuteStatus() - .get("ad9a8e26-29d9-4829-bb30-e597a58cdbb8", "58b33f4f-c8c7-4b01-99cc-d437db4d40dd", Context.NONE); + .subAssessments() + .listAll("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", com.azure.core.util.Context.NONE); } } ``` @@ -6056,8 +5987,6 @@ public final class SubscriptionGovernanceRulesExecuteStatusGetSamples { ### Tasks_GetResourceGroupLevelTask ```java -import com.azure.core.util.Context; - /** Samples for Tasks GetResourceGroupLevelTask. */ public final class TasksGetResourceGroupLevelTaskSamples { /* @@ -6073,7 +6002,7 @@ public final class TasksGetResourceGroupLevelTaskSamples { manager .tasks() .getResourceGroupLevelTaskWithResponse( - "myRg", "westeurope", "d55b4dc0-779c-c66c-33e5-d7bce24c4222", Context.NONE); + "myRg", "westeurope", "d55b4dc0-779c-c66c-33e5-d7bce24c4222", com.azure.core.util.Context.NONE); } } ``` @@ -6081,8 +6010,6 @@ public final class TasksGetResourceGroupLevelTaskSamples { ### Tasks_GetSubscriptionLevelTask ```java -import com.azure.core.util.Context; - /** Samples for Tasks GetSubscriptionLevelTask. */ public final class TasksGetSubscriptionLevelTaskSamples { /* @@ -6097,7 +6024,8 @@ public final class TasksGetSubscriptionLevelTaskSamples { com.azure.resourcemanager.security.SecurityManager manager) { manager .tasks() - .getSubscriptionLevelTaskWithResponse("westeurope", "62609ee7-d0a5-8616-9fe4-1df5cca7758d", Context.NONE); + .getSubscriptionLevelTaskWithResponse( + "westeurope", "62609ee7-d0a5-8616-9fe4-1df5cca7758d", com.azure.core.util.Context.NONE); } } ``` @@ -6105,8 +6033,6 @@ public final class TasksGetSubscriptionLevelTaskSamples { ### Tasks_List ```java -import com.azure.core.util.Context; - /** Samples for Tasks List. */ public final class TasksListSamples { /* @@ -6118,7 +6044,7 @@ public final class TasksListSamples { * @param manager Entry point to SecurityManager. */ public static void getSecurityRecommendationsTasks(com.azure.resourcemanager.security.SecurityManager manager) { - manager.tasks().list(null, Context.NONE); + manager.tasks().list(null, com.azure.core.util.Context.NONE); } } ``` @@ -6126,8 +6052,6 @@ public final class TasksListSamples { ### Tasks_ListByHomeRegion ```java -import com.azure.core.util.Context; - /** Samples for Tasks ListByHomeRegion. */ public final class TasksListByHomeRegionSamples { /* @@ -6140,7 +6064,7 @@ public final class TasksListByHomeRegionSamples { */ public static void getSecurityRecommendationsTasksFromSecurityDataLocation( com.azure.resourcemanager.security.SecurityManager manager) { - manager.tasks().listByHomeRegion("westeurope", null, Context.NONE); + manager.tasks().listByHomeRegion("westeurope", null, com.azure.core.util.Context.NONE); } } ``` @@ -6148,8 +6072,6 @@ public final class TasksListByHomeRegionSamples { ### Tasks_ListByResourceGroup ```java -import com.azure.core.util.Context; - /** Samples for Tasks ListByResourceGroup. */ public final class TasksListByResourceGroupSamples { /* @@ -6162,7 +6084,7 @@ public final class TasksListByResourceGroupSamples { */ public static void getSecurityRecommendationTasksInAResourceGroup( com.azure.resourcemanager.security.SecurityManager manager) { - manager.tasks().listByResourceGroup("myRg", "westeurope", null, Context.NONE); + manager.tasks().listByResourceGroup("myRg", "westeurope", null, com.azure.core.util.Context.NONE); } } ``` @@ -6170,7 +6092,6 @@ public final class TasksListByResourceGroupSamples { ### Tasks_UpdateResourceGroupLevelTaskState ```java -import com.azure.core.util.Context; import com.azure.resourcemanager.security.models.TaskUpdateActionType; /** Samples for Tasks UpdateResourceGroupLevelTaskState. */ @@ -6192,7 +6113,7 @@ public final class TasksUpdateResourceGroupLevelTaskStateSamples { "westeurope", "d55b4dc0-779c-c66c-33e5-d7bce24c4222", TaskUpdateActionType.DISMISS, - Context.NONE); + com.azure.core.util.Context.NONE); } } ``` @@ -6200,7 +6121,6 @@ public final class TasksUpdateResourceGroupLevelTaskStateSamples { ### Tasks_UpdateSubscriptionLevelTaskState ```java -import com.azure.core.util.Context; import com.azure.resourcemanager.security.models.TaskUpdateActionType; /** Samples for Tasks UpdateSubscriptionLevelTaskState. */ @@ -6218,7 +6138,10 @@ public final class TasksUpdateSubscriptionLevelTaskStateSamples { manager .tasks() .updateSubscriptionLevelTaskStateWithResponse( - "westeurope", "62609ee7-d0a5-8616-9fe4-1df5cca7758d", TaskUpdateActionType.DISMISS, Context.NONE); + "westeurope", + "62609ee7-d0a5-8616-9fe4-1df5cca7758d", + TaskUpdateActionType.DISMISS, + com.azure.core.util.Context.NONE); } } ``` @@ -6226,8 +6149,6 @@ public final class TasksUpdateSubscriptionLevelTaskStateSamples { ### Topology_Get ```java -import com.azure.core.util.Context; - /** Samples for Topology Get. */ public final class TopologyGetSamples { /* @@ -6239,7 +6160,7 @@ public final class TopologyGetSamples { * @param manager Entry point to SecurityManager. */ public static void getTopology(com.azure.resourcemanager.security.SecurityManager manager) { - manager.topologies().getWithResponse("myservers", "centralus", "vnets", Context.NONE); + manager.topologies().getWithResponse("myservers", "centralus", "vnets", com.azure.core.util.Context.NONE); } } ``` @@ -6247,8 +6168,6 @@ public final class TopologyGetSamples { ### Topology_List ```java -import com.azure.core.util.Context; - /** Samples for Topology List. */ public final class TopologyListSamples { /* @@ -6260,7 +6179,7 @@ public final class TopologyListSamples { * @param manager Entry point to SecurityManager. */ public static void getTopologyOnASubscription(com.azure.resourcemanager.security.SecurityManager manager) { - manager.topologies().list(Context.NONE); + manager.topologies().list(com.azure.core.util.Context.NONE); } } ``` @@ -6268,8 +6187,6 @@ public final class TopologyListSamples { ### Topology_ListByHomeRegion ```java -import com.azure.core.util.Context; - /** Samples for Topology ListByHomeRegion. */ public final class TopologyListByHomeRegionSamples { /* @@ -6282,7 +6199,7 @@ public final class TopologyListByHomeRegionSamples { */ public static void getTopologyOnASubscriptionFromSecurityDataLocation( com.azure.resourcemanager.security.SecurityManager manager) { - manager.topologies().listByHomeRegion("centralus", Context.NONE); + manager.topologies().listByHomeRegion("centralus", com.azure.core.util.Context.NONE); } } ``` @@ -6316,8 +6233,6 @@ public final class WorkspaceSettingsCreateSamples { ### WorkspaceSettings_Delete ```java -import com.azure.core.util.Context; - /** Samples for WorkspaceSettings Delete. */ public final class WorkspaceSettingsDeleteSamples { /* @@ -6330,7 +6245,7 @@ public final class WorkspaceSettingsDeleteSamples { */ public static void deleteAWorkspaceSettingDataForResourceGroup( com.azure.resourcemanager.security.SecurityManager manager) { - manager.workspaceSettings().deleteWithResponse("default", Context.NONE); + manager.workspaceSettings().deleteWithResponse("default", com.azure.core.util.Context.NONE); } } ``` @@ -6338,8 +6253,6 @@ public final class WorkspaceSettingsDeleteSamples { ### WorkspaceSettings_Get ```java -import com.azure.core.util.Context; - /** Samples for WorkspaceSettings Get. */ public final class WorkspaceSettingsGetSamples { /* @@ -6351,7 +6264,7 @@ public final class WorkspaceSettingsGetSamples { * @param manager Entry point to SecurityManager. */ public static void getAWorkspaceSettingOnSubscription(com.azure.resourcemanager.security.SecurityManager manager) { - manager.workspaceSettings().getWithResponse("default", Context.NONE); + manager.workspaceSettings().getWithResponse("default", com.azure.core.util.Context.NONE); } } ``` @@ -6359,8 +6272,6 @@ public final class WorkspaceSettingsGetSamples { ### WorkspaceSettings_List ```java -import com.azure.core.util.Context; - /** Samples for WorkspaceSettings List. */ public final class WorkspaceSettingsListSamples { /* @@ -6372,7 +6283,7 @@ public final class WorkspaceSettingsListSamples { * @param manager Entry point to SecurityManager. */ public static void getWorkspaceSettingsOnSubscription(com.azure.resourcemanager.security.SecurityManager manager) { - manager.workspaceSettings().list(Context.NONE); + manager.workspaceSettings().list(com.azure.core.util.Context.NONE); } } ``` @@ -6380,7 +6291,6 @@ public final class WorkspaceSettingsListSamples { ### WorkspaceSettings_Update ```java -import com.azure.core.util.Context; import com.azure.resourcemanager.security.models.WorkspaceSetting; /** Samples for WorkspaceSettings Update. */ @@ -6395,7 +6305,8 @@ public final class WorkspaceSettingsUpdateSamples { */ public static void updateAWorkspaceSettingDataForSubscription( com.azure.resourcemanager.security.SecurityManager manager) { - WorkspaceSetting resource = manager.workspaceSettings().getWithResponse("default", Context.NONE).getValue(); + WorkspaceSetting resource = + manager.workspaceSettings().getWithResponse("default", com.azure.core.util.Context.NONE).getValue(); resource .update() .withWorkspaceId( diff --git a/sdk/security/azure-resourcemanager-security/pom.xml b/sdk/security/azure-resourcemanager-security/pom.xml index cf8c20c697a6d..59dba9b0279f2 100644 --- a/sdk/security/azure-resourcemanager-security/pom.xml +++ b/sdk/security/azure-resourcemanager-security/pom.xml @@ -1,3 +1,8 @@ + 4.0.0 @@ -38,7 +43,8 @@ UTF-8 - true + 0 + 0 diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/SecurityManager.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/SecurityManager.java index 4da6685a18db2..c5b835d4af3ec 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/SecurityManager.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/SecurityManager.java @@ -49,7 +49,8 @@ import com.azure.resourcemanager.security.implementation.ExternalSecuritySolutionsImpl; import com.azure.resourcemanager.security.implementation.GovernanceAssignmentsImpl; import com.azure.resourcemanager.security.implementation.GovernanceRulesImpl; -import com.azure.resourcemanager.security.implementation.GovernanceRulesOperationsImpl; +import com.azure.resourcemanager.security.implementation.HealthReportOperationsImpl; +import com.azure.resourcemanager.security.implementation.HealthReportsImpl; import com.azure.resourcemanager.security.implementation.InformationProtectionPoliciesImpl; import com.azure.resourcemanager.security.implementation.IngestionSettingsImpl; import com.azure.resourcemanager.security.implementation.IotSecuritySolutionAnalyticsImpl; @@ -70,9 +71,6 @@ import com.azure.resourcemanager.security.implementation.SecurityCenterBuilder; import com.azure.resourcemanager.security.implementation.SecurityConnectorApplicationOperationsImpl; import com.azure.resourcemanager.security.implementation.SecurityConnectorApplicationsImpl; -import com.azure.resourcemanager.security.implementation.SecurityConnectorGovernanceRulesExecuteStatusImpl; -import com.azure.resourcemanager.security.implementation.SecurityConnectorGovernanceRulesImpl; -import com.azure.resourcemanager.security.implementation.SecurityConnectorGovernanceRulesOperationsImpl; import com.azure.resourcemanager.security.implementation.SecurityConnectorsImpl; import com.azure.resourcemanager.security.implementation.SecurityContactsImpl; import com.azure.resourcemanager.security.implementation.SecuritySolutionsImpl; @@ -84,7 +82,6 @@ import com.azure.resourcemanager.security.implementation.SqlVulnerabilityAssessmentScanResultsImpl; import com.azure.resourcemanager.security.implementation.SqlVulnerabilityAssessmentScansImpl; import com.azure.resourcemanager.security.implementation.SubAssessmentsImpl; -import com.azure.resourcemanager.security.implementation.SubscriptionGovernanceRulesExecuteStatusImpl; import com.azure.resourcemanager.security.implementation.TasksImpl; import com.azure.resourcemanager.security.implementation.TopologiesImpl; import com.azure.resourcemanager.security.implementation.WorkspaceSettingsImpl; @@ -113,7 +110,8 @@ import com.azure.resourcemanager.security.models.ExternalSecuritySolutions; import com.azure.resourcemanager.security.models.GovernanceAssignments; import com.azure.resourcemanager.security.models.GovernanceRules; -import com.azure.resourcemanager.security.models.GovernanceRulesOperations; +import com.azure.resourcemanager.security.models.HealthReportOperations; +import com.azure.resourcemanager.security.models.HealthReports; import com.azure.resourcemanager.security.models.InformationProtectionPolicies; import com.azure.resourcemanager.security.models.IngestionSettings; import com.azure.resourcemanager.security.models.IotSecuritySolutionAnalytics; @@ -133,9 +131,6 @@ import com.azure.resourcemanager.security.models.SecureScores; import com.azure.resourcemanager.security.models.SecurityConnectorApplicationOperations; import com.azure.resourcemanager.security.models.SecurityConnectorApplications; -import com.azure.resourcemanager.security.models.SecurityConnectorGovernanceRules; -import com.azure.resourcemanager.security.models.SecurityConnectorGovernanceRulesExecuteStatus; -import com.azure.resourcemanager.security.models.SecurityConnectorGovernanceRulesOperations; import com.azure.resourcemanager.security.models.SecurityConnectors; import com.azure.resourcemanager.security.models.SecurityContacts; import com.azure.resourcemanager.security.models.SecuritySolutions; @@ -147,7 +142,6 @@ import com.azure.resourcemanager.security.models.SqlVulnerabilityAssessmentScanResults; import com.azure.resourcemanager.security.models.SqlVulnerabilityAssessmentScans; import com.azure.resourcemanager.security.models.SubAssessments; -import com.azure.resourcemanager.security.models.SubscriptionGovernanceRulesExecuteStatus; import com.azure.resourcemanager.security.models.Tasks; import com.azure.resourcemanager.security.models.Topologies; import com.azure.resourcemanager.security.models.WorkspaceSettings; @@ -242,12 +236,6 @@ public final class SecurityManager { private Connectors connectors; - private SqlVulnerabilityAssessmentScans sqlVulnerabilityAssessmentScans; - - private SqlVulnerabilityAssessmentScanResults sqlVulnerabilityAssessmentScanResults; - - private SqlVulnerabilityAssessmentBaselineRules sqlVulnerabilityAssessmentBaselineRules; - private Alerts alerts; private Settings settings; @@ -260,16 +248,6 @@ public final class SecurityManager { private GovernanceRules governanceRules; - private GovernanceRulesOperations governanceRulesOperations; - - private SecurityConnectorGovernanceRules securityConnectorGovernanceRules; - - private SecurityConnectorGovernanceRulesOperations securityConnectorGovernanceRulesOperations; - - private SubscriptionGovernanceRulesExecuteStatus subscriptionGovernanceRulesExecuteStatus; - - private SecurityConnectorGovernanceRulesExecuteStatus securityConnectorGovernanceRulesExecuteStatus; - private GovernanceAssignments governanceAssignments; private Applications applications; @@ -286,6 +264,16 @@ public final class SecurityManager { private ApiCollectionOffboardings apiCollectionOffboardings; + private HealthReports healthReports; + + private HealthReportOperations healthReportOperations; + + private SqlVulnerabilityAssessmentScans sqlVulnerabilityAssessmentScans; + + private SqlVulnerabilityAssessmentScanResults sqlVulnerabilityAssessmentScanResults; + + private SqlVulnerabilityAssessmentBaselineRules sqlVulnerabilityAssessmentBaselineRules; + private final SecurityCenter clientObject; private SecurityManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { @@ -451,7 +439,7 @@ public SecurityManager authenticate(TokenCredential credential, AzureProfile pro .append("-") .append("com.azure.resourcemanager.security") .append("/") - .append("1.0.0-beta.3"); + .append("1.0.0-beta.1"); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder .append(" (") @@ -1022,47 +1010,6 @@ public Connectors connectors() { return connectors; } - /** - * Gets the resource collection API of SqlVulnerabilityAssessmentScans. - * - * @return Resource collection API of SqlVulnerabilityAssessmentScans. - */ - public SqlVulnerabilityAssessmentScans sqlVulnerabilityAssessmentScans() { - if (this.sqlVulnerabilityAssessmentScans == null) { - this.sqlVulnerabilityAssessmentScans = - new SqlVulnerabilityAssessmentScansImpl(clientObject.getSqlVulnerabilityAssessmentScans(), this); - } - return sqlVulnerabilityAssessmentScans; - } - - /** - * Gets the resource collection API of SqlVulnerabilityAssessmentScanResults. - * - * @return Resource collection API of SqlVulnerabilityAssessmentScanResults. - */ - public SqlVulnerabilityAssessmentScanResults sqlVulnerabilityAssessmentScanResults() { - if (this.sqlVulnerabilityAssessmentScanResults == null) { - this.sqlVulnerabilityAssessmentScanResults = - new SqlVulnerabilityAssessmentScanResultsImpl( - clientObject.getSqlVulnerabilityAssessmentScanResults(), this); - } - return sqlVulnerabilityAssessmentScanResults; - } - - /** - * Gets the resource collection API of SqlVulnerabilityAssessmentBaselineRules. It manages RuleResults. - * - * @return Resource collection API of SqlVulnerabilityAssessmentBaselineRules. - */ - public SqlVulnerabilityAssessmentBaselineRules sqlVulnerabilityAssessmentBaselineRules() { - if (this.sqlVulnerabilityAssessmentBaselineRules == null) { - this.sqlVulnerabilityAssessmentBaselineRules = - new SqlVulnerabilityAssessmentBaselineRulesImpl( - clientObject.getSqlVulnerabilityAssessmentBaselineRules(), this); - } - return sqlVulnerabilityAssessmentBaselineRules; - } - /** * Gets the resource collection API of Alerts. * @@ -1124,7 +1071,7 @@ public SecurityConnectors securityConnectors() { } /** - * Gets the resource collection API of GovernanceRules. + * Gets the resource collection API of GovernanceRules. It manages GovernanceRule. * * @return Resource collection API of GovernanceRules. */ @@ -1135,74 +1082,6 @@ public GovernanceRules governanceRules() { return governanceRules; } - /** - * Gets the resource collection API of GovernanceRulesOperations. It manages GovernanceRule. - * - * @return Resource collection API of GovernanceRulesOperations. - */ - public GovernanceRulesOperations governanceRulesOperations() { - if (this.governanceRulesOperations == null) { - this.governanceRulesOperations = - new GovernanceRulesOperationsImpl(clientObject.getGovernanceRulesOperations(), this); - } - return governanceRulesOperations; - } - - /** - * Gets the resource collection API of SecurityConnectorGovernanceRules. - * - * @return Resource collection API of SecurityConnectorGovernanceRules. - */ - public SecurityConnectorGovernanceRules securityConnectorGovernanceRules() { - if (this.securityConnectorGovernanceRules == null) { - this.securityConnectorGovernanceRules = - new SecurityConnectorGovernanceRulesImpl(clientObject.getSecurityConnectorGovernanceRules(), this); - } - return securityConnectorGovernanceRules; - } - - /** - * Gets the resource collection API of SecurityConnectorGovernanceRulesOperations. - * - * @return Resource collection API of SecurityConnectorGovernanceRulesOperations. - */ - public SecurityConnectorGovernanceRulesOperations securityConnectorGovernanceRulesOperations() { - if (this.securityConnectorGovernanceRulesOperations == null) { - this.securityConnectorGovernanceRulesOperations = - new SecurityConnectorGovernanceRulesOperationsImpl( - clientObject.getSecurityConnectorGovernanceRulesOperations(), this); - } - return securityConnectorGovernanceRulesOperations; - } - - /** - * Gets the resource collection API of SubscriptionGovernanceRulesExecuteStatus. - * - * @return Resource collection API of SubscriptionGovernanceRulesExecuteStatus. - */ - public SubscriptionGovernanceRulesExecuteStatus subscriptionGovernanceRulesExecuteStatus() { - if (this.subscriptionGovernanceRulesExecuteStatus == null) { - this.subscriptionGovernanceRulesExecuteStatus = - new SubscriptionGovernanceRulesExecuteStatusImpl( - clientObject.getSubscriptionGovernanceRulesExecuteStatus(), this); - } - return subscriptionGovernanceRulesExecuteStatus; - } - - /** - * Gets the resource collection API of SecurityConnectorGovernanceRulesExecuteStatus. - * - * @return Resource collection API of SecurityConnectorGovernanceRulesExecuteStatus. - */ - public SecurityConnectorGovernanceRulesExecuteStatus securityConnectorGovernanceRulesExecuteStatus() { - if (this.securityConnectorGovernanceRulesExecuteStatus == null) { - this.securityConnectorGovernanceRulesExecuteStatus = - new SecurityConnectorGovernanceRulesExecuteStatusImpl( - clientObject.getSecurityConnectorGovernanceRulesExecuteStatus(), this); - } - return securityConnectorGovernanceRulesExecuteStatus; - } - /** * Gets the resource collection API of GovernanceAssignments. It manages GovernanceAssignment. * @@ -1304,6 +1183,72 @@ public ApiCollectionOffboardings apiCollectionOffboardings() { return apiCollectionOffboardings; } + /** + * Gets the resource collection API of HealthReports. + * + * @return Resource collection API of HealthReports. + */ + public HealthReports healthReports() { + if (this.healthReports == null) { + this.healthReports = new HealthReportsImpl(clientObject.getHealthReports(), this); + } + return healthReports; + } + + /** + * Gets the resource collection API of HealthReportOperations. + * + * @return Resource collection API of HealthReportOperations. + */ + public HealthReportOperations healthReportOperations() { + if (this.healthReportOperations == null) { + this.healthReportOperations = + new HealthReportOperationsImpl(clientObject.getHealthReportOperations(), this); + } + return healthReportOperations; + } + + /** + * Gets the resource collection API of SqlVulnerabilityAssessmentScans. + * + * @return Resource collection API of SqlVulnerabilityAssessmentScans. + */ + public SqlVulnerabilityAssessmentScans sqlVulnerabilityAssessmentScans() { + if (this.sqlVulnerabilityAssessmentScans == null) { + this.sqlVulnerabilityAssessmentScans = + new SqlVulnerabilityAssessmentScansImpl(clientObject.getSqlVulnerabilityAssessmentScans(), this); + } + return sqlVulnerabilityAssessmentScans; + } + + /** + * Gets the resource collection API of SqlVulnerabilityAssessmentScanResults. + * + * @return Resource collection API of SqlVulnerabilityAssessmentScanResults. + */ + public SqlVulnerabilityAssessmentScanResults sqlVulnerabilityAssessmentScanResults() { + if (this.sqlVulnerabilityAssessmentScanResults == null) { + this.sqlVulnerabilityAssessmentScanResults = + new SqlVulnerabilityAssessmentScanResultsImpl( + clientObject.getSqlVulnerabilityAssessmentScanResults(), this); + } + return sqlVulnerabilityAssessmentScanResults; + } + + /** + * Gets the resource collection API of SqlVulnerabilityAssessmentBaselineRules. It manages RuleResults. + * + * @return Resource collection API of SqlVulnerabilityAssessmentBaselineRules. + */ + public SqlVulnerabilityAssessmentBaselineRules sqlVulnerabilityAssessmentBaselineRules() { + if (this.sqlVulnerabilityAssessmentBaselineRules == null) { + this.sqlVulnerabilityAssessmentBaselineRules = + new SqlVulnerabilityAssessmentBaselineRulesImpl( + clientObject.getSqlVulnerabilityAssessmentBaselineRules(), this); + } + return sqlVulnerabilityAssessmentBaselineRules; + } + /** * @return Wrapped service client SecurityCenter providing direct access to the underlying auto-generated API * implementation, based on Azure REST API. diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/GovernanceAssignmentsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/GovernanceAssignmentsClient.java index 611311e8ef0b1..ab8458ddf09cb 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/GovernanceAssignmentsClient.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/GovernanceAssignmentsClient.java @@ -14,31 +14,33 @@ /** An instance of this class provides access to all the operations defined in GovernanceAssignmentsClient. */ public interface GovernanceAssignmentsClient { /** - * Get security governanceAssignments on all your resources inside a scope. + * Get governance assignments on all of your resources inside a scope. * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param assessmentName The Assessment Key - Unique key for the assessment type. + * @param scope The scope of the Governance assignments. Valid scopes are: subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * @param assessmentName The Assessment Key - A unique key for the assessment type. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security governanceAssignments on all your resources inside a scope as paginated response with {@link + * @return governance assignments on all of your resources inside a scope as paginated response with {@link * PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(String scope, String assessmentName); /** - * Get security governanceAssignments on all your resources inside a scope. + * Get governance assignments on all of your resources inside a scope. * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param assessmentName The Assessment Key - Unique key for the assessment type. + * @param scope The scope of the Governance assignments. Valid scopes are: subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * @param assessmentName The Assessment Key - A unique key for the assessment type. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security governanceAssignments on all your resources inside a scope as paginated response with {@link + * @return governance assignments on all of your resources inside a scope as paginated response with {@link * PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) @@ -47,11 +49,11 @@ public interface GovernanceAssignmentsClient { /** * Get a specific governanceAssignment for the requested scope by AssignmentKey. * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param assessmentName The Assessment Key - Unique key for the assessment type. - * @param assignmentKey The security governance assignment key - the assessment key of the required governance - * assignment. + * @param scope The scope of the Governance assignments. Valid scopes are: subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * @param assessmentName The Assessment Key - A unique key for the assessment type. + * @param assignmentKey The governance assignment key - the assessment key of the required governance assignment. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -65,11 +67,11 @@ Response getWithResponse( /** * Get a specific governanceAssignment for the requested scope by AssignmentKey. * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param assessmentName The Assessment Key - Unique key for the assessment type. - * @param assignmentKey The security governance assignment key - the assessment key of the required governance - * assignment. + * @param scope The scope of the Governance assignments. Valid scopes are: subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * @param assessmentName The Assessment Key - A unique key for the assessment type. + * @param assignmentKey The governance assignment key - the assessment key of the required governance assignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -79,19 +81,19 @@ Response getWithResponse( GovernanceAssignmentInner get(String scope, String assessmentName, String assignmentKey); /** - * Creates or update a security GovernanceAssignment on the given subscription. + * Creates or updates a governance assignment on the given subscription. * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param assessmentName The Assessment Key - Unique key for the assessment type. - * @param assignmentKey The security governance assignment key - the assessment key of the required governance - * assignment. - * @param governanceAssignment GovernanceAssignment over a subscription scope. + * @param scope The scope of the Governance assignments. Valid scopes are: subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * @param assessmentName The Assessment Key - A unique key for the assessment type. + * @param assignmentKey The governance assignment key - the assessment key of the required governance assignment. + * @param governanceAssignment Governance assignment over a subscription scope. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security GovernanceAssignment over a given scope along with {@link Response}. + * @return governance assignment over a given scope along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response createOrUpdateWithResponse( @@ -102,18 +104,18 @@ Response createOrUpdateWithResponse( Context context); /** - * Creates or update a security GovernanceAssignment on the given subscription. + * Creates or updates a governance assignment on the given subscription. * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param assessmentName The Assessment Key - Unique key for the assessment type. - * @param assignmentKey The security governance assignment key - the assessment key of the required governance - * assignment. - * @param governanceAssignment GovernanceAssignment over a subscription scope. + * @param scope The scope of the Governance assignments. Valid scopes are: subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * @param assessmentName The Assessment Key - A unique key for the assessment type. + * @param assignmentKey The governance assignment key - the assessment key of the required governance assignment. + * @param governanceAssignment Governance assignment over a subscription scope. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security GovernanceAssignment over a given scope. + * @return governance assignment over a given scope. */ @ServiceMethod(returns = ReturnType.SINGLE) GovernanceAssignmentInner createOrUpdate( @@ -122,11 +124,11 @@ GovernanceAssignmentInner createOrUpdate( /** * Delete a GovernanceAssignment over a given scope. * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param assessmentName The Assessment Key - Unique key for the assessment type. - * @param assignmentKey The security governance assignment key - the assessment key of the required governance - * assignment. + * @param scope The scope of the Governance assignments. Valid scopes are: subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * @param assessmentName The Assessment Key - A unique key for the assessment type. + * @param assignmentKey The governance assignment key - the assessment key of the required governance assignment. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -139,11 +141,11 @@ GovernanceAssignmentInner createOrUpdate( /** * Delete a GovernanceAssignment over a given scope. * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param assessmentName The Assessment Key - Unique key for the assessment type. - * @param assignmentKey The security governance assignment key - the assessment key of the required governance - * assignment. + * @param scope The scope of the Governance assignments. Valid scopes are: subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * @param assessmentName The Assessment Key - A unique key for the assessment type. + * @param assignmentKey The governance assignment key - the assessment key of the required governance assignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/GovernanceRulesClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/GovernanceRulesClient.java index 02a824e96f3f1..d6f4ace6458cf 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/GovernanceRulesClient.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/GovernanceRulesClient.java @@ -7,32 +7,281 @@ import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.security.fluent.models.GovernanceRuleInner; +import com.azure.resourcemanager.security.fluent.models.OperationResultAutoGeneratedInner; +import com.azure.resourcemanager.security.models.ExecuteGovernanceRuleParams; +import com.azure.resourcemanager.security.models.GovernanceRulesOperationResultsResponse; /** An instance of this class provides access to all the operations defined in GovernanceRulesClient. */ public interface GovernanceRulesClient { /** - * Get a list of all relevant governanceRules over a subscription level scope. + * Get a list of all relevant governance rules over a scope. * + * @param scope The scope of the Governance rules. Valid scopes are: management group (format: + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all relevant governanceRules over a subscription level scope as paginated response with {@link - * PagedIterable}. + * @return a list of all relevant governance rules over a scope as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); + PagedIterable list(String scope); /** - * Get a list of all relevant governanceRules over a subscription level scope. + * Get a list of all relevant governance rules over a scope. * + * @param scope The scope of the Governance rules. Valid scopes are: management group (format: + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all relevant governanceRules over a subscription level scope as paginated response with {@link - * PagedIterable}. + * @return a list of all relevant governance rules over a scope as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); + PagedIterable list(String scope, Context context); + + /** + * Get a specific governance rule for the requested scope by ruleId. + * + * @param scope The scope of the Governance rules. Valid scopes are: management group (format: + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a specific governance rule for the requested scope by ruleId along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String scope, String ruleId, Context context); + + /** + * Get a specific governance rule for the requested scope by ruleId. + * + * @param scope The scope of the Governance rules. Valid scopes are: management group (format: + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a specific governance rule for the requested scope by ruleId. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GovernanceRuleInner get(String scope, String ruleId); + + /** + * Creates or updates a governance rule over a given scope. + * + * @param scope The scope of the Governance rules. Valid scopes are: management group (format: + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). + * @param governanceRule Governance rule over a given scope. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return governance rule over a given scope along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String scope, String ruleId, GovernanceRuleInner governanceRule, Context context); + + /** + * Creates or updates a governance rule over a given scope. + * + * @param scope The scope of the Governance rules. Valid scopes are: management group (format: + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). + * @param governanceRule Governance rule over a given scope. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return governance rule over a given scope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GovernanceRuleInner createOrUpdate(String scope, String ruleId, GovernanceRuleInner governanceRule); + + /** + * Delete a Governance rule over a given scope. + * + * @param scope The scope of the Governance rules. Valid scopes are: management group (format: + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String scope, String ruleId); + + /** + * Delete a Governance rule over a given scope. + * + * @param scope The scope of the Governance rules. Valid scopes are: management group (format: + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String scope, String ruleId, Context context); + + /** + * Delete a Governance rule over a given scope. + * + * @param scope The scope of the Governance rules. Valid scopes are: management group (format: + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String scope, String ruleId); + + /** + * Delete a Governance rule over a given scope. + * + * @param scope The scope of the Governance rules. Valid scopes are: management group (format: + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String scope, String ruleId, Context context); + + /** + * Execute a governance rule. + * + * @param scope The scope of the Governance rules. Valid scopes are: management group (format: + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginExecute(String scope, String ruleId); + + /** + * Execute a governance rule. + * + * @param scope The scope of the Governance rules. Valid scopes are: management group (format: + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). + * @param executeGovernanceRuleParams Execute governance rule over a given scope. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginExecute( + String scope, String ruleId, ExecuteGovernanceRuleParams executeGovernanceRuleParams, Context context); + + /** + * Execute a governance rule. + * + * @param scope The scope of the Governance rules. Valid scopes are: management group (format: + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void execute(String scope, String ruleId); + + /** + * Execute a governance rule. + * + * @param scope The scope of the Governance rules. Valid scopes are: management group (format: + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). + * @param executeGovernanceRuleParams Execute governance rule over a given scope. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void execute(String scope, String ruleId, ExecuteGovernanceRuleParams executeGovernanceRuleParams, Context context); + + /** + * Get governance rules long run operation result for the requested scope by ruleId and operationId. + * + * @param scope The scope of the Governance rules. Valid scopes are: management group (format: + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). + * @param operationId The governance rule long running operation unique key. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return governance rules long run operation result for the requested scope by ruleId and operationId. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GovernanceRulesOperationResultsResponse operationResultsWithResponse( + String scope, String ruleId, String operationId, Context context); + + /** + * Get governance rules long run operation result for the requested scope by ruleId and operationId. + * + * @param scope The scope of the Governance rules. Valid scopes are: management group (format: + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). + * @param operationId The governance rule long running operation unique key. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return governance rules long run operation result for the requested scope by ruleId and operationId. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationResultAutoGeneratedInner operationResults(String scope, String ruleId, String operationId); } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/GovernanceRulesOperationsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/GovernanceRulesOperationsClient.java deleted file mode 100644 index e178e1f24eaf3..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/GovernanceRulesOperationsClient.java +++ /dev/null @@ -1,219 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.security.fluent.models.GovernanceRuleInner; -import com.azure.resourcemanager.security.models.ExecuteGovernanceRuleParams; - -/** An instance of this class provides access to all the operations defined in GovernanceRulesOperationsClient. */ -public interface GovernanceRulesOperationsClient { - /** - * Get a specific governanceRule for the requested scope by ruleId. - * - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific governanceRule for the requested scope by ruleId along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String ruleId, Context context); - - /** - * Get a specific governanceRule for the requested scope by ruleId. - * - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific governanceRule for the requested scope by ruleId. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - GovernanceRuleInner get(String ruleId); - - /** - * Creates or update a security GovernanceRule on the given subscription. - * - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @param governanceRule GovernanceRule over a subscription scope. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security GovernanceRule over a given scope along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( - String ruleId, GovernanceRuleInner governanceRule, Context context); - - /** - * Creates or update a security GovernanceRule on the given subscription. - * - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @param governanceRule GovernanceRule over a subscription scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security GovernanceRule over a given scope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - GovernanceRuleInner createOrUpdate(String ruleId, GovernanceRuleInner governanceRule); - - /** - * Delete a GovernanceRule over a given scope. - * - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String ruleId, Context context); - - /** - * Delete a GovernanceRule over a given scope. - * - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String ruleId); - - /** - * Execute a security GovernanceRule on the given subscription. - * - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginRuleIdExecuteSingleSubscription(String ruleId); - - /** - * Execute a security GovernanceRule on the given subscription. - * - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @param executeGovernanceRuleParams GovernanceRule over a subscription scope. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginRuleIdExecuteSingleSubscription( - String ruleId, ExecuteGovernanceRuleParams executeGovernanceRuleParams, Context context); - - /** - * Execute a security GovernanceRule on the given subscription. - * - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void ruleIdExecuteSingleSubscription(String ruleId); - - /** - * Execute a security GovernanceRule on the given subscription. - * - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @param executeGovernanceRuleParams GovernanceRule over a subscription scope. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void ruleIdExecuteSingleSubscription( - String ruleId, ExecuteGovernanceRuleParams executeGovernanceRuleParams, Context context); - - /** - * Execute a security GovernanceRule on the given security connector. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginRuleIdExecuteSingleSecurityConnector( - String resourceGroupName, String securityConnectorName, String ruleId); - - /** - * Execute a security GovernanceRule on the given security connector. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @param executeGovernanceRuleParams GovernanceRule over a subscription scope. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginRuleIdExecuteSingleSecurityConnector( - String resourceGroupName, - String securityConnectorName, - String ruleId, - ExecuteGovernanceRuleParams executeGovernanceRuleParams, - Context context); - - /** - * Execute a security GovernanceRule on the given security connector. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void ruleIdExecuteSingleSecurityConnector(String resourceGroupName, String securityConnectorName, String ruleId); - - /** - * Execute a security GovernanceRule on the given security connector. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @param executeGovernanceRuleParams GovernanceRule over a subscription scope. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void ruleIdExecuteSingleSecurityConnector( - String resourceGroupName, - String securityConnectorName, - String ruleId, - ExecuteGovernanceRuleParams executeGovernanceRuleParams, - Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/HealthReportOperationsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/HealthReportOperationsClient.java new file mode 100644 index 0000000000000..9127fc7b309b8 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/HealthReportOperationsClient.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.security.fluent.models.HealthReportInner; + +/** An instance of this class provides access to all the operations defined in HealthReportOperationsClient. */ +public interface HealthReportOperationsClient { + /** + * Get health report of resource. + * + * @param resourceId The identifier of the resource. + * @param healthReportName The health report Key - Unique key for the health report type. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return health report of resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceId, String healthReportName, Context context); + + /** + * Get health report of resource. + * + * @param resourceId The identifier of the resource. + * @param healthReportName The health report Key - Unique key for the health report type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return health report of resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + HealthReportInner get(String resourceId, String healthReportName); +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/HealthReportsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/HealthReportsClient.java new file mode 100644 index 0000000000000..57ee9785cfd2f --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/HealthReportsClient.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.security.fluent.models.HealthReportInner; + +/** An instance of this class provides access to all the operations defined in HealthReportsClient. */ +public interface HealthReportsClient { + /** + * Get a list of all health reports inside a scope. Valid scopes are: subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * + * @param scope The scope at which the operation is performed. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all health reports inside a scope as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String scope); + + /** + * Get a list of all health reports inside a scope. Valid scopes are: subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * + * @param scope The scope at which the operation is performed. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all health reports inside a scope as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String scope, Context context); +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecurityCenter.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecurityCenter.java index 4067fa273c193..705fefe02cb51 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecurityCenter.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecurityCenter.java @@ -324,27 +324,6 @@ public interface SecurityCenter { */ ConnectorsClient getConnectors(); - /** - * Gets the SqlVulnerabilityAssessmentScansClient object to access its operations. - * - * @return the SqlVulnerabilityAssessmentScansClient object. - */ - SqlVulnerabilityAssessmentScansClient getSqlVulnerabilityAssessmentScans(); - - /** - * Gets the SqlVulnerabilityAssessmentScanResultsClient object to access its operations. - * - * @return the SqlVulnerabilityAssessmentScanResultsClient object. - */ - SqlVulnerabilityAssessmentScanResultsClient getSqlVulnerabilityAssessmentScanResults(); - - /** - * Gets the SqlVulnerabilityAssessmentBaselineRulesClient object to access its operations. - * - * @return the SqlVulnerabilityAssessmentBaselineRulesClient object. - */ - SqlVulnerabilityAssessmentBaselineRulesClient getSqlVulnerabilityAssessmentBaselineRules(); - /** * Gets the AlertsClient object to access its operations. * @@ -387,41 +366,6 @@ public interface SecurityCenter { */ GovernanceRulesClient getGovernanceRules(); - /** - * Gets the GovernanceRulesOperationsClient object to access its operations. - * - * @return the GovernanceRulesOperationsClient object. - */ - GovernanceRulesOperationsClient getGovernanceRulesOperations(); - - /** - * Gets the SecurityConnectorGovernanceRulesClient object to access its operations. - * - * @return the SecurityConnectorGovernanceRulesClient object. - */ - SecurityConnectorGovernanceRulesClient getSecurityConnectorGovernanceRules(); - - /** - * Gets the SecurityConnectorGovernanceRulesOperationsClient object to access its operations. - * - * @return the SecurityConnectorGovernanceRulesOperationsClient object. - */ - SecurityConnectorGovernanceRulesOperationsClient getSecurityConnectorGovernanceRulesOperations(); - - /** - * Gets the SubscriptionGovernanceRulesExecuteStatusClient object to access its operations. - * - * @return the SubscriptionGovernanceRulesExecuteStatusClient object. - */ - SubscriptionGovernanceRulesExecuteStatusClient getSubscriptionGovernanceRulesExecuteStatus(); - - /** - * Gets the SecurityConnectorGovernanceRulesExecuteStatusClient object to access its operations. - * - * @return the SecurityConnectorGovernanceRulesExecuteStatusClient object. - */ - SecurityConnectorGovernanceRulesExecuteStatusClient getSecurityConnectorGovernanceRulesExecuteStatus(); - /** * Gets the GovernanceAssignmentsClient object to access its operations. * @@ -477,4 +421,39 @@ public interface SecurityCenter { * @return the ApiCollectionOffboardingsClient object. */ ApiCollectionOffboardingsClient getApiCollectionOffboardings(); + + /** + * Gets the HealthReportsClient object to access its operations. + * + * @return the HealthReportsClient object. + */ + HealthReportsClient getHealthReports(); + + /** + * Gets the HealthReportOperationsClient object to access its operations. + * + * @return the HealthReportOperationsClient object. + */ + HealthReportOperationsClient getHealthReportOperations(); + + /** + * Gets the SqlVulnerabilityAssessmentScansClient object to access its operations. + * + * @return the SqlVulnerabilityAssessmentScansClient object. + */ + SqlVulnerabilityAssessmentScansClient getSqlVulnerabilityAssessmentScans(); + + /** + * Gets the SqlVulnerabilityAssessmentScanResultsClient object to access its operations. + * + * @return the SqlVulnerabilityAssessmentScanResultsClient object. + */ + SqlVulnerabilityAssessmentScanResultsClient getSqlVulnerabilityAssessmentScanResults(); + + /** + * Gets the SqlVulnerabilityAssessmentBaselineRulesClient object to access its operations. + * + * @return the SqlVulnerabilityAssessmentBaselineRulesClient object. + */ + SqlVulnerabilityAssessmentBaselineRulesClient getSqlVulnerabilityAssessmentBaselineRules(); } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecurityConnectorGovernanceRulesClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecurityConnectorGovernanceRulesClient.java deleted file mode 100644 index 9384a9cbf5d16..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecurityConnectorGovernanceRulesClient.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.GovernanceRuleInner; - -/** - * An instance of this class provides access to all the operations defined in SecurityConnectorGovernanceRulesClient. - */ -public interface SecurityConnectorGovernanceRulesClient { - /** - * Get a list of all relevant governanceRules over a security connector level scope. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all relevant governanceRules over a security connector level scope as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String securityConnectorName); - - /** - * Get a list of all relevant governanceRules over a security connector level scope. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all relevant governanceRules over a security connector level scope as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String securityConnectorName, Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecurityConnectorGovernanceRulesExecuteStatusClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecurityConnectorGovernanceRulesExecuteStatusClient.java deleted file mode 100644 index 99d21e3faec41..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecurityConnectorGovernanceRulesExecuteStatusClient.java +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.security.fluent.models.ExecuteRuleStatusInner; - -/** - * An instance of this class provides access to all the operations defined in - * SecurityConnectorGovernanceRulesExecuteStatusClient. - */ -public interface SecurityConnectorGovernanceRulesExecuteStatusClient { - /** - * Get a specific governanceRule execution status for the requested scope by ruleId and operationId. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @param operationId The security GovernanceRule execution key - unique key for the execution of GovernanceRule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of a specific governanceRule execution status for the requested scope - * by ruleId and operationId. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ExecuteRuleStatusInner> beginGet( - String resourceGroupName, String securityConnectorName, String ruleId, String operationId); - - /** - * Get a specific governanceRule execution status for the requested scope by ruleId and operationId. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @param operationId The security GovernanceRule execution key - unique key for the execution of GovernanceRule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of a specific governanceRule execution status for the requested scope - * by ruleId and operationId. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ExecuteRuleStatusInner> beginGet( - String resourceGroupName, String securityConnectorName, String ruleId, String operationId, Context context); - - /** - * Get a specific governanceRule execution status for the requested scope by ruleId and operationId. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @param operationId The security GovernanceRule execution key - unique key for the execution of GovernanceRule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific governanceRule execution status for the requested scope by ruleId and operationId. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ExecuteRuleStatusInner get( - String resourceGroupName, String securityConnectorName, String ruleId, String operationId); - - /** - * Get a specific governanceRule execution status for the requested scope by ruleId and operationId. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @param operationId The security GovernanceRule execution key - unique key for the execution of GovernanceRule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific governanceRule execution status for the requested scope by ruleId and operationId. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ExecuteRuleStatusInner get( - String resourceGroupName, String securityConnectorName, String ruleId, String operationId, Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecurityConnectorGovernanceRulesOperationsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecurityConnectorGovernanceRulesOperationsClient.java deleted file mode 100644 index f2963ac0d5842..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecurityConnectorGovernanceRulesOperationsClient.java +++ /dev/null @@ -1,119 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.GovernanceRuleInner; - -/** - * An instance of this class provides access to all the operations defined in - * SecurityConnectorGovernanceRulesOperationsClient. - */ -public interface SecurityConnectorGovernanceRulesOperationsClient { - /** - * Get a specific governanceRule for the requested scope by ruleId. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific governanceRule for the requested scope by ruleId along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String securityConnectorName, String ruleId, Context context); - - /** - * Get a specific governanceRule for the requested scope by ruleId. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific governanceRule for the requested scope by ruleId. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - GovernanceRuleInner get(String resourceGroupName, String securityConnectorName, String ruleId); - - /** - * Creates or update a security GovernanceRule on the given security connector. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @param governanceRule GovernanceRule over a subscription scope. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security GovernanceRule over a given scope along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( - String resourceGroupName, - String securityConnectorName, - String ruleId, - GovernanceRuleInner governanceRule, - Context context); - - /** - * Creates or update a security GovernanceRule on the given security connector. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @param governanceRule GovernanceRule over a subscription scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security GovernanceRule over a given scope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - GovernanceRuleInner createOrUpdate( - String resourceGroupName, String securityConnectorName, String ruleId, GovernanceRuleInner governanceRule); - - /** - * Delete a GovernanceRule over a given scope. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse( - String resourceGroupName, String securityConnectorName, String ruleId, Context context); - - /** - * Delete a GovernanceRule over a given scope. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String securityConnectorName, String ruleId); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SubscriptionGovernanceRulesExecuteStatusClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SubscriptionGovernanceRulesExecuteStatusClient.java deleted file mode 100644 index 2c9577447c455..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SubscriptionGovernanceRulesExecuteStatusClient.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.security.fluent.models.ExecuteRuleStatusInner; - -/** - * An instance of this class provides access to all the operations defined in - * SubscriptionGovernanceRulesExecuteStatusClient. - */ -public interface SubscriptionGovernanceRulesExecuteStatusClient { - /** - * Get a specific governanceRule execution status for the requested scope by ruleId and operationId. - * - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @param operationId The security GovernanceRule execution key - unique key for the execution of GovernanceRule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of a specific governanceRule execution status for the requested scope - * by ruleId and operationId. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ExecuteRuleStatusInner> beginGet(String ruleId, String operationId); - - /** - * Get a specific governanceRule execution status for the requested scope by ruleId and operationId. - * - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @param operationId The security GovernanceRule execution key - unique key for the execution of GovernanceRule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of a specific governanceRule execution status for the requested scope - * by ruleId and operationId. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ExecuteRuleStatusInner> beginGet( - String ruleId, String operationId, Context context); - - /** - * Get a specific governanceRule execution status for the requested scope by ruleId and operationId. - * - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @param operationId The security GovernanceRule execution key - unique key for the execution of GovernanceRule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific governanceRule execution status for the requested scope by ruleId and operationId. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ExecuteRuleStatusInner get(String ruleId, String operationId); - - /** - * Get a specific governanceRule execution status for the requested scope by ruleId and operationId. - * - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @param operationId The security GovernanceRule execution key - unique key for the execution of GovernanceRule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific governanceRule execution status for the requested scope by ruleId and operationId. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ExecuteRuleStatusInner get(String ruleId, String operationId, Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AlertInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AlertInner.java index 70d189e707ead..ac8fd6624bd45 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AlertInner.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AlertInner.java @@ -200,8 +200,9 @@ public OffsetDateTime timeGeneratedUtc() { } /** - * Get the productName property: The name of the product which published this alert (Azure Security Center, Azure - * ATP, Microsoft Defender ATP, O365 ATP, MCAS, and so on). + * Get the productName property: The name of the product which published this alert (Microsoft Sentinel, Microsoft + * Defender for Identity, Microsoft Defender for Endpoint, Microsoft Defender for Office, Microsoft Defender for + * Cloud Apps, and so on). * * @return the productName value. */ diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AlertProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AlertProperties.java index 2ad9696f5d25c..5a65af987b501 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AlertProperties.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AlertProperties.java @@ -128,8 +128,8 @@ public final class AlertProperties { private OffsetDateTime timeGeneratedUtc; /* - * The name of the product which published this alert (Azure Security Center, Azure ATP, Microsoft Defender ATP, - * O365 ATP, MCAS, and so on). + * The name of the product which published this alert (Microsoft Sentinel, Microsoft Defender for Identity, + * Microsoft Defender for Endpoint, Microsoft Defender for Office, Microsoft Defender for Cloud Apps, and so on). */ @JsonProperty(value = "productName", access = JsonProperty.Access.WRITE_ONLY) private String productName; @@ -355,8 +355,9 @@ public OffsetDateTime timeGeneratedUtc() { } /** - * Get the productName property: The name of the product which published this alert (Azure Security Center, Azure - * ATP, Microsoft Defender ATP, O365 ATP, MCAS, and so on). + * Get the productName property: The name of the product which published this alert (Microsoft Sentinel, Microsoft + * Defender for Identity, Microsoft Defender for Endpoint, Microsoft Defender for Office, Microsoft Defender for + * Cloud Apps, and so on). * * @return the productName value. */ diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ExecuteRuleStatusInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ExecuteRuleStatusInner.java deleted file mode 100644 index da82adde26341..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ExecuteRuleStatusInner.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Execute status of Security GovernanceRule over a given scope. */ -@Immutable -public final class ExecuteRuleStatusInner { - /* - * Unique key for the execution of GovernanceRule - */ - @JsonProperty(value = "operationId", access = JsonProperty.Access.WRITE_ONLY) - private String operationId; - - /** Creates an instance of ExecuteRuleStatusInner class. */ - public ExecuteRuleStatusInner() { - } - - /** - * Get the operationId property: Unique key for the execution of GovernanceRule. - * - * @return the operationId value. - */ - public String operationId() { - return this.operationId; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GovernanceAssignmentInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GovernanceAssignmentInner.java index c828bf76ff264..f880104179cce 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GovernanceAssignmentInner.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GovernanceAssignmentInner.java @@ -12,11 +12,11 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; -/** Security GovernanceAssignment over a given scope. */ +/** Governance assignment over a given scope. */ @Fluent public final class GovernanceAssignmentInner extends ProxyResource { /* - * Properties of a security governanceAssignment + * The properties of a governance assignment */ @JsonProperty(value = "properties") private GovernanceAssignmentProperties innerProperties; @@ -26,7 +26,7 @@ public GovernanceAssignmentInner() { } /** - * Get the innerProperties property: Properties of a security governanceAssignment. + * Get the innerProperties property: The properties of a governance assignment. * * @return the innerProperties value. */ diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GovernanceRuleInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GovernanceRuleInner.java index 2a763d38f7877..62781d9a3ac87 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GovernanceRuleInner.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GovernanceRuleInner.java @@ -7,17 +7,18 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; import com.azure.resourcemanager.security.models.GovernanceRuleEmailNotification; +import com.azure.resourcemanager.security.models.GovernanceRuleMetadata; import com.azure.resourcemanager.security.models.GovernanceRuleOwnerSource; import com.azure.resourcemanager.security.models.GovernanceRuleSourceResourceType; import com.azure.resourcemanager.security.models.GovernanceRuleType; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** Security GovernanceRule over a given scope. */ +/** Governance rule over a given scope. */ @Fluent public final class GovernanceRuleInner extends ProxyResource { /* - * Properties of a security governanceRule + * Properties of a governance rule */ @JsonProperty(value = "properties") private GovernanceRuleProperties innerProperties; @@ -27,7 +28,7 @@ public GovernanceRuleInner() { } /** - * Get the innerProperties property: Properties of a security governanceRule. + * Get the innerProperties property: Properties of a governance rule. * * @return the innerProperties value. */ @@ -36,7 +37,16 @@ private GovernanceRuleProperties innerProperties() { } /** - * Get the displayName property: display name of the governanceRule. + * Get the tenantId property: The tenantId (GUID). + * + * @return the tenantId value. + */ + public String tenantId() { + return this.innerProperties() == null ? null : this.innerProperties().tenantId(); + } + + /** + * Get the displayName property: Display name of the governance rule. * * @return the displayName value. */ @@ -45,7 +55,7 @@ public String displayName() { } /** - * Set the displayName property: display name of the governanceRule. + * Set the displayName property: Display name of the governance rule. * * @param displayName the displayName value to set. * @return the GovernanceRuleInner object itself. @@ -59,7 +69,7 @@ public GovernanceRuleInner withDisplayName(String displayName) { } /** - * Get the description property: description of the governanceRule. + * Get the description property: Description of the governance rule. * * @return the description value. */ @@ -68,7 +78,7 @@ public String description() { } /** - * Set the description property: description of the governanceRule. + * Set the description property: Description of the governance rule. * * @param description the description value to set. * @return the GovernanceRuleInner object itself. @@ -131,7 +141,7 @@ public GovernanceRuleInner withIsGracePeriod(Boolean isGracePeriod) { /** * Get the rulePriority property: The governance rule priority, priority to the lower number. Rules with the same - * priority on the same subscription will not be allowed. + * priority on the same scope will not be allowed. * * @return the rulePriority value. */ @@ -141,7 +151,7 @@ public Integer rulePriority() { /** * Set the rulePriority property: The governance rule priority, priority to the lower number. Rules with the same - * priority on the same subscription will not be allowed. + * priority on the same scope will not be allowed. * * @param rulePriority the rulePriority value to set. * @return the GovernanceRuleInner object itself. @@ -223,6 +233,29 @@ public GovernanceRuleInner withSourceResourceType(GovernanceRuleSourceResourceTy return this; } + /** + * Get the excludedScopes property: Excluded scopes, filter out the descendants of the scope (on management scopes). + * + * @return the excludedScopes value. + */ + public List excludedScopes() { + return this.innerProperties() == null ? null : this.innerProperties().excludedScopes(); + } + + /** + * Set the excludedScopes property: Excluded scopes, filter out the descendants of the scope (on management scopes). + * + * @param excludedScopes the excludedScopes value to set. + * @return the GovernanceRuleInner object itself. + */ + public GovernanceRuleInner withExcludedScopes(List excludedScopes) { + if (this.innerProperties() == null) { + this.innerProperties = new GovernanceRuleProperties(); + } + this.innerProperties().withExcludedScopes(excludedScopes); + return this; + } + /** * Get the conditionSets property: The governance rule conditionSets - see examples. * @@ -247,7 +280,32 @@ public GovernanceRuleInner withConditionSets(List conditionSets) { } /** - * Get the ownerSource property: The Owner source for the governance rule - e.g. Manually by user@contoso.com - see + * Get the includeMemberScopes property: Defines whether the rule is management scope rule (master connector as a + * single scope or management scope). + * + * @return the includeMemberScopes value. + */ + public Boolean includeMemberScopes() { + return this.innerProperties() == null ? null : this.innerProperties().includeMemberScopes(); + } + + /** + * Set the includeMemberScopes property: Defines whether the rule is management scope rule (master connector as a + * single scope or management scope). + * + * @param includeMemberScopes the includeMemberScopes value to set. + * @return the GovernanceRuleInner object itself. + */ + public GovernanceRuleInner withIncludeMemberScopes(Boolean includeMemberScopes) { + if (this.innerProperties() == null) { + this.innerProperties = new GovernanceRuleProperties(); + } + this.innerProperties().withIncludeMemberScopes(includeMemberScopes); + return this; + } + + /** + * Get the ownerSource property: The owner source for the governance rule - e.g. Manually by user@contoso.com - see * example. * * @return the ownerSource value. @@ -257,7 +315,7 @@ public GovernanceRuleOwnerSource ownerSource() { } /** - * Set the ownerSource property: The Owner source for the governance rule - e.g. Manually by user@contoso.com - see + * Set the ownerSource property: The owner source for the governance rule - e.g. Manually by user@contoso.com - see * example. * * @param ownerSource the ownerSource value to set. @@ -297,6 +355,29 @@ public GovernanceRuleInner withGovernanceEmailNotification( return this; } + /** + * Get the metadata property: The governance rule metadata. + * + * @return the metadata value. + */ + public GovernanceRuleMetadata metadata() { + return this.innerProperties() == null ? null : this.innerProperties().metadata(); + } + + /** + * Set the metadata property: The governance rule metadata. + * + * @param metadata the metadata value to set. + * @return the GovernanceRuleInner object itself. + */ + public GovernanceRuleInner withMetadata(GovernanceRuleMetadata metadata) { + if (this.innerProperties() == null) { + this.innerProperties = new GovernanceRuleProperties(); + } + this.innerProperties().withMetadata(metadata); + return this; + } + /** * Validates the instance. * diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GovernanceRuleProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GovernanceRuleProperties.java index 202b506fbfe21..d54629e94239b 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GovernanceRuleProperties.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GovernanceRuleProperties.java @@ -7,23 +7,30 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.security.models.GovernanceRuleEmailNotification; +import com.azure.resourcemanager.security.models.GovernanceRuleMetadata; import com.azure.resourcemanager.security.models.GovernanceRuleOwnerSource; import com.azure.resourcemanager.security.models.GovernanceRuleSourceResourceType; import com.azure.resourcemanager.security.models.GovernanceRuleType; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** Describes properties of an governanceRule. */ +/** Describes properties of an governance rule. */ @Fluent public final class GovernanceRuleProperties { /* - * display name of the governanceRule + * The tenantId (GUID) + */ + @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) + private String tenantId; + + /* + * Display name of the governance rule */ @JsonProperty(value = "displayName", required = true) private String displayName; /* - * description of the governanceRule + * Description of the governance rule */ @JsonProperty(value = "description") private String description; @@ -42,8 +49,8 @@ public final class GovernanceRuleProperties { private Boolean isGracePeriod; /* - * The governance rule priority, priority to the lower number. Rules with the same priority on the same - * subscription will not be allowed + * The governance rule priority, priority to the lower number. Rules with the same priority on the same scope will + * not be allowed */ @JsonProperty(value = "rulePriority", required = true) private int rulePriority; @@ -66,6 +73,12 @@ public final class GovernanceRuleProperties { @JsonProperty(value = "sourceResourceType", required = true) private GovernanceRuleSourceResourceType sourceResourceType; + /* + * Excluded scopes, filter out the descendants of the scope (on management scopes) + */ + @JsonProperty(value = "excludedScopes") + private List excludedScopes; + /* * The governance rule conditionSets - see examples */ @@ -73,7 +86,13 @@ public final class GovernanceRuleProperties { private List conditionSets; /* - * The Owner source for the governance rule - e.g. Manually by user@contoso.com - see example + * Defines whether the rule is management scope rule (master connector as a single scope or management scope) + */ + @JsonProperty(value = "includeMemberScopes") + private Boolean includeMemberScopes; + + /* + * The owner source for the governance rule - e.g. Manually by user@contoso.com - see example */ @JsonProperty(value = "ownerSource", required = true) private GovernanceRuleOwnerSource ownerSource; @@ -85,12 +104,27 @@ public final class GovernanceRuleProperties { @JsonProperty(value = "governanceEmailNotification") private GovernanceRuleEmailNotification governanceEmailNotification; + /* + * The governance rule metadata + */ + @JsonProperty(value = "metadata") + private GovernanceRuleMetadata metadata; + /** Creates an instance of GovernanceRuleProperties class. */ public GovernanceRuleProperties() { } /** - * Get the displayName property: display name of the governanceRule. + * Get the tenantId property: The tenantId (GUID). + * + * @return the tenantId value. + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Get the displayName property: Display name of the governance rule. * * @return the displayName value. */ @@ -99,7 +133,7 @@ public String displayName() { } /** - * Set the displayName property: display name of the governanceRule. + * Set the displayName property: Display name of the governance rule. * * @param displayName the displayName value to set. * @return the GovernanceRuleProperties object itself. @@ -110,7 +144,7 @@ public GovernanceRuleProperties withDisplayName(String displayName) { } /** - * Get the description property: description of the governanceRule. + * Get the description property: Description of the governance rule. * * @return the description value. */ @@ -119,7 +153,7 @@ public String description() { } /** - * Set the description property: description of the governanceRule. + * Set the description property: Description of the governance rule. * * @param description the description value to set. * @return the GovernanceRuleProperties object itself. @@ -173,7 +207,7 @@ public GovernanceRuleProperties withIsGracePeriod(Boolean isGracePeriod) { /** * Get the rulePriority property: The governance rule priority, priority to the lower number. Rules with the same - * priority on the same subscription will not be allowed. + * priority on the same scope will not be allowed. * * @return the rulePriority value. */ @@ -183,7 +217,7 @@ public int rulePriority() { /** * Set the rulePriority property: The governance rule priority, priority to the lower number. Rules with the same - * priority on the same subscription will not be allowed. + * priority on the same scope will not be allowed. * * @param rulePriority the rulePriority value to set. * @return the GovernanceRuleProperties object itself. @@ -253,6 +287,26 @@ public GovernanceRuleProperties withSourceResourceType(GovernanceRuleSourceResou return this; } + /** + * Get the excludedScopes property: Excluded scopes, filter out the descendants of the scope (on management scopes). + * + * @return the excludedScopes value. + */ + public List excludedScopes() { + return this.excludedScopes; + } + + /** + * Set the excludedScopes property: Excluded scopes, filter out the descendants of the scope (on management scopes). + * + * @param excludedScopes the excludedScopes value to set. + * @return the GovernanceRuleProperties object itself. + */ + public GovernanceRuleProperties withExcludedScopes(List excludedScopes) { + this.excludedScopes = excludedScopes; + return this; + } + /** * Get the conditionSets property: The governance rule conditionSets - see examples. * @@ -274,7 +328,29 @@ public GovernanceRuleProperties withConditionSets(List conditionSets) { } /** - * Get the ownerSource property: The Owner source for the governance rule - e.g. Manually by user@contoso.com - see + * Get the includeMemberScopes property: Defines whether the rule is management scope rule (master connector as a + * single scope or management scope). + * + * @return the includeMemberScopes value. + */ + public Boolean includeMemberScopes() { + return this.includeMemberScopes; + } + + /** + * Set the includeMemberScopes property: Defines whether the rule is management scope rule (master connector as a + * single scope or management scope). + * + * @param includeMemberScopes the includeMemberScopes value to set. + * @return the GovernanceRuleProperties object itself. + */ + public GovernanceRuleProperties withIncludeMemberScopes(Boolean includeMemberScopes) { + this.includeMemberScopes = includeMemberScopes; + return this; + } + + /** + * Get the ownerSource property: The owner source for the governance rule - e.g. Manually by user@contoso.com - see * example. * * @return the ownerSource value. @@ -284,7 +360,7 @@ public GovernanceRuleOwnerSource ownerSource() { } /** - * Set the ownerSource property: The Owner source for the governance rule - e.g. Manually by user@contoso.com - see + * Set the ownerSource property: The owner source for the governance rule - e.g. Manually by user@contoso.com - see * example. * * @param ownerSource the ownerSource value to set. @@ -318,6 +394,26 @@ public GovernanceRuleProperties withGovernanceEmailNotification( return this; } + /** + * Get the metadata property: The governance rule metadata. + * + * @return the metadata value. + */ + public GovernanceRuleMetadata metadata() { + return this.metadata; + } + + /** + * Set the metadata property: The governance rule metadata. + * + * @param metadata the metadata value to set. + * @return the GovernanceRuleProperties object itself. + */ + public GovernanceRuleProperties withMetadata(GovernanceRuleMetadata metadata) { + this.metadata = metadata; + return this; + } + /** * Validates the instance. * @@ -359,6 +455,9 @@ public void validate() { if (governanceEmailNotification() != null) { governanceEmailNotification().validate(); } + if (metadata() != null) { + metadata().validate(); + } } private static final ClientLogger LOGGER = new ClientLogger(GovernanceRuleProperties.class); diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/HealthReportInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/HealthReportInner.java new file mode 100644 index 0000000000000..31f24ba0c299b --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/HealthReportInner.java @@ -0,0 +1,187 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.resourcemanager.security.models.EnvironmentDetails; +import com.azure.resourcemanager.security.models.HealthDataClassification; +import com.azure.resourcemanager.security.models.Issue; +import com.azure.resourcemanager.security.models.ResourceDetailsAutoGenerated; +import com.azure.resourcemanager.security.models.StatusAutoGenerated; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The health report resource. */ +@Fluent +public final class HealthReportInner extends ProxyResource { + /* + * Properties of a health report + */ + @JsonProperty(value = "properties") + private HealthReportProperties innerProperties; + + /** Creates an instance of HealthReportInner class. */ + public HealthReportInner() { + } + + /** + * Get the innerProperties property: Properties of a health report. + * + * @return the innerProperties value. + */ + private HealthReportProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the resourceDetails property: The resource details of the health report. + * + * @return the resourceDetails value. + */ + public ResourceDetailsAutoGenerated resourceDetails() { + return this.innerProperties() == null ? null : this.innerProperties().resourceDetails(); + } + + /** + * Set the resourceDetails property: The resource details of the health report. + * + * @param resourceDetails the resourceDetails value to set. + * @return the HealthReportInner object itself. + */ + public HealthReportInner withResourceDetails(ResourceDetailsAutoGenerated resourceDetails) { + if (this.innerProperties() == null) { + this.innerProperties = new HealthReportProperties(); + } + this.innerProperties().withResourceDetails(resourceDetails); + return this; + } + + /** + * Get the environmentDetails property: The environment details of the resource. + * + * @return the environmentDetails value. + */ + public EnvironmentDetails environmentDetails() { + return this.innerProperties() == null ? null : this.innerProperties().environmentDetails(); + } + + /** + * Set the environmentDetails property: The environment details of the resource. + * + * @param environmentDetails the environmentDetails value to set. + * @return the HealthReportInner object itself. + */ + public HealthReportInner withEnvironmentDetails(EnvironmentDetails environmentDetails) { + if (this.innerProperties() == null) { + this.innerProperties = new HealthReportProperties(); + } + this.innerProperties().withEnvironmentDetails(environmentDetails); + return this; + } + + /** + * Get the healthDataClassification property: The classification of the health report. + * + * @return the healthDataClassification value. + */ + public HealthDataClassification healthDataClassification() { + return this.innerProperties() == null ? null : this.innerProperties().healthDataClassification(); + } + + /** + * Set the healthDataClassification property: The classification of the health report. + * + * @param healthDataClassification the healthDataClassification value to set. + * @return the HealthReportInner object itself. + */ + public HealthReportInner withHealthDataClassification(HealthDataClassification healthDataClassification) { + if (this.innerProperties() == null) { + this.innerProperties = new HealthReportProperties(); + } + this.innerProperties().withHealthDataClassification(healthDataClassification); + return this; + } + + /** + * Get the status property: The status of the health report. + * + * @return the status value. + */ + public StatusAutoGenerated status() { + return this.innerProperties() == null ? null : this.innerProperties().status(); + } + + /** + * Set the status property: The status of the health report. + * + * @param status the status value to set. + * @return the HealthReportInner object itself. + */ + public HealthReportInner withStatus(StatusAutoGenerated status) { + if (this.innerProperties() == null) { + this.innerProperties = new HealthReportProperties(); + } + this.innerProperties().withStatus(status); + return this; + } + + /** + * Get the affectedDefendersPlans property: The affected defenders plans by unhealthy report. + * + * @return the affectedDefendersPlans value. + */ + public List affectedDefendersPlans() { + return this.innerProperties() == null ? null : this.innerProperties().affectedDefendersPlans(); + } + + /** + * Set the affectedDefendersPlans property: The affected defenders plans by unhealthy report. + * + * @param affectedDefendersPlans the affectedDefendersPlans value to set. + * @return the HealthReportInner object itself. + */ + public HealthReportInner withAffectedDefendersPlans(List affectedDefendersPlans) { + if (this.innerProperties() == null) { + this.innerProperties = new HealthReportProperties(); + } + this.innerProperties().withAffectedDefendersPlans(affectedDefendersPlans); + return this; + } + + /** + * Get the issues property: A collection of the issues in the report. + * + * @return the issues value. + */ + public List issues() { + return this.innerProperties() == null ? null : this.innerProperties().issues(); + } + + /** + * Set the issues property: A collection of the issues in the report. + * + * @param issues the issues value to set. + * @return the HealthReportInner object itself. + */ + public HealthReportInner withIssues(List issues) { + if (this.innerProperties() == null) { + this.innerProperties = new HealthReportProperties(); + } + this.innerProperties().withIssues(issues); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/HealthReportProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/HealthReportProperties.java new file mode 100644 index 0000000000000..98ee1832e128c --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/HealthReportProperties.java @@ -0,0 +1,201 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.security.models.EnvironmentDetails; +import com.azure.resourcemanager.security.models.HealthDataClassification; +import com.azure.resourcemanager.security.models.Issue; +import com.azure.resourcemanager.security.models.ResourceDetailsAutoGenerated; +import com.azure.resourcemanager.security.models.StatusAutoGenerated; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes properties of the health report. */ +@Fluent +public final class HealthReportProperties { + /* + * The resource details of the health report + */ + @JsonProperty(value = "resourceDetails") + private ResourceDetailsAutoGenerated resourceDetails; + + /* + * The environment details of the resource + */ + @JsonProperty(value = "environmentDetails") + private EnvironmentDetails environmentDetails; + + /* + * The classification of the health report + */ + @JsonProperty(value = "healthDataClassification") + private HealthDataClassification healthDataClassification; + + /* + * The status of the health report + */ + @JsonProperty(value = "status") + private StatusAutoGenerated status; + + /* + * The affected defenders plans by unhealthy report + */ + @JsonProperty(value = "affectedDefendersPlans") + private List affectedDefendersPlans; + + /* + * A collection of the issues in the report + */ + @JsonProperty(value = "issues") + private List issues; + + /** Creates an instance of HealthReportProperties class. */ + public HealthReportProperties() { + } + + /** + * Get the resourceDetails property: The resource details of the health report. + * + * @return the resourceDetails value. + */ + public ResourceDetailsAutoGenerated resourceDetails() { + return this.resourceDetails; + } + + /** + * Set the resourceDetails property: The resource details of the health report. + * + * @param resourceDetails the resourceDetails value to set. + * @return the HealthReportProperties object itself. + */ + public HealthReportProperties withResourceDetails(ResourceDetailsAutoGenerated resourceDetails) { + this.resourceDetails = resourceDetails; + return this; + } + + /** + * Get the environmentDetails property: The environment details of the resource. + * + * @return the environmentDetails value. + */ + public EnvironmentDetails environmentDetails() { + return this.environmentDetails; + } + + /** + * Set the environmentDetails property: The environment details of the resource. + * + * @param environmentDetails the environmentDetails value to set. + * @return the HealthReportProperties object itself. + */ + public HealthReportProperties withEnvironmentDetails(EnvironmentDetails environmentDetails) { + this.environmentDetails = environmentDetails; + return this; + } + + /** + * Get the healthDataClassification property: The classification of the health report. + * + * @return the healthDataClassification value. + */ + public HealthDataClassification healthDataClassification() { + return this.healthDataClassification; + } + + /** + * Set the healthDataClassification property: The classification of the health report. + * + * @param healthDataClassification the healthDataClassification value to set. + * @return the HealthReportProperties object itself. + */ + public HealthReportProperties withHealthDataClassification(HealthDataClassification healthDataClassification) { + this.healthDataClassification = healthDataClassification; + return this; + } + + /** + * Get the status property: The status of the health report. + * + * @return the status value. + */ + public StatusAutoGenerated status() { + return this.status; + } + + /** + * Set the status property: The status of the health report. + * + * @param status the status value to set. + * @return the HealthReportProperties object itself. + */ + public HealthReportProperties withStatus(StatusAutoGenerated status) { + this.status = status; + return this; + } + + /** + * Get the affectedDefendersPlans property: The affected defenders plans by unhealthy report. + * + * @return the affectedDefendersPlans value. + */ + public List affectedDefendersPlans() { + return this.affectedDefendersPlans; + } + + /** + * Set the affectedDefendersPlans property: The affected defenders plans by unhealthy report. + * + * @param affectedDefendersPlans the affectedDefendersPlans value to set. + * @return the HealthReportProperties object itself. + */ + public HealthReportProperties withAffectedDefendersPlans(List affectedDefendersPlans) { + this.affectedDefendersPlans = affectedDefendersPlans; + return this; + } + + /** + * Get the issues property: A collection of the issues in the report. + * + * @return the issues value. + */ + public List issues() { + return this.issues; + } + + /** + * Set the issues property: A collection of the issues in the report. + * + * @param issues the issues value to set. + * @return the HealthReportProperties object itself. + */ + public HealthReportProperties withIssues(List issues) { + this.issues = issues; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (resourceDetails() != null) { + resourceDetails().validate(); + } + if (environmentDetails() != null) { + environmentDetails().validate(); + } + if (healthDataClassification() != null) { + healthDataClassification().validate(); + } + if (status() != null) { + status().validate(); + } + if (issues() != null) { + issues().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/OperationResultAutoGeneratedInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/OperationResultAutoGeneratedInner.java new file mode 100644 index 0000000000000..c4ca79253a776 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/OperationResultAutoGeneratedInner.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.security.models.OperationResult; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Long run operation status of governance rule over a given scope. */ +@Immutable +public final class OperationResultAutoGeneratedInner { + /* + * The status of the long run operation result of governance rule + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private OperationResult status; + + /** Creates an instance of OperationResultAutoGeneratedInner class. */ + public OperationResultAutoGeneratedInner() { + } + + /** + * Get the status property: The status of the long run operation result of governance rule. + * + * @return the status value. + */ + public OperationResult status() { + return this.status; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AdaptiveNetworkHardeningsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AdaptiveNetworkHardeningsClientImpl.java index 52b58d5775785..860e01b3e66ed 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AdaptiveNetworkHardeningsClientImpl.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AdaptiveNetworkHardeningsClientImpl.java @@ -867,7 +867,8 @@ public SyncPoller, Void> beginEnforce( String resourceName, String adaptiveNetworkHardeningResourceName, AdaptiveNetworkHardeningEnforceRequest body) { - return beginEnforceAsync( + return this + .beginEnforceAsync( resourceGroupName, resourceNamespace, resourceType, @@ -902,7 +903,8 @@ public SyncPoller, Void> beginEnforce( String adaptiveNetworkHardeningResourceName, AdaptiveNetworkHardeningEnforceRequest body, Context context) { - return beginEnforceAsync( + return this + .beginEnforceAsync( resourceGroupName, resourceNamespace, resourceType, diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AlertsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AlertsClientImpl.java index d6a9894b807df..2f4d678a4a23c 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AlertsClientImpl.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AlertsClientImpl.java @@ -2729,7 +2729,7 @@ private PollerFlux, Void> beginSimulateAsync( @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginSimulate( String ascLocation, AlertSimulatorRequestBody alertSimulatorRequestBody) { - return beginSimulateAsync(ascLocation, alertSimulatorRequestBody).getSyncPoller(); + return this.beginSimulateAsync(ascLocation, alertSimulatorRequestBody).getSyncPoller(); } /** @@ -2747,7 +2747,7 @@ public SyncPoller, Void> beginSimulate( @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginSimulate( String ascLocation, AlertSimulatorRequestBody alertSimulatorRequestBody, Context context) { - return beginSimulateAsync(ascLocation, alertSimulatorRequestBody, context).getSyncPoller(); + return this.beginSimulateAsync(ascLocation, alertSimulatorRequestBody, context).getSyncPoller(); } /** diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ExecuteRuleStatusImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ExecuteRuleStatusImpl.java deleted file mode 100644 index 28186d86be9f5..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ExecuteRuleStatusImpl.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.resourcemanager.security.fluent.models.ExecuteRuleStatusInner; -import com.azure.resourcemanager.security.models.ExecuteRuleStatus; - -public final class ExecuteRuleStatusImpl implements ExecuteRuleStatus { - private ExecuteRuleStatusInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - ExecuteRuleStatusImpl( - ExecuteRuleStatusInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String operationId() { - return this.innerModel().operationId(); - } - - public ExecuteRuleStatusInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GovernanceAssignmentsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GovernanceAssignmentsClientImpl.java index e906d7271e8d8..2f964e6ef3ee5 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GovernanceAssignmentsClientImpl.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GovernanceAssignmentsClientImpl.java @@ -67,7 +67,7 @@ public interface GovernanceAssignmentsService { Mono> list( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam(value = "scope", encoded = true) String scope, + @PathParam("scope") String scope, @PathParam("assessmentName") String assessmentName, @HeaderParam("Accept") String accept, Context context); @@ -79,7 +79,7 @@ Mono> list( Mono> get( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam(value = "scope", encoded = true) String scope, + @PathParam("scope") String scope, @PathParam("assessmentName") String assessmentName, @PathParam("assignmentKey") String assignmentKey, @HeaderParam("Accept") String accept, @@ -92,7 +92,7 @@ Mono> get( Mono> createOrUpdate( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam(value = "scope", encoded = true) String scope, + @PathParam("scope") String scope, @PathParam("assessmentName") String assessmentName, @PathParam("assignmentKey") String assignmentKey, @BodyParam("application/json") GovernanceAssignmentInner governanceAssignment, @@ -107,7 +107,7 @@ Mono> createOrUpdate( Mono> delete( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam(value = "scope", encoded = true) String scope, + @PathParam("scope") String scope, @PathParam("assessmentName") String assessmentName, @PathParam("assignmentKey") String assignmentKey, Context context); @@ -124,15 +124,16 @@ Mono> listNext( } /** - * Get security governanceAssignments on all your resources inside a scope. + * Get governance assignments on all of your resources inside a scope. * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param assessmentName The Assessment Key - Unique key for the assessment type. + * @param scope The scope of the Governance assignments. Valid scopes are: subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * @param assessmentName The Assessment Key - A unique key for the assessment type. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security governanceAssignments on all your resources inside a scope along with {@link PagedResponse} on + * @return governance assignments on all of your resources inside a scope along with {@link PagedResponse} on * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -167,16 +168,17 @@ private Mono> listSinglePageAsync(Strin } /** - * Get security governanceAssignments on all your resources inside a scope. + * Get governance assignments on all of your resources inside a scope. * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param assessmentName The Assessment Key - Unique key for the assessment type. + * @param scope The scope of the Governance assignments. Valid scopes are: subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * @param assessmentName The Assessment Key - A unique key for the assessment type. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security governanceAssignments on all your resources inside a scope along with {@link PagedResponse} on + * @return governance assignments on all of your resources inside a scope along with {@link PagedResponse} on * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -211,15 +213,16 @@ private Mono> listSinglePageAsync( } /** - * Get security governanceAssignments on all your resources inside a scope. + * Get governance assignments on all of your resources inside a scope. * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param assessmentName The Assessment Key - Unique key for the assessment type. + * @param scope The scope of the Governance assignments. Valid scopes are: subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * @param assessmentName The Assessment Key - A unique key for the assessment type. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security governanceAssignments on all your resources inside a scope as paginated response with {@link + * @return governance assignments on all of your resources inside a scope as paginated response with {@link * PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) @@ -229,16 +232,17 @@ private PagedFlux listAsync(String scope, String asse } /** - * Get security governanceAssignments on all your resources inside a scope. + * Get governance assignments on all of your resources inside a scope. * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param assessmentName The Assessment Key - Unique key for the assessment type. + * @param scope The scope of the Governance assignments. Valid scopes are: subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * @param assessmentName The Assessment Key - A unique key for the assessment type. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security governanceAssignments on all your resources inside a scope as paginated response with {@link + * @return governance assignments on all of your resources inside a scope as paginated response with {@link * PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) @@ -249,15 +253,16 @@ private PagedFlux listAsync(String scope, String asse } /** - * Get security governanceAssignments on all your resources inside a scope. + * Get governance assignments on all of your resources inside a scope. * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param assessmentName The Assessment Key - Unique key for the assessment type. + * @param scope The scope of the Governance assignments. Valid scopes are: subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * @param assessmentName The Assessment Key - A unique key for the assessment type. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security governanceAssignments on all your resources inside a scope as paginated response with {@link + * @return governance assignments on all of your resources inside a scope as paginated response with {@link * PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) @@ -266,16 +271,17 @@ public PagedIterable list(String scope, String assess } /** - * Get security governanceAssignments on all your resources inside a scope. + * Get governance assignments on all of your resources inside a scope. * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param assessmentName The Assessment Key - Unique key for the assessment type. + * @param scope The scope of the Governance assignments. Valid scopes are: subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * @param assessmentName The Assessment Key - A unique key for the assessment type. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security governanceAssignments on all your resources inside a scope as paginated response with {@link + * @return governance assignments on all of your resources inside a scope as paginated response with {@link * PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) @@ -286,11 +292,11 @@ public PagedIterable list(String scope, String assess /** * Get a specific governanceAssignment for the requested scope by AssignmentKey. * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param assessmentName The Assessment Key - Unique key for the assessment type. - * @param assignmentKey The security governance assignment key - the assessment key of the required governance - * assignment. + * @param scope The scope of the Governance assignments. Valid scopes are: subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * @param assessmentName The Assessment Key - A unique key for the assessment type. + * @param assignmentKey The governance assignment key - the assessment key of the required governance assignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -335,11 +341,11 @@ private Mono> getWithResponseAsync( /** * Get a specific governanceAssignment for the requested scope by AssignmentKey. * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param assessmentName The Assessment Key - Unique key for the assessment type. - * @param assignmentKey The security governance assignment key - the assessment key of the required governance - * assignment. + * @param scope The scope of the Governance assignments. Valid scopes are: subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * @param assessmentName The Assessment Key - A unique key for the assessment type. + * @param assignmentKey The governance assignment key - the assessment key of the required governance assignment. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -375,11 +381,11 @@ private Mono> getWithResponseAsync( /** * Get a specific governanceAssignment for the requested scope by AssignmentKey. * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param assessmentName The Assessment Key - Unique key for the assessment type. - * @param assignmentKey The security governance assignment key - the assessment key of the required governance - * assignment. + * @param scope The scope of the Governance assignments. Valid scopes are: subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * @param assessmentName The Assessment Key - A unique key for the assessment type. + * @param assignmentKey The governance assignment key - the assessment key of the required governance assignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -395,11 +401,11 @@ private Mono getAsync(String scope, String assessment /** * Get a specific governanceAssignment for the requested scope by AssignmentKey. * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param assessmentName The Assessment Key - Unique key for the assessment type. - * @param assignmentKey The security governance assignment key - the assessment key of the required governance - * assignment. + * @param scope The scope of the Governance assignments. Valid scopes are: subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * @param assessmentName The Assessment Key - A unique key for the assessment type. + * @param assignmentKey The governance assignment key - the assessment key of the required governance assignment. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -415,11 +421,11 @@ public Response getWithResponse( /** * Get a specific governanceAssignment for the requested scope by AssignmentKey. * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param assessmentName The Assessment Key - Unique key for the assessment type. - * @param assignmentKey The security governance assignment key - the assessment key of the required governance - * assignment. + * @param scope The scope of the Governance assignments. Valid scopes are: subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * @param assessmentName The Assessment Key - A unique key for the assessment type. + * @param assignmentKey The governance assignment key - the assessment key of the required governance assignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -431,19 +437,19 @@ public GovernanceAssignmentInner get(String scope, String assessmentName, String } /** - * Creates or update a security GovernanceAssignment on the given subscription. + * Creates or updates a governance assignment on the given subscription. * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param assessmentName The Assessment Key - Unique key for the assessment type. - * @param assignmentKey The security governance assignment key - the assessment key of the required governance - * assignment. - * @param governanceAssignment GovernanceAssignment over a subscription scope. + * @param scope The scope of the Governance assignments. Valid scopes are: subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * @param assessmentName The Assessment Key - A unique key for the assessment type. + * @param assignmentKey The governance assignment key - the assessment key of the required governance assignment. + * @param governanceAssignment Governance assignment over a subscription scope. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security GovernanceAssignment over a given scope along with {@link Response} on successful completion of - * {@link Mono}. + * @return governance assignment over a given scope along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrUpdateWithResponseAsync( @@ -488,20 +494,20 @@ private Mono> createOrUpdateWithResponseAsyn } /** - * Creates or update a security GovernanceAssignment on the given subscription. + * Creates or updates a governance assignment on the given subscription. * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param assessmentName The Assessment Key - Unique key for the assessment type. - * @param assignmentKey The security governance assignment key - the assessment key of the required governance - * assignment. - * @param governanceAssignment GovernanceAssignment over a subscription scope. + * @param scope The scope of the Governance assignments. Valid scopes are: subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * @param assessmentName The Assessment Key - A unique key for the assessment type. + * @param assignmentKey The governance assignment key - the assessment key of the required governance assignment. + * @param governanceAssignment Governance assignment over a subscription scope. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security GovernanceAssignment over a given scope along with {@link Response} on successful completion of - * {@link Mono}. + * @return governance assignment over a given scope along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrUpdateWithResponseAsync( @@ -547,18 +553,18 @@ private Mono> createOrUpdateWithResponseAsyn } /** - * Creates or update a security GovernanceAssignment on the given subscription. + * Creates or updates a governance assignment on the given subscription. * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param assessmentName The Assessment Key - Unique key for the assessment type. - * @param assignmentKey The security governance assignment key - the assessment key of the required governance - * assignment. - * @param governanceAssignment GovernanceAssignment over a subscription scope. + * @param scope The scope of the Governance assignments. Valid scopes are: subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * @param assessmentName The Assessment Key - A unique key for the assessment type. + * @param assignmentKey The governance assignment key - the assessment key of the required governance assignment. + * @param governanceAssignment Governance assignment over a subscription scope. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security GovernanceAssignment over a given scope on successful completion of {@link Mono}. + * @return governance assignment over a given scope on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync( @@ -568,19 +574,19 @@ private Mono createOrUpdateAsync( } /** - * Creates or update a security GovernanceAssignment on the given subscription. + * Creates or updates a governance assignment on the given subscription. * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param assessmentName The Assessment Key - Unique key for the assessment type. - * @param assignmentKey The security governance assignment key - the assessment key of the required governance - * assignment. - * @param governanceAssignment GovernanceAssignment over a subscription scope. + * @param scope The scope of the Governance assignments. Valid scopes are: subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * @param assessmentName The Assessment Key - A unique key for the assessment type. + * @param assignmentKey The governance assignment key - the assessment key of the required governance assignment. + * @param governanceAssignment Governance assignment over a subscription scope. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security GovernanceAssignment over a given scope along with {@link Response}. + * @return governance assignment over a given scope along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response createOrUpdateWithResponse( @@ -594,18 +600,18 @@ public Response createOrUpdateWithResponse( } /** - * Creates or update a security GovernanceAssignment on the given subscription. + * Creates or updates a governance assignment on the given subscription. * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param assessmentName The Assessment Key - Unique key for the assessment type. - * @param assignmentKey The security governance assignment key - the assessment key of the required governance - * assignment. - * @param governanceAssignment GovernanceAssignment over a subscription scope. + * @param scope The scope of the Governance assignments. Valid scopes are: subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * @param assessmentName The Assessment Key - A unique key for the assessment type. + * @param assignmentKey The governance assignment key - the assessment key of the required governance assignment. + * @param governanceAssignment Governance assignment over a subscription scope. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security GovernanceAssignment over a given scope. + * @return governance assignment over a given scope. */ @ServiceMethod(returns = ReturnType.SINGLE) public GovernanceAssignmentInner createOrUpdate( @@ -617,11 +623,11 @@ public GovernanceAssignmentInner createOrUpdate( /** * Delete a GovernanceAssignment over a given scope. * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param assessmentName The Assessment Key - Unique key for the assessment type. - * @param assignmentKey The security governance assignment key - the assessment key of the required governance - * assignment. + * @param scope The scope of the Governance assignments. Valid scopes are: subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * @param assessmentName The Assessment Key - A unique key for the assessment type. + * @param assignmentKey The governance assignment key - the assessment key of the required governance assignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -656,11 +662,11 @@ private Mono> deleteWithResponseAsync(String scope, String assess /** * Delete a GovernanceAssignment over a given scope. * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param assessmentName The Assessment Key - Unique key for the assessment type. - * @param assignmentKey The security governance assignment key - the assessment key of the required governance - * assignment. + * @param scope The scope of the Governance assignments. Valid scopes are: subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * @param assessmentName The Assessment Key - A unique key for the assessment type. + * @param assignmentKey The governance assignment key - the assessment key of the required governance assignment. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -693,11 +699,11 @@ private Mono> deleteWithResponseAsync( /** * Delete a GovernanceAssignment over a given scope. * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param assessmentName The Assessment Key - Unique key for the assessment type. - * @param assignmentKey The security governance assignment key - the assessment key of the required governance - * assignment. + * @param scope The scope of the Governance assignments. Valid scopes are: subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * @param assessmentName The Assessment Key - A unique key for the assessment type. + * @param assignmentKey The governance assignment key - the assessment key of the required governance assignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -711,11 +717,11 @@ private Mono deleteAsync(String scope, String assessmentName, String assig /** * Delete a GovernanceAssignment over a given scope. * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param assessmentName The Assessment Key - Unique key for the assessment type. - * @param assignmentKey The security governance assignment key - the assessment key of the required governance - * assignment. + * @param scope The scope of the Governance assignments. Valid scopes are: subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * @param assessmentName The Assessment Key - A unique key for the assessment type. + * @param assignmentKey The governance assignment key - the assessment key of the required governance assignment. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -731,11 +737,11 @@ public Response deleteWithResponse( /** * Delete a GovernanceAssignment over a given scope. * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param assessmentName The Assessment Key - Unique key for the assessment type. - * @param assignmentKey The security governance assignment key - the assessment key of the required governance - * assignment. + * @param scope The scope of the Governance assignments. Valid scopes are: subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * @param assessmentName The Assessment Key - A unique key for the assessment type. + * @param assignmentKey The governance assignment key - the assessment key of the required governance assignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -753,8 +759,8 @@ public void delete(String scope, String assessmentName, String assignmentKey) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return page of a security governance assignments list along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * @return page of a governance assignments list along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -791,8 +797,8 @@ private Mono> listNextSinglePageAsync(S * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return page of a security governance assignments list along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * @return page of a governance assignments list along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GovernanceRuleImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GovernanceRuleImpl.java index 305b3e22fa3c6..da9ab6f2522b3 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GovernanceRuleImpl.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GovernanceRuleImpl.java @@ -9,6 +9,7 @@ import com.azure.resourcemanager.security.models.ExecuteGovernanceRuleParams; import com.azure.resourcemanager.security.models.GovernanceRule; import com.azure.resourcemanager.security.models.GovernanceRuleEmailNotification; +import com.azure.resourcemanager.security.models.GovernanceRuleMetadata; import com.azure.resourcemanager.security.models.GovernanceRuleOwnerSource; import com.azure.resourcemanager.security.models.GovernanceRuleSourceResourceType; import com.azure.resourcemanager.security.models.GovernanceRuleType; @@ -32,6 +33,10 @@ public String type() { return this.innerModel().type(); } + public String tenantId() { + return this.innerModel().tenantId(); + } + public String displayName() { return this.innerModel().displayName(); } @@ -64,6 +69,15 @@ public GovernanceRuleSourceResourceType sourceResourceType() { return this.innerModel().sourceResourceType(); } + public List excludedScopes() { + List inner = this.innerModel().excludedScopes(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + public List conditionSets() { List inner = this.innerModel().conditionSets(); if (inner != null) { @@ -73,6 +87,10 @@ public List conditionSets() { } } + public Boolean includeMemberScopes() { + return this.innerModel().includeMemberScopes(); + } + public GovernanceRuleOwnerSource ownerSource() { return this.innerModel().ownerSource(); } @@ -81,6 +99,10 @@ public GovernanceRuleEmailNotification governanceEmailNotification() { return this.innerModel().governanceEmailNotification(); } + public GovernanceRuleMetadata metadata() { + return this.innerModel().metadata(); + } + public GovernanceRuleInner innerModel() { return this.innerObject; } @@ -89,14 +111,21 @@ private com.azure.resourcemanager.security.SecurityManager manager() { return this.serviceManager; } + private String scope; + private String ruleId; + public GovernanceRuleImpl withExistingScope(String scope) { + this.scope = scope; + return this; + } + public GovernanceRule create() { this.innerObject = serviceManager .serviceClient() - .getGovernanceRulesOperations() - .createOrUpdateWithResponse(ruleId, this.innerModel(), Context.NONE) + .getGovernanceRules() + .createOrUpdateWithResponse(scope, ruleId, this.innerModel(), Context.NONE) .getValue(); return this; } @@ -105,8 +134,8 @@ public GovernanceRule create(Context context) { this.innerObject = serviceManager .serviceClient() - .getGovernanceRulesOperations() - .createOrUpdateWithResponse(ruleId, this.innerModel(), context) + .getGovernanceRules() + .createOrUpdateWithResponse(scope, ruleId, this.innerModel(), context) .getValue(); return this; } @@ -125,8 +154,8 @@ public GovernanceRule apply() { this.innerObject = serviceManager .serviceClient() - .getGovernanceRulesOperations() - .createOrUpdateWithResponse(ruleId, this.innerModel(), Context.NONE) + .getGovernanceRules() + .createOrUpdateWithResponse(scope, ruleId, this.innerModel(), Context.NONE) .getValue(); return this; } @@ -135,8 +164,8 @@ public GovernanceRule apply(Context context) { this.innerObject = serviceManager .serviceClient() - .getGovernanceRulesOperations() - .createOrUpdateWithResponse(ruleId, this.innerModel(), context) + .getGovernanceRules() + .createOrUpdateWithResponse(scope, ruleId, this.innerModel(), context) .getValue(); return this; } @@ -145,34 +174,34 @@ public GovernanceRule apply(Context context) { GovernanceRuleInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.ruleId = Utils.getValueFromIdByName(innerObject.id(), "governanceRules"); + this.scope = + Utils + .getValueFromIdByParameterName( + innerObject.id(), "/{scope}/providers/Microsoft.Security/governanceRules/{ruleId}", "scope"); + this.ruleId = + Utils + .getValueFromIdByParameterName( + innerObject.id(), "/{scope}/providers/Microsoft.Security/governanceRules/{ruleId}", "ruleId"); } public GovernanceRule refresh() { this.innerObject = - serviceManager - .serviceClient() - .getGovernanceRulesOperations() - .getWithResponse(ruleId, Context.NONE) - .getValue(); + serviceManager.serviceClient().getGovernanceRules().getWithResponse(scope, ruleId, Context.NONE).getValue(); return this; } public GovernanceRule refresh(Context context) { this.innerObject = - serviceManager.serviceClient().getGovernanceRulesOperations().getWithResponse(ruleId, context).getValue(); + serviceManager.serviceClient().getGovernanceRules().getWithResponse(scope, ruleId, context).getValue(); return this; } - public void ruleIdExecuteSingleSubscription() { - serviceManager.governanceRulesOperations().ruleIdExecuteSingleSubscription(ruleId); + public void execute() { + serviceManager.governanceRules().execute(scope, ruleId); } - public void ruleIdExecuteSingleSubscription( - ExecuteGovernanceRuleParams executeGovernanceRuleParams, Context context) { - serviceManager - .governanceRulesOperations() - .ruleIdExecuteSingleSubscription(ruleId, executeGovernanceRuleParams, context); + public void execute(ExecuteGovernanceRuleParams executeGovernanceRuleParams, Context context) { + serviceManager.governanceRules().execute(scope, ruleId, executeGovernanceRuleParams, context); } public GovernanceRuleImpl withDisplayName(String displayName) { @@ -215,11 +244,21 @@ public GovernanceRuleImpl withSourceResourceType(GovernanceRuleSourceResourceTyp return this; } + public GovernanceRuleImpl withExcludedScopes(List excludedScopes) { + this.innerModel().withExcludedScopes(excludedScopes); + return this; + } + public GovernanceRuleImpl withConditionSets(List conditionSets) { this.innerModel().withConditionSets(conditionSets); return this; } + public GovernanceRuleImpl withIncludeMemberScopes(Boolean includeMemberScopes) { + this.innerModel().withIncludeMemberScopes(includeMemberScopes); + return this; + } + public GovernanceRuleImpl withOwnerSource(GovernanceRuleOwnerSource ownerSource) { this.innerModel().withOwnerSource(ownerSource); return this; @@ -230,4 +269,9 @@ public GovernanceRuleImpl withGovernanceEmailNotification( this.innerModel().withGovernanceEmailNotification(governanceEmailNotification); return this; } + + public GovernanceRuleImpl withMetadata(GovernanceRuleMetadata metadata) { + this.innerModel().withMetadata(metadata); + return this; + } } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GovernanceRulesClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GovernanceRulesClientImpl.java index ea8fac3117c40..011360e5c693e 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GovernanceRulesClientImpl.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GovernanceRulesClientImpl.java @@ -4,6 +4,8 @@ package com.azure.resourcemanager.security.implementation; +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; @@ -11,6 +13,8 @@ import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; import com.azure.core.annotation.QueryParam; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -23,11 +27,19 @@ import com.azure.core.http.rest.Response; import com.azure.core.http.rest.RestProxy; import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.security.fluent.GovernanceRulesClient; import com.azure.resourcemanager.security.fluent.models.GovernanceRuleInner; +import com.azure.resourcemanager.security.fluent.models.OperationResultAutoGeneratedInner; +import com.azure.resourcemanager.security.models.ExecuteGovernanceRuleParams; import com.azure.resourcemanager.security.models.GovernanceRuleList; +import com.azure.resourcemanager.security.models.GovernanceRulesOperationResultsResponse; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; /** An instance of this class provides access to all the operations defined in GovernanceRulesClient. */ @@ -57,13 +69,75 @@ public final class GovernanceRulesClientImpl implements GovernanceRulesClient { @ServiceInterface(name = "SecurityCenterGovern") public interface GovernanceRulesService { @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/governanceRules") + @Get("/{scope}/providers/Microsoft.Security/governanceRules") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> list( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + @PathParam("scope") String scope, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/{scope}/providers/Microsoft.Security/governanceRules/{ruleId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("scope") String scope, + @PathParam("ruleId") String ruleId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put("/{scope}/providers/Microsoft.Security/governanceRules/{ruleId}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("scope") String scope, + @PathParam("ruleId") String ruleId, + @BodyParam("application/json") GovernanceRuleInner governanceRule, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Delete("/{scope}/providers/Microsoft.Security/governanceRules/{ruleId}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("scope") String scope, + @PathParam("ruleId") String ruleId, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post("/{scope}/providers/Microsoft.Security/governanceRules/{ruleId}/execute") + @ExpectedResponses({202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> execute( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("scope") String scope, + @PathParam("ruleId") String ruleId, + @BodyParam("application/json") ExecuteGovernanceRuleParams executeGovernanceRuleParams, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/{scope}/providers/Microsoft.Security/governanceRules/{ruleId}/operationResults/{operationId}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono operationResults( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("scope") String scope, + @PathParam("ruleId") String ruleId, + @PathParam("operationId") String operationId, @HeaderParam("Accept") String accept, Context context); @@ -79,34 +153,33 @@ Mono> listNext( } /** - * Get a list of all relevant governanceRules over a subscription level scope. + * Get a list of all relevant governance rules over a scope. * + * @param scope The scope of the Governance rules. Valid scopes are: management group (format: + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all relevant governanceRules over a subscription level scope along with {@link PagedResponse} - * on successful completion of {@link Mono}. + * @return a list of all relevant governance rules over a scope along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { + private Mono> listSinglePageAsync(String scope) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + if (scope == null) { + return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); } final String apiVersion = "2022-01-01-preview"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) + .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, scope, accept, context)) .>map( res -> new PagedResponseBase<>( @@ -120,34 +193,35 @@ private Mono> listSinglePageAsync() { } /** - * Get a list of all relevant governanceRules over a subscription level scope. + * Get a list of all relevant governance rules over a scope. * + * @param scope The scope of the Governance rules. Valid scopes are: management group (format: + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all relevant governanceRules over a subscription level scope along with {@link PagedResponse} - * on successful completion of {@link Mono}. + * @return a list of all relevant governance rules over a scope along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { + private Mono> listSinglePageAsync(String scope, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + if (scope == null) { + return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); } final String apiVersion = "2022-01-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) + .list(this.client.getEndpoint(), apiVersion, scope, accept, context) .map( res -> new PagedResponseBase<>( @@ -160,60 +234,1021 @@ private Mono> listSinglePageAsync(Context con } /** - * Get a list of all relevant governanceRules over a subscription level scope. + * Get a list of all relevant governance rules over a scope. * + * @param scope The scope of the Governance rules. Valid scopes are: management group (format: + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all relevant governanceRules over a subscription level scope as paginated response with {@link - * PagedFlux}. + * @return a list of all relevant governance rules over a scope as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + private PagedFlux listAsync(String scope) { + return new PagedFlux<>(() -> listSinglePageAsync(scope), nextLink -> listNextSinglePageAsync(nextLink)); } /** - * Get a list of all relevant governanceRules over a subscription level scope. + * Get a list of all relevant governance rules over a scope. * + * @param scope The scope of the Governance rules. Valid scopes are: management group (format: + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all relevant governanceRules over a subscription level scope as paginated response with {@link - * PagedFlux}. + * @return a list of all relevant governance rules over a scope as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { + private PagedFlux listAsync(String scope, Context context) { return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + () -> listSinglePageAsync(scope, context), nextLink -> listNextSinglePageAsync(nextLink, context)); } /** - * Get a list of all relevant governanceRules over a subscription level scope. + * Get a list of all relevant governance rules over a scope. * + * @param scope The scope of the Governance rules. Valid scopes are: management group (format: + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all relevant governanceRules over a subscription level scope as paginated response with {@link - * PagedIterable}. + * @return a list of all relevant governance rules over a scope as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); + public PagedIterable list(String scope) { + return new PagedIterable<>(listAsync(scope)); } /** - * Get a list of all relevant governanceRules over a subscription level scope. + * Get a list of all relevant governance rules over a scope. * + * @param scope The scope of the Governance rules. Valid scopes are: management group (format: + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all relevant governanceRules over a subscription level scope as paginated response with {@link - * PagedIterable}. + * @return a list of all relevant governance rules over a scope as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); + public PagedIterable list(String scope, Context context) { + return new PagedIterable<>(listAsync(scope, context)); + } + + /** + * Get a specific governance rule for the requested scope by ruleId. + * + * @param scope The scope of the Governance rules. Valid scopes are: management group (format: + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a specific governance rule for the requested scope by ruleId along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String scope, String ruleId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (scope == null) { + return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); + } + if (ruleId == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleId is required and cannot be null.")); + } + final String apiVersion = "2022-01-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, scope, ruleId, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a specific governance rule for the requested scope by ruleId. + * + * @param scope The scope of the Governance rules. Valid scopes are: management group (format: + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a specific governance rule for the requested scope by ruleId along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String scope, String ruleId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (scope == null) { + return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); + } + if (ruleId == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleId is required and cannot be null.")); + } + final String apiVersion = "2022-01-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), apiVersion, scope, ruleId, accept, context); + } + + /** + * Get a specific governance rule for the requested scope by ruleId. + * + * @param scope The scope of the Governance rules. Valid scopes are: management group (format: + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a specific governance rule for the requested scope by ruleId on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String scope, String ruleId) { + return getWithResponseAsync(scope, ruleId).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a specific governance rule for the requested scope by ruleId. + * + * @param scope The scope of the Governance rules. Valid scopes are: management group (format: + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a specific governance rule for the requested scope by ruleId along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String scope, String ruleId, Context context) { + return getWithResponseAsync(scope, ruleId, context).block(); + } + + /** + * Get a specific governance rule for the requested scope by ruleId. + * + * @param scope The scope of the Governance rules. Valid scopes are: management group (format: + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a specific governance rule for the requested scope by ruleId. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GovernanceRuleInner get(String scope, String ruleId) { + return getWithResponse(scope, ruleId, Context.NONE).getValue(); + } + + /** + * Creates or updates a governance rule over a given scope. + * + * @param scope The scope of the Governance rules. Valid scopes are: management group (format: + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). + * @param governanceRule Governance rule over a given scope. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return governance rule over a given scope along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String scope, String ruleId, GovernanceRuleInner governanceRule) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (scope == null) { + return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); + } + if (ruleId == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleId is required and cannot be null.")); + } + if (governanceRule == null) { + return Mono.error(new IllegalArgumentException("Parameter governanceRule is required and cannot be null.")); + } else { + governanceRule.validate(); + } + final String apiVersion = "2022-01-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), apiVersion, scope, ruleId, governanceRule, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a governance rule over a given scope. + * + * @param scope The scope of the Governance rules. Valid scopes are: management group (format: + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). + * @param governanceRule Governance rule over a given scope. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return governance rule over a given scope along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String scope, String ruleId, GovernanceRuleInner governanceRule, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (scope == null) { + return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); + } + if (ruleId == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleId is required and cannot be null.")); + } + if (governanceRule == null) { + return Mono.error(new IllegalArgumentException("Parameter governanceRule is required and cannot be null.")); + } else { + governanceRule.validate(); + } + final String apiVersion = "2022-01-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate(this.client.getEndpoint(), apiVersion, scope, ruleId, governanceRule, accept, context); + } + + /** + * Creates or updates a governance rule over a given scope. + * + * @param scope The scope of the Governance rules. Valid scopes are: management group (format: + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). + * @param governanceRule Governance rule over a given scope. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return governance rule over a given scope on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String scope, String ruleId, GovernanceRuleInner governanceRule) { + return createOrUpdateWithResponseAsync(scope, ruleId, governanceRule) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Creates or updates a governance rule over a given scope. + * + * @param scope The scope of the Governance rules. Valid scopes are: management group (format: + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). + * @param governanceRule Governance rule over a given scope. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return governance rule over a given scope along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String scope, String ruleId, GovernanceRuleInner governanceRule, Context context) { + return createOrUpdateWithResponseAsync(scope, ruleId, governanceRule, context).block(); + } + + /** + * Creates or updates a governance rule over a given scope. + * + * @param scope The scope of the Governance rules. Valid scopes are: management group (format: + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). + * @param governanceRule Governance rule over a given scope. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return governance rule over a given scope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GovernanceRuleInner createOrUpdate(String scope, String ruleId, GovernanceRuleInner governanceRule) { + return createOrUpdateWithResponse(scope, ruleId, governanceRule, Context.NONE).getValue(); + } + + /** + * Delete a Governance rule over a given scope. + * + * @param scope The scope of the Governance rules. Valid scopes are: management group (format: + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String scope, String ruleId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (scope == null) { + return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); + } + if (ruleId == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleId is required and cannot be null.")); + } + final String apiVersion = "2022-01-01-preview"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), apiVersion, scope, ruleId, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a Governance rule over a given scope. + * + * @param scope The scope of the Governance rules. Valid scopes are: management group (format: + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String scope, String ruleId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (scope == null) { + return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); + } + if (ruleId == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleId is required and cannot be null.")); + } + final String apiVersion = "2022-01-01-preview"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), apiVersion, scope, ruleId, context); + } + + /** + * Delete a Governance rule over a given scope. + * + * @param scope The scope of the Governance rules. Valid scopes are: management group (format: + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String scope, String ruleId) { + Mono>> mono = deleteWithResponseAsync(scope, ruleId); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Delete a Governance rule over a given scope. + * + * @param scope The scope of the Governance rules. Valid scopes are: management group (format: + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String scope, String ruleId, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(scope, ruleId, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete a Governance rule over a given scope. + * + * @param scope The scope of the Governance rules. Valid scopes are: management group (format: + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String scope, String ruleId) { + return this.beginDeleteAsync(scope, ruleId).getSyncPoller(); + } + + /** + * Delete a Governance rule over a given scope. + * + * @param scope The scope of the Governance rules. Valid scopes are: management group (format: + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String scope, String ruleId, Context context) { + return this.beginDeleteAsync(scope, ruleId, context).getSyncPoller(); + } + + /** + * Delete a Governance rule over a given scope. + * + * @param scope The scope of the Governance rules. Valid scopes are: management group (format: + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String scope, String ruleId) { + return beginDeleteAsync(scope, ruleId).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a Governance rule over a given scope. + * + * @param scope The scope of the Governance rules. Valid scopes are: management group (format: + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String scope, String ruleId, Context context) { + return beginDeleteAsync(scope, ruleId, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a Governance rule over a given scope. + * + * @param scope The scope of the Governance rules. Valid scopes are: management group (format: + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String scope, String ruleId) { + deleteAsync(scope, ruleId).block(); + } + + /** + * Delete a Governance rule over a given scope. + * + * @param scope The scope of the Governance rules. Valid scopes are: management group (format: + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String scope, String ruleId, Context context) { + deleteAsync(scope, ruleId, context).block(); + } + + /** + * Execute a governance rule. + * + * @param scope The scope of the Governance rules. Valid scopes are: management group (format: + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). + * @param executeGovernanceRuleParams Execute governance rule over a given scope. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> executeWithResponseAsync( + String scope, String ruleId, ExecuteGovernanceRuleParams executeGovernanceRuleParams) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (scope == null) { + return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); + } + if (ruleId == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleId is required and cannot be null.")); + } + if (executeGovernanceRuleParams != null) { + executeGovernanceRuleParams.validate(); + } + final String apiVersion = "2022-01-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .execute( + this.client.getEndpoint(), + apiVersion, + scope, + ruleId, + executeGovernanceRuleParams, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Execute a governance rule. + * + * @param scope The scope of the Governance rules. Valid scopes are: management group (format: + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). + * @param executeGovernanceRuleParams Execute governance rule over a given scope. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> executeWithResponseAsync( + String scope, String ruleId, ExecuteGovernanceRuleParams executeGovernanceRuleParams, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (scope == null) { + return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); + } + if (ruleId == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleId is required and cannot be null.")); + } + if (executeGovernanceRuleParams != null) { + executeGovernanceRuleParams.validate(); + } + final String apiVersion = "2022-01-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .execute( + this.client.getEndpoint(), apiVersion, scope, ruleId, executeGovernanceRuleParams, accept, context); + } + + /** + * Execute a governance rule. + * + * @param scope The scope of the Governance rules. Valid scopes are: management group (format: + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). + * @param executeGovernanceRuleParams Execute governance rule over a given scope. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginExecuteAsync( + String scope, String ruleId, ExecuteGovernanceRuleParams executeGovernanceRuleParams) { + Mono>> mono = executeWithResponseAsync(scope, ruleId, executeGovernanceRuleParams); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Execute a governance rule. + * + * @param scope The scope of the Governance rules. Valid scopes are: management group (format: + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginExecuteAsync(String scope, String ruleId) { + final ExecuteGovernanceRuleParams executeGovernanceRuleParams = null; + Mono>> mono = executeWithResponseAsync(scope, ruleId, executeGovernanceRuleParams); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Execute a governance rule. + * + * @param scope The scope of the Governance rules. Valid scopes are: management group (format: + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). + * @param executeGovernanceRuleParams Execute governance rule over a given scope. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginExecuteAsync( + String scope, String ruleId, ExecuteGovernanceRuleParams executeGovernanceRuleParams, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + executeWithResponseAsync(scope, ruleId, executeGovernanceRuleParams, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Execute a governance rule. + * + * @param scope The scope of the Governance rules. Valid scopes are: management group (format: + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginExecute(String scope, String ruleId) { + final ExecuteGovernanceRuleParams executeGovernanceRuleParams = null; + return this.beginExecuteAsync(scope, ruleId, executeGovernanceRuleParams).getSyncPoller(); + } + + /** + * Execute a governance rule. + * + * @param scope The scope of the Governance rules. Valid scopes are: management group (format: + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). + * @param executeGovernanceRuleParams Execute governance rule over a given scope. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginExecute( + String scope, String ruleId, ExecuteGovernanceRuleParams executeGovernanceRuleParams, Context context) { + return this.beginExecuteAsync(scope, ruleId, executeGovernanceRuleParams, context).getSyncPoller(); + } + + /** + * Execute a governance rule. + * + * @param scope The scope of the Governance rules. Valid scopes are: management group (format: + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). + * @param executeGovernanceRuleParams Execute governance rule over a given scope. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono executeAsync( + String scope, String ruleId, ExecuteGovernanceRuleParams executeGovernanceRuleParams) { + return beginExecuteAsync(scope, ruleId, executeGovernanceRuleParams) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Execute a governance rule. + * + * @param scope The scope of the Governance rules. Valid scopes are: management group (format: + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono executeAsync(String scope, String ruleId) { + final ExecuteGovernanceRuleParams executeGovernanceRuleParams = null; + return beginExecuteAsync(scope, ruleId, executeGovernanceRuleParams) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Execute a governance rule. + * + * @param scope The scope of the Governance rules. Valid scopes are: management group (format: + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). + * @param executeGovernanceRuleParams Execute governance rule over a given scope. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono executeAsync( + String scope, String ruleId, ExecuteGovernanceRuleParams executeGovernanceRuleParams, Context context) { + return beginExecuteAsync(scope, ruleId, executeGovernanceRuleParams, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Execute a governance rule. + * + * @param scope The scope of the Governance rules. Valid scopes are: management group (format: + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void execute(String scope, String ruleId) { + final ExecuteGovernanceRuleParams executeGovernanceRuleParams = null; + executeAsync(scope, ruleId, executeGovernanceRuleParams).block(); + } + + /** + * Execute a governance rule. + * + * @param scope The scope of the Governance rules. Valid scopes are: management group (format: + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). + * @param executeGovernanceRuleParams Execute governance rule over a given scope. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void execute( + String scope, String ruleId, ExecuteGovernanceRuleParams executeGovernanceRuleParams, Context context) { + executeAsync(scope, ruleId, executeGovernanceRuleParams, context).block(); + } + + /** + * Get governance rules long run operation result for the requested scope by ruleId and operationId. + * + * @param scope The scope of the Governance rules. Valid scopes are: management group (format: + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). + * @param operationId The governance rule long running operation unique key. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return governance rules long run operation result for the requested scope by ruleId and operationId on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono operationResultsWithResponseAsync( + String scope, String ruleId, String operationId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (scope == null) { + return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); + } + if (ruleId == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleId is required and cannot be null.")); + } + if (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + final String apiVersion = "2022-01-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .operationResults( + this.client.getEndpoint(), apiVersion, scope, ruleId, operationId, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get governance rules long run operation result for the requested scope by ruleId and operationId. + * + * @param scope The scope of the Governance rules. Valid scopes are: management group (format: + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). + * @param operationId The governance rule long running operation unique key. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return governance rules long run operation result for the requested scope by ruleId and operationId on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono operationResultsWithResponseAsync( + String scope, String ruleId, String operationId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (scope == null) { + return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); + } + if (ruleId == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleId is required and cannot be null.")); + } + if (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + final String apiVersion = "2022-01-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .operationResults(this.client.getEndpoint(), apiVersion, scope, ruleId, operationId, accept, context); + } + + /** + * Get governance rules long run operation result for the requested scope by ruleId and operationId. + * + * @param scope The scope of the Governance rules. Valid scopes are: management group (format: + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). + * @param operationId The governance rule long running operation unique key. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return governance rules long run operation result for the requested scope by ruleId and operationId on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono operationResultsAsync( + String scope, String ruleId, String operationId) { + return operationResultsWithResponseAsync(scope, ruleId, operationId) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get governance rules long run operation result for the requested scope by ruleId and operationId. + * + * @param scope The scope of the Governance rules. Valid scopes are: management group (format: + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). + * @param operationId The governance rule long running operation unique key. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return governance rules long run operation result for the requested scope by ruleId and operationId. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GovernanceRulesOperationResultsResponse operationResultsWithResponse( + String scope, String ruleId, String operationId, Context context) { + return operationResultsWithResponseAsync(scope, ruleId, operationId, context).block(); + } + + /** + * Get governance rules long run operation result for the requested scope by ruleId and operationId. + * + * @param scope The scope of the Governance rules. Valid scopes are: management group (format: + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). + * @param operationId The governance rule long running operation unique key. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return governance rules long run operation result for the requested scope by ruleId and operationId. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationResultAutoGeneratedInner operationResults(String scope, String ruleId, String operationId) { + return operationResultsWithResponse(scope, ruleId, operationId, Context.NONE).getValue(); } /** @@ -224,8 +1259,8 @@ public PagedIterable list(Context context) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return page of a security governanceRules list along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return page of a governance rules list along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -262,8 +1297,8 @@ private Mono> listNextSinglePageAsync(String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return page of a security governanceRules list along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return page of a governance rules list along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GovernanceRulesImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GovernanceRulesImpl.java index 4d51e8088d803..30860d8f1e41e 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GovernanceRulesImpl.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GovernanceRulesImpl.java @@ -5,12 +5,18 @@ package com.azure.resourcemanager.security.implementation; import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.security.fluent.GovernanceRulesClient; import com.azure.resourcemanager.security.fluent.models.GovernanceRuleInner; +import com.azure.resourcemanager.security.fluent.models.OperationResultAutoGeneratedInner; +import com.azure.resourcemanager.security.models.ExecuteGovernanceRuleParams; import com.azure.resourcemanager.security.models.GovernanceRule; import com.azure.resourcemanager.security.models.GovernanceRules; +import com.azure.resourcemanager.security.models.GovernanceRulesOperationResultsResponse; +import com.azure.resourcemanager.security.models.OperationResultAutoGenerated; public final class GovernanceRulesImpl implements GovernanceRules { private static final ClientLogger LOGGER = new ClientLogger(GovernanceRulesImpl.class); @@ -25,16 +31,179 @@ public GovernanceRulesImpl( this.serviceManager = serviceManager; } - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); + public PagedIterable list(String scope) { + PagedIterable inner = this.serviceClient().list(scope); return Utils.mapPage(inner, inner1 -> new GovernanceRuleImpl(inner1, this.manager())); } - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); + public PagedIterable list(String scope, Context context) { + PagedIterable inner = this.serviceClient().list(scope, context); return Utils.mapPage(inner, inner1 -> new GovernanceRuleImpl(inner1, this.manager())); } + public Response getWithResponse(String scope, String ruleId, Context context) { + Response inner = this.serviceClient().getWithResponse(scope, ruleId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new GovernanceRuleImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public GovernanceRule get(String scope, String ruleId) { + GovernanceRuleInner inner = this.serviceClient().get(scope, ruleId); + if (inner != null) { + return new GovernanceRuleImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String scope, String ruleId) { + this.serviceClient().delete(scope, ruleId); + } + + public void delete(String scope, String ruleId, Context context) { + this.serviceClient().delete(scope, ruleId, context); + } + + public void execute(String scope, String ruleId) { + this.serviceClient().execute(scope, ruleId); + } + + public void execute( + String scope, String ruleId, ExecuteGovernanceRuleParams executeGovernanceRuleParams, Context context) { + this.serviceClient().execute(scope, ruleId, executeGovernanceRuleParams, context); + } + + public Response operationResultsWithResponse( + String scope, String ruleId, String operationId, Context context) { + GovernanceRulesOperationResultsResponse inner = + this.serviceClient().operationResultsWithResponse(scope, ruleId, operationId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new OperationResultAutoGeneratedImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public OperationResultAutoGenerated operationResults(String scope, String ruleId, String operationId) { + OperationResultAutoGeneratedInner inner = this.serviceClient().operationResults(scope, ruleId, operationId); + if (inner != null) { + return new OperationResultAutoGeneratedImpl(inner, this.manager()); + } else { + return null; + } + } + + public GovernanceRule getById(String id) { + String scope = + Utils + .getValueFromIdByParameterName( + id, "/{scope}/providers/Microsoft.Security/governanceRules/{ruleId}", "scope"); + if (scope == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'scope'.", id))); + } + String ruleId = + Utils + .getValueFromIdByParameterName( + id, "/{scope}/providers/Microsoft.Security/governanceRules/{ruleId}", "ruleId"); + if (ruleId == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'governanceRules'.", id))); + } + return this.getWithResponse(scope, ruleId, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String scope = + Utils + .getValueFromIdByParameterName( + id, "/{scope}/providers/Microsoft.Security/governanceRules/{ruleId}", "scope"); + if (scope == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'scope'.", id))); + } + String ruleId = + Utils + .getValueFromIdByParameterName( + id, "/{scope}/providers/Microsoft.Security/governanceRules/{ruleId}", "ruleId"); + if (ruleId == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'governanceRules'.", id))); + } + return this.getWithResponse(scope, ruleId, context); + } + + public void deleteById(String id) { + String scope = + Utils + .getValueFromIdByParameterName( + id, "/{scope}/providers/Microsoft.Security/governanceRules/{ruleId}", "scope"); + if (scope == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'scope'.", id))); + } + String ruleId = + Utils + .getValueFromIdByParameterName( + id, "/{scope}/providers/Microsoft.Security/governanceRules/{ruleId}", "ruleId"); + if (ruleId == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'governanceRules'.", id))); + } + this.delete(scope, ruleId, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String scope = + Utils + .getValueFromIdByParameterName( + id, "/{scope}/providers/Microsoft.Security/governanceRules/{ruleId}", "scope"); + if (scope == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'scope'.", id))); + } + String ruleId = + Utils + .getValueFromIdByParameterName( + id, "/{scope}/providers/Microsoft.Security/governanceRules/{ruleId}", "ruleId"); + if (ruleId == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'governanceRules'.", id))); + } + this.delete(scope, ruleId, context); + } + private GovernanceRulesClient serviceClient() { return this.innerClient; } @@ -42,4 +211,8 @@ private GovernanceRulesClient serviceClient() { private com.azure.resourcemanager.security.SecurityManager manager() { return this.serviceManager; } + + public GovernanceRuleImpl define(String name) { + return new GovernanceRuleImpl(name, this.manager()); + } } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GovernanceRulesOperationsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GovernanceRulesOperationsClientImpl.java deleted file mode 100644 index 93087b1f3699e..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GovernanceRulesOperationsClientImpl.java +++ /dev/null @@ -1,1160 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.security.fluent.GovernanceRulesOperationsClient; -import com.azure.resourcemanager.security.fluent.models.GovernanceRuleInner; -import com.azure.resourcemanager.security.models.ExecuteGovernanceRuleParams; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in GovernanceRulesOperationsClient. */ -public final class GovernanceRulesOperationsClientImpl implements GovernanceRulesOperationsClient { - /** The proxy service used to perform REST calls. */ - private final GovernanceRulesOperationsService service; - - /** The service client containing this operation class. */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of GovernanceRulesOperationsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - GovernanceRulesOperationsClientImpl(SecurityCenterImpl client) { - this.service = - RestProxy - .create( - GovernanceRulesOperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterGovernanceRulesOperations to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterGovern") - public interface GovernanceRulesOperationsService { - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/governanceRules/{ruleId}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("ruleId") String ruleId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put("/subscriptions/{subscriptionId}/providers/Microsoft.Security/governanceRules/{ruleId}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("ruleId") String ruleId, - @BodyParam("application/json") GovernanceRuleInner governanceRule, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete("/subscriptions/{subscriptionId}/providers/Microsoft.Security/governanceRules/{ruleId}") - @ExpectedResponses({200, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("ruleId") String ruleId, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post("/subscriptions/{subscriptionId}/providers/Microsoft.Security/governanceRules/{ruleId}/execute") - @ExpectedResponses({202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> ruleIdExecuteSingleSubscription( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("ruleId") String ruleId, - @BodyParam("application/json") ExecuteGovernanceRuleParams executeGovernanceRuleParams, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security" - + "/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/governanceRules/{ruleId}" - + "/execute") - @ExpectedResponses({202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> ruleIdExecuteSingleSecurityConnector( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("securityConnectorName") String securityConnectorName, - @PathParam("ruleId") String ruleId, - @BodyParam("application/json") ExecuteGovernanceRuleParams executeGovernanceRuleParams, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Get a specific governanceRule for the requested scope by ruleId. - * - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific governanceRule for the requested scope by ruleId along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String ruleId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (ruleId == null) { - return Mono.error(new IllegalArgumentException("Parameter ruleId is required and cannot be null.")); - } - final String apiVersion = "2022-01-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - ruleId, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get a specific governanceRule for the requested scope by ruleId. - * - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific governanceRule for the requested scope by ruleId along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String ruleId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (ruleId == null) { - return Mono.error(new IllegalArgumentException("Parameter ruleId is required and cannot be null.")); - } - final String apiVersion = "2022-01-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), ruleId, accept, context); - } - - /** - * Get a specific governanceRule for the requested scope by ruleId. - * - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific governanceRule for the requested scope by ruleId on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String ruleId) { - return getWithResponseAsync(ruleId).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get a specific governanceRule for the requested scope by ruleId. - * - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific governanceRule for the requested scope by ruleId along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String ruleId, Context context) { - return getWithResponseAsync(ruleId, context).block(); - } - - /** - * Get a specific governanceRule for the requested scope by ruleId. - * - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific governanceRule for the requested scope by ruleId. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GovernanceRuleInner get(String ruleId) { - return getWithResponse(ruleId, Context.NONE).getValue(); - } - - /** - * Creates or update a security GovernanceRule on the given subscription. - * - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @param governanceRule GovernanceRule over a subscription scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security GovernanceRule over a given scope along with {@link Response} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String ruleId, GovernanceRuleInner governanceRule) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (ruleId == null) { - return Mono.error(new IllegalArgumentException("Parameter ruleId is required and cannot be null.")); - } - if (governanceRule == null) { - return Mono.error(new IllegalArgumentException("Parameter governanceRule is required and cannot be null.")); - } else { - governanceRule.validate(); - } - final String apiVersion = "2022-01-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - ruleId, - governanceRule, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or update a security GovernanceRule on the given subscription. - * - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @param governanceRule GovernanceRule over a subscription scope. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security GovernanceRule over a given scope along with {@link Response} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String ruleId, GovernanceRuleInner governanceRule, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (ruleId == null) { - return Mono.error(new IllegalArgumentException("Parameter ruleId is required and cannot be null.")); - } - if (governanceRule == null) { - return Mono.error(new IllegalArgumentException("Parameter governanceRule is required and cannot be null.")); - } else { - governanceRule.validate(); - } - final String apiVersion = "2022-01-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - ruleId, - governanceRule, - accept, - context); - } - - /** - * Creates or update a security GovernanceRule on the given subscription. - * - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @param governanceRule GovernanceRule over a subscription scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security GovernanceRule over a given scope on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String ruleId, GovernanceRuleInner governanceRule) { - return createOrUpdateWithResponseAsync(ruleId, governanceRule).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Creates or update a security GovernanceRule on the given subscription. - * - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @param governanceRule GovernanceRule over a subscription scope. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security GovernanceRule over a given scope along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse( - String ruleId, GovernanceRuleInner governanceRule, Context context) { - return createOrUpdateWithResponseAsync(ruleId, governanceRule, context).block(); - } - - /** - * Creates or update a security GovernanceRule on the given subscription. - * - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @param governanceRule GovernanceRule over a subscription scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security GovernanceRule over a given scope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GovernanceRuleInner createOrUpdate(String ruleId, GovernanceRuleInner governanceRule) { - return createOrUpdateWithResponse(ruleId, governanceRule, Context.NONE).getValue(); - } - - /** - * Delete a GovernanceRule over a given scope. - * - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String ruleId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (ruleId == null) { - return Mono.error(new IllegalArgumentException("Parameter ruleId is required and cannot be null.")); - } - final String apiVersion = "2022-01-01-preview"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), ruleId, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Delete a GovernanceRule over a given scope. - * - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String ruleId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (ruleId == null) { - return Mono.error(new IllegalArgumentException("Parameter ruleId is required and cannot be null.")); - } - final String apiVersion = "2022-01-01-preview"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), ruleId, context); - } - - /** - * Delete a GovernanceRule over a given scope. - * - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String ruleId) { - return deleteWithResponseAsync(ruleId).flatMap(ignored -> Mono.empty()); - } - - /** - * Delete a GovernanceRule over a given scope. - * - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String ruleId, Context context) { - return deleteWithResponseAsync(ruleId, context).block(); - } - - /** - * Delete a GovernanceRule over a given scope. - * - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String ruleId) { - deleteWithResponse(ruleId, Context.NONE); - } - - /** - * Execute a security GovernanceRule on the given subscription. - * - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @param executeGovernanceRuleParams GovernanceRule over a subscription scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> ruleIdExecuteSingleSubscriptionWithResponseAsync( - String ruleId, ExecuteGovernanceRuleParams executeGovernanceRuleParams) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (ruleId == null) { - return Mono.error(new IllegalArgumentException("Parameter ruleId is required and cannot be null.")); - } - if (executeGovernanceRuleParams != null) { - executeGovernanceRuleParams.validate(); - } - final String apiVersion = "2022-01-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .ruleIdExecuteSingleSubscription( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - ruleId, - executeGovernanceRuleParams, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Execute a security GovernanceRule on the given subscription. - * - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @param executeGovernanceRuleParams GovernanceRule over a subscription scope. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> ruleIdExecuteSingleSubscriptionWithResponseAsync( - String ruleId, ExecuteGovernanceRuleParams executeGovernanceRuleParams, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (ruleId == null) { - return Mono.error(new IllegalArgumentException("Parameter ruleId is required and cannot be null.")); - } - if (executeGovernanceRuleParams != null) { - executeGovernanceRuleParams.validate(); - } - final String apiVersion = "2022-01-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .ruleIdExecuteSingleSubscription( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - ruleId, - executeGovernanceRuleParams, - accept, - context); - } - - /** - * Execute a security GovernanceRule on the given subscription. - * - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @param executeGovernanceRuleParams GovernanceRule over a subscription scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginRuleIdExecuteSingleSubscriptionAsync( - String ruleId, ExecuteGovernanceRuleParams executeGovernanceRuleParams) { - Mono>> mono = - ruleIdExecuteSingleSubscriptionWithResponseAsync(ruleId, executeGovernanceRuleParams); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Execute a security GovernanceRule on the given subscription. - * - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginRuleIdExecuteSingleSubscriptionAsync(String ruleId) { - final ExecuteGovernanceRuleParams executeGovernanceRuleParams = null; - Mono>> mono = - ruleIdExecuteSingleSubscriptionWithResponseAsync(ruleId, executeGovernanceRuleParams); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Execute a security GovernanceRule on the given subscription. - * - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @param executeGovernanceRuleParams GovernanceRule over a subscription scope. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginRuleIdExecuteSingleSubscriptionAsync( - String ruleId, ExecuteGovernanceRuleParams executeGovernanceRuleParams, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - ruleIdExecuteSingleSubscriptionWithResponseAsync(ruleId, executeGovernanceRuleParams, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Execute a security GovernanceRule on the given subscription. - * - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginRuleIdExecuteSingleSubscription(String ruleId) { - final ExecuteGovernanceRuleParams executeGovernanceRuleParams = null; - return beginRuleIdExecuteSingleSubscriptionAsync(ruleId, executeGovernanceRuleParams).getSyncPoller(); - } - - /** - * Execute a security GovernanceRule on the given subscription. - * - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @param executeGovernanceRuleParams GovernanceRule over a subscription scope. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginRuleIdExecuteSingleSubscription( - String ruleId, ExecuteGovernanceRuleParams executeGovernanceRuleParams, Context context) { - return beginRuleIdExecuteSingleSubscriptionAsync(ruleId, executeGovernanceRuleParams, context).getSyncPoller(); - } - - /** - * Execute a security GovernanceRule on the given subscription. - * - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @param executeGovernanceRuleParams GovernanceRule over a subscription scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono ruleIdExecuteSingleSubscriptionAsync( - String ruleId, ExecuteGovernanceRuleParams executeGovernanceRuleParams) { - return beginRuleIdExecuteSingleSubscriptionAsync(ruleId, executeGovernanceRuleParams) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Execute a security GovernanceRule on the given subscription. - * - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono ruleIdExecuteSingleSubscriptionAsync(String ruleId) { - final ExecuteGovernanceRuleParams executeGovernanceRuleParams = null; - return beginRuleIdExecuteSingleSubscriptionAsync(ruleId, executeGovernanceRuleParams) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Execute a security GovernanceRule on the given subscription. - * - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @param executeGovernanceRuleParams GovernanceRule over a subscription scope. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono ruleIdExecuteSingleSubscriptionAsync( - String ruleId, ExecuteGovernanceRuleParams executeGovernanceRuleParams, Context context) { - return beginRuleIdExecuteSingleSubscriptionAsync(ruleId, executeGovernanceRuleParams, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Execute a security GovernanceRule on the given subscription. - * - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void ruleIdExecuteSingleSubscription(String ruleId) { - final ExecuteGovernanceRuleParams executeGovernanceRuleParams = null; - ruleIdExecuteSingleSubscriptionAsync(ruleId, executeGovernanceRuleParams).block(); - } - - /** - * Execute a security GovernanceRule on the given subscription. - * - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @param executeGovernanceRuleParams GovernanceRule over a subscription scope. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void ruleIdExecuteSingleSubscription( - String ruleId, ExecuteGovernanceRuleParams executeGovernanceRuleParams, Context context) { - ruleIdExecuteSingleSubscriptionAsync(ruleId, executeGovernanceRuleParams, context).block(); - } - - /** - * Execute a security GovernanceRule on the given security connector. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @param executeGovernanceRuleParams GovernanceRule over a subscription scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> ruleIdExecuteSingleSecurityConnectorWithResponseAsync( - String resourceGroupName, - String securityConnectorName, - String ruleId, - ExecuteGovernanceRuleParams executeGovernanceRuleParams) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - if (ruleId == null) { - return Mono.error(new IllegalArgumentException("Parameter ruleId is required and cannot be null.")); - } - if (executeGovernanceRuleParams != null) { - executeGovernanceRuleParams.validate(); - } - final String apiVersion = "2022-01-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .ruleIdExecuteSingleSecurityConnector( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - securityConnectorName, - ruleId, - executeGovernanceRuleParams, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Execute a security GovernanceRule on the given security connector. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @param executeGovernanceRuleParams GovernanceRule over a subscription scope. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> ruleIdExecuteSingleSecurityConnectorWithResponseAsync( - String resourceGroupName, - String securityConnectorName, - String ruleId, - ExecuteGovernanceRuleParams executeGovernanceRuleParams, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - if (ruleId == null) { - return Mono.error(new IllegalArgumentException("Parameter ruleId is required and cannot be null.")); - } - if (executeGovernanceRuleParams != null) { - executeGovernanceRuleParams.validate(); - } - final String apiVersion = "2022-01-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .ruleIdExecuteSingleSecurityConnector( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - securityConnectorName, - ruleId, - executeGovernanceRuleParams, - accept, - context); - } - - /** - * Execute a security GovernanceRule on the given security connector. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @param executeGovernanceRuleParams GovernanceRule over a subscription scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginRuleIdExecuteSingleSecurityConnectorAsync( - String resourceGroupName, - String securityConnectorName, - String ruleId, - ExecuteGovernanceRuleParams executeGovernanceRuleParams) { - Mono>> mono = - ruleIdExecuteSingleSecurityConnectorWithResponseAsync( - resourceGroupName, securityConnectorName, ruleId, executeGovernanceRuleParams); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Execute a security GovernanceRule on the given security connector. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginRuleIdExecuteSingleSecurityConnectorAsync( - String resourceGroupName, String securityConnectorName, String ruleId) { - final ExecuteGovernanceRuleParams executeGovernanceRuleParams = null; - Mono>> mono = - ruleIdExecuteSingleSecurityConnectorWithResponseAsync( - resourceGroupName, securityConnectorName, ruleId, executeGovernanceRuleParams); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Execute a security GovernanceRule on the given security connector. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @param executeGovernanceRuleParams GovernanceRule over a subscription scope. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginRuleIdExecuteSingleSecurityConnectorAsync( - String resourceGroupName, - String securityConnectorName, - String ruleId, - ExecuteGovernanceRuleParams executeGovernanceRuleParams, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - ruleIdExecuteSingleSecurityConnectorWithResponseAsync( - resourceGroupName, securityConnectorName, ruleId, executeGovernanceRuleParams, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Execute a security GovernanceRule on the given security connector. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginRuleIdExecuteSingleSecurityConnector( - String resourceGroupName, String securityConnectorName, String ruleId) { - final ExecuteGovernanceRuleParams executeGovernanceRuleParams = null; - return beginRuleIdExecuteSingleSecurityConnectorAsync( - resourceGroupName, securityConnectorName, ruleId, executeGovernanceRuleParams) - .getSyncPoller(); - } - - /** - * Execute a security GovernanceRule on the given security connector. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @param executeGovernanceRuleParams GovernanceRule over a subscription scope. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginRuleIdExecuteSingleSecurityConnector( - String resourceGroupName, - String securityConnectorName, - String ruleId, - ExecuteGovernanceRuleParams executeGovernanceRuleParams, - Context context) { - return beginRuleIdExecuteSingleSecurityConnectorAsync( - resourceGroupName, securityConnectorName, ruleId, executeGovernanceRuleParams, context) - .getSyncPoller(); - } - - /** - * Execute a security GovernanceRule on the given security connector. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @param executeGovernanceRuleParams GovernanceRule over a subscription scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono ruleIdExecuteSingleSecurityConnectorAsync( - String resourceGroupName, - String securityConnectorName, - String ruleId, - ExecuteGovernanceRuleParams executeGovernanceRuleParams) { - return beginRuleIdExecuteSingleSecurityConnectorAsync( - resourceGroupName, securityConnectorName, ruleId, executeGovernanceRuleParams) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Execute a security GovernanceRule on the given security connector. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono ruleIdExecuteSingleSecurityConnectorAsync( - String resourceGroupName, String securityConnectorName, String ruleId) { - final ExecuteGovernanceRuleParams executeGovernanceRuleParams = null; - return beginRuleIdExecuteSingleSecurityConnectorAsync( - resourceGroupName, securityConnectorName, ruleId, executeGovernanceRuleParams) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Execute a security GovernanceRule on the given security connector. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @param executeGovernanceRuleParams GovernanceRule over a subscription scope. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono ruleIdExecuteSingleSecurityConnectorAsync( - String resourceGroupName, - String securityConnectorName, - String ruleId, - ExecuteGovernanceRuleParams executeGovernanceRuleParams, - Context context) { - return beginRuleIdExecuteSingleSecurityConnectorAsync( - resourceGroupName, securityConnectorName, ruleId, executeGovernanceRuleParams, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Execute a security GovernanceRule on the given security connector. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void ruleIdExecuteSingleSecurityConnector( - String resourceGroupName, String securityConnectorName, String ruleId) { - final ExecuteGovernanceRuleParams executeGovernanceRuleParams = null; - ruleIdExecuteSingleSecurityConnectorAsync( - resourceGroupName, securityConnectorName, ruleId, executeGovernanceRuleParams) - .block(); - } - - /** - * Execute a security GovernanceRule on the given security connector. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @param executeGovernanceRuleParams GovernanceRule over a subscription scope. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void ruleIdExecuteSingleSecurityConnector( - String resourceGroupName, - String securityConnectorName, - String ruleId, - ExecuteGovernanceRuleParams executeGovernanceRuleParams, - Context context) { - ruleIdExecuteSingleSecurityConnectorAsync( - resourceGroupName, securityConnectorName, ruleId, executeGovernanceRuleParams, context) - .block(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GovernanceRulesOperationsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GovernanceRulesOperationsImpl.java deleted file mode 100644 index cccc331c926bc..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GovernanceRulesOperationsImpl.java +++ /dev/null @@ -1,146 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.GovernanceRulesOperationsClient; -import com.azure.resourcemanager.security.fluent.models.GovernanceRuleInner; -import com.azure.resourcemanager.security.models.ExecuteGovernanceRuleParams; -import com.azure.resourcemanager.security.models.GovernanceRule; -import com.azure.resourcemanager.security.models.GovernanceRulesOperations; - -public final class GovernanceRulesOperationsImpl implements GovernanceRulesOperations { - private static final ClientLogger LOGGER = new ClientLogger(GovernanceRulesOperationsImpl.class); - - private final GovernanceRulesOperationsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public GovernanceRulesOperationsImpl( - GovernanceRulesOperationsClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String ruleId, Context context) { - Response inner = this.serviceClient().getWithResponse(ruleId, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new GovernanceRuleImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public GovernanceRule get(String ruleId) { - GovernanceRuleInner inner = this.serviceClient().get(ruleId); - if (inner != null) { - return new GovernanceRuleImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response deleteWithResponse(String ruleId, Context context) { - return this.serviceClient().deleteWithResponse(ruleId, context); - } - - public void delete(String ruleId) { - this.serviceClient().delete(ruleId); - } - - public void ruleIdExecuteSingleSubscription(String ruleId) { - this.serviceClient().ruleIdExecuteSingleSubscription(ruleId); - } - - public void ruleIdExecuteSingleSubscription( - String ruleId, ExecuteGovernanceRuleParams executeGovernanceRuleParams, Context context) { - this.serviceClient().ruleIdExecuteSingleSubscription(ruleId, executeGovernanceRuleParams, context); - } - - public void ruleIdExecuteSingleSecurityConnector( - String resourceGroupName, String securityConnectorName, String ruleId) { - this.serviceClient().ruleIdExecuteSingleSecurityConnector(resourceGroupName, securityConnectorName, ruleId); - } - - public void ruleIdExecuteSingleSecurityConnector( - String resourceGroupName, - String securityConnectorName, - String ruleId, - ExecuteGovernanceRuleParams executeGovernanceRuleParams, - Context context) { - this - .serviceClient() - .ruleIdExecuteSingleSecurityConnector( - resourceGroupName, securityConnectorName, ruleId, executeGovernanceRuleParams, context); - } - - public GovernanceRule getById(String id) { - String ruleId = Utils.getValueFromIdByName(id, "governanceRules"); - if (ruleId == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'governanceRules'.", id))); - } - return this.getWithResponse(ruleId, Context.NONE).getValue(); - } - - public Response getByIdWithResponse(String id, Context context) { - String ruleId = Utils.getValueFromIdByName(id, "governanceRules"); - if (ruleId == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'governanceRules'.", id))); - } - return this.getWithResponse(ruleId, context); - } - - public void deleteById(String id) { - String ruleId = Utils.getValueFromIdByName(id, "governanceRules"); - if (ruleId == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'governanceRules'.", id))); - } - this.deleteWithResponse(ruleId, Context.NONE); - } - - public Response deleteByIdWithResponse(String id, Context context) { - String ruleId = Utils.getValueFromIdByName(id, "governanceRules"); - if (ruleId == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'governanceRules'.", id))); - } - return this.deleteWithResponse(ruleId, context); - } - - private GovernanceRulesOperationsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - public GovernanceRuleImpl define(String name) { - return new GovernanceRuleImpl(name, this.manager()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/HealthReportImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/HealthReportImpl.java new file mode 100644 index 0000000000000..e93fab68ae8e3 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/HealthReportImpl.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.implementation; + +import com.azure.resourcemanager.security.fluent.models.HealthReportInner; +import com.azure.resourcemanager.security.models.EnvironmentDetails; +import com.azure.resourcemanager.security.models.HealthDataClassification; +import com.azure.resourcemanager.security.models.HealthReport; +import com.azure.resourcemanager.security.models.Issue; +import com.azure.resourcemanager.security.models.ResourceDetailsAutoGenerated; +import com.azure.resourcemanager.security.models.StatusAutoGenerated; +import java.util.Collections; +import java.util.List; + +public final class HealthReportImpl implements HealthReport { + private HealthReportInner innerObject; + + private final com.azure.resourcemanager.security.SecurityManager serviceManager; + + HealthReportImpl(HealthReportInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public ResourceDetailsAutoGenerated resourceDetails() { + return this.innerModel().resourceDetails(); + } + + public EnvironmentDetails environmentDetails() { + return this.innerModel().environmentDetails(); + } + + public HealthDataClassification healthDataClassification() { + return this.innerModel().healthDataClassification(); + } + + public StatusAutoGenerated status() { + return this.innerModel().status(); + } + + public List affectedDefendersPlans() { + List inner = this.innerModel().affectedDefendersPlans(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List issues() { + List inner = this.innerModel().issues(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public HealthReportInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.security.SecurityManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/HealthReportOperationsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/HealthReportOperationsClientImpl.java new file mode 100644 index 0000000000000..d2c16f0a8577c --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/HealthReportOperationsClientImpl.java @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.security.fluent.HealthReportOperationsClient; +import com.azure.resourcemanager.security.fluent.models.HealthReportInner; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in HealthReportOperationsClient. */ +public final class HealthReportOperationsClientImpl implements HealthReportOperationsClient { + /** The proxy service used to perform REST calls. */ + private final HealthReportOperationsService service; + + /** The service client containing this operation class. */ + private final SecurityCenterImpl client; + + /** + * Initializes an instance of HealthReportOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + HealthReportOperationsClientImpl(SecurityCenterImpl client) { + this.service = + RestProxy + .create(HealthReportOperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityCenterHealthReportOperations to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SecurityCenterHealth") + public interface HealthReportOperationsService { + @Headers({"Content-Type: application/json"}) + @Get("/{resourceId}/providers/Microsoft.Security/healthReports/{healthReportName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam(value = "resourceId", encoded = true) String resourceId, + @PathParam("healthReportName") String healthReportName, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get health report of resource. + * + * @param resourceId The identifier of the resource. + * @param healthReportName The health report Key - Unique key for the health report type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return health report of resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceId, String healthReportName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceId == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); + } + if (healthReportName == null) { + return Mono + .error(new IllegalArgumentException("Parameter healthReportName is required and cannot be null.")); + } + final String apiVersion = "2023-02-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service.get(this.client.getEndpoint(), apiVersion, resourceId, healthReportName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get health report of resource. + * + * @param resourceId The identifier of the resource. + * @param healthReportName The health report Key - Unique key for the health report type. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return health report of resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceId, String healthReportName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceId == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); + } + if (healthReportName == null) { + return Mono + .error(new IllegalArgumentException("Parameter healthReportName is required and cannot be null.")); + } + final String apiVersion = "2023-02-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), apiVersion, resourceId, healthReportName, accept, context); + } + + /** + * Get health report of resource. + * + * @param resourceId The identifier of the resource. + * @param healthReportName The health report Key - Unique key for the health report type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return health report of resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceId, String healthReportName) { + return getWithResponseAsync(resourceId, healthReportName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get health report of resource. + * + * @param resourceId The identifier of the resource. + * @param healthReportName The health report Key - Unique key for the health report type. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return health report of resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceId, String healthReportName, Context context) { + return getWithResponseAsync(resourceId, healthReportName, context).block(); + } + + /** + * Get health report of resource. + * + * @param resourceId The identifier of the resource. + * @param healthReportName The health report Key - Unique key for the health report type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return health report of resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public HealthReportInner get(String resourceId, String healthReportName) { + return getWithResponse(resourceId, healthReportName, Context.NONE).getValue(); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/HealthReportOperationsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/HealthReportOperationsImpl.java new file mode 100644 index 0000000000000..6824b37162f94 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/HealthReportOperationsImpl.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.security.fluent.HealthReportOperationsClient; +import com.azure.resourcemanager.security.fluent.models.HealthReportInner; +import com.azure.resourcemanager.security.models.HealthReport; +import com.azure.resourcemanager.security.models.HealthReportOperations; + +public final class HealthReportOperationsImpl implements HealthReportOperations { + private static final ClientLogger LOGGER = new ClientLogger(HealthReportOperationsImpl.class); + + private final HealthReportOperationsClient innerClient; + + private final com.azure.resourcemanager.security.SecurityManager serviceManager; + + public HealthReportOperationsImpl( + HealthReportOperationsClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceId, String healthReportName, Context context) { + Response inner = this.serviceClient().getWithResponse(resourceId, healthReportName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new HealthReportImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public HealthReport get(String resourceId, String healthReportName) { + HealthReportInner inner = this.serviceClient().get(resourceId, healthReportName); + if (inner != null) { + return new HealthReportImpl(inner, this.manager()); + } else { + return null; + } + } + + private HealthReportOperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.security.SecurityManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityConnectorGovernanceRulesClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/HealthReportsClientImpl.java similarity index 52% rename from sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityConnectorGovernanceRulesClientImpl.java rename to sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/HealthReportsClientImpl.java index 8003fecc610a6..06047bcaac586 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityConnectorGovernanceRulesClientImpl.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/HealthReportsClientImpl.java @@ -25,55 +25,45 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.SecurityConnectorGovernanceRulesClient; -import com.azure.resourcemanager.security.fluent.models.GovernanceRuleInner; -import com.azure.resourcemanager.security.models.GovernanceRuleList; +import com.azure.resourcemanager.security.fluent.HealthReportsClient; +import com.azure.resourcemanager.security.fluent.models.HealthReportInner; +import com.azure.resourcemanager.security.models.HealthReportsList; import reactor.core.publisher.Mono; -/** - * An instance of this class provides access to all the operations defined in SecurityConnectorGovernanceRulesClient. - */ -public final class SecurityConnectorGovernanceRulesClientImpl implements SecurityConnectorGovernanceRulesClient { +/** An instance of this class provides access to all the operations defined in HealthReportsClient. */ +public final class HealthReportsClientImpl implements HealthReportsClient { /** The proxy service used to perform REST calls. */ - private final SecurityConnectorGovernanceRulesService service; + private final HealthReportsService service; /** The service client containing this operation class. */ private final SecurityCenterImpl client; /** - * Initializes an instance of SecurityConnectorGovernanceRulesClientImpl. + * Initializes an instance of HealthReportsClientImpl. * * @param client the instance of the service client containing this operation class. */ - SecurityConnectorGovernanceRulesClientImpl(SecurityCenterImpl client) { + HealthReportsClientImpl(SecurityCenterImpl client) { this.service = - RestProxy - .create( - SecurityConnectorGovernanceRulesService.class, - client.getHttpPipeline(), - client.getSerializerAdapter()); + RestProxy.create(HealthReportsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for SecurityCenterSecurityConnectorGovernanceRules to be used by the - * proxy service to perform REST calls. + * The interface defining all the services for SecurityCenterHealthReports to be used by the proxy service to + * perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "SecurityCenterSecuri") - public interface SecurityConnectorGovernanceRulesService { + @ServiceInterface(name = "SecurityCenterHealth") + public interface HealthReportsService { @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security" - + "/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/governanceRules") + @Get("/{scope}/providers/Microsoft.Security/healthReports") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( + Mono> list( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("securityConnectorName") String securityConnectorName, + @PathParam(value = "scope", encoded = true) String scope, @HeaderParam("Accept") String accept, Context context); @@ -81,7 +71,7 @@ Mono> list( @Get("{nextLink}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( + Mono> listNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, @@ -89,55 +79,33 @@ Mono> listNext( } /** - * Get a list of all relevant governanceRules over a security connector level scope. + * Get a list of all health reports inside a scope. Valid scopes are: subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. + * @param scope The scope at which the operation is performed. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all relevant governanceRules over a security connector level scope along with {@link - * PagedResponse} on successful completion of {@link Mono}. + * @return a list of all health reports inside a scope along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String securityConnectorName) { + private Mono> listSinglePageAsync(String scope) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); + if (scope == null) { + return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); } - final String apiVersion = "2022-01-01-preview"; + final String apiVersion = "2023-02-01-preview"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - securityConnectorName, - accept, - context)) - .>map( + .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, scope, accept, context)) + .>map( res -> new PagedResponseBase<>( res.getRequest(), @@ -150,53 +118,34 @@ private Mono> listSinglePageAsync( } /** - * Get a list of all relevant governanceRules over a security connector level scope. + * Get a list of all health reports inside a scope. Valid scopes are: subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. + * @param scope The scope at which the operation is performed. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all relevant governanceRules over a security connector level scope along with {@link - * PagedResponse} on successful completion of {@link Mono}. + * @return a list of all health reports inside a scope along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String securityConnectorName, Context context) { + private Mono> listSinglePageAsync(String scope, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + if (scope == null) { + return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - final String apiVersion = "2022-01-01-preview"; + final String apiVersion = "2023-02-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - securityConnectorName, - accept, - context) + .list(this.client.getEndpoint(), apiVersion, scope, accept, context) .map( res -> new PagedResponseBase<>( @@ -209,79 +158,70 @@ private Mono> listSinglePageAsync( } /** - * Get a list of all relevant governanceRules over a security connector level scope. + * Get a list of all health reports inside a scope. Valid scopes are: subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. + * @param scope The scope at which the operation is performed. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all relevant governanceRules over a security connector level scope as paginated response with - * {@link PagedFlux}. + * @return a list of all health reports inside a scope as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String securityConnectorName) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, securityConnectorName), - nextLink -> listNextSinglePageAsync(nextLink)); + private PagedFlux listAsync(String scope) { + return new PagedFlux<>(() -> listSinglePageAsync(scope), nextLink -> listNextSinglePageAsync(nextLink)); } /** - * Get a list of all relevant governanceRules over a security connector level scope. + * Get a list of all health reports inside a scope. Valid scopes are: subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. + * @param scope The scope at which the operation is performed. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all relevant governanceRules over a security connector level scope as paginated response with - * {@link PagedFlux}. + * @return a list of all health reports inside a scope as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, String securityConnectorName, Context context) { + private PagedFlux listAsync(String scope, Context context) { return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, securityConnectorName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + () -> listSinglePageAsync(scope, context), nextLink -> listNextSinglePageAsync(nextLink, context)); } /** - * Get a list of all relevant governanceRules over a security connector level scope. + * Get a list of all health reports inside a scope. Valid scopes are: subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. + * @param scope The scope at which the operation is performed. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all relevant governanceRules over a security connector level scope as paginated response with - * {@link PagedIterable}. + * @return a list of all health reports inside a scope as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String securityConnectorName) { - return new PagedIterable<>(listAsync(resourceGroupName, securityConnectorName)); + public PagedIterable list(String scope) { + return new PagedIterable<>(listAsync(scope)); } /** - * Get a list of all relevant governanceRules over a security connector level scope. + * Get a list of all health reports inside a scope. Valid scopes are: subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. + * @param scope The scope at which the operation is performed. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all relevant governanceRules over a security connector level scope as paginated response with - * {@link PagedIterable}. + * @return a list of all health reports inside a scope as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String resourceGroupName, String securityConnectorName, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, securityConnectorName, context)); + public PagedIterable list(String scope, Context context) { + return new PagedIterable<>(listAsync(scope, context)); } /** @@ -292,11 +232,10 @@ public PagedIterable list( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return page of a security governanceRules list along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return page of health reports list along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { + private Mono> listNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -309,7 +248,7 @@ private Mono> listNextSinglePageAsync(String final String accept = "application/json"; return FluxUtil .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( + .>map( res -> new PagedResponseBase<>( res.getRequest(), @@ -330,11 +269,10 @@ private Mono> listNextSinglePageAsync(String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return page of a security governanceRules list along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return page of health reports list along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { + private Mono> listNextSinglePageAsync(String nextLink, Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/HealthReportsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/HealthReportsImpl.java new file mode 100644 index 0000000000000..cf87726c02728 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/HealthReportsImpl.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.security.fluent.HealthReportsClient; +import com.azure.resourcemanager.security.fluent.models.HealthReportInner; +import com.azure.resourcemanager.security.models.HealthReport; +import com.azure.resourcemanager.security.models.HealthReports; + +public final class HealthReportsImpl implements HealthReports { + private static final ClientLogger LOGGER = new ClientLogger(HealthReportsImpl.class); + + private final HealthReportsClient innerClient; + + private final com.azure.resourcemanager.security.SecurityManager serviceManager; + + public HealthReportsImpl( + HealthReportsClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String scope) { + PagedIterable inner = this.serviceClient().list(scope); + return Utils.mapPage(inner, inner1 -> new HealthReportImpl(inner1, this.manager())); + } + + public PagedIterable list(String scope, Context context) { + PagedIterable inner = this.serviceClient().list(scope, context); + return Utils.mapPage(inner, inner1 -> new HealthReportImpl(inner1, this.manager())); + } + + private HealthReportsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.security.SecurityManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/OperationResultAutoGeneratedImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/OperationResultAutoGeneratedImpl.java new file mode 100644 index 0000000000000..dc4835d2f4bc1 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/OperationResultAutoGeneratedImpl.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.implementation; + +import com.azure.resourcemanager.security.fluent.models.OperationResultAutoGeneratedInner; +import com.azure.resourcemanager.security.models.OperationResult; +import com.azure.resourcemanager.security.models.OperationResultAutoGenerated; + +public final class OperationResultAutoGeneratedImpl implements OperationResultAutoGenerated { + private OperationResultAutoGeneratedInner innerObject; + + private final com.azure.resourcemanager.security.SecurityManager serviceManager; + + OperationResultAutoGeneratedImpl( + OperationResultAutoGeneratedInner innerObject, + com.azure.resourcemanager.security.SecurityManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public OperationResult status() { + return this.innerModel().status(); + } + + public OperationResultAutoGeneratedInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.security.SecurityManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityCenterImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityCenterImpl.java index 9a689bc4619e3..c9277a64c04f3 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityCenterImpl.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityCenterImpl.java @@ -47,7 +47,8 @@ import com.azure.resourcemanager.security.fluent.ExternalSecuritySolutionsClient; import com.azure.resourcemanager.security.fluent.GovernanceAssignmentsClient; import com.azure.resourcemanager.security.fluent.GovernanceRulesClient; -import com.azure.resourcemanager.security.fluent.GovernanceRulesOperationsClient; +import com.azure.resourcemanager.security.fluent.HealthReportOperationsClient; +import com.azure.resourcemanager.security.fluent.HealthReportsClient; import com.azure.resourcemanager.security.fluent.InformationProtectionPoliciesClient; import com.azure.resourcemanager.security.fluent.IngestionSettingsClient; import com.azure.resourcemanager.security.fluent.IotSecuritySolutionAnalyticsClient; @@ -68,9 +69,6 @@ import com.azure.resourcemanager.security.fluent.SecurityCenter; import com.azure.resourcemanager.security.fluent.SecurityConnectorApplicationOperationsClient; import com.azure.resourcemanager.security.fluent.SecurityConnectorApplicationsClient; -import com.azure.resourcemanager.security.fluent.SecurityConnectorGovernanceRulesClient; -import com.azure.resourcemanager.security.fluent.SecurityConnectorGovernanceRulesExecuteStatusClient; -import com.azure.resourcemanager.security.fluent.SecurityConnectorGovernanceRulesOperationsClient; import com.azure.resourcemanager.security.fluent.SecurityConnectorsClient; import com.azure.resourcemanager.security.fluent.SecurityContactsClient; import com.azure.resourcemanager.security.fluent.SecuritySolutionsClient; @@ -82,7 +80,6 @@ import com.azure.resourcemanager.security.fluent.SqlVulnerabilityAssessmentScanResultsClient; import com.azure.resourcemanager.security.fluent.SqlVulnerabilityAssessmentScansClient; import com.azure.resourcemanager.security.fluent.SubAssessmentsClient; -import com.azure.resourcemanager.security.fluent.SubscriptionGovernanceRulesExecuteStatusClient; import com.azure.resourcemanager.security.fluent.TasksClient; import com.azure.resourcemanager.security.fluent.TopologiesClient; import com.azure.resourcemanager.security.fluent.WorkspaceSettingsClient; @@ -650,42 +647,6 @@ public ConnectorsClient getConnectors() { return this.connectors; } - /** The SqlVulnerabilityAssessmentScansClient object to access its operations. */ - private final SqlVulnerabilityAssessmentScansClient sqlVulnerabilityAssessmentScans; - - /** - * Gets the SqlVulnerabilityAssessmentScansClient object to access its operations. - * - * @return the SqlVulnerabilityAssessmentScansClient object. - */ - public SqlVulnerabilityAssessmentScansClient getSqlVulnerabilityAssessmentScans() { - return this.sqlVulnerabilityAssessmentScans; - } - - /** The SqlVulnerabilityAssessmentScanResultsClient object to access its operations. */ - private final SqlVulnerabilityAssessmentScanResultsClient sqlVulnerabilityAssessmentScanResults; - - /** - * Gets the SqlVulnerabilityAssessmentScanResultsClient object to access its operations. - * - * @return the SqlVulnerabilityAssessmentScanResultsClient object. - */ - public SqlVulnerabilityAssessmentScanResultsClient getSqlVulnerabilityAssessmentScanResults() { - return this.sqlVulnerabilityAssessmentScanResults; - } - - /** The SqlVulnerabilityAssessmentBaselineRulesClient object to access its operations. */ - private final SqlVulnerabilityAssessmentBaselineRulesClient sqlVulnerabilityAssessmentBaselineRules; - - /** - * Gets the SqlVulnerabilityAssessmentBaselineRulesClient object to access its operations. - * - * @return the SqlVulnerabilityAssessmentBaselineRulesClient object. - */ - public SqlVulnerabilityAssessmentBaselineRulesClient getSqlVulnerabilityAssessmentBaselineRules() { - return this.sqlVulnerabilityAssessmentBaselineRules; - } - /** The AlertsClient object to access its operations. */ private final AlertsClient alerts; @@ -758,66 +719,6 @@ public GovernanceRulesClient getGovernanceRules() { return this.governanceRules; } - /** The GovernanceRulesOperationsClient object to access its operations. */ - private final GovernanceRulesOperationsClient governanceRulesOperations; - - /** - * Gets the GovernanceRulesOperationsClient object to access its operations. - * - * @return the GovernanceRulesOperationsClient object. - */ - public GovernanceRulesOperationsClient getGovernanceRulesOperations() { - return this.governanceRulesOperations; - } - - /** The SecurityConnectorGovernanceRulesClient object to access its operations. */ - private final SecurityConnectorGovernanceRulesClient securityConnectorGovernanceRules; - - /** - * Gets the SecurityConnectorGovernanceRulesClient object to access its operations. - * - * @return the SecurityConnectorGovernanceRulesClient object. - */ - public SecurityConnectorGovernanceRulesClient getSecurityConnectorGovernanceRules() { - return this.securityConnectorGovernanceRules; - } - - /** The SecurityConnectorGovernanceRulesOperationsClient object to access its operations. */ - private final SecurityConnectorGovernanceRulesOperationsClient securityConnectorGovernanceRulesOperations; - - /** - * Gets the SecurityConnectorGovernanceRulesOperationsClient object to access its operations. - * - * @return the SecurityConnectorGovernanceRulesOperationsClient object. - */ - public SecurityConnectorGovernanceRulesOperationsClient getSecurityConnectorGovernanceRulesOperations() { - return this.securityConnectorGovernanceRulesOperations; - } - - /** The SubscriptionGovernanceRulesExecuteStatusClient object to access its operations. */ - private final SubscriptionGovernanceRulesExecuteStatusClient subscriptionGovernanceRulesExecuteStatus; - - /** - * Gets the SubscriptionGovernanceRulesExecuteStatusClient object to access its operations. - * - * @return the SubscriptionGovernanceRulesExecuteStatusClient object. - */ - public SubscriptionGovernanceRulesExecuteStatusClient getSubscriptionGovernanceRulesExecuteStatus() { - return this.subscriptionGovernanceRulesExecuteStatus; - } - - /** The SecurityConnectorGovernanceRulesExecuteStatusClient object to access its operations. */ - private final SecurityConnectorGovernanceRulesExecuteStatusClient securityConnectorGovernanceRulesExecuteStatus; - - /** - * Gets the SecurityConnectorGovernanceRulesExecuteStatusClient object to access its operations. - * - * @return the SecurityConnectorGovernanceRulesExecuteStatusClient object. - */ - public SecurityConnectorGovernanceRulesExecuteStatusClient getSecurityConnectorGovernanceRulesExecuteStatus() { - return this.securityConnectorGovernanceRulesExecuteStatus; - } - /** The GovernanceAssignmentsClient object to access its operations. */ private final GovernanceAssignmentsClient governanceAssignments; @@ -914,6 +815,66 @@ public ApiCollectionOffboardingsClient getApiCollectionOffboardings() { return this.apiCollectionOffboardings; } + /** The HealthReportsClient object to access its operations. */ + private final HealthReportsClient healthReports; + + /** + * Gets the HealthReportsClient object to access its operations. + * + * @return the HealthReportsClient object. + */ + public HealthReportsClient getHealthReports() { + return this.healthReports; + } + + /** The HealthReportOperationsClient object to access its operations. */ + private final HealthReportOperationsClient healthReportOperations; + + /** + * Gets the HealthReportOperationsClient object to access its operations. + * + * @return the HealthReportOperationsClient object. + */ + public HealthReportOperationsClient getHealthReportOperations() { + return this.healthReportOperations; + } + + /** The SqlVulnerabilityAssessmentScansClient object to access its operations. */ + private final SqlVulnerabilityAssessmentScansClient sqlVulnerabilityAssessmentScans; + + /** + * Gets the SqlVulnerabilityAssessmentScansClient object to access its operations. + * + * @return the SqlVulnerabilityAssessmentScansClient object. + */ + public SqlVulnerabilityAssessmentScansClient getSqlVulnerabilityAssessmentScans() { + return this.sqlVulnerabilityAssessmentScans; + } + + /** The SqlVulnerabilityAssessmentScanResultsClient object to access its operations. */ + private final SqlVulnerabilityAssessmentScanResultsClient sqlVulnerabilityAssessmentScanResults; + + /** + * Gets the SqlVulnerabilityAssessmentScanResultsClient object to access its operations. + * + * @return the SqlVulnerabilityAssessmentScanResultsClient object. + */ + public SqlVulnerabilityAssessmentScanResultsClient getSqlVulnerabilityAssessmentScanResults() { + return this.sqlVulnerabilityAssessmentScanResults; + } + + /** The SqlVulnerabilityAssessmentBaselineRulesClient object to access its operations. */ + private final SqlVulnerabilityAssessmentBaselineRulesClient sqlVulnerabilityAssessmentBaselineRules; + + /** + * Gets the SqlVulnerabilityAssessmentBaselineRulesClient object to access its operations. + * + * @return the SqlVulnerabilityAssessmentBaselineRulesClient object. + */ + public SqlVulnerabilityAssessmentBaselineRulesClient getSqlVulnerabilityAssessmentBaselineRules() { + return this.sqlVulnerabilityAssessmentBaselineRules; + } + /** * Initializes an instance of SecurityCenter client. * @@ -979,22 +940,12 @@ public ApiCollectionOffboardingsClient getApiCollectionOffboardings() { this.secureScoreControlDefinitions = new SecureScoreControlDefinitionsClientImpl(this); this.securitySolutions = new SecuritySolutionsClientImpl(this); this.connectors = new ConnectorsClientImpl(this); - this.sqlVulnerabilityAssessmentScans = new SqlVulnerabilityAssessmentScansClientImpl(this); - this.sqlVulnerabilityAssessmentScanResults = new SqlVulnerabilityAssessmentScanResultsClientImpl(this); - this.sqlVulnerabilityAssessmentBaselineRules = new SqlVulnerabilityAssessmentBaselineRulesClientImpl(this); this.alerts = new AlertsClientImpl(this); this.settings = new SettingsClientImpl(this); this.ingestionSettings = new IngestionSettingsClientImpl(this); this.softwareInventories = new SoftwareInventoriesClientImpl(this); this.securityConnectors = new SecurityConnectorsClientImpl(this); this.governanceRules = new GovernanceRulesClientImpl(this); - this.governanceRulesOperations = new GovernanceRulesOperationsClientImpl(this); - this.securityConnectorGovernanceRules = new SecurityConnectorGovernanceRulesClientImpl(this); - this.securityConnectorGovernanceRulesOperations = - new SecurityConnectorGovernanceRulesOperationsClientImpl(this); - this.subscriptionGovernanceRulesExecuteStatus = new SubscriptionGovernanceRulesExecuteStatusClientImpl(this); - this.securityConnectorGovernanceRulesExecuteStatus = - new SecurityConnectorGovernanceRulesExecuteStatusClientImpl(this); this.governanceAssignments = new GovernanceAssignmentsClientImpl(this); this.applications = new ApplicationsClientImpl(this); this.applicationOperations = new ApplicationOperationsClientImpl(this); @@ -1003,6 +954,11 @@ public ApiCollectionOffboardingsClient getApiCollectionOffboardings() { this.apiCollections = new ApiCollectionsClientImpl(this); this.apiCollectionOnboardings = new ApiCollectionOnboardingsClientImpl(this); this.apiCollectionOffboardings = new ApiCollectionOffboardingsClientImpl(this); + this.healthReports = new HealthReportsClientImpl(this); + this.healthReportOperations = new HealthReportOperationsClientImpl(this); + this.sqlVulnerabilityAssessmentScans = new SqlVulnerabilityAssessmentScansClientImpl(this); + this.sqlVulnerabilityAssessmentScanResults = new SqlVulnerabilityAssessmentScanResultsClientImpl(this); + this.sqlVulnerabilityAssessmentBaselineRules = new SqlVulnerabilityAssessmentBaselineRulesClientImpl(this); } /** diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityConnectorGovernanceRulesExecuteStatusClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityConnectorGovernanceRulesExecuteStatusClientImpl.java deleted file mode 100644 index 9ff565d0b92de..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityConnectorGovernanceRulesExecuteStatusClientImpl.java +++ /dev/null @@ -1,392 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.security.fluent.SecurityConnectorGovernanceRulesExecuteStatusClient; -import com.azure.resourcemanager.security.fluent.models.ExecuteRuleStatusInner; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in - * SecurityConnectorGovernanceRulesExecuteStatusClient. - */ -public final class SecurityConnectorGovernanceRulesExecuteStatusClientImpl - implements SecurityConnectorGovernanceRulesExecuteStatusClient { - /** The proxy service used to perform REST calls. */ - private final SecurityConnectorGovernanceRulesExecuteStatusService service; - - /** The service client containing this operation class. */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of SecurityConnectorGovernanceRulesExecuteStatusClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - SecurityConnectorGovernanceRulesExecuteStatusClientImpl(SecurityCenterImpl client) { - this.service = - RestProxy - .create( - SecurityConnectorGovernanceRulesExecuteStatusService.class, - client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterSecurityConnectorGovernanceRulesExecuteStatus to be - * used by the proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterSecuri") - public interface SecurityConnectorGovernanceRulesExecuteStatusService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security" - + "/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/governanceRules/{ruleId}" - + "/operationResults/{operationId}") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("securityConnectorName") String securityConnectorName, - @PathParam("ruleId") String ruleId, - @PathParam("operationId") String operationId, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Get a specific governanceRule execution status for the requested scope by ruleId and operationId. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @param operationId The security GovernanceRule execution key - unique key for the execution of GovernanceRule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific governanceRule execution status for the requested scope by ruleId and operationId along with - * {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> getWithResponseAsync( - String resourceGroupName, String securityConnectorName, String ruleId, String operationId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - if (ruleId == null) { - return Mono.error(new IllegalArgumentException("Parameter ruleId is required and cannot be null.")); - } - if (operationId == null) { - return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); - } - final String apiVersion = "2022-01-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - securityConnectorName, - ruleId, - operationId, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get a specific governanceRule execution status for the requested scope by ruleId and operationId. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @param operationId The security GovernanceRule execution key - unique key for the execution of GovernanceRule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific governanceRule execution status for the requested scope by ruleId and operationId along with - * {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> getWithResponseAsync( - String resourceGroupName, String securityConnectorName, String ruleId, String operationId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - if (ruleId == null) { - return Mono.error(new IllegalArgumentException("Parameter ruleId is required and cannot be null.")); - } - if (operationId == null) { - return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); - } - final String apiVersion = "2022-01-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - securityConnectorName, - ruleId, - operationId, - accept, - context); - } - - /** - * Get a specific governanceRule execution status for the requested scope by ruleId and operationId. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @param operationId The security GovernanceRule execution key - unique key for the execution of GovernanceRule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of a specific governanceRule execution status for the requested scope - * by ruleId and operationId. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ExecuteRuleStatusInner> beginGetAsync( - String resourceGroupName, String securityConnectorName, String ruleId, String operationId) { - Mono>> mono = - getWithResponseAsync(resourceGroupName, securityConnectorName, ruleId, operationId); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - ExecuteRuleStatusInner.class, - ExecuteRuleStatusInner.class, - this.client.getContext()); - } - - /** - * Get a specific governanceRule execution status for the requested scope by ruleId and operationId. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @param operationId The security GovernanceRule execution key - unique key for the execution of GovernanceRule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of a specific governanceRule execution status for the requested scope - * by ruleId and operationId. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ExecuteRuleStatusInner> beginGetAsync( - String resourceGroupName, String securityConnectorName, String ruleId, String operationId, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - getWithResponseAsync(resourceGroupName, securityConnectorName, ruleId, operationId, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - ExecuteRuleStatusInner.class, - ExecuteRuleStatusInner.class, - context); - } - - /** - * Get a specific governanceRule execution status for the requested scope by ruleId and operationId. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @param operationId The security GovernanceRule execution key - unique key for the execution of GovernanceRule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of a specific governanceRule execution status for the requested scope - * by ruleId and operationId. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ExecuteRuleStatusInner> beginGet( - String resourceGroupName, String securityConnectorName, String ruleId, String operationId) { - return beginGetAsync(resourceGroupName, securityConnectorName, ruleId, operationId).getSyncPoller(); - } - - /** - * Get a specific governanceRule execution status for the requested scope by ruleId and operationId. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @param operationId The security GovernanceRule execution key - unique key for the execution of GovernanceRule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of a specific governanceRule execution status for the requested scope - * by ruleId and operationId. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ExecuteRuleStatusInner> beginGet( - String resourceGroupName, String securityConnectorName, String ruleId, String operationId, Context context) { - return beginGetAsync(resourceGroupName, securityConnectorName, ruleId, operationId, context).getSyncPoller(); - } - - /** - * Get a specific governanceRule execution status for the requested scope by ruleId and operationId. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @param operationId The security GovernanceRule execution key - unique key for the execution of GovernanceRule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific governanceRule execution status for the requested scope by ruleId and operationId on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync( - String resourceGroupName, String securityConnectorName, String ruleId, String operationId) { - return beginGetAsync(resourceGroupName, securityConnectorName, ruleId, operationId) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Get a specific governanceRule execution status for the requested scope by ruleId and operationId. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @param operationId The security GovernanceRule execution key - unique key for the execution of GovernanceRule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific governanceRule execution status for the requested scope by ruleId and operationId on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync( - String resourceGroupName, String securityConnectorName, String ruleId, String operationId, Context context) { - return beginGetAsync(resourceGroupName, securityConnectorName, ruleId, operationId, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Get a specific governanceRule execution status for the requested scope by ruleId and operationId. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @param operationId The security GovernanceRule execution key - unique key for the execution of GovernanceRule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific governanceRule execution status for the requested scope by ruleId and operationId. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ExecuteRuleStatusInner get( - String resourceGroupName, String securityConnectorName, String ruleId, String operationId) { - return getAsync(resourceGroupName, securityConnectorName, ruleId, operationId).block(); - } - - /** - * Get a specific governanceRule execution status for the requested scope by ruleId and operationId. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @param operationId The security GovernanceRule execution key - unique key for the execution of GovernanceRule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific governanceRule execution status for the requested scope by ruleId and operationId. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ExecuteRuleStatusInner get( - String resourceGroupName, String securityConnectorName, String ruleId, String operationId, Context context) { - return getAsync(resourceGroupName, securityConnectorName, ruleId, operationId, context).block(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityConnectorGovernanceRulesExecuteStatusImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityConnectorGovernanceRulesExecuteStatusImpl.java deleted file mode 100644 index 59e7a717d0b4e..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityConnectorGovernanceRulesExecuteStatusImpl.java +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.SecurityConnectorGovernanceRulesExecuteStatusClient; -import com.azure.resourcemanager.security.fluent.models.ExecuteRuleStatusInner; -import com.azure.resourcemanager.security.models.ExecuteRuleStatus; -import com.azure.resourcemanager.security.models.SecurityConnectorGovernanceRulesExecuteStatus; - -public final class SecurityConnectorGovernanceRulesExecuteStatusImpl - implements SecurityConnectorGovernanceRulesExecuteStatus { - private static final ClientLogger LOGGER = - new ClientLogger(SecurityConnectorGovernanceRulesExecuteStatusImpl.class); - - private final SecurityConnectorGovernanceRulesExecuteStatusClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public SecurityConnectorGovernanceRulesExecuteStatusImpl( - SecurityConnectorGovernanceRulesExecuteStatusClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public ExecuteRuleStatus get( - String resourceGroupName, String securityConnectorName, String ruleId, String operationId) { - ExecuteRuleStatusInner inner = - this.serviceClient().get(resourceGroupName, securityConnectorName, ruleId, operationId); - if (inner != null) { - return new ExecuteRuleStatusImpl(inner, this.manager()); - } else { - return null; - } - } - - public ExecuteRuleStatus get( - String resourceGroupName, String securityConnectorName, String ruleId, String operationId, Context context) { - ExecuteRuleStatusInner inner = - this.serviceClient().get(resourceGroupName, securityConnectorName, ruleId, operationId, context); - if (inner != null) { - return new ExecuteRuleStatusImpl(inner, this.manager()); - } else { - return null; - } - } - - private SecurityConnectorGovernanceRulesExecuteStatusClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityConnectorGovernanceRulesImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityConnectorGovernanceRulesImpl.java deleted file mode 100644 index 6b5751548ebf0..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityConnectorGovernanceRulesImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.SecurityConnectorGovernanceRulesClient; -import com.azure.resourcemanager.security.fluent.models.GovernanceRuleInner; -import com.azure.resourcemanager.security.models.GovernanceRule; -import com.azure.resourcemanager.security.models.SecurityConnectorGovernanceRules; - -public final class SecurityConnectorGovernanceRulesImpl implements SecurityConnectorGovernanceRules { - private static final ClientLogger LOGGER = new ClientLogger(SecurityConnectorGovernanceRulesImpl.class); - - private final SecurityConnectorGovernanceRulesClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public SecurityConnectorGovernanceRulesImpl( - SecurityConnectorGovernanceRulesClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list(String resourceGroupName, String securityConnectorName) { - PagedIterable inner = this.serviceClient().list(resourceGroupName, securityConnectorName); - return Utils.mapPage(inner, inner1 -> new GovernanceRuleImpl(inner1, this.manager())); - } - - public PagedIterable list(String resourceGroupName, String securityConnectorName, Context context) { - PagedIterable inner = - this.serviceClient().list(resourceGroupName, securityConnectorName, context); - return Utils.mapPage(inner, inner1 -> new GovernanceRuleImpl(inner1, this.manager())); - } - - private SecurityConnectorGovernanceRulesClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityConnectorGovernanceRulesOperationsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityConnectorGovernanceRulesOperationsClientImpl.java deleted file mode 100644 index bdee003c2b91f..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityConnectorGovernanceRulesOperationsClientImpl.java +++ /dev/null @@ -1,635 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.SecurityConnectorGovernanceRulesOperationsClient; -import com.azure.resourcemanager.security.fluent.models.GovernanceRuleInner; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in - * SecurityConnectorGovernanceRulesOperationsClient. - */ -public final class SecurityConnectorGovernanceRulesOperationsClientImpl - implements SecurityConnectorGovernanceRulesOperationsClient { - /** The proxy service used to perform REST calls. */ - private final SecurityConnectorGovernanceRulesOperationsService service; - - /** The service client containing this operation class. */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of SecurityConnectorGovernanceRulesOperationsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - SecurityConnectorGovernanceRulesOperationsClientImpl(SecurityCenterImpl client) { - this.service = - RestProxy - .create( - SecurityConnectorGovernanceRulesOperationsService.class, - client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterSecurityConnectorGovernanceRulesOperations to be used - * by the proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterSecuri") - public interface SecurityConnectorGovernanceRulesOperationsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security" - + "/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/governanceRules/{ruleId}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("securityConnectorName") String securityConnectorName, - @PathParam("ruleId") String ruleId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security" - + "/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/governanceRules/{ruleId}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("securityConnectorName") String securityConnectorName, - @PathParam("ruleId") String ruleId, - @BodyParam("application/json") GovernanceRuleInner governanceRule, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security" - + "/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/governanceRules/{ruleId}") - @ExpectedResponses({200, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("securityConnectorName") String securityConnectorName, - @PathParam("ruleId") String ruleId, - Context context); - } - - /** - * Get a specific governanceRule for the requested scope by ruleId. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific governanceRule for the requested scope by ruleId along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String securityConnectorName, String ruleId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - if (ruleId == null) { - return Mono.error(new IllegalArgumentException("Parameter ruleId is required and cannot be null.")); - } - final String apiVersion = "2022-01-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - securityConnectorName, - ruleId, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get a specific governanceRule for the requested scope by ruleId. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific governanceRule for the requested scope by ruleId along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String securityConnectorName, String ruleId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - if (ruleId == null) { - return Mono.error(new IllegalArgumentException("Parameter ruleId is required and cannot be null.")); - } - final String apiVersion = "2022-01-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - securityConnectorName, - ruleId, - accept, - context); - } - - /** - * Get a specific governanceRule for the requested scope by ruleId. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific governanceRule for the requested scope by ruleId on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String securityConnectorName, String ruleId) { - return getWithResponseAsync(resourceGroupName, securityConnectorName, ruleId) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get a specific governanceRule for the requested scope by ruleId. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific governanceRule for the requested scope by ruleId along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String securityConnectorName, String ruleId, Context context) { - return getWithResponseAsync(resourceGroupName, securityConnectorName, ruleId, context).block(); - } - - /** - * Get a specific governanceRule for the requested scope by ruleId. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific governanceRule for the requested scope by ruleId. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GovernanceRuleInner get(String resourceGroupName, String securityConnectorName, String ruleId) { - return getWithResponse(resourceGroupName, securityConnectorName, ruleId, Context.NONE).getValue(); - } - - /** - * Creates or update a security GovernanceRule on the given security connector. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @param governanceRule GovernanceRule over a subscription scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security GovernanceRule over a given scope along with {@link Response} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, String securityConnectorName, String ruleId, GovernanceRuleInner governanceRule) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - if (ruleId == null) { - return Mono.error(new IllegalArgumentException("Parameter ruleId is required and cannot be null.")); - } - if (governanceRule == null) { - return Mono.error(new IllegalArgumentException("Parameter governanceRule is required and cannot be null.")); - } else { - governanceRule.validate(); - } - final String apiVersion = "2022-01-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - securityConnectorName, - ruleId, - governanceRule, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or update a security GovernanceRule on the given security connector. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @param governanceRule GovernanceRule over a subscription scope. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security GovernanceRule over a given scope along with {@link Response} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, - String securityConnectorName, - String ruleId, - GovernanceRuleInner governanceRule, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - if (ruleId == null) { - return Mono.error(new IllegalArgumentException("Parameter ruleId is required and cannot be null.")); - } - if (governanceRule == null) { - return Mono.error(new IllegalArgumentException("Parameter governanceRule is required and cannot be null.")); - } else { - governanceRule.validate(); - } - final String apiVersion = "2022-01-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - securityConnectorName, - ruleId, - governanceRule, - accept, - context); - } - - /** - * Creates or update a security GovernanceRule on the given security connector. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @param governanceRule GovernanceRule over a subscription scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security GovernanceRule over a given scope on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String securityConnectorName, String ruleId, GovernanceRuleInner governanceRule) { - return createOrUpdateWithResponseAsync(resourceGroupName, securityConnectorName, ruleId, governanceRule) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Creates or update a security GovernanceRule on the given security connector. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @param governanceRule GovernanceRule over a subscription scope. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security GovernanceRule over a given scope along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse( - String resourceGroupName, - String securityConnectorName, - String ruleId, - GovernanceRuleInner governanceRule, - Context context) { - return createOrUpdateWithResponseAsync( - resourceGroupName, securityConnectorName, ruleId, governanceRule, context) - .block(); - } - - /** - * Creates or update a security GovernanceRule on the given security connector. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @param governanceRule GovernanceRule over a subscription scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security GovernanceRule over a given scope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GovernanceRuleInner createOrUpdate( - String resourceGroupName, String securityConnectorName, String ruleId, GovernanceRuleInner governanceRule) { - return createOrUpdateWithResponse( - resourceGroupName, securityConnectorName, ruleId, governanceRule, Context.NONE) - .getValue(); - } - - /** - * Delete a GovernanceRule over a given scope. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String securityConnectorName, String ruleId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - if (ruleId == null) { - return Mono.error(new IllegalArgumentException("Parameter ruleId is required and cannot be null.")); - } - final String apiVersion = "2022-01-01-preview"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - securityConnectorName, - ruleId, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Delete a GovernanceRule over a given scope. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String securityConnectorName, String ruleId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - if (ruleId == null) { - return Mono.error(new IllegalArgumentException("Parameter ruleId is required and cannot be null.")); - } - final String apiVersion = "2022-01-01-preview"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - securityConnectorName, - ruleId, - context); - } - - /** - * Delete a GovernanceRule over a given scope. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String securityConnectorName, String ruleId) { - return deleteWithResponseAsync(resourceGroupName, securityConnectorName, ruleId) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Delete a GovernanceRule over a given scope. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse( - String resourceGroupName, String securityConnectorName, String ruleId, Context context) { - return deleteWithResponseAsync(resourceGroupName, securityConnectorName, ruleId, context).block(); - } - - /** - * Delete a GovernanceRule over a given scope. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String securityConnectorName, String ruleId) { - deleteWithResponse(resourceGroupName, securityConnectorName, ruleId, Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityConnectorGovernanceRulesOperationsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityConnectorGovernanceRulesOperationsImpl.java deleted file mode 100644 index ffacfe8ef7b6d..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityConnectorGovernanceRulesOperationsImpl.java +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.SecurityConnectorGovernanceRulesOperationsClient; -import com.azure.resourcemanager.security.fluent.models.GovernanceRuleInner; -import com.azure.resourcemanager.security.models.GovernanceRule; -import com.azure.resourcemanager.security.models.SecurityConnectorGovernanceRulesOperations; - -public final class SecurityConnectorGovernanceRulesOperationsImpl - implements SecurityConnectorGovernanceRulesOperations { - private static final ClientLogger LOGGER = new ClientLogger(SecurityConnectorGovernanceRulesOperationsImpl.class); - - private final SecurityConnectorGovernanceRulesOperationsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public SecurityConnectorGovernanceRulesOperationsImpl( - SecurityConnectorGovernanceRulesOperationsClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse( - String resourceGroupName, String securityConnectorName, String ruleId, Context context) { - Response inner = - this.serviceClient().getWithResponse(resourceGroupName, securityConnectorName, ruleId, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new GovernanceRuleImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public GovernanceRule get(String resourceGroupName, String securityConnectorName, String ruleId) { - GovernanceRuleInner inner = this.serviceClient().get(resourceGroupName, securityConnectorName, ruleId); - if (inner != null) { - return new GovernanceRuleImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response createOrUpdateWithResponse( - String resourceGroupName, - String securityConnectorName, - String ruleId, - GovernanceRuleInner governanceRule, - Context context) { - Response inner = - this - .serviceClient() - .createOrUpdateWithResponse(resourceGroupName, securityConnectorName, ruleId, governanceRule, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new GovernanceRuleImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public GovernanceRule createOrUpdate( - String resourceGroupName, String securityConnectorName, String ruleId, GovernanceRuleInner governanceRule) { - GovernanceRuleInner inner = - this.serviceClient().createOrUpdate(resourceGroupName, securityConnectorName, ruleId, governanceRule); - if (inner != null) { - return new GovernanceRuleImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response deleteWithResponse( - String resourceGroupName, String securityConnectorName, String ruleId, Context context) { - return this.serviceClient().deleteWithResponse(resourceGroupName, securityConnectorName, ruleId, context); - } - - public void delete(String resourceGroupName, String securityConnectorName, String ruleId) { - this.serviceClient().delete(resourceGroupName, securityConnectorName, ruleId); - } - - private SecurityConnectorGovernanceRulesOperationsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ServerVulnerabilityAssessmentsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ServerVulnerabilityAssessmentsClientImpl.java index aaa76310a74f1..f7ae692de9d4f 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ServerVulnerabilityAssessmentsClientImpl.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ServerVulnerabilityAssessmentsClientImpl.java @@ -896,7 +896,7 @@ private PollerFlux, Void> beginDeleteAsync( @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete( String resourceGroupName, String resourceNamespace, String resourceType, String resourceName) { - return beginDeleteAsync(resourceGroupName, resourceNamespace, resourceType, resourceName).getSyncPoller(); + return this.beginDeleteAsync(resourceGroupName, resourceNamespace, resourceType, resourceName).getSyncPoller(); } /** @@ -916,7 +916,8 @@ public SyncPoller, Void> beginDelete( @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete( String resourceGroupName, String resourceNamespace, String resourceType, String resourceName, Context context) { - return beginDeleteAsync(resourceGroupName, resourceNamespace, resourceType, resourceName, context) + return this + .beginDeleteAsync(resourceGroupName, resourceNamespace, resourceType, resourceName, context) .getSyncPoller(); } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SqlVulnerabilityAssessmentBaselineRulesClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SqlVulnerabilityAssessmentBaselineRulesClientImpl.java index fb09ad14141d2..434e0aa1a792e 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SqlVulnerabilityAssessmentBaselineRulesClientImpl.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SqlVulnerabilityAssessmentBaselineRulesClientImpl.java @@ -165,7 +165,7 @@ private Mono> createOrUpdateWithResponseAsync( if (body != null) { body.validate(); } - final String apiVersion = "2020-07-01-preview"; + final String apiVersion = "2023-02-01-preview"; final String accept = "application/json"; return FluxUtil .withContext( @@ -217,7 +217,7 @@ private Mono> createOrUpdateWithResponseAsync( if (body != null) { body.validate(); } - final String apiVersion = "2020-07-01-preview"; + final String apiVersion = "2023-02-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -309,7 +309,7 @@ private Mono> getWithResponseAsync( if (resourceId == null) { return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); } - final String apiVersion = "2020-07-01-preview"; + final String apiVersion = "2023-02-01-preview"; final String accept = "application/json"; return FluxUtil .withContext( @@ -350,7 +350,7 @@ private Mono> getWithResponseAsync( if (resourceId == null) { return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); } - final String apiVersion = "2020-07-01-preview"; + final String apiVersion = "2023-02-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.get(this.client.getEndpoint(), ruleId, workspaceId, apiVersion, resourceId, accept, context); @@ -434,7 +434,7 @@ private Mono> deleteWithResponseAsync(String ruleId, String works if (resourceId == null) { return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); } - final String apiVersion = "2020-07-01-preview"; + final String apiVersion = "2023-02-01-preview"; final String accept = "application/json"; return FluxUtil .withContext( @@ -475,7 +475,7 @@ private Mono> deleteWithResponseAsync( if (resourceId == null) { return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); } - final String apiVersion = "2020-07-01-preview"; + final String apiVersion = "2023-02-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.delete(this.client.getEndpoint(), ruleId, workspaceId, apiVersion, resourceId, accept, context); @@ -554,7 +554,7 @@ private Mono> listWithResponseAsync(String workspace if (resourceId == null) { return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); } - final String apiVersion = "2020-07-01-preview"; + final String apiVersion = "2023-02-01-preview"; final String accept = "application/json"; return FluxUtil .withContext( @@ -590,7 +590,7 @@ private Mono> listWithResponseAsync( if (resourceId == null) { return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); } - final String apiVersion = "2020-07-01-preview"; + final String apiVersion = "2023-02-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.list(this.client.getEndpoint(), workspaceId, apiVersion, resourceId, accept, context); @@ -671,7 +671,7 @@ private Mono> addWithResponseAsync( if (body != null) { body.validate(); } - final String apiVersion = "2020-07-01-preview"; + final String apiVersion = "2023-02-01-preview"; final String accept = "application/json"; return FluxUtil .withContext( @@ -710,7 +710,7 @@ private Mono> addWithResponseAsync( if (body != null) { body.validate(); } - final String apiVersion = "2020-07-01-preview"; + final String apiVersion = "2023-02-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.add(this.client.getEndpoint(), workspaceId, apiVersion, resourceId, body, accept, context); diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SqlVulnerabilityAssessmentScanResultsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SqlVulnerabilityAssessmentScanResultsClientImpl.java index 6f55d95084f3d..ea72beb761c64 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SqlVulnerabilityAssessmentScanResultsClientImpl.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SqlVulnerabilityAssessmentScanResultsClientImpl.java @@ -125,7 +125,7 @@ private Mono> getWithResponseAsync( if (resourceId == null) { return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); } - final String apiVersion = "2020-07-01-preview"; + final String apiVersion = "2023-02-01-preview"; final String accept = "application/json"; return FluxUtil .withContext( @@ -178,7 +178,7 @@ private Mono> getWithResponseAsync( if (resourceId == null) { return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); } - final String apiVersion = "2020-07-01-preview"; + final String apiVersion = "2023-02-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -269,7 +269,7 @@ private Mono> listWithResponseAsync( if (resourceId == null) { return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); } - final String apiVersion = "2020-07-01-preview"; + final String apiVersion = "2023-02-01-preview"; final String accept = "application/json"; return FluxUtil .withContext( @@ -310,7 +310,7 @@ private Mono> listWithResponseAsync( if (resourceId == null) { return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); } - final String apiVersion = "2020-07-01-preview"; + final String apiVersion = "2023-02-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.list(this.client.getEndpoint(), scanId, workspaceId, apiVersion, resourceId, accept, context); diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SqlVulnerabilityAssessmentScansClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SqlVulnerabilityAssessmentScansClientImpl.java index ffcc94ec06f9d..3a315100d9df3 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SqlVulnerabilityAssessmentScansClientImpl.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SqlVulnerabilityAssessmentScansClientImpl.java @@ -111,7 +111,7 @@ private Mono> getWithResponseAsync(String scanId, String wor if (resourceId == null) { return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); } - final String apiVersion = "2020-07-01-preview"; + final String apiVersion = "2023-02-01-preview"; final String accept = "application/json"; return FluxUtil .withContext( @@ -152,7 +152,7 @@ private Mono> getWithResponseAsync( if (resourceId == null) { return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); } - final String apiVersion = "2020-07-01-preview"; + final String apiVersion = "2023-02-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.get(this.client.getEndpoint(), scanId, workspaceId, apiVersion, resourceId, accept, context); @@ -231,7 +231,7 @@ private Mono> listWithResponseAsync(String workspaceId, Str if (resourceId == null) { return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); } - final String apiVersion = "2020-07-01-preview"; + final String apiVersion = "2023-02-01-preview"; final String accept = "application/json"; return FluxUtil .withContext( @@ -265,7 +265,7 @@ private Mono> listWithResponseAsync(String workspaceId, Str if (resourceId == null) { return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); } - final String apiVersion = "2020-07-01-preview"; + final String apiVersion = "2023-02-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.list(this.client.getEndpoint(), workspaceId, apiVersion, resourceId, accept, context); diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SubscriptionGovernanceRulesExecuteStatusClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SubscriptionGovernanceRulesExecuteStatusClientImpl.java deleted file mode 100644 index a555e86981c04..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SubscriptionGovernanceRulesExecuteStatusClientImpl.java +++ /dev/null @@ -1,327 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.security.fluent.SubscriptionGovernanceRulesExecuteStatusClient; -import com.azure.resourcemanager.security.fluent.models.ExecuteRuleStatusInner; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in - * SubscriptionGovernanceRulesExecuteStatusClient. - */ -public final class SubscriptionGovernanceRulesExecuteStatusClientImpl - implements SubscriptionGovernanceRulesExecuteStatusClient { - /** The proxy service used to perform REST calls. */ - private final SubscriptionGovernanceRulesExecuteStatusService service; - - /** The service client containing this operation class. */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of SubscriptionGovernanceRulesExecuteStatusClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - SubscriptionGovernanceRulesExecuteStatusClientImpl(SecurityCenterImpl client) { - this.service = - RestProxy - .create( - SubscriptionGovernanceRulesExecuteStatusService.class, - client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterSubscriptionGovernanceRulesExecuteStatus to be used by - * the proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterSubscr") - public interface SubscriptionGovernanceRulesExecuteStatusService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/providers/Microsoft.Security/governanceRules/{ruleId}/operationResults" - + "/{operationId}") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("ruleId") String ruleId, - @PathParam("operationId") String operationId, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Get a specific governanceRule execution status for the requested scope by ruleId and operationId. - * - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @param operationId The security GovernanceRule execution key - unique key for the execution of GovernanceRule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific governanceRule execution status for the requested scope by ruleId and operationId along with - * {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> getWithResponseAsync(String ruleId, String operationId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (ruleId == null) { - return Mono.error(new IllegalArgumentException("Parameter ruleId is required and cannot be null.")); - } - if (operationId == null) { - return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); - } - final String apiVersion = "2022-01-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - ruleId, - operationId, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get a specific governanceRule execution status for the requested scope by ruleId and operationId. - * - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @param operationId The security GovernanceRule execution key - unique key for the execution of GovernanceRule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific governanceRule execution status for the requested scope by ruleId and operationId along with - * {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> getWithResponseAsync(String ruleId, String operationId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (ruleId == null) { - return Mono.error(new IllegalArgumentException("Parameter ruleId is required and cannot be null.")); - } - if (operationId == null) { - return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); - } - final String apiVersion = "2022-01-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - ruleId, - operationId, - accept, - context); - } - - /** - * Get a specific governanceRule execution status for the requested scope by ruleId and operationId. - * - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @param operationId The security GovernanceRule execution key - unique key for the execution of GovernanceRule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of a specific governanceRule execution status for the requested scope - * by ruleId and operationId. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ExecuteRuleStatusInner> beginGetAsync( - String ruleId, String operationId) { - Mono>> mono = getWithResponseAsync(ruleId, operationId); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - ExecuteRuleStatusInner.class, - ExecuteRuleStatusInner.class, - this.client.getContext()); - } - - /** - * Get a specific governanceRule execution status for the requested scope by ruleId and operationId. - * - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @param operationId The security GovernanceRule execution key - unique key for the execution of GovernanceRule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of a specific governanceRule execution status for the requested scope - * by ruleId and operationId. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ExecuteRuleStatusInner> beginGetAsync( - String ruleId, String operationId, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = getWithResponseAsync(ruleId, operationId, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - ExecuteRuleStatusInner.class, - ExecuteRuleStatusInner.class, - context); - } - - /** - * Get a specific governanceRule execution status for the requested scope by ruleId and operationId. - * - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @param operationId The security GovernanceRule execution key - unique key for the execution of GovernanceRule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of a specific governanceRule execution status for the requested scope - * by ruleId and operationId. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ExecuteRuleStatusInner> beginGet( - String ruleId, String operationId) { - return beginGetAsync(ruleId, operationId).getSyncPoller(); - } - - /** - * Get a specific governanceRule execution status for the requested scope by ruleId and operationId. - * - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @param operationId The security GovernanceRule execution key - unique key for the execution of GovernanceRule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of a specific governanceRule execution status for the requested scope - * by ruleId and operationId. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ExecuteRuleStatusInner> beginGet( - String ruleId, String operationId, Context context) { - return beginGetAsync(ruleId, operationId, context).getSyncPoller(); - } - - /** - * Get a specific governanceRule execution status for the requested scope by ruleId and operationId. - * - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @param operationId The security GovernanceRule execution key - unique key for the execution of GovernanceRule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific governanceRule execution status for the requested scope by ruleId and operationId on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String ruleId, String operationId) { - return beginGetAsync(ruleId, operationId).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Get a specific governanceRule execution status for the requested scope by ruleId and operationId. - * - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @param operationId The security GovernanceRule execution key - unique key for the execution of GovernanceRule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific governanceRule execution status for the requested scope by ruleId and operationId on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String ruleId, String operationId, Context context) { - return beginGetAsync(ruleId, operationId, context).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Get a specific governanceRule execution status for the requested scope by ruleId and operationId. - * - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @param operationId The security GovernanceRule execution key - unique key for the execution of GovernanceRule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific governanceRule execution status for the requested scope by ruleId and operationId. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ExecuteRuleStatusInner get(String ruleId, String operationId) { - return getAsync(ruleId, operationId).block(); - } - - /** - * Get a specific governanceRule execution status for the requested scope by ruleId and operationId. - * - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @param operationId The security GovernanceRule execution key - unique key for the execution of GovernanceRule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific governanceRule execution status for the requested scope by ruleId and operationId. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ExecuteRuleStatusInner get(String ruleId, String operationId, Context context) { - return getAsync(ruleId, operationId, context).block(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SubscriptionGovernanceRulesExecuteStatusImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SubscriptionGovernanceRulesExecuteStatusImpl.java deleted file mode 100644 index 624e35819415c..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SubscriptionGovernanceRulesExecuteStatusImpl.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.SubscriptionGovernanceRulesExecuteStatusClient; -import com.azure.resourcemanager.security.fluent.models.ExecuteRuleStatusInner; -import com.azure.resourcemanager.security.models.ExecuteRuleStatus; -import com.azure.resourcemanager.security.models.SubscriptionGovernanceRulesExecuteStatus; - -public final class SubscriptionGovernanceRulesExecuteStatusImpl implements SubscriptionGovernanceRulesExecuteStatus { - private static final ClientLogger LOGGER = new ClientLogger(SubscriptionGovernanceRulesExecuteStatusImpl.class); - - private final SubscriptionGovernanceRulesExecuteStatusClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public SubscriptionGovernanceRulesExecuteStatusImpl( - SubscriptionGovernanceRulesExecuteStatusClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public ExecuteRuleStatus get(String ruleId, String operationId) { - ExecuteRuleStatusInner inner = this.serviceClient().get(ruleId, operationId); - if (inner != null) { - return new ExecuteRuleStatusImpl(inner, this.manager()); - } else { - return null; - } - } - - public ExecuteRuleStatus get(String ruleId, String operationId, Context context) { - ExecuteRuleStatusInner inner = this.serviceClient().get(ruleId, operationId, context); - if (inner != null) { - return new ExecuteRuleStatusImpl(inner, this.manager()); - } else { - return null; - } - } - - private SubscriptionGovernanceRulesExecuteStatusClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AadConnectivityState.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AadConnectivityState.java index 84e83a2228a24..72e27397e81a3 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AadConnectivityState.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AadConnectivityState.java @@ -19,6 +19,15 @@ public final class AadConnectivityState extends ExpandableStringEnum { /** Static value Workspace for ActionType. */ public static final ActionType WORKSPACE = fromString("Workspace"); + /** + * Creates a new instance of ActionType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ActionType() { + } + /** * Creates or finds a ActionType from its string representation. * diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AdaptiveApplicationControlIssue.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AdaptiveApplicationControlIssue.java index c29b40cff9ac2..a4c59fbd56e6c 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AdaptiveApplicationControlIssue.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AdaptiveApplicationControlIssue.java @@ -31,6 +31,15 @@ public final class AdaptiveApplicationControlIssue extends ExpandableStringEnum< /** Static value RulesViolatedManually for AdaptiveApplicationControlIssue. */ public static final AdaptiveApplicationControlIssue RULES_VIOLATED_MANUALLY = fromString("RulesViolatedManually"); + /** + * Creates a new instance of AdaptiveApplicationControlIssue value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AdaptiveApplicationControlIssue() { + } + /** * Creates or finds a AdaptiveApplicationControlIssue from its string representation. * diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AdditionalWorkspaceDataType.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AdditionalWorkspaceDataType.java index 18bc50fe75736..a449a76a1c094 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AdditionalWorkspaceDataType.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AdditionalWorkspaceDataType.java @@ -16,6 +16,15 @@ public final class AdditionalWorkspaceDataType extends ExpandableStringEnum { /** Static value High for AlertSeverity. */ public static final AlertSeverity HIGH = fromString("High"); + /** + * Creates a new instance of AlertSeverity value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AlertSeverity() { + } + /** * Creates or finds a AlertSeverity from its string representation. * diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AlertStatus.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AlertStatus.java index e513d2fbaebd9..4a5d9c3eebbcb 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AlertStatus.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AlertStatus.java @@ -22,6 +22,15 @@ public final class AlertStatus extends ExpandableStringEnum { /** Static value Dismissed for AlertStatus. */ public static final AlertStatus DISMISSED = fromString("Dismissed"); + /** + * Creates a new instance of AlertStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AlertStatus() { + } + /** * Creates or finds a AlertStatus from its string representation. * diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ApplicationSourceResourceType.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ApplicationSourceResourceType.java index c1a4fd5e7a256..9d2dd77b7267b 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ApplicationSourceResourceType.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ApplicationSourceResourceType.java @@ -13,6 +13,15 @@ public final class ApplicationSourceResourceType extends ExpandableStringEnum { /** Static value VerifiedPartner for AssessmentType. */ public static final AssessmentType VERIFIED_PARTNER = fromString("VerifiedPartner"); + /** + * Creates a new instance of AssessmentType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AssessmentType() { + } + /** * Creates or finds a AssessmentType from its string representation. * diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AuthenticationProvisioningState.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AuthenticationProvisioningState.java index 2c175146038df..e81b2a271af08 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AuthenticationProvisioningState.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AuthenticationProvisioningState.java @@ -22,6 +22,15 @@ public final class AuthenticationProvisioningState extends ExpandableStringEnum< /** Static value IncorrectPolicy for AuthenticationProvisioningState. */ public static final AuthenticationProvisioningState INCORRECT_POLICY = fromString("IncorrectPolicy"); + /** + * Creates a new instance of AuthenticationProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AuthenticationProvisioningState() { + } + /** * Creates or finds a AuthenticationProvisioningState from its string representation. * diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AuthenticationType.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AuthenticationType.java index d696c80407542..39089c8a4a996 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AuthenticationType.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AuthenticationType.java @@ -22,6 +22,15 @@ public final class AuthenticationType extends ExpandableStringEnum { /** Static value Off for AutoProvision. */ public static final AutoProvision OFF = fromString("Off"); + /** + * Creates a new instance of AutoProvision value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AutoProvision() { + } + /** * Creates or finds a AutoProvision from its string representation. * diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutomationActionLogicApp.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutomationActionLogicApp.java index add694b33d756..38fe7c5d0598e 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutomationActionLogicApp.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutomationActionLogicApp.java @@ -8,7 +8,6 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; -import java.net.URL; /** * The logic app action that should be triggered. To learn more about Microsoft Defender for Cloud's Workflow Automation @@ -29,7 +28,7 @@ public final class AutomationActionLogicApp extends AutomationAction { * The Logic App trigger URI endpoint (it will not be included in any response). */ @JsonProperty(value = "uri") - private URL uri; + private String uri; /** Creates an instance of AutomationActionLogicApp class. */ public AutomationActionLogicApp() { @@ -62,7 +61,7 @@ public AutomationActionLogicApp withLogicAppResourceId(String logicAppResourceId * * @return the uri value. */ - public URL uri() { + public String uri() { return this.uri; } @@ -72,7 +71,7 @@ public URL uri() { * @param uri the uri value to set. * @return the AutomationActionLogicApp object itself. */ - public AutomationActionLogicApp withUri(URL uri) { + public AutomationActionLogicApp withUri(String uri) { this.uri = uri; return this; } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/BundleType.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/BundleType.java index 30baf07944a7f..e16b0198c97e3 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/BundleType.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/BundleType.java @@ -37,6 +37,15 @@ public final class BundleType extends ExpandableStringEnum { /** Static value CosmosDbs for BundleType. */ public static final BundleType COSMOS_DBS = fromString("CosmosDbs"); + /** + * Creates a new instance of BundleType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public BundleType() { + } + /** * Creates or finds a BundleType from its string representation. * diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Categories.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Categories.java index 4c69ac5822351..deadc86057452 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Categories.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Categories.java @@ -25,6 +25,15 @@ public final class Categories extends ExpandableStringEnum { /** Static value IoT for Categories. */ public static final Categories IOT = fromString("IoT"); + /** + * Creates a new instance of Categories value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Categories() { + } + /** * Creates or finds a Categories from its string representation. * diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CloudName.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CloudName.java index 1d0955b7b59b4..83f88aa12596a 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CloudName.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CloudName.java @@ -25,6 +25,15 @@ public final class CloudName extends ExpandableStringEnum { /** Static value AzureDevOps for CloudName. */ public static final CloudName AZURE_DEV_OPS = fromString("AzureDevOps"); + /** + * Creates a new instance of CloudName value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public CloudName() { + } + /** * Creates or finds a CloudName from its string representation. * diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ConfigurationStatus.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ConfigurationStatus.java index fd58202fdc363..ca570c91256db 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ConfigurationStatus.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ConfigurationStatus.java @@ -25,6 +25,15 @@ public final class ConfigurationStatus extends ExpandableStringEnum { /** Static value External for ConnectionType. */ public static final ConnectionType EXTERNAL = fromString("External"); + /** + * Creates a new instance of ConnectionType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ConnectionType() { + } + /** * Creates or finds a ConnectionType from its string representation. * diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ControlType.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ControlType.java index e51ff00f89518..b2502b132198f 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ControlType.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ControlType.java @@ -16,6 +16,15 @@ public final class ControlType extends ExpandableStringEnum { /** Static value Custom for ControlType. */ public static final ControlType CUSTOM = fromString("Custom"); + /** + * Creates a new instance of ControlType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ControlType() { + } + /** * Creates or finds a ControlType from its string representation. * diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DataSource.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DataSource.java index 0961ad97b4f8b..8327adbc4f490 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DataSource.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DataSource.java @@ -13,6 +13,15 @@ public final class DataSource extends ExpandableStringEnum { /** Static value TwinData for DataSource. */ public static final DataSource TWIN_DATA = fromString("TwinData"); + /** + * Creates a new instance of DataSource value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DataSource() { + } + /** * Creates or finds a DataSource from its string representation. * diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Direction.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Direction.java index 724e0747a3d7e..9042afdbef2e8 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Direction.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Direction.java @@ -16,6 +16,15 @@ public final class Direction extends ExpandableStringEnum { /** Static value Outbound for Direction. */ public static final Direction OUTBOUND = fromString("Outbound"); + /** + * Creates a new instance of Direction value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Direction() { + } + /** * Creates or finds a Direction from its string representation. * diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/EndOfSupportStatus.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/EndOfSupportStatus.java index 3469fbd8bad52..ffd0f46c7c4fc 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/EndOfSupportStatus.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/EndOfSupportStatus.java @@ -26,6 +26,15 @@ public final class EndOfSupportStatus extends ExpandableStringEnum /** Static value None for EnforcementMode. */ public static final EnforcementMode NONE = fromString("None"); + /** + * Creates a new instance of EnforcementMode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public EnforcementMode() { + } + /** * Creates or finds a EnforcementMode from its string representation. * diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/EnforcementSupport.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/EnforcementSupport.java index b97844d228ebd..89f498dd851a8 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/EnforcementSupport.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/EnforcementSupport.java @@ -19,6 +19,15 @@ public final class EnforcementSupport extends ExpandableStringEnum /** Static value AzureDevOpsScope for EnvironmentType. */ public static final EnvironmentType AZURE_DEV_OPS_SCOPE = fromString("AzureDevOpsScope"); + /** + * Creates a new instance of EnvironmentType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public EnvironmentType() { + } + /** * Creates or finds a EnvironmentType from its string representation. * diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/EventSource.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/EventSource.java index aef31cc74c22a..39678faa99075 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/EventSource.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/EventSource.java @@ -44,6 +44,15 @@ public final class EventSource extends ExpandableStringEnum { public static final EventSource REGULATORY_COMPLIANCE_ASSESSMENT_SNAPSHOT = fromString("RegulatoryComplianceAssessmentSnapshot"); + /** + * Creates a new instance of EventSource value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public EventSource() { + } + /** * Creates or finds a EventSource from its string representation. * diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ExecuteRuleStatus.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ExecuteRuleStatus.java deleted file mode 100644 index 5900c813bb035..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ExecuteRuleStatus.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.resourcemanager.security.fluent.models.ExecuteRuleStatusInner; - -/** An immutable client-side representation of ExecuteRuleStatus. */ -public interface ExecuteRuleStatus { - /** - * Gets the operationId property: Unique key for the execution of GovernanceRule. - * - * @return the operationId value. - */ - String operationId(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.ExecuteRuleStatusInner object. - * - * @return the inner object. - */ - ExecuteRuleStatusInner innerModel(); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ExpandControlsEnum.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ExpandControlsEnum.java index ca56454732f08..05be0c5ea44ff 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ExpandControlsEnum.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ExpandControlsEnum.java @@ -13,6 +13,15 @@ public final class ExpandControlsEnum extends ExpandableStringEnum { /** Static value metadata for ExpandEnum. */ public static final ExpandEnum METADATA = fromString("metadata"); + /** + * Creates a new instance of ExpandEnum value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ExpandEnum() { + } + /** * Creates or finds a ExpandEnum from its string representation. * diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ExportData.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ExportData.java index 548c20e3e1f29..d24f2e1271f8d 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ExportData.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ExportData.java @@ -13,6 +13,15 @@ public final class ExportData extends ExpandableStringEnum { /** Static value RawEvents for ExportData. */ public static final ExportData RAW_EVENTS = fromString("RawEvents"); + /** + * Creates a new instance of ExportData value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ExportData() { + } + /** * Creates or finds a ExportData from its string representation. * diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ExternalSecuritySolutionKind.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ExternalSecuritySolutionKind.java index 5423e2bd2e8a5..cbbc0b7acb37c 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ExternalSecuritySolutionKind.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ExternalSecuritySolutionKind.java @@ -19,6 +19,15 @@ public final class ExternalSecuritySolutionKind extends ExpandableStringEnum { /** Static value Unknown for FileType. */ public static final FileType UNKNOWN = fromString("Unknown"); + /** + * Creates a new instance of FileType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public FileType() { + } + /** * Creates or finds a FileType from its string representation. * diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GovernanceAssignment.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GovernanceAssignment.java index 5e73773ecc053..8d0fb0553d18d 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GovernanceAssignment.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GovernanceAssignment.java @@ -97,10 +97,10 @@ interface WithParentResource { /** * Specifies scope, assessmentName. * - * @param scope Scope of the query, can be subscription - * (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group - * (/providers/Microsoft.Management/managementGroups/mgName). - * @param assessmentName The Assessment Key - Unique key for the assessment type. + * @param scope The scope of the Governance assignments. Valid scopes are: subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * @param assessmentName The Assessment Key - A unique key for the assessment type. * @return the next definition stage. */ WithCreate withExistingAssessment(String scope, String assessmentName); diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GovernanceAssignmentAdditionalData.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GovernanceAssignmentAdditionalData.java index 65e03a10a5290..5e3045c9ce815 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GovernanceAssignmentAdditionalData.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GovernanceAssignmentAdditionalData.java @@ -7,23 +7,23 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** Describe the additional data of GovernanceAssignment - optional. */ +/** Describe the additional data of governance assignment - optional. */ @Fluent public final class GovernanceAssignmentAdditionalData { /* - * Ticket number associated with this GovernanceAssignment + * Ticket number associated with this governance assignment */ @JsonProperty(value = "ticketNumber") private Integer ticketNumber; /* - * Ticket link associated with this GovernanceAssignment - for example: https://snow.com + * Ticket link associated with this governance assignment - for example: https://snow.com */ @JsonProperty(value = "ticketLink") private String ticketLink; /* - * The ticket status associated with this GovernanceAssignment - for example: Active + * The ticket status associated with this governance assignment - for example: Active */ @JsonProperty(value = "ticketStatus") private String ticketStatus; @@ -33,7 +33,7 @@ public GovernanceAssignmentAdditionalData() { } /** - * Get the ticketNumber property: Ticket number associated with this GovernanceAssignment. + * Get the ticketNumber property: Ticket number associated with this governance assignment. * * @return the ticketNumber value. */ @@ -42,7 +42,7 @@ public Integer ticketNumber() { } /** - * Set the ticketNumber property: Ticket number associated with this GovernanceAssignment. + * Set the ticketNumber property: Ticket number associated with this governance assignment. * * @param ticketNumber the ticketNumber value to set. * @return the GovernanceAssignmentAdditionalData object itself. @@ -53,7 +53,7 @@ public GovernanceAssignmentAdditionalData withTicketNumber(Integer ticketNumber) } /** - * Get the ticketLink property: Ticket link associated with this GovernanceAssignment - for example: + * Get the ticketLink property: Ticket link associated with this governance assignment - for example: * https://snow.com. * * @return the ticketLink value. @@ -63,7 +63,7 @@ public String ticketLink() { } /** - * Set the ticketLink property: Ticket link associated with this GovernanceAssignment - for example: + * Set the ticketLink property: Ticket link associated with this governance assignment - for example: * https://snow.com. * * @param ticketLink the ticketLink value to set. @@ -75,7 +75,8 @@ public GovernanceAssignmentAdditionalData withTicketLink(String ticketLink) { } /** - * Get the ticketStatus property: The ticket status associated with this GovernanceAssignment - for example: Active. + * Get the ticketStatus property: The ticket status associated with this governance assignment - for example: + * Active. * * @return the ticketStatus value. */ @@ -84,7 +85,8 @@ public String ticketStatus() { } /** - * Set the ticketStatus property: The ticket status associated with this GovernanceAssignment - for example: Active. + * Set the ticketStatus property: The ticket status associated with this governance assignment - for example: + * Active. * * @param ticketStatus the ticketStatus value to set. * @return the GovernanceAssignmentAdditionalData object itself. diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GovernanceAssignments.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GovernanceAssignments.java index 2a65ca423e075..ee86df36eed0b 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GovernanceAssignments.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GovernanceAssignments.java @@ -11,30 +11,32 @@ /** Resource collection API of GovernanceAssignments. */ public interface GovernanceAssignments { /** - * Get security governanceAssignments on all your resources inside a scope. + * Get governance assignments on all of your resources inside a scope. * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param assessmentName The Assessment Key - Unique key for the assessment type. + * @param scope The scope of the Governance assignments. Valid scopes are: subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * @param assessmentName The Assessment Key - A unique key for the assessment type. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security governanceAssignments on all your resources inside a scope as paginated response with {@link + * @return governance assignments on all of your resources inside a scope as paginated response with {@link * PagedIterable}. */ PagedIterable list(String scope, String assessmentName); /** - * Get security governanceAssignments on all your resources inside a scope. + * Get governance assignments on all of your resources inside a scope. * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param assessmentName The Assessment Key - Unique key for the assessment type. + * @param scope The scope of the Governance assignments. Valid scopes are: subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * @param assessmentName The Assessment Key - A unique key for the assessment type. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security governanceAssignments on all your resources inside a scope as paginated response with {@link + * @return governance assignments on all of your resources inside a scope as paginated response with {@link * PagedIterable}. */ PagedIterable list(String scope, String assessmentName, Context context); @@ -42,11 +44,11 @@ public interface GovernanceAssignments { /** * Get a specific governanceAssignment for the requested scope by AssignmentKey. * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param assessmentName The Assessment Key - Unique key for the assessment type. - * @param assignmentKey The security governance assignment key - the assessment key of the required governance - * assignment. + * @param scope The scope of the Governance assignments. Valid scopes are: subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * @param assessmentName The Assessment Key - A unique key for the assessment type. + * @param assignmentKey The governance assignment key - the assessment key of the required governance assignment. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -59,11 +61,11 @@ Response getWithResponse( /** * Get a specific governanceAssignment for the requested scope by AssignmentKey. * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param assessmentName The Assessment Key - Unique key for the assessment type. - * @param assignmentKey The security governance assignment key - the assessment key of the required governance - * assignment. + * @param scope The scope of the Governance assignments. Valid scopes are: subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * @param assessmentName The Assessment Key - A unique key for the assessment type. + * @param assignmentKey The governance assignment key - the assessment key of the required governance assignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -74,11 +76,11 @@ Response getWithResponse( /** * Delete a GovernanceAssignment over a given scope. * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param assessmentName The Assessment Key - Unique key for the assessment type. - * @param assignmentKey The security governance assignment key - the assessment key of the required governance - * assignment. + * @param scope The scope of the Governance assignments. Valid scopes are: subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * @param assessmentName The Assessment Key - A unique key for the assessment type. + * @param assignmentKey The governance assignment key - the assessment key of the required governance assignment. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -90,11 +92,11 @@ Response getWithResponse( /** * Delete a GovernanceAssignment over a given scope. * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param assessmentName The Assessment Key - Unique key for the assessment type. - * @param assignmentKey The security governance assignment key - the assessment key of the required governance - * assignment. + * @param scope The scope of the Governance assignments. Valid scopes are: subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * @param assessmentName The Assessment Key - A unique key for the assessment type. + * @param assignmentKey The governance assignment key - the assessment key of the required governance assignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GovernanceAssignmentsList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GovernanceAssignmentsList.java index 16e725b80fe30..e1d3c1e584e18 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GovernanceAssignmentsList.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GovernanceAssignmentsList.java @@ -9,7 +9,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** Page of a security governance assignments list. */ +/** Page of a governance assignments list. */ @Immutable public final class GovernanceAssignmentsList { /* diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GovernanceRule.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GovernanceRule.java index 26fca1a2ee700..29fee19b4c66d 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GovernanceRule.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GovernanceRule.java @@ -32,14 +32,21 @@ public interface GovernanceRule { String type(); /** - * Gets the displayName property: display name of the governanceRule. + * Gets the tenantId property: The tenantId (GUID). + * + * @return the tenantId value. + */ + String tenantId(); + + /** + * Gets the displayName property: Display name of the governance rule. * * @return the displayName value. */ String displayName(); /** - * Gets the description property: description of the governanceRule. + * Gets the description property: Description of the governance rule. * * @return the description value. */ @@ -62,7 +69,7 @@ public interface GovernanceRule { /** * Gets the rulePriority property: The governance rule priority, priority to the lower number. Rules with the same - * priority on the same subscription will not be allowed. + * priority on the same scope will not be allowed. * * @return the rulePriority value. */ @@ -89,6 +96,14 @@ public interface GovernanceRule { */ GovernanceRuleSourceResourceType sourceResourceType(); + /** + * Gets the excludedScopes property: Excluded scopes, filter out the descendants of the scope (on management + * scopes). + * + * @return the excludedScopes value. + */ + List excludedScopes(); + /** * Gets the conditionSets property: The governance rule conditionSets - see examples. * @@ -97,7 +112,15 @@ public interface GovernanceRule { List conditionSets(); /** - * Gets the ownerSource property: The Owner source for the governance rule - e.g. Manually by user@contoso.com - see + * Gets the includeMemberScopes property: Defines whether the rule is management scope rule (master connector as a + * single scope or management scope). + * + * @return the includeMemberScopes value. + */ + Boolean includeMemberScopes(); + + /** + * Gets the ownerSource property: The owner source for the governance rule - e.g. Manually by user@contoso.com - see * example. * * @return the ownerSource value. @@ -112,6 +135,13 @@ public interface GovernanceRule { */ GovernanceRuleEmailNotification governanceEmailNotification(); + /** + * Gets the metadata property: The governance rule metadata. + * + * @return the metadata value. + */ + GovernanceRuleMetadata metadata(); + /** * Gets the inner com.azure.resourcemanager.security.fluent.models.GovernanceRuleInner object. * @@ -120,12 +150,25 @@ public interface GovernanceRule { GovernanceRuleInner innerModel(); /** The entirety of the GovernanceRule definition. */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithCreate { + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithScope, DefinitionStages.WithCreate { } /** The GovernanceRule definition stages. */ interface DefinitionStages { /** The first stage of the GovernanceRule definition. */ - interface Blank extends WithCreate { + interface Blank extends WithScope { + } + /** The stage of the GovernanceRule definition allowing to specify parent resource. */ + interface WithScope { + /** + * Specifies scope. + * + * @param scope The scope of the Governance rules. Valid scopes are: management group (format: + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * @return the next definition stage. + */ + WithCreate withExistingScope(String scope); } /** * The stage of the GovernanceRule definition which contains all the minimum required properties for the @@ -140,9 +183,12 @@ interface WithCreate DefinitionStages.WithIsDisabled, DefinitionStages.WithRuleType, DefinitionStages.WithSourceResourceType, + DefinitionStages.WithExcludedScopes, DefinitionStages.WithConditionSets, + DefinitionStages.WithIncludeMemberScopes, DefinitionStages.WithOwnerSource, - DefinitionStages.WithGovernanceEmailNotification { + DefinitionStages.WithGovernanceEmailNotification, + DefinitionStages.WithMetadata { /** * Executes the create request. * @@ -161,9 +207,9 @@ interface WithCreate /** The stage of the GovernanceRule definition allowing to specify displayName. */ interface WithDisplayName { /** - * Specifies the displayName property: display name of the governanceRule. + * Specifies the displayName property: Display name of the governance rule. * - * @param displayName display name of the governanceRule. + * @param displayName Display name of the governance rule. * @return the next definition stage. */ WithCreate withDisplayName(String displayName); @@ -171,9 +217,9 @@ interface WithDisplayName { /** The stage of the GovernanceRule definition allowing to specify description. */ interface WithDescription { /** - * Specifies the description property: description of the governanceRule. + * Specifies the description property: Description of the governance rule. * - * @param description description of the governanceRule. + * @param description Description of the governance rule. * @return the next definition stage. */ WithCreate withDescription(String description); @@ -204,10 +250,10 @@ interface WithIsGracePeriod { interface WithRulePriority { /** * Specifies the rulePriority property: The governance rule priority, priority to the lower number. Rules - * with the same priority on the same subscription will not be allowed. + * with the same priority on the same scope will not be allowed. * * @param rulePriority The governance rule priority, priority to the lower number. Rules with the same - * priority on the same subscription will not be allowed. + * priority on the same scope will not be allowed. * @return the next definition stage. */ WithCreate withRulePriority(int rulePriority); @@ -244,6 +290,17 @@ interface WithSourceResourceType { */ WithCreate withSourceResourceType(GovernanceRuleSourceResourceType sourceResourceType); } + /** The stage of the GovernanceRule definition allowing to specify excludedScopes. */ + interface WithExcludedScopes { + /** + * Specifies the excludedScopes property: Excluded scopes, filter out the descendants of the scope (on + * management scopes). + * + * @param excludedScopes Excluded scopes, filter out the descendants of the scope (on management scopes). + * @return the next definition stage. + */ + WithCreate withExcludedScopes(List excludedScopes); + } /** The stage of the GovernanceRule definition allowing to specify conditionSets. */ interface WithConditionSets { /** @@ -254,13 +311,25 @@ interface WithConditionSets { */ WithCreate withConditionSets(List conditionSets); } + /** The stage of the GovernanceRule definition allowing to specify includeMemberScopes. */ + interface WithIncludeMemberScopes { + /** + * Specifies the includeMemberScopes property: Defines whether the rule is management scope rule (master + * connector as a single scope or management scope). + * + * @param includeMemberScopes Defines whether the rule is management scope rule (master connector as a + * single scope or management scope). + * @return the next definition stage. + */ + WithCreate withIncludeMemberScopes(Boolean includeMemberScopes); + } /** The stage of the GovernanceRule definition allowing to specify ownerSource. */ interface WithOwnerSource { /** - * Specifies the ownerSource property: The Owner source for the governance rule - e.g. Manually by + * Specifies the ownerSource property: The owner source for the governance rule - e.g. Manually by * user@contoso.com - see example. * - * @param ownerSource The Owner source for the governance rule - e.g. Manually by user@contoso.com - see + * @param ownerSource The owner source for the governance rule - e.g. Manually by user@contoso.com - see * example. * @return the next definition stage. */ @@ -278,6 +347,16 @@ interface WithGovernanceEmailNotification { */ WithCreate withGovernanceEmailNotification(GovernanceRuleEmailNotification governanceEmailNotification); } + /** The stage of the GovernanceRule definition allowing to specify metadata. */ + interface WithMetadata { + /** + * Specifies the metadata property: The governance rule metadata. + * + * @param metadata The governance rule metadata. + * @return the next definition stage. + */ + WithCreate withMetadata(GovernanceRuleMetadata metadata); + } } /** * Begins update for the GovernanceRule resource. @@ -296,9 +375,12 @@ interface Update UpdateStages.WithIsDisabled, UpdateStages.WithRuleType, UpdateStages.WithSourceResourceType, + UpdateStages.WithExcludedScopes, UpdateStages.WithConditionSets, + UpdateStages.WithIncludeMemberScopes, UpdateStages.WithOwnerSource, - UpdateStages.WithGovernanceEmailNotification { + UpdateStages.WithGovernanceEmailNotification, + UpdateStages.WithMetadata { /** * Executes the update request. * @@ -319,9 +401,9 @@ interface UpdateStages { /** The stage of the GovernanceRule update allowing to specify displayName. */ interface WithDisplayName { /** - * Specifies the displayName property: display name of the governanceRule. + * Specifies the displayName property: Display name of the governance rule. * - * @param displayName display name of the governanceRule. + * @param displayName Display name of the governance rule. * @return the next definition stage. */ Update withDisplayName(String displayName); @@ -329,9 +411,9 @@ interface WithDisplayName { /** The stage of the GovernanceRule update allowing to specify description. */ interface WithDescription { /** - * Specifies the description property: description of the governanceRule. + * Specifies the description property: Description of the governance rule. * - * @param description description of the governanceRule. + * @param description Description of the governance rule. * @return the next definition stage. */ Update withDescription(String description); @@ -362,10 +444,10 @@ interface WithIsGracePeriod { interface WithRulePriority { /** * Specifies the rulePriority property: The governance rule priority, priority to the lower number. Rules - * with the same priority on the same subscription will not be allowed. + * with the same priority on the same scope will not be allowed. * * @param rulePriority The governance rule priority, priority to the lower number. Rules with the same - * priority on the same subscription will not be allowed. + * priority on the same scope will not be allowed. * @return the next definition stage. */ Update withRulePriority(int rulePriority); @@ -402,6 +484,17 @@ interface WithSourceResourceType { */ Update withSourceResourceType(GovernanceRuleSourceResourceType sourceResourceType); } + /** The stage of the GovernanceRule update allowing to specify excludedScopes. */ + interface WithExcludedScopes { + /** + * Specifies the excludedScopes property: Excluded scopes, filter out the descendants of the scope (on + * management scopes). + * + * @param excludedScopes Excluded scopes, filter out the descendants of the scope (on management scopes). + * @return the next definition stage. + */ + Update withExcludedScopes(List excludedScopes); + } /** The stage of the GovernanceRule update allowing to specify conditionSets. */ interface WithConditionSets { /** @@ -412,13 +505,25 @@ interface WithConditionSets { */ Update withConditionSets(List conditionSets); } + /** The stage of the GovernanceRule update allowing to specify includeMemberScopes. */ + interface WithIncludeMemberScopes { + /** + * Specifies the includeMemberScopes property: Defines whether the rule is management scope rule (master + * connector as a single scope or management scope). + * + * @param includeMemberScopes Defines whether the rule is management scope rule (master connector as a + * single scope or management scope). + * @return the next definition stage. + */ + Update withIncludeMemberScopes(Boolean includeMemberScopes); + } /** The stage of the GovernanceRule update allowing to specify ownerSource. */ interface WithOwnerSource { /** - * Specifies the ownerSource property: The Owner source for the governance rule - e.g. Manually by + * Specifies the ownerSource property: The owner source for the governance rule - e.g. Manually by * user@contoso.com - see example. * - * @param ownerSource The Owner source for the governance rule - e.g. Manually by user@contoso.com - see + * @param ownerSource The owner source for the governance rule - e.g. Manually by user@contoso.com - see * example. * @return the next definition stage. */ @@ -436,6 +541,16 @@ interface WithGovernanceEmailNotification { */ Update withGovernanceEmailNotification(GovernanceRuleEmailNotification governanceEmailNotification); } + /** The stage of the GovernanceRule update allowing to specify metadata. */ + interface WithMetadata { + /** + * Specifies the metadata property: The governance rule metadata. + * + * @param metadata The governance rule metadata. + * @return the next definition stage. + */ + Update withMetadata(GovernanceRuleMetadata metadata); + } } /** * Refreshes the resource to sync with Azure. @@ -453,21 +568,21 @@ interface WithGovernanceEmailNotification { GovernanceRule refresh(Context context); /** - * Execute a security GovernanceRule on the given subscription. + * Execute a governance rule. * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ - void ruleIdExecuteSingleSubscription(); + void execute(); /** - * Execute a security GovernanceRule on the given subscription. + * Execute a governance rule. * - * @param executeGovernanceRuleParams GovernanceRule over a subscription scope. + * @param executeGovernanceRuleParams Execute governance rule over a given scope. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ - void ruleIdExecuteSingleSubscription(ExecuteGovernanceRuleParams executeGovernanceRuleParams, Context context); + void execute(ExecuteGovernanceRuleParams executeGovernanceRuleParams, Context context); } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GovernanceRuleEmailNotification.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GovernanceRuleEmailNotification.java index d39890d509c55..e8dce71f1fb19 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GovernanceRuleEmailNotification.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GovernanceRuleEmailNotification.java @@ -11,13 +11,13 @@ @Fluent public final class GovernanceRuleEmailNotification { /* - * Defines whether manager email notifications are disabled. + * Defines whether manager email notifications are disabled */ @JsonProperty(value = "disableManagerEmailNotification") private Boolean disableManagerEmailNotification; /* - * Defines whether owner email notifications are disabled. + * Defines whether owner email notifications are disabled */ @JsonProperty(value = "disableOwnerEmailNotification") private Boolean disableOwnerEmailNotification; diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GovernanceRuleList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GovernanceRuleList.java index b43661b6b4f3d..f8ba5f28cd651 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GovernanceRuleList.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GovernanceRuleList.java @@ -9,11 +9,11 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** Page of a security governanceRules list. */ +/** Page of a governance rules list. */ @Immutable public final class GovernanceRuleList { /* - * Collection of governanceRules in this page + * Collection of governance rules in this page */ @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) private List value; @@ -29,7 +29,7 @@ public GovernanceRuleList() { } /** - * Get the value property: Collection of governanceRules in this page. + * Get the value property: Collection of governance rules in this page. * * @return the value value. */ diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GovernanceRuleMetadata.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GovernanceRuleMetadata.java new file mode 100644 index 0000000000000..8c6b0dd86ef9a --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GovernanceRuleMetadata.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** The governance rule metadata. */ +@Immutable +public final class GovernanceRuleMetadata { + /* + * Governance rule Created by object id (GUID) + */ + @JsonProperty(value = "createdBy", access = JsonProperty.Access.WRITE_ONLY) + private String createdBy; + + /* + * Governance rule creation date + */ + @JsonProperty(value = "createdOn", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime createdOn; + + /* + * Governance rule last updated by object id (GUID) + */ + @JsonProperty(value = "updatedBy", access = JsonProperty.Access.WRITE_ONLY) + private String updatedBy; + + /* + * Governance rule last update date + */ + @JsonProperty(value = "updatedOn", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime updatedOn; + + /** Creates an instance of GovernanceRuleMetadata class. */ + public GovernanceRuleMetadata() { + } + + /** + * Get the createdBy property: Governance rule Created by object id (GUID). + * + * @return the createdBy value. + */ + public String createdBy() { + return this.createdBy; + } + + /** + * Get the createdOn property: Governance rule creation date. + * + * @return the createdOn value. + */ + public OffsetDateTime createdOn() { + return this.createdOn; + } + + /** + * Get the updatedBy property: Governance rule last updated by object id (GUID). + * + * @return the updatedBy value. + */ + public String updatedBy() { + return this.updatedBy; + } + + /** + * Get the updatedOn property: Governance rule last update date. + * + * @return the updatedOn value. + */ + public OffsetDateTime updatedOn() { + return this.updatedOn; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GovernanceRuleOwnerSourceType.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GovernanceRuleOwnerSourceType.java index 146956a011308..4af9cd6367bd0 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GovernanceRuleOwnerSourceType.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GovernanceRuleOwnerSourceType.java @@ -16,6 +16,15 @@ public final class GovernanceRuleOwnerSourceType extends ExpandableStringEnum list(String scope); + + /** + * Get a list of all relevant governance rules over a scope. + * + * @param scope The scope of the Governance rules. Valid scopes are: management group (format: + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all relevant governance rules over a scope as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String scope, Context context); + + /** + * Get a specific governance rule for the requested scope by ruleId. + * + * @param scope The scope of the Governance rules. Valid scopes are: management group (format: + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a specific governance rule for the requested scope by ruleId along with {@link Response}. + */ + Response getWithResponse(String scope, String ruleId, Context context); + + /** + * Get a specific governance rule for the requested scope by ruleId. + * + * @param scope The scope of the Governance rules. Valid scopes are: management group (format: + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all relevant governanceRules over a subscription level scope as paginated response with {@link - * PagedIterable}. + * @return a specific governance rule for the requested scope by ruleId. */ - PagedIterable list(); + GovernanceRule get(String scope, String ruleId); /** - * Get a list of all relevant governanceRules over a subscription level scope. + * Delete a Governance rule over a given scope. * + * @param scope The scope of the Governance rules. Valid scopes are: management group (format: + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String scope, String ruleId); + + /** + * Delete a Governance rule over a given scope. + * + * @param scope The scope of the Governance rules. Valid scopes are: management group (format: + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String scope, String ruleId, Context context); + + /** + * Execute a governance rule. + * + * @param scope The scope of the Governance rules. Valid scopes are: management group (format: + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void execute(String scope, String ruleId); + + /** + * Execute a governance rule. + * + * @param scope The scope of the Governance rules. Valid scopes are: management group (format: + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). + * @param executeGovernanceRuleParams Execute governance rule over a given scope. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all relevant governanceRules over a subscription level scope as paginated response with {@link - * PagedIterable}. */ - PagedIterable list(Context context); + void execute(String scope, String ruleId, ExecuteGovernanceRuleParams executeGovernanceRuleParams, Context context); + + /** + * Get governance rules long run operation result for the requested scope by ruleId and operationId. + * + * @param scope The scope of the Governance rules. Valid scopes are: management group (format: + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). + * @param operationId The governance rule long running operation unique key. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return governance rules long run operation result for the requested scope by ruleId and operationId. + */ + Response operationResultsWithResponse( + String scope, String ruleId, String operationId, Context context); + + /** + * Get governance rules long run operation result for the requested scope by ruleId and operationId. + * + * @param scope The scope of the Governance rules. Valid scopes are: management group (format: + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). + * @param operationId The governance rule long running operation unique key. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return governance rules long run operation result for the requested scope by ruleId and operationId. + */ + OperationResultAutoGenerated operationResults(String scope, String ruleId, String operationId); + + /** + * Get a specific governance rule for the requested scope by ruleId. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a specific governance rule for the requested scope by ruleId along with {@link Response}. + */ + GovernanceRule getById(String id); + + /** + * Get a specific governance rule for the requested scope by ruleId. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a specific governance rule for the requested scope by ruleId along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a Governance rule over a given scope. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a Governance rule over a given scope. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new GovernanceRule resource. + * + * @param name resource name. + * @return the first stage of the new GovernanceRule definition. + */ + GovernanceRule.DefinitionStages.Blank define(String name); } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GovernanceRulesOperationResultsHeaders.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GovernanceRulesOperationResultsHeaders.java new file mode 100644 index 0000000000000..64ccd176ad4a5 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GovernanceRulesOperationResultsHeaders.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.http.HttpHeaderName; +import com.azure.core.http.HttpHeaders; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The GovernanceRulesOperationResultsHeaders model. */ +@Fluent +public final class GovernanceRulesOperationResultsHeaders { + /* + * The location property. + */ + @JsonProperty(value = "location") + private String location; + + // HttpHeaders containing the raw property values. + /** + * Creates an instance of GovernanceRulesOperationResultsHeaders class. + * + * @param rawHeaders The raw HttpHeaders that will be used to create the property values. + */ + public GovernanceRulesOperationResultsHeaders(HttpHeaders rawHeaders) { + this.location = rawHeaders.getValue(HttpHeaderName.LOCATION); + } + + /** + * Get the location property: The location property. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The location property. + * + * @param location the location value to set. + * @return the GovernanceRulesOperationResultsHeaders object itself. + */ + public GovernanceRulesOperationResultsHeaders withLocation(String location) { + this.location = location; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GovernanceRulesOperationResultsResponse.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GovernanceRulesOperationResultsResponse.java new file mode 100644 index 0000000000000..d7a5527e6b975 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GovernanceRulesOperationResultsResponse.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.security.fluent.models.OperationResultAutoGeneratedInner; + +/** Contains all response data for the operationResults operation. */ +public final class GovernanceRulesOperationResultsResponse + extends ResponseBase { + /** + * Creates an instance of GovernanceRulesOperationResultsResponse. + * + * @param request the request which resulted in this GovernanceRulesOperationResultsResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public GovernanceRulesOperationResultsResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + OperationResultAutoGeneratedInner value, + GovernanceRulesOperationResultsHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** + * Gets the deserialized response body. + * + * @return the deserialized response body. + */ + @Override + public OperationResultAutoGeneratedInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GovernanceRulesOperations.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GovernanceRulesOperations.java deleted file mode 100644 index d6a3504509ea0..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GovernanceRulesOperations.java +++ /dev/null @@ -1,165 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** Resource collection API of GovernanceRulesOperations. */ -public interface GovernanceRulesOperations { - /** - * Get a specific governanceRule for the requested scope by ruleId. - * - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific governanceRule for the requested scope by ruleId along with {@link Response}. - */ - Response getWithResponse(String ruleId, Context context); - - /** - * Get a specific governanceRule for the requested scope by ruleId. - * - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific governanceRule for the requested scope by ruleId. - */ - GovernanceRule get(String ruleId); - - /** - * Delete a GovernanceRule over a given scope. - * - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response deleteWithResponse(String ruleId, Context context); - - /** - * Delete a GovernanceRule over a given scope. - * - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void delete(String ruleId); - - /** - * Execute a security GovernanceRule on the given subscription. - * - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void ruleIdExecuteSingleSubscription(String ruleId); - - /** - * Execute a security GovernanceRule on the given subscription. - * - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @param executeGovernanceRuleParams GovernanceRule over a subscription scope. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void ruleIdExecuteSingleSubscription( - String ruleId, ExecuteGovernanceRuleParams executeGovernanceRuleParams, Context context); - - /** - * Execute a security GovernanceRule on the given security connector. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void ruleIdExecuteSingleSecurityConnector(String resourceGroupName, String securityConnectorName, String ruleId); - - /** - * Execute a security GovernanceRule on the given security connector. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @param executeGovernanceRuleParams GovernanceRule over a subscription scope. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void ruleIdExecuteSingleSecurityConnector( - String resourceGroupName, - String securityConnectorName, - String ruleId, - ExecuteGovernanceRuleParams executeGovernanceRuleParams, - Context context); - - /** - * Get a specific governanceRule for the requested scope by ruleId. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific governanceRule for the requested scope by ruleId along with {@link Response}. - */ - GovernanceRule getById(String id); - - /** - * Get a specific governanceRule for the requested scope by ruleId. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific governanceRule for the requested scope by ruleId along with {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Delete a GovernanceRule over a given scope. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteById(String id); - - /** - * Delete a GovernanceRule over a given scope. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response deleteByIdWithResponse(String id, Context context); - - /** - * Begins definition for a new GovernanceRule resource. - * - * @param name resource name. - * @return the first stage of the new GovernanceRule definition. - */ - GovernanceRule.DefinitionStages.Blank define(String name); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/HealthDataClassification.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/HealthDataClassification.java new file mode 100644 index 0000000000000..9be26ae2b0db7 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/HealthDataClassification.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The classification of the health report. */ +@Fluent +public final class HealthDataClassification { + /* + * The component describes the name of the agent/service that scans the issue + */ + @JsonProperty(value = "component") + private String component; + + /* + * The scenario describes the health scenario issue of the component + */ + @JsonProperty(value = "scenario") + private String scenario; + + /* + * The resource scope of the health report + */ + @JsonProperty(value = "scope") + private ScopeName scope; + + /** Creates an instance of HealthDataClassification class. */ + public HealthDataClassification() { + } + + /** + * Get the component property: The component describes the name of the agent/service that scans the issue. + * + * @return the component value. + */ + public String component() { + return this.component; + } + + /** + * Set the component property: The component describes the name of the agent/service that scans the issue. + * + * @param component the component value to set. + * @return the HealthDataClassification object itself. + */ + public HealthDataClassification withComponent(String component) { + this.component = component; + return this; + } + + /** + * Get the scenario property: The scenario describes the health scenario issue of the component. + * + * @return the scenario value. + */ + public String scenario() { + return this.scenario; + } + + /** + * Set the scenario property: The scenario describes the health scenario issue of the component. + * + * @param scenario the scenario value to set. + * @return the HealthDataClassification object itself. + */ + public HealthDataClassification withScenario(String scenario) { + this.scenario = scenario; + return this; + } + + /** + * Get the scope property: The resource scope of the health report. + * + * @return the scope value. + */ + public ScopeName scope() { + return this.scope; + } + + /** + * Set the scope property: The resource scope of the health report. + * + * @param scope the scope value to set. + * @return the HealthDataClassification object itself. + */ + public HealthDataClassification withScope(ScopeName scope) { + this.scope = scope; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/HealthReport.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/HealthReport.java new file mode 100644 index 0000000000000..da93fa084412c --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/HealthReport.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.resourcemanager.security.fluent.models.HealthReportInner; +import java.util.List; + +/** An immutable client-side representation of HealthReport. */ +public interface HealthReport { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the resourceDetails property: The resource details of the health report. + * + * @return the resourceDetails value. + */ + ResourceDetailsAutoGenerated resourceDetails(); + + /** + * Gets the environmentDetails property: The environment details of the resource. + * + * @return the environmentDetails value. + */ + EnvironmentDetails environmentDetails(); + + /** + * Gets the healthDataClassification property: The classification of the health report. + * + * @return the healthDataClassification value. + */ + HealthDataClassification healthDataClassification(); + + /** + * Gets the status property: The status of the health report. + * + * @return the status value. + */ + StatusAutoGenerated status(); + + /** + * Gets the affectedDefendersPlans property: The affected defenders plans by unhealthy report. + * + * @return the affectedDefendersPlans value. + */ + List affectedDefendersPlans(); + + /** + * Gets the issues property: A collection of the issues in the report. + * + * @return the issues value. + */ + List issues(); + + /** + * Gets the inner com.azure.resourcemanager.security.fluent.models.HealthReportInner object. + * + * @return the inner object. + */ + HealthReportInner innerModel(); +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/HealthReportOperations.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/HealthReportOperations.java new file mode 100644 index 0000000000000..df0dbf9b29fea --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/HealthReportOperations.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of HealthReportOperations. */ +public interface HealthReportOperations { + /** + * Get health report of resource. + * + * @param resourceId The identifier of the resource. + * @param healthReportName The health report Key - Unique key for the health report type. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return health report of resource along with {@link Response}. + */ + Response getWithResponse(String resourceId, String healthReportName, Context context); + + /** + * Get health report of resource. + * + * @param resourceId The identifier of the resource. + * @param healthReportName The health report Key - Unique key for the health report type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return health report of resource. + */ + HealthReport get(String resourceId, String healthReportName); +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/HealthReports.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/HealthReports.java new file mode 100644 index 0000000000000..8765b15539e7b --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/HealthReports.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of HealthReports. */ +public interface HealthReports { + /** + * Get a list of all health reports inside a scope. Valid scopes are: subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * + * @param scope The scope at which the operation is performed. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all health reports inside a scope as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String scope); + + /** + * Get a list of all health reports inside a scope. Valid scopes are: subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * + * @param scope The scope at which the operation is performed. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all health reports inside a scope as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String scope, Context context); +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/HealthReportsList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/HealthReportsList.java new file mode 100644 index 0000000000000..0d3cc1e6a747b --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/HealthReportsList.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.security.fluent.models.HealthReportInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Page of health reports list. */ +@Immutable +public final class HealthReportsList { + /* + * Collection of health reports in this page + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * The URI to fetch the next page + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** Creates an instance of HealthReportsList class. */ + public HealthReportsList() { + } + + /** + * Get the value property: Collection of health reports in this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The URI to fetch the next page. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/HybridComputeProvisioningState.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/HybridComputeProvisioningState.java index 3e50934622e97..f938034d5fe25 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/HybridComputeProvisioningState.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/HybridComputeProvisioningState.java @@ -19,6 +19,15 @@ public final class HybridComputeProvisioningState extends ExpandableStringEnum { /** Static value Exploitation for Intent. */ public static final Intent EXPLOITATION = fromString("Exploitation"); + /** + * Creates a new instance of Intent value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Intent() { + } + /** * Creates or finds a Intent from its string representation. * diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Issue.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Issue.java new file mode 100644 index 0000000000000..f35226ffafe20 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Issue.java @@ -0,0 +1,224 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** The issue that caused the resource to by unhealthy. */ +@Fluent +public final class Issue { + /* + * The unique issue key + */ + @JsonProperty(value = "issueKey", required = true) + private String issueKey; + + /* + * The issue name + */ + @JsonProperty(value = "issueName") + private String issueName; + + /* + * The affected security values that MDC offers that will be affected by the issue, for example: recommendations, + * alerts, etc + */ + @JsonProperty(value = "securityValues") + private List securityValues; + + /* + * The issue description + */ + @JsonProperty(value = "issueDescription") + private String issueDescription; + + /* + * Human readable description of what you should do to mitigate this health issue + */ + @JsonProperty(value = "remediationSteps") + private String remediationSteps; + + /* + * The remediation script to solve this issue + */ + @JsonProperty(value = "remediationScript") + private String remediationScript; + + /* + * Additional data for the given issue. The additional data depends on the issue type + */ + @JsonProperty(value = "issueAdditionalData") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map issueAdditionalData; + + /** Creates an instance of Issue class. */ + public Issue() { + } + + /** + * Get the issueKey property: The unique issue key. + * + * @return the issueKey value. + */ + public String issueKey() { + return this.issueKey; + } + + /** + * Set the issueKey property: The unique issue key. + * + * @param issueKey the issueKey value to set. + * @return the Issue object itself. + */ + public Issue withIssueKey(String issueKey) { + this.issueKey = issueKey; + return this; + } + + /** + * Get the issueName property: The issue name. + * + * @return the issueName value. + */ + public String issueName() { + return this.issueName; + } + + /** + * Set the issueName property: The issue name. + * + * @param issueName the issueName value to set. + * @return the Issue object itself. + */ + public Issue withIssueName(String issueName) { + this.issueName = issueName; + return this; + } + + /** + * Get the securityValues property: The affected security values that MDC offers that will be affected by the issue, + * for example: recommendations, alerts, etc. + * + * @return the securityValues value. + */ + public List securityValues() { + return this.securityValues; + } + + /** + * Set the securityValues property: The affected security values that MDC offers that will be affected by the issue, + * for example: recommendations, alerts, etc. + * + * @param securityValues the securityValues value to set. + * @return the Issue object itself. + */ + public Issue withSecurityValues(List securityValues) { + this.securityValues = securityValues; + return this; + } + + /** + * Get the issueDescription property: The issue description. + * + * @return the issueDescription value. + */ + public String issueDescription() { + return this.issueDescription; + } + + /** + * Set the issueDescription property: The issue description. + * + * @param issueDescription the issueDescription value to set. + * @return the Issue object itself. + */ + public Issue withIssueDescription(String issueDescription) { + this.issueDescription = issueDescription; + return this; + } + + /** + * Get the remediationSteps property: Human readable description of what you should do to mitigate this health + * issue. + * + * @return the remediationSteps value. + */ + public String remediationSteps() { + return this.remediationSteps; + } + + /** + * Set the remediationSteps property: Human readable description of what you should do to mitigate this health + * issue. + * + * @param remediationSteps the remediationSteps value to set. + * @return the Issue object itself. + */ + public Issue withRemediationSteps(String remediationSteps) { + this.remediationSteps = remediationSteps; + return this; + } + + /** + * Get the remediationScript property: The remediation script to solve this issue. + * + * @return the remediationScript value. + */ + public String remediationScript() { + return this.remediationScript; + } + + /** + * Set the remediationScript property: The remediation script to solve this issue. + * + * @param remediationScript the remediationScript value to set. + * @return the Issue object itself. + */ + public Issue withRemediationScript(String remediationScript) { + this.remediationScript = remediationScript; + return this; + } + + /** + * Get the issueAdditionalData property: Additional data for the given issue. The additional data depends on the + * issue type. + * + * @return the issueAdditionalData value. + */ + public Map issueAdditionalData() { + return this.issueAdditionalData; + } + + /** + * Set the issueAdditionalData property: Additional data for the given issue. The additional data depends on the + * issue type. + * + * @param issueAdditionalData the issueAdditionalData value to set. + * @return the Issue object itself. + */ + public Issue withIssueAdditionalData(Map issueAdditionalData) { + this.issueAdditionalData = issueAdditionalData; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (issueKey() == null) { + throw LOGGER + .logExceptionAsError(new IllegalArgumentException("Missing required property issueKey in model Issue")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(Issue.class); +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Kind.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Kind.java index 22027d89b0a89..3b6c0c059d31d 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Kind.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Kind.java @@ -13,6 +13,15 @@ public final class Kind extends ExpandableStringEnum { /** Static value Bundles for Kind. */ public static final Kind BUNDLES = fromString("Bundles"); + /** + * Creates a new instance of Kind value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Kind() { + } + /** * Creates or finds a Kind from its string representation. * diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/MinimalSeverity.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/MinimalSeverity.java index 4d7ee4052dfc6..6121cd0dad328 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/MinimalSeverity.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/MinimalSeverity.java @@ -19,6 +19,15 @@ public final class MinimalSeverity extends ExpandableStringEnum /** Static value Low for MinimalSeverity. */ public static final MinimalSeverity LOW = fromString("Low"); + /** + * Creates a new instance of MinimalSeverity value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public MinimalSeverity() { + } + /** * Creates or finds a MinimalSeverity from its string representation. * diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/OfferingType.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/OfferingType.java index ed9676b3bc3b2..814cb32f98e19 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/OfferingType.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/OfferingType.java @@ -55,6 +55,15 @@ public final class OfferingType extends ExpandableStringEnum { /** Static value DefenderForDevOpsAzureDevOps for OfferingType. */ public static final OfferingType DEFENDER_FOR_DEV_OPS_AZURE_DEV_OPS = fromString("DefenderForDevOpsAzureDevOps"); + /** + * Creates a new instance of OfferingType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public OfferingType() { + } + /** * Creates or finds a OfferingType from its string representation. * diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/OperationResult.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/OperationResult.java new file mode 100644 index 0000000000000..5e73d10eacb5f --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/OperationResult.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The status of the long run operation result of governance rule. */ +public final class OperationResult extends ExpandableStringEnum { + /** Static value Succeeded for OperationResult. */ + public static final OperationResult SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for OperationResult. */ + public static final OperationResult FAILED = fromString("Failed"); + + /** Static value Canceled for OperationResult. */ + public static final OperationResult CANCELED = fromString("Canceled"); + + /** + * Creates a new instance of OperationResult value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public OperationResult() { + } + + /** + * Creates or finds a OperationResult from its string representation. + * + * @param name a name to look for. + * @return the corresponding OperationResult. + */ + @JsonCreator + public static OperationResult fromString(String name) { + return fromString(name, OperationResult.class); + } + + /** + * Gets known OperationResult values. + * + * @return known OperationResult values. + */ + public static Collection values() { + return values(OperationResult.class); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/OperationResultAutoGenerated.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/OperationResultAutoGenerated.java new file mode 100644 index 0000000000000..94dce0ac83518 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/OperationResultAutoGenerated.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.resourcemanager.security.fluent.models.OperationResultAutoGeneratedInner; + +/** An immutable client-side representation of OperationResultAutoGenerated. */ +public interface OperationResultAutoGenerated { + /** + * Gets the status property: The status of the long run operation result of governance rule. + * + * @return the status value. + */ + OperationResult status(); + + /** + * Gets the inner com.azure.resourcemanager.security.fluent.models.OperationResultAutoGeneratedInner object. + * + * @return the inner object. + */ + OperationResultAutoGeneratedInner innerModel(); +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Operator.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Operator.java index 8a7dd43b16760..82f67b205ac3a 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Operator.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Operator.java @@ -37,6 +37,15 @@ public final class Operator extends ExpandableStringEnum { /** Static value EndsWith for Operator. */ public static final Operator ENDS_WITH = fromString("EndsWith"); + /** + * Creates a new instance of Operator value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Operator() { + } + /** * Creates or finds a Operator from its string representation. * diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/OrganizationMembershipType.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/OrganizationMembershipType.java index 79d56594bfb60..a5ca7145f0f3c 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/OrganizationMembershipType.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/OrganizationMembershipType.java @@ -16,6 +16,15 @@ public final class OrganizationMembershipType extends ExpandableStringEnum { /** Static value Standard for PricingTier. */ public static final PricingTier STANDARD = fromString("Standard"); + /** + * Creates a new instance of PricingTier value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PricingTier() { + } + /** * Creates or finds a PricingTier from its string representation. * diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/PropertyType.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/PropertyType.java index 0781591ee50ba..4ea08d7c1143f 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/PropertyType.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/PropertyType.java @@ -22,6 +22,15 @@ public final class PropertyType extends ExpandableStringEnum { /** Static value Boolean for PropertyType. */ public static final PropertyType BOOLEAN = fromString("Boolean"); + /** + * Creates a new instance of PropertyType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PropertyType() { + } + /** * Creates or finds a PropertyType from its string representation. * diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Protocol.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Protocol.java index ca9cad6e6adf4..820e6bed5a7e5 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Protocol.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Protocol.java @@ -19,6 +19,15 @@ public final class Protocol extends ExpandableStringEnum { /** Static value * for Protocol. */ public static final Protocol ASTERISK = fromString("*"); + /** + * Creates a new instance of Protocol value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Protocol() { + } + /** * Creates or finds a Protocol from its string representation. * diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ProvisioningState.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ProvisioningState.java index 1817f99588164..eb1a1e0b54a8a 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ProvisioningState.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ProvisioningState.java @@ -19,6 +19,15 @@ public final class ProvisioningState extends ExpandableStringEnum { /** Static value NotHealthy for ResourceStatus. */ public static final ResourceStatus NOT_HEALTHY = fromString("NotHealthy"); + /** + * Creates a new instance of ResourceStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ResourceStatus() { + } + /** * Creates or finds a ResourceStatus from its string representation. * diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Roles.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Roles.java index d207978ebef84..c1e2a1bbea975 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Roles.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Roles.java @@ -22,6 +22,15 @@ public final class Roles extends ExpandableStringEnum { /** Static value Contributor for Roles. */ public static final Roles CONTRIBUTOR = fromString("Contributor"); + /** + * Creates a new instance of Roles value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Roles() { + } + /** * Creates or finds a Roles from its string representation. * diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RuleSeverity.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RuleSeverity.java index 8b4f22960d69e..51bcd78788b97 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RuleSeverity.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RuleSeverity.java @@ -25,6 +25,15 @@ public final class RuleSeverity extends ExpandableStringEnum { /** Static value Obsolete for RuleSeverity. */ public static final RuleSeverity OBSOLETE = fromString("Obsolete"); + /** + * Creates a new instance of RuleSeverity value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public RuleSeverity() { + } + /** * Creates or finds a RuleSeverity from its string representation. * diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RuleStatus.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RuleStatus.java index 8c12fd7972725..28934ce8878b3 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RuleStatus.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RuleStatus.java @@ -19,6 +19,15 @@ public final class RuleStatus extends ExpandableStringEnum { /** Static value InternalError for RuleStatus. */ public static final RuleStatus INTERNAL_ERROR = fromString("InternalError"); + /** + * Creates a new instance of RuleStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public RuleStatus() { + } + /** * Creates or finds a RuleStatus from its string representation. * diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RuleType.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RuleType.java index 597ee0162474b..0a2be8577c384 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RuleType.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RuleType.java @@ -22,6 +22,15 @@ public final class RuleType extends ExpandableStringEnum { /** Static value NegativeList for RuleType. */ public static final RuleType NEGATIVE_LIST = fromString("NegativeList"); + /** + * Creates a new instance of RuleType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public RuleType() { + } + /** * Creates or finds a RuleType from its string representation. * diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ScanProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ScanProperties.java index e0cd0eb6d4fe9..13cc398281e78 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ScanProperties.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ScanProperties.java @@ -95,6 +95,12 @@ public final class ScanProperties { @JsonProperty(value = "isBaselineApplied") private Boolean isBaselineApplied; + /* + * Last scan time. + */ + @JsonProperty(value = "lastScanTime") + private OffsetDateTime lastScanTime; + /** Creates an instance of ScanProperties class. */ public ScanProperties() { } @@ -379,6 +385,26 @@ public ScanProperties withIsBaselineApplied(Boolean isBaselineApplied) { return this; } + /** + * Get the lastScanTime property: Last scan time. + * + * @return the lastScanTime value. + */ + public OffsetDateTime lastScanTime() { + return this.lastScanTime; + } + + /** + * Set the lastScanTime property: Last scan time. + * + * @param lastScanTime the lastScanTime value to set. + * @return the ScanProperties object itself. + */ + public ScanProperties withLastScanTime(OffsetDateTime lastScanTime) { + this.lastScanTime = lastScanTime; + return this; + } + /** * Validates the instance. * diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ScanState.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ScanState.java index bc4ad6e9ec4b7..be0a3069acf22 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ScanState.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ScanState.java @@ -22,6 +22,15 @@ public final class ScanState extends ExpandableStringEnum { /** Static value Passed for ScanState. */ public static final ScanState PASSED = fromString("Passed"); + /** + * Creates a new instance of ScanState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ScanState() { + } + /** * Creates or finds a ScanState from its string representation. * diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ScanTriggerType.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ScanTriggerType.java index 6ac595ee8f217..c0fd6f5e26f13 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ScanTriggerType.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ScanTriggerType.java @@ -16,6 +16,15 @@ public final class ScanTriggerType extends ExpandableStringEnum /** Static value Recurring for ScanTriggerType. */ public static final ScanTriggerType RECURRING = fromString("Recurring"); + /** + * Creates a new instance of ScanTriggerType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ScanTriggerType() { + } + /** * Creates or finds a ScanTriggerType from its string representation. * diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ScanningMode.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ScanningMode.java index 670762fe2355c..29bcdf0f13948 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ScanningMode.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ScanningMode.java @@ -13,6 +13,15 @@ public final class ScanningMode extends ExpandableStringEnum { /** Static value Default for ScanningMode. */ public static final ScanningMode DEFAULT = fromString("Default"); + /** + * Creates a new instance of ScanningMode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ScanningMode() { + } + /** * Creates or finds a ScanningMode from its string representation. * diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ScopeName.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ScopeName.java new file mode 100644 index 0000000000000..b14c4be5daac6 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ScopeName.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The resource scope of the health report. */ +public final class ScopeName extends ExpandableStringEnum { + /** Static value Connectors for ScopeName. */ + public static final ScopeName CONNECTORS = fromString("Connectors"); + + /** Static value Clusters for ScopeName. */ + public static final ScopeName CLUSTERS = fromString("Clusters"); + + /** Static value VirtualMachines for ScopeName. */ + public static final ScopeName VIRTUAL_MACHINES = fromString("VirtualMachines"); + + /** Static value Unknown for ScopeName. */ + public static final ScopeName UNKNOWN = fromString("Unknown"); + + /** + * Creates a new instance of ScopeName value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ScopeName() { + } + + /** + * Creates or finds a ScopeName from its string representation. + * + * @param name a name to look for. + * @return the corresponding ScopeName. + */ + @JsonCreator + public static ScopeName fromString(String name) { + return fromString(name, ScopeName.class); + } + + /** + * Gets known ScopeName values. + * + * @return known ScopeName values. + */ + public static Collection values() { + return values(ScopeName.class); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityConnectorGovernanceRules.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityConnectorGovernanceRules.java deleted file mode 100644 index 6b35c10b877c2..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityConnectorGovernanceRules.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; - -/** Resource collection API of SecurityConnectorGovernanceRules. */ -public interface SecurityConnectorGovernanceRules { - /** - * Get a list of all relevant governanceRules over a security connector level scope. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all relevant governanceRules over a security connector level scope as paginated response with - * {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String securityConnectorName); - - /** - * Get a list of all relevant governanceRules over a security connector level scope. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all relevant governanceRules over a security connector level scope as paginated response with - * {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String securityConnectorName, Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityConnectorGovernanceRulesExecuteStatus.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityConnectorGovernanceRulesExecuteStatus.java deleted file mode 100644 index ce51d4bd12f2d..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityConnectorGovernanceRulesExecuteStatus.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.Context; - -/** Resource collection API of SecurityConnectorGovernanceRulesExecuteStatus. */ -public interface SecurityConnectorGovernanceRulesExecuteStatus { - /** - * Get a specific governanceRule execution status for the requested scope by ruleId and operationId. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @param operationId The security GovernanceRule execution key - unique key for the execution of GovernanceRule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific governanceRule execution status for the requested scope by ruleId and operationId. - */ - ExecuteRuleStatus get(String resourceGroupName, String securityConnectorName, String ruleId, String operationId); - - /** - * Get a specific governanceRule execution status for the requested scope by ruleId and operationId. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @param operationId The security GovernanceRule execution key - unique key for the execution of GovernanceRule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific governanceRule execution status for the requested scope by ruleId and operationId. - */ - ExecuteRuleStatus get( - String resourceGroupName, String securityConnectorName, String ruleId, String operationId, Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityConnectorGovernanceRulesOperations.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityConnectorGovernanceRulesOperations.java deleted file mode 100644 index 8105ecc88148e..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityConnectorGovernanceRulesOperations.java +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.GovernanceRuleInner; - -/** Resource collection API of SecurityConnectorGovernanceRulesOperations. */ -public interface SecurityConnectorGovernanceRulesOperations { - /** - * Get a specific governanceRule for the requested scope by ruleId. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific governanceRule for the requested scope by ruleId along with {@link Response}. - */ - Response getWithResponse( - String resourceGroupName, String securityConnectorName, String ruleId, Context context); - - /** - * Get a specific governanceRule for the requested scope by ruleId. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific governanceRule for the requested scope by ruleId. - */ - GovernanceRule get(String resourceGroupName, String securityConnectorName, String ruleId); - - /** - * Creates or update a security GovernanceRule on the given security connector. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @param governanceRule GovernanceRule over a subscription scope. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security GovernanceRule over a given scope along with {@link Response}. - */ - Response createOrUpdateWithResponse( - String resourceGroupName, - String securityConnectorName, - String ruleId, - GovernanceRuleInner governanceRule, - Context context); - - /** - * Creates or update a security GovernanceRule on the given security connector. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @param governanceRule GovernanceRule over a subscription scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security GovernanceRule over a given scope. - */ - GovernanceRule createOrUpdate( - String resourceGroupName, String securityConnectorName, String ruleId, GovernanceRuleInner governanceRule); - - /** - * Delete a GovernanceRule over a given scope. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response deleteWithResponse( - String resourceGroupName, String securityConnectorName, String ruleId, Context context); - - /** - * Delete a GovernanceRule over a given scope. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void delete(String resourceGroupName, String securityConnectorName, String ruleId); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityFamily.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityFamily.java index d323f8a218185..2d7ae478887f9 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityFamily.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityFamily.java @@ -22,6 +22,15 @@ public final class SecurityFamily extends ExpandableStringEnum { /** Static value Va for SecurityFamily. */ public static final SecurityFamily VA = fromString("Va"); + /** + * Creates a new instance of SecurityFamily value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SecurityFamily() { + } + /** * Creates or finds a SecurityFamily from its string representation. * diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecuritySolutionStatus.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecuritySolutionStatus.java index 39469a2db7b9e..6b76d1d22d9a0 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecuritySolutionStatus.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecuritySolutionStatus.java @@ -16,6 +16,15 @@ public final class SecuritySolutionStatus extends ExpandableStringEnum { /** Static value AlertSyncSettings for SettingKind. */ public static final SettingKind ALERT_SYNC_SETTINGS = fromString("AlertSyncSettings"); + /** + * Creates a new instance of SettingKind value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SettingKind() { + } + /** * Creates or finds a SettingKind from its string representation. * diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SettingName.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SettingName.java index d14d9dd07de67..c07d20eb13b2f 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SettingName.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SettingName.java @@ -26,6 +26,15 @@ public final class SettingName extends ExpandableStringEnum { /** Static value Sentinel for SettingName. */ public static final SettingName SENTINEL = fromString("Sentinel"); + /** + * Creates a new instance of SettingName value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SettingName() { + } + /** * Creates or finds a SettingName from its string representation. * diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Severity.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Severity.java index f57ff1b0f3485..e7453a10d1b8f 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Severity.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Severity.java @@ -19,6 +19,15 @@ public final class Severity extends ExpandableStringEnum { /** Static value High for Severity. */ public static final Severity HIGH = fromString("High"); + /** + * Creates a new instance of Severity value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Severity() { + } + /** * Creates or finds a Severity from its string representation. * diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SeverityEnum.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SeverityEnum.java index a494a7431166f..2202ed856bf58 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SeverityEnum.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SeverityEnum.java @@ -19,6 +19,15 @@ public final class SeverityEnum extends ExpandableStringEnum { /** Static value Low for SeverityEnum. */ public static final SeverityEnum LOW = fromString("Low"); + /** + * Creates a new instance of SeverityEnum value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SeverityEnum() { + } + /** * Creates or finds a SeverityEnum from its string representation. * diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Source.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Source.java index 1182e98198a5b..daaa9fabec9b7 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Source.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Source.java @@ -19,6 +19,15 @@ public final class Source extends ExpandableStringEnum { /** Static value OnPremiseSql for Source. */ public static final Source ON_PREMISE_SQL = fromString("OnPremiseSql"); + /** + * Creates a new instance of Source value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Source() { + } + /** * Creates or finds a Source from its string representation. * diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SourceSystem.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SourceSystem.java index 35bc1f6b8fca8..092c38009856a 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SourceSystem.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SourceSystem.java @@ -25,6 +25,15 @@ public final class SourceSystem extends ExpandableStringEnum { /** Static value None for SourceSystem. */ public static final SourceSystem NONE = fromString("None"); + /** + * Creates a new instance of SourceSystem value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SourceSystem() { + } + /** * Creates or finds a SourceSystem from its string representation. * diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/State.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/State.java index 48c21bf110912..9d606016f1704 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/State.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/State.java @@ -22,6 +22,15 @@ public final class State extends ExpandableStringEnum { /** Static value Unsupported for State. */ public static final State UNSUPPORTED = fromString("Unsupported"); + /** + * Creates a new instance of State value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public State() { + } + /** * Creates or finds a State from its string representation. * diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Status.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Status.java index cdf5da0173054..30997f3be2d14 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Status.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Status.java @@ -16,6 +16,15 @@ public final class Status extends ExpandableStringEnum { /** Static value Initiated for Status. */ public static final Status INITIATED = fromString("Initiated"); + /** + * Creates a new instance of Status value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Status() { + } + /** * Creates or finds a Status from its string representation. * diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/StatusAutoGenerated.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/StatusAutoGenerated.java new file mode 100644 index 0000000000000..9332eaf6883c7 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/StatusAutoGenerated.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** The status of the health report. */ +@Fluent +public final class StatusAutoGenerated { + /* + * The status of the health report + */ + @JsonProperty(value = "code") + private StatusName code; + + /* + * The date of when the status of the health report was changed in the last time + */ + @JsonProperty(value = "statusChangeDate", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime statusChangeDate; + + /* + * The date of when the resource of the health report was scanned in the first time + */ + @JsonProperty(value = "firstEvaluationDate", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime firstEvaluationDate; + + /** Creates an instance of StatusAutoGenerated class. */ + public StatusAutoGenerated() { + } + + /** + * Get the code property: The status of the health report. + * + * @return the code value. + */ + public StatusName code() { + return this.code; + } + + /** + * Set the code property: The status of the health report. + * + * @param code the code value to set. + * @return the StatusAutoGenerated object itself. + */ + public StatusAutoGenerated withCode(StatusName code) { + this.code = code; + return this; + } + + /** + * Get the statusChangeDate property: The date of when the status of the health report was changed in the last time. + * + * @return the statusChangeDate value. + */ + public OffsetDateTime statusChangeDate() { + return this.statusChangeDate; + } + + /** + * Get the firstEvaluationDate property: The date of when the resource of the health report was scanned in the first + * time. + * + * @return the firstEvaluationDate value. + */ + public OffsetDateTime firstEvaluationDate() { + return this.firstEvaluationDate; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/StatusName.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/StatusName.java new file mode 100644 index 0000000000000..78edef2e37cdb --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/StatusName.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The status of the health report. */ +public final class StatusName extends ExpandableStringEnum { + /** Static value Healthy for StatusName. */ + public static final StatusName HEALTHY = fromString("Healthy"); + + /** Static value NotHealthy for StatusName. */ + public static final StatusName NOT_HEALTHY = fromString("NotHealthy"); + + /** Static value NotApplicable for StatusName. */ + public static final StatusName NOT_APPLICABLE = fromString("NotApplicable"); + + /** + * Creates a new instance of StatusName value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public StatusName() { + } + + /** + * Creates or finds a StatusName from its string representation. + * + * @param name a name to look for. + * @return the corresponding StatusName. + */ + @JsonCreator + public static StatusName fromString(String name) { + return fromString(name, StatusName.class); + } + + /** + * Gets known StatusName values. + * + * @return known StatusName values. + */ + public static Collection values() { + return values(StatusName.class); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/StatusReason.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/StatusReason.java index 81b2a8d3472b1..91be264a363f5 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/StatusReason.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/StatusReason.java @@ -19,6 +19,15 @@ public final class StatusReason extends ExpandableStringEnum { /** Static value NewerRequestInitiated for StatusReason. */ public static final StatusReason NEWER_REQUEST_INITIATED = fromString("NewerRequestInitiated"); + /** + * Creates a new instance of StatusReason value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public StatusReason() { + } + /** * Creates or finds a StatusReason from its string representation. * diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SubAssessmentStatusCode.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SubAssessmentStatusCode.java index a7eb47fc6c9d7..9b82da2254333 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SubAssessmentStatusCode.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SubAssessmentStatusCode.java @@ -19,6 +19,15 @@ public final class SubAssessmentStatusCode extends ExpandableStringEnum { /** Static value P2 for SubPlan. */ public static final SubPlan P2 = fromString("P2"); + /** + * Creates a new instance of SubPlan value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SubPlan() { + } + /** * Creates or finds a SubPlan from its string representation. * diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SubscriptionGovernanceRulesExecuteStatus.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SubscriptionGovernanceRulesExecuteStatus.java deleted file mode 100644 index 9fa71ca25484e..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SubscriptionGovernanceRulesExecuteStatus.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.Context; - -/** Resource collection API of SubscriptionGovernanceRulesExecuteStatus. */ -public interface SubscriptionGovernanceRulesExecuteStatus { - /** - * Get a specific governanceRule execution status for the requested scope by ruleId and operationId. - * - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @param operationId The security GovernanceRule execution key - unique key for the execution of GovernanceRule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific governanceRule execution status for the requested scope by ruleId and operationId. - */ - ExecuteRuleStatus get(String ruleId, String operationId); - - /** - * Get a specific governanceRule execution status for the requested scope by ruleId and operationId. - * - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @param operationId The security GovernanceRule execution key - unique key for the execution of GovernanceRule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific governanceRule execution status for the requested scope by ruleId and operationId. - */ - ExecuteRuleStatus get(String ruleId, String operationId, Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SupportedCloudEnum.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SupportedCloudEnum.java index 8e2923b2f39b2..b8013fad05edf 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SupportedCloudEnum.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SupportedCloudEnum.java @@ -16,6 +16,15 @@ public final class SupportedCloudEnum extends ExpandableStringEnum { /** Static value Impact for Tactics. */ public static final Tactics IMPACT = fromString("Impact"); + /** + * Creates a new instance of Tactics value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Tactics() { + } + /** * Creates or finds a Tactics from its string representation. * diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/TaskUpdateActionType.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/TaskUpdateActionType.java index 7d2ab405fbd26..3db786c081d20 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/TaskUpdateActionType.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/TaskUpdateActionType.java @@ -25,6 +25,15 @@ public final class TaskUpdateActionType extends ExpandableStringEnum { public static final Techniques FILE_AND_DIRECTORY_PERMISSIONS_MODIFICATION = fromString("File and Directory Permissions Modification"); + /** + * Creates a new instance of Techniques value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Techniques() { + } + /** * Creates or finds a Techniques from its string representation. * diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Threats.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Threats.java index 862130ea347e8..de2c64b423473 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Threats.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Threats.java @@ -34,6 +34,15 @@ public final class Threats extends ExpandableStringEnum { /** Static value denialOfService for Threats. */ public static final Threats DENIAL_OF_SERVICE = fromString("denialOfService"); + /** + * Creates a new instance of Threats value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Threats() { + } + /** * Creates or finds a Threats from its string representation. * diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/TransportProtocol.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/TransportProtocol.java index fbe1dd4c0203e..b2ac098057551 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/TransportProtocol.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/TransportProtocol.java @@ -16,6 +16,15 @@ public final class TransportProtocol extends ExpandableStringEnum { /** Static value TVM for Type. */ public static final Type TVM = fromString("TVM"); + /** + * Creates a new instance of Type value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Type() { + } + /** * Creates or finds a Type from its string representation. * diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/UnmaskedIpLoggingStatus.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/UnmaskedIpLoggingStatus.java index d29302edd7990..b1888b57a29bc 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/UnmaskedIpLoggingStatus.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/UnmaskedIpLoggingStatus.java @@ -16,6 +16,15 @@ public final class UnmaskedIpLoggingStatus extends ExpandableStringEnum { /** Static value High for UserImpact. */ public static final UserImpact HIGH = fromString("High"); + /** + * Creates a new instance of UserImpact value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public UserImpact() { + } + /** * Creates or finds a UserImpact from its string representation. * diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ValueType.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ValueType.java index 646cd0fcc3410..dd486682d0c16 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ValueType.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ValueType.java @@ -16,6 +16,15 @@ public final class ValueType extends ExpandableStringEnum { /** Static value String for ValueType. */ public static final ValueType STRING = fromString("String"); + /** + * Creates a new instance of ValueType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ValueType() { + } + /** * Creates or finds a ValueType from its string representation. * diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AdaptiveApplicationControlsDeleteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AdaptiveApplicationControlsDeleteSamples.java index 58a86e421a304..7dad0c29f87fc 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AdaptiveApplicationControlsDeleteSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AdaptiveApplicationControlsDeleteSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for AdaptiveApplicationControls Delete. */ public final class AdaptiveApplicationControlsDeleteSamples { /* @@ -18,6 +16,8 @@ public final class AdaptiveApplicationControlsDeleteSamples { */ public static void deleteAnApplicationControlMachineGroup( com.azure.resourcemanager.security.SecurityManager manager) { - manager.adaptiveApplicationControls().deleteByResourceGroupWithResponse("centralus", "GROUP1", Context.NONE); + manager + .adaptiveApplicationControls() + .deleteByResourceGroupWithResponse("centralus", "GROUP1", com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AdaptiveApplicationControlsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AdaptiveApplicationControlsGetSamples.java index 2548b745ba18b..c7c0a57ce4290 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AdaptiveApplicationControlsGetSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AdaptiveApplicationControlsGetSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for AdaptiveApplicationControls Get. */ public final class AdaptiveApplicationControlsGetSamples { /* @@ -18,6 +16,8 @@ public final class AdaptiveApplicationControlsGetSamples { */ public static void getsAConfiguredApplicationControlVMServerGroup( com.azure.resourcemanager.security.SecurityManager manager) { - manager.adaptiveApplicationControls().getWithResponse("centralus", "ERELGROUP1", Context.NONE); + manager + .adaptiveApplicationControls() + .getWithResponse("centralus", "ERELGROUP1", com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AdaptiveApplicationControlsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AdaptiveApplicationControlsListSamples.java index 6f0682f726abb..f10d7ae3dbbc6 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AdaptiveApplicationControlsListSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AdaptiveApplicationControlsListSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for AdaptiveApplicationControls List. */ public final class AdaptiveApplicationControlsListSamples { /* @@ -18,6 +16,6 @@ public final class AdaptiveApplicationControlsListSamples { */ public static void getsAListOfApplicationControlGroupsOfMachinesForTheSubscription( com.azure.resourcemanager.security.SecurityManager manager) { - manager.adaptiveApplicationControls().listWithResponse(true, false, Context.NONE); + manager.adaptiveApplicationControls().listWithResponse(true, false, com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AdaptiveApplicationControlsPutSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AdaptiveApplicationControlsPutSamples.java index 81d96bb3dcc25..978819ba310b1 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AdaptiveApplicationControlsPutSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AdaptiveApplicationControlsPutSamples.java @@ -4,7 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; import com.azure.resourcemanager.security.models.AdaptiveApplicationControlGroup; import com.azure.resourcemanager.security.models.ConfigurationStatus; import com.azure.resourcemanager.security.models.EnforcementMode; @@ -32,7 +31,10 @@ public final class AdaptiveApplicationControlsPutSamples { public static void updateAnApplicationControlMachineGroupByAddingANewApplication( com.azure.resourcemanager.security.SecurityManager manager) { AdaptiveApplicationControlGroup resource = - manager.adaptiveApplicationControls().getWithResponse("centralus", "ERELGROUP1", Context.NONE).getValue(); + manager + .adaptiveApplicationControls() + .getWithResponse("centralus", "ERELGROUP1", com.azure.core.util.Context.NONE) + .getValue(); resource .update() .withEnforcementMode(EnforcementMode.AUDIT) diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AdaptiveNetworkHardeningsEnforceSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AdaptiveNetworkHardeningsEnforceSamples.java index cd4112b4a13be..69905511b7b9d 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AdaptiveNetworkHardeningsEnforceSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AdaptiveNetworkHardeningsEnforceSamples.java @@ -4,7 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; import com.azure.resourcemanager.security.models.AdaptiveNetworkHardeningEnforceRequest; import com.azure.resourcemanager.security.models.Direction; import com.azure.resourcemanager.security.models.Rule; @@ -52,6 +51,6 @@ public static void enforcesTheGivenRulesOnTheNSGSListedInTheRequest( .asList( "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg1", "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/rg2/providers/Microsoft.Network/networkSecurityGroups/nsg2")), - Context.NONE); + com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AdaptiveNetworkHardeningsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AdaptiveNetworkHardeningsGetSamples.java index c4b72d5960273..d14b4b39facef 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AdaptiveNetworkHardeningsGetSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AdaptiveNetworkHardeningsGetSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for AdaptiveNetworkHardenings Get. */ public final class AdaptiveNetworkHardeningsGetSamples { /* @@ -20,6 +18,7 @@ public static void getASingleAdaptiveNetworkHardeningResource( com.azure.resourcemanager.security.SecurityManager manager) { manager .adaptiveNetworkHardenings() - .getWithResponse("rg1", "Microsoft.Compute", "virtualMachines", "vm1", "default", Context.NONE); + .getWithResponse( + "rg1", "Microsoft.Compute", "virtualMachines", "vm1", "default", com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AdaptiveNetworkHardeningsListByExtendedResourceSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AdaptiveNetworkHardeningsListByExtendedResourceSamples.java index fecd6e07dc2ab..32fd0bdd4930b 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AdaptiveNetworkHardeningsListByExtendedResourceSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AdaptiveNetworkHardeningsListByExtendedResourceSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for AdaptiveNetworkHardenings ListByExtendedResource. */ public final class AdaptiveNetworkHardeningsListByExtendedResourceSamples { /* @@ -20,6 +18,7 @@ public static void listAdaptiveNetworkHardeningsResourcesOfAnExtendedResource( com.azure.resourcemanager.security.SecurityManager manager) { manager .adaptiveNetworkHardenings() - .listByExtendedResource("rg1", "Microsoft.Compute", "virtualMachines", "vm1", Context.NONE); + .listByExtendedResource( + "rg1", "Microsoft.Compute", "virtualMachines", "vm1", com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AdvancedThreatProtectionGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AdvancedThreatProtectionGetSamples.java index 06e287187a1d2..07fdc03ea9759 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AdvancedThreatProtectionGetSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AdvancedThreatProtectionGetSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for AdvancedThreatProtection Get. */ public final class AdvancedThreatProtectionGetSamples { /* @@ -22,6 +20,6 @@ public static void getsTheAdvancedThreatProtectionSettingsForTheSpecifiedResourc .advancedThreatProtections() .getWithResponse( "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Storage/storageAccounts/samplestorageaccount", - Context.NONE); + com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsGetResourceGroupLevelSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsGetResourceGroupLevelSamples.java index eaea6bd0f8419..952df50d555a8 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsGetResourceGroupLevelSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsGetResourceGroupLevelSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for Alerts GetResourceGroupLevel. */ public final class AlertsGetResourceGroupLevelSamples { /* @@ -21,6 +19,9 @@ public static void getSecurityAlertOnAResourceGroupFromASecurityDataLocation( manager .alerts() .getResourceGroupLevelWithResponse( - "myRg1", "westeurope", "2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a", Context.NONE); + "myRg1", + "westeurope", + "2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a", + com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsGetSubscriptionLevelSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsGetSubscriptionLevelSamples.java index 4e2256051d2f7..9f74230436774 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsGetSubscriptionLevelSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsGetSubscriptionLevelSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for Alerts GetSubscriptionLevel. */ public final class AlertsGetSubscriptionLevelSamples { /* @@ -21,6 +19,8 @@ public static void getSecurityAlertOnASubscriptionFromASecurityDataLocation( manager .alerts() .getSubscriptionLevelWithResponse( - "westeurope", "2518770965529163669_F144EE95-A3E5-42DA-A279-967D115809AA", Context.NONE); + "westeurope", + "2518770965529163669_F144EE95-A3E5-42DA-A279-967D115809AA", + com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsListByResourceGroupSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsListByResourceGroupSamples.java index ff0ba50d21a2b..60d9a3ab767a7 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsListByResourceGroupSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsListByResourceGroupSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for Alerts ListByResourceGroup. */ public final class AlertsListByResourceGroupSamples { /* @@ -17,6 +15,6 @@ public final class AlertsListByResourceGroupSamples { * @param manager Entry point to SecurityManager. */ public static void getSecurityAlertsOnAResourceGroup(com.azure.resourcemanager.security.SecurityManager manager) { - manager.alerts().listByResourceGroup("myRg1", Context.NONE); + manager.alerts().listByResourceGroup("myRg1", com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsListResourceGroupLevelByRegionSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsListResourceGroupLevelByRegionSamples.java index 574052bfe342e..05ab47528d2ac 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsListResourceGroupLevelByRegionSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsListResourceGroupLevelByRegionSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for Alerts ListResourceGroupLevelByRegion. */ public final class AlertsListResourceGroupLevelByRegionSamples { /* @@ -18,6 +16,6 @@ public final class AlertsListResourceGroupLevelByRegionSamples { */ public static void getSecurityAlertsOnAResourceGroupFromASecurityDataLocation( com.azure.resourcemanager.security.SecurityManager manager) { - manager.alerts().listResourceGroupLevelByRegion("westeurope", "myRg1", Context.NONE); + manager.alerts().listResourceGroupLevelByRegion("westeurope", "myRg1", com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsListSamples.java index 11663e6d08e35..7c54817f6302a 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsListSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsListSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for Alerts List. */ public final class AlertsListSamples { /* @@ -17,6 +15,6 @@ public final class AlertsListSamples { * @param manager Entry point to SecurityManager. */ public static void getSecurityAlertsOnASubscription(com.azure.resourcemanager.security.SecurityManager manager) { - manager.alerts().list(Context.NONE); + manager.alerts().list(com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsListSubscriptionLevelByRegionSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsListSubscriptionLevelByRegionSamples.java index 4d01171908789..c65e44da04b31 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsListSubscriptionLevelByRegionSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsListSubscriptionLevelByRegionSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for Alerts ListSubscriptionLevelByRegion. */ public final class AlertsListSubscriptionLevelByRegionSamples { /* @@ -18,6 +16,6 @@ public final class AlertsListSubscriptionLevelByRegionSamples { */ public static void getSecurityAlertsOnASubscriptionFromASecurityDataLocation( com.azure.resourcemanager.security.SecurityManager manager) { - manager.alerts().listSubscriptionLevelByRegion("westeurope", Context.NONE); + manager.alerts().listSubscriptionLevelByRegion("westeurope", com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsSimulateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsSimulateSamples.java index b8e33ed28b302..cebb570236a8e 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsSimulateSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsSimulateSamples.java @@ -4,7 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; import com.azure.resourcemanager.security.models.AlertSimulatorBundlesRequestProperties; import com.azure.resourcemanager.security.models.AlertSimulatorRequestBody; import com.azure.resourcemanager.security.models.BundleType; @@ -41,6 +40,6 @@ public static void simulateSecurityAlertsOnASubscription( BundleType.STORAGE_ACCOUNTS, BundleType.VIRTUAL_MACHINES, BundleType.COSMOS_DBS))), - Context.NONE); + com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsSuppressionRulesDeleteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsSuppressionRulesDeleteSamples.java index 60048a128b184..569975501b144 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsSuppressionRulesDeleteSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsSuppressionRulesDeleteSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for AlertsSuppressionRules Delete. */ public final class AlertsSuppressionRulesDeleteSamples { /* @@ -18,6 +16,6 @@ public final class AlertsSuppressionRulesDeleteSamples { */ public static void deleteSuppressionRuleDataForASubscription( com.azure.resourcemanager.security.SecurityManager manager) { - manager.alertsSuppressionRules().deleteWithResponse("dismissIpAnomalyAlerts", Context.NONE); + manager.alertsSuppressionRules().deleteWithResponse("dismissIpAnomalyAlerts", com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsSuppressionRulesGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsSuppressionRulesGetSamples.java index e6f52de5e4398..c846ef7358471 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsSuppressionRulesGetSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsSuppressionRulesGetSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for AlertsSuppressionRules Get. */ public final class AlertsSuppressionRulesGetSamples { /* @@ -18,6 +16,6 @@ public final class AlertsSuppressionRulesGetSamples { */ public static void getSuppressionAlertRuleForSubscription( com.azure.resourcemanager.security.SecurityManager manager) { - manager.alertsSuppressionRules().getWithResponse("dismissIpAnomalyAlerts", Context.NONE); + manager.alertsSuppressionRules().getWithResponse("dismissIpAnomalyAlerts", com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsSuppressionRulesListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsSuppressionRulesListSamples.java index ecdedac4572d8..a38d3a433c1f7 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsSuppressionRulesListSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsSuppressionRulesListSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for AlertsSuppressionRules List. */ public final class AlertsSuppressionRulesListSamples { /* @@ -17,7 +15,7 @@ public final class AlertsSuppressionRulesListSamples { * @param manager Entry point to SecurityManager. */ public static void getSuppressionRulesForSubscription(com.azure.resourcemanager.security.SecurityManager manager) { - manager.alertsSuppressionRules().list(null, Context.NONE); + manager.alertsSuppressionRules().list(null, com.azure.core.util.Context.NONE); } /* @@ -30,6 +28,6 @@ public static void getSuppressionRulesForSubscription(com.azure.resourcemanager. */ public static void getSuppressionAlertRuleForSubscriptionFilteredByAlertType( com.azure.resourcemanager.security.SecurityManager manager) { - manager.alertsSuppressionRules().list("IpAnomaly", Context.NONE); + manager.alertsSuppressionRules().list("IpAnomaly", com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsSuppressionRulesUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsSuppressionRulesUpdateSamples.java index 166a570d48a94..ec5c5a7887c0a 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsSuppressionRulesUpdateSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsSuppressionRulesUpdateSamples.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.security.generated; import com.azure.core.management.serializer.SerializerFactory; -import com.azure.core.util.Context; import com.azure.core.util.serializer.SerializerEncoding; import com.azure.resourcemanager.security.fluent.models.AlertsSuppressionRuleInner; import com.azure.resourcemanager.security.models.RuleState; @@ -58,7 +57,7 @@ public static void updateOrCreateSuppressionRuleForSubscription( new ScopeElement() .withField("entities.process.commandline") .withAdditionalProperties(mapOf("contains", "POWERSHELL.EXE"))))), - Context.NONE); + com.azure.core.util.Context.NONE); } @SuppressWarnings("unchecked") diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsUpdateResourceGroupLevelStateToActivateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsUpdateResourceGroupLevelStateToActivateSamples.java index 5d4105816fa10..790c4c6bfce98 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsUpdateResourceGroupLevelStateToActivateSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsUpdateResourceGroupLevelStateToActivateSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for Alerts UpdateResourceGroupLevelStateToActivate. */ public final class AlertsUpdateResourceGroupLevelStateToActivateSamples { /* @@ -21,6 +19,9 @@ public static void updateSecurityAlertStateOnAResourceGroupFromASecurityDataLoca manager .alerts() .updateResourceGroupLevelStateToActivateWithResponse( - "myRg2", "westeurope", "2518765996949954086_2325cf9e-42a2-4f72-ae7f-9b863cba2d22", Context.NONE); + "myRg2", + "westeurope", + "2518765996949954086_2325cf9e-42a2-4f72-ae7f-9b863cba2d22", + com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsUpdateResourceGroupLevelStateToDismissSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsUpdateResourceGroupLevelStateToDismissSamples.java index 8a972e5ca9a2c..f241dcebf3c68 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsUpdateResourceGroupLevelStateToDismissSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsUpdateResourceGroupLevelStateToDismissSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for Alerts UpdateResourceGroupLevelStateToDismiss. */ public final class AlertsUpdateResourceGroupLevelStateToDismissSamples { /* @@ -21,6 +19,9 @@ public static void updateSecurityAlertStateOnAResourceGroupFromASecurityDataLoca manager .alerts() .updateResourceGroupLevelStateToDismissWithResponse( - "myRg2", "westeurope", "2518765996949954086_2325cf9e-42a2-4f72-ae7f-9b863cba2d22", Context.NONE); + "myRg2", + "westeurope", + "2518765996949954086_2325cf9e-42a2-4f72-ae7f-9b863cba2d22", + com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsUpdateResourceGroupLevelStateToInProgressSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsUpdateResourceGroupLevelStateToInProgressSamples.java index d02213b7031a7..40ecdf0a423b6 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsUpdateResourceGroupLevelStateToInProgressSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsUpdateResourceGroupLevelStateToInProgressSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for Alerts UpdateResourceGroupLevelStateToInProgress. */ public final class AlertsUpdateResourceGroupLevelStateToInProgressSamples { /* @@ -21,6 +19,9 @@ public static void updateSecurityAlertStateOnAResourceGroupFromASecurityDataLoca manager .alerts() .updateResourceGroupLevelStateToInProgressWithResponse( - "myRg2", "westeurope", "2518765996949954086_2325cf9e-42a2-4f72-ae7f-9b863cba2d22", Context.NONE); + "myRg2", + "westeurope", + "2518765996949954086_2325cf9e-42a2-4f72-ae7f-9b863cba2d22", + com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsUpdateResourceGroupLevelStateToResolveSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsUpdateResourceGroupLevelStateToResolveSamples.java index 47bf66e50405d..6cdc7da263909 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsUpdateResourceGroupLevelStateToResolveSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsUpdateResourceGroupLevelStateToResolveSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for Alerts UpdateResourceGroupLevelStateToResolve. */ public final class AlertsUpdateResourceGroupLevelStateToResolveSamples { /* @@ -21,6 +19,9 @@ public static void updateSecurityAlertStateOnAResourceGroupFromASecurityDataLoca manager .alerts() .updateResourceGroupLevelStateToResolveWithResponse( - "myRg2", "westeurope", "2518765996949954086_2325cf9e-42a2-4f72-ae7f-9b863cba2d22", Context.NONE); + "myRg2", + "westeurope", + "2518765996949954086_2325cf9e-42a2-4f72-ae7f-9b863cba2d22", + com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsUpdateSubscriptionLevelStateToActivateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsUpdateSubscriptionLevelStateToActivateSamples.java index 00665ed60170d..3a3688aaa0599 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsUpdateSubscriptionLevelStateToActivateSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsUpdateSubscriptionLevelStateToActivateSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for Alerts UpdateSubscriptionLevelStateToActivate. */ public final class AlertsUpdateSubscriptionLevelStateToActivateSamples { /* @@ -21,6 +19,8 @@ public static void updateSecurityAlertStateOnASubscriptionFromASecurityDataLocat manager .alerts() .updateSubscriptionLevelStateToActivateWithResponse( - "westeurope", "2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a", Context.NONE); + "westeurope", + "2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a", + com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsUpdateSubscriptionLevelStateToDismissSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsUpdateSubscriptionLevelStateToDismissSamples.java index 46a57eb48dbc8..36390c329158c 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsUpdateSubscriptionLevelStateToDismissSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsUpdateSubscriptionLevelStateToDismissSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for Alerts UpdateSubscriptionLevelStateToDismiss. */ public final class AlertsUpdateSubscriptionLevelStateToDismissSamples { /* @@ -21,6 +19,8 @@ public static void updateSecurityAlertStateOnASubscriptionFromASecurityDataLocat manager .alerts() .updateSubscriptionLevelStateToDismissWithResponse( - "westeurope", "2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a", Context.NONE); + "westeurope", + "2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a", + com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsUpdateSubscriptionLevelStateToInProgressSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsUpdateSubscriptionLevelStateToInProgressSamples.java index 79bcd21fd2ae1..91aa9435bf839 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsUpdateSubscriptionLevelStateToInProgressSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsUpdateSubscriptionLevelStateToInProgressSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for Alerts UpdateSubscriptionLevelStateToInProgress. */ public final class AlertsUpdateSubscriptionLevelStateToInProgressSamples { /* @@ -21,6 +19,8 @@ public static void updateSecurityAlertStateOnASubscriptionFromASecurityDataLocat manager .alerts() .updateSubscriptionLevelStateToInProgressWithResponse( - "westeurope", "2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a", Context.NONE); + "westeurope", + "2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a", + com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsUpdateSubscriptionLevelStateToResolveSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsUpdateSubscriptionLevelStateToResolveSamples.java index 70553942c10d8..824aaf51e636a 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsUpdateSubscriptionLevelStateToResolveSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsUpdateSubscriptionLevelStateToResolveSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for Alerts UpdateSubscriptionLevelStateToResolve. */ public final class AlertsUpdateSubscriptionLevelStateToResolveSamples { /* @@ -21,6 +19,8 @@ public static void updateSecurityAlertStateOnASubscriptionFromASecurityDataLocat manager .alerts() .updateSubscriptionLevelStateToResolveWithResponse( - "westeurope", "2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a", Context.NONE); + "westeurope", + "2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a", + com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AllowedConnectionsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AllowedConnectionsGetSamples.java index b10b261522014..0f2261cdc99f1 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AllowedConnectionsGetSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AllowedConnectionsGetSamples.java @@ -4,7 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; import com.azure.resourcemanager.security.models.ConnectionType; /** Samples for AllowedConnections Get. */ @@ -20,6 +19,6 @@ public final class AllowedConnectionsGetSamples { public static void getAllowedConnections(com.azure.resourcemanager.security.SecurityManager manager) { manager .allowedConnections() - .getWithResponse("myResourceGroup", "centralus", ConnectionType.INTERNAL, Context.NONE); + .getWithResponse("myResourceGroup", "centralus", ConnectionType.INTERNAL, com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AllowedConnectionsListByHomeRegionSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AllowedConnectionsListByHomeRegionSamples.java index bbd75213fa549..c23bc1bb5ae7b 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AllowedConnectionsListByHomeRegionSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AllowedConnectionsListByHomeRegionSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for AllowedConnections ListByHomeRegion. */ public final class AllowedConnectionsListByHomeRegionSamples { /* @@ -18,6 +16,6 @@ public final class AllowedConnectionsListByHomeRegionSamples { */ public static void getAllowedConnectionsOnASubscriptionFromSecurityDataLocation( com.azure.resourcemanager.security.SecurityManager manager) { - manager.allowedConnections().listByHomeRegion("centralus", Context.NONE); + manager.allowedConnections().listByHomeRegion("centralus", com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AllowedConnectionsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AllowedConnectionsListSamples.java index 2bda8c34c7c01..be7943d2ab122 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AllowedConnectionsListSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AllowedConnectionsListSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for AllowedConnections List. */ public final class AllowedConnectionsListSamples { /* @@ -18,6 +16,6 @@ public final class AllowedConnectionsListSamples { */ public static void getAllowedConnectionsOnASubscription( com.azure.resourcemanager.security.SecurityManager manager) { - manager.allowedConnections().list(Context.NONE); + manager.allowedConnections().list(com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApiCollectionGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApiCollectionGetSamples.java index a8266d2f7a2b3..91a9efb5966ee 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApiCollectionGetSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApiCollectionGetSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for ApiCollection Get. */ public final class ApiCollectionGetSamples { /* @@ -18,6 +16,6 @@ public final class ApiCollectionGetSamples { */ public static void getsAnAzureAPIManagementAPIIfItHasBeenOnboardedToDefenderForAPIs( com.azure.resourcemanager.security.SecurityManager manager) { - manager.apiCollections().getWithResponse("rg1", "apimService1", "echo-api", Context.NONE); + manager.apiCollections().getWithResponse("rg1", "apimService1", "echo-api", com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApiCollectionListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApiCollectionListSamples.java index 7400f6ef75b4d..2dcb3c2a2e388 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApiCollectionListSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApiCollectionListSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for ApiCollection List. */ public final class ApiCollectionListSamples { /* @@ -18,6 +16,6 @@ public final class ApiCollectionListSamples { */ public static void getsAListOfAzureAPIManagementAPIsThatHaveBeenOnboardedToDefenderForAPIs( com.azure.resourcemanager.security.SecurityManager manager) { - manager.apiCollections().list("rg1", "apimService1", Context.NONE); + manager.apiCollections().list("rg1", "apimService1", com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApiCollectionOffboardingDeleteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApiCollectionOffboardingDeleteSamples.java index 373aaad01332f..cd679b4b46aa0 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApiCollectionOffboardingDeleteSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApiCollectionOffboardingDeleteSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for ApiCollectionOffboarding Delete. */ public final class ApiCollectionOffboardingDeleteSamples { /* @@ -18,6 +16,8 @@ public final class ApiCollectionOffboardingDeleteSamples { */ public static void deleteASecurityRecommendationTaskOnAResource( com.azure.resourcemanager.security.SecurityManager manager) { - manager.apiCollectionOffboardings().deleteWithResponse("rg1", "apimService1", "echo-api", Context.NONE); + manager + .apiCollectionOffboardings() + .deleteWithResponse("rg1", "apimService1", "echo-api", com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApiCollectionOnboardingCreateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApiCollectionOnboardingCreateSamples.java index 8babfd3c48cea..14342e5bb6eb1 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApiCollectionOnboardingCreateSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApiCollectionOnboardingCreateSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for ApiCollectionOnboarding Create. */ public final class ApiCollectionOnboardingCreateSamples { /* @@ -18,6 +16,8 @@ public final class ApiCollectionOnboardingCreateSamples { */ public static void onboardAnAzureAPIManagementAPIToDefenderForAPIs( com.azure.resourcemanager.security.SecurityManager manager) { - manager.apiCollectionOnboardings().createWithResponse("rg1", "apimService1", "echo-api", Context.NONE); + manager + .apiCollectionOnboardings() + .createWithResponse("rg1", "apimService1", "echo-api", com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApplicationOperationDeleteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApplicationOperationDeleteSamples.java index aaf99b5794229..b5240718d70d1 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApplicationOperationDeleteSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApplicationOperationDeleteSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for ApplicationOperation Delete. */ public final class ApplicationOperationDeleteSamples { /* @@ -17,6 +15,8 @@ public final class ApplicationOperationDeleteSamples { * @param manager Entry point to SecurityManager. */ public static void deleteSecurityApplication(com.azure.resourcemanager.security.SecurityManager manager) { - manager.applicationOperations().deleteWithResponse("ad9a8e26-29d9-4829-bb30-e597a58cdbb8", Context.NONE); + manager + .applicationOperations() + .deleteWithResponse("ad9a8e26-29d9-4829-bb30-e597a58cdbb8", com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApplicationOperationGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApplicationOperationGetSamples.java index 04e422cfb5b97..7254278291e10 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApplicationOperationGetSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApplicationOperationGetSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for ApplicationOperation Get. */ public final class ApplicationOperationGetSamples { /* @@ -18,6 +16,8 @@ public final class ApplicationOperationGetSamples { */ public static void getSecurityApplicationBySpecificApplicationId( com.azure.resourcemanager.security.SecurityManager manager) { - manager.applicationOperations().getWithResponse("ad9a8e26-29d9-4829-bb30-e597a58cdbb8", Context.NONE); + manager + .applicationOperations() + .getWithResponse("ad9a8e26-29d9-4829-bb30-e597a58cdbb8", com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApplicationsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApplicationsListSamples.java index 41988ef0abc12..f3c3cd97e2c5c 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApplicationsListSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApplicationsListSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for Applications List. */ public final class ApplicationsListSamples { /* @@ -18,6 +16,6 @@ public final class ApplicationsListSamples { */ public static void listApplicationsSecurityBySubscriptionLevelScope( com.azure.resourcemanager.security.SecurityManager manager) { - manager.applications().list(Context.NONE); + manager.applications().list(com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsDeleteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsDeleteSamples.java index 92a35350d0924..2e0f60dde9d09 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsDeleteSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsDeleteSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for Assessments Delete. */ public final class AssessmentsDeleteSamples { /* @@ -23,6 +21,6 @@ public static void deleteASecurityRecommendationTaskOnAResource( .deleteByResourceGroupWithResponse( "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachineScaleSets/vmss2", "8bb8be0a-6010-4789-812f-e4d661c4ed0e", - Context.NONE); + com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsGetSamples.java index 488d0df6e4995..a81c28cd3e70a 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsGetSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsGetSamples.java @@ -4,7 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; import com.azure.resourcemanager.security.models.ExpandEnum; /** Samples for Assessments Get. */ @@ -25,7 +24,7 @@ public static void getSecurityRecommendationTaskFromSecurityDataLocationWithExpa "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachineScaleSets/vmss2", "21300918-b2e3-0346-785f-c77ff57d243b", ExpandEnum.LINKS, - Context.NONE); + com.azure.core.util.Context.NONE); } /* @@ -44,6 +43,6 @@ public static void getSecurityRecommendationTaskFromSecurityDataLocation( "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachineScaleSets/vmss2", "21300918-b2e3-0346-785f-c77ff57d243b", null, - Context.NONE); + com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsListSamples.java index 2f5ba8c60f8c9..fddca63d44264 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsListSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsListSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for Assessments List. */ public final class AssessmentsListSamples { /* @@ -17,6 +15,8 @@ public final class AssessmentsListSamples { * @param manager Entry point to SecurityManager. */ public static void listSecurityAssessments(com.azure.resourcemanager.security.SecurityManager manager) { - manager.assessments().list("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", Context.NONE); + manager + .assessments() + .list("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsMetadataDeleteInSubscriptionSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsMetadataDeleteInSubscriptionSamples.java index 4ff6c8c563b8b..63884b1c80c30 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsMetadataDeleteInSubscriptionSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsMetadataDeleteInSubscriptionSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for AssessmentsMetadata DeleteInSubscription. */ public final class AssessmentsMetadataDeleteInSubscriptionSamples { /* @@ -20,6 +18,6 @@ public static void deleteASecurityAssessmentMetadataForSubscription( com.azure.resourcemanager.security.SecurityManager manager) { manager .assessmentsMetadatas() - .deleteInSubscriptionWithResponse("ca039e75-a276-4175-aebc-bcd41e4b14b7", Context.NONE); + .deleteInSubscriptionWithResponse("ca039e75-a276-4175-aebc-bcd41e4b14b7", com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsMetadataGetInSubscriptionSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsMetadataGetInSubscriptionSamples.java index 96a76d72463a4..0f7e228b9cc21 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsMetadataGetInSubscriptionSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsMetadataGetInSubscriptionSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for AssessmentsMetadata GetInSubscription. */ public final class AssessmentsMetadataGetInSubscriptionSamples { /* @@ -20,6 +18,6 @@ public static void getSecurityAssessmentMetadataForSubscription( com.azure.resourcemanager.security.SecurityManager manager) { manager .assessmentsMetadatas() - .getInSubscriptionWithResponse("21300918-b2e3-0346-785f-c77ff57d243b", Context.NONE); + .getInSubscriptionWithResponse("21300918-b2e3-0346-785f-c77ff57d243b", com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsMetadataGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsMetadataGetSamples.java index a60a33657bbf5..2ea20e106553e 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsMetadataGetSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsMetadataGetSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for AssessmentsMetadata Get. */ public final class AssessmentsMetadataGetSamples { /* @@ -17,6 +15,8 @@ public final class AssessmentsMetadataGetSamples { * @param manager Entry point to SecurityManager. */ public static void getSecurityAssessmentMetadata(com.azure.resourcemanager.security.SecurityManager manager) { - manager.assessmentsMetadatas().getWithResponse("21300918-b2e3-0346-785f-c77ff57d243b", Context.NONE); + manager + .assessmentsMetadatas() + .getWithResponse("21300918-b2e3-0346-785f-c77ff57d243b", com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsMetadataListBySubscriptionSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsMetadataListBySubscriptionSamples.java index 516213e0e7e23..529cd708667ec 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsMetadataListBySubscriptionSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsMetadataListBySubscriptionSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for AssessmentsMetadata ListBySubscription. */ public final class AssessmentsMetadataListBySubscriptionSamples { /* @@ -18,6 +16,6 @@ public final class AssessmentsMetadataListBySubscriptionSamples { */ public static void listSecurityAssessmentMetadataForSubscription( com.azure.resourcemanager.security.SecurityManager manager) { - manager.assessmentsMetadatas().listBySubscription(Context.NONE); + manager.assessmentsMetadatas().listBySubscription(com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsMetadataListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsMetadataListSamples.java index 50d946d45a062..0f6d1e92fab48 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsMetadataListSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsMetadataListSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for AssessmentsMetadata List. */ public final class AssessmentsMetadataListSamples { /* @@ -17,6 +15,6 @@ public final class AssessmentsMetadataListSamples { * @param manager Entry point to SecurityManager. */ public static void listSecurityAssessmentMetadata(com.azure.resourcemanager.security.SecurityManager manager) { - manager.assessmentsMetadatas().list(Context.NONE); + manager.assessmentsMetadatas().list(com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutoProvisioningSettingsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutoProvisioningSettingsGetSamples.java index 3d26e6c9be8f7..2e2d1d057a8dc 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutoProvisioningSettingsGetSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutoProvisioningSettingsGetSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for AutoProvisioningSettings Get. */ public final class AutoProvisioningSettingsGetSamples { /* @@ -18,6 +16,6 @@ public final class AutoProvisioningSettingsGetSamples { */ public static void getAnAutoProvisioningSettingForSubscription( com.azure.resourcemanager.security.SecurityManager manager) { - manager.autoProvisioningSettings().getWithResponse("default", Context.NONE); + manager.autoProvisioningSettings().getWithResponse("default", com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutoProvisioningSettingsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutoProvisioningSettingsListSamples.java index d4d0c2342adf4..542c3c285e85b 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutoProvisioningSettingsListSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutoProvisioningSettingsListSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for AutoProvisioningSettings List. */ public final class AutoProvisioningSettingsListSamples { /* @@ -18,6 +16,6 @@ public final class AutoProvisioningSettingsListSamples { */ public static void getAutoProvisioningSettingsForSubscription( com.azure.resourcemanager.security.SecurityManager manager) { - manager.autoProvisioningSettings().list(Context.NONE); + manager.autoProvisioningSettings().list(com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutomationsCreateOrUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutomationsCreateOrUpdateSamples.java index a322c2b5e87e2..7d93c45686371 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutomationsCreateOrUpdateSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutomationsCreateOrUpdateSamples.java @@ -12,8 +12,6 @@ import com.azure.resourcemanager.security.models.EventSource; import com.azure.resourcemanager.security.models.Operator; import com.azure.resourcemanager.security.models.PropertyType; -import java.io.IOException; -import java.net.URL; import java.util.Arrays; import java.util.HashMap; import java.util.Map; @@ -29,7 +27,7 @@ public final class AutomationsCreateOrUpdateSamples { * @param manager Entry point to SecurityManager. */ public static void createOrUpdateASecurityAutomationForAllAssessmentsIncludingAllSeverities( - com.azure.resourcemanager.security.SecurityManager manager) throws IOException { + com.azure.resourcemanager.security.SecurityManager manager) { manager .automations() .define("exampleAutomation") @@ -57,7 +55,7 @@ public static void createOrUpdateASecurityAutomationForAllAssessmentsIncludingAl new AutomationActionLogicApp() .withLogicAppResourceId( "/subscriptions/e54a4a18-5b94-4f90-9471-bd3decad8a2e/resourceGroups/sample/providers/Microsoft.Logic/workflows/MyTest1") - .withUri(new URL("https://exampleTriggerUri1.com")))) + .withUri("https://exampleTriggerUri1.com"))) .create(); } @@ -69,8 +67,7 @@ public static void createOrUpdateASecurityAutomationForAllAssessmentsIncludingAl * * @param manager Entry point to SecurityManager. */ - public static void disableOrEnableASecurityAutomation(com.azure.resourcemanager.security.SecurityManager manager) - throws IOException { + public static void disableOrEnableASecurityAutomation(com.azure.resourcemanager.security.SecurityManager manager) { manager .automations() .define("exampleAutomation") @@ -114,7 +111,7 @@ public static void disableOrEnableASecurityAutomation(com.azure.resourcemanager. new AutomationActionLogicApp() .withLogicAppResourceId( "/subscriptions/e54a4a18-5b94-4f90-9471-bd3decad8a2e/resourceGroups/sample/providers/Microsoft.Logic/workflows/MyTest1") - .withUri(new URL("https://exampleTriggerUri1.com")))) + .withUri("https://exampleTriggerUri1.com"))) .create(); } @@ -127,7 +124,7 @@ public static void disableOrEnableASecurityAutomation(com.azure.resourcemanager. * @param manager Entry point to SecurityManager. */ public static void createOrUpdateASecurityAutomationForAllHighSeverityAssessments( - com.azure.resourcemanager.security.SecurityManager manager) throws IOException { + com.azure.resourcemanager.security.SecurityManager manager) { manager .automations() .define("exampleAutomation") @@ -171,7 +168,7 @@ public static void createOrUpdateASecurityAutomationForAllHighSeverityAssessment new AutomationActionLogicApp() .withLogicAppResourceId( "/subscriptions/e54a4a18-5b94-4f90-9471-bd3decad8a2e/resourceGroups/sample/providers/Microsoft.Logic/workflows/MyTest1") - .withUri(new URL("https://exampleTriggerUri1.com")))) + .withUri("https://exampleTriggerUri1.com"))) .create(); } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutomationsDeleteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutomationsDeleteSamples.java index a4aed632e6d30..581f4c2760a64 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutomationsDeleteSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutomationsDeleteSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for Automations Delete. */ public final class AutomationsDeleteSamples { /* @@ -17,6 +15,8 @@ public final class AutomationsDeleteSamples { * @param manager Entry point to SecurityManager. */ public static void deleteASecurityAutomation(com.azure.resourcemanager.security.SecurityManager manager) { - manager.automations().deleteByResourceGroupWithResponse("myRg", "myAutomationName", Context.NONE); + manager + .automations() + .deleteByResourceGroupWithResponse("myRg", "myAutomationName", com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutomationsGetByResourceGroupSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutomationsGetByResourceGroupSamples.java index cf9d5671476dd..f2cb4ebc832c5 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutomationsGetByResourceGroupSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutomationsGetByResourceGroupSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for Automations GetByResourceGroup. */ public final class AutomationsGetByResourceGroupSamples { /* @@ -17,6 +15,9 @@ public final class AutomationsGetByResourceGroupSamples { * @param manager Entry point to SecurityManager. */ public static void retrieveASecurityAutomation(com.azure.resourcemanager.security.SecurityManager manager) { - manager.automations().getByResourceGroupWithResponse("exampleResourceGroup", "exampleAutomation", Context.NONE); + manager + .automations() + .getByResourceGroupWithResponse( + "exampleResourceGroup", "exampleAutomation", com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutomationsListByResourceGroupSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutomationsListByResourceGroupSamples.java index e01250d097525..953d549518779 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutomationsListByResourceGroupSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutomationsListByResourceGroupSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for Automations ListByResourceGroup. */ public final class AutomationsListByResourceGroupSamples { /* @@ -18,6 +16,6 @@ public final class AutomationsListByResourceGroupSamples { */ public static void listAllSecurityAutomationsOfASpecifiedResourceGroup( com.azure.resourcemanager.security.SecurityManager manager) { - manager.automations().listByResourceGroup("exampleResourceGroup", Context.NONE); + manager.automations().listByResourceGroup("exampleResourceGroup", com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutomationsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutomationsListSamples.java index b08458f15aec3..a937bba783140 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutomationsListSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutomationsListSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for Automations List. */ public final class AutomationsListSamples { /* @@ -18,6 +16,6 @@ public final class AutomationsListSamples { */ public static void listAllSecurityAutomationsOfASpecifiedSubscription( com.azure.resourcemanager.security.SecurityManager manager) { - manager.automations().list(Context.NONE); + manager.automations().list(com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutomationsValidateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutomationsValidateSamples.java index 845d14d0aa023..5202ae3636088 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutomationsValidateSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutomationsValidateSamples.java @@ -4,7 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; import com.azure.resourcemanager.security.fluent.models.AutomationInner; import com.azure.resourcemanager.security.models.AutomationActionLogicApp; import com.azure.resourcemanager.security.models.AutomationRuleSet; @@ -14,8 +13,6 @@ import com.azure.resourcemanager.security.models.EventSource; import com.azure.resourcemanager.security.models.Operator; import com.azure.resourcemanager.security.models.PropertyType; -import java.io.IOException; -import java.net.URL; import java.util.Arrays; import java.util.HashMap; import java.util.Map; @@ -31,7 +28,7 @@ public final class AutomationsValidateSamples { * @param manager Entry point to SecurityManager. */ public static void validateTheSecurityAutomationModelBeforeCreateOrUpdate( - com.azure.resourcemanager.security.SecurityManager manager) throws IOException { + com.azure.resourcemanager.security.SecurityManager manager) { manager .automations() .validateWithResponse( @@ -77,8 +74,8 @@ public static void validateTheSecurityAutomationModelBeforeCreateOrUpdate( new AutomationActionLogicApp() .withLogicAppResourceId( "/subscriptions/e54a4a18-5b94-4f90-9471-bd3decad8a2e/resourceGroups/sample/providers/Microsoft.Logic/workflows/MyTest1") - .withUri(new URL("https://exampleTriggerUri1.com")))), - Context.NONE); + .withUri("https://exampleTriggerUri1.com"))), + com.azure.core.util.Context.NONE); } @SuppressWarnings("unchecked") diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ComplianceResultsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ComplianceResultsGetSamples.java index bf64e0c5d0cf7..b0128db04b1a1 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ComplianceResultsGetSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ComplianceResultsGetSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for ComplianceResults Get. */ public final class ComplianceResultsGetSamples { /* @@ -20,6 +18,8 @@ public static void getComplianceResultsOnSubscription(com.azure.resourcemanager. manager .complianceResults() .getWithResponse( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", "DesignateMoreThanOneOwner", Context.NONE); + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", + "DesignateMoreThanOneOwner", + com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ComplianceResultsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ComplianceResultsListSamples.java index 17788b0153229..4a8d4514ccd93 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ComplianceResultsListSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ComplianceResultsListSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for ComplianceResults List. */ public final class ComplianceResultsListSamples { /* @@ -17,6 +15,8 @@ public final class ComplianceResultsListSamples { * @param manager Entry point to SecurityManager. */ public static void getComplianceResultsOnSubscription(com.azure.resourcemanager.security.SecurityManager manager) { - manager.complianceResults().list("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", Context.NONE); + manager + .complianceResults() + .list("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CompliancesGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CompliancesGetSamples.java index 783e52d8a90f0..4d6fad326e2bd 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CompliancesGetSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CompliancesGetSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for Compliances Get. */ public final class CompliancesGetSamples { /* @@ -19,6 +17,7 @@ public final class CompliancesGetSamples { public static void getSecurityComplianceDataForADay(com.azure.resourcemanager.security.SecurityManager manager) { manager .compliances() - .getWithResponse("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", "2018-01-01Z", Context.NONE); + .getWithResponse( + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", "2018-01-01Z", com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CompliancesListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CompliancesListSamples.java index 08b7fa294f581..c9903d8e3c29c 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CompliancesListSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CompliancesListSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for Compliances List. */ public final class CompliancesListSamples { /* @@ -17,6 +15,8 @@ public final class CompliancesListSamples { * @param manager Entry point to SecurityManager. */ public static void getSecurityComplianceDataOverTime(com.azure.resourcemanager.security.SecurityManager manager) { - manager.compliances().list("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", Context.NONE); + manager + .compliances() + .list("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ConnectorsDeleteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ConnectorsDeleteSamples.java index c00a2e80cb785..e4250d1c13870 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ConnectorsDeleteSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ConnectorsDeleteSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for Connectors Delete. */ public final class ConnectorsDeleteSamples { /* @@ -18,6 +16,6 @@ public final class ConnectorsDeleteSamples { */ public static void deleteACloudAccountConnectorFromASubscription( com.azure.resourcemanager.security.SecurityManager manager) { - manager.connectors().deleteWithResponse("aws_dev1", Context.NONE); + manager.connectors().deleteWithResponse("aws_dev1", com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ConnectorsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ConnectorsGetSamples.java index 030dba9b18999..fc7aa92f844d7 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ConnectorsGetSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ConnectorsGetSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for Connectors Get. */ public final class ConnectorsGetSamples { /* @@ -18,6 +16,6 @@ public final class ConnectorsGetSamples { */ public static void detailsOfASpecificCloudAccountConnector( com.azure.resourcemanager.security.SecurityManager manager) { - manager.connectors().getWithResponse("aws_dev1", Context.NONE); + manager.connectors().getWithResponse("aws_dev1", com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ConnectorsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ConnectorsListSamples.java index d514b40724794..f13798406aeeb 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ConnectorsListSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ConnectorsListSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for Connectors List. */ public final class ConnectorsListSamples { /* @@ -18,6 +16,6 @@ public final class ConnectorsListSamples { */ public static void getAllCloudAccountsConnectorsOfASubscription( com.azure.resourcemanager.security.SecurityManager manager) { - manager.connectors().list(Context.NONE); + manager.connectors().list(com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CustomAssessmentAutomationsDeleteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CustomAssessmentAutomationsDeleteSamples.java index 6ec3cb2c2be0f..b5221d8c248c6 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CustomAssessmentAutomationsDeleteSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CustomAssessmentAutomationsDeleteSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for CustomAssessmentAutomations Delete. */ public final class CustomAssessmentAutomationsDeleteSamples { /* @@ -19,6 +17,7 @@ public final class CustomAssessmentAutomationsDeleteSamples { public static void deleteACustomAssessmentAutomation(com.azure.resourcemanager.security.SecurityManager manager) { manager .customAssessmentAutomations() - .deleteByResourceGroupWithResponse("TestResourceGroup", "MyCustomAssessmentAutomation", Context.NONE); + .deleteByResourceGroupWithResponse( + "TestResourceGroup", "MyCustomAssessmentAutomation", com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CustomAssessmentAutomationsGetByResourceGroupSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CustomAssessmentAutomationsGetByResourceGroupSamples.java index ce01fa6f39689..672b037c94130 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CustomAssessmentAutomationsGetByResourceGroupSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CustomAssessmentAutomationsGetByResourceGroupSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for CustomAssessmentAutomations GetByResourceGroup. */ public final class CustomAssessmentAutomationsGetByResourceGroupSamples { /* @@ -19,6 +17,7 @@ public final class CustomAssessmentAutomationsGetByResourceGroupSamples { public static void getACustomAssessmentAutomation(com.azure.resourcemanager.security.SecurityManager manager) { manager .customAssessmentAutomations() - .getByResourceGroupWithResponse("TestResourceGroup", "MyCustomAssessmentAutomation", Context.NONE); + .getByResourceGroupWithResponse( + "TestResourceGroup", "MyCustomAssessmentAutomation", com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CustomAssessmentAutomationsListByResourceGroupSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CustomAssessmentAutomationsListByResourceGroupSamples.java index 9cefc95fc412b..9dfd8616b5869 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CustomAssessmentAutomationsListByResourceGroupSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CustomAssessmentAutomationsListByResourceGroupSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for CustomAssessmentAutomations ListByResourceGroup. */ public final class CustomAssessmentAutomationsListByResourceGroupSamples { /* @@ -18,6 +16,8 @@ public final class CustomAssessmentAutomationsListByResourceGroupSamples { */ public static void listCustomAssessmentAutomationsInASubscriptionAndAResourceGroup( com.azure.resourcemanager.security.SecurityManager manager) { - manager.customAssessmentAutomations().listByResourceGroup("TestResourceGroup", Context.NONE); + manager + .customAssessmentAutomations() + .listByResourceGroup("TestResourceGroup", com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CustomAssessmentAutomationsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CustomAssessmentAutomationsListSamples.java index 3c3c3672b7dfe..f7cd322e51270 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CustomAssessmentAutomationsListSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CustomAssessmentAutomationsListSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for CustomAssessmentAutomations List. */ public final class CustomAssessmentAutomationsListSamples { /* @@ -18,6 +16,6 @@ public final class CustomAssessmentAutomationsListSamples { */ public static void listCustomAssessmentAutomationsInASubscription( com.azure.resourcemanager.security.SecurityManager manager) { - manager.customAssessmentAutomations().list(Context.NONE); + manager.customAssessmentAutomations().list(com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentsDeleteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentsDeleteSamples.java index d6a703a40b2be..fefbea30f2acc 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentsDeleteSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentsDeleteSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for CustomEntityStoreAssignments Delete. */ public final class CustomEntityStoreAssignmentsDeleteSamples { /* @@ -20,6 +18,6 @@ public static void deleteACustomEntityStoreAssignment(com.azure.resourcemanager. manager .customEntityStoreAssignments() .deleteByResourceGroupWithResponse( - "TestResourceGroup", "33e7cc6e-a139-4723-a0e5-76993aee0771", Context.NONE); + "TestResourceGroup", "33e7cc6e-a139-4723-a0e5-76993aee0771", com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentsGetByResourceGroupSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentsGetByResourceGroupSamples.java index 4434a4e307b7d..80714a727fc26 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentsGetByResourceGroupSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentsGetByResourceGroupSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for CustomEntityStoreAssignments GetByResourceGroup. */ public final class CustomEntityStoreAssignmentsGetByResourceGroupSamples { /* @@ -19,6 +17,7 @@ public final class CustomEntityStoreAssignmentsGetByResourceGroupSamples { public static void getACustomEntityStoreAssignment(com.azure.resourcemanager.security.SecurityManager manager) { manager .customEntityStoreAssignments() - .getByResourceGroupWithResponse("TestResourceGroup", "33e7cc6e-a139-4723-a0e5-76993aee0771", Context.NONE); + .getByResourceGroupWithResponse( + "TestResourceGroup", "33e7cc6e-a139-4723-a0e5-76993aee0771", com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentsListByResourceGroupSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentsListByResourceGroupSamples.java index 267815ae5beac..d03aaad838ed1 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentsListByResourceGroupSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentsListByResourceGroupSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for CustomEntityStoreAssignments ListByResourceGroup. */ public final class CustomEntityStoreAssignmentsListByResourceGroupSamples { /* @@ -18,6 +16,8 @@ public final class CustomEntityStoreAssignmentsListByResourceGroupSamples { */ public static void listCustomEntityStoreAssignmentsInASubscriptionAndAResourceGroup( com.azure.resourcemanager.security.SecurityManager manager) { - manager.customEntityStoreAssignments().listByResourceGroup("TestResourceGroup", Context.NONE); + manager + .customEntityStoreAssignments() + .listByResourceGroup("TestResourceGroup", com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentsListSamples.java index 611304842ae74..3684ba56655b1 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentsListSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentsListSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for CustomEntityStoreAssignments List. */ public final class CustomEntityStoreAssignmentsListSamples { /* @@ -18,6 +16,6 @@ public final class CustomEntityStoreAssignmentsListSamples { */ public static void listCustomEntityStoreAssignmentsInASubscription( com.azure.resourcemanager.security.SecurityManager manager) { - manager.customEntityStoreAssignments().list(Context.NONE); + manager.customEntityStoreAssignments().list(com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DeviceSecurityGroupsDeleteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DeviceSecurityGroupsDeleteSamples.java index 502c9779e398a..345e341c162ba 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DeviceSecurityGroupsDeleteSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DeviceSecurityGroupsDeleteSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for DeviceSecurityGroups Delete. */ public final class DeviceSecurityGroupsDeleteSamples { /* @@ -23,6 +21,6 @@ public static void deleteADeviceSecurityGroupForTheSpecifiedIoTHubResource( .deleteByResourceGroupWithResponse( "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Devices/iotHubs/sampleiothub", "samplesecuritygroup", - Context.NONE); + com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DeviceSecurityGroupsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DeviceSecurityGroupsGetSamples.java index ed7273a61a0b4..3f8034b69f598 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DeviceSecurityGroupsGetSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DeviceSecurityGroupsGetSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for DeviceSecurityGroups Get. */ public final class DeviceSecurityGroupsGetSamples { /* @@ -23,6 +21,6 @@ public static void getADeviceSecurityGroupForTheSpecifiedIoTHubResource( .getWithResponse( "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Devices/iotHubs/sampleiothub", "samplesecuritygroup", - Context.NONE); + com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DeviceSecurityGroupsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DeviceSecurityGroupsListSamples.java index 509ed4381408d..22ad1ada2ae7d 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DeviceSecurityGroupsListSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DeviceSecurityGroupsListSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for DeviceSecurityGroups List. */ public final class DeviceSecurityGroupsListSamples { /* @@ -22,6 +20,6 @@ public static void listAllDeviceSecurityGroupsForTheSpecifiedIoTHubResource( .deviceSecurityGroups() .list( "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Devices/iotHubs/sampleiothub", - Context.NONE); + com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DiscoveredSecuritySolutionsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DiscoveredSecuritySolutionsGetSamples.java index a9b5a5131d72e..6940d814d7fa7 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DiscoveredSecuritySolutionsGetSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DiscoveredSecuritySolutionsGetSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for DiscoveredSecuritySolutions Get. */ public final class DiscoveredSecuritySolutionsGetSamples { /* @@ -18,6 +16,8 @@ public final class DiscoveredSecuritySolutionsGetSamples { */ public static void getDiscoveredSecuritySolutionFromASecurityDataLocation( com.azure.resourcemanager.security.SecurityManager manager) { - manager.discoveredSecuritySolutions().getWithResponse("myRg2", "centralus", "paloalto7", Context.NONE); + manager + .discoveredSecuritySolutions() + .getWithResponse("myRg2", "centralus", "paloalto7", com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DiscoveredSecuritySolutionsListByHomeRegionSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DiscoveredSecuritySolutionsListByHomeRegionSamples.java index c91f1ac4215e5..4c3e263cecee0 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DiscoveredSecuritySolutionsListByHomeRegionSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DiscoveredSecuritySolutionsListByHomeRegionSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for DiscoveredSecuritySolutions ListByHomeRegion. */ public final class DiscoveredSecuritySolutionsListByHomeRegionSamples { /* @@ -18,6 +16,6 @@ public final class DiscoveredSecuritySolutionsListByHomeRegionSamples { */ public static void getDiscoveredSecuritySolutionsFromASecurityDataLocation( com.azure.resourcemanager.security.SecurityManager manager) { - manager.discoveredSecuritySolutions().listByHomeRegion("centralus", Context.NONE); + manager.discoveredSecuritySolutions().listByHomeRegion("centralus", com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DiscoveredSecuritySolutionsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DiscoveredSecuritySolutionsListSamples.java index b47bac33d4f42..51c9fbbd26ebc 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DiscoveredSecuritySolutionsListSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DiscoveredSecuritySolutionsListSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for DiscoveredSecuritySolutions List. */ public final class DiscoveredSecuritySolutionsListSamples { /* @@ -17,6 +15,6 @@ public final class DiscoveredSecuritySolutionsListSamples { * @param manager Entry point to SecurityManager. */ public static void getDiscoveredSecuritySolutions(com.azure.resourcemanager.security.SecurityManager manager) { - manager.discoveredSecuritySolutions().list(Context.NONE); + manager.discoveredSecuritySolutions().list(com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ExternalSecuritySolutionsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ExternalSecuritySolutionsGetSamples.java index a973316c35103..dd9e89a7c6107 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ExternalSecuritySolutionsGetSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ExternalSecuritySolutionsGetSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for ExternalSecuritySolutions Get. */ public final class ExternalSecuritySolutionsGetSamples { /* @@ -23,6 +21,6 @@ public static void getExternalSecuritySolution(com.azure.resourcemanager.securit "defaultresourcegroup-eus", "centralus", "aad_defaultworkspace-20ff7fc3-e762-44dd-bd96-b71116dcdc23-eus", - Context.NONE); + com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ExternalSecuritySolutionsListByHomeRegionSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ExternalSecuritySolutionsListByHomeRegionSamples.java index b904166fdf625..c36eb61798744 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ExternalSecuritySolutionsListByHomeRegionSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ExternalSecuritySolutionsListByHomeRegionSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for ExternalSecuritySolutions ListByHomeRegion. */ public final class ExternalSecuritySolutionsListByHomeRegionSamples { /* @@ -18,6 +16,6 @@ public final class ExternalSecuritySolutionsListByHomeRegionSamples { */ public static void getExternalSecuritySolutionsOnASubscriptionFromSecurityDataLocation( com.azure.resourcemanager.security.SecurityManager manager) { - manager.externalSecuritySolutions().listByHomeRegion("centralus", Context.NONE); + manager.externalSecuritySolutions().listByHomeRegion("centralus", com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ExternalSecuritySolutionsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ExternalSecuritySolutionsListSamples.java index 8fc973100527f..4e71e4cbcf339 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ExternalSecuritySolutionsListSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ExternalSecuritySolutionsListSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for ExternalSecuritySolutions List. */ public final class ExternalSecuritySolutionsListSamples { /* @@ -18,6 +16,6 @@ public final class ExternalSecuritySolutionsListSamples { */ public static void getExternalSecuritySolutionsOnASubscription( com.azure.resourcemanager.security.SecurityManager manager) { - manager.externalSecuritySolutions().list(Context.NONE); + manager.externalSecuritySolutions().list(com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GovernanceAssignmentsDeleteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GovernanceAssignmentsDeleteSamples.java index 93c9f4c589b43..9a9b5dcf84d87 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GovernanceAssignmentsDeleteSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GovernanceAssignmentsDeleteSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for GovernanceAssignments Delete. */ public final class GovernanceAssignmentsDeleteSamples { /* @@ -23,6 +21,6 @@ public static void deleteSecurityAssignment(com.azure.resourcemanager.security.S "subscriptions/c32e05d9-7207-4e22-bdf4-4f7d9c72e5fd/resourceGroups/compute_servers/providers/Microsoft.Compute/virtualMachines/win2012", "6b9421dd-5555-2251-9b3d-2be58e2f82cd", "6634ff9f-127b-4bf2-8e6e-b1737f5e789c", - Context.NONE); + com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GovernanceAssignmentsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GovernanceAssignmentsGetSamples.java index 03c0914c9d084..4b54638508767 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GovernanceAssignmentsGetSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GovernanceAssignmentsGetSamples.java @@ -4,19 +4,17 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for GovernanceAssignments Get. */ public final class GovernanceAssignmentsGetSamples { /* * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceAssignments/GetGovernanceAssignment_example.json */ /** - * Sample code: Get security governanceAssignment by specific governanceAssignmentKey. + * Sample code: Get governanceAssignment by specific governanceAssignmentKey. * * @param manager Entry point to SecurityManager. */ - public static void getSecurityGovernanceAssignmentBySpecificGovernanceAssignmentKey( + public static void getGovernanceAssignmentBySpecificGovernanceAssignmentKey( com.azure.resourcemanager.security.SecurityManager manager) { manager .governanceAssignments() @@ -24,6 +22,6 @@ public static void getSecurityGovernanceAssignmentBySpecificGovernanceAssignment "subscriptions/c32e05d9-7207-4e22-bdf4-4f7d9c72e5fd/resourceGroups/compute_servers/providers/Microsoft.Compute/virtualMachines/win2012", "6b9421dd-5555-2251-9b3d-2be58e2f82cd", "6634ff9f-127b-4bf2-8e6e-b1737f5e789c", - Context.NONE); + com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GovernanceAssignmentsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GovernanceAssignmentsListSamples.java index c245575cfed4c..110e4c159f014 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GovernanceAssignmentsListSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GovernanceAssignmentsListSamples.java @@ -4,24 +4,22 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for GovernanceAssignments List. */ public final class GovernanceAssignmentsListSamples { /* * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceAssignments/ListGovernanceAssignments_example.json */ /** - * Sample code: List security governanceAssignments. + * Sample code: List governance assignments. * * @param manager Entry point to SecurityManager. */ - public static void listSecurityGovernanceAssignments(com.azure.resourcemanager.security.SecurityManager manager) { + public static void listGovernanceAssignments(com.azure.resourcemanager.security.SecurityManager manager) { manager .governanceAssignments() .list( "subscriptions/c32e05d9-7207-4e22-bdf4-4f7d9c72e5fd", "6b9421dd-5555-2251-9b3d-2be58e2f82cd", - Context.NONE); + com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GovernanceRuleListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GovernanceRuleListSamples.java deleted file mode 100644 index 2b55990c5fcf5..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GovernanceRuleListSamples.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.Context; - -/** Samples for GovernanceRule List. */ -public final class GovernanceRuleListSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/ListBySubscriptionGovernanceRules_example.json - */ - /** - * Sample code: List security governanceRules by subscription level scope. - * - * @param manager Entry point to SecurityManager. - */ - public static void listSecurityGovernanceRulesBySubscriptionLevelScope( - com.azure.resourcemanager.security.SecurityManager manager) { - manager.governanceRules().list(Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GovernanceRulesCreateOrUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GovernanceRulesCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..dc001c41ee490 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GovernanceRulesCreateOrUpdateSamples.java @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.generated; + +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.security.models.GovernanceRuleEmailNotification; +import com.azure.resourcemanager.security.models.GovernanceRuleOwnerSource; +import com.azure.resourcemanager.security.models.GovernanceRuleOwnerSourceType; +import com.azure.resourcemanager.security.models.GovernanceRuleSourceResourceType; +import com.azure.resourcemanager.security.models.GovernanceRuleType; +import java.io.IOException; +import java.util.Arrays; + +/** Samples for GovernanceRules CreateOrUpdate. */ +public final class GovernanceRulesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/PutManagementGroupGovernanceRule_example.json + */ + /** + * Sample code: Create or update governance rule over management group scope. + * + * @param manager Entry point to SecurityManager. + */ + public static void createOrUpdateGovernanceRuleOverManagementGroupScope( + com.azure.resourcemanager.security.SecurityManager manager) throws IOException { + manager + .governanceRules() + .define("ad9a8e26-29d9-4829-bb30-e597a58cdbb8") + .withExistingScope("providers/Microsoft.Management/managementGroups/contoso") + .withDisplayName("Management group rule") + .withDescription("A rule for a management group") + .withRemediationTimeframe("7.00:00:00") + .withIsGracePeriod(true) + .withRulePriority(200) + .withIsDisabled(false) + .withRuleType(GovernanceRuleType.INTEGRATED) + .withSourceResourceType(GovernanceRuleSourceResourceType.ASSESSMENTS) + .withExcludedScopes(Arrays.asList("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23")) + .withConditionSets( + Arrays + .asList( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize( + "{\"conditions\":[{\"operator\":\"In\",\"property\":\"$.AssessmentKey\",\"value\":\"[\\\"b1cd27e0-4ecc-4246-939f-49c426d9d72f\\\"," + + " \\\"fe83f80b-073d-4ccf-93d9-6797eb870201\\\"]\"}]}", + Object.class, + SerializerEncoding.JSON))) + .withOwnerSource( + new GovernanceRuleOwnerSource() + .withType(GovernanceRuleOwnerSourceType.MANUALLY) + .withValue("user@contoso.com")) + .withGovernanceEmailNotification( + new GovernanceRuleEmailNotification() + .withDisableManagerEmailNotification(true) + .withDisableOwnerEmailNotification(false)) + .create(); + } + + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/PutSecurityConnectorGovernanceRule_example.json + */ + /** + * Sample code: Create or update governance rule over security connector scope. + * + * @param manager Entry point to SecurityManager. + */ + public static void createOrUpdateGovernanceRuleOverSecurityConnectorScope( + com.azure.resourcemanager.security.SecurityManager manager) throws IOException { + manager + .governanceRules() + .define("ad9a8e26-29d9-4829-bb30-e597a58cdbb8") + .withExistingScope( + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/gcpResourceGroup/providers/Microsoft.Security/securityConnectors/gcpconnector") + .withDisplayName("GCP Admin's rule") + .withDescription("A rule on critical GCP recommendations") + .withRemediationTimeframe("7.00:00:00") + .withIsGracePeriod(true) + .withRulePriority(200) + .withIsDisabled(false) + .withRuleType(GovernanceRuleType.INTEGRATED) + .withSourceResourceType(GovernanceRuleSourceResourceType.ASSESSMENTS) + .withConditionSets( + Arrays + .asList( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize( + "{\"conditions\":[{\"operator\":\"In\",\"property\":\"$.AssessmentKey\",\"value\":\"[\\\"b1cd27e0-4ecc-4246-939f-49c426d9d72f\\\"," + + " \\\"fe83f80b-073d-4ccf-93d9-6797eb870201\\\"]\"}]}", + Object.class, + SerializerEncoding.JSON))) + .withOwnerSource( + new GovernanceRuleOwnerSource() + .withType(GovernanceRuleOwnerSourceType.MANUALLY) + .withValue("user@contoso.com")) + .withGovernanceEmailNotification( + new GovernanceRuleEmailNotification() + .withDisableManagerEmailNotification(true) + .withDisableOwnerEmailNotification(false)) + .create(); + } + + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/PutGovernanceRule_example.json + */ + /** + * Sample code: Create or update governance rule over subscription scope. + * + * @param manager Entry point to SecurityManager. + */ + public static void createOrUpdateGovernanceRuleOverSubscriptionScope( + com.azure.resourcemanager.security.SecurityManager manager) throws IOException { + manager + .governanceRules() + .define("ad9a8e26-29d9-4829-bb30-e597a58cdbb8") + .withExistingScope("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23") + .withDisplayName("Admin's rule") + .withDescription("A rule for critical recommendations") + .withRemediationTimeframe("7.00:00:00") + .withIsGracePeriod(true) + .withRulePriority(200) + .withIsDisabled(false) + .withRuleType(GovernanceRuleType.INTEGRATED) + .withSourceResourceType(GovernanceRuleSourceResourceType.ASSESSMENTS) + .withConditionSets( + Arrays + .asList( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize( + "{\"conditions\":[{\"operator\":\"In\",\"property\":\"$.AssessmentKey\",\"value\":\"[\\\"b1cd27e0-4ecc-4246-939f-49c426d9d72f\\\"," + + " \\\"fe83f80b-073d-4ccf-93d9-6797eb870201\\\"]\"}]}", + Object.class, + SerializerEncoding.JSON))) + .withOwnerSource( + new GovernanceRuleOwnerSource() + .withType(GovernanceRuleOwnerSourceType.MANUALLY) + .withValue("user@contoso.com")) + .withGovernanceEmailNotification( + new GovernanceRuleEmailNotification() + .withDisableManagerEmailNotification(false) + .withDisableOwnerEmailNotification(false)) + .create(); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GovernanceRulesDeleteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GovernanceRulesDeleteSamples.java new file mode 100644 index 0000000000000..aa1be6c408933 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GovernanceRulesDeleteSamples.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** Samples for GovernanceRules Delete. */ +public final class GovernanceRulesDeleteSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/DeleteManagementGroupGovernanceRule_example.json + */ + /** + * Sample code: Delete a Governance rule over management group scope. + * + * @param manager Entry point to SecurityManager. + */ + public static void deleteAGovernanceRuleOverManagementGroupScope( + com.azure.resourcemanager.security.SecurityManager manager) { + manager + .governanceRules() + .delete( + "providers/Microsoft.Management/managementGroups/contoso", + "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/DeleteGovernanceRule_example.json + */ + /** + * Sample code: Delete a Governance rule over subscription scope. + * + * @param manager Entry point to SecurityManager. + */ + public static void deleteAGovernanceRuleOverSubscriptionScope( + com.azure.resourcemanager.security.SecurityManager manager) { + manager + .governanceRules() + .delete( + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", + "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/DeleteSecurityConnectorGovernanceRule_example.json + */ + /** + * Sample code: Delete a Governance rule over security connector scope. + * + * @param manager Entry point to SecurityManager. + */ + public static void deleteAGovernanceRuleOverSecurityConnectorScope( + com.azure.resourcemanager.security.SecurityManager manager) { + manager + .governanceRules() + .delete( + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/gcpResourceGroup/providers/Microsoft.Security/securityConnectors/gcpconnector", + "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GovernanceRulesExecuteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GovernanceRulesExecuteSamples.java new file mode 100644 index 0000000000000..800f8a6d6c057 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GovernanceRulesExecuteSamples.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** Samples for GovernanceRules Execute. */ +public final class GovernanceRulesExecuteSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/PostSecurityConnectorGovernanceRule_example.json + */ + /** + * Sample code: Execute governance rule over security connector scope. + * + * @param manager Entry point to SecurityManager. + */ + public static void executeGovernanceRuleOverSecurityConnectorScope( + com.azure.resourcemanager.security.SecurityManager manager) { + manager + .governanceRules() + .execute( + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/gcpResourceGroup/providers/Microsoft.Security/securityConnectors/gcpconnector", + "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", + null, + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/PostGovernanceRule_example.json + */ + /** + * Sample code: Execute Governance rule over subscription scope. + * + * @param manager Entry point to SecurityManager. + */ + public static void executeGovernanceRuleOverSubscriptionScope( + com.azure.resourcemanager.security.SecurityManager manager) { + manager + .governanceRules() + .execute( + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", + "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", + null, + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/PostManagementGroupGovernanceRule_example.json + */ + /** + * Sample code: Execute governance rule over management group scope. + * + * @param manager Entry point to SecurityManager. + */ + public static void executeGovernanceRuleOverManagementGroupScope( + com.azure.resourcemanager.security.SecurityManager manager) { + manager + .governanceRules() + .execute( + "providers/Microsoft.Management/managementGroups/contoso", + "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", + null, + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GovernanceRulesGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GovernanceRulesGetSamples.java new file mode 100644 index 0000000000000..0f9bf067895da --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GovernanceRulesGetSamples.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** Samples for GovernanceRules Get. */ +public final class GovernanceRulesGetSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/GetManagementGroupGovernanceRule_example.json + */ + /** + * Sample code: Get a governance rule over management group scope. + * + * @param manager Entry point to SecurityManager. + */ + public static void getAGovernanceRuleOverManagementGroupScope( + com.azure.resourcemanager.security.SecurityManager manager) { + manager + .governanceRules() + .getWithResponse( + "providers/Microsoft.Management/managementGroups/contoso", + "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/GetGovernanceRule_example.json + */ + /** + * Sample code: Get a governance rule over subscription scope. + * + * @param manager Entry point to SecurityManager. + */ + public static void getAGovernanceRuleOverSubscriptionScope( + com.azure.resourcemanager.security.SecurityManager manager) { + manager + .governanceRules() + .getWithResponse( + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", + "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/GetSecurityConnectorGovernanceRule_example.json + */ + /** + * Sample code: Get a governance rule over security connector scope. + * + * @param manager Entry point to SecurityManager. + */ + public static void getAGovernanceRuleOverSecurityConnectorScope( + com.azure.resourcemanager.security.SecurityManager manager) { + manager + .governanceRules() + .getWithResponse( + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/gcpResourceGroup/providers/Microsoft.Security/securityConnectors/gcpconnector", + "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GovernanceRulesListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GovernanceRulesListSamples.java new file mode 100644 index 0000000000000..63aec77cac6c7 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GovernanceRulesListSamples.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** Samples for GovernanceRules List. */ +public final class GovernanceRulesListSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/ListBySubscriptionGovernanceRules_example.json + */ + /** + * Sample code: List governance rules by subscription scope. + * + * @param manager Entry point to SecurityManager. + */ + public static void listGovernanceRulesBySubscriptionScope( + com.azure.resourcemanager.security.SecurityManager manager) { + manager + .governanceRules() + .list("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/ListBySecurityConnectorGovernanceRules_example.json + */ + /** + * Sample code: List governance rules by security connector scope. + * + * @param manager Entry point to SecurityManager. + */ + public static void listGovernanceRulesBySecurityConnectorScope( + com.azure.resourcemanager.security.SecurityManager manager) { + manager + .governanceRules() + .list( + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/gcpResourceGroup/providers/Microsoft.Security/securityConnectors/gcpconnector", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/ListByManagementGroupGovernanceRules_example.json + */ + /** + * Sample code: List governance rules by management group scope. + * + * @param manager Entry point to SecurityManager. + */ + public static void listGovernanceRulesByManagementGroupScope( + com.azure.resourcemanager.security.SecurityManager manager) { + manager + .governanceRules() + .list("providers/Microsoft.Management/managementGroups/contoso", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GovernanceRulesOperationCreateOrUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GovernanceRulesOperationCreateOrUpdateSamples.java deleted file mode 100644 index 970b5383bd1f7..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GovernanceRulesOperationCreateOrUpdateSamples.java +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.management.serializer.SerializerFactory; -import com.azure.core.util.serializer.SerializerEncoding; -import com.azure.resourcemanager.security.models.GovernanceRuleEmailNotification; -import com.azure.resourcemanager.security.models.GovernanceRuleOwnerSource; -import com.azure.resourcemanager.security.models.GovernanceRuleOwnerSourceType; -import com.azure.resourcemanager.security.models.GovernanceRuleSourceResourceType; -import com.azure.resourcemanager.security.models.GovernanceRuleType; -import java.io.IOException; -import java.util.Arrays; - -/** Samples for GovernanceRulesOperation CreateOrUpdate. */ -public final class GovernanceRulesOperationCreateOrUpdateSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/PutGovernanceRule_example.json - */ - /** - * Sample code: Create Governance rule. - * - * @param manager Entry point to SecurityManager. - */ - public static void createGovernanceRule(com.azure.resourcemanager.security.SecurityManager manager) - throws IOException { - manager - .governanceRulesOperations() - .define("ad9a8e26-29d9-4829-bb30-e597a58cdbb8") - .withDisplayName("Admin's rule") - .withDescription("A rule on critical recommendations") - .withRemediationTimeframe("7.00:00:00") - .withIsGracePeriod(true) - .withRulePriority(200) - .withIsDisabled(false) - .withRuleType(GovernanceRuleType.INTEGRATED) - .withSourceResourceType(GovernanceRuleSourceResourceType.ASSESSMENTS) - .withConditionSets( - Arrays - .asList( - SerializerFactory - .createDefaultManagementSerializerAdapter() - .deserialize( - "{\"conditions\":[{\"operator\":\"In\",\"property\":\"$.AssessmentKey\",\"value\":\"[\\\"b1cd27e0-4ecc-4246-939f-49c426d9d72f\\\"," - + " \\\"fe83f80b-073d-4ccf-93d9-6797eb870201\\\"]\"}]}", - Object.class, - SerializerEncoding.JSON))) - .withOwnerSource( - new GovernanceRuleOwnerSource() - .withType(GovernanceRuleOwnerSourceType.MANUALLY) - .withValue("user@contoso.com")) - .withGovernanceEmailNotification( - new GovernanceRuleEmailNotification() - .withDisableManagerEmailNotification(false) - .withDisableOwnerEmailNotification(false)) - .create(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GovernanceRulesOperationDeleteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GovernanceRulesOperationDeleteSamples.java deleted file mode 100644 index fbbed032aadee..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GovernanceRulesOperationDeleteSamples.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.Context; - -/** Samples for GovernanceRulesOperation Delete. */ -public final class GovernanceRulesOperationDeleteSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/DeleteGovernanceRule_example.json - */ - /** - * Sample code: Delete security GovernanceRule. - * - * @param manager Entry point to SecurityManager. - */ - public static void deleteSecurityGovernanceRule(com.azure.resourcemanager.security.SecurityManager manager) { - manager.governanceRulesOperations().deleteWithResponse("ad9a8e26-29d9-4829-bb30-e597a58cdbb8", Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GovernanceRulesOperationGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GovernanceRulesOperationGetSamples.java deleted file mode 100644 index 85133ea5e362c..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GovernanceRulesOperationGetSamples.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.Context; - -/** Samples for GovernanceRulesOperation Get. */ -public final class GovernanceRulesOperationGetSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/GetGovernanceRule_example.json - */ - /** - * Sample code: Get security governanceRules by specific governanceRuleId. - * - * @param manager Entry point to SecurityManager. - */ - public static void getSecurityGovernanceRulesBySpecificGovernanceRuleId( - com.azure.resourcemanager.security.SecurityManager manager) { - manager.governanceRulesOperations().getWithResponse("ad9a8e26-29d9-4829-bb30-e597a58cdbb8", Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GovernanceRulesOperationResultsSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GovernanceRulesOperationResultsSamples.java new file mode 100644 index 0000000000000..8c7df88fec266 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GovernanceRulesOperationResultsSamples.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** Samples for GovernanceRules OperationResults. */ +public final class GovernanceRulesOperationResultsSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/GetManagementGroupGovernanceRuleExecuteStatus_example.json + */ + /** + * Sample code: Get governance rules long run operation result over management group. + * + * @param manager Entry point to SecurityManager. + */ + public static void getGovernanceRulesLongRunOperationResultOverManagementGroup( + com.azure.resourcemanager.security.SecurityManager manager) { + manager + .governanceRules() + .operationResultsWithResponse( + "providers/Microsoft.Management/managementGroups/contoso", + "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", + "58b33f4f-c8c7-4b01-99cc-d437db4d40dd", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/GetSecurityConnectorGovernanceRuleExecuteStatus_example.json + */ + /** + * Sample code: Get governance rules long run operation result over security connector. + * + * @param manager Entry point to SecurityManager. + */ + public static void getGovernanceRulesLongRunOperationResultOverSecurityConnector( + com.azure.resourcemanager.security.SecurityManager manager) { + manager + .governanceRules() + .operationResultsWithResponse( + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/gcpResourceGroup/providers/Microsoft.Security/securityConnectors/gcpconnector", + "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", + "58b33f4f-c8c7-4b01-99cc-d437db4d40dd", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/GetGovernanceRuleExecuteStatus_example.json + */ + /** + * Sample code: Get governance rules long run operation result over subscription. + * + * @param manager Entry point to SecurityManager. + */ + public static void getGovernanceRulesLongRunOperationResultOverSubscription( + com.azure.resourcemanager.security.SecurityManager manager) { + manager + .governanceRules() + .operationResultsWithResponse( + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", + "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", + "58b33f4f-c8c7-4b01-99cc-d437db4d40dd", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GovernanceRulesOperationRuleIdExecuteSingleSecurityConnectorSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GovernanceRulesOperationRuleIdExecuteSingleSecurityConnectorSamples.java deleted file mode 100644 index d020a96f48dbf..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GovernanceRulesOperationRuleIdExecuteSingleSecurityConnectorSamples.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.Context; - -/** Samples for GovernanceRulesOperation RuleIdExecuteSingleSecurityConnector. */ -public final class GovernanceRulesOperationRuleIdExecuteSingleSecurityConnectorSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/PostSecurityConnectorGovernanceRule_example.json - */ - /** - * Sample code: Execute Governance rule. - * - * @param manager Entry point to SecurityManager. - */ - public static void executeGovernanceRule(com.azure.resourcemanager.security.SecurityManager manager) { - manager - .governanceRulesOperations() - .ruleIdExecuteSingleSecurityConnector( - "gcpResourceGroup", "gcpconnector", "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", null, Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GovernanceRulesOperationRuleIdExecuteSingleSubscriptionSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GovernanceRulesOperationRuleIdExecuteSingleSubscriptionSamples.java deleted file mode 100644 index 45732f26c4d1a..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GovernanceRulesOperationRuleIdExecuteSingleSubscriptionSamples.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.Context; - -/** Samples for GovernanceRulesOperation RuleIdExecuteSingleSubscription. */ -public final class GovernanceRulesOperationRuleIdExecuteSingleSubscriptionSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/PostGovernanceRule_example.json - */ - /** - * Sample code: Execute Governance rule. - * - * @param manager Entry point to SecurityManager. - */ - public static void executeGovernanceRule(com.azure.resourcemanager.security.SecurityManager manager) { - manager - .governanceRulesOperations() - .ruleIdExecuteSingleSubscription("ad9a8e26-29d9-4829-bb30-e597a58cdbb8", null, Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/HealthReportOperationGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/HealthReportOperationGetSamples.java new file mode 100644 index 0000000000000..04042dc0cc790 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/HealthReportOperationGetSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** Samples for HealthReportOperation Get. */ +public final class HealthReportOperationGetSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-02-01-preview/examples/HealthReports/GetHealthReport_example.json + */ + /** + * Sample code: Get health report of resource. + * + * @param manager Entry point to SecurityManager. + */ + public static void getHealthReportOfResource(com.azure.resourcemanager.security.SecurityManager manager) { + manager + .healthReportOperations() + .getWithResponse( + "subscriptions/a1efb6ca-fbc5-4782-9aaa-5c7daded1ce2/resourcegroups/E2E-IBB0WX/providers/Microsoft.Security/securityconnectors/AwsConnectorAllOfferings", + "909c629a-bf39-4521-8e4f-10b443a0bc02", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/HealthReportsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/HealthReportsListSamples.java new file mode 100644 index 0000000000000..2a7ee29833eb9 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/HealthReportsListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** Samples for HealthReports List. */ +public final class HealthReportsListSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-02-01-preview/examples/HealthReports/ListHealthReports_example.json + */ + /** + * Sample code: List health reports. + * + * @param manager Entry point to SecurityManager. + */ + public static void listHealthReports(com.azure.resourcemanager.security.SecurityManager manager) { + manager + .healthReports() + .list("subscriptions/a1efb6ca-fbc5-4782-9aaa-5c7daded1ce2", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/InformationProtectionPoliciesGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/InformationProtectionPoliciesGetSamples.java index 635b5b0fc4a6f..7cb89afb693da 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/InformationProtectionPoliciesGetSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/InformationProtectionPoliciesGetSamples.java @@ -4,7 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; import com.azure.resourcemanager.security.models.InformationProtectionPolicyName; /** Samples for InformationProtectionPolicies Get. */ @@ -24,7 +23,7 @@ public static void getTheCustomizedInformationProtectionPolicyForAManagementGrou .getWithResponse( "providers/Microsoft.Management/managementGroups/148059f7-faf3-49a6-ba35-85122112291e", InformationProtectionPolicyName.CUSTOM, - Context.NONE); + com.azure.core.util.Context.NONE); } /* @@ -42,6 +41,6 @@ public static void getTheEffectiveInformationProtectionPolicyForAManagementGroup .getWithResponse( "providers/Microsoft.Management/managementGroups/148059f7-faf3-49a6-ba35-85122112291e", InformationProtectionPolicyName.EFFECTIVE, - Context.NONE); + com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/InformationProtectionPoliciesListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/InformationProtectionPoliciesListSamples.java index a0caa0b0060ed..967f89da9bdc0 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/InformationProtectionPoliciesListSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/InformationProtectionPoliciesListSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for InformationProtectionPolicies List. */ public final class InformationProtectionPoliciesListSamples { /* @@ -19,6 +17,8 @@ public final class InformationProtectionPoliciesListSamples { public static void getInformationProtectionPolicies(com.azure.resourcemanager.security.SecurityManager manager) { manager .informationProtectionPolicies() - .list("providers/Microsoft.Management/managementGroups/148059f7-faf3-49a6-ba35-85122112291e", Context.NONE); + .list( + "providers/Microsoft.Management/managementGroups/148059f7-faf3-49a6-ba35-85122112291e", + com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IngestionSettingsDeleteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IngestionSettingsDeleteSamples.java index 110f7d10abd7b..4951d449f9f33 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IngestionSettingsDeleteSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IngestionSettingsDeleteSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for IngestionSettings Delete. */ public final class IngestionSettingsDeleteSamples { /* @@ -18,6 +16,6 @@ public final class IngestionSettingsDeleteSamples { */ public static void deleteAnIngestionSettingForTheSubscription( com.azure.resourcemanager.security.SecurityManager manager) { - manager.ingestionSettings().deleteWithResponse("default", Context.NONE); + manager.ingestionSettings().deleteWithResponse("default", com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IngestionSettingsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IngestionSettingsGetSamples.java index 100bc62997789..ef8e1251dfc46 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IngestionSettingsGetSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IngestionSettingsGetSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for IngestionSettings Get. */ public final class IngestionSettingsGetSamples { /* @@ -17,6 +15,6 @@ public final class IngestionSettingsGetSamples { * @param manager Entry point to SecurityManager. */ public static void getAIngestionSettingOnSubscription(com.azure.resourcemanager.security.SecurityManager manager) { - manager.ingestionSettings().getWithResponse("default", Context.NONE); + manager.ingestionSettings().getWithResponse("default", com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IngestionSettingsListConnectionStringsSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IngestionSettingsListConnectionStringsSamples.java index 83f53d7b32b2d..ada2d98661529 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IngestionSettingsListConnectionStringsSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IngestionSettingsListConnectionStringsSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for IngestionSettings ListConnectionStrings. */ public final class IngestionSettingsListConnectionStringsSamples { /* @@ -18,6 +16,6 @@ public final class IngestionSettingsListConnectionStringsSamples { */ public static void listConnectionStringsForIngestingSecurityDataAndLogs( com.azure.resourcemanager.security.SecurityManager manager) { - manager.ingestionSettings().listConnectionStringsWithResponse("default", Context.NONE); + manager.ingestionSettings().listConnectionStringsWithResponse("default", com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IngestionSettingsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IngestionSettingsListSamples.java index 88446ff86d961..32d658d01c4a2 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IngestionSettingsListSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IngestionSettingsListSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for IngestionSettings List. */ public final class IngestionSettingsListSamples { /* @@ -17,6 +15,6 @@ public final class IngestionSettingsListSamples { * @param manager Entry point to SecurityManager. */ public static void getIngestionSettingsOnSubscription(com.azure.resourcemanager.security.SecurityManager manager) { - manager.ingestionSettings().list(Context.NONE); + manager.ingestionSettings().list(com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IngestionSettingsListTokensSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IngestionSettingsListTokensSamples.java index 3266ef4937bf2..62bf0af3b48b8 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IngestionSettingsListTokensSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IngestionSettingsListTokensSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for IngestionSettings ListTokens. */ public final class IngestionSettingsListTokensSamples { /* @@ -17,6 +15,6 @@ public final class IngestionSettingsListTokensSamples { * @param manager Entry point to SecurityManager. */ public static void listIngestionSettingTokens(com.azure.resourcemanager.security.SecurityManager manager) { - manager.ingestionSettings().listTokensWithResponse("default", Context.NONE); + manager.ingestionSettings().listTokensWithResponse("default", com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionAnalyticsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionAnalyticsGetSamples.java index a730f27225dc7..3e2799e0950ca 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionAnalyticsGetSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionAnalyticsGetSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for IotSecuritySolutionAnalytics Get. */ public final class IotSecuritySolutionAnalyticsGetSamples { /* @@ -17,6 +15,6 @@ public final class IotSecuritySolutionAnalyticsGetSamples { * @param manager Entry point to SecurityManager. */ public static void getSecuritySolutionAnalytics(com.azure.resourcemanager.security.SecurityManager manager) { - manager.iotSecuritySolutionAnalytics().getWithResponse("MyGroup", "default", Context.NONE); + manager.iotSecuritySolutionAnalytics().getWithResponse("MyGroup", "default", com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionAnalyticsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionAnalyticsListSamples.java index ea9d60a61c130..970f32858c276 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionAnalyticsListSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionAnalyticsListSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for IotSecuritySolutionAnalytics List. */ public final class IotSecuritySolutionAnalyticsListSamples { /* @@ -17,6 +15,6 @@ public final class IotSecuritySolutionAnalyticsListSamples { * @param manager Entry point to SecurityManager. */ public static void getSecuritySolutionAnalytics(com.azure.resourcemanager.security.SecurityManager manager) { - manager.iotSecuritySolutionAnalytics().listWithResponse("MyGroup", "default", Context.NONE); + manager.iotSecuritySolutionAnalytics().listWithResponse("MyGroup", "default", com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionDeleteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionDeleteSamples.java index 5db96c94994d1..fdb129e8fe06f 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionDeleteSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionDeleteSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for IotSecuritySolution Delete. */ public final class IotSecuritySolutionDeleteSamples { /* @@ -17,6 +15,8 @@ public final class IotSecuritySolutionDeleteSamples { * @param manager Entry point to SecurityManager. */ public static void deleteAnIoTSecuritySolution(com.azure.resourcemanager.security.SecurityManager manager) { - manager.iotSecuritySolutions().deleteByResourceGroupWithResponse("MyGroup", "default", Context.NONE); + manager + .iotSecuritySolutions() + .deleteByResourceGroupWithResponse("MyGroup", "default", com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionGetByResourceGroupSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionGetByResourceGroupSamples.java index ed7eaa93f72ac..11e0c535e4404 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionGetByResourceGroupSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionGetByResourceGroupSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for IotSecuritySolution GetByResourceGroup. */ public final class IotSecuritySolutionGetByResourceGroupSamples { /* @@ -17,6 +15,8 @@ public final class IotSecuritySolutionGetByResourceGroupSamples { * @param manager Entry point to SecurityManager. */ public static void getAIoTSecuritySolution(com.azure.resourcemanager.security.SecurityManager manager) { - manager.iotSecuritySolutions().getByResourceGroupWithResponse("MyGroup", "default", Context.NONE); + manager + .iotSecuritySolutions() + .getByResourceGroupWithResponse("MyGroup", "default", com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionListByResourceGroupSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionListByResourceGroupSamples.java index c7ac3f499ea34..aae2ee5ad1200 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionListByResourceGroupSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionListByResourceGroupSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for IotSecuritySolution ListByResourceGroup. */ public final class IotSecuritySolutionListByResourceGroupSamples { /* @@ -24,7 +22,7 @@ public static void listIoTSecuritySolutionsByResourceGroupAndIoTHub( "MyRg", "properties.iotHubs/any(i eq" + " \"/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/FirstIotHub\")", - Context.NONE); + com.azure.core.util.Context.NONE); } /* @@ -37,6 +35,6 @@ public static void listIoTSecuritySolutionsByResourceGroupAndIoTHub( */ public static void listIoTSecuritySolutionsByResourceGroup( com.azure.resourcemanager.security.SecurityManager manager) { - manager.iotSecuritySolutions().listByResourceGroup("MyGroup", null, Context.NONE); + manager.iotSecuritySolutions().listByResourceGroup("MyGroup", null, com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionListSamples.java index db8995d2d7a49..d9db4bb4ee727 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionListSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionListSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for IotSecuritySolution List. */ public final class IotSecuritySolutionListSamples { /* @@ -18,7 +16,7 @@ public final class IotSecuritySolutionListSamples { */ public static void listIoTSecuritySolutionsBySubscription( com.azure.resourcemanager.security.SecurityManager manager) { - manager.iotSecuritySolutions().list(null, Context.NONE); + manager.iotSecuritySolutions().list(null, com.azure.core.util.Context.NONE); } /* @@ -35,6 +33,6 @@ public static void listIoTSecuritySolutionsByIoTHub(com.azure.resourcemanager.se .list( "properties.iotHubs/any(i eq" + " \"/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/FirstIotHub\")", - Context.NONE); + com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionUpdateSamples.java index 91b615ae42ace..a051bd1be9ad3 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionUpdateSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionUpdateSamples.java @@ -4,7 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; import com.azure.resourcemanager.security.models.IoTSecuritySolutionModel; import com.azure.resourcemanager.security.models.RecommendationConfigStatus; import com.azure.resourcemanager.security.models.RecommendationConfigurationProperties; @@ -27,7 +26,10 @@ public final class IotSecuritySolutionUpdateSamples { public static void useThisMethodToUpdateExistingIoTSecuritySolution( com.azure.resourcemanager.security.SecurityManager manager) { IoTSecuritySolutionModel resource = - manager.iotSecuritySolutions().getByResourceGroupWithResponse("myRg", "default", Context.NONE).getValue(); + manager + .iotSecuritySolutions() + .getByResourceGroupWithResponse("myRg", "default", com.azure.core.util.Context.NONE) + .getValue(); resource .update() .withTags(mapOf("foo", "bar")) diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsAnalyticsAggregatedAlertDismissSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsAnalyticsAggregatedAlertDismissSamples.java index 195f009e4ee21..a0de4c8e44577 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsAnalyticsAggregatedAlertDismissSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsAnalyticsAggregatedAlertDismissSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for IotSecuritySolutionsAnalyticsAggregatedAlert Dismiss. */ public final class IotSecuritySolutionsAnalyticsAggregatedAlertDismissSamples { /* @@ -20,6 +18,10 @@ public static void dismissAnAggregatedIoTSecuritySolutionAlert( com.azure.resourcemanager.security.SecurityManager manager) { manager .iotSecuritySolutionsAnalyticsAggregatedAlerts() - .dismissWithResponse("IoTEdgeResources", "default", "IoT_Bruteforce_Fail/2019-02-02/dismiss", Context.NONE); + .dismissWithResponse( + "IoTEdgeResources", + "default", + "IoT_Bruteforce_Fail/2019-02-02/dismiss", + com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsAnalyticsAggregatedAlertGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsAnalyticsAggregatedAlertGetSamples.java index 1ec0b400137ba..7f3477220cbc0 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsAnalyticsAggregatedAlertGetSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsAnalyticsAggregatedAlertGetSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for IotSecuritySolutionsAnalyticsAggregatedAlert Get. */ public final class IotSecuritySolutionsAnalyticsAggregatedAlertGetSamples { /* @@ -22,6 +20,6 @@ public final class IotSecuritySolutionsAnalyticsAggregatedAlertGetSamples { com.azure.resourcemanager.security.SecurityManager manager) { manager .iotSecuritySolutionsAnalyticsAggregatedAlerts() - .getWithResponse("MyGroup", "default", "IoT_Bruteforce_Fail/2019-02-02", Context.NONE); + .getWithResponse("MyGroup", "default", "IoT_Bruteforce_Fail/2019-02-02", com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsAnalyticsAggregatedAlertListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsAnalyticsAggregatedAlertListSamples.java index 2a5d44e133544..1118e3bf77cf7 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsAnalyticsAggregatedAlertListSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsAnalyticsAggregatedAlertListSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for IotSecuritySolutionsAnalyticsAggregatedAlert List. */ public final class IotSecuritySolutionsAnalyticsAggregatedAlertListSamples { /* @@ -18,6 +16,8 @@ public final class IotSecuritySolutionsAnalyticsAggregatedAlertListSamples { */ public static void getTheAggregatedAlertListOfYoursIoTSecuritySolution( com.azure.resourcemanager.security.SecurityManager manager) { - manager.iotSecuritySolutionsAnalyticsAggregatedAlerts().list("MyGroup", "default", null, Context.NONE); + manager + .iotSecuritySolutionsAnalyticsAggregatedAlerts() + .list("MyGroup", "default", null, com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsAnalyticsRecommendationGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsAnalyticsRecommendationGetSamples.java index deb456d305d91..f97da5af90aee 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsAnalyticsRecommendationGetSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsAnalyticsRecommendationGetSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for IotSecuritySolutionsAnalyticsRecommendation Get. */ public final class IotSecuritySolutionsAnalyticsRecommendationGetSamples { /* @@ -20,6 +18,6 @@ public static void getTheAggregatedSecurityAnalyticsRecommendationOfYoursIoTSecu com.azure.resourcemanager.security.SecurityManager manager) { manager .iotSecuritySolutionsAnalyticsRecommendations() - .getWithResponse("IoTEdgeResources", "default", "OpenPortsOnDevice", Context.NONE); + .getWithResponse("IoTEdgeResources", "default", "OpenPortsOnDevice", com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsAnalyticsRecommendationListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsAnalyticsRecommendationListSamples.java index d62d0c7b56fa0..8c0c7b4fb1e01 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsAnalyticsRecommendationListSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsAnalyticsRecommendationListSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for IotSecuritySolutionsAnalyticsRecommendation List. */ public final class IotSecuritySolutionsAnalyticsRecommendationListSamples { /* @@ -18,6 +16,8 @@ public final class IotSecuritySolutionsAnalyticsRecommendationListSamples { */ public static void getTheListOfAggregatedSecurityAnalyticsRecommendationsOfYoursIoTSecuritySolution( com.azure.resourcemanager.security.SecurityManager manager) { - manager.iotSecuritySolutionsAnalyticsRecommendations().list("IoTEdgeResources", "default", null, Context.NONE); + manager + .iotSecuritySolutionsAnalyticsRecommendations() + .list("IoTEdgeResources", "default", null, com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesDeleteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesDeleteSamples.java index 901e757aee799..681a042bb5291 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesDeleteSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesDeleteSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for JitNetworkAccessPolicies Delete. */ public final class JitNetworkAccessPoliciesDeleteSamples { /* @@ -17,6 +15,8 @@ public final class JitNetworkAccessPoliciesDeleteSamples { * @param manager Entry point to SecurityManager. */ public static void deleteAJITNetworkAccessPolicy(com.azure.resourcemanager.security.SecurityManager manager) { - manager.jitNetworkAccessPolicies().deleteWithResponse("myRg1", "westeurope", "default", Context.NONE); + manager + .jitNetworkAccessPolicies() + .deleteWithResponse("myRg1", "westeurope", "default", com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesGetSamples.java index 7980fe421c11a..ab72d150b50e1 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesGetSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesGetSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for JitNetworkAccessPolicies Get. */ public final class JitNetworkAccessPoliciesGetSamples { /* @@ -17,6 +15,8 @@ public final class JitNetworkAccessPoliciesGetSamples { * @param manager Entry point to SecurityManager. */ public static void getJITNetworkAccessPolicy(com.azure.resourcemanager.security.SecurityManager manager) { - manager.jitNetworkAccessPolicies().getWithResponse("myRg1", "westeurope", "default", Context.NONE); + manager + .jitNetworkAccessPolicies() + .getWithResponse("myRg1", "westeurope", "default", com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesInitiateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesInitiateSamples.java index 580773955da76..9d338d8dffea9 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesInitiateSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesInitiateSamples.java @@ -4,7 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; import com.azure.resourcemanager.security.models.JitNetworkAccessPolicyInitiatePort; import com.azure.resourcemanager.security.models.JitNetworkAccessPolicyInitiateRequest; import com.azure.resourcemanager.security.models.JitNetworkAccessPolicyInitiateVirtualMachine; @@ -42,6 +41,6 @@ public static void initiateAnActionOnAJITNetworkAccessPolicy( .withNumber(3389) .withAllowedSourceAddressPrefix("192.127.0.2"))))) .withJustification("testing a new version of the product"), - Context.NONE); + com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesListByRegionSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesListByRegionSamples.java index 1b28bab688c3d..9406cd00796cd 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesListByRegionSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesListByRegionSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for JitNetworkAccessPolicies ListByRegion. */ public final class JitNetworkAccessPoliciesListByRegionSamples { /* @@ -18,6 +16,6 @@ public final class JitNetworkAccessPoliciesListByRegionSamples { */ public static void getJITNetworkAccessPoliciesOnASubscriptionFromASecurityDataLocation( com.azure.resourcemanager.security.SecurityManager manager) { - manager.jitNetworkAccessPolicies().listByRegion("westeurope", Context.NONE); + manager.jitNetworkAccessPolicies().listByRegion("westeurope", com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesListByResourceGroupAndRegionSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesListByResourceGroupAndRegionSamples.java index 6c889374a2e07..36a229436cf0a 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesListByResourceGroupAndRegionSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesListByResourceGroupAndRegionSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for JitNetworkAccessPolicies ListByResourceGroupAndRegion. */ public final class JitNetworkAccessPoliciesListByResourceGroupAndRegionSamples { /* @@ -18,6 +16,8 @@ public final class JitNetworkAccessPoliciesListByResourceGroupAndRegionSamples { */ public static void getJITNetworkAccessPoliciesOnAResourceGroupFromASecurityDataLocation( com.azure.resourcemanager.security.SecurityManager manager) { - manager.jitNetworkAccessPolicies().listByResourceGroupAndRegion("myRg1", "westeurope", Context.NONE); + manager + .jitNetworkAccessPolicies() + .listByResourceGroupAndRegion("myRg1", "westeurope", com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesListByResourceGroupSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesListByResourceGroupSamples.java index 9869861f626ed..2959d77976c61 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesListByResourceGroupSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesListByResourceGroupSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for JitNetworkAccessPolicies ListByResourceGroup. */ public final class JitNetworkAccessPoliciesListByResourceGroupSamples { /* @@ -18,6 +16,6 @@ public final class JitNetworkAccessPoliciesListByResourceGroupSamples { */ public static void getJITNetworkAccessPoliciesOnAResourceGroup( com.azure.resourcemanager.security.SecurityManager manager) { - manager.jitNetworkAccessPolicies().listByResourceGroup("myRg1", Context.NONE); + manager.jitNetworkAccessPolicies().listByResourceGroup("myRg1", com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesListSamples.java index 282237c4306dc..fed5a8ee0a89f 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesListSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesListSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for JitNetworkAccessPolicies List. */ public final class JitNetworkAccessPoliciesListSamples { /* @@ -18,6 +16,6 @@ public final class JitNetworkAccessPoliciesListSamples { */ public static void getJITNetworkAccessPoliciesOnASubscription( com.azure.resourcemanager.security.SecurityManager manager) { - manager.jitNetworkAccessPolicies().list(Context.NONE); + manager.jitNetworkAccessPolicies().list(com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/LocationsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/LocationsGetSamples.java index 67816790d9a44..cb46980fa1c76 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/LocationsGetSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/LocationsGetSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for Locations Get. */ public final class LocationsGetSamples { /* @@ -17,6 +15,6 @@ public final class LocationsGetSamples { * @param manager Entry point to SecurityManager. */ public static void getSecurityDataLocation(com.azure.resourcemanager.security.SecurityManager manager) { - manager.locations().getWithResponse("centralus", Context.NONE); + manager.locations().getWithResponse("centralus", com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/LocationsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/LocationsListSamples.java index ef4c1b59677d1..2dd2e99e2b868 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/LocationsListSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/LocationsListSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for Locations List. */ public final class LocationsListSamples { /* @@ -17,6 +15,6 @@ public final class LocationsListSamples { * @param manager Entry point to SecurityManager. */ public static void getSecurityDataLocations(com.azure.resourcemanager.security.SecurityManager manager) { - manager.locations().list(Context.NONE); + manager.locations().list(com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/MdeOnboardingsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/MdeOnboardingsGetSamples.java index a1d769d0f6340..427bf4a9f9557 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/MdeOnboardingsGetSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/MdeOnboardingsGetSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for MdeOnboardings Get. */ public final class MdeOnboardingsGetSamples { /* @@ -18,6 +16,6 @@ public final class MdeOnboardingsGetSamples { */ public static void theDefaultConfigurationOrDataNeededToOnboardTheMachineToMDE( com.azure.resourcemanager.security.SecurityManager manager) { - manager.mdeOnboardings().getWithResponse(Context.NONE); + manager.mdeOnboardings().getWithResponse(com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/MdeOnboardingsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/MdeOnboardingsListSamples.java index 2fa5b118906d8..61075a1ba98bd 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/MdeOnboardingsListSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/MdeOnboardingsListSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for MdeOnboardings List. */ public final class MdeOnboardingsListSamples { /* @@ -18,6 +16,6 @@ public final class MdeOnboardingsListSamples { */ public static void theConfigurationOrDataNeededToOnboardTheMachineToMDE( com.azure.resourcemanager.security.SecurityManager manager) { - manager.mdeOnboardings().listWithResponse(Context.NONE); + manager.mdeOnboardings().listWithResponse(com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/PricingsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/PricingsGetSamples.java index 4ae5d26f05cbf..00100d9230d1b 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/PricingsGetSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/PricingsGetSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for Pricings Get. */ public final class PricingsGetSamples { /* @@ -17,6 +15,6 @@ public final class PricingsGetSamples { * @param manager Entry point to SecurityManager. */ public static void getPricingsOnSubscription(com.azure.resourcemanager.security.SecurityManager manager) { - manager.pricings().getWithResponse("VirtualMachines", Context.NONE); + manager.pricings().getWithResponse("VirtualMachines", com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/PricingsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/PricingsListSamples.java index b2b1e9b13a72f..57707d29659a4 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/PricingsListSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/PricingsListSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for Pricings List. */ public final class PricingsListSamples { /* @@ -17,6 +15,6 @@ public final class PricingsListSamples { * @param manager Entry point to SecurityManager. */ public static void getPricingsOnSubscription(com.azure.resourcemanager.security.SecurityManager manager) { - manager.pricings().listWithResponse(Context.NONE); + manager.pricings().listWithResponse(com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/PricingsUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/PricingsUpdateSamples.java index 550bcec527582..87d52ed76d486 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/PricingsUpdateSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/PricingsUpdateSamples.java @@ -4,7 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; import com.azure.resourcemanager.security.fluent.models.PricingInner; import com.azure.resourcemanager.security.models.PricingTier; @@ -24,6 +23,6 @@ public static void updatePricingOnSubscription(com.azure.resourcemanager.securit .updateWithResponse( "VirtualMachines", new PricingInner().withPricingTier(PricingTier.STANDARD).withSubPlan("P2"), - Context.NONE); + com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceAssessmentsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceAssessmentsGetSamples.java index f738a6e89a514..dd1e94f9e3689 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceAssessmentsGetSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceAssessmentsGetSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for RegulatoryComplianceAssessments Get. */ public final class RegulatoryComplianceAssessmentsGetSamples { /* @@ -20,6 +18,7 @@ public static void getSelectedRegulatoryComplianceAssessmentDetailsAndState( com.azure.resourcemanager.security.SecurityManager manager) { manager .regulatoryComplianceAssessments() - .getWithResponse("PCI-DSS-3.2", "1.1", "968548cb-02b3-8cd2-11f8-0cf64ab1a347", Context.NONE); + .getWithResponse( + "PCI-DSS-3.2", "1.1", "968548cb-02b3-8cd2-11f8-0cf64ab1a347", com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceAssessmentsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceAssessmentsListSamples.java index 625601c1643d4..20cb2b2db966e 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceAssessmentsListSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceAssessmentsListSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for RegulatoryComplianceAssessments List. */ public final class RegulatoryComplianceAssessmentsListSamples { /* @@ -18,6 +16,6 @@ public final class RegulatoryComplianceAssessmentsListSamples { */ public static void getAllAssessmentsMappedToSelectedRegulatoryComplianceControl( com.azure.resourcemanager.security.SecurityManager manager) { - manager.regulatoryComplianceAssessments().list("PCI-DSS-3.2", "1.1", null, Context.NONE); + manager.regulatoryComplianceAssessments().list("PCI-DSS-3.2", "1.1", null, com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceControlsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceControlsGetSamples.java index 75cf0f0987626..6e2e8932e0636 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceControlsGetSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceControlsGetSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for RegulatoryComplianceControls Get. */ public final class RegulatoryComplianceControlsGetSamples { /* @@ -18,6 +16,6 @@ public final class RegulatoryComplianceControlsGetSamples { */ public static void getSelectedRegulatoryComplianceControlDetailsAndState( com.azure.resourcemanager.security.SecurityManager manager) { - manager.regulatoryComplianceControls().getWithResponse("PCI-DSS-3.2", "1.1", Context.NONE); + manager.regulatoryComplianceControls().getWithResponse("PCI-DSS-3.2", "1.1", com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceControlsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceControlsListSamples.java index cbbe872370a38..5ec769b1b499c 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceControlsListSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceControlsListSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for RegulatoryComplianceControls List. */ public final class RegulatoryComplianceControlsListSamples { /* @@ -18,6 +16,6 @@ public final class RegulatoryComplianceControlsListSamples { */ public static void getAllRegulatoryComplianceControlsDetailsAndStateForSelectedStandard( com.azure.resourcemanager.security.SecurityManager manager) { - manager.regulatoryComplianceControls().list("PCI-DSS-3.2", null, Context.NONE); + manager.regulatoryComplianceControls().list("PCI-DSS-3.2", null, com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceStandardsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceStandardsGetSamples.java index 23d37a285792a..2210e75907711 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceStandardsGetSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceStandardsGetSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for RegulatoryComplianceStandards Get. */ public final class RegulatoryComplianceStandardsGetSamples { /* @@ -18,6 +16,6 @@ public final class RegulatoryComplianceStandardsGetSamples { */ public static void getSelectedRegulatoryComplianceStandardDetailsAndState( com.azure.resourcemanager.security.SecurityManager manager) { - manager.regulatoryComplianceStandards().getWithResponse("PCI-DSS-3.2", Context.NONE); + manager.regulatoryComplianceStandards().getWithResponse("PCI-DSS-3.2", com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceStandardsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceStandardsListSamples.java index ba2eb53c723f7..67096678032e0 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceStandardsListSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceStandardsListSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for RegulatoryComplianceStandards List. */ public final class RegulatoryComplianceStandardsListSamples { /* @@ -18,6 +16,6 @@ public final class RegulatoryComplianceStandardsListSamples { */ public static void getAllSupportedRegulatoryComplianceStandardsDetailsAndState( com.azure.resourcemanager.security.SecurityManager manager) { - manager.regulatoryComplianceStandards().list(null, Context.NONE); + manager.regulatoryComplianceStandards().list(null, com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecureScoreControlDefinitionsListBySubscriptionSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecureScoreControlDefinitionsListBySubscriptionSamples.java index b9369eaff31f2..7fb94aceb9c1e 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecureScoreControlDefinitionsListBySubscriptionSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecureScoreControlDefinitionsListBySubscriptionSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for SecureScoreControlDefinitions ListBySubscription. */ public final class SecureScoreControlDefinitionsListBySubscriptionSamples { /* @@ -18,6 +16,6 @@ public final class SecureScoreControlDefinitionsListBySubscriptionSamples { */ public static void listSecurityControlsDefinitionBySubscription( com.azure.resourcemanager.security.SecurityManager manager) { - manager.secureScoreControlDefinitions().listBySubscription(Context.NONE); + manager.secureScoreControlDefinitions().listBySubscription(com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecureScoreControlDefinitionsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecureScoreControlDefinitionsListSamples.java index 5fbb2adbae3cc..c79e4f49431cd 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecureScoreControlDefinitionsListSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecureScoreControlDefinitionsListSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for SecureScoreControlDefinitions List. */ public final class SecureScoreControlDefinitionsListSamples { /* @@ -17,6 +15,6 @@ public final class SecureScoreControlDefinitionsListSamples { * @param manager Entry point to SecurityManager. */ public static void listSecurityControlsDefinition(com.azure.resourcemanager.security.SecurityManager manager) { - manager.secureScoreControlDefinitions().list(Context.NONE); + manager.secureScoreControlDefinitions().list(com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecureScoreControlsListBySecureScoreSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecureScoreControlsListBySecureScoreSamples.java index 455b442dd2e0d..49d280c3fa994 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecureScoreControlsListBySecureScoreSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecureScoreControlsListBySecureScoreSamples.java @@ -4,7 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; import com.azure.resourcemanager.security.models.ExpandControlsEnum; /** Samples for SecureScoreControls ListBySecureScore. */ @@ -20,7 +19,9 @@ public final class SecureScoreControlsListBySecureScoreSamples { */ public static void getSecurityControlsAndTheirCurrentScoreForTheSpecifiedInitiativeWithTheExpandParameter( com.azure.resourcemanager.security.SecurityManager manager) { - manager.secureScoreControls().listBySecureScore("ascScore", ExpandControlsEnum.DEFINITION, Context.NONE); + manager + .secureScoreControls() + .listBySecureScore("ascScore", ExpandControlsEnum.DEFINITION, com.azure.core.util.Context.NONE); } /* @@ -33,6 +34,6 @@ public static void getSecurityControlsAndTheirCurrentScoreForTheSpecifiedInitiat */ public static void getSecurityControlsAndTheirCurrentScoreForTheSpecifiedInitiative( com.azure.resourcemanager.security.SecurityManager manager) { - manager.secureScoreControls().listBySecureScore("ascScore", null, Context.NONE); + manager.secureScoreControls().listBySecureScore("ascScore", null, com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecureScoreControlsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecureScoreControlsListSamples.java index 69b765b9b8bbd..7a8e372c9394c 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecureScoreControlsListSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecureScoreControlsListSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for SecureScoreControls List. */ public final class SecureScoreControlsListSamples { /* @@ -17,6 +15,6 @@ public final class SecureScoreControlsListSamples { * @param manager Entry point to SecurityManager. */ public static void listAllSecureScoresControls(com.azure.resourcemanager.security.SecurityManager manager) { - manager.secureScoreControls().list(null, Context.NONE); + manager.secureScoreControls().list(null, com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecureScoresGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecureScoresGetSamples.java index a253c982e80a5..7c03ad1b48642 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecureScoresGetSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecureScoresGetSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for SecureScores Get. */ public final class SecureScoresGetSamples { /* @@ -17,6 +15,6 @@ public final class SecureScoresGetSamples { * @param manager Entry point to SecurityManager. */ public static void getSingleSecureScore(com.azure.resourcemanager.security.SecurityManager manager) { - manager.secureScores().getWithResponse("ascScore", Context.NONE); + manager.secureScores().getWithResponse("ascScore", com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecureScoresListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecureScoresListSamples.java index 1e67c7946beb5..8e80e1a1ec05b 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecureScoresListSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecureScoresListSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for SecureScores List. */ public final class SecureScoresListSamples { /* @@ -17,6 +15,6 @@ public final class SecureScoresListSamples { * @param manager Entry point to SecurityManager. */ public static void listSecureScores(com.azure.resourcemanager.security.SecurityManager manager) { - manager.secureScores().list(Context.NONE); + manager.secureScores().list(com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorApplicationOperationCreateOrUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorApplicationOperationCreateOrUpdateSamples.java index 07e98d6aeb865..201991a09b7ea 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorApplicationOperationCreateOrUpdateSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorApplicationOperationCreateOrUpdateSamples.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.security.generated; import com.azure.core.management.serializer.SerializerFactory; -import com.azure.core.util.Context; import com.azure.core.util.serializer.SerializerEncoding; import com.azure.resourcemanager.security.fluent.models.ApplicationInner; import com.azure.resourcemanager.security.models.ApplicationSourceResourceType; @@ -43,6 +42,6 @@ public static void createApplication(com.azure.resourcemanager.security.Security "{\"conditions\":[{\"operator\":\"contains\",\"property\":\"$.Id\",\"value\":\"-prod-\"}]}", Object.class, SerializerEncoding.JSON))), - Context.NONE); + com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorApplicationOperationDeleteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorApplicationOperationDeleteSamples.java index 2ff181af68717..abb0121eb39f0 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorApplicationOperationDeleteSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorApplicationOperationDeleteSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for SecurityConnectorApplicationOperation Delete. */ public final class SecurityConnectorApplicationOperationDeleteSamples { /* @@ -20,6 +18,9 @@ public static void deleteSecurityApplication(com.azure.resourcemanager.security. manager .securityConnectorApplicationOperations() .deleteWithResponse( - "gcpResourceGroup", "gcpconnector", "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", Context.NONE); + "gcpResourceGroup", + "gcpconnector", + "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", + com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorApplicationOperationGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorApplicationOperationGetSamples.java index a460cab453d1a..821fb72764d00 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorApplicationOperationGetSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorApplicationOperationGetSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for SecurityConnectorApplicationOperation Get. */ public final class SecurityConnectorApplicationOperationGetSamples { /* @@ -20,6 +18,10 @@ public static void getSecurityApplicationsBySpecificApplicationId( com.azure.resourcemanager.security.SecurityManager manager) { manager .securityConnectorApplicationOperations() - .getWithResponse("gcpResourceGroup", "gcpconnector", "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", Context.NONE); + .getWithResponse( + "gcpResourceGroup", + "gcpconnector", + "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", + com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorApplicationsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorApplicationsListSamples.java index 1865b1af0e81c..ec5b0b68372e3 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorApplicationsListSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorApplicationsListSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for SecurityConnectorApplications List. */ public final class SecurityConnectorApplicationsListSamples { /* @@ -18,6 +16,8 @@ public final class SecurityConnectorApplicationsListSamples { */ public static void listSecurityApplicationsBySecurityConnectorLevelScope( com.azure.resourcemanager.security.SecurityManager manager) { - manager.securityConnectorApplications().list("gcpResourceGroup", "gcpconnector", Context.NONE); + manager + .securityConnectorApplications() + .list("gcpResourceGroup", "gcpconnector", com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorGovernanceRuleListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorGovernanceRuleListSamples.java deleted file mode 100644 index ba982a6515d25..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorGovernanceRuleListSamples.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.Context; - -/** Samples for SecurityConnectorGovernanceRule List. */ -public final class SecurityConnectorGovernanceRuleListSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/ListBySecurityConnectorGovernanceRules_example.json - */ - /** - * Sample code: List security governanceRules by security connector level scope. - * - * @param manager Entry point to SecurityManager. - */ - public static void listSecurityGovernanceRulesBySecurityConnectorLevelScope( - com.azure.resourcemanager.security.SecurityManager manager) { - manager.securityConnectorGovernanceRules().list("gcpResourceGroup", "gcpconnector", Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorGovernanceRulesExecuteStatusGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorGovernanceRulesExecuteStatusGetSamples.java deleted file mode 100644 index 455463d5e7a97..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorGovernanceRulesExecuteStatusGetSamples.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.Context; - -/** Samples for SecurityConnectorGovernanceRulesExecuteStatus Get. */ -public final class SecurityConnectorGovernanceRulesExecuteStatusGetSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/GetSecurityConnectorGovernanceRuleExecuteStatus_example.json - */ - /** - * Sample code: Get security governanceRules execution status by specific governanceRuleId. - * - * @param manager Entry point to SecurityManager. - */ - public static void getSecurityGovernanceRulesExecutionStatusBySpecificGovernanceRuleId( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .securityConnectorGovernanceRulesExecuteStatus() - .get( - "gcpResourceGroup", - "gcpconnector", - "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", - "58b33f4f-c8c7-4b01-99cc-d437db4d40dd", - Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorGovernanceRulesOperationCreateOrUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorGovernanceRulesOperationCreateOrUpdateSamples.java deleted file mode 100644 index 04da624d84f8e..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorGovernanceRulesOperationCreateOrUpdateSamples.java +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.management.serializer.SerializerFactory; -import com.azure.core.util.Context; -import com.azure.core.util.serializer.SerializerEncoding; -import com.azure.resourcemanager.security.fluent.models.GovernanceRuleInner; -import com.azure.resourcemanager.security.models.GovernanceRuleEmailNotification; -import com.azure.resourcemanager.security.models.GovernanceRuleOwnerSource; -import com.azure.resourcemanager.security.models.GovernanceRuleOwnerSourceType; -import com.azure.resourcemanager.security.models.GovernanceRuleSourceResourceType; -import com.azure.resourcemanager.security.models.GovernanceRuleType; -import java.io.IOException; -import java.util.Arrays; - -/** Samples for SecurityConnectorGovernanceRulesOperation CreateOrUpdate. */ -public final class SecurityConnectorGovernanceRulesOperationCreateOrUpdateSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/PutSecurityConnectorGovernanceRule_example.json - */ - /** - * Sample code: Create Governance rule. - * - * @param manager Entry point to SecurityManager. - */ - public static void createGovernanceRule(com.azure.resourcemanager.security.SecurityManager manager) - throws IOException { - manager - .securityConnectorGovernanceRulesOperations() - .createOrUpdateWithResponse( - "gcpResourceGroup", - "gcpconnector", - "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", - new GovernanceRuleInner() - .withDisplayName("GCP Admin's rule") - .withDescription("A rule on critical GCP recommendations") - .withRemediationTimeframe("7.00:00:00") - .withIsGracePeriod(true) - .withRulePriority(200) - .withIsDisabled(false) - .withRuleType(GovernanceRuleType.INTEGRATED) - .withSourceResourceType(GovernanceRuleSourceResourceType.ASSESSMENTS) - .withConditionSets( - Arrays - .asList( - SerializerFactory - .createDefaultManagementSerializerAdapter() - .deserialize( - "{\"conditions\":[{\"operator\":\"In\",\"property\":\"$.AssessmentKey\",\"value\":\"[\\\"b1cd27e0-4ecc-4246-939f-49c426d9d72f\\\"," - + " \\\"fe83f80b-073d-4ccf-93d9-6797eb870201\\\"]\"}]}", - Object.class, - SerializerEncoding.JSON))) - .withOwnerSource( - new GovernanceRuleOwnerSource() - .withType(GovernanceRuleOwnerSourceType.MANUALLY) - .withValue("user@contoso.com")) - .withGovernanceEmailNotification( - new GovernanceRuleEmailNotification() - .withDisableManagerEmailNotification(true) - .withDisableOwnerEmailNotification(false)), - Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorGovernanceRulesOperationDeleteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorGovernanceRulesOperationDeleteSamples.java deleted file mode 100644 index 2c60c9d3542bb..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorGovernanceRulesOperationDeleteSamples.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.Context; - -/** Samples for SecurityConnectorGovernanceRulesOperation Delete. */ -public final class SecurityConnectorGovernanceRulesOperationDeleteSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/DeleteSecurityConnectorGovernanceRule_example.json - */ - /** - * Sample code: Delete security GovernanceRule. - * - * @param manager Entry point to SecurityManager. - */ - public static void deleteSecurityGovernanceRule(com.azure.resourcemanager.security.SecurityManager manager) { - manager - .securityConnectorGovernanceRulesOperations() - .deleteWithResponse( - "gcpResourceGroup", "gcpconnector", "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorGovernanceRulesOperationGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorGovernanceRulesOperationGetSamples.java deleted file mode 100644 index 16caffc3a7038..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorGovernanceRulesOperationGetSamples.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.Context; - -/** Samples for SecurityConnectorGovernanceRulesOperation Get. */ -public final class SecurityConnectorGovernanceRulesOperationGetSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/GetSecurityConnectorGovernanceRule_example.json - */ - /** - * Sample code: Get security governanceRules by specific governanceRuleId. - * - * @param manager Entry point to SecurityManager. - */ - public static void getSecurityGovernanceRulesBySpecificGovernanceRuleId( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .securityConnectorGovernanceRulesOperations() - .getWithResponse("gcpResourceGroup", "gcpconnector", "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorsDeleteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorsDeleteSamples.java index a553f1969ac1a..5ae1585411030 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorsDeleteSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorsDeleteSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for SecurityConnectors Delete. */ public final class SecurityConnectorsDeleteSamples { /* @@ -17,6 +15,8 @@ public final class SecurityConnectorsDeleteSamples { * @param manager Entry point to SecurityManager. */ public static void deleteASecurityConnector(com.azure.resourcemanager.security.SecurityManager manager) { - manager.securityConnectors().deleteByResourceGroupWithResponse("myRg", "mySecurityConnectorName", Context.NONE); + manager + .securityConnectors() + .deleteByResourceGroupWithResponse("myRg", "mySecurityConnectorName", com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorsGetByResourceGroupSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorsGetByResourceGroupSamples.java index 0ccb35001bbab..71658c80acaa7 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorsGetByResourceGroupSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorsGetByResourceGroupSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for SecurityConnectors GetByResourceGroup. */ public final class SecurityConnectorsGetByResourceGroupSamples { /* @@ -19,6 +17,7 @@ public final class SecurityConnectorsGetByResourceGroupSamples { public static void retrieveASecurityConnector(com.azure.resourcemanager.security.SecurityManager manager) { manager .securityConnectors() - .getByResourceGroupWithResponse("exampleResourceGroup", "exampleSecurityConnectorName", Context.NONE); + .getByResourceGroupWithResponse( + "exampleResourceGroup", "exampleSecurityConnectorName", com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorsListByResourceGroupSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorsListByResourceGroupSamples.java index 6e6ba11333b83..7ef176cdabd6d 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorsListByResourceGroupSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorsListByResourceGroupSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for SecurityConnectors ListByResourceGroup. */ public final class SecurityConnectorsListByResourceGroupSamples { /* @@ -18,6 +16,6 @@ public final class SecurityConnectorsListByResourceGroupSamples { */ public static void listAllSecurityConnectorsOfASpecifiedResourceGroup( com.azure.resourcemanager.security.SecurityManager manager) { - manager.securityConnectors().listByResourceGroup("exampleResourceGroup", Context.NONE); + manager.securityConnectors().listByResourceGroup("exampleResourceGroup", com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorsListSamples.java index fbbcac8e526d0..7ffad4112de98 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorsListSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorsListSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for SecurityConnectors List. */ public final class SecurityConnectorsListSamples { /* @@ -18,6 +16,6 @@ public final class SecurityConnectorsListSamples { */ public static void listAllSecurityConnectorsOfASpecifiedSubscription( com.azure.resourcemanager.security.SecurityManager manager) { - manager.securityConnectors().list(Context.NONE); + manager.securityConnectors().list(com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorsUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorsUpdateSamples.java index 722e512832cf0..69c6877ab8066 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorsUpdateSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorsUpdateSamples.java @@ -4,7 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; import com.azure.resourcemanager.security.models.AwsEnvironmentData; import com.azure.resourcemanager.security.models.CloudName; import com.azure.resourcemanager.security.models.CspmMonitorAwsOffering; @@ -28,7 +27,8 @@ public static void updateASecurityConnector(com.azure.resourcemanager.security.S SecurityConnector resource = manager .securityConnectors() - .getByResourceGroupWithResponse("exampleResourceGroup", "exampleSecurityConnectorName", Context.NONE) + .getByResourceGroupWithResponse( + "exampleResourceGroup", "exampleSecurityConnectorName", com.azure.core.util.Context.NONE) .getValue(); resource .update() diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityContactsDeleteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityContactsDeleteSamples.java index 16d4d4f65df06..98c33bc4588f3 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityContactsDeleteSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityContactsDeleteSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for SecurityContacts Delete. */ public final class SecurityContactsDeleteSamples { /* @@ -17,6 +15,6 @@ public final class SecurityContactsDeleteSamples { * @param manager Entry point to SecurityManager. */ public static void deletesASecurityContactData(com.azure.resourcemanager.security.SecurityManager manager) { - manager.securityContacts().deleteWithResponse("default", Context.NONE); + manager.securityContacts().deleteWithResponse("default", com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityContactsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityContactsGetSamples.java index e3446a09afef3..dae37c8f541a0 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityContactsGetSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityContactsGetSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for SecurityContacts Get. */ public final class SecurityContactsGetSamples { /* @@ -17,6 +15,6 @@ public final class SecurityContactsGetSamples { * @param manager Entry point to SecurityManager. */ public static void getASecurityContact(com.azure.resourcemanager.security.SecurityManager manager) { - manager.securityContacts().getWithResponse("default", Context.NONE); + manager.securityContacts().getWithResponse("default", com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityContactsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityContactsListSamples.java index 223df9dc3f2f6..5faedd5eb8e6a 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityContactsListSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityContactsListSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for SecurityContacts List. */ public final class SecurityContactsListSamples { /* @@ -17,6 +15,6 @@ public final class SecurityContactsListSamples { * @param manager Entry point to SecurityManager. */ public static void listSecurityContactData(com.azure.resourcemanager.security.SecurityManager manager) { - manager.securityContacts().list(Context.NONE); + manager.securityContacts().list(com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecuritySolutionsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecuritySolutionsGetSamples.java index 5f533886dc031..8e97ea287cbc7 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecuritySolutionsGetSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecuritySolutionsGetSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for SecuritySolutions Get. */ public final class SecuritySolutionsGetSamples { /* @@ -18,6 +16,8 @@ public final class SecuritySolutionsGetSamples { */ public static void getASecuritySolutionFromASecurityDataLocation( com.azure.resourcemanager.security.SecurityManager manager) { - manager.securitySolutions().getWithResponse("myRg2", "centralus", "paloalto7", Context.NONE); + manager + .securitySolutions() + .getWithResponse("myRg2", "centralus", "paloalto7", com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecuritySolutionsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecuritySolutionsListSamples.java index 8591a99ebc7b7..cd069ae64f546 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecuritySolutionsListSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecuritySolutionsListSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for SecuritySolutions List. */ public final class SecuritySolutionsListSamples { /* @@ -17,6 +15,6 @@ public final class SecuritySolutionsListSamples { * @param manager Entry point to SecurityManager. */ public static void getSecuritySolutions(com.azure.resourcemanager.security.SecurityManager manager) { - manager.securitySolutions().list(Context.NONE); + manager.securitySolutions().list(com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecuritySolutionsReferenceDataListByHomeRegionSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecuritySolutionsReferenceDataListByHomeRegionSamples.java index 53299f538ba13..95bd652250420 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecuritySolutionsReferenceDataListByHomeRegionSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecuritySolutionsReferenceDataListByHomeRegionSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for SecuritySolutionsReferenceData ListByHomeRegion. */ public final class SecuritySolutionsReferenceDataListByHomeRegionSamples { /* @@ -18,6 +16,8 @@ public final class SecuritySolutionsReferenceDataListByHomeRegionSamples { */ public static void getSecuritySolutionsFromASecurityDataLocation( com.azure.resourcemanager.security.SecurityManager manager) { - manager.securitySolutionsReferenceDatas().listByHomeRegionWithResponse("westcentralus", Context.NONE); + manager + .securitySolutionsReferenceDatas() + .listByHomeRegionWithResponse("westcentralus", com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecuritySolutionsReferenceDataListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecuritySolutionsReferenceDataListSamples.java index dfa11f8c404e8..a8d096022f4d2 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecuritySolutionsReferenceDataListSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecuritySolutionsReferenceDataListSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for SecuritySolutionsReferenceData List. */ public final class SecuritySolutionsReferenceDataListSamples { /* @@ -17,6 +15,6 @@ public final class SecuritySolutionsReferenceDataListSamples { * @param manager Entry point to SecurityManager. */ public static void getSecuritySolutions(com.azure.resourcemanager.security.SecurityManager manager) { - manager.securitySolutionsReferenceDatas().listWithResponse(Context.NONE); + manager.securitySolutionsReferenceDatas().listWithResponse(com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentCreateOrUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentCreateOrUpdateSamples.java index fe3017416bf1a..ed274653d4c66 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentCreateOrUpdateSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentCreateOrUpdateSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for ServerVulnerabilityAssessment CreateOrUpdate. */ public final class ServerVulnerabilityAssessmentCreateOrUpdateSamples { /* @@ -22,6 +20,7 @@ public final class ServerVulnerabilityAssessmentCreateOrUpdateSamples { com.azure.resourcemanager.security.SecurityManager manager) { manager .serverVulnerabilityAssessments() - .createOrUpdateWithResponse("rg1", "Microsoft.Compute", "virtualMachines", "vm1", Context.NONE); + .createOrUpdateWithResponse( + "rg1", "Microsoft.Compute", "virtualMachines", "vm1", com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentDeleteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentDeleteSamples.java index 056566f775603..f21b5996ca05b 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentDeleteSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentDeleteSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for ServerVulnerabilityAssessment Delete. */ public final class ServerVulnerabilityAssessmentDeleteSamples { /* @@ -22,6 +20,6 @@ public final class ServerVulnerabilityAssessmentDeleteSamples { com.azure.resourcemanager.security.SecurityManager manager) { manager .serverVulnerabilityAssessments() - .delete("rg1", "Microsoft.Compute", "virtualMachines", "vm1", Context.NONE); + .delete("rg1", "Microsoft.Compute", "virtualMachines", "vm1", com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentGetSamples.java index 50daf86f9917b..c09f90755c086 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentGetSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentGetSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for ServerVulnerabilityAssessment Get. */ public final class ServerVulnerabilityAssessmentGetSamples { /* @@ -22,6 +20,6 @@ public final class ServerVulnerabilityAssessmentGetSamples { com.azure.resourcemanager.security.SecurityManager manager) { manager .serverVulnerabilityAssessments() - .getWithResponse("rg1", "Microsoft.Compute", "virtualMachines", "vm1", Context.NONE); + .getWithResponse("rg1", "Microsoft.Compute", "virtualMachines", "vm1", com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentListByExtendedResourceSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentListByExtendedResourceSamples.java index cc1f30350ef7e..452d11d298307 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentListByExtendedResourceSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentListByExtendedResourceSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for ServerVulnerabilityAssessment ListByExtendedResource. */ public final class ServerVulnerabilityAssessmentListByExtendedResourceSamples { /* @@ -22,6 +20,7 @@ public final class ServerVulnerabilityAssessmentListByExtendedResourceSamples { com.azure.resourcemanager.security.SecurityManager manager) { manager .serverVulnerabilityAssessments() - .listByExtendedResourceWithResponse("rg1", "Microsoft.Compute", "virtualMachines", "vm1", Context.NONE); + .listByExtendedResourceWithResponse( + "rg1", "Microsoft.Compute", "virtualMachines", "vm1", com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SettingsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SettingsGetSamples.java index da4d85ace10c8..058d115b4ebe8 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SettingsGetSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SettingsGetSamples.java @@ -4,7 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; import com.azure.resourcemanager.security.models.SettingName; /** Samples for Settings Get. */ @@ -18,6 +17,6 @@ public final class SettingsGetSamples { * @param manager Entry point to SecurityManager. */ public static void getASettingOnSubscription(com.azure.resourcemanager.security.SecurityManager manager) { - manager.settings().getWithResponse(SettingName.MCAS, Context.NONE); + manager.settings().getWithResponse(SettingName.WDATP, com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SettingsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SettingsListSamples.java index 76e8919cef6b3..f86c285f82109 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SettingsListSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SettingsListSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for Settings List. */ public final class SettingsListSamples { /* @@ -17,6 +15,6 @@ public final class SettingsListSamples { * @param manager Entry point to SecurityManager. */ public static void getSettingsOfSubscription(com.azure.resourcemanager.security.SecurityManager manager) { - manager.settings().list(Context.NONE); + manager.settings().list(com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SettingsUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SettingsUpdateSamples.java index 15610a3652fea..5a1fa53dafbe5 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SettingsUpdateSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SettingsUpdateSamples.java @@ -4,7 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; import com.azure.resourcemanager.security.models.DataExportSettings; import com.azure.resourcemanager.security.models.SettingName; @@ -21,6 +20,7 @@ public final class SettingsUpdateSamples { public static void updateASettingForSubscription(com.azure.resourcemanager.security.SecurityManager manager) { manager .settings() - .updateWithResponse(SettingName.MCAS, new DataExportSettings().withEnabled(true), Context.NONE); + .updateWithResponse( + SettingName.WDATP, new DataExportSettings().withEnabled(true), com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SoftwareInventoriesGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SoftwareInventoriesGetSamples.java index e1d6fd5142f36..8a2b88493c57a 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SoftwareInventoriesGetSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SoftwareInventoriesGetSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for SoftwareInventories Get. */ public final class SoftwareInventoriesGetSamples { /* @@ -26,6 +24,6 @@ public static void getsASingleSoftwareDataOfTheVirtualMachine( "virtualMachines", "Eitan-Test1", "outlook_16.0.10371.20060", - Context.NONE); + com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SoftwareInventoriesListByExtendedResourceSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SoftwareInventoriesListByExtendedResourceSamples.java index fea25b9e2a46e..83a8fa334a835 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SoftwareInventoriesListByExtendedResourceSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SoftwareInventoriesListByExtendedResourceSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for SoftwareInventories ListByExtendedResource. */ public final class SoftwareInventoriesListByExtendedResourceSamples { /* @@ -20,6 +18,7 @@ public static void getsTheSoftwareInventoryOfTheVirtualMachine( com.azure.resourcemanager.security.SecurityManager manager) { manager .softwareInventories() - .listByExtendedResource("EITAN-TESTS", "Microsoft.Compute", "virtualMachines", "Eitan-Test1", Context.NONE); + .listByExtendedResource( + "EITAN-TESTS", "Microsoft.Compute", "virtualMachines", "Eitan-Test1", com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SoftwareInventoriesListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SoftwareInventoriesListSamples.java index 31f4d777c7016..466e95d795926 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SoftwareInventoriesListSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SoftwareInventoriesListSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for SoftwareInventories List. */ public final class SoftwareInventoriesListSamples { /* @@ -18,6 +16,6 @@ public final class SoftwareInventoriesListSamples { */ public static void getsTheSoftwareInventoryOfAllVirtualMachinesInTheSubscriptions( com.azure.resourcemanager.security.SecurityManager manager) { - manager.softwareInventories().list(Context.NONE); + manager.softwareInventories().list(com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentBaselineRulesAddSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentBaselineRulesAddSamples.java index 752e4ed3fbc57..c2a326cd6392f 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentBaselineRulesAddSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentBaselineRulesAddSamples.java @@ -4,7 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; import com.azure.resourcemanager.security.models.RulesResultsInput; import java.util.Arrays; import java.util.HashMap; @@ -13,7 +12,7 @@ /** Samples for SqlVulnerabilityAssessmentBaselineRules Add. */ public final class SqlVulnerabilityAssessmentBaselineRulesAddSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2020-07-01-preview/examples/sqlVulnerabilityAssessmentsBaselineRuleOperations/ArcMachineBaselineRules_Add.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-02-01-preview/examples/sqlVulnerabilityAssessmentsBaselineRuleOperations/ArcMachineBaselineRules_Add.json */ /** * Sample code: Create a baseline for all rules. @@ -34,11 +33,11 @@ public static void createABaselineForAllRules(com.azure.resourcemanager.security Arrays.asList(Arrays.asList("userA", "SELECT"), Arrays.asList("userB", "SELECT")), "VA5678", Arrays.asList(Arrays.asList("Test", "0.0.0.0", "125.125.125.125")))), - Context.NONE); + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2020-07-01-preview/examples/sqlVulnerabilityAssessmentsBaselineRuleOperations/ArcMachineBaselineRules_AddLatest.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-02-01-preview/examples/sqlVulnerabilityAssessmentsBaselineRuleOperations/ArcMachineBaselineRules_AddLatest.json */ /** * Sample code: Create a baseline for all rules using the latest scan results. @@ -53,7 +52,7 @@ public static void createABaselineForAllRulesUsingTheLatestScanResults( "55555555-6666-7777-8888-999999999999", "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", new RulesResultsInput().withLatestScan(true).withResults(mapOf()), - Context.NONE); + com.azure.core.util.Context.NONE); } @SuppressWarnings("unchecked") diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentBaselineRulesCreateOrUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentBaselineRulesCreateOrUpdateSamples.java index e33ba7d2f3d80..e7a520b74f214 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentBaselineRulesCreateOrUpdateSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentBaselineRulesCreateOrUpdateSamples.java @@ -9,7 +9,7 @@ /** Samples for SqlVulnerabilityAssessmentBaselineRules CreateOrUpdate. */ public final class SqlVulnerabilityAssessmentBaselineRulesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2020-07-01-preview/examples/sqlVulnerabilityAssessmentsBaselineRuleOperations/ArcMachineBaselineRules_PutLatest.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-02-01-preview/examples/sqlVulnerabilityAssessmentsBaselineRuleOperations/ArcMachineBaselineRules_PutLatest.json */ /** * Sample code: Create a baseline using the latest scan results. @@ -30,7 +30,7 @@ public static void createABaselineUsingTheLatestScanResults( } /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2020-07-01-preview/examples/sqlVulnerabilityAssessmentsBaselineRuleOperations/ArcMachineBaselineRules_Put.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-02-01-preview/examples/sqlVulnerabilityAssessmentsBaselineRuleOperations/ArcMachineBaselineRules_Put.json */ /** * Sample code: Create a baseline. diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentBaselineRulesDeleteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentBaselineRulesDeleteSamples.java index 7d3abebdf0e9b..85019c61a57fb 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentBaselineRulesDeleteSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentBaselineRulesDeleteSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for SqlVulnerabilityAssessmentBaselineRules Delete. */ public final class SqlVulnerabilityAssessmentBaselineRulesDeleteSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2020-07-01-preview/examples/sqlVulnerabilityAssessmentsBaselineRuleOperations/ArcMachineBaselineRules_Delete.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-02-01-preview/examples/sqlVulnerabilityAssessmentsBaselineRuleOperations/ArcMachineBaselineRules_Delete.json */ /** * Sample code: Delete the baseline. @@ -23,6 +21,6 @@ public static void deleteTheBaseline(com.azure.resourcemanager.security.Security "VA1234", "55555555-6666-7777-8888-999999999999", "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", - Context.NONE); + com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentBaselineRulesGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentBaselineRulesGetSamples.java index f516b62809d80..7b46ac27add63 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentBaselineRulesGetSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentBaselineRulesGetSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for SqlVulnerabilityAssessmentBaselineRules Get. */ public final class SqlVulnerabilityAssessmentBaselineRulesGetSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2020-07-01-preview/examples/sqlVulnerabilityAssessmentsBaselineRuleOperations/ArcMachineBaselineRules_Get.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-02-01-preview/examples/sqlVulnerabilityAssessmentsBaselineRuleOperations/ArcMachineBaselineRules_Get.json */ /** * Sample code: Get the baseline. @@ -23,6 +21,6 @@ public static void getTheBaseline(com.azure.resourcemanager.security.SecurityMan "VA1234", "55555555-6666-7777-8888-999999999999", "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", - Context.NONE); + com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentBaselineRulesListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentBaselineRulesListSamples.java index 55a5b4292c52b..c30093dd44f76 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentBaselineRulesListSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentBaselineRulesListSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for SqlVulnerabilityAssessmentBaselineRules List. */ public final class SqlVulnerabilityAssessmentBaselineRulesListSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2020-07-01-preview/examples/sqlVulnerabilityAssessmentsBaselineRuleOperations/ArcMachineBaselineRules_List.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-02-01-preview/examples/sqlVulnerabilityAssessmentsBaselineRuleOperations/ArcMachineBaselineRules_List.json */ /** * Sample code: List baseline for all rules. @@ -22,6 +20,6 @@ public static void listBaselineForAllRules(com.azure.resourcemanager.security.Se .listWithResponse( "55555555-6666-7777-8888-999999999999", "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", - Context.NONE); + com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentScanResultsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentScanResultsGetSamples.java index 71cd4c97543fd..c3c8bfa045544 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentScanResultsGetSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentScanResultsGetSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for SqlVulnerabilityAssessmentScanResults Get. */ public final class SqlVulnerabilityAssessmentScanResultsGetSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2020-07-01-preview/examples/sqlVulnerabilityAssessmentsScanResultsOperations/ArcMachineScanResults_Get.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-02-01-preview/examples/sqlVulnerabilityAssessmentsScanResultsOperations/ArcMachineScanResults_Get.json */ /** * Sample code: Get scan details of a scan record. @@ -24,11 +22,11 @@ public static void getScanDetailsOfAScanRecord(com.azure.resourcemanager.securit "VA2063", "55555555-6666-7777-8888-999999999999", "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", - Context.NONE); + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2020-07-01-preview/examples/sqlVulnerabilityAssessmentsScanResultsOperations/ArcMachineScanResults_GetLatest.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-02-01-preview/examples/sqlVulnerabilityAssessmentsScanResultsOperations/ArcMachineScanResults_GetLatest.json */ /** * Sample code: Get scan details of the latest scan record. @@ -43,6 +41,6 @@ public static void getScanDetailsOfTheLatestScanRecord(com.azure.resourcemanager "VA2063", "55555555-6666-7777-8888-999999999999", "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", - Context.NONE); + com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentScanResultsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentScanResultsListSamples.java index d04ac4c8762a3..098caee04195e 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentScanResultsListSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentScanResultsListSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for SqlVulnerabilityAssessmentScanResults List. */ public final class SqlVulnerabilityAssessmentScanResultsListSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2020-07-01-preview/examples/sqlVulnerabilityAssessmentsScanResultsOperations/ArcMachineScanResults_ListLatest.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-02-01-preview/examples/sqlVulnerabilityAssessmentsScanResultsOperations/ArcMachineScanResults_ListLatest.json */ /** * Sample code: List scan results of the latest scan. @@ -23,11 +21,11 @@ public static void listScanResultsOfTheLatestScan(com.azure.resourcemanager.secu "latest", "55555555-6666-7777-8888-999999999999", "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", - Context.NONE); + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2020-07-01-preview/examples/sqlVulnerabilityAssessmentsScanResultsOperations/ArcMachineScanResults_List.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-02-01-preview/examples/sqlVulnerabilityAssessmentsScanResultsOperations/ArcMachineScanResults_List.json */ /** * Sample code: List scan results. @@ -41,6 +39,6 @@ public static void listScanResults(com.azure.resourcemanager.security.SecurityMa "Scheduled-20200623", "55555555-6666-7777-8888-999999999999", "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", - Context.NONE); + com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentScansGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentScansGetSamples.java index d2479c2dba22a..b99cdce70a1d6 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentScansGetSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentScansGetSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for SqlVulnerabilityAssessmentScans Get. */ public final class SqlVulnerabilityAssessmentScansGetSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2020-07-01-preview/examples/sqlVulnerabilityAssessmentScanOperations/ArcMachineScans_Get.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-02-01-preview/examples/sqlVulnerabilityAssessmentScanOperations/ArcMachineScans_Get.json */ /** * Sample code: Get scan details of a scan record. @@ -23,11 +21,11 @@ public static void getScanDetailsOfAScanRecord(com.azure.resourcemanager.securit "Scheduled-20200623", "55555555-6666-7777-8888-999999999999", "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", - Context.NONE); + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2020-07-01-preview/examples/sqlVulnerabilityAssessmentScanOperations/ArcMachineScans_GetLatest.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-02-01-preview/examples/sqlVulnerabilityAssessmentScanOperations/ArcMachineScans_GetLatest.json */ /** * Sample code: Get scan details of the latest scan record. @@ -41,6 +39,6 @@ public static void getScanDetailsOfTheLatestScanRecord(com.azure.resourcemanager "latest", "55555555-6666-7777-8888-999999999999", "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", - Context.NONE); + com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentScansListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentScansListSamples.java index 255cd84d8df02..3c9a744957371 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentScansListSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentScansListSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for SqlVulnerabilityAssessmentScans List. */ public final class SqlVulnerabilityAssessmentScansListSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2020-07-01-preview/examples/sqlVulnerabilityAssessmentScanOperations/ArcMachineScans_List.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-02-01-preview/examples/sqlVulnerabilityAssessmentScanOperations/ArcMachineScans_List.json */ /** * Sample code: List scan details. @@ -22,6 +20,6 @@ public static void listScanDetails(com.azure.resourcemanager.security.SecurityMa .listWithResponse( "55555555-6666-7777-8888-999999999999", "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", - Context.NONE); + com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SubAssessmentsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SubAssessmentsGetSamples.java index 6862f82270e96..74ccfe4b7b9fe 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SubAssessmentsGetSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SubAssessmentsGetSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for SubAssessments Get. */ public final class SubAssessmentsGetSamples { /* @@ -24,6 +22,6 @@ public static void getSecurityRecommendationTaskFromSecurityDataLocation( "subscriptions/212f9889-769e-45ae-ab43-6da33674bd26/resourceGroups/DEMORG/providers/Microsoft.Compute/virtualMachines/vm2", "1195afff-c881-495e-9bc5-1486211ae03f", "95f7da9c-a2a4-1322-0758-fcd24ef09b85", - Context.NONE); + com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SubAssessmentsListAllSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SubAssessmentsListAllSamples.java index fc9160cd5786c..5e92a236f32c3 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SubAssessmentsListAllSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SubAssessmentsListAllSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for SubAssessments ListAll. */ public final class SubAssessmentsListAllSamples { /* @@ -17,6 +15,8 @@ public final class SubAssessmentsListAllSamples { * @param manager Entry point to SecurityManager. */ public static void listSecuritySubAssessments(com.azure.resourcemanager.security.SecurityManager manager) { - manager.subAssessments().listAll("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", Context.NONE); + manager + .subAssessments() + .listAll("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SubAssessmentsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SubAssessmentsListSamples.java index 8314850e4a11d..0b526b319fab1 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SubAssessmentsListSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SubAssessmentsListSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for SubAssessments List. */ public final class SubAssessmentsListSamples { /* @@ -22,6 +20,6 @@ public static void listSecuritySubAssessments(com.azure.resourcemanager.security .list( "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", "82e20e14-edc5-4373-bfc4-f13121257c37", - Context.NONE); + com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SubscriptionGovernanceRulesExecuteStatusGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SubscriptionGovernanceRulesExecuteStatusGetSamples.java deleted file mode 100644 index 6e6f39d5ffac0..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SubscriptionGovernanceRulesExecuteStatusGetSamples.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.Context; - -/** Samples for SubscriptionGovernanceRulesExecuteStatus Get. */ -public final class SubscriptionGovernanceRulesExecuteStatusGetSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/GetGovernanceRuleExecuteStatus_example.json - */ - /** - * Sample code: Get security governanceRules execution status by specific governanceRuleId. - * - * @param manager Entry point to SecurityManager. - */ - public static void getSecurityGovernanceRulesExecutionStatusBySpecificGovernanceRuleId( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .subscriptionGovernanceRulesExecuteStatus() - .get("ad9a8e26-29d9-4829-bb30-e597a58cdbb8", "58b33f4f-c8c7-4b01-99cc-d437db4d40dd", Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TasksGetResourceGroupLevelTaskSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TasksGetResourceGroupLevelTaskSamples.java index 681c605bbbc75..afaf7627eff1b 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TasksGetResourceGroupLevelTaskSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TasksGetResourceGroupLevelTaskSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for Tasks GetResourceGroupLevelTask. */ public final class TasksGetResourceGroupLevelTaskSamples { /* @@ -21,6 +19,6 @@ public static void getSecurityRecommendationTaskInAResourceGroup( manager .tasks() .getResourceGroupLevelTaskWithResponse( - "myRg", "westeurope", "d55b4dc0-779c-c66c-33e5-d7bce24c4222", Context.NONE); + "myRg", "westeurope", "d55b4dc0-779c-c66c-33e5-d7bce24c4222", com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TasksGetSubscriptionLevelTaskSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TasksGetSubscriptionLevelTaskSamples.java index 2ff665519cd1a..91f3120372563 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TasksGetSubscriptionLevelTaskSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TasksGetSubscriptionLevelTaskSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for Tasks GetSubscriptionLevelTask. */ public final class TasksGetSubscriptionLevelTaskSamples { /* @@ -20,6 +18,7 @@ public static void getSecurityRecommendationTaskFromSecurityDataLocation( com.azure.resourcemanager.security.SecurityManager manager) { manager .tasks() - .getSubscriptionLevelTaskWithResponse("westeurope", "62609ee7-d0a5-8616-9fe4-1df5cca7758d", Context.NONE); + .getSubscriptionLevelTaskWithResponse( + "westeurope", "62609ee7-d0a5-8616-9fe4-1df5cca7758d", com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TasksListByHomeRegionSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TasksListByHomeRegionSamples.java index 2640d12e2c78f..4c70b24b9cb33 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TasksListByHomeRegionSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TasksListByHomeRegionSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for Tasks ListByHomeRegion. */ public final class TasksListByHomeRegionSamples { /* @@ -18,6 +16,6 @@ public final class TasksListByHomeRegionSamples { */ public static void getSecurityRecommendationsTasksFromSecurityDataLocation( com.azure.resourcemanager.security.SecurityManager manager) { - manager.tasks().listByHomeRegion("westeurope", null, Context.NONE); + manager.tasks().listByHomeRegion("westeurope", null, com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TasksListByResourceGroupSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TasksListByResourceGroupSamples.java index bf564a298da7a..c47d54fe6d705 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TasksListByResourceGroupSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TasksListByResourceGroupSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for Tasks ListByResourceGroup. */ public final class TasksListByResourceGroupSamples { /* @@ -18,6 +16,6 @@ public final class TasksListByResourceGroupSamples { */ public static void getSecurityRecommendationTasksInAResourceGroup( com.azure.resourcemanager.security.SecurityManager manager) { - manager.tasks().listByResourceGroup("myRg", "westeurope", null, Context.NONE); + manager.tasks().listByResourceGroup("myRg", "westeurope", null, com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TasksListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TasksListSamples.java index 86ed670d92a06..5a8d972d8aa62 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TasksListSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TasksListSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for Tasks List. */ public final class TasksListSamples { /* @@ -17,6 +15,6 @@ public final class TasksListSamples { * @param manager Entry point to SecurityManager. */ public static void getSecurityRecommendationsTasks(com.azure.resourcemanager.security.SecurityManager manager) { - manager.tasks().list(null, Context.NONE); + manager.tasks().list(null, com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TasksUpdateResourceGroupLevelTaskStateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TasksUpdateResourceGroupLevelTaskStateSamples.java index 40c93fc13fd8a..cd5b5f66f01fa 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TasksUpdateResourceGroupLevelTaskStateSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TasksUpdateResourceGroupLevelTaskStateSamples.java @@ -4,7 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; import com.azure.resourcemanager.security.models.TaskUpdateActionType; /** Samples for Tasks UpdateResourceGroupLevelTaskState. */ @@ -26,6 +25,6 @@ public static void changeSecurityRecommendationTaskState( "westeurope", "d55b4dc0-779c-c66c-33e5-d7bce24c4222", TaskUpdateActionType.DISMISS, - Context.NONE); + com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TasksUpdateSubscriptionLevelTaskStateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TasksUpdateSubscriptionLevelTaskStateSamples.java index 8b24296405933..d90f3ab1966a7 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TasksUpdateSubscriptionLevelTaskStateSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TasksUpdateSubscriptionLevelTaskStateSamples.java @@ -4,7 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; import com.azure.resourcemanager.security.models.TaskUpdateActionType; /** Samples for Tasks UpdateSubscriptionLevelTaskState. */ @@ -22,6 +21,9 @@ public static void changeSecurityRecommendationTaskState( manager .tasks() .updateSubscriptionLevelTaskStateWithResponse( - "westeurope", "62609ee7-d0a5-8616-9fe4-1df5cca7758d", TaskUpdateActionType.DISMISS, Context.NONE); + "westeurope", + "62609ee7-d0a5-8616-9fe4-1df5cca7758d", + TaskUpdateActionType.DISMISS, + com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TopologyGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TopologyGetSamples.java index 3722e0ab3e1e7..05a3dae076409 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TopologyGetSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TopologyGetSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for Topology Get. */ public final class TopologyGetSamples { /* @@ -17,6 +15,6 @@ public final class TopologyGetSamples { * @param manager Entry point to SecurityManager. */ public static void getTopology(com.azure.resourcemanager.security.SecurityManager manager) { - manager.topologies().getWithResponse("myservers", "centralus", "vnets", Context.NONE); + manager.topologies().getWithResponse("myservers", "centralus", "vnets", com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TopologyListByHomeRegionSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TopologyListByHomeRegionSamples.java index 470219b343bdf..75842d2af62ef 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TopologyListByHomeRegionSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TopologyListByHomeRegionSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for Topology ListByHomeRegion. */ public final class TopologyListByHomeRegionSamples { /* @@ -18,6 +16,6 @@ public final class TopologyListByHomeRegionSamples { */ public static void getTopologyOnASubscriptionFromSecurityDataLocation( com.azure.resourcemanager.security.SecurityManager manager) { - manager.topologies().listByHomeRegion("centralus", Context.NONE); + manager.topologies().listByHomeRegion("centralus", com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TopologyListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TopologyListSamples.java index e05f1b16277b3..b6e52888605af 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TopologyListSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TopologyListSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for Topology List. */ public final class TopologyListSamples { /* @@ -17,6 +15,6 @@ public final class TopologyListSamples { * @param manager Entry point to SecurityManager. */ public static void getTopologyOnASubscription(com.azure.resourcemanager.security.SecurityManager manager) { - manager.topologies().list(Context.NONE); + manager.topologies().list(com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/WorkspaceSettingsDeleteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/WorkspaceSettingsDeleteSamples.java index 6e1442fb22c99..19c01da6846c8 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/WorkspaceSettingsDeleteSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/WorkspaceSettingsDeleteSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for WorkspaceSettings Delete. */ public final class WorkspaceSettingsDeleteSamples { /* @@ -18,6 +16,6 @@ public final class WorkspaceSettingsDeleteSamples { */ public static void deleteAWorkspaceSettingDataForResourceGroup( com.azure.resourcemanager.security.SecurityManager manager) { - manager.workspaceSettings().deleteWithResponse("default", Context.NONE); + manager.workspaceSettings().deleteWithResponse("default", com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/WorkspaceSettingsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/WorkspaceSettingsGetSamples.java index 88a6b0efc9b9c..08c7f4dbd305d 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/WorkspaceSettingsGetSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/WorkspaceSettingsGetSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for WorkspaceSettings Get. */ public final class WorkspaceSettingsGetSamples { /* @@ -17,6 +15,6 @@ public final class WorkspaceSettingsGetSamples { * @param manager Entry point to SecurityManager. */ public static void getAWorkspaceSettingOnSubscription(com.azure.resourcemanager.security.SecurityManager manager) { - manager.workspaceSettings().getWithResponse("default", Context.NONE); + manager.workspaceSettings().getWithResponse("default", com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/WorkspaceSettingsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/WorkspaceSettingsListSamples.java index f6c1549921b52..df53ac48f04e0 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/WorkspaceSettingsListSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/WorkspaceSettingsListSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; - /** Samples for WorkspaceSettings List. */ public final class WorkspaceSettingsListSamples { /* @@ -17,6 +15,6 @@ public final class WorkspaceSettingsListSamples { * @param manager Entry point to SecurityManager. */ public static void getWorkspaceSettingsOnSubscription(com.azure.resourcemanager.security.SecurityManager manager) { - manager.workspaceSettings().list(Context.NONE); + manager.workspaceSettings().list(com.azure.core.util.Context.NONE); } } diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/WorkspaceSettingsUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/WorkspaceSettingsUpdateSamples.java index fea537bd70fa8..2fbcebb231aef 100644 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/WorkspaceSettingsUpdateSamples.java +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/WorkspaceSettingsUpdateSamples.java @@ -4,7 +4,6 @@ package com.azure.resourcemanager.security.generated; -import com.azure.core.util.Context; import com.azure.resourcemanager.security.models.WorkspaceSetting; /** Samples for WorkspaceSettings Update. */ @@ -19,7 +18,8 @@ public final class WorkspaceSettingsUpdateSamples { */ public static void updateAWorkspaceSettingDataForSubscription( com.azure.resourcemanager.security.SecurityManager manager) { - WorkspaceSetting resource = manager.workspaceSettings().getWithResponse("default", Context.NONE).getValue(); + WorkspaceSetting resource = + manager.workspaceSettings().getWithResponse("default", com.azure.core.util.Context.NONE).getValue(); resource .update() .withWorkspaceId(