From 8c0f514ff9c7766e26c284ee4a8d0f5078a7b714 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Mon, 26 Dec 2022 06:44:26 +0000 Subject: [PATCH] CodeGen from PR 21988 in Azure/azure-rest-api-specs Merge 1ae8826ff8e3a12951c84335e302f8a519684453 into 40354d03b1fa91a41eec400a5ed54d4cce457c28 --- .../CHANGELOG.md | 4 +- .../azure-resourcemanager-security/README.md | 2 +- .../azure-resourcemanager-security/SAMPLE.md | 328 ++++++++-- .../security/SecurityManager.java | 99 ++- .../fluent/GovernanceAssignmentsClient.java | 54 +- .../fluent/GovernanceRulesClient.java | 8 +- .../GovernanceRulesOperationsClient.java | 138 +++-- .../ManagementGroupGovernanceRulesClient.java | 41 ++ ...GovernanceRulesOperationResultsClient.java | 47 ++ ...tGroupGovernanceRulesOperationsClient.java | 128 ++++ .../security/fluent/SecurityCenter.java | 33 +- ...ecurityConnectorGovernanceRulesClient.java | 8 +- ...torGovernanceRulesExecuteStatusClient.java | 90 --- ...GovernanceRulesOperationResultsClient.java | 52 ++ ...nectorGovernanceRulesOperationsClient.java | 75 ++- ...ionGovernanceRulesExecuteStatusClient.java | 75 --- ...GovernanceRulesOperationResultsClient.java | 45 ++ .../fluent/models/ExecuteRuleStatusInner.java | 39 -- .../models/GovernanceAssignmentInner.java | 6 +- .../fluent/models/GovernanceRuleInner.java | 99 ++- .../models/GovernanceRuleProperties.java | 119 +++- .../OperationResultAutoGeneratedInner.java | 40 ++ .../implementation/ExecuteRuleStatusImpl.java | 32 - .../GovernanceAssignmentsClientImpl.java | 153 +++-- .../implementation/GovernanceRuleImpl.java | 37 ++ .../GovernanceRulesClientImpl.java | 36 +- .../GovernanceRulesOperationsClientImpl.java | 539 +++++++++++++---- .../GovernanceRulesOperationsImpl.java | 14 + ...agementGroupGovernanceRulesClientImpl.java | 304 ++++++++++ .../ManagementGroupGovernanceRulesImpl.java | 46 ++ ...rnanceRulesOperationResultsClientImpl.java | 217 +++++++ ...upGovernanceRulesOperationResultsImpl.java | 64 ++ ...upGovernanceRulesOperationsClientImpl.java | 567 ++++++++++++++++++ ...entGroupGovernanceRulesOperationsImpl.java | 91 +++ .../OperationResultAutoGeneratedImpl.java | 34 ++ .../implementation/SecurityCenterImpl.java | 80 ++- ...ityConnectorGovernanceRulesClientImpl.java | 32 +- ...overnanceRulesExecuteStatusClientImpl.java | 392 ------------ ...ectorGovernanceRulesExecuteStatusImpl.java | 59 -- ...rnanceRulesOperationResultsClientImpl.java | 262 ++++++++ ...orGovernanceRulesOperationResultsImpl.java | 68 +++ ...orGovernanceRulesOperationsClientImpl.java | 221 +++++-- ...onnectorGovernanceRulesOperationsImpl.java | 9 +- ...overnanceRulesExecuteStatusClientImpl.java | 327 ---------- ...ptionGovernanceRulesExecuteStatusImpl.java | 53 -- ...rnanceRulesOperationResultsClientImpl.java | 221 +++++++ ...onGovernanceRulesOperationResultsImpl.java | 62 ++ .../security/models/ExecuteRuleStatus.java | 24 - .../security/models/GovernanceAssignment.java | 2 +- .../GovernanceAssignmentAdditionalData.java | 22 +- .../models/GovernanceAssignments.java | 32 +- .../models/GovernanceAssignmentsList.java | 2 +- .../security/models/GovernanceRule.java | 142 ++++- .../GovernanceRuleEmailNotification.java | 4 +- .../security/models/GovernanceRuleList.java | 6 +- .../models/GovernanceRuleMetadata.java | 85 +++ .../security/models/GovernanceRules.java | 8 +- .../models/GovernanceRulesOperations.java | 80 ++- .../ManagementGroupGovernanceRules.java | 36 ++ ...tGroupGovernanceRulesOperationResults.java | 39 ++ ...rnanceRulesOperationResultsGetHeaders.java | 58 ++ ...nanceRulesOperationResultsGetResponse.java | 42 ++ ...agementGroupGovernanceRulesOperations.java | 88 +++ .../security/models/OperationResult.java | 41 ++ .../models/OperationResultAutoGenerated.java | 24 + .../SecurityConnectorGovernanceRules.java | 8 +- ...ectorGovernanceRulesOperationResults.java} | 30 +- ...rnanceRulesOperationResultsGetHeaders.java | 58 ++ ...nanceRulesOperationResultsGetResponse.java | 43 ++ ...ityConnectorGovernanceRulesOperations.java | 44 +- ...ptionGovernanceRulesOperationResults.java} | 27 +- ...rnanceRulesOperationResultsGetHeaders.java | 58 ++ ...nanceRulesOperationResultsGetResponse.java | 42 ++ .../GovernanceAssignmentsGetSamples.java | 4 +- .../GovernanceAssignmentsListSamples.java | 4 +- .../generated/GovernanceRuleListSamples.java | 4 +- ...ceRulesOperationCreateOrUpdateSamples.java | 4 +- ...GovernanceRulesOperationDeleteSamples.java | 4 +- .../GovernanceRulesOperationGetSamples.java | 5 +- ...IdExecuteSingleManagementGroupSamples.java | 24 + ...ExecuteSingleSecurityConnectorSamples.java | 2 +- ...agementGroupGovernanceRuleListSamples.java | 23 + ...ceRulesOperationCreateOrUpdateSamples.java | 66 ++ ...GovernanceRulesOperationDeleteSamples.java | 24 + ...oupGovernanceRulesOperationGetSamples.java | 25 + ...ernanceRulesOperationResultGetSamples.java | 29 + ...ityConnectorGovernanceRuleListSamples.java | 4 +- ...GovernanceRulesOperationDeleteSamples.java | 7 +- ...torGovernanceRulesOperationGetSamples.java | 5 +- ...rnanceRulesOperationResultGetSamples.java} | 12 +- ...rnanceRulesOperationResultGetSamples.java} | 13 +- 91 files changed, 4966 insertions(+), 1788 deletions(-) create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/ManagementGroupGovernanceRulesClient.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/ManagementGroupGovernanceRulesOperationResultsClient.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/ManagementGroupGovernanceRulesOperationsClient.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecurityConnectorGovernanceRulesExecuteStatusClient.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecurityConnectorGovernanceRulesOperationResultsClient.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SubscriptionGovernanceRulesExecuteStatusClient.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SubscriptionGovernanceRulesOperationResultsClient.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ExecuteRuleStatusInner.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/OperationResultAutoGeneratedInner.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ExecuteRuleStatusImpl.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ManagementGroupGovernanceRulesClientImpl.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ManagementGroupGovernanceRulesImpl.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ManagementGroupGovernanceRulesOperationResultsClientImpl.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ManagementGroupGovernanceRulesOperationResultsImpl.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ManagementGroupGovernanceRulesOperationsClientImpl.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ManagementGroupGovernanceRulesOperationsImpl.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/OperationResultAutoGeneratedImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityConnectorGovernanceRulesExecuteStatusClientImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityConnectorGovernanceRulesExecuteStatusImpl.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityConnectorGovernanceRulesOperationResultsClientImpl.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityConnectorGovernanceRulesOperationResultsImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SubscriptionGovernanceRulesExecuteStatusClientImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SubscriptionGovernanceRulesExecuteStatusImpl.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SubscriptionGovernanceRulesOperationResultsClientImpl.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SubscriptionGovernanceRulesOperationResultsImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ExecuteRuleStatus.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GovernanceRuleMetadata.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ManagementGroupGovernanceRules.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ManagementGroupGovernanceRulesOperationResults.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ManagementGroupGovernanceRulesOperationResultsGetHeaders.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ManagementGroupGovernanceRulesOperationResultsGetResponse.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ManagementGroupGovernanceRulesOperations.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/OperationResult.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/OperationResultAutoGenerated.java rename sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/{SecurityConnectorGovernanceRulesExecuteStatus.java => SecurityConnectorGovernanceRulesOperationResults.java} (54%) create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityConnectorGovernanceRulesOperationResultsGetHeaders.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityConnectorGovernanceRulesOperationResultsGetResponse.java rename sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/{SubscriptionGovernanceRulesExecuteStatus.java => SubscriptionGovernanceRulesOperationResults.java} (52%) create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SubscriptionGovernanceRulesOperationResultsGetHeaders.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SubscriptionGovernanceRulesOperationResultsGetResponse.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GovernanceRulesOperationRuleIdExecuteSingleManagementGroupSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ManagementGroupGovernanceRuleListSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ManagementGroupGovernanceRulesOperationCreateOrUpdateSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ManagementGroupGovernanceRulesOperationDeleteSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ManagementGroupGovernanceRulesOperationGetSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ManagementGroupGovernanceRulesOperationResultGetSamples.java rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/{SecurityConnectorGovernanceRulesExecuteStatusGetSamples.java => SecurityConnectorGovernanceRulesOperationResultGetSamples.java} (66%) rename sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/{SubscriptionGovernanceRulesExecuteStatusGetSamples.java => SubscriptionGovernanceRulesOperationResultGetSamples.java} (53%) diff --git a/sdk/security/azure-resourcemanager-security/CHANGELOG.md b/sdk/security/azure-resourcemanager-security/CHANGELOG.md index 94e033f5fe1d..719c66bf6089 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 (2022-12-26) + +- 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 56feefc413ff..d5a2f20c8a87 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 4a430c8205e5..a29c3da6cead 100644 --- a/sdk/security/azure-resourcemanager-security/SAMPLE.md +++ b/sdk/security/azure-resourcemanager-security/SAMPLE.md @@ -172,6 +172,7 @@ - [CreateOrUpdate](#governancerulesoperation_createorupdate) - [Delete](#governancerulesoperation_delete) - [Get](#governancerulesoperation_get) +- [RuleIdExecuteSingleManagementGroup](#governancerulesoperation_ruleidexecutesinglemanagementgroup) - [RuleIdExecuteSingleSecurityConnector](#governancerulesoperation_ruleidexecutesinglesecurityconnector) - [RuleIdExecuteSingleSubscription](#governancerulesoperation_ruleidexecutesinglesubscription) @@ -231,6 +232,20 @@ - [Get](#locations_get) - [List](#locations_list) +## ManagementGroupGovernanceRule + +- [List](#managementgroupgovernancerule_list) + +## ManagementGroupGovernanceRulesOperation + +- [CreateOrUpdate](#managementgroupgovernancerulesoperation_createorupdate) +- [Delete](#managementgroupgovernancerulesoperation_delete) +- [Get](#managementgroupgovernancerulesoperation_get) + +## ManagementGroupGovernanceRulesOperationResult + +- [Get](#managementgroupgovernancerulesoperationresult_get) + ## MdeOnboardings - [Get](#mdeonboardings_get) @@ -286,16 +301,16 @@ - [List](#securityconnectorgovernancerule_list) -## SecurityConnectorGovernanceRulesExecuteStatus - -- [Get](#securityconnectorgovernancerulesexecutestatus_get) - ## SecurityConnectorGovernanceRulesOperation - [CreateOrUpdate](#securityconnectorgovernancerulesoperation_createorupdate) - [Delete](#securityconnectorgovernancerulesoperation_delete) - [Get](#securityconnectorgovernancerulesoperation_get) +## SecurityConnectorGovernanceRulesOperationResult + +- [Get](#securityconnectorgovernancerulesoperationresult_get) + ## SecurityConnectors - [CreateOrUpdate](#securityconnectors_createorupdate) @@ -365,9 +380,9 @@ - [List](#subassessments_list) - [ListAll](#subassessments_listall) -## SubscriptionGovernanceRulesExecuteStatus +## SubscriptionGovernanceRulesOperationResult -- [Get](#subscriptiongovernancerulesexecutestatus_get) +- [Get](#subscriptiongovernancerulesoperationresult_get) ## Tasks @@ -3088,11 +3103,11 @@ 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() @@ -3116,11 +3131,11 @@ 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( @@ -3142,11 +3157,11 @@ 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. + * Sample code: List governance rules by subscription level scope. * * @param manager Entry point to SecurityManager. */ - public static void listSecurityGovernanceRulesBySubscriptionLevelScope( + public static void listGovernanceRulesBySubscriptionLevelScope( com.azure.resourcemanager.security.SecurityManager manager) { manager.governanceRules().list(Context.NONE); } @@ -3172,7 +3187,7 @@ 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. + * Sample code: Create governance rule. * * @param manager Entry point to SecurityManager. */ @@ -3182,7 +3197,7 @@ public final class GovernanceRulesOperationCreateOrUpdateSamples { .governanceRulesOperations() .define("ad9a8e26-29d9-4829-bb30-e597a58cdbb8") .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) @@ -3223,11 +3238,11 @@ 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 governance rule. * * @param manager Entry point to SecurityManager. */ - public static void deleteSecurityGovernanceRule(com.azure.resourcemanager.security.SecurityManager manager) { + public static void deleteGovernanceRule(com.azure.resourcemanager.security.SecurityManager manager) { manager.governanceRulesOperations().deleteWithResponse("ad9a8e26-29d9-4829-bb30-e597a58cdbb8", Context.NONE); } } @@ -3244,17 +3259,39 @@ 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. + * Sample code: Get a governance rule by its' ID. * * @param manager Entry point to SecurityManager. */ - public static void getSecurityGovernanceRulesBySpecificGovernanceRuleId( - com.azure.resourcemanager.security.SecurityManager manager) { + public static void getAGovernanceRuleByItsID(com.azure.resourcemanager.security.SecurityManager manager) { manager.governanceRulesOperations().getWithResponse("ad9a8e26-29d9-4829-bb30-e597a58cdbb8", Context.NONE); } } ``` +### GovernanceRulesOperation_RuleIdExecuteSingleManagementGroup + +```java +import com.azure.core.util.Context; + +/** Samples for GovernanceRulesOperation RuleIdExecuteSingleManagementGroup. */ +public final class GovernanceRulesOperationRuleIdExecuteSingleManagementGroupSamples { + /* + * 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. + * + * @param manager Entry point to SecurityManager. + */ + public static void executeGovernanceRule(com.azure.resourcemanager.security.SecurityManager manager) { + manager + .governanceRulesOperations() + .ruleIdExecuteSingleManagementGroup("contoso", "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", null, Context.NONE); + } +} +``` + ### GovernanceRulesOperation_RuleIdExecuteSingleSecurityConnector ```java @@ -3266,7 +3303,7 @@ public final class GovernanceRulesOperationRuleIdExecuteSingleSecurityConnectorS * 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. * * @param manager Entry point to SecurityManager. */ @@ -4285,6 +4322,168 @@ public final class LocationsListSamples { } ``` +### ManagementGroupGovernanceRule_List + +```java +import com.azure.core.util.Context; + +/** Samples for ManagementGroupGovernanceRule List. */ +public final class ManagementGroupGovernanceRuleListSamples { + /* + * 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 level scope. + * + * @param manager Entry point to SecurityManager. + */ + public static void listGovernanceRulesByManagementGroupLevelScope( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.managementGroupGovernanceRules().list("contoso", Context.NONE); + } +} +``` + +### ManagementGroupGovernanceRulesOperation_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 ManagementGroupGovernanceRulesOperation CreateOrUpdate. */ +public final class ManagementGroupGovernanceRulesOperationCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/PutManagementGroupGovernanceRule_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 + .managementGroupGovernanceRulesOperations() + .createOrUpdateWithResponse( + "contoso", + "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", + new GovernanceRuleInner() + .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)), + Context.NONE); + } +} +``` + +### ManagementGroupGovernanceRulesOperation_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for ManagementGroupGovernanceRulesOperation Delete. */ +public final class ManagementGroupGovernanceRulesOperationDeleteSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/DeleteManagementGroupGovernanceRule_example.json + */ + /** + * Sample code: Delete Governance rule. + * + * @param manager Entry point to SecurityManager. + */ + public static void deleteGovernanceRule(com.azure.resourcemanager.security.SecurityManager manager) { + manager + .managementGroupGovernanceRulesOperations() + .delete("contoso", "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", Context.NONE); + } +} +``` + +### ManagementGroupGovernanceRulesOperation_Get + +```java +import com.azure.core.util.Context; + +/** Samples for ManagementGroupGovernanceRulesOperation Get. */ +public final class ManagementGroupGovernanceRulesOperationGetSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/GetManagementGroupGovernanceRule_example.json + */ + /** + * Sample code: Get governance rules by specific governanceRuleId. + * + * @param manager Entry point to SecurityManager. + */ + public static void getGovernanceRulesBySpecificGovernanceRuleId( + com.azure.resourcemanager.security.SecurityManager manager) { + manager + .managementGroupGovernanceRulesOperations() + .getWithResponse("contoso", "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", Context.NONE); + } +} +``` + +### ManagementGroupGovernanceRulesOperationResult_Get + +```java +import com.azure.core.util.Context; + +/** Samples for ManagementGroupGovernanceRulesOperationResult Get. */ +public final class ManagementGroupGovernanceRulesOperationResultGetSamples { + /* + * 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 by specific governance rule ID. + * + * @param manager Entry point to SecurityManager. + */ + public static void getGovernanceRulesLongRunOperationResultBySpecificGovernanceRuleID( + com.azure.resourcemanager.security.SecurityManager manager) { + manager + .managementGroupGovernanceRulesOperationResults() + .getWithResponse( + "contoso", + "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", + "58b33f4f-c8c7-4b01-99cc-d437db4d40dd", + Context.NONE); + } +} +``` + ### MdeOnboardings_Get ```java @@ -4804,46 +5003,17 @@ 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. + * Sample code: List governance rules by security connector level scope. * * @param manager Entry point to SecurityManager. */ - public static void listSecurityGovernanceRulesBySecurityConnectorLevelScope( + public static void listGovernanceRulesBySecurityConnectorLevelScope( 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 @@ -4920,15 +5090,14 @@ 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. + * Sample code: Delete governance rule. * * @param manager Entry point to SecurityManager. */ - public static void deleteSecurityGovernanceRule(com.azure.resourcemanager.security.SecurityManager manager) { + public static void deleteGovernanceRule(com.azure.resourcemanager.security.SecurityManager manager) { manager .securityConnectorGovernanceRulesOperations() - .deleteWithResponse( - "gcpResourceGroup", "gcpconnector", "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", Context.NONE); + .delete("gcpResourceGroup", "gcpconnector", "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", Context.NONE); } } ``` @@ -4944,12 +5113,11 @@ 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. + * Sample code: Get a governance rule by its' ID. * * @param manager Entry point to SecurityManager. */ - public static void getSecurityGovernanceRulesBySpecificGovernanceRuleId( - com.azure.resourcemanager.security.SecurityManager manager) { + public static void getAGovernanceRuleByItsID(com.azure.resourcemanager.security.SecurityManager manager) { manager .securityConnectorGovernanceRulesOperations() .getWithResponse("gcpResourceGroup", "gcpconnector", "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", Context.NONE); @@ -4957,6 +5125,35 @@ public final class SecurityConnectorGovernanceRulesOperationGetSamples { } ``` +### SecurityConnectorGovernanceRulesOperationResult_Get + +```java +import com.azure.core.util.Context; + +/** Samples for SecurityConnectorGovernanceRulesOperationResult Get. */ +public final class SecurityConnectorGovernanceRulesOperationResultGetSamples { + /* + * 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 by specific governance rule ID. + * + * @param manager Entry point to SecurityManager. + */ + public static void getGovernanceRulesLongRunOperationResultBySpecificGovernanceRuleID( + com.azure.resourcemanager.security.SecurityManager manager) { + manager + .securityConnectorGovernanceRulesOperationResults() + .getWithResponse( + "gcpResourceGroup", + "gcpconnector", + "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", + "58b33f4f-c8c7-4b01-99cc-d437db4d40dd", + Context.NONE); + } +} +``` + ### SecurityConnectors_CreateOrUpdate ```java @@ -6029,26 +6226,27 @@ public final class SubAssessmentsListAllSamples { } ``` -### SubscriptionGovernanceRulesExecuteStatus_Get +### SubscriptionGovernanceRulesOperationResult_Get ```java import com.azure.core.util.Context; -/** Samples for SubscriptionGovernanceRulesExecuteStatus Get. */ -public final class SubscriptionGovernanceRulesExecuteStatusGetSamples { +/** Samples for SubscriptionGovernanceRulesOperationResult Get. */ +public final class SubscriptionGovernanceRulesOperationResultGetSamples { /* * 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. + * Sample code: Get governance rules long run operation result by specific governance rule ID. * * @param manager Entry point to SecurityManager. */ - public static void getSecurityGovernanceRulesExecutionStatusBySpecificGovernanceRuleId( + public static void getGovernanceRulesLongRunOperationResultBySpecificGovernanceRuleID( com.azure.resourcemanager.security.SecurityManager manager) { manager - .subscriptionGovernanceRulesExecuteStatus() - .get("ad9a8e26-29d9-4829-bb30-e597a58cdbb8", "58b33f4f-c8c7-4b01-99cc-d437db4d40dd", Context.NONE); + .subscriptionGovernanceRulesOperationResults() + .getWithResponse( + "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", "58b33f4f-c8c7-4b01-99cc-d437db4d40dd", Context.NONE); } } ``` 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 4da6685a18db..532579d09fde 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 @@ -58,6 +58,9 @@ import com.azure.resourcemanager.security.implementation.IotSecuritySolutionsImpl; import com.azure.resourcemanager.security.implementation.JitNetworkAccessPoliciesImpl; import com.azure.resourcemanager.security.implementation.LocationsImpl; +import com.azure.resourcemanager.security.implementation.ManagementGroupGovernanceRulesImpl; +import com.azure.resourcemanager.security.implementation.ManagementGroupGovernanceRulesOperationResultsImpl; +import com.azure.resourcemanager.security.implementation.ManagementGroupGovernanceRulesOperationsImpl; import com.azure.resourcemanager.security.implementation.MdeOnboardingsImpl; import com.azure.resourcemanager.security.implementation.OperationsImpl; import com.azure.resourcemanager.security.implementation.PricingsImpl; @@ -70,8 +73,8 @@ 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.SecurityConnectorGovernanceRulesOperationResultsImpl; import com.azure.resourcemanager.security.implementation.SecurityConnectorGovernanceRulesOperationsImpl; import com.azure.resourcemanager.security.implementation.SecurityConnectorsImpl; import com.azure.resourcemanager.security.implementation.SecurityContactsImpl; @@ -84,7 +87,7 @@ 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.SubscriptionGovernanceRulesOperationResultsImpl; import com.azure.resourcemanager.security.implementation.TasksImpl; import com.azure.resourcemanager.security.implementation.TopologiesImpl; import com.azure.resourcemanager.security.implementation.WorkspaceSettingsImpl; @@ -122,6 +125,9 @@ import com.azure.resourcemanager.security.models.IotSecuritySolutionsAnalyticsRecommendations; import com.azure.resourcemanager.security.models.JitNetworkAccessPolicies; import com.azure.resourcemanager.security.models.Locations; +import com.azure.resourcemanager.security.models.ManagementGroupGovernanceRules; +import com.azure.resourcemanager.security.models.ManagementGroupGovernanceRulesOperationResults; +import com.azure.resourcemanager.security.models.ManagementGroupGovernanceRulesOperations; import com.azure.resourcemanager.security.models.MdeOnboardings; import com.azure.resourcemanager.security.models.Operations; import com.azure.resourcemanager.security.models.Pricings; @@ -134,7 +140,7 @@ 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.SecurityConnectorGovernanceRulesOperationResults; import com.azure.resourcemanager.security.models.SecurityConnectorGovernanceRulesOperations; import com.azure.resourcemanager.security.models.SecurityConnectors; import com.azure.resourcemanager.security.models.SecurityContacts; @@ -147,7 +153,7 @@ 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.SubscriptionGovernanceRulesOperationResults; import com.azure.resourcemanager.security.models.Tasks; import com.azure.resourcemanager.security.models.Topologies; import com.azure.resourcemanager.security.models.WorkspaceSettings; @@ -266,9 +272,15 @@ public final class SecurityManager { private SecurityConnectorGovernanceRulesOperations securityConnectorGovernanceRulesOperations; - private SubscriptionGovernanceRulesExecuteStatus subscriptionGovernanceRulesExecuteStatus; + private ManagementGroupGovernanceRules managementGroupGovernanceRules; - private SecurityConnectorGovernanceRulesExecuteStatus securityConnectorGovernanceRulesExecuteStatus; + private ManagementGroupGovernanceRulesOperations managementGroupGovernanceRulesOperations; + + private SubscriptionGovernanceRulesOperationResults subscriptionGovernanceRulesOperationResults; + + private SecurityConnectorGovernanceRulesOperationResults securityConnectorGovernanceRulesOperationResults; + + private ManagementGroupGovernanceRulesOperationResults managementGroupGovernanceRulesOperationResults; private GovernanceAssignments governanceAssignments; @@ -451,7 +463,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(" (") @@ -1176,31 +1188,72 @@ public SecurityConnectorGovernanceRulesOperations securityConnectorGovernanceRul } /** - * Gets the resource collection API of SubscriptionGovernanceRulesExecuteStatus. + * Gets the resource collection API of ManagementGroupGovernanceRules. + * + * @return Resource collection API of ManagementGroupGovernanceRules. + */ + public ManagementGroupGovernanceRules managementGroupGovernanceRules() { + if (this.managementGroupGovernanceRules == null) { + this.managementGroupGovernanceRules = + new ManagementGroupGovernanceRulesImpl(clientObject.getManagementGroupGovernanceRules(), this); + } + return managementGroupGovernanceRules; + } + + /** + * Gets the resource collection API of ManagementGroupGovernanceRulesOperations. + * + * @return Resource collection API of ManagementGroupGovernanceRulesOperations. + */ + public ManagementGroupGovernanceRulesOperations managementGroupGovernanceRulesOperations() { + if (this.managementGroupGovernanceRulesOperations == null) { + this.managementGroupGovernanceRulesOperations = + new ManagementGroupGovernanceRulesOperationsImpl( + clientObject.getManagementGroupGovernanceRulesOperations(), this); + } + return managementGroupGovernanceRulesOperations; + } + + /** + * Gets the resource collection API of SubscriptionGovernanceRulesOperationResults. + * + * @return Resource collection API of SubscriptionGovernanceRulesOperationResults. + */ + public SubscriptionGovernanceRulesOperationResults subscriptionGovernanceRulesOperationResults() { + if (this.subscriptionGovernanceRulesOperationResults == null) { + this.subscriptionGovernanceRulesOperationResults = + new SubscriptionGovernanceRulesOperationResultsImpl( + clientObject.getSubscriptionGovernanceRulesOperationResults(), this); + } + return subscriptionGovernanceRulesOperationResults; + } + + /** + * Gets the resource collection API of SecurityConnectorGovernanceRulesOperationResults. * - * @return Resource collection API of SubscriptionGovernanceRulesExecuteStatus. + * @return Resource collection API of SecurityConnectorGovernanceRulesOperationResults. */ - public SubscriptionGovernanceRulesExecuteStatus subscriptionGovernanceRulesExecuteStatus() { - if (this.subscriptionGovernanceRulesExecuteStatus == null) { - this.subscriptionGovernanceRulesExecuteStatus = - new SubscriptionGovernanceRulesExecuteStatusImpl( - clientObject.getSubscriptionGovernanceRulesExecuteStatus(), this); + public SecurityConnectorGovernanceRulesOperationResults securityConnectorGovernanceRulesOperationResults() { + if (this.securityConnectorGovernanceRulesOperationResults == null) { + this.securityConnectorGovernanceRulesOperationResults = + new SecurityConnectorGovernanceRulesOperationResultsImpl( + clientObject.getSecurityConnectorGovernanceRulesOperationResults(), this); } - return subscriptionGovernanceRulesExecuteStatus; + return securityConnectorGovernanceRulesOperationResults; } /** - * Gets the resource collection API of SecurityConnectorGovernanceRulesExecuteStatus. + * Gets the resource collection API of ManagementGroupGovernanceRulesOperationResults. * - * @return Resource collection API of SecurityConnectorGovernanceRulesExecuteStatus. + * @return Resource collection API of ManagementGroupGovernanceRulesOperationResults. */ - public SecurityConnectorGovernanceRulesExecuteStatus securityConnectorGovernanceRulesExecuteStatus() { - if (this.securityConnectorGovernanceRulesExecuteStatus == null) { - this.securityConnectorGovernanceRulesExecuteStatus = - new SecurityConnectorGovernanceRulesExecuteStatusImpl( - clientObject.getSecurityConnectorGovernanceRulesExecuteStatus(), this); + public ManagementGroupGovernanceRulesOperationResults managementGroupGovernanceRulesOperationResults() { + if (this.managementGroupGovernanceRulesOperationResults == null) { + this.managementGroupGovernanceRulesOperationResults = + new ManagementGroupGovernanceRulesOperationResultsImpl( + clientObject.getManagementGroupGovernanceRulesOperationResults(), this); } - return securityConnectorGovernanceRulesExecuteStatus; + return managementGroupGovernanceRulesOperationResults; } /** 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 611311e8ef0b..e321f563dfb6 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,31 @@ /** 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 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 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) @@ -49,9 +49,8 @@ public interface GovernanceAssignmentsClient { * * @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 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. @@ -67,9 +66,8 @@ Response getWithResponse( * * @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 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 +77,18 @@ 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 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 +99,17 @@ 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 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( @@ -124,9 +120,8 @@ GovernanceAssignmentInner createOrUpdate( * * @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 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. @@ -141,9 +136,8 @@ GovernanceAssignmentInner createOrUpdate( * * @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 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 02a824e96f3f..8aaac51c49a5 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 @@ -13,24 +13,24 @@ /** 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 the governance rules on the subscription level scope. * * @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 + * @return a list of the governance rules on the subscription level scope as paginated response with {@link * PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(); /** - * Get a list of all relevant governanceRules over a subscription level scope. + * Get a list of the governance rules on the subscription level 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 + * @return a list of the governance rules on the subscription level scope as paginated response with {@link * PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) 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 index e178e1f24eaf..7d9c4ff1d1a5 100644 --- 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 @@ -16,62 +16,62 @@ /** 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. + * Get a specific governance rule for the requested scope by ruleId. * - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. + * @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 governanceRule for the requested scope by ruleId along with {@link Response}. + * @return a specific governance rule 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. + * Get a specific governance rule for the requested scope by ruleId. * - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. + * @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 governanceRule for the requested scope by ruleId. + * @return a specific governance rule for the requested scope by ruleId. */ @ServiceMethod(returns = ReturnType.SINGLE) GovernanceRuleInner get(String ruleId); /** - * Creates or update a security GovernanceRule on the given subscription. + * Creates or updates a governance rule on a subscription. * - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @param governanceRule GovernanceRule over a subscription scope. + * @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 security GovernanceRule over a given scope along with {@link Response}. + * @return governance rule 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. + * Creates or updates a governance rule on a subscription. * - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @param governanceRule GovernanceRule over a subscription scope. + * @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 security GovernanceRule over a given scope. + * @return governance rule over a given scope. */ @ServiceMethod(returns = ReturnType.SINGLE) GovernanceRuleInner createOrUpdate(String ruleId, GovernanceRuleInner governanceRule); /** - * Delete a GovernanceRule over a given scope. + * Delete a Governance rule over a given scope. * - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. + * @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. @@ -82,9 +82,9 @@ Response createOrUpdateWithResponse( Response deleteWithResponse(String ruleId, Context context); /** - * Delete a GovernanceRule over a given scope. + * Delete a Governance rule over a given scope. * - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. + * @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. @@ -93,9 +93,9 @@ Response createOrUpdateWithResponse( void delete(String ruleId); /** - * Execute a security GovernanceRule on the given subscription. + * Execute a governance rule on a subscription. * - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. + * @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. @@ -105,10 +105,10 @@ Response createOrUpdateWithResponse( SyncPoller, Void> beginRuleIdExecuteSingleSubscription(String ruleId); /** - * Execute a security GovernanceRule on the given subscription. + * Execute a governance rule on a subscription. * - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @param executeGovernanceRuleParams GovernanceRule over a subscription scope. + * @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. @@ -120,9 +120,9 @@ SyncPoller, Void> beginRuleIdExecuteSingleSubscription( String ruleId, ExecuteGovernanceRuleParams executeGovernanceRuleParams, Context context); /** - * Execute a security GovernanceRule on the given subscription. + * Execute a governance rule on a subscription. * - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. + * @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. @@ -131,10 +131,10 @@ SyncPoller, Void> beginRuleIdExecuteSingleSubscription( void ruleIdExecuteSingleSubscription(String ruleId); /** - * Execute a security GovernanceRule on the given subscription. + * Execute a governance rule on a subscription. * - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @param executeGovernanceRuleParams GovernanceRule over a subscription scope. + * @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. @@ -145,12 +145,12 @@ void ruleIdExecuteSingleSubscription( String ruleId, ExecuteGovernanceRuleParams executeGovernanceRuleParams, Context context); /** - * Execute a security GovernanceRule on the given security connector. + * Execute a governance rule 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 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. @@ -161,13 +161,13 @@ SyncPoller, Void> beginRuleIdExecuteSingleSecurityConnector( String resourceGroupName, String securityConnectorName, String ruleId); /** - * Execute a security GovernanceRule on the given security connector. + * Execute a governance rule 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 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. @@ -183,12 +183,12 @@ SyncPoller, Void> beginRuleIdExecuteSingleSecurityConnector( Context context); /** - * Execute a security GovernanceRule on the given security connector. + * Execute a governance rule 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 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. @@ -197,13 +197,13 @@ SyncPoller, Void> beginRuleIdExecuteSingleSecurityConnector( void ruleIdExecuteSingleSecurityConnector(String resourceGroupName, String securityConnectorName, String ruleId); /** - * Execute a security GovernanceRule on the given security connector. + * Execute a governance rule 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 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. @@ -216,4 +216,66 @@ void ruleIdExecuteSingleSecurityConnector( String ruleId, ExecuteGovernanceRuleParams executeGovernanceRuleParams, Context context); + + /** + * Execute governance rule on the given management group. + * + * @param managementGroupId Azure Management Group ID. + * @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> beginRuleIdExecuteSingleManagementGroup(String managementGroupId, String ruleId); + + /** + * Execute governance rule on the given management group. + * + * @param managementGroupId Azure Management Group ID. + * @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> beginRuleIdExecuteSingleManagementGroup( + String managementGroupId, + String ruleId, + ExecuteGovernanceRuleParams executeGovernanceRuleParams, + Context context); + + /** + * Execute governance rule on the given management group. + * + * @param managementGroupId Azure Management Group ID. + * @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 ruleIdExecuteSingleManagementGroup(String managementGroupId, String ruleId); + + /** + * Execute governance rule on the given management group. + * + * @param managementGroupId Azure Management Group ID. + * @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 ruleIdExecuteSingleManagementGroup( + String managementGroupId, + String ruleId, + ExecuteGovernanceRuleParams executeGovernanceRuleParams, + Context context); } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/ManagementGroupGovernanceRulesClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/ManagementGroupGovernanceRulesClient.java new file mode 100644 index 000000000000..b925e7dc87e6 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/ManagementGroupGovernanceRulesClient.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.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 ManagementGroupGovernanceRulesClient. */ +public interface ManagementGroupGovernanceRulesClient { + /** + * Get a list of all relevant governance rules over a management group level scope. + * + * @param managementGroupId Azure Management Group 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 list of all relevant governance rules over a management group level scope as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String managementGroupId); + + /** + * Get a list of all relevant governance rules over a management group level scope. + * + * @param managementGroupId Azure Management Group 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 list of all relevant governance rules over a management group level scope as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String managementGroupId, Context context); +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/ManagementGroupGovernanceRulesOperationResultsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/ManagementGroupGovernanceRulesOperationResultsClient.java new file mode 100644 index 000000000000..561b9765f53c --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/ManagementGroupGovernanceRulesOperationResultsClient.java @@ -0,0 +1,47 @@ +// 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.util.Context; +import com.azure.resourcemanager.security.fluent.models.OperationResultAutoGeneratedInner; +import com.azure.resourcemanager.security.models.ManagementGroupGovernanceRulesOperationResultsGetResponse; + +/** + * An instance of this class provides access to all the operations defined in + * ManagementGroupGovernanceRulesOperationResultsClient. + */ +public interface ManagementGroupGovernanceRulesOperationResultsClient { + /** + * Get governance rules long run operation result for the requested scope by ruleId and operationId. + * + * @param managementGroupId Azure Management Group ID. + * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). + * @param operationId The governance rule execution key - unique key for the execution of governance rule. + * @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) + ManagementGroupGovernanceRulesOperationResultsGetResponse getWithResponse( + String managementGroupId, String ruleId, String operationId, Context context); + + /** + * Get governance rules long run operation result for the requested scope by ruleId and operationId. + * + * @param managementGroupId Azure Management Group ID. + * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). + * @param operationId The governance rule execution key - unique key for the execution of governance rule. + * @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 get(String managementGroupId, String ruleId, String operationId); +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/ManagementGroupGovernanceRulesOperationsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/ManagementGroupGovernanceRulesOperationsClient.java new file mode 100644 index 000000000000..aa93fac6d41a --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/ManagementGroupGovernanceRulesOperationsClient.java @@ -0,0 +1,128 @@ +// 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; + +/** + * An instance of this class provides access to all the operations defined in + * ManagementGroupGovernanceRulesOperationsClient. + */ +public interface ManagementGroupGovernanceRulesOperationsClient { + /** + * Get a specific governance rule for the requested scope by ruleId. + * + * @param managementGroupId Azure Management Group ID. + * @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 managementGroupId, String ruleId, Context context); + + /** + * Get a specific governance rule for the requested scope by ruleId. + * + * @param managementGroupId Azure Management Group ID. + * @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 managementGroupId, String ruleId); + + /** + * Creates or updates governance rule on the given management group. + * + * @param managementGroupId Azure Management Group ID. + * @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 managementGroupId, String ruleId, GovernanceRuleInner governanceRule, Context context); + + /** + * Creates or updates governance rule on the given management group. + * + * @param managementGroupId Azure Management Group ID. + * @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 managementGroupId, String ruleId, GovernanceRuleInner governanceRule); + + /** + * Delete a Governance rule over a given scope. + * + * @param managementGroupId Azure Management Group ID. + * @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 managementGroupId, String ruleId); + + /** + * Delete a Governance rule over a given scope. + * + * @param managementGroupId Azure Management Group ID. + * @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 managementGroupId, String ruleId, Context context); + + /** + * Delete a Governance rule over a given scope. + * + * @param managementGroupId Azure Management Group ID. + * @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 managementGroupId, String ruleId); + + /** + * Delete a Governance rule over a given scope. + * + * @param managementGroupId Azure Management Group ID. + * @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 managementGroupId, String ruleId, 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 4067fa273c19..efbc0fa17280 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 @@ -409,18 +409,39 @@ public interface SecurityCenter { SecurityConnectorGovernanceRulesOperationsClient getSecurityConnectorGovernanceRulesOperations(); /** - * Gets the SubscriptionGovernanceRulesExecuteStatusClient object to access its operations. + * Gets the ManagementGroupGovernanceRulesClient object to access its operations. * - * @return the SubscriptionGovernanceRulesExecuteStatusClient object. + * @return the ManagementGroupGovernanceRulesClient object. */ - SubscriptionGovernanceRulesExecuteStatusClient getSubscriptionGovernanceRulesExecuteStatus(); + ManagementGroupGovernanceRulesClient getManagementGroupGovernanceRules(); /** - * Gets the SecurityConnectorGovernanceRulesExecuteStatusClient object to access its operations. + * Gets the ManagementGroupGovernanceRulesOperationsClient object to access its operations. * - * @return the SecurityConnectorGovernanceRulesExecuteStatusClient object. + * @return the ManagementGroupGovernanceRulesOperationsClient object. */ - SecurityConnectorGovernanceRulesExecuteStatusClient getSecurityConnectorGovernanceRulesExecuteStatus(); + ManagementGroupGovernanceRulesOperationsClient getManagementGroupGovernanceRulesOperations(); + + /** + * Gets the SubscriptionGovernanceRulesOperationResultsClient object to access its operations. + * + * @return the SubscriptionGovernanceRulesOperationResultsClient object. + */ + SubscriptionGovernanceRulesOperationResultsClient getSubscriptionGovernanceRulesOperationResults(); + + /** + * Gets the SecurityConnectorGovernanceRulesOperationResultsClient object to access its operations. + * + * @return the SecurityConnectorGovernanceRulesOperationResultsClient object. + */ + SecurityConnectorGovernanceRulesOperationResultsClient getSecurityConnectorGovernanceRulesOperationResults(); + + /** + * Gets the ManagementGroupGovernanceRulesOperationResultsClient object to access its operations. + * + * @return the ManagementGroupGovernanceRulesOperationResultsClient object. + */ + ManagementGroupGovernanceRulesOperationResultsClient getManagementGroupGovernanceRulesOperationResults(); /** * Gets the GovernanceAssignmentsClient object to access its operations. 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 index 9384a9cbf5d1..f5b1d3f78f4e 100644 --- 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 @@ -15,7 +15,7 @@ */ public interface SecurityConnectorGovernanceRulesClient { /** - * Get a list of all relevant governanceRules over a security connector level scope. + * Get a list of all relevant governance rules over a security connector level scope. * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case * insensitive. @@ -23,14 +23,14 @@ public interface SecurityConnectorGovernanceRulesClient { * @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 + * @return a list of all relevant governance rules 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. + * Get a list of all relevant governance rules over a security connector level scope. * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case * insensitive. @@ -39,7 +39,7 @@ public interface SecurityConnectorGovernanceRulesClient { * @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 + * @return a list of all relevant governance rules over a security connector level scope as paginated response with * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) 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 99d21e3faec4..000000000000 --- 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/SecurityConnectorGovernanceRulesOperationResultsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecurityConnectorGovernanceRulesOperationResultsClient.java new file mode 100644 index 000000000000..bef67fa01ddd --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecurityConnectorGovernanceRulesOperationResultsClient.java @@ -0,0 +1,52 @@ +// 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.util.Context; +import com.azure.resourcemanager.security.fluent.models.OperationResultAutoGeneratedInner; +import com.azure.resourcemanager.security.models.SecurityConnectorGovernanceRulesOperationResultsGetResponse; + +/** + * An instance of this class provides access to all the operations defined in + * SecurityConnectorGovernanceRulesOperationResultsClient. + */ +public interface SecurityConnectorGovernanceRulesOperationResultsClient { + /** + * Get governance rule long run operation result 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 governance rule key - unique key for the standard governance rule (GUID). + * @param operationId The governance rule execution key - unique key for the execution of governance rule. + * @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 long run operation result for the requested scope by ruleId and operationId. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SecurityConnectorGovernanceRulesOperationResultsGetResponse getWithResponse( + String resourceGroupName, String securityConnectorName, String ruleId, String operationId, Context context); + + /** + * Get governance rule long run operation result 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 governance rule key - unique key for the standard governance rule (GUID). + * @param operationId The governance rule execution key - unique key for the execution of governance rule. + * @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 long run operation result for the requested scope by ruleId and operationId. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationResultAutoGeneratedInner get( + String resourceGroupName, String securityConnectorName, String ruleId, String operationId); +} 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 index f2963ac0d584..11929ddc574f 100644 --- 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 @@ -7,7 +7,9 @@ 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; /** @@ -16,50 +18,50 @@ */ public interface SecurityConnectorGovernanceRulesOperationsClient { /** - * Get a specific governanceRule for the requested scope by ruleId. + * Get a specific governance rule 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 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 governanceRule for the requested scope by ruleId along with {@link Response}. + * @return a specific governance rule 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. + * Get a specific governance rule 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 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 governanceRule for the requested scope by ruleId. + * @return a specific governance rule 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. + * Creates or updates a governance rule 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 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 security GovernanceRule over a given scope along with {@link Response}. + * @return governance rule over a given scope along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response createOrUpdateWithResponse( @@ -70,50 +72,81 @@ Response createOrUpdateWithResponse( Context context); /** - * Creates or update a security GovernanceRule on the given security connector. + * Creates or updates a governance rule 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 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 security GovernanceRule over a given scope. + * @return governance rule 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. + * Delete a Governance rule 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 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 resourceGroupName, String securityConnectorName, String ruleId); + + /** + * Delete a Governance rule 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 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 Response}. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse( + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( String resourceGroupName, String securityConnectorName, String ruleId, Context context); /** - * Delete a GovernanceRule over a given scope. + * Delete a Governance rule 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 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 resourceGroupName, String securityConnectorName, String ruleId); + + /** + * Delete a Governance rule 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 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 resourceGroupName, String securityConnectorName, String ruleId, Context context); } 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 2c9577447c45..000000000000 --- 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/SubscriptionGovernanceRulesOperationResultsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SubscriptionGovernanceRulesOperationResultsClient.java new file mode 100644 index 000000000000..9a2f6f6930f9 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SubscriptionGovernanceRulesOperationResultsClient.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.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.util.Context; +import com.azure.resourcemanager.security.fluent.models.OperationResultAutoGeneratedInner; +import com.azure.resourcemanager.security.models.SubscriptionGovernanceRulesOperationResultsGetResponse; + +/** + * An instance of this class provides access to all the operations defined in + * SubscriptionGovernanceRulesOperationResultsClient. + */ +public interface SubscriptionGovernanceRulesOperationResultsClient { + /** + * Get governance rules long run operation result for the requested scope by ruleId and operationId. + * + * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). + * @param operationId The governance rule execution key - unique key for the execution of governance rule. + * @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) + SubscriptionGovernanceRulesOperationResultsGetResponse getWithResponse( + String ruleId, String operationId, Context context); + + /** + * Get governance rules long run operation result for the requested scope by ruleId and operationId. + * + * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). + * @param operationId The governance rule execution key - unique key for the execution of governance rule. + * @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 get(String ruleId, String operationId); +} 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 da82adde2634..000000000000 --- 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 c828bf76ff26..f880104179cc 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 2a763d38f787..852350d9bc42 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. @@ -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 202b506fbfe2..7f4c9da7f5d4 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; @@ -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. @@ -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/OperationResultAutoGeneratedInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/OperationResultAutoGeneratedInner.java new file mode 100644 index 000000000000..c4ca79253a77 --- /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/ExecuteRuleStatusImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ExecuteRuleStatusImpl.java deleted file mode 100644 index 28186d86be9f..000000000000 --- 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 e906d7271e8d..1e2f0ec8c021 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 @@ -124,15 +124,15 @@ 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 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 +167,16 @@ 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 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 +211,15 @@ 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 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 +229,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 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 +249,15 @@ 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 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 +266,16 @@ 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 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) @@ -288,9 +288,8 @@ public PagedIterable list(String scope, String assess * * @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 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. @@ -337,9 +336,8 @@ private Mono> getWithResponseAsync( * * @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 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. @@ -377,9 +375,8 @@ private Mono> getWithResponseAsync( * * @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 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. @@ -397,9 +394,8 @@ private Mono getAsync(String scope, String assessment * * @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 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. @@ -417,9 +413,8 @@ public Response getWithResponse( * * @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 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 +426,18 @@ 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 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 +482,19 @@ 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 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 +540,17 @@ 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 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 +560,18 @@ 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 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 +585,17 @@ 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 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( @@ -619,9 +609,8 @@ public GovernanceAssignmentInner createOrUpdate( * * @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 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. @@ -658,9 +647,8 @@ private Mono> deleteWithResponseAsync(String scope, String assess * * @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 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. @@ -695,9 +683,8 @@ private Mono> deleteWithResponseAsync( * * @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 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. @@ -713,9 +700,8 @@ private Mono deleteAsync(String scope, String assessmentName, String assig * * @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 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. @@ -733,9 +719,8 @@ public Response deleteWithResponse( * * @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 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 +738,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 +776,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 305b3e22fa3c..679e0fbc1c1d 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; } @@ -215,11 +237,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 +262,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 ea8fac3117c4..63ccb81f7d19 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 @@ -79,12 +79,12 @@ Mono> listNext( } /** - * Get a list of all relevant governanceRules over a subscription level scope. + * Get a list of the governance rules on the subscription level scope. * * @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 the governance rules on the subscription level scope along with {@link PagedResponse} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync() { @@ -120,14 +120,14 @@ private Mono> listSinglePageAsync() { } /** - * Get a list of all relevant governanceRules over a subscription level scope. + * Get a list of the governance rules on the subscription level 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 list of all relevant governanceRules over a subscription level scope along with {@link PagedResponse} - * on successful completion of {@link Mono}. + * @return a list of the governance rules on the subscription level scope along with {@link PagedResponse} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(Context context) { @@ -160,11 +160,11 @@ private Mono> listSinglePageAsync(Context con } /** - * Get a list of all relevant governanceRules over a subscription level scope. + * Get a list of the governance rules on the subscription level scope. * * @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 + * @return a list of the governance rules on the subscription level scope as paginated response with {@link * PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) @@ -173,13 +173,13 @@ private PagedFlux listAsync() { } /** - * Get a list of all relevant governanceRules over a subscription level scope. + * Get a list of the governance rules on the subscription level 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 list of all relevant governanceRules over a subscription level scope as paginated response with {@link + * @return a list of the governance rules on the subscription level scope as paginated response with {@link * PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) @@ -189,11 +189,11 @@ private PagedFlux listAsync(Context context) { } /** - * Get a list of all relevant governanceRules over a subscription level scope. + * Get a list of the governance rules on the subscription level scope. * * @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 + * @return a list of the governance rules on the subscription level scope as paginated response with {@link * PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) @@ -202,13 +202,13 @@ public PagedIterable list() { } /** - * Get a list of all relevant governanceRules over a subscription level scope. + * Get a list of the governance rules on the subscription level 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 list of all relevant governanceRules over a subscription level scope as paginated response with {@link + * @return a list of the governance rules on the subscription level scope as paginated response with {@link * PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) @@ -224,8 +224,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 +262,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/GovernanceRulesOperationsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GovernanceRulesOperationsClientImpl.java index 93087b1f3699..31f73d4c528d 100644 --- 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 @@ -129,16 +129,31 @@ Mono>> ruleIdExecuteSingleSecurityConnector( @BodyParam("application/json") ExecuteGovernanceRuleParams executeGovernanceRuleParams, @HeaderParam("Accept") String accept, Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Security" + + "/governanceRules/{ruleId}/execute") + @ExpectedResponses({202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> ruleIdExecuteSingleManagementGroup( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("managementGroupId") String managementGroupId, + @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. + * Get a specific governance rule for the requested scope by ruleId. * - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. + * @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 governanceRule for the requested scope by ruleId along with {@link Response} on successful + * @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) @@ -175,14 +190,14 @@ private Mono> getWithResponseAsync(String ruleId) } /** - * Get a specific governanceRule for the requested scope by ruleId. + * Get a specific governance rule for the requested scope by ruleId. * - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. + * @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 governanceRule for the requested scope by ruleId along with {@link Response} on successful + * @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) @@ -210,13 +225,13 @@ private Mono> getWithResponseAsync(String ruleId, } /** - * Get a specific governanceRule for the requested scope by ruleId. + * Get a specific governance rule for the requested scope by ruleId. * - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. + * @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 governanceRule for the requested scope by ruleId on successful completion of {@link Mono}. + * @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 ruleId) { @@ -224,14 +239,14 @@ private Mono getAsync(String ruleId) { } /** - * Get a specific governanceRule for the requested scope by ruleId. + * Get a specific governance rule for the requested scope by ruleId. * - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. + * @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 governanceRule for the requested scope by ruleId along with {@link Response}. + * @return a specific governance rule for the requested scope by ruleId along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String ruleId, Context context) { @@ -239,13 +254,13 @@ public Response getWithResponse(String ruleId, Context cont } /** - * Get a specific governanceRule for the requested scope by ruleId. + * Get a specific governance rule for the requested scope by ruleId. * - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. + * @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 governanceRule for the requested scope by ruleId. + * @return a specific governance rule for the requested scope by ruleId. */ @ServiceMethod(returns = ReturnType.SINGLE) public GovernanceRuleInner get(String ruleId) { @@ -253,15 +268,14 @@ public GovernanceRuleInner get(String ruleId) { } /** - * Creates or update a security GovernanceRule on the given subscription. + * Creates or updates a governance rule on a subscription. * - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @param governanceRule GovernanceRule over a subscription scope. + * @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 security GovernanceRule over a given scope along with {@link Response} on successful completion of {@link - * Mono}. + * @return governance rule over a given scope along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrUpdateWithResponseAsync( @@ -304,16 +318,15 @@ private Mono> createOrUpdateWithResponseAsync( } /** - * Creates or update a security GovernanceRule on the given subscription. + * Creates or updates a governance rule on a subscription. * - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @param governanceRule GovernanceRule over a subscription scope. + * @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 security GovernanceRule over a given scope along with {@link Response} on successful completion of {@link - * Mono}. + * @return governance rule over a given scope along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrUpdateWithResponseAsync( @@ -353,14 +366,14 @@ private Mono> createOrUpdateWithResponseAsync( } /** - * Creates or update a security GovernanceRule on the given subscription. + * Creates or updates a governance rule on a subscription. * - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @param governanceRule GovernanceRule over a subscription scope. + * @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 security GovernanceRule over a given scope on successful completion of {@link Mono}. + * @return governance rule over a given scope on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync(String ruleId, GovernanceRuleInner governanceRule) { @@ -368,15 +381,15 @@ private Mono createOrUpdateAsync(String ruleId, GovernanceR } /** - * Creates or update a security GovernanceRule on the given subscription. + * Creates or updates a governance rule on a subscription. * - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @param governanceRule GovernanceRule over a subscription scope. + * @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 security GovernanceRule over a given scope along with {@link Response}. + * @return governance rule over a given scope along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response createOrUpdateWithResponse( @@ -385,14 +398,14 @@ public Response createOrUpdateWithResponse( } /** - * Creates or update a security GovernanceRule on the given subscription. + * Creates or updates a governance rule on a subscription. * - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @param governanceRule GovernanceRule over a subscription scope. + * @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 security GovernanceRule over a given scope. + * @return governance rule over a given scope. */ @ServiceMethod(returns = ReturnType.SINGLE) public GovernanceRuleInner createOrUpdate(String ruleId, GovernanceRuleInner governanceRule) { @@ -400,9 +413,9 @@ public GovernanceRuleInner createOrUpdate(String ruleId, GovernanceRuleInner gov } /** - * Delete a GovernanceRule over a given scope. + * Delete a Governance rule over a given scope. * - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. + * @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. @@ -436,9 +449,9 @@ private Mono> deleteWithResponseAsync(String ruleId) { } /** - * Delete a GovernanceRule over a given scope. + * Delete a Governance rule over a given scope. * - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. + * @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. @@ -468,9 +481,9 @@ private Mono> deleteWithResponseAsync(String ruleId, Context cont } /** - * Delete a GovernanceRule over a given scope. + * Delete a Governance rule over a given scope. * - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. + * @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. @@ -482,9 +495,9 @@ private Mono deleteAsync(String ruleId) { } /** - * Delete a GovernanceRule over a given scope. + * Delete a Governance rule over a given scope. * - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. + * @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. @@ -497,9 +510,9 @@ public Response deleteWithResponse(String ruleId, Context context) { } /** - * Delete a GovernanceRule over a given scope. + * Delete a Governance rule over a given scope. * - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. + * @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. @@ -510,10 +523,10 @@ public void delete(String ruleId) { } /** - * Execute a security GovernanceRule on the given subscription. + * Execute a governance rule on a subscription. * - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @param executeGovernanceRuleParams GovernanceRule over a subscription scope. + * @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. @@ -558,10 +571,10 @@ private Mono>> ruleIdExecuteSingleSubscriptionWithResp } /** - * Execute a security GovernanceRule on the given subscription. + * Execute a governance rule on a subscription. * - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @param executeGovernanceRuleParams GovernanceRule over a subscription scope. + * @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. @@ -604,10 +617,10 @@ private Mono>> ruleIdExecuteSingleSubscriptionWithResp } /** - * Execute a security GovernanceRule on the given subscription. + * Execute a governance rule on a subscription. * - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @param executeGovernanceRuleParams GovernanceRule over a subscription scope. + * @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. @@ -625,9 +638,9 @@ private PollerFlux, Void> beginRuleIdExecuteSingleSubscriptionA } /** - * Execute a security GovernanceRule on the given subscription. + * Execute a governance rule on a subscription. * - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. + * @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. @@ -645,10 +658,10 @@ private PollerFlux, Void> beginRuleIdExecuteSingleSubscriptionA } /** - * Execute a security GovernanceRule on the given subscription. + * Execute a governance rule on a subscription. * - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @param executeGovernanceRuleParams GovernanceRule over a subscription scope. + * @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. @@ -667,9 +680,9 @@ private PollerFlux, Void> beginRuleIdExecuteSingleSubscriptionA } /** - * Execute a security GovernanceRule on the given subscription. + * Execute a governance rule on a subscription. * - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. + * @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. @@ -682,10 +695,10 @@ public SyncPoller, Void> beginRuleIdExecuteSingleSubscription(S } /** - * Execute a security GovernanceRule on the given subscription. + * Execute a governance rule on a subscription. * - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @param executeGovernanceRuleParams GovernanceRule over a subscription scope. + * @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. @@ -699,10 +712,10 @@ public SyncPoller, Void> beginRuleIdExecuteSingleSubscription( } /** - * Execute a security GovernanceRule on the given subscription. + * Execute a governance rule on a subscription. * - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @param executeGovernanceRuleParams GovernanceRule over a subscription scope. + * @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. @@ -717,9 +730,9 @@ private Mono ruleIdExecuteSingleSubscriptionAsync( } /** - * Execute a security GovernanceRule on the given subscription. + * Execute a governance rule on a subscription. * - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. + * @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. @@ -734,10 +747,10 @@ private Mono ruleIdExecuteSingleSubscriptionAsync(String ruleId) { } /** - * Execute a security GovernanceRule on the given subscription. + * Execute a governance rule on a subscription. * - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @param executeGovernanceRuleParams GovernanceRule over a subscription scope. + * @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. @@ -753,9 +766,9 @@ private Mono ruleIdExecuteSingleSubscriptionAsync( } /** - * Execute a security GovernanceRule on the given subscription. + * Execute a governance rule on a subscription. * - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. + * @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. @@ -767,10 +780,10 @@ public void ruleIdExecuteSingleSubscription(String ruleId) { } /** - * Execute a security GovernanceRule on the given subscription. + * Execute a governance rule on a subscription. * - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @param executeGovernanceRuleParams GovernanceRule over a subscription scope. + * @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. @@ -783,13 +796,13 @@ public void ruleIdExecuteSingleSubscription( } /** - * Execute a security GovernanceRule on the given security connector. + * Execute a governance rule 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 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. @@ -847,13 +860,13 @@ private Mono>> ruleIdExecuteSingleSecurityConnectorWit } /** - * Execute a security GovernanceRule on the given security connector. + * Execute a governance rule 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 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. @@ -910,13 +923,13 @@ private Mono>> ruleIdExecuteSingleSecurityConnectorWit } /** - * Execute a security GovernanceRule on the given security connector. + * Execute a governance rule 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 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. @@ -938,12 +951,12 @@ private PollerFlux, Void> beginRuleIdExecuteSingleSecurityConne } /** - * Execute a security GovernanceRule on the given security connector. + * Execute a governance rule 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 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. @@ -963,13 +976,13 @@ private PollerFlux, Void> beginRuleIdExecuteSingleSecurityConne } /** - * Execute a security GovernanceRule on the given security connector. + * Execute a governance rule 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 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. @@ -993,12 +1006,12 @@ private PollerFlux, Void> beginRuleIdExecuteSingleSecurityConne } /** - * Execute a security GovernanceRule on the given security connector. + * Execute a governance rule 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 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. @@ -1014,13 +1027,13 @@ public SyncPoller, Void> beginRuleIdExecuteSingleSecurityConnec } /** - * Execute a security GovernanceRule on the given security connector. + * Execute a governance rule 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 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. @@ -1040,13 +1053,13 @@ public SyncPoller, Void> beginRuleIdExecuteSingleSecurityConnec } /** - * Execute a security GovernanceRule on the given security connector. + * Execute a governance rule 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 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. @@ -1065,12 +1078,12 @@ private Mono ruleIdExecuteSingleSecurityConnectorAsync( } /** - * Execute a security GovernanceRule on the given security connector. + * Execute a governance rule 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 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. @@ -1087,13 +1100,13 @@ private Mono ruleIdExecuteSingleSecurityConnectorAsync( } /** - * Execute a security GovernanceRule on the given security connector. + * Execute a governance rule 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 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. @@ -1114,12 +1127,12 @@ private Mono ruleIdExecuteSingleSecurityConnectorAsync( } /** - * Execute a security GovernanceRule on the given security connector. + * Execute a governance rule 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 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. @@ -1134,13 +1147,13 @@ public void ruleIdExecuteSingleSecurityConnector( } /** - * Execute a security GovernanceRule on the given security connector. + * Execute a governance rule 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 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. @@ -1157,4 +1170,308 @@ public void ruleIdExecuteSingleSecurityConnector( resourceGroupName, securityConnectorName, ruleId, executeGovernanceRuleParams, context) .block(); } + + /** + * Execute governance rule on the given management group. + * + * @param managementGroupId Azure Management Group ID. + * @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>> ruleIdExecuteSingleManagementGroupWithResponseAsync( + String managementGroupId, 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 (managementGroupId == null) { + return Mono + .error(new IllegalArgumentException("Parameter managementGroupId 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 + .ruleIdExecuteSingleManagementGroup( + this.client.getEndpoint(), + apiVersion, + managementGroupId, + ruleId, + executeGovernanceRuleParams, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Execute governance rule on the given management group. + * + * @param managementGroupId Azure Management Group ID. + * @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>> ruleIdExecuteSingleManagementGroupWithResponseAsync( + String managementGroupId, + 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 (managementGroupId == null) { + return Mono + .error(new IllegalArgumentException("Parameter managementGroupId 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 + .ruleIdExecuteSingleManagementGroup( + this.client.getEndpoint(), + apiVersion, + managementGroupId, + ruleId, + executeGovernanceRuleParams, + accept, + context); + } + + /** + * Execute governance rule on the given management group. + * + * @param managementGroupId Azure Management Group ID. + * @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> beginRuleIdExecuteSingleManagementGroupAsync( + String managementGroupId, String ruleId, ExecuteGovernanceRuleParams executeGovernanceRuleParams) { + Mono>> mono = + ruleIdExecuteSingleManagementGroupWithResponseAsync(managementGroupId, ruleId, executeGovernanceRuleParams); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Execute governance rule on the given management group. + * + * @param managementGroupId Azure Management Group ID. + * @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> beginRuleIdExecuteSingleManagementGroupAsync( + String managementGroupId, String ruleId) { + final ExecuteGovernanceRuleParams executeGovernanceRuleParams = null; + Mono>> mono = + ruleIdExecuteSingleManagementGroupWithResponseAsync(managementGroupId, ruleId, executeGovernanceRuleParams); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Execute governance rule on the given management group. + * + * @param managementGroupId Azure Management Group ID. + * @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> beginRuleIdExecuteSingleManagementGroupAsync( + String managementGroupId, + String ruleId, + ExecuteGovernanceRuleParams executeGovernanceRuleParams, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + ruleIdExecuteSingleManagementGroupWithResponseAsync( + managementGroupId, ruleId, executeGovernanceRuleParams, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Execute governance rule on the given management group. + * + * @param managementGroupId Azure Management Group ID. + * @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> beginRuleIdExecuteSingleManagementGroup( + String managementGroupId, String ruleId) { + final ExecuteGovernanceRuleParams executeGovernanceRuleParams = null; + return beginRuleIdExecuteSingleManagementGroupAsync(managementGroupId, ruleId, executeGovernanceRuleParams) + .getSyncPoller(); + } + + /** + * Execute governance rule on the given management group. + * + * @param managementGroupId Azure Management Group ID. + * @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> beginRuleIdExecuteSingleManagementGroup( + String managementGroupId, + String ruleId, + ExecuteGovernanceRuleParams executeGovernanceRuleParams, + Context context) { + return beginRuleIdExecuteSingleManagementGroupAsync( + managementGroupId, ruleId, executeGovernanceRuleParams, context) + .getSyncPoller(); + } + + /** + * Execute governance rule on the given management group. + * + * @param managementGroupId Azure Management Group ID. + * @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 ruleIdExecuteSingleManagementGroupAsync( + String managementGroupId, String ruleId, ExecuteGovernanceRuleParams executeGovernanceRuleParams) { + return beginRuleIdExecuteSingleManagementGroupAsync(managementGroupId, ruleId, executeGovernanceRuleParams) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Execute governance rule on the given management group. + * + * @param managementGroupId Azure Management Group ID. + * @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 ruleIdExecuteSingleManagementGroupAsync(String managementGroupId, String ruleId) { + final ExecuteGovernanceRuleParams executeGovernanceRuleParams = null; + return beginRuleIdExecuteSingleManagementGroupAsync(managementGroupId, ruleId, executeGovernanceRuleParams) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Execute governance rule on the given management group. + * + * @param managementGroupId Azure Management Group ID. + * @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 ruleIdExecuteSingleManagementGroupAsync( + String managementGroupId, + String ruleId, + ExecuteGovernanceRuleParams executeGovernanceRuleParams, + Context context) { + return beginRuleIdExecuteSingleManagementGroupAsync( + managementGroupId, ruleId, executeGovernanceRuleParams, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Execute governance rule on the given management group. + * + * @param managementGroupId Azure Management Group ID. + * @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 ruleIdExecuteSingleManagementGroup(String managementGroupId, String ruleId) { + final ExecuteGovernanceRuleParams executeGovernanceRuleParams = null; + ruleIdExecuteSingleManagementGroupAsync(managementGroupId, ruleId, executeGovernanceRuleParams).block(); + } + + /** + * Execute governance rule on the given management group. + * + * @param managementGroupId Azure Management Group ID. + * @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 ruleIdExecuteSingleManagementGroup( + String managementGroupId, + String ruleId, + ExecuteGovernanceRuleParams executeGovernanceRuleParams, + Context context) { + ruleIdExecuteSingleManagementGroupAsync(managementGroupId, 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 index cccc331c926b..5e5dddd04864 100644 --- 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 @@ -84,6 +84,20 @@ public void ruleIdExecuteSingleSecurityConnector( resourceGroupName, securityConnectorName, ruleId, executeGovernanceRuleParams, context); } + public void ruleIdExecuteSingleManagementGroup(String managementGroupId, String ruleId) { + this.serviceClient().ruleIdExecuteSingleManagementGroup(managementGroupId, ruleId); + } + + public void ruleIdExecuteSingleManagementGroup( + String managementGroupId, + String ruleId, + ExecuteGovernanceRuleParams executeGovernanceRuleParams, + Context context) { + this + .serviceClient() + .ruleIdExecuteSingleManagementGroup(managementGroupId, ruleId, executeGovernanceRuleParams, context); + } + public GovernanceRule getById(String id) { String ruleId = Utils.getValueFromIdByName(id, "governanceRules"); if (ruleId == null) { diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ManagementGroupGovernanceRulesClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ManagementGroupGovernanceRulesClientImpl.java new file mode 100644 index 000000000000..800d88df242b --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ManagementGroupGovernanceRulesClientImpl.java @@ -0,0 +1,304 @@ +// 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.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +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.ManagementGroupGovernanceRulesClient; +import com.azure.resourcemanager.security.fluent.models.GovernanceRuleInner; +import com.azure.resourcemanager.security.models.GovernanceRuleList; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ManagementGroupGovernanceRulesClient. */ +public final class ManagementGroupGovernanceRulesClientImpl implements ManagementGroupGovernanceRulesClient { + /** The proxy service used to perform REST calls. */ + private final ManagementGroupGovernanceRulesService service; + + /** The service client containing this operation class. */ + private final SecurityCenterImpl client; + + /** + * Initializes an instance of ManagementGroupGovernanceRulesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ManagementGroupGovernanceRulesClientImpl(SecurityCenterImpl client) { + this.service = + RestProxy + .create( + ManagementGroupGovernanceRulesService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityCenterManagementGroupGovernanceRules to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SecurityCenterManage") + public interface ManagementGroupGovernanceRulesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Security" + + "/governanceRules") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("managementGroupId") String managementGroupId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get a list of all relevant governance rules over a management group level scope. + * + * @param managementGroupId Azure Management Group ID. + * @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 governance rules over a management group level scope along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String managementGroupId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (managementGroupId == null) { + return Mono + .error(new IllegalArgumentException("Parameter managementGroupId 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, managementGroupId, accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a list of all relevant governance rules over a management group level scope. + * + * @param managementGroupId Azure Management Group ID. + * @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 governance rules over a management group level scope along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String managementGroupId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (managementGroupId == null) { + return Mono + .error(new IllegalArgumentException("Parameter managementGroupId 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, managementGroupId, accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get a list of all relevant governance rules over a management group level scope. + * + * @param managementGroupId Azure Management Group ID. + * @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 governance rules over a management group level scope as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String managementGroupId) { + return new PagedFlux<>( + () -> listSinglePageAsync(managementGroupId), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Get a list of all relevant governance rules over a management group level scope. + * + * @param managementGroupId Azure Management Group ID. + * @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 governance rules over a management group level scope as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String managementGroupId, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(managementGroupId, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Get a list of all relevant governance rules over a management group level scope. + * + * @param managementGroupId Azure Management Group ID. + * @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 governance rules over a management group level scope as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String managementGroupId) { + return new PagedIterable<>(listAsync(managementGroupId)); + } + + /** + * Get a list of all relevant governance rules over a management group level scope. + * + * @param managementGroupId Azure Management Group ID. + * @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 governance rules over a management group level scope as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String managementGroupId, Context context) { + return new PagedIterable<>(listAsync(managementGroupId, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @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 governance rules list along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @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 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) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ManagementGroupGovernanceRulesImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ManagementGroupGovernanceRulesImpl.java new file mode 100644 index 000000000000..fa3d69006eb8 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ManagementGroupGovernanceRulesImpl.java @@ -0,0 +1,46 @@ +// 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.ManagementGroupGovernanceRulesClient; +import com.azure.resourcemanager.security.fluent.models.GovernanceRuleInner; +import com.azure.resourcemanager.security.models.GovernanceRule; +import com.azure.resourcemanager.security.models.ManagementGroupGovernanceRules; + +public final class ManagementGroupGovernanceRulesImpl implements ManagementGroupGovernanceRules { + private static final ClientLogger LOGGER = new ClientLogger(ManagementGroupGovernanceRulesImpl.class); + + private final ManagementGroupGovernanceRulesClient innerClient; + + private final com.azure.resourcemanager.security.SecurityManager serviceManager; + + public ManagementGroupGovernanceRulesImpl( + ManagementGroupGovernanceRulesClient innerClient, + com.azure.resourcemanager.security.SecurityManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String managementGroupId) { + PagedIterable inner = this.serviceClient().list(managementGroupId); + return Utils.mapPage(inner, inner1 -> new GovernanceRuleImpl(inner1, this.manager())); + } + + public PagedIterable list(String managementGroupId, Context context) { + PagedIterable inner = this.serviceClient().list(managementGroupId, context); + return Utils.mapPage(inner, inner1 -> new GovernanceRuleImpl(inner1, this.manager())); + } + + private ManagementGroupGovernanceRulesClient 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/ManagementGroupGovernanceRulesOperationResultsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ManagementGroupGovernanceRulesOperationResultsClientImpl.java new file mode 100644 index 000000000000..56c6c2643ecd --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ManagementGroupGovernanceRulesOperationResultsClientImpl.java @@ -0,0 +1,217 @@ +// 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.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.ManagementGroupGovernanceRulesOperationResultsClient; +import com.azure.resourcemanager.security.fluent.models.OperationResultAutoGeneratedInner; +import com.azure.resourcemanager.security.models.ManagementGroupGovernanceRulesOperationResultsGetResponse; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in + * ManagementGroupGovernanceRulesOperationResultsClient. + */ +public final class ManagementGroupGovernanceRulesOperationResultsClientImpl + implements ManagementGroupGovernanceRulesOperationResultsClient { + /** The proxy service used to perform REST calls. */ + private final ManagementGroupGovernanceRulesOperationResultsService service; + + /** The service client containing this operation class. */ + private final SecurityCenterImpl client; + + /** + * Initializes an instance of ManagementGroupGovernanceRulesOperationResultsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ManagementGroupGovernanceRulesOperationResultsClientImpl(SecurityCenterImpl client) { + this.service = + RestProxy + .create( + ManagementGroupGovernanceRulesOperationResultsService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityCenterManagementGroupGovernanceRulesOperationResults to be + * used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SecurityCenterManage") + public interface ManagementGroupGovernanceRulesOperationResultsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/providers/Microsoft.Management/managementGroups/{managementGroupId}/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("managementGroupId") String managementGroupId, + @PathParam("ruleId") String ruleId, + @PathParam("operationId") String operationId, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get governance rules long run operation result for the requested scope by ruleId and operationId. + * + * @param managementGroupId Azure Management Group ID. + * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). + * @param operationId The governance rule execution key - unique key for the execution of governance rule. + * @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 getWithResponseAsync( + String managementGroupId, 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 (managementGroupId == null) { + return Mono + .error(new IllegalArgumentException("Parameter managementGroupId 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, + managementGroupId, + 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 managementGroupId Azure Management Group ID. + * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). + * @param operationId The governance rule execution key - unique key for the execution of governance rule. + * @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 getWithResponseAsync( + String managementGroupId, 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 (managementGroupId == null) { + return Mono + .error(new IllegalArgumentException("Parameter managementGroupId 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, managementGroupId, ruleId, operationId, accept, context); + } + + /** + * Get governance rules long run operation result for the requested scope by ruleId and operationId. + * + * @param managementGroupId Azure Management Group ID. + * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). + * @param operationId The governance rule execution key - unique key for the execution of governance rule. + * @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 getAsync( + String managementGroupId, String ruleId, String operationId) { + return getWithResponseAsync(managementGroupId, ruleId, operationId) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get governance rules long run operation result for the requested scope by ruleId and operationId. + * + * @param managementGroupId Azure Management Group ID. + * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). + * @param operationId The governance rule execution key - unique key for the execution of governance rule. + * @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 ManagementGroupGovernanceRulesOperationResultsGetResponse getWithResponse( + String managementGroupId, String ruleId, String operationId, Context context) { + return getWithResponseAsync(managementGroupId, ruleId, operationId, context).block(); + } + + /** + * Get governance rules long run operation result for the requested scope by ruleId and operationId. + * + * @param managementGroupId Azure Management Group ID. + * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). + * @param operationId The governance rule execution key - unique key for the execution of governance rule. + * @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 get(String managementGroupId, String ruleId, String operationId) { + return getWithResponse(managementGroupId, ruleId, operationId, Context.NONE).getValue(); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ManagementGroupGovernanceRulesOperationResultsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ManagementGroupGovernanceRulesOperationResultsImpl.java new file mode 100644 index 000000000000..0be3df48f9ab --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ManagementGroupGovernanceRulesOperationResultsImpl.java @@ -0,0 +1,64 @@ +// 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.ManagementGroupGovernanceRulesOperationResultsClient; +import com.azure.resourcemanager.security.fluent.models.OperationResultAutoGeneratedInner; +import com.azure.resourcemanager.security.models.ManagementGroupGovernanceRulesOperationResults; +import com.azure.resourcemanager.security.models.ManagementGroupGovernanceRulesOperationResultsGetResponse; +import com.azure.resourcemanager.security.models.OperationResultAutoGenerated; + +public final class ManagementGroupGovernanceRulesOperationResultsImpl + implements ManagementGroupGovernanceRulesOperationResults { + private static final ClientLogger LOGGER = + new ClientLogger(ManagementGroupGovernanceRulesOperationResultsImpl.class); + + private final ManagementGroupGovernanceRulesOperationResultsClient innerClient; + + private final com.azure.resourcemanager.security.SecurityManager serviceManager; + + public ManagementGroupGovernanceRulesOperationResultsImpl( + ManagementGroupGovernanceRulesOperationResultsClient innerClient, + com.azure.resourcemanager.security.SecurityManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse( + String managementGroupId, String ruleId, String operationId, Context context) { + ManagementGroupGovernanceRulesOperationResultsGetResponse inner = + this.serviceClient().getWithResponse(managementGroupId, 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 get(String managementGroupId, String ruleId, String operationId) { + OperationResultAutoGeneratedInner inner = this.serviceClient().get(managementGroupId, ruleId, operationId); + if (inner != null) { + return new OperationResultAutoGeneratedImpl(inner, this.manager()); + } else { + return null; + } + } + + private ManagementGroupGovernanceRulesOperationResultsClient 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/ManagementGroupGovernanceRulesOperationsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ManagementGroupGovernanceRulesOperationsClientImpl.java new file mode 100644 index 000000000000..4732567d6092 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ManagementGroupGovernanceRulesOperationsClientImpl.java @@ -0,0 +1,567 @@ +// 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.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.ManagementGroupGovernanceRulesOperationsClient; +import com.azure.resourcemanager.security.fluent.models.GovernanceRuleInner; +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 + * ManagementGroupGovernanceRulesOperationsClient. + */ +public final class ManagementGroupGovernanceRulesOperationsClientImpl + implements ManagementGroupGovernanceRulesOperationsClient { + /** The proxy service used to perform REST calls. */ + private final ManagementGroupGovernanceRulesOperationsService service; + + /** The service client containing this operation class. */ + private final SecurityCenterImpl client; + + /** + * Initializes an instance of ManagementGroupGovernanceRulesOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ManagementGroupGovernanceRulesOperationsClientImpl(SecurityCenterImpl client) { + this.service = + RestProxy + .create( + ManagementGroupGovernanceRulesOperationsService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityCenterManagementGroupGovernanceRulesOperations to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SecurityCenterManage") + public interface ManagementGroupGovernanceRulesOperationsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Security" + + "/governanceRules/{ruleId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("managementGroupId") String managementGroupId, + @PathParam("ruleId") String ruleId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Security" + + "/governanceRules/{ruleId}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("managementGroupId") String managementGroupId, + @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( + "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Security" + + "/governanceRules/{ruleId}") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("managementGroupId") String managementGroupId, + @PathParam("ruleId") String ruleId, + Context context); + } + + /** + * Get a specific governance rule for the requested scope by ruleId. + * + * @param managementGroupId Azure Management Group ID. + * @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 managementGroupId, String ruleId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (managementGroupId == null) { + return Mono + .error(new IllegalArgumentException("Parameter managementGroupId 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, managementGroupId, 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 managementGroupId Azure Management Group ID. + * @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 managementGroupId, 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 (managementGroupId == null) { + return Mono + .error(new IllegalArgumentException("Parameter managementGroupId 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, managementGroupId, ruleId, accept, context); + } + + /** + * Get a specific governance rule for the requested scope by ruleId. + * + * @param managementGroupId Azure Management Group ID. + * @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 managementGroupId, String ruleId) { + return getWithResponseAsync(managementGroupId, ruleId).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a specific governance rule for the requested scope by ruleId. + * + * @param managementGroupId Azure Management Group ID. + * @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 managementGroupId, String ruleId, Context context) { + return getWithResponseAsync(managementGroupId, ruleId, context).block(); + } + + /** + * Get a specific governance rule for the requested scope by ruleId. + * + * @param managementGroupId Azure Management Group ID. + * @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 managementGroupId, String ruleId) { + return getWithResponse(managementGroupId, ruleId, Context.NONE).getValue(); + } + + /** + * Creates or updates governance rule on the given management group. + * + * @param managementGroupId Azure Management Group ID. + * @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 managementGroupId, 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 (managementGroupId == null) { + return Mono + .error(new IllegalArgumentException("Parameter managementGroupId 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, + managementGroupId, + ruleId, + governanceRule, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates governance rule on the given management group. + * + * @param managementGroupId Azure Management Group ID. + * @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 managementGroupId, 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 (managementGroupId == null) { + return Mono + .error(new IllegalArgumentException("Parameter managementGroupId 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, managementGroupId, ruleId, governanceRule, accept, context); + } + + /** + * Creates or updates governance rule on the given management group. + * + * @param managementGroupId Azure Management Group ID. + * @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 managementGroupId, String ruleId, GovernanceRuleInner governanceRule) { + return createOrUpdateWithResponseAsync(managementGroupId, ruleId, governanceRule) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Creates or updates governance rule on the given management group. + * + * @param managementGroupId Azure Management Group ID. + * @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 managementGroupId, String ruleId, GovernanceRuleInner governanceRule, Context context) { + return createOrUpdateWithResponseAsync(managementGroupId, ruleId, governanceRule, context).block(); + } + + /** + * Creates or updates governance rule on the given management group. + * + * @param managementGroupId Azure Management Group ID. + * @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 managementGroupId, String ruleId, GovernanceRuleInner governanceRule) { + return createOrUpdateWithResponse(managementGroupId, ruleId, governanceRule, Context.NONE).getValue(); + } + + /** + * Delete a Governance rule over a given scope. + * + * @param managementGroupId Azure Management Group ID. + * @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 managementGroupId, String ruleId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (managementGroupId == null) { + return Mono + .error(new IllegalArgumentException("Parameter managementGroupId 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, managementGroupId, ruleId, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a Governance rule over a given scope. + * + * @param managementGroupId Azure Management Group ID. + * @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 managementGroupId, 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 (managementGroupId == null) { + return Mono + .error(new IllegalArgumentException("Parameter managementGroupId 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, managementGroupId, ruleId, context); + } + + /** + * Delete a Governance rule over a given scope. + * + * @param managementGroupId Azure Management Group ID. + * @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 managementGroupId, String ruleId) { + Mono>> mono = deleteWithResponseAsync(managementGroupId, 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 managementGroupId Azure Management Group ID. + * @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 managementGroupId, String ruleId, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(managementGroupId, ruleId, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete a Governance rule over a given scope. + * + * @param managementGroupId Azure Management Group ID. + * @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 managementGroupId, String ruleId) { + return beginDeleteAsync(managementGroupId, ruleId).getSyncPoller(); + } + + /** + * Delete a Governance rule over a given scope. + * + * @param managementGroupId Azure Management Group ID. + * @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 managementGroupId, String ruleId, Context context) { + return beginDeleteAsync(managementGroupId, ruleId, context).getSyncPoller(); + } + + /** + * Delete a Governance rule over a given scope. + * + * @param managementGroupId Azure Management Group ID. + * @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 managementGroupId, String ruleId) { + return beginDeleteAsync(managementGroupId, ruleId).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a Governance rule over a given scope. + * + * @param managementGroupId Azure Management Group ID. + * @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 managementGroupId, String ruleId, Context context) { + return beginDeleteAsync(managementGroupId, ruleId, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a Governance rule over a given scope. + * + * @param managementGroupId Azure Management Group ID. + * @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 managementGroupId, String ruleId) { + deleteAsync(managementGroupId, ruleId).block(); + } + + /** + * Delete a Governance rule over a given scope. + * + * @param managementGroupId Azure Management Group ID. + * @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 managementGroupId, String ruleId, Context context) { + deleteAsync(managementGroupId, ruleId, context).block(); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ManagementGroupGovernanceRulesOperationsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ManagementGroupGovernanceRulesOperationsImpl.java new file mode 100644 index 000000000000..0397b530c654 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ManagementGroupGovernanceRulesOperationsImpl.java @@ -0,0 +1,91 @@ +// 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.ManagementGroupGovernanceRulesOperationsClient; +import com.azure.resourcemanager.security.fluent.models.GovernanceRuleInner; +import com.azure.resourcemanager.security.models.GovernanceRule; +import com.azure.resourcemanager.security.models.ManagementGroupGovernanceRulesOperations; + +public final class ManagementGroupGovernanceRulesOperationsImpl implements ManagementGroupGovernanceRulesOperations { + private static final ClientLogger LOGGER = new ClientLogger(ManagementGroupGovernanceRulesOperationsImpl.class); + + private final ManagementGroupGovernanceRulesOperationsClient innerClient; + + private final com.azure.resourcemanager.security.SecurityManager serviceManager; + + public ManagementGroupGovernanceRulesOperationsImpl( + ManagementGroupGovernanceRulesOperationsClient innerClient, + com.azure.resourcemanager.security.SecurityManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String managementGroupId, String ruleId, Context context) { + Response inner = this.serviceClient().getWithResponse(managementGroupId, 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 managementGroupId, String ruleId) { + GovernanceRuleInner inner = this.serviceClient().get(managementGroupId, ruleId); + if (inner != null) { + return new GovernanceRuleImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response createOrUpdateWithResponse( + String managementGroupId, String ruleId, GovernanceRuleInner governanceRule, Context context) { + Response inner = + this.serviceClient().createOrUpdateWithResponse(managementGroupId, 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 managementGroupId, String ruleId, GovernanceRuleInner governanceRule) { + GovernanceRuleInner inner = this.serviceClient().createOrUpdate(managementGroupId, ruleId, governanceRule); + if (inner != null) { + return new GovernanceRuleImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String managementGroupId, String ruleId) { + this.serviceClient().delete(managementGroupId, ruleId); + } + + public void delete(String managementGroupId, String ruleId, Context context) { + this.serviceClient().delete(managementGroupId, ruleId, context); + } + + private ManagementGroupGovernanceRulesOperationsClient 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 000000000000..dc4835d2f4bc --- /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 9a689bc4619e..50e993eae715 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 @@ -56,6 +56,9 @@ import com.azure.resourcemanager.security.fluent.IotSecuritySolutionsClient; import com.azure.resourcemanager.security.fluent.JitNetworkAccessPoliciesClient; import com.azure.resourcemanager.security.fluent.LocationsClient; +import com.azure.resourcemanager.security.fluent.ManagementGroupGovernanceRulesClient; +import com.azure.resourcemanager.security.fluent.ManagementGroupGovernanceRulesOperationResultsClient; +import com.azure.resourcemanager.security.fluent.ManagementGroupGovernanceRulesOperationsClient; import com.azure.resourcemanager.security.fluent.MdeOnboardingsClient; import com.azure.resourcemanager.security.fluent.OperationsClient; import com.azure.resourcemanager.security.fluent.PricingsClient; @@ -69,7 +72,7 @@ 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.SecurityConnectorGovernanceRulesOperationResultsClient; import com.azure.resourcemanager.security.fluent.SecurityConnectorGovernanceRulesOperationsClient; import com.azure.resourcemanager.security.fluent.SecurityConnectorsClient; import com.azure.resourcemanager.security.fluent.SecurityContactsClient; @@ -82,7 +85,7 @@ 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.SubscriptionGovernanceRulesOperationResultsClient; import com.azure.resourcemanager.security.fluent.TasksClient; import com.azure.resourcemanager.security.fluent.TopologiesClient; import com.azure.resourcemanager.security.fluent.WorkspaceSettingsClient; @@ -794,28 +797,66 @@ public SecurityConnectorGovernanceRulesOperationsClient getSecurityConnectorGove return this.securityConnectorGovernanceRulesOperations; } - /** The SubscriptionGovernanceRulesExecuteStatusClient object to access its operations. */ - private final SubscriptionGovernanceRulesExecuteStatusClient subscriptionGovernanceRulesExecuteStatus; + /** The ManagementGroupGovernanceRulesClient object to access its operations. */ + private final ManagementGroupGovernanceRulesClient managementGroupGovernanceRules; /** - * Gets the SubscriptionGovernanceRulesExecuteStatusClient object to access its operations. + * Gets the ManagementGroupGovernanceRulesClient object to access its operations. * - * @return the SubscriptionGovernanceRulesExecuteStatusClient object. + * @return the ManagementGroupGovernanceRulesClient object. */ - public SubscriptionGovernanceRulesExecuteStatusClient getSubscriptionGovernanceRulesExecuteStatus() { - return this.subscriptionGovernanceRulesExecuteStatus; + public ManagementGroupGovernanceRulesClient getManagementGroupGovernanceRules() { + return this.managementGroupGovernanceRules; } - /** The SecurityConnectorGovernanceRulesExecuteStatusClient object to access its operations. */ - private final SecurityConnectorGovernanceRulesExecuteStatusClient securityConnectorGovernanceRulesExecuteStatus; + /** The ManagementGroupGovernanceRulesOperationsClient object to access its operations. */ + private final ManagementGroupGovernanceRulesOperationsClient managementGroupGovernanceRulesOperations; /** - * Gets the SecurityConnectorGovernanceRulesExecuteStatusClient object to access its operations. + * Gets the ManagementGroupGovernanceRulesOperationsClient object to access its operations. * - * @return the SecurityConnectorGovernanceRulesExecuteStatusClient object. + * @return the ManagementGroupGovernanceRulesOperationsClient object. */ - public SecurityConnectorGovernanceRulesExecuteStatusClient getSecurityConnectorGovernanceRulesExecuteStatus() { - return this.securityConnectorGovernanceRulesExecuteStatus; + public ManagementGroupGovernanceRulesOperationsClient getManagementGroupGovernanceRulesOperations() { + return this.managementGroupGovernanceRulesOperations; + } + + /** The SubscriptionGovernanceRulesOperationResultsClient object to access its operations. */ + private final SubscriptionGovernanceRulesOperationResultsClient subscriptionGovernanceRulesOperationResults; + + /** + * Gets the SubscriptionGovernanceRulesOperationResultsClient object to access its operations. + * + * @return the SubscriptionGovernanceRulesOperationResultsClient object. + */ + public SubscriptionGovernanceRulesOperationResultsClient getSubscriptionGovernanceRulesOperationResults() { + return this.subscriptionGovernanceRulesOperationResults; + } + + /** The SecurityConnectorGovernanceRulesOperationResultsClient object to access its operations. */ + private final SecurityConnectorGovernanceRulesOperationResultsClient + securityConnectorGovernanceRulesOperationResults; + + /** + * Gets the SecurityConnectorGovernanceRulesOperationResultsClient object to access its operations. + * + * @return the SecurityConnectorGovernanceRulesOperationResultsClient object. + */ + public SecurityConnectorGovernanceRulesOperationResultsClient + getSecurityConnectorGovernanceRulesOperationResults() { + return this.securityConnectorGovernanceRulesOperationResults; + } + + /** The ManagementGroupGovernanceRulesOperationResultsClient object to access its operations. */ + private final ManagementGroupGovernanceRulesOperationResultsClient managementGroupGovernanceRulesOperationResults; + + /** + * Gets the ManagementGroupGovernanceRulesOperationResultsClient object to access its operations. + * + * @return the ManagementGroupGovernanceRulesOperationResultsClient object. + */ + public ManagementGroupGovernanceRulesOperationResultsClient getManagementGroupGovernanceRulesOperationResults() { + return this.managementGroupGovernanceRulesOperationResults; } /** The GovernanceAssignmentsClient object to access its operations. */ @@ -992,9 +1033,14 @@ public ApiCollectionOffboardingsClient getApiCollectionOffboardings() { this.securityConnectorGovernanceRules = new SecurityConnectorGovernanceRulesClientImpl(this); this.securityConnectorGovernanceRulesOperations = new SecurityConnectorGovernanceRulesOperationsClientImpl(this); - this.subscriptionGovernanceRulesExecuteStatus = new SubscriptionGovernanceRulesExecuteStatusClientImpl(this); - this.securityConnectorGovernanceRulesExecuteStatus = - new SecurityConnectorGovernanceRulesExecuteStatusClientImpl(this); + this.managementGroupGovernanceRules = new ManagementGroupGovernanceRulesClientImpl(this); + this.managementGroupGovernanceRulesOperations = new ManagementGroupGovernanceRulesOperationsClientImpl(this); + this.subscriptionGovernanceRulesOperationResults = + new SubscriptionGovernanceRulesOperationResultsClientImpl(this); + this.securityConnectorGovernanceRulesOperationResults = + new SecurityConnectorGovernanceRulesOperationResultsClientImpl(this); + this.managementGroupGovernanceRulesOperationResults = + new ManagementGroupGovernanceRulesOperationResultsClientImpl(this); this.governanceAssignments = new GovernanceAssignmentsClientImpl(this); this.applications = new ApplicationsClientImpl(this); this.applicationOperations = new ApplicationOperationsClientImpl(this); 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/SecurityConnectorGovernanceRulesClientImpl.java index 8003fecc610a..9f49978ae3cd 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/SecurityConnectorGovernanceRulesClientImpl.java @@ -89,7 +89,7 @@ Mono> listNext( } /** - * Get a list of all relevant governanceRules over a security connector level scope. + * Get a list of all relevant governance rules over a security connector level scope. * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case * insensitive. @@ -97,7 +97,7 @@ Mono> listNext( * @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 + * @return a list of all relevant governance rules over a security connector level scope along with {@link * PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -150,7 +150,7 @@ private Mono> listSinglePageAsync( } /** - * Get a list of all relevant governanceRules over a security connector level scope. + * Get a list of all relevant governance rules over a security connector level scope. * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case * insensitive. @@ -159,7 +159,7 @@ private Mono> listSinglePageAsync( * @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 + * @return a list of all relevant governance rules over a security connector level scope along with {@link * PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -209,7 +209,7 @@ private Mono> listSinglePageAsync( } /** - * Get a list of all relevant governanceRules over a security connector level scope. + * Get a list of all relevant governance rules over a security connector level scope. * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case * insensitive. @@ -217,7 +217,7 @@ private Mono> listSinglePageAsync( * @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 + * @return a list of all relevant governance rules over a security connector level scope as paginated response with * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) @@ -228,7 +228,7 @@ private PagedFlux listAsync(String resourceGroupName, Strin } /** - * Get a list of all relevant governanceRules over a security connector level scope. + * Get a list of all relevant governance rules over a security connector level scope. * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case * insensitive. @@ -237,7 +237,7 @@ private PagedFlux listAsync(String resourceGroupName, Strin * @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 + * @return a list of all relevant governance rules over a security connector level scope as paginated response with * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) @@ -249,7 +249,7 @@ private PagedFlux listAsync( } /** - * Get a list of all relevant governanceRules over a security connector level scope. + * Get a list of all relevant governance rules over a security connector level scope. * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case * insensitive. @@ -257,7 +257,7 @@ private PagedFlux listAsync( * @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 + * @return a list of all relevant governance rules over a security connector level scope as paginated response with * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) @@ -266,7 +266,7 @@ public PagedIterable list(String resourceGroupName, String } /** - * Get a list of all relevant governanceRules over a security connector level scope. + * Get a list of all relevant governance rules over a security connector level scope. * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case * insensitive. @@ -275,7 +275,7 @@ public PagedIterable list(String resourceGroupName, 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 a list of all relevant governanceRules over a security connector level scope as paginated response with + * @return a list of all relevant governance rules over a security connector level scope as paginated response with * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) @@ -292,8 +292,8 @@ 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 a governance rules list along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -330,8 +330,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/SecurityConnectorGovernanceRulesExecuteStatusClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityConnectorGovernanceRulesExecuteStatusClientImpl.java deleted file mode 100644 index 9ff565d0b92d..000000000000 --- 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 59e7a717d0b4..000000000000 --- 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/SecurityConnectorGovernanceRulesOperationResultsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityConnectorGovernanceRulesOperationResultsClientImpl.java new file mode 100644 index 000000000000..75325a371f40 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityConnectorGovernanceRulesOperationResultsClientImpl.java @@ -0,0 +1,262 @@ +// 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.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.SecurityConnectorGovernanceRulesOperationResultsClient; +import com.azure.resourcemanager.security.fluent.models.OperationResultAutoGeneratedInner; +import com.azure.resourcemanager.security.models.SecurityConnectorGovernanceRulesOperationResultsGetResponse; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in + * SecurityConnectorGovernanceRulesOperationResultsClient. + */ +public final class SecurityConnectorGovernanceRulesOperationResultsClientImpl + implements SecurityConnectorGovernanceRulesOperationResultsClient { + /** The proxy service used to perform REST calls. */ + private final SecurityConnectorGovernanceRulesOperationResultsService service; + + /** The service client containing this operation class. */ + private final SecurityCenterImpl client; + + /** + * Initializes an instance of SecurityConnectorGovernanceRulesOperationResultsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SecurityConnectorGovernanceRulesOperationResultsClientImpl(SecurityCenterImpl client) { + this.service = + RestProxy + .create( + SecurityConnectorGovernanceRulesOperationResultsService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityCenterSecurityConnectorGovernanceRulesOperationResults to be + * used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SecurityCenterSecuri") + public interface SecurityConnectorGovernanceRulesOperationResultsService { + @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 governance rule long run operation result 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 governance rule key - unique key for the standard governance rule (GUID). + * @param operationId The governance rule execution key - unique key for the execution of governance rule. + * @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 long run operation result for the requested scope by ruleId and operationId 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 governance rule long run operation result 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 governance rule key - unique key for the standard governance rule (GUID). + * @param operationId The governance rule execution key - unique key for the execution of governance rule. + * @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 long run operation result for the requested scope by ruleId and operationId 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 governance rule long run operation result 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 governance rule key - unique key for the standard governance rule (GUID). + * @param operationId The governance rule execution key - unique key for the execution of governance rule. + * @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 long run operation result 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 getWithResponseAsync(resourceGroupName, securityConnectorName, ruleId, operationId) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get governance rule long run operation result 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 governance rule key - unique key for the standard governance rule (GUID). + * @param operationId The governance rule execution key - unique key for the execution of governance rule. + * @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 long run operation result for the requested scope by ruleId and operationId. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SecurityConnectorGovernanceRulesOperationResultsGetResponse getWithResponse( + String resourceGroupName, String securityConnectorName, String ruleId, String operationId, Context context) { + return getWithResponseAsync(resourceGroupName, securityConnectorName, ruleId, operationId, context).block(); + } + + /** + * Get governance rule long run operation result 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 governance rule key - unique key for the standard governance rule (GUID). + * @param operationId The governance rule execution key - unique key for the execution of governance rule. + * @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 long run operation result for the requested scope by ruleId and operationId. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationResultAutoGeneratedInner get( + String resourceGroupName, String securityConnectorName, String ruleId, String operationId) { + return getWithResponse(resourceGroupName, securityConnectorName, ruleId, operationId, Context.NONE).getValue(); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityConnectorGovernanceRulesOperationResultsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityConnectorGovernanceRulesOperationResultsImpl.java new file mode 100644 index 000000000000..a6f830881429 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityConnectorGovernanceRulesOperationResultsImpl.java @@ -0,0 +1,68 @@ +// 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.SecurityConnectorGovernanceRulesOperationResultsClient; +import com.azure.resourcemanager.security.fluent.models.OperationResultAutoGeneratedInner; +import com.azure.resourcemanager.security.models.OperationResultAutoGenerated; +import com.azure.resourcemanager.security.models.SecurityConnectorGovernanceRulesOperationResults; +import com.azure.resourcemanager.security.models.SecurityConnectorGovernanceRulesOperationResultsGetResponse; + +public final class SecurityConnectorGovernanceRulesOperationResultsImpl + implements SecurityConnectorGovernanceRulesOperationResults { + private static final ClientLogger LOGGER = + new ClientLogger(SecurityConnectorGovernanceRulesOperationResultsImpl.class); + + private final SecurityConnectorGovernanceRulesOperationResultsClient innerClient; + + private final com.azure.resourcemanager.security.SecurityManager serviceManager; + + public SecurityConnectorGovernanceRulesOperationResultsImpl( + SecurityConnectorGovernanceRulesOperationResultsClient innerClient, + com.azure.resourcemanager.security.SecurityManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse( + String resourceGroupName, String securityConnectorName, String ruleId, String operationId, Context context) { + SecurityConnectorGovernanceRulesOperationResultsGetResponse inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, securityConnectorName, 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 get( + String resourceGroupName, String securityConnectorName, String ruleId, String operationId) { + OperationResultAutoGeneratedInner inner = + this.serviceClient().get(resourceGroupName, securityConnectorName, ruleId, operationId); + if (inner != null) { + return new OperationResultAutoGeneratedImpl(inner, this.manager()); + } else { + return null; + } + } + + private SecurityConnectorGovernanceRulesOperationResultsClient 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 index bdee003c2b91..0e93a29e2b90 100644 --- 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 @@ -22,10 +22,15 @@ 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.SecurityConnectorGovernanceRulesOperationsClient; import com.azure.resourcemanager.security.fluent.models.GovernanceRuleInner; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; /** @@ -99,9 +104,9 @@ Mono> createOrUpdate( @Delete( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security" + "/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/governanceRules/{ruleId}") - @ExpectedResponses({200, 204}) + @ExpectedResponses({200, 202, 204}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( + Mono>> delete( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @@ -112,16 +117,16 @@ Mono> delete( } /** - * Get a specific governanceRule for the requested scope by ruleId. + * Get a specific governance rule 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 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 governanceRule for the requested scope by ruleId along with {@link Response} on successful + * @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) @@ -169,17 +174,17 @@ private Mono> getWithResponseAsync( } /** - * Get a specific governanceRule for the requested scope by ruleId. + * Get a specific governance rule 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 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 governanceRule for the requested scope by ruleId along with {@link Response} on successful + * @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) @@ -224,16 +229,16 @@ private Mono> getWithResponseAsync( } /** - * Get a specific governanceRule for the requested scope by ruleId. + * Get a specific governance rule 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 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 governanceRule for the requested scope by ruleId on successful completion of {@link Mono}. + * @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 resourceGroupName, String securityConnectorName, String ruleId) { @@ -242,17 +247,17 @@ private Mono getAsync(String resourceGroupName, String secu } /** - * Get a specific governanceRule for the requested scope by ruleId. + * Get a specific governance rule 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 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 governanceRule for the requested scope by ruleId along with {@link Response}. + * @return a specific governance rule for the requested scope by ruleId along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse( @@ -261,16 +266,16 @@ public Response getWithResponse( } /** - * Get a specific governanceRule for the requested scope by ruleId. + * Get a specific governance rule 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 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 governanceRule for the requested scope by ruleId. + * @return a specific governance rule for the requested scope by ruleId. */ @ServiceMethod(returns = ReturnType.SINGLE) public GovernanceRuleInner get(String resourceGroupName, String securityConnectorName, String ruleId) { @@ -278,18 +283,17 @@ public GovernanceRuleInner get(String resourceGroupName, String securityConnecto } /** - * Creates or update a security GovernanceRule on the given security connector. + * Creates or updates a governance rule 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 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 security GovernanceRule over a given scope along with {@link Response} on successful completion of {@link - * Mono}. + * @return governance rule over a given scope along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrUpdateWithResponseAsync( @@ -342,19 +346,18 @@ private Mono> createOrUpdateWithResponseAsync( } /** - * Creates or update a security GovernanceRule on the given security connector. + * Creates or updates a governance rule 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 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 security GovernanceRule over a given scope along with {@link Response} on successful completion of {@link - * Mono}. + * @return governance rule over a given scope along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrUpdateWithResponseAsync( @@ -408,17 +411,17 @@ private Mono> createOrUpdateWithResponseAsync( } /** - * Creates or update a security GovernanceRule on the given security connector. + * Creates or updates a governance rule 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 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 security GovernanceRule over a given scope on successful completion of {@link Mono}. + * @return governance rule over a given scope on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync( @@ -428,18 +431,18 @@ private Mono createOrUpdateAsync( } /** - * Creates or update a security GovernanceRule on the given security connector. + * Creates or updates a governance rule 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 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 security GovernanceRule over a given scope along with {@link Response}. + * @return governance rule over a given scope along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response createOrUpdateWithResponse( @@ -454,17 +457,17 @@ public Response createOrUpdateWithResponse( } /** - * Creates or update a security GovernanceRule on the given security connector. + * Creates or updates a governance rule 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 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 security GovernanceRule over a given scope. + * @return governance rule over a given scope. */ @ServiceMethod(returns = ReturnType.SINGLE) public GovernanceRuleInner createOrUpdate( @@ -475,19 +478,19 @@ public GovernanceRuleInner createOrUpdate( } /** - * Delete a GovernanceRule over a given scope. + * Delete a Governance rule 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 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( + private Mono>> deleteWithResponseAsync( String resourceGroupName, String securityConnectorName, String ruleId) { if (this.client.getEndpoint() == null) { return Mono @@ -529,12 +532,12 @@ private Mono> deleteWithResponseAsync( } /** - * Delete a GovernanceRule over a given scope. + * Delete a Governance rule 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 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. @@ -542,7 +545,7 @@ private Mono> deleteWithResponseAsync( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( + private Mono>> deleteWithResponseAsync( String resourceGroupName, String securityConnectorName, String ruleId, Context context) { if (this.client.getEndpoint() == null) { return Mono @@ -581,12 +584,96 @@ private Mono> deleteWithResponseAsync( } /** - * Delete a GovernanceRule over a given scope. + * Delete a Governance rule 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 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 resourceGroupName, String securityConnectorName, String ruleId) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, securityConnectorName, 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 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 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 resourceGroupName, String securityConnectorName, String ruleId, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, securityConnectorName, ruleId, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete a Governance rule 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 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 resourceGroupName, String securityConnectorName, String ruleId) { + return beginDeleteAsync(resourceGroupName, securityConnectorName, ruleId).getSyncPoller(); + } + + /** + * Delete a Governance rule 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 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 resourceGroupName, String securityConnectorName, String ruleId, Context context) { + return beginDeleteAsync(resourceGroupName, securityConnectorName, ruleId, context).getSyncPoller(); + } + + /** + * Delete a Governance rule 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 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. @@ -594,42 +681,62 @@ private Mono> deleteWithResponseAsync( */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String securityConnectorName, String ruleId) { - return deleteWithResponseAsync(resourceGroupName, securityConnectorName, ruleId) - .flatMap(ignored -> Mono.empty()); + return beginDeleteAsync(resourceGroupName, securityConnectorName, ruleId) + .last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * Delete a GovernanceRule over a given scope. + * Delete a Governance rule 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 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}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse( + private Mono deleteAsync( String resourceGroupName, String securityConnectorName, String ruleId, Context context) { - return deleteWithResponseAsync(resourceGroupName, securityConnectorName, ruleId, context).block(); + return beginDeleteAsync(resourceGroupName, securityConnectorName, ruleId, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * Delete a GovernanceRule over a given scope. + * Delete a Governance rule 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 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 resourceGroupName, String securityConnectorName, String ruleId) { - deleteWithResponse(resourceGroupName, securityConnectorName, ruleId, Context.NONE); + deleteAsync(resourceGroupName, securityConnectorName, ruleId).block(); + } + + /** + * Delete a Governance rule 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 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 resourceGroupName, String securityConnectorName, String ruleId, Context context) { + deleteAsync(resourceGroupName, securityConnectorName, ruleId, context).block(); } } 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 index ffacfe8ef7b6..ba54cf50cf97 100644 --- 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 @@ -84,15 +84,14 @@ public GovernanceRule createOrUpdate( } } - 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); } + public void delete(String resourceGroupName, String securityConnectorName, String ruleId, Context context) { + this.serviceClient().delete(resourceGroupName, securityConnectorName, ruleId, context); + } + private SecurityConnectorGovernanceRulesOperationsClient serviceClient() { return this.innerClient; } 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 a555e86981c0..000000000000 --- 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 624e35819415..000000000000 --- 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/implementation/SubscriptionGovernanceRulesOperationResultsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SubscriptionGovernanceRulesOperationResultsClientImpl.java new file mode 100644 index 000000000000..8d9f567e28ed --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SubscriptionGovernanceRulesOperationResultsClientImpl.java @@ -0,0 +1,221 @@ +// 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.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.SubscriptionGovernanceRulesOperationResultsClient; +import com.azure.resourcemanager.security.fluent.models.OperationResultAutoGeneratedInner; +import com.azure.resourcemanager.security.models.SubscriptionGovernanceRulesOperationResultsGetResponse; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in + * SubscriptionGovernanceRulesOperationResultsClient. + */ +public final class SubscriptionGovernanceRulesOperationResultsClientImpl + implements SubscriptionGovernanceRulesOperationResultsClient { + /** The proxy service used to perform REST calls. */ + private final SubscriptionGovernanceRulesOperationResultsService service; + + /** The service client containing this operation class. */ + private final SecurityCenterImpl client; + + /** + * Initializes an instance of SubscriptionGovernanceRulesOperationResultsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SubscriptionGovernanceRulesOperationResultsClientImpl(SecurityCenterImpl client) { + this.service = + RestProxy + .create( + SubscriptionGovernanceRulesOperationResultsService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityCenterSubscriptionGovernanceRulesOperationResults to be used + * by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SecurityCenterSubscr") + public interface SubscriptionGovernanceRulesOperationResultsService { + @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 governance rules long run operation result for the requested scope by ruleId and operationId. + * + * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). + * @param operationId The governance rule execution key - unique key for the execution of governance rule. + * @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 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 governance rules long run operation result for the requested scope by ruleId and operationId. + * + * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). + * @param operationId The governance rule execution key - unique key for the execution of governance rule. + * @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 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 governance rules long run operation result for the requested scope by ruleId and operationId. + * + * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). + * @param operationId The governance rule execution key - unique key for the execution of governance rule. + * @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 getAsync(String ruleId, String operationId) { + return getWithResponseAsync(ruleId, operationId).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get governance rules long run operation result for the requested scope by ruleId and operationId. + * + * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). + * @param operationId The governance rule execution key - unique key for the execution of governance rule. + * @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 SubscriptionGovernanceRulesOperationResultsGetResponse getWithResponse( + String ruleId, String operationId, Context context) { + return getWithResponseAsync(ruleId, operationId, context).block(); + } + + /** + * Get governance rules long run operation result for the requested scope by ruleId and operationId. + * + * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). + * @param operationId The governance rule execution key - unique key for the execution of governance rule. + * @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 get(String ruleId, String operationId) { + return getWithResponse(ruleId, operationId, Context.NONE).getValue(); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SubscriptionGovernanceRulesOperationResultsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SubscriptionGovernanceRulesOperationResultsImpl.java new file mode 100644 index 000000000000..ffcb707c357e --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SubscriptionGovernanceRulesOperationResultsImpl.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.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.SubscriptionGovernanceRulesOperationResultsClient; +import com.azure.resourcemanager.security.fluent.models.OperationResultAutoGeneratedInner; +import com.azure.resourcemanager.security.models.OperationResultAutoGenerated; +import com.azure.resourcemanager.security.models.SubscriptionGovernanceRulesOperationResults; +import com.azure.resourcemanager.security.models.SubscriptionGovernanceRulesOperationResultsGetResponse; + +public final class SubscriptionGovernanceRulesOperationResultsImpl + implements SubscriptionGovernanceRulesOperationResults { + private static final ClientLogger LOGGER = new ClientLogger(SubscriptionGovernanceRulesOperationResultsImpl.class); + + private final SubscriptionGovernanceRulesOperationResultsClient innerClient; + + private final com.azure.resourcemanager.security.SecurityManager serviceManager; + + public SubscriptionGovernanceRulesOperationResultsImpl( + SubscriptionGovernanceRulesOperationResultsClient innerClient, + com.azure.resourcemanager.security.SecurityManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String ruleId, String operationId, Context context) { + SubscriptionGovernanceRulesOperationResultsGetResponse inner = + this.serviceClient().getWithResponse(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 get(String ruleId, String operationId) { + OperationResultAutoGeneratedInner inner = this.serviceClient().get(ruleId, operationId); + if (inner != null) { + return new OperationResultAutoGeneratedImpl(inner, this.manager()); + } else { + return null; + } + } + + private SubscriptionGovernanceRulesOperationResultsClient 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/ExecuteRuleStatus.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ExecuteRuleStatus.java deleted file mode 100644 index 5900c813bb03..000000000000 --- 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/GovernanceAssignment.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GovernanceAssignment.java index 5e73773ecc05..2b39b44fc8c3 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 @@ -100,7 +100,7 @@ interface WithParentResource { * @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 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 65e03a10a529..5e3045c9ce81 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 2a65ca423e07..8a41db7dff41 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,30 @@ /** 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 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 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); @@ -44,9 +44,8 @@ public interface GovernanceAssignments { * * @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 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. @@ -61,9 +60,8 @@ Response getWithResponse( * * @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 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. @@ -76,9 +74,8 @@ Response getWithResponse( * * @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 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. @@ -92,9 +89,8 @@ Response getWithResponse( * * @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 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 16e725b80fe3..e1d3c1e584e1 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 26fca1a2ee70..21e41e4b7ec4 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. */ @@ -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. * @@ -140,9 +170,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 +194,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 +204,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); @@ -244,6 +277,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 +298,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 +334,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 +362,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 +388,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 +398,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); @@ -402,6 +471,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 +492,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 +528,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,7 +555,7 @@ interface WithGovernanceEmailNotification { GovernanceRule refresh(Context context); /** - * Execute a security GovernanceRule on the given subscription. + * Execute a governance rule on a subscription. * * @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. @@ -461,9 +563,9 @@ interface WithGovernanceEmailNotification { void ruleIdExecuteSingleSubscription(); /** - * Execute a security GovernanceRule on the given subscription. + * Execute a governance rule on a subscription. * - * @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. 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 d39890d509c5..e8dce71f1fb1 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 b43661b6b4f3..f8ba5f28cd65 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 000000000000..8c6b0dd86ef9 --- /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/GovernanceRules.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GovernanceRules.java index 207ec0f93fcb..ab45249607ac 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GovernanceRules.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GovernanceRules.java @@ -10,23 +10,23 @@ /** Resource collection API of GovernanceRules. */ public interface GovernanceRules { /** - * Get a list of all relevant governanceRules over a subscription level scope. + * Get a list of the governance rules on the subscription level scope. * * @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 + * @return a list of the governance rules on the subscription level scope as paginated response with {@link * PagedIterable}. */ PagedIterable list(); /** - * Get a list of all relevant governanceRules over a subscription level scope. + * Get a list of the governance rules on the subscription level 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 + * @return a list of the governance rules on the subscription level scope as paginated response with {@link * PagedIterable}. */ PagedIterable list(Context context); 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 index d6a3504509ea..6dca9e1f46ba 100644 --- 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 @@ -10,32 +10,32 @@ /** Resource collection API of GovernanceRulesOperations. */ public interface GovernanceRulesOperations { /** - * Get a specific governanceRule for the requested scope by ruleId. + * Get a specific governance rule for the requested scope by ruleId. * - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. + * @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 governanceRule for the requested scope by ruleId along with {@link Response}. + * @return a specific governance rule 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. + * Get a specific governance rule for the requested scope by ruleId. * - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. + * @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 governanceRule for the requested scope by ruleId. + * @return a specific governance rule for the requested scope by ruleId. */ GovernanceRule get(String ruleId); /** - * Delete a GovernanceRule over a given scope. + * Delete a Governance rule over a given scope. * - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. + * @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. @@ -45,9 +45,9 @@ public interface GovernanceRulesOperations { Response deleteWithResponse(String ruleId, Context context); /** - * Delete a GovernanceRule over a given scope. + * Delete a Governance rule over a given scope. * - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. + * @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. @@ -55,9 +55,9 @@ public interface GovernanceRulesOperations { void delete(String ruleId); /** - * Execute a security GovernanceRule on the given subscription. + * Execute a governance rule on a subscription. * - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. + * @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. @@ -65,10 +65,10 @@ public interface GovernanceRulesOperations { void ruleIdExecuteSingleSubscription(String ruleId); /** - * Execute a security GovernanceRule on the given subscription. + * Execute a governance rule on a subscription. * - * @param ruleId The security GovernanceRule key - unique key for the standard GovernanceRule. - * @param executeGovernanceRuleParams GovernanceRule over a subscription scope. + * @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. @@ -78,12 +78,12 @@ void ruleIdExecuteSingleSubscription( String ruleId, ExecuteGovernanceRuleParams executeGovernanceRuleParams, Context context); /** - * Execute a security GovernanceRule on the given security connector. + * Execute a governance rule 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 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. @@ -91,13 +91,13 @@ void ruleIdExecuteSingleSubscription( void ruleIdExecuteSingleSecurityConnector(String resourceGroupName, String securityConnectorName, String ruleId); /** - * Execute a security GovernanceRule on the given security connector. + * Execute a governance rule 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 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. @@ -111,30 +111,58 @@ void ruleIdExecuteSingleSecurityConnector( Context context); /** - * Get a specific governanceRule for the requested scope by ruleId. + * Execute governance rule on the given management group. + * + * @param managementGroupId Azure Management Group ID. + * @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 ruleIdExecuteSingleManagementGroup(String managementGroupId, String ruleId); + + /** + * Execute governance rule on the given management group. + * + * @param managementGroupId Azure Management Group ID. + * @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. + */ + void ruleIdExecuteSingleManagementGroup( + String managementGroupId, + String ruleId, + ExecuteGovernanceRuleParams executeGovernanceRuleParams, + Context context); + + /** + * 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 governanceRule for the requested scope by ruleId along with {@link Response}. + * @return a specific governance rule for the requested scope by ruleId along with {@link Response}. */ GovernanceRule getById(String id); /** - * Get a specific governanceRule for the requested scope by ruleId. + * 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 governanceRule for the requested scope by ruleId along with {@link Response}. + * @return a specific governance rule for the requested scope by ruleId along with {@link Response}. */ Response getByIdWithResponse(String id, Context context); /** - * Delete a GovernanceRule over a given scope. + * Delete a Governance rule over a given scope. * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -144,7 +172,7 @@ void ruleIdExecuteSingleSecurityConnector( void deleteById(String id); /** - * Delete a GovernanceRule over a given scope. + * Delete a Governance rule over a given scope. * * @param id the resource ID. * @param context The context to associate with this operation. diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ManagementGroupGovernanceRules.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ManagementGroupGovernanceRules.java new file mode 100644 index 000000000000..02b8ad445def --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ManagementGroupGovernanceRules.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.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of ManagementGroupGovernanceRules. */ +public interface ManagementGroupGovernanceRules { + /** + * Get a list of all relevant governance rules over a management group level scope. + * + * @param managementGroupId Azure Management Group 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 list of all relevant governance rules over a management group level scope as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(String managementGroupId); + + /** + * Get a list of all relevant governance rules over a management group level scope. + * + * @param managementGroupId Azure Management Group 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 list of all relevant governance rules over a management group level scope as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(String managementGroupId, Context context); +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ManagementGroupGovernanceRulesOperationResults.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ManagementGroupGovernanceRulesOperationResults.java new file mode 100644 index 000000000000..405b705bf5ac --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ManagementGroupGovernanceRulesOperationResults.java @@ -0,0 +1,39 @@ +// 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 ManagementGroupGovernanceRulesOperationResults. */ +public interface ManagementGroupGovernanceRulesOperationResults { + /** + * Get governance rules long run operation result for the requested scope by ruleId and operationId. + * + * @param managementGroupId Azure Management Group ID. + * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). + * @param operationId The governance rule execution key - unique key for the execution of governance rule. + * @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 getWithResponse( + String managementGroupId, String ruleId, String operationId, Context context); + + /** + * Get governance rules long run operation result for the requested scope by ruleId and operationId. + * + * @param managementGroupId Azure Management Group ID. + * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). + * @param operationId The governance rule execution key - unique key for the execution of governance rule. + * @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 get(String managementGroupId, String ruleId, String operationId); +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ManagementGroupGovernanceRulesOperationResultsGetHeaders.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ManagementGroupGovernanceRulesOperationResultsGetHeaders.java new file mode 100644 index 000000000000..31f1393aeea0 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ManagementGroupGovernanceRulesOperationResultsGetHeaders.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 ManagementGroupGovernanceRulesOperationResultsGetHeaders model. */ +@Fluent +public final class ManagementGroupGovernanceRulesOperationResultsGetHeaders { + /* + * The location property. + */ + @JsonProperty(value = "location") + private String location; + + // HttpHeaders containing the raw property values. + /** + * Creates an instance of ManagementGroupGovernanceRulesOperationResultsGetHeaders class. + * + * @param rawHeaders The raw HttpHeaders that will be used to create the property values. + */ + public ManagementGroupGovernanceRulesOperationResultsGetHeaders(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 ManagementGroupGovernanceRulesOperationResultsGetHeaders object itself. + */ + public ManagementGroupGovernanceRulesOperationResultsGetHeaders 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/ManagementGroupGovernanceRulesOperationResultsGetResponse.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ManagementGroupGovernanceRulesOperationResultsGetResponse.java new file mode 100644 index 000000000000..d91dce37743c --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ManagementGroupGovernanceRulesOperationResultsGetResponse.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 get operation. */ +public final class ManagementGroupGovernanceRulesOperationResultsGetResponse + extends ResponseBase { + /** + * Creates an instance of ManagementGroupGovernanceRulesOperationResultsGetResponse. + * + * @param request the request which resulted in this ManagementGroupGovernanceRulesOperationResultsGetResponse. + * @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 ManagementGroupGovernanceRulesOperationResultsGetResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + OperationResultAutoGeneratedInner value, + ManagementGroupGovernanceRulesOperationResultsGetHeaders 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/ManagementGroupGovernanceRulesOperations.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ManagementGroupGovernanceRulesOperations.java new file mode 100644 index 000000000000..be16f201b76b --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ManagementGroupGovernanceRulesOperations.java @@ -0,0 +1,88 @@ +// 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 ManagementGroupGovernanceRulesOperations. */ +public interface ManagementGroupGovernanceRulesOperations { + /** + * Get a specific governance rule for the requested scope by ruleId. + * + * @param managementGroupId Azure Management Group ID. + * @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 managementGroupId, String ruleId, Context context); + + /** + * Get a specific governance rule for the requested scope by ruleId. + * + * @param managementGroupId Azure Management Group ID. + * @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. + */ + GovernanceRule get(String managementGroupId, String ruleId); + + /** + * Creates or updates governance rule on the given management group. + * + * @param managementGroupId Azure Management Group ID. + * @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}. + */ + Response createOrUpdateWithResponse( + String managementGroupId, String ruleId, GovernanceRuleInner governanceRule, Context context); + + /** + * Creates or updates governance rule on the given management group. + * + * @param managementGroupId Azure Management Group ID. + * @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. + */ + GovernanceRule createOrUpdate(String managementGroupId, String ruleId, GovernanceRuleInner governanceRule); + + /** + * Delete a Governance rule over a given scope. + * + * @param managementGroupId Azure Management Group ID. + * @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 managementGroupId, String ruleId); + + /** + * Delete a Governance rule over a given scope. + * + * @param managementGroupId Azure Management Group ID. + * @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 managementGroupId, String ruleId, Context context); +} 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 000000000000..7d66935f331a --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/OperationResult.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.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 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 000000000000..94dce0ac8351 --- /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/SecurityConnectorGovernanceRules.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityConnectorGovernanceRules.java index 6b35c10b877c..a3c32f89d8f0 100644 --- 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 @@ -10,7 +10,7 @@ /** Resource collection API of SecurityConnectorGovernanceRules. */ public interface SecurityConnectorGovernanceRules { /** - * Get a list of all relevant governanceRules over a security connector level scope. + * Get a list of all relevant governance rules over a security connector level scope. * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case * insensitive. @@ -18,13 +18,13 @@ public interface SecurityConnectorGovernanceRules { * @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 + * @return a list of all relevant governance rules 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. + * Get a list of all relevant governance rules over a security connector level scope. * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case * insensitive. @@ -33,7 +33,7 @@ public interface SecurityConnectorGovernanceRules { * @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 + * @return a list of all relevant governance rules 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/SecurityConnectorGovernanceRulesOperationResults.java similarity index 54% rename from sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityConnectorGovernanceRulesExecuteStatus.java rename to sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityConnectorGovernanceRulesOperationResults.java index ce51d4bd12f2..5ecd434f2472 100644 --- 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/SecurityConnectorGovernanceRulesOperationResults.java @@ -4,39 +4,41 @@ package com.azure.resourcemanager.security.models; +import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of SecurityConnectorGovernanceRulesExecuteStatus. */ -public interface SecurityConnectorGovernanceRulesExecuteStatus { +/** Resource collection API of SecurityConnectorGovernanceRulesOperationResults. */ +public interface SecurityConnectorGovernanceRulesOperationResults { /** - * Get a specific governanceRule execution status for the requested scope by ruleId and operationId. + * Get governance rule long run operation result 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 ruleId The governance rule key - unique key for the standard governance rule (GUID). + * @param operationId The governance rule execution key - unique key for the execution of governance rule. + * @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. + * @return governance rule long run operation result for the requested scope by ruleId and operationId. */ - ExecuteRuleStatus get(String resourceGroupName, String securityConnectorName, String ruleId, String operationId); + Response getWithResponse( + String resourceGroupName, String securityConnectorName, String ruleId, String operationId, Context context); /** - * Get a specific governanceRule execution status for the requested scope by ruleId and operationId. + * Get governance rule long run operation result 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. + * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). + * @param operationId The governance rule execution key - unique key for the execution of governance rule. * @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. + * @return governance rule long run operation result for the requested scope by ruleId and operationId. */ - ExecuteRuleStatus get( - String resourceGroupName, String securityConnectorName, String ruleId, String operationId, Context context); + OperationResultAutoGenerated get( + String resourceGroupName, String securityConnectorName, String ruleId, String operationId); } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityConnectorGovernanceRulesOperationResultsGetHeaders.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityConnectorGovernanceRulesOperationResultsGetHeaders.java new file mode 100644 index 000000000000..6d640fd24399 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityConnectorGovernanceRulesOperationResultsGetHeaders.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 SecurityConnectorGovernanceRulesOperationResultsGetHeaders model. */ +@Fluent +public final class SecurityConnectorGovernanceRulesOperationResultsGetHeaders { + /* + * The location property. + */ + @JsonProperty(value = "location") + private String location; + + // HttpHeaders containing the raw property values. + /** + * Creates an instance of SecurityConnectorGovernanceRulesOperationResultsGetHeaders class. + * + * @param rawHeaders The raw HttpHeaders that will be used to create the property values. + */ + public SecurityConnectorGovernanceRulesOperationResultsGetHeaders(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 SecurityConnectorGovernanceRulesOperationResultsGetHeaders object itself. + */ + public SecurityConnectorGovernanceRulesOperationResultsGetHeaders 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/SecurityConnectorGovernanceRulesOperationResultsGetResponse.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityConnectorGovernanceRulesOperationResultsGetResponse.java new file mode 100644 index 000000000000..20361fc2af7b --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityConnectorGovernanceRulesOperationResultsGetResponse.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.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 get operation. */ +public final class SecurityConnectorGovernanceRulesOperationResultsGetResponse + extends ResponseBase< + SecurityConnectorGovernanceRulesOperationResultsGetHeaders, OperationResultAutoGeneratedInner> { + /** + * Creates an instance of SecurityConnectorGovernanceRulesOperationResultsGetResponse. + * + * @param request the request which resulted in this SecurityConnectorGovernanceRulesOperationResultsGetResponse. + * @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 SecurityConnectorGovernanceRulesOperationResultsGetResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + OperationResultAutoGeneratedInner value, + SecurityConnectorGovernanceRulesOperationResultsGetHeaders 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/SecurityConnectorGovernanceRulesOperations.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityConnectorGovernanceRulesOperations.java index 8105ecc88148..f3ace88c6c51 100644 --- 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 @@ -11,48 +11,48 @@ /** Resource collection API of SecurityConnectorGovernanceRulesOperations. */ public interface SecurityConnectorGovernanceRulesOperations { /** - * Get a specific governanceRule for the requested scope by ruleId. + * Get a specific governance rule 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 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 governanceRule for the requested scope by ruleId along with {@link Response}. + * @return a specific governance rule 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. + * Get a specific governance rule 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 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 governanceRule for the requested scope by ruleId. + * @return a specific governance rule 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. + * Creates or updates a governance rule 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 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 security GovernanceRule over a given scope along with {@link Response}. + * @return governance rule over a given scope along with {@link Response}. */ Response createOrUpdateWithResponse( String resourceGroupName, @@ -62,47 +62,45 @@ Response createOrUpdateWithResponse( Context context); /** - * Creates or update a security GovernanceRule on the given security connector. + * Creates or updates a governance rule 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 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 security GovernanceRule over a given scope. + * @return governance rule over a given scope. */ GovernanceRule createOrUpdate( String resourceGroupName, String securityConnectorName, String ruleId, GovernanceRuleInner governanceRule); /** - * Delete a GovernanceRule over a given scope. + * Delete a Governance rule 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. + * @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 Response}. */ - Response deleteWithResponse( - String resourceGroupName, String securityConnectorName, String ruleId, Context context); + void delete(String resourceGroupName, String securityConnectorName, String ruleId); /** - * Delete a GovernanceRule over a given scope. + * Delete a Governance rule 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 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 resourceGroupName, String securityConnectorName, String ruleId); + void delete(String resourceGroupName, String securityConnectorName, String ruleId, Context context); } 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/SubscriptionGovernanceRulesOperationResults.java similarity index 52% rename from sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SubscriptionGovernanceRulesExecuteStatus.java rename to sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SubscriptionGovernanceRulesOperationResults.java index 9fa71ca25484..db3e6ae27a06 100644 --- 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/SubscriptionGovernanceRulesOperationResults.java @@ -4,32 +4,33 @@ package com.azure.resourcemanager.security.models; +import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of SubscriptionGovernanceRulesExecuteStatus. */ -public interface SubscriptionGovernanceRulesExecuteStatus { +/** Resource collection API of SubscriptionGovernanceRulesOperationResults. */ +public interface SubscriptionGovernanceRulesOperationResults { /** - * Get a specific governanceRule execution status for the requested scope by ruleId and operationId. + * Get governance rules long run operation result 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 ruleId The governance rule key - unique key for the standard governance rule (GUID). + * @param operationId The governance rule execution key - unique key for the execution of governance rule. + * @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. + * @return governance rules long run operation result for the requested scope by ruleId and operationId. */ - ExecuteRuleStatus get(String ruleId, String operationId); + Response getWithResponse(String ruleId, String operationId, Context context); /** - * Get a specific governanceRule execution status for the requested scope by ruleId and operationId. + * Get governance rules long run operation result 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. + * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). + * @param operationId The governance rule execution key - unique key for the execution of governance rule. * @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. + * @return governance rules long run operation result for the requested scope by ruleId and operationId. */ - ExecuteRuleStatus get(String ruleId, String operationId, Context context); + OperationResultAutoGenerated get(String ruleId, String operationId); } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SubscriptionGovernanceRulesOperationResultsGetHeaders.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SubscriptionGovernanceRulesOperationResultsGetHeaders.java new file mode 100644 index 000000000000..d484010aa554 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SubscriptionGovernanceRulesOperationResultsGetHeaders.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 SubscriptionGovernanceRulesOperationResultsGetHeaders model. */ +@Fluent +public final class SubscriptionGovernanceRulesOperationResultsGetHeaders { + /* + * The location property. + */ + @JsonProperty(value = "location") + private String location; + + // HttpHeaders containing the raw property values. + /** + * Creates an instance of SubscriptionGovernanceRulesOperationResultsGetHeaders class. + * + * @param rawHeaders The raw HttpHeaders that will be used to create the property values. + */ + public SubscriptionGovernanceRulesOperationResultsGetHeaders(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 SubscriptionGovernanceRulesOperationResultsGetHeaders object itself. + */ + public SubscriptionGovernanceRulesOperationResultsGetHeaders 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/SubscriptionGovernanceRulesOperationResultsGetResponse.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SubscriptionGovernanceRulesOperationResultsGetResponse.java new file mode 100644 index 000000000000..babb4b42fe9c --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SubscriptionGovernanceRulesOperationResultsGetResponse.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 get operation. */ +public final class SubscriptionGovernanceRulesOperationResultsGetResponse + extends ResponseBase { + /** + * Creates an instance of SubscriptionGovernanceRulesOperationResultsGetResponse. + * + * @param request the request which resulted in this SubscriptionGovernanceRulesOperationResultsGetResponse. + * @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 SubscriptionGovernanceRulesOperationResultsGetResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + OperationResultAutoGeneratedInner value, + SubscriptionGovernanceRulesOperationResultsGetHeaders 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/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 03c0914c9d08..b8985ad10a4d 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 @@ -12,11 +12,11 @@ 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() 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 c245575cfed4..391428b6afb3 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 @@ -12,11 +12,11 @@ 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( 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 index 2b55990c5fcf..c14509b57724 100644 --- 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 @@ -12,11 +12,11 @@ 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. + * Sample code: List governance rules by subscription level scope. * * @param manager Entry point to SecurityManager. */ - public static void listSecurityGovernanceRulesBySubscriptionLevelScope( + public static void listGovernanceRulesBySubscriptionLevelScope( 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/GovernanceRulesOperationCreateOrUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GovernanceRulesOperationCreateOrUpdateSamples.java index 970b5383bd1f..53941e280097 100644 --- 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 @@ -20,7 +20,7 @@ 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. + * Sample code: Create governance rule. * * @param manager Entry point to SecurityManager. */ @@ -30,7 +30,7 @@ public static void createGovernanceRule(com.azure.resourcemanager.security.Secur .governanceRulesOperations() .define("ad9a8e26-29d9-4829-bb30-e597a58cdbb8") .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) 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 index fbbed032aade..b5fbbdd2e617 100644 --- 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 @@ -12,11 +12,11 @@ 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 governance rule. * * @param manager Entry point to SecurityManager. */ - public static void deleteSecurityGovernanceRule(com.azure.resourcemanager.security.SecurityManager manager) { + public static void deleteGovernanceRule(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 index 85133ea5e362..fdd2a18f0c79 100644 --- 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 @@ -12,12 +12,11 @@ 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. + * Sample code: Get a governance rule by its' ID. * * @param manager Entry point to SecurityManager. */ - public static void getSecurityGovernanceRulesBySpecificGovernanceRuleId( - com.azure.resourcemanager.security.SecurityManager manager) { + public static void getAGovernanceRuleByItsID(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/GovernanceRulesOperationRuleIdExecuteSingleManagementGroupSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GovernanceRulesOperationRuleIdExecuteSingleManagementGroupSamples.java new file mode 100644 index 000000000000..a0b1f28f5812 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GovernanceRulesOperationRuleIdExecuteSingleManagementGroupSamples.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.generated; + +import com.azure.core.util.Context; + +/** Samples for GovernanceRulesOperation RuleIdExecuteSingleManagementGroup. */ +public final class GovernanceRulesOperationRuleIdExecuteSingleManagementGroupSamples { + /* + * 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. + * + * @param manager Entry point to SecurityManager. + */ + public static void executeGovernanceRule(com.azure.resourcemanager.security.SecurityManager manager) { + manager + .governanceRulesOperations() + .ruleIdExecuteSingleManagementGroup("contoso", "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", null, 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 index d020a96f48db..d186d716ee0d 100644 --- 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 @@ -12,7 +12,7 @@ public final class GovernanceRulesOperationRuleIdExecuteSingleSecurityConnectorS * 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. * * @param manager Entry point to SecurityManager. */ diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ManagementGroupGovernanceRuleListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ManagementGroupGovernanceRuleListSamples.java new file mode 100644 index 000000000000..846c77eaee2e --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ManagementGroupGovernanceRuleListSamples.java @@ -0,0 +1,23 @@ +// 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 ManagementGroupGovernanceRule List. */ +public final class ManagementGroupGovernanceRuleListSamples { + /* + * 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 level scope. + * + * @param manager Entry point to SecurityManager. + */ + public static void listGovernanceRulesByManagementGroupLevelScope( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.managementGroupGovernanceRules().list("contoso", Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ManagementGroupGovernanceRulesOperationCreateOrUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ManagementGroupGovernanceRulesOperationCreateOrUpdateSamples.java new file mode 100644 index 000000000000..6b2deffb7c9c --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ManagementGroupGovernanceRulesOperationCreateOrUpdateSamples.java @@ -0,0 +1,66 @@ +// 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 ManagementGroupGovernanceRulesOperation CreateOrUpdate. */ +public final class ManagementGroupGovernanceRulesOperationCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/PutManagementGroupGovernanceRule_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 + .managementGroupGovernanceRulesOperations() + .createOrUpdateWithResponse( + "contoso", + "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", + new GovernanceRuleInner() + .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)), + Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ManagementGroupGovernanceRulesOperationDeleteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ManagementGroupGovernanceRulesOperationDeleteSamples.java new file mode 100644 index 000000000000..3b92e6ecfc24 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ManagementGroupGovernanceRulesOperationDeleteSamples.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.generated; + +import com.azure.core.util.Context; + +/** Samples for ManagementGroupGovernanceRulesOperation Delete. */ +public final class ManagementGroupGovernanceRulesOperationDeleteSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/DeleteManagementGroupGovernanceRule_example.json + */ + /** + * Sample code: Delete Governance rule. + * + * @param manager Entry point to SecurityManager. + */ + public static void deleteGovernanceRule(com.azure.resourcemanager.security.SecurityManager manager) { + manager + .managementGroupGovernanceRulesOperations() + .delete("contoso", "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ManagementGroupGovernanceRulesOperationGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ManagementGroupGovernanceRulesOperationGetSamples.java new file mode 100644 index 000000000000..4231cbe3e9d7 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ManagementGroupGovernanceRulesOperationGetSamples.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; + +import com.azure.core.util.Context; + +/** Samples for ManagementGroupGovernanceRulesOperation Get. */ +public final class ManagementGroupGovernanceRulesOperationGetSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/GetManagementGroupGovernanceRule_example.json + */ + /** + * Sample code: Get governance rules by specific governanceRuleId. + * + * @param manager Entry point to SecurityManager. + */ + public static void getGovernanceRulesBySpecificGovernanceRuleId( + com.azure.resourcemanager.security.SecurityManager manager) { + manager + .managementGroupGovernanceRulesOperations() + .getWithResponse("contoso", "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ManagementGroupGovernanceRulesOperationResultGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ManagementGroupGovernanceRulesOperationResultGetSamples.java new file mode 100644 index 000000000000..e909e5a12676 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ManagementGroupGovernanceRulesOperationResultGetSamples.java @@ -0,0 +1,29 @@ +// 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 ManagementGroupGovernanceRulesOperationResult Get. */ +public final class ManagementGroupGovernanceRulesOperationResultGetSamples { + /* + * 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 by specific governance rule ID. + * + * @param manager Entry point to SecurityManager. + */ + public static void getGovernanceRulesLongRunOperationResultBySpecificGovernanceRuleID( + com.azure.resourcemanager.security.SecurityManager manager) { + manager + .managementGroupGovernanceRulesOperationResults() + .getWithResponse( + "contoso", + "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/SecurityConnectorGovernanceRuleListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorGovernanceRuleListSamples.java index ba982a6515d2..317567ca0157 100644 --- 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 @@ -12,11 +12,11 @@ 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. + * Sample code: List governance rules by security connector level scope. * * @param manager Entry point to SecurityManager. */ - public static void listSecurityGovernanceRulesBySecurityConnectorLevelScope( + public static void listGovernanceRulesBySecurityConnectorLevelScope( 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/SecurityConnectorGovernanceRulesOperationDeleteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorGovernanceRulesOperationDeleteSamples.java index 2c60c9d3542b..991e95a83ab7 100644 --- 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 @@ -12,14 +12,13 @@ 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. + * Sample code: Delete governance rule. * * @param manager Entry point to SecurityManager. */ - public static void deleteSecurityGovernanceRule(com.azure.resourcemanager.security.SecurityManager manager) { + public static void deleteGovernanceRule(com.azure.resourcemanager.security.SecurityManager manager) { manager .securityConnectorGovernanceRulesOperations() - .deleteWithResponse( - "gcpResourceGroup", "gcpconnector", "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", Context.NONE); + .delete("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 index 16caffc3a703..9bd6f2744338 100644 --- 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 @@ -12,12 +12,11 @@ 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. + * Sample code: Get a governance rule by its' ID. * * @param manager Entry point to SecurityManager. */ - public static void getSecurityGovernanceRulesBySpecificGovernanceRuleId( - com.azure.resourcemanager.security.SecurityManager manager) { + public static void getAGovernanceRuleByItsID(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/SecurityConnectorGovernanceRulesExecuteStatusGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorGovernanceRulesOperationResultGetSamples.java similarity index 66% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorGovernanceRulesExecuteStatusGetSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorGovernanceRulesOperationResultGetSamples.java index 455463d5e7a9..327c157b55a3 100644 --- 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/SecurityConnectorGovernanceRulesOperationResultGetSamples.java @@ -6,21 +6,21 @@ import com.azure.core.util.Context; -/** Samples for SecurityConnectorGovernanceRulesExecuteStatus Get. */ -public final class SecurityConnectorGovernanceRulesExecuteStatusGetSamples { +/** Samples for SecurityConnectorGovernanceRulesOperationResult Get. */ +public final class SecurityConnectorGovernanceRulesOperationResultGetSamples { /* * 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. + * Sample code: Get governance rules long run operation result by specific governance rule ID. * * @param manager Entry point to SecurityManager. */ - public static void getSecurityGovernanceRulesExecutionStatusBySpecificGovernanceRuleId( + public static void getGovernanceRulesLongRunOperationResultBySpecificGovernanceRuleID( com.azure.resourcemanager.security.SecurityManager manager) { manager - .securityConnectorGovernanceRulesExecuteStatus() - .get( + .securityConnectorGovernanceRulesOperationResults() + .getWithResponse( "gcpResourceGroup", "gcpconnector", "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", 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/SubscriptionGovernanceRulesOperationResultGetSamples.java similarity index 53% rename from sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SubscriptionGovernanceRulesExecuteStatusGetSamples.java rename to sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SubscriptionGovernanceRulesOperationResultGetSamples.java index 6e6f39d5ffac..77778686d0fd 100644 --- 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/SubscriptionGovernanceRulesOperationResultGetSamples.java @@ -6,20 +6,21 @@ import com.azure.core.util.Context; -/** Samples for SubscriptionGovernanceRulesExecuteStatus Get. */ -public final class SubscriptionGovernanceRulesExecuteStatusGetSamples { +/** Samples for SubscriptionGovernanceRulesOperationResult Get. */ +public final class SubscriptionGovernanceRulesOperationResultGetSamples { /* * 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. + * Sample code: Get governance rules long run operation result by specific governance rule ID. * * @param manager Entry point to SecurityManager. */ - public static void getSecurityGovernanceRulesExecutionStatusBySpecificGovernanceRuleId( + public static void getGovernanceRulesLongRunOperationResultBySpecificGovernanceRuleID( com.azure.resourcemanager.security.SecurityManager manager) { manager - .subscriptionGovernanceRulesExecuteStatus() - .get("ad9a8e26-29d9-4829-bb30-e597a58cdbb8", "58b33f4f-c8c7-4b01-99cc-d437db4d40dd", Context.NONE); + .subscriptionGovernanceRulesOperationResults() + .getWithResponse( + "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", "58b33f4f-c8c7-4b01-99cc-d437db4d40dd", Context.NONE); } }