diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/CHANGELOG.md b/sdk/policyinsights/azure-resourcemanager-policyinsights/CHANGELOG.md index 6a2aea56a3f7..a78f0ca43a0f 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/CHANGELOG.md +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/CHANGELOG.md @@ -1,6 +1,8 @@ # Release History -## 1.0.0-beta.3 (Unreleased) +## 1.0.0-beta.1 (2022-09-29) + +- Azure Resource Manager PolicyInsights client library for Java. This package contains Microsoft Azure SDK for PolicyInsights Management SDK. Package tag package-2022-09. 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/policyinsights/azure-resourcemanager-policyinsights/README.md b/sdk/policyinsights/azure-resourcemanager-policyinsights/README.md index ca1dcf849346..81a99d0b7941 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/README.md +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/README.md @@ -2,7 +2,7 @@ Azure Resource Manager PolicyInsights client library for Java. -This package contains Microsoft Azure SDK for PolicyInsights Management SDK. Package tag package-2021-10. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). +This package contains Microsoft Azure SDK for PolicyInsights Management SDK. Package tag package-2022-09. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## We'd love to hear your feedback @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-policyinsights - 1.0.0-beta.2 + 1.0.0-beta.3 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/SAMPLE.md b/sdk/policyinsights/azure-resourcemanager-policyinsights/SAMPLE.md index 5592e4996b65..0b082f297d40 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/SAMPLE.md +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/SAMPLE.md @@ -38,6 +38,7 @@ ## PolicyRestrictions +- [CheckAtManagementGroupScope](#policyrestrictions_checkatmanagementgroupscope) - [CheckAtResourceGroupScope](#policyrestrictions_checkatresourcegroupscope) - [CheckAtSubscriptionScope](#policyrestrictions_checkatsubscriptionscope) @@ -98,17 +99,20 @@ ### Attestations_CreateOrUpdateAtResource ```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.policyinsights.fluent.models.AttestationInner; import com.azure.resourcemanager.policyinsights.models.AttestationEvidence; import com.azure.resourcemanager.policyinsights.models.ComplianceState; +import java.io.IOException; import java.time.OffsetDateTime; import java.util.Arrays; /** Samples for Attestations CreateOrUpdateAtResource. */ public final class AttestationsCreateOrUpdateAtResourceSamples { /* - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_CreateResourceScope.json + * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-09-01/examples/Attestations_CreateResourceScope.json */ /** * Sample code: Create attestation at individual resource scope. @@ -116,7 +120,7 @@ public final class AttestationsCreateOrUpdateAtResourceSamples { * @param manager Entry point to PolicyInsightsManager. */ public static void createAttestationAtIndividualResourceScope( - com.azure.resourcemanager.policyinsights.PolicyInsightsManager manager) { + com.azure.resourcemanager.policyinsights.PolicyInsightsManager manager) throws IOException { manager .attestations() .createOrUpdateAtResource( @@ -135,8 +139,13 @@ public final class AttestationsCreateOrUpdateAtResourceSamples { .asList( new AttestationEvidence() .withDescription("The results of the security audit.") - .withSourceUri( - "https://gist.github.com/contoso/9573e238762c60166c090ae16b814011"))), + .withSourceUri("https://gist.github.com/contoso/9573e238762c60166c090ae16b814011"))) + .withAssessmentDate(OffsetDateTime.parse("2021-06-10T00:00:00Z")) + .withMetadata( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize( + "{\"departmentId\":\"NYC-MARKETING-1\"}", Object.class, SerializerEncoding.JSON)), Context.NONE); } } @@ -145,15 +154,18 @@ public final class AttestationsCreateOrUpdateAtResourceSamples { ### Attestations_CreateOrUpdateAtResourceGroup ```java +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; import com.azure.resourcemanager.policyinsights.models.AttestationEvidence; import com.azure.resourcemanager.policyinsights.models.ComplianceState; +import java.io.IOException; import java.time.OffsetDateTime; import java.util.Arrays; /** Samples for Attestations CreateOrUpdateAtResourceGroup. */ public final class AttestationsCreateOrUpdateAtResourceGroupSamples { /* - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_CreateResourceGroupScope.json + * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-09-01/examples/Attestations_CreateResourceGroupScope.json */ /** * Sample code: Create attestation at resource group scope. @@ -161,7 +173,7 @@ public final class AttestationsCreateOrUpdateAtResourceGroupSamples { * @param manager Entry point to PolicyInsightsManager. */ public static void createAttestationAtResourceGroupScope( - com.azure.resourcemanager.policyinsights.PolicyInsightsManager manager) { + com.azure.resourcemanager.policyinsights.PolicyInsightsManager manager) throws IOException { manager .attestations() .define("790996e6-9871-4b1f-9cd9-ec42cd6ced1e") @@ -179,6 +191,11 @@ public final class AttestationsCreateOrUpdateAtResourceGroupSamples { new AttestationEvidence() .withDescription("The results of the security audit.") .withSourceUri("https://gist.github.com/contoso/9573e238762c60166c090ae16b814011"))) + .withAssessmentDate(OffsetDateTime.parse("2021-06-10T00:00:00Z")) + .withMetadata( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize("{\"departmentId\":\"NYC-MARKETING-1\"}", Object.class, SerializerEncoding.JSON)) .create(); } } @@ -187,17 +204,20 @@ public final class AttestationsCreateOrUpdateAtResourceGroupSamples { ### Attestations_CreateOrUpdateAtSubscription ```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.policyinsights.fluent.models.AttestationInner; import com.azure.resourcemanager.policyinsights.models.AttestationEvidence; import com.azure.resourcemanager.policyinsights.models.ComplianceState; +import java.io.IOException; import java.time.OffsetDateTime; import java.util.Arrays; /** Samples for Attestations CreateOrUpdateAtSubscription. */ public final class AttestationsCreateOrUpdateAtSubscriptionSamples { /* - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_CreateSubscriptionScope.json + * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-09-01/examples/Attestations_CreateSubscriptionScope.json */ /** * Sample code: Create attestation at subscription scope. @@ -218,7 +238,7 @@ public final class AttestationsCreateOrUpdateAtSubscriptionSamples { } /* - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_CreateSubscriptionScope_AllProperties.json + * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-09-01/examples/Attestations_CreateSubscriptionScope_AllProperties.json */ /** * Sample code: Create attestation at subscription scope with all properties. @@ -226,7 +246,7 @@ public final class AttestationsCreateOrUpdateAtSubscriptionSamples { * @param manager Entry point to PolicyInsightsManager. */ public static void createAttestationAtSubscriptionScopeWithAllProperties( - com.azure.resourcemanager.policyinsights.PolicyInsightsManager manager) { + com.azure.resourcemanager.policyinsights.PolicyInsightsManager manager) throws IOException { manager .attestations() .createOrUpdateAtSubscription( @@ -244,8 +264,13 @@ public final class AttestationsCreateOrUpdateAtSubscriptionSamples { .asList( new AttestationEvidence() .withDescription("The results of the security audit.") - .withSourceUri( - "https://gist.github.com/contoso/9573e238762c60166c090ae16b814011"))), + .withSourceUri("https://gist.github.com/contoso/9573e238762c60166c090ae16b814011"))) + .withAssessmentDate(OffsetDateTime.parse("2021-06-10T00:00:00Z")) + .withMetadata( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize( + "{\"departmentId\":\"NYC-MARKETING-1\"}", Object.class, SerializerEncoding.JSON)), Context.NONE); } } @@ -259,7 +284,7 @@ import com.azure.core.util.Context; /** Samples for Attestations Delete. */ public final class AttestationsDeleteSamples { /* - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_DeleteResourceGroupScope.json + * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-09-01/examples/Attestations_DeleteResourceGroupScope.json */ /** * Sample code: Delete attestation at resource group scope. @@ -281,7 +306,7 @@ import com.azure.core.util.Context; /** Samples for Attestations DeleteAtResource. */ public final class AttestationsDeleteAtResourceSamples { /* - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_DeleteResourceScope.json + * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-09-01/examples/Attestations_DeleteResourceScope.json */ /** * Sample code: Delete attestation at individual resource scope. @@ -308,7 +333,7 @@ import com.azure.core.util.Context; /** Samples for Attestations DeleteAtSubscription. */ public final class AttestationsDeleteAtSubscriptionSamples { /* - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_DeleteSubscriptionScope.json + * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-09-01/examples/Attestations_DeleteSubscriptionScope.json */ /** * Sample code: Delete attestation at subscription scope. @@ -330,7 +355,7 @@ import com.azure.core.util.Context; /** Samples for Attestations GetAtResource. */ public final class AttestationsGetAtResourceSamples { /* - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_GetResourceScope.json + * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-09-01/examples/Attestations_GetResourceScope.json */ /** * Sample code: Get attestation at individual resource scope. @@ -357,7 +382,7 @@ import com.azure.core.util.Context; /** Samples for Attestations GetAtSubscription. */ public final class AttestationsGetAtSubscriptionSamples { /* - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_GetSubscriptionScope.json + * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-09-01/examples/Attestations_GetSubscriptionScope.json */ /** * Sample code: Get attestation at subscription scope. @@ -379,7 +404,7 @@ import com.azure.core.util.Context; /** Samples for Attestations GetByResourceGroup. */ public final class AttestationsGetByResourceGroupSamples { /* - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_GetResourceGroupScope.json + * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-09-01/examples/Attestations_GetResourceGroupScope.json */ /** * Sample code: Get attestation at resource group scope. @@ -403,7 +428,7 @@ import com.azure.core.util.Context; /** Samples for Attestations List. */ public final class AttestationsListSamples { /* - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_ListSubscriptionScope.json + * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-09-01/examples/Attestations_ListSubscriptionScope.json */ /** * Sample code: List attestations at subscription scope. @@ -416,7 +441,7 @@ public final class AttestationsListSamples { } /* - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_ListSubscriptionScope_WithQuery.json + * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-09-01/examples/Attestations_ListSubscriptionScope_WithQuery.json */ /** * Sample code: List attestations at subscription scope with query parameters. @@ -445,7 +470,7 @@ import com.azure.core.util.Context; /** Samples for Attestations ListByResourceGroup. */ public final class AttestationsListByResourceGroupSamples { /* - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_ListResourceGroupScope_WithQuery.json + * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-09-01/examples/Attestations_ListResourceGroupScope_WithQuery.json */ /** * Sample code: List attestations at resource group scope with query parameters. @@ -466,7 +491,7 @@ public final class AttestationsListByResourceGroupSamples { } /* - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_ListResourceGroupScope.json + * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-09-01/examples/Attestations_ListResourceGroupScope.json */ /** * Sample code: List attestations at resource group scope. @@ -488,7 +513,7 @@ import com.azure.core.util.Context; /** Samples for Attestations ListForResource. */ public final class AttestationsListForResourceSamples { /* - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_ListResourceScope_WithQuery.json + * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-09-01/examples/Attestations_ListResourceScope_WithQuery.json */ /** * Sample code: List attestations at individual resource scope with query parameters. @@ -509,7 +534,7 @@ public final class AttestationsListForResourceSamples { } /* - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_ListResourceScope.json + * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-09-01/examples/Attestations_ListResourceScope.json */ /** * Sample code: List attestations at individual resource scope. @@ -554,6 +579,7 @@ public final class OperationsListSamples { ```java import com.azure.core.util.Context; +import com.azure.resourcemanager.policyinsights.models.PolicyEventsResourceType; /** Samples for PolicyEvents ListQueryResultsForManagementGroup. */ public final class PolicyEventsListQueryResultsForManagementGroupSamples { @@ -570,7 +596,17 @@ public final class PolicyEventsListQueryResultsForManagementGroupSamples { manager .policyEvents() .listQueryResultsForManagementGroup( - "myManagementGroup", null, null, null, null, null, null, null, "WpmWfBSvPhkAK6QD", Context.NONE); + PolicyEventsResourceType.DEFAULT, + "myManagementGroup", + null, + null, + null, + null, + null, + null, + null, + "WpmWfBSvPhkAK6QD", + Context.NONE); } /* @@ -586,7 +622,17 @@ public final class PolicyEventsListQueryResultsForManagementGroupSamples { manager .policyEvents() .listQueryResultsForManagementGroup( - "myManagementGroup", null, null, null, null, null, null, null, null, Context.NONE); + PolicyEventsResourceType.DEFAULT, + "myManagementGroup", + null, + null, + null, + null, + null, + null, + null, + null, + Context.NONE); } } ``` @@ -595,6 +641,7 @@ public final class PolicyEventsListQueryResultsForManagementGroupSamples { ```java import com.azure.core.util.Context; +import com.azure.resourcemanager.policyinsights.models.PolicyEventsResourceType; /** Samples for PolicyEvents ListQueryResultsForPolicyDefinition. */ public final class PolicyEventsListQueryResultsForPolicyDefinitionSamples { @@ -611,6 +658,7 @@ public final class PolicyEventsListQueryResultsForPolicyDefinitionSamples { manager .policyEvents() .listQueryResultsForPolicyDefinition( + PolicyEventsResourceType.DEFAULT, "fffedd8f-ffff-fffd-fffd-fffed2f84852", "24813039-7534-408a-9842-eb99f45721b1", null, @@ -637,6 +685,7 @@ public final class PolicyEventsListQueryResultsForPolicyDefinitionSamples { manager .policyEvents() .listQueryResultsForPolicyDefinition( + PolicyEventsResourceType.DEFAULT, "fffedd8f-ffff-fffd-fffd-fffed2f84852", "24813039-7534-408a-9842-eb99f45721b1", null, @@ -656,6 +705,7 @@ public final class PolicyEventsListQueryResultsForPolicyDefinitionSamples { ```java import com.azure.core.util.Context; +import com.azure.resourcemanager.policyinsights.models.PolicyEventsResourceType; /** Samples for PolicyEvents ListQueryResultsForPolicySetDefinition. */ public final class PolicyEventsListQueryResultsForPolicySetDefinitionSamples { @@ -672,6 +722,7 @@ public final class PolicyEventsListQueryResultsForPolicySetDefinitionSamples { manager .policyEvents() .listQueryResultsForPolicySetDefinition( + PolicyEventsResourceType.DEFAULT, "fffedd8f-ffff-fffd-fffd-fffed2f84852", "3e3807c1-65c9-49e0-a406-82d8ae3e338c", null, @@ -698,6 +749,7 @@ public final class PolicyEventsListQueryResultsForPolicySetDefinitionSamples { manager .policyEvents() .listQueryResultsForPolicySetDefinition( + PolicyEventsResourceType.DEFAULT, "fffedd8f-ffff-fffd-fffd-fffed2f84852", "3e3807c1-65c9-49e0-a406-82d8ae3e338c", null, @@ -717,6 +769,7 @@ public final class PolicyEventsListQueryResultsForPolicySetDefinitionSamples { ```java import com.azure.core.util.Context; +import com.azure.resourcemanager.policyinsights.models.PolicyEventsResourceType; /** Samples for PolicyEvents ListQueryResultsForResource. */ public final class PolicyEventsListQueryResultsForResourceSamples { @@ -733,6 +786,7 @@ public final class PolicyEventsListQueryResultsForResourceSamples { manager .policyEvents() .listQueryResultsForResource( + PolicyEventsResourceType.DEFAULT, "subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.SomeNamespace/someResourceType/someResourceName", null, null, @@ -759,6 +813,7 @@ public final class PolicyEventsListQueryResultsForResourceSamples { manager .policyEvents() .listQueryResultsForResource( + PolicyEventsResourceType.DEFAULT, "subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.ServiceFabric/clusters/myCluster/applications/myApplication", null, null, @@ -785,6 +840,7 @@ public final class PolicyEventsListQueryResultsForResourceSamples { manager .policyEvents() .listQueryResultsForResource( + PolicyEventsResourceType.DEFAULT, "subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.SomeNamespace/someResourceType/someResource/someNestedResourceType/someNestedResource", null, null, @@ -810,6 +866,7 @@ public final class PolicyEventsListQueryResultsForResourceSamples { manager .policyEvents() .listQueryResultsForResource( + PolicyEventsResourceType.DEFAULT, "subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.ClassicCompute/domainNames/myDomainName", null, null, @@ -836,6 +893,7 @@ public final class PolicyEventsListQueryResultsForResourceSamples { manager .policyEvents() .listQueryResultsForResource( + PolicyEventsResourceType.DEFAULT, "subscriptions/e78961ba-36fe-4739-9212-e3031b4c8db7/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/Vaults/myKVName", null, null, @@ -865,6 +923,7 @@ public final class PolicyEventsListQueryResultsForResourceSamples { manager .policyEvents() .listQueryResultsForResource( + PolicyEventsResourceType.DEFAULT, "subscriptions/e78961ba-36fe-4739-9212-e3031b4c8db7/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/Vaults/myKVName", null, null, @@ -893,6 +952,7 @@ public final class PolicyEventsListQueryResultsForResourceSamples { manager .policyEvents() .listQueryResultsForResource( + PolicyEventsResourceType.DEFAULT, "subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.ClassicCompute/domainNames/myDomainName", null, null, @@ -912,6 +972,7 @@ public final class PolicyEventsListQueryResultsForResourceSamples { ```java import com.azure.core.util.Context; +import com.azure.resourcemanager.policyinsights.models.PolicyEventsResourceType; /** Samples for PolicyEvents ListQueryResultsForResourceGroup. */ public final class PolicyEventsListQueryResultsForResourceGroupSamples { @@ -928,6 +989,7 @@ public final class PolicyEventsListQueryResultsForResourceGroupSamples { manager .policyEvents() .listQueryResultsForResourceGroup( + PolicyEventsResourceType.DEFAULT, "fffedd8f-ffff-fffd-fffd-fffed2f84852", "myResourceGroup", null, @@ -954,6 +1016,7 @@ public final class PolicyEventsListQueryResultsForResourceGroupSamples { manager .policyEvents() .listQueryResultsForResourceGroup( + PolicyEventsResourceType.DEFAULT, "fffedd8f-ffff-fffd-fffd-fffed2f84852", "myResourceGroup", null, @@ -973,6 +1036,7 @@ public final class PolicyEventsListQueryResultsForResourceGroupSamples { ```java import com.azure.core.util.Context; +import com.azure.resourcemanager.policyinsights.models.PolicyEventsResourceType; /** Samples for PolicyEvents ListQueryResultsForResourceGroupLevelPolicyAssignment. */ public final class PolicyEventsListQueryResultsForResourceGroupLevelPolicyAssignmentSamples { @@ -989,6 +1053,7 @@ public final class PolicyEventsListQueryResultsForResourceGroupLevelPolicyAssign manager .policyEvents() .listQueryResultsForResourceGroupLevelPolicyAssignment( + PolicyEventsResourceType.DEFAULT, "fffedd8f-ffff-fffd-fffd-fffed2f84852", "myResourceGroup", "myPolicyAssignment", @@ -1016,6 +1081,7 @@ public final class PolicyEventsListQueryResultsForResourceGroupLevelPolicyAssign manager .policyEvents() .listQueryResultsForResourceGroupLevelPolicyAssignment( + PolicyEventsResourceType.DEFAULT, "fffedd8f-ffff-fffd-fffd-fffed2f84852", "myResourceGroup", "myPolicyAssignment", @@ -1036,6 +1102,7 @@ public final class PolicyEventsListQueryResultsForResourceGroupLevelPolicyAssign ```java import com.azure.core.util.Context; +import com.azure.resourcemanager.policyinsights.models.PolicyEventsResourceType; import java.time.OffsetDateTime; /** Samples for PolicyEvents ListQueryResultsForSubscription. */ @@ -1053,6 +1120,7 @@ public final class PolicyEventsListQueryResultsForSubscriptionSamples { manager .policyEvents() .listQueryResultsForSubscription( + PolicyEventsResourceType.DEFAULT, "fffedd8f-ffff-fffd-fffd-fffed2f84852", 2, "Timestamp desc, PolicyAssignmentId asc, SubscriptionId asc, ResourceGroup asc, ResourceId", @@ -1077,6 +1145,7 @@ public final class PolicyEventsListQueryResultsForSubscriptionSamples { manager .policyEvents() .listQueryResultsForSubscription( + PolicyEventsResourceType.DEFAULT, "fffedd8f-ffff-fffd-fffd-fffed2f84852", null, null, @@ -1102,6 +1171,7 @@ public final class PolicyEventsListQueryResultsForSubscriptionSamples { manager .policyEvents() .listQueryResultsForSubscription( + PolicyEventsResourceType.DEFAULT, "fffedd8f-ffff-fffd-fffd-fffed2f84852", 2, null, @@ -1127,6 +1197,7 @@ public final class PolicyEventsListQueryResultsForSubscriptionSamples { manager .policyEvents() .listQueryResultsForSubscription( + PolicyEventsResourceType.DEFAULT, "fffedd8f-ffff-fffd-fffd-fffed2f84852", null, null, @@ -1151,6 +1222,7 @@ public final class PolicyEventsListQueryResultsForSubscriptionSamples { manager .policyEvents() .listQueryResultsForSubscription( + PolicyEventsResourceType.DEFAULT, "fffedd8f-ffff-fffd-fffd-fffed2f84852", 10, "NumDeniedResources desc", @@ -1177,6 +1249,7 @@ public final class PolicyEventsListQueryResultsForSubscriptionSamples { manager .policyEvents() .listQueryResultsForSubscription( + PolicyEventsResourceType.DEFAULT, "fffedd8f-ffff-fffd-fffd-fffed2f84852", 2, null, @@ -1203,7 +1276,17 @@ public final class PolicyEventsListQueryResultsForSubscriptionSamples { manager .policyEvents() .listQueryResultsForSubscription( - "fffedd8f-ffff-fffd-fffd-fffed2f84852", null, null, null, null, null, null, null, null, Context.NONE); + PolicyEventsResourceType.DEFAULT, + "fffedd8f-ffff-fffd-fffd-fffed2f84852", + null, + null, + null, + null, + null, + null, + null, + null, + Context.NONE); } } ``` @@ -1212,6 +1295,7 @@ public final class PolicyEventsListQueryResultsForSubscriptionSamples { ```java import com.azure.core.util.Context; +import com.azure.resourcemanager.policyinsights.models.PolicyEventsResourceType; /** Samples for PolicyEvents ListQueryResultsForSubscriptionLevelPolicyAssignment. */ public final class PolicyEventsListQueryResultsForSubscriptionLevelPolicyAssignmentSamples { @@ -1228,6 +1312,7 @@ public final class PolicyEventsListQueryResultsForSubscriptionLevelPolicyAssignm manager .policyEvents() .listQueryResultsForSubscriptionLevelPolicyAssignment( + PolicyEventsResourceType.DEFAULT, "fffedd8f-ffff-fffd-fffd-fffed2f84852", "ec8f9645-8ecb-4abb-9c0b-5292f19d4003", null, @@ -1254,6 +1339,7 @@ public final class PolicyEventsListQueryResultsForSubscriptionLevelPolicyAssignm manager .policyEvents() .listQueryResultsForSubscriptionLevelPolicyAssignment( + PolicyEventsResourceType.DEFAULT, "fffedd8f-ffff-fffd-fffd-fffed2f84852", "ec8f9645-8ecb-4abb-9c0b-5292f19d4003", null, @@ -1326,6 +1412,37 @@ public final class PolicyMetadataListSamples { } ``` +### PolicyRestrictions_CheckAtManagementGroupScope + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.policyinsights.models.CheckManagementGroupRestrictionsRequest; +import com.azure.resourcemanager.policyinsights.models.PendingField; +import java.util.Arrays; + +/** Samples for PolicyRestrictions CheckAtManagementGroupScope. */ +public final class PolicyRestrictionsCheckAtManagementGroupScopeSamples { + /* + * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-03-01/examples/PolicyRestrictions_CheckAtManagementGroupScope.json + */ + /** + * Sample code: Check policy restrictions at management group scope. + * + * @param manager Entry point to PolicyInsightsManager. + */ + public static void checkPolicyRestrictionsAtManagementGroupScope( + com.azure.resourcemanager.policyinsights.PolicyInsightsManager manager) { + manager + .policyRestrictions() + .checkAtManagementGroupScopeWithResponse( + "financeMg", + new CheckManagementGroupRestrictionsRequest() + .withPendingFields(Arrays.asList(new PendingField().withField("type"))), + Context.NONE); + } +} +``` + ### PolicyRestrictions_CheckAtResourceGroupScope ```java @@ -1341,7 +1458,7 @@ import java.util.Arrays; /** Samples for PolicyRestrictions CheckAtResourceGroupScope. */ public final class PolicyRestrictionsCheckAtResourceGroupScopeSamples { /* - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2020-07-01/examples/PolicyRestrictions_CheckAtResourceGroupScope.json + * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-03-01/examples/PolicyRestrictions_CheckAtResourceGroupScope.json */ /** * Sample code: Check policy restrictions at resource group scope. @@ -1393,7 +1510,7 @@ import java.util.Arrays; /** Samples for PolicyRestrictions CheckAtSubscriptionScope. */ public final class PolicyRestrictionsCheckAtSubscriptionScopeSamples { /* - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2020-07-01/examples/PolicyRestrictions_CheckAtSubscriptionScope.json + * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-03-01/examples/PolicyRestrictions_CheckAtSubscriptionScope.json */ /** * Sample code: Check policy restrictions at subscription scope. @@ -2243,6 +2360,7 @@ public final class PolicyStatesListQueryResultsForSubscriptionLevelPolicyAssignm ```java import com.azure.core.util.Context; +import com.azure.resourcemanager.policyinsights.models.PolicyStatesSummaryResourceType; import java.time.OffsetDateTime; /** Samples for PolicyStates SummarizeForManagementGroup. */ @@ -2260,6 +2378,7 @@ public final class PolicyStatesSummarizeForManagementGroupSamples { manager .policyStates() .summarizeForManagementGroupWithResponse( + PolicyStatesSummaryResourceType.LATEST, "myManagementGroup", 0, OffsetDateTime.parse("2019-10-05T18:00:00Z"), @@ -2274,6 +2393,7 @@ public final class PolicyStatesSummarizeForManagementGroupSamples { ```java import com.azure.core.util.Context; +import com.azure.resourcemanager.policyinsights.models.PolicyStatesSummaryResourceType; /** Samples for PolicyStates SummarizeForPolicyDefinition. */ public final class PolicyStatesSummarizeForPolicyDefinitionSamples { @@ -2290,6 +2410,7 @@ public final class PolicyStatesSummarizeForPolicyDefinitionSamples { manager .policyStates() .summarizeForPolicyDefinitionWithResponse( + PolicyStatesSummaryResourceType.LATEST, "fffedd8f-ffff-fffd-fffd-fffed2f84852", "24813039-7534-408a-9842-eb99f45721b1", null, @@ -2305,6 +2426,7 @@ public final class PolicyStatesSummarizeForPolicyDefinitionSamples { ```java import com.azure.core.util.Context; +import com.azure.resourcemanager.policyinsights.models.PolicyStatesSummaryResourceType; import java.time.OffsetDateTime; /** Samples for PolicyStates SummarizeForPolicySetDefinition. */ @@ -2322,6 +2444,7 @@ public final class PolicyStatesSummarizeForPolicySetDefinitionSamples { manager .policyStates() .summarizeForPolicySetDefinitionWithResponse( + PolicyStatesSummaryResourceType.LATEST, "fffedd8f-ffff-fffd-fffd-fffed2f84852", "3e3807c1-65c9-49e0-a406-82d8ae3e338c", 1, @@ -2337,6 +2460,7 @@ public final class PolicyStatesSummarizeForPolicySetDefinitionSamples { ```java import com.azure.core.util.Context; +import com.azure.resourcemanager.policyinsights.models.PolicyStatesSummaryResourceType; /** Samples for PolicyStates SummarizeForResource. */ public final class PolicyStatesSummarizeForResourceSamples { @@ -2353,6 +2477,7 @@ public final class PolicyStatesSummarizeForResourceSamples { manager .policyStates() .summarizeForResourceWithResponse( + PolicyStatesSummaryResourceType.LATEST, "subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/my-vault", 2, null, @@ -2367,6 +2492,7 @@ public final class PolicyStatesSummarizeForResourceSamples { ```java import com.azure.core.util.Context; +import com.azure.resourcemanager.policyinsights.models.PolicyStatesSummaryResourceType; /** Samples for PolicyStates SummarizeForResourceGroup. */ public final class PolicyStatesSummarizeForResourceGroupSamples { @@ -2383,7 +2509,14 @@ public final class PolicyStatesSummarizeForResourceGroupSamples { manager .policyStates() .summarizeForResourceGroupWithResponse( - "fffedd8f-ffff-fffd-fffd-fffed2f84852", "myResourceGroup", null, null, null, null, Context.NONE); + PolicyStatesSummaryResourceType.LATEST, + "fffedd8f-ffff-fffd-fffd-fffed2f84852", + "myResourceGroup", + null, + null, + null, + null, + Context.NONE); } } ``` @@ -2392,6 +2525,7 @@ public final class PolicyStatesSummarizeForResourceGroupSamples { ```java import com.azure.core.util.Context; +import com.azure.resourcemanager.policyinsights.models.PolicyStatesSummaryResourceType; /** Samples for PolicyStates SummarizeForResourceGroupLevelPolicyAssignment. */ public final class PolicyStatesSummarizeForResourceGroupLevelPolicyAssignmentSamples { @@ -2408,6 +2542,7 @@ public final class PolicyStatesSummarizeForResourceGroupLevelPolicyAssignmentSam manager .policyStates() .summarizeForResourceGroupLevelPolicyAssignmentWithResponse( + PolicyStatesSummaryResourceType.LATEST, "fffedd8f-ffff-fffd-fffd-fffed2f84852", "myResourceGroup", "b7a1ca2596524e3ab19597f2", @@ -2424,6 +2559,7 @@ public final class PolicyStatesSummarizeForResourceGroupLevelPolicyAssignmentSam ```java import com.azure.core.util.Context; +import com.azure.resourcemanager.policyinsights.models.PolicyStatesSummaryResourceType; /** Samples for PolicyStates SummarizeForSubscription. */ public final class PolicyStatesSummarizeForSubscriptionSamples { @@ -2440,6 +2576,7 @@ public final class PolicyStatesSummarizeForSubscriptionSamples { manager .policyStates() .summarizeForSubscriptionWithResponse( + PolicyStatesSummaryResourceType.LATEST, "fffedd8f-ffff-fffd-fffd-fffed2f84852", 1, null, @@ -2461,7 +2598,13 @@ public final class PolicyStatesSummarizeForSubscriptionSamples { manager .policyStates() .summarizeForSubscriptionWithResponse( - "fffedd8f-ffff-fffd-fffd-fffed2f84852", 5, null, null, null, Context.NONE); + PolicyStatesSummaryResourceType.LATEST, + "fffedd8f-ffff-fffd-fffd-fffed2f84852", + 5, + null, + null, + null, + Context.NONE); } } ``` @@ -2470,6 +2613,7 @@ public final class PolicyStatesSummarizeForSubscriptionSamples { ```java import com.azure.core.util.Context; +import com.azure.resourcemanager.policyinsights.models.PolicyStatesSummaryResourceType; /** Samples for PolicyStates SummarizeForSubscriptionLevelPolicyAssignment. */ public final class PolicyStatesSummarizeForSubscriptionLevelPolicyAssignmentSamples { @@ -2486,6 +2630,7 @@ public final class PolicyStatesSummarizeForSubscriptionLevelPolicyAssignmentSamp manager .policyStates() .summarizeForSubscriptionLevelPolicyAssignmentWithResponse( + PolicyStatesSummaryResourceType.LATEST, "fffedd8f-ffff-fffd-fffd-fffed2f84852", "ec8f9645-8ecb-4abb-9c0b-5292f19d4003", null, @@ -2547,6 +2692,7 @@ public final class PolicyStatesTriggerSubscriptionEvaluationSamples { ```java import com.azure.core.util.Context; +import com.azure.resourcemanager.policyinsights.models.PolicyTrackedResourcesResourceType; /** Samples for PolicyTrackedResources ListQueryResultsForManagementGroup. */ public final class PolicyTrackedResourcesListQueryResultsForManagementGroupSamples { @@ -2564,6 +2710,7 @@ public final class PolicyTrackedResourcesListQueryResultsForManagementGroupSampl .policyTrackedResources() .listQueryResultsForManagementGroup( "myManagementGroup", + PolicyTrackedResourcesResourceType.DEFAULT, 1, "PolicyAssignmentId eq" + " '/subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Authorization/policyAssignments/myPolicyAssignment'" @@ -2584,7 +2731,8 @@ public final class PolicyTrackedResourcesListQueryResultsForManagementGroupSampl com.azure.resourcemanager.policyinsights.PolicyInsightsManager manager) { manager .policyTrackedResources() - .listQueryResultsForManagementGroup("myManagementGroup", null, null, Context.NONE); + .listQueryResultsForManagementGroup( + "myManagementGroup", PolicyTrackedResourcesResourceType.DEFAULT, null, null, Context.NONE); } } ``` @@ -2593,6 +2741,7 @@ public final class PolicyTrackedResourcesListQueryResultsForManagementGroupSampl ```java import com.azure.core.util.Context; +import com.azure.resourcemanager.policyinsights.models.PolicyTrackedResourcesResourceType; /** Samples for PolicyTrackedResources ListQueryResultsForResource. */ public final class PolicyTrackedResourcesListQueryResultsForResourceSamples { @@ -2610,6 +2759,7 @@ public final class PolicyTrackedResourcesListQueryResultsForResourceSamples { .policyTrackedResources() .listQueryResultsForResource( "subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Example/exampleResourceType/myResource", + PolicyTrackedResourcesResourceType.DEFAULT, 1, "PolicyAssignmentId eq" + " '/subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Authorization/policyAssignments/myPolicyAssignment'" @@ -2631,6 +2781,7 @@ public final class PolicyTrackedResourcesListQueryResultsForResourceSamples { .policyTrackedResources() .listQueryResultsForResource( "subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Example/exampleResourceType/myResource", + PolicyTrackedResourcesResourceType.DEFAULT, null, null, Context.NONE); @@ -2642,6 +2793,7 @@ public final class PolicyTrackedResourcesListQueryResultsForResourceSamples { ```java import com.azure.core.util.Context; +import com.azure.resourcemanager.policyinsights.models.PolicyTrackedResourcesResourceType; /** Samples for PolicyTrackedResources ListQueryResultsForResourceGroup. */ public final class PolicyTrackedResourcesListQueryResultsForResourceGroupSamples { @@ -2659,6 +2811,7 @@ public final class PolicyTrackedResourcesListQueryResultsForResourceGroupSamples .policyTrackedResources() .listQueryResultsForResourceGroup( "myResourceGroup", + PolicyTrackedResourcesResourceType.DEFAULT, 1, "PolicyAssignmentId eq" + " '/subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Authorization/policyAssignments/myPolicyAssignment'" @@ -2677,7 +2830,10 @@ public final class PolicyTrackedResourcesListQueryResultsForResourceGroupSamples */ public static void queryAtResourceGroupScope( com.azure.resourcemanager.policyinsights.PolicyInsightsManager manager) { - manager.policyTrackedResources().listQueryResultsForResourceGroup("myResourceGroup", null, null, Context.NONE); + manager + .policyTrackedResources() + .listQueryResultsForResourceGroup( + "myResourceGroup", PolicyTrackedResourcesResourceType.DEFAULT, null, null, Context.NONE); } } ``` @@ -2686,6 +2842,7 @@ public final class PolicyTrackedResourcesListQueryResultsForResourceGroupSamples ```java import com.azure.core.util.Context; +import com.azure.resourcemanager.policyinsights.models.PolicyTrackedResourcesResourceType; /** Samples for PolicyTrackedResources ListQueryResultsForSubscription. */ public final class PolicyTrackedResourcesListQueryResultsForSubscriptionSamples { @@ -2702,6 +2859,7 @@ public final class PolicyTrackedResourcesListQueryResultsForSubscriptionSamples manager .policyTrackedResources() .listQueryResultsForSubscription( + PolicyTrackedResourcesResourceType.DEFAULT, 1, "PolicyAssignmentId eq" + " '/subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Authorization/policyAssignments/myPolicyAssignment'" @@ -2720,7 +2878,9 @@ public final class PolicyTrackedResourcesListQueryResultsForSubscriptionSamples */ public static void queryAtSubscriptionScope( com.azure.resourcemanager.policyinsights.PolicyInsightsManager manager) { - manager.policyTrackedResources().listQueryResultsForSubscription(null, null, Context.NONE); + manager + .policyTrackedResources() + .listQueryResultsForSubscription(PolicyTrackedResourcesResourceType.DEFAULT, null, null, Context.NONE); } } ``` @@ -2960,7 +3120,7 @@ public final class RemediationsCreateOrUpdateAtSubscriptionSamples { .withFilters(new RemediationFilters().withLocations(Arrays.asList("eastus", "westus"))) .withResourceCount(42) .withParallelDeployments(6) - .withFailureThreshold(new RemediationPropertiesFailureThreshold().withPercentage(0.1f)), + .withFailureThreshold(new RemediationPropertiesFailureThreshold().withPercentage(0.1F)), Context.NONE); } } diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/pom.xml b/sdk/policyinsights/azure-resourcemanager-policyinsights/pom.xml index 82ba5a94d217..15f7aa54b74d 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/pom.xml +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/pom.xml @@ -13,7 +13,7 @@ jar Microsoft Azure SDK for PolicyInsights Management - This package contains Microsoft Azure SDK for PolicyInsights Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Package tag package-2021-10. + This package contains Microsoft Azure SDK for PolicyInsights Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Package tag package-2022-09. https://github.com/Azure/azure-sdk-for-java diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/PolicyInsightsManager.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/PolicyInsightsManager.java index 118878241144..8d10ef291f12 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/PolicyInsightsManager.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/PolicyInsightsManager.java @@ -10,11 +10,13 @@ import com.azure.core.http.HttpPipelineBuilder; import com.azure.core.http.HttpPipelinePosition; import com.azure.core.http.policy.AddDatePolicy; +import com.azure.core.http.policy.AddHeadersFromContextPolicy; import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.http.policy.HttpLoggingPolicy; import com.azure.core.http.policy.HttpPipelinePolicy; import com.azure.core.http.policy.HttpPolicyProviders; import com.azure.core.http.policy.RequestIdPolicy; +import com.azure.core.http.policy.RetryOptions; import com.azure.core.http.policy.RetryPolicy; import com.azure.core.http.policy.UserAgentPolicy; import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy; @@ -91,6 +93,19 @@ public static PolicyInsightsManager authenticate(TokenCredential credential, Azu return configure().authenticate(credential, profile); } + /** + * Creates an instance of PolicyInsights service API entry point. + * + * @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential. + * @param profile the Azure profile for client. + * @return the PolicyInsights service API instance. + */ + public static PolicyInsightsManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return new PolicyInsightsManager(httpPipeline, profile, null); + } + /** * Gets a Configurable instance that can be used to create PolicyInsightsManager with optional configuration. * @@ -102,13 +117,14 @@ public static Configurable configure() { /** The Configurable allowing configurations to be set. */ public static final class Configurable { - private final ClientLogger logger = new ClientLogger(Configurable.class); + private static final ClientLogger LOGGER = new ClientLogger(Configurable.class); private HttpClient httpClient; private HttpLogOptions httpLogOptions; private final List policies = new ArrayList<>(); private final List scopes = new ArrayList<>(); private RetryPolicy retryPolicy; + private RetryOptions retryOptions; private Duration defaultPollInterval; private Configurable() { @@ -169,6 +185,19 @@ public Configurable withRetryPolicy(RetryPolicy retryPolicy) { return this; } + /** + * Sets the retry options for the HTTP pipeline retry policy. + * + *

This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}. + * + * @param retryOptions the retry options for the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryOptions(RetryOptions retryOptions) { + this.retryOptions = Objects.requireNonNull(retryOptions, "'retryOptions' cannot be null."); + return this; + } + /** * Sets the default poll interval, used when service does not provide "Retry-After" header. * @@ -176,9 +205,11 @@ public Configurable withRetryPolicy(RetryPolicy retryPolicy) { * @return the configurable object itself. */ public Configurable withDefaultPollInterval(Duration defaultPollInterval) { - this.defaultPollInterval = Objects.requireNonNull(defaultPollInterval, "'retryPolicy' cannot be null."); + this.defaultPollInterval = + Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null."); if (this.defaultPollInterval.isNegative()) { - throw logger.logExceptionAsError(new IllegalArgumentException("'httpPipeline' cannot be negative")); + throw LOGGER + .logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' cannot be negative")); } return this; } @@ -200,7 +231,7 @@ public PolicyInsightsManager authenticate(TokenCredential credential, AzureProfi .append("-") .append("com.azure.resourcemanager.policyinsights") .append("/") - .append("1.0.0-beta.2"); + .append("1.0.0-beta.1"); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder .append(" (") @@ -218,10 +249,15 @@ public PolicyInsightsManager authenticate(TokenCredential credential, AzureProfi scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default"); } if (retryPolicy == null) { - retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); + if (retryOptions != null) { + retryPolicy = new RetryPolicy(retryOptions); + } else { + retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); + } } List policies = new ArrayList<>(); policies.add(new UserAgentPolicy(userAgentBuilder.toString())); + policies.add(new AddHeadersFromContextPolicy()); policies.add(new RequestIdPolicy()); policies .addAll( @@ -252,7 +288,11 @@ public PolicyInsightsManager authenticate(TokenCredential credential, AzureProfi } } - /** @return Resource collection API of PolicyTrackedResources. */ + /** + * Gets the resource collection API of PolicyTrackedResources. + * + * @return Resource collection API of PolicyTrackedResources. + */ public PolicyTrackedResources policyTrackedResources() { if (this.policyTrackedResources == null) { this.policyTrackedResources = @@ -261,7 +301,11 @@ public PolicyTrackedResources policyTrackedResources() { return policyTrackedResources; } - /** @return Resource collection API of Remediations. */ + /** + * Gets the resource collection API of Remediations. It manages Remediation. + * + * @return Resource collection API of Remediations. + */ public Remediations remediations() { if (this.remediations == null) { this.remediations = new RemediationsImpl(clientObject.getRemediations(), this); @@ -269,7 +313,11 @@ public Remediations remediations() { return remediations; } - /** @return Resource collection API of PolicyEvents. */ + /** + * Gets the resource collection API of PolicyEvents. + * + * @return Resource collection API of PolicyEvents. + */ public PolicyEvents policyEvents() { if (this.policyEvents == null) { this.policyEvents = new PolicyEventsImpl(clientObject.getPolicyEvents(), this); @@ -277,7 +325,11 @@ public PolicyEvents policyEvents() { return policyEvents; } - /** @return Resource collection API of PolicyStates. */ + /** + * Gets the resource collection API of PolicyStates. + * + * @return Resource collection API of PolicyStates. + */ public PolicyStates policyStates() { if (this.policyStates == null) { this.policyStates = new PolicyStatesImpl(clientObject.getPolicyStates(), this); @@ -285,7 +337,11 @@ public PolicyStates policyStates() { return policyStates; } - /** @return Resource collection API of Operations. */ + /** + * Gets the resource collection API of Operations. + * + * @return Resource collection API of Operations. + */ public Operations operations() { if (this.operations == null) { this.operations = new OperationsImpl(clientObject.getOperations(), this); @@ -293,7 +349,11 @@ public Operations operations() { return operations; } - /** @return Resource collection API of PolicyMetadatas. */ + /** + * Gets the resource collection API of PolicyMetadatas. + * + * @return Resource collection API of PolicyMetadatas. + */ public PolicyMetadatas policyMetadatas() { if (this.policyMetadatas == null) { this.policyMetadatas = new PolicyMetadatasImpl(clientObject.getPolicyMetadatas(), this); @@ -301,7 +361,11 @@ public PolicyMetadatas policyMetadatas() { return policyMetadatas; } - /** @return Resource collection API of PolicyRestrictions. */ + /** + * Gets the resource collection API of PolicyRestrictions. + * + * @return Resource collection API of PolicyRestrictions. + */ public PolicyRestrictions policyRestrictions() { if (this.policyRestrictions == null) { this.policyRestrictions = new PolicyRestrictionsImpl(clientObject.getPolicyRestrictions(), this); @@ -309,7 +373,11 @@ public PolicyRestrictions policyRestrictions() { return policyRestrictions; } - /** @return Resource collection API of Attestations. */ + /** + * Gets the resource collection API of Attestations. It manages Attestation. + * + * @return Resource collection API of Attestations. + */ public Attestations attestations() { if (this.attestations == null) { this.attestations = new AttestationsImpl(clientObject.getAttestations(), this); diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/fluent/AttestationsClient.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/fluent/AttestationsClient.java index 27762cb0732b..2d8e3958436d 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/fluent/AttestationsClient.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/fluent/AttestationsClient.java @@ -20,7 +20,7 @@ public interface AttestationsClient { * * @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 all attestations for the subscription. + * @return all attestations for the subscription as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(); @@ -34,7 +34,7 @@ public interface AttestationsClient { * @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 all attestations for the subscription. + * @return all attestations for the subscription as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(Integer top, String filter, Context context); @@ -47,7 +47,7 @@ public interface AttestationsClient { * @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 an attestation resource. + * @return the {@link SyncPoller} for polling of an attestation resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, AttestationInner> beginCreateOrUpdateAtSubscription( @@ -62,7 +62,7 @@ SyncPoller, AttestationInner> beginCreateOrUpdateAt * @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 an attestation resource. + * @return the {@link SyncPoller} for polling of an attestation resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, AttestationInner> beginCreateOrUpdateAtSubscription( @@ -115,7 +115,7 @@ SyncPoller, AttestationInner> beginCreateOrUpdateAt * @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 an existing attestation at subscription scope. + * @return an existing attestation at subscription scope along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getAtSubscriptionWithResponse(String attestationName, Context context); @@ -139,7 +139,7 @@ SyncPoller, AttestationInner> beginCreateOrUpdateAt * @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 response. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response deleteAtSubscriptionWithResponse(String attestationName, Context context); @@ -151,7 +151,7 @@ SyncPoller, AttestationInner> beginCreateOrUpdateAt * @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 all attestations for the resource group. + * @return all attestations for the resource group as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByResourceGroup(String resourceGroupName); @@ -166,7 +166,7 @@ SyncPoller, AttestationInner> beginCreateOrUpdateAt * @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 all attestations for the resource group. + * @return all attestations for the resource group as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByResourceGroup( @@ -181,7 +181,7 @@ PagedIterable listByResourceGroup( * @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 an attestation resource. + * @return the {@link SyncPoller} for polling of an attestation resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, AttestationInner> beginCreateOrUpdateAtResourceGroup( @@ -197,7 +197,7 @@ SyncPoller, AttestationInner> beginCreateOrUpdateAt * @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 an attestation resource. + * @return the {@link SyncPoller} for polling of an attestation resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, AttestationInner> beginCreateOrUpdateAtResourceGroup( @@ -256,7 +256,7 @@ AttestationInner createOrUpdateAtResourceGroup( * @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 an existing attestation at resource group scope. + * @return an existing attestation at resource group scope along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getByResourceGroupWithResponse( @@ -283,7 +283,7 @@ Response getByResourceGroupWithResponse( * @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 response. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response deleteWithResponse(String resourceGroupName, String attestationName, Context context); @@ -295,7 +295,7 @@ Response getByResourceGroupWithResponse( * @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 all attestations for a resource. + * @return all attestations for a resource as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listForResource(String resourceId); @@ -310,7 +310,7 @@ Response getByResourceGroupWithResponse( * @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 all attestations for a resource. + * @return all attestations for a resource as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listForResource(String resourceId, Integer top, String filter, Context context); @@ -324,7 +324,7 @@ Response getByResourceGroupWithResponse( * @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 an attestation resource. + * @return the {@link SyncPoller} for polling of an attestation resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, AttestationInner> beginCreateOrUpdateAtResource( @@ -340,7 +340,7 @@ SyncPoller, AttestationInner> beginCreateOrUpdateAt * @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 an attestation resource. + * @return the {@link SyncPoller} for polling of an attestation resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, AttestationInner> beginCreateOrUpdateAtResource( @@ -398,7 +398,7 @@ AttestationInner createOrUpdateAtResource( * @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 an existing attestation at resource scope. + * @return an existing attestation at resource scope along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getAtResourceWithResponse(String resourceId, String attestationName, Context context); @@ -424,7 +424,7 @@ AttestationInner createOrUpdateAtResource( * @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 response. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response deleteAtResourceWithResponse(String resourceId, String attestationName, Context context); diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/fluent/OperationsClient.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/fluent/OperationsClient.java index fd08a116756e..eee9909301ad 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/fluent/OperationsClient.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/fluent/OperationsClient.java @@ -29,7 +29,7 @@ public interface OperationsClient { * @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 list of available operations. + * @return list of available operations along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response listWithResponse(Context context); diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/fluent/PolicyEventsClient.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/fluent/PolicyEventsClient.java index 3d264be6c247..4375008175a2 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/fluent/PolicyEventsClient.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/fluent/PolicyEventsClient.java @@ -9,6 +9,7 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.util.Context; import com.azure.resourcemanager.policyinsights.fluent.models.PolicyEventInner; +import com.azure.resourcemanager.policyinsights.models.PolicyEventsResourceType; import java.time.OffsetDateTime; /** An instance of this class provides access to all the operations defined in PolicyEventsClient. */ @@ -16,18 +17,23 @@ public interface PolicyEventsClient { /** * Queries policy events for the resources under the management group. * + * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only "default" is + * allowed. * @param managementGroupName Management group name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listQueryResultsForManagementGroup(String managementGroupName); + PagedIterable listQueryResultsForManagementGroup( + PolicyEventsResourceType policyEventsResource, String managementGroupName); /** * Queries policy events for the resources under the management group. * + * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only "default" is + * allowed. * @param managementGroupName Management group name. * @param top Maximum number of records to return. * @param orderBy Ordering expression using OData notation. One or more comma-separated column names with an @@ -46,10 +52,11 @@ public interface PolicyEventsClient { * @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 query results. + * @return query results as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listQueryResultsForManagementGroup( + PolicyEventsResourceType policyEventsResource, String managementGroupName, Integer top, String orderBy, @@ -64,18 +71,23 @@ PagedIterable listQueryResultsForManagementGroup( /** * Queries policy events for the resources under the subscription. * + * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only "default" is + * allowed. * @param subscriptionId Microsoft Azure subscription 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 query results. + * @return query results as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listQueryResultsForSubscription(String subscriptionId); + PagedIterable listQueryResultsForSubscription( + PolicyEventsResourceType policyEventsResource, String subscriptionId); /** * Queries policy events for the resources under the subscription. * + * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only "default" is + * allowed. * @param subscriptionId Microsoft Azure subscription ID. * @param top Maximum number of records to return. * @param orderBy Ordering expression using OData notation. One or more comma-separated column names with an @@ -94,10 +106,11 @@ PagedIterable listQueryResultsForManagementGroup( * @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 query results. + * @return query results as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listQueryResultsForSubscription( + PolicyEventsResourceType policyEventsResource, String subscriptionId, Integer top, String orderBy, @@ -112,19 +125,24 @@ PagedIterable listQueryResultsForSubscription( /** * Queries policy events for the resources under the resource group. * + * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only "default" is + * allowed. * @param subscriptionId Microsoft Azure subscription ID. * @param resourceGroupName Resource group name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listQueryResultsForResourceGroup(String subscriptionId, String resourceGroupName); + PagedIterable listQueryResultsForResourceGroup( + PolicyEventsResourceType policyEventsResource, String subscriptionId, String resourceGroupName); /** * Queries policy events for the resources under the resource group. * + * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only "default" is + * allowed. * @param subscriptionId Microsoft Azure subscription ID. * @param resourceGroupName Resource group name. * @param top Maximum number of records to return. @@ -144,10 +162,11 @@ PagedIterable listQueryResultsForSubscription( * @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 query results. + * @return query results as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listQueryResultsForResourceGroup( + PolicyEventsResourceType policyEventsResource, String subscriptionId, String resourceGroupName, Integer top, @@ -163,18 +182,23 @@ PagedIterable listQueryResultsForResourceGroup( /** * Queries policy events for the resource. * + * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only "default" is + * allowed. * @param resourceId 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 query results. + * @return query results as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listQueryResultsForResource(String resourceId); + PagedIterable listQueryResultsForResource( + PolicyEventsResourceType policyEventsResource, String resourceId); /** * Queries policy events for the resource. * + * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only "default" is + * allowed. * @param resourceId Resource ID. * @param top Maximum number of records to return. * @param orderBy Ordering expression using OData notation. One or more comma-separated column names with an @@ -194,10 +218,11 @@ PagedIterable listQueryResultsForResourceGroup( * @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 query results. + * @return query results as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listQueryResultsForResource( + PolicyEventsResourceType policyEventsResource, String resourceId, Integer top, String orderBy, @@ -213,20 +238,24 @@ PagedIterable listQueryResultsForResource( /** * Queries policy events for the subscription level policy set definition. * + * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only "default" is + * allowed. * @param subscriptionId Microsoft Azure subscription ID. * @param policySetDefinitionName Policy set definition name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listQueryResultsForPolicySetDefinition( - String subscriptionId, String policySetDefinitionName); + PolicyEventsResourceType policyEventsResource, String subscriptionId, String policySetDefinitionName); /** * Queries policy events for the subscription level policy set definition. * + * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only "default" is + * allowed. * @param subscriptionId Microsoft Azure subscription ID. * @param policySetDefinitionName Policy set definition name. * @param top Maximum number of records to return. @@ -246,10 +275,11 @@ PagedIterable listQueryResultsForPolicySetDefinition( * @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 query results. + * @return query results as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listQueryResultsForPolicySetDefinition( + PolicyEventsResourceType policyEventsResource, String subscriptionId, String policySetDefinitionName, Integer top, @@ -265,20 +295,24 @@ PagedIterable listQueryResultsForPolicySetDefinition( /** * Queries policy events for the subscription level policy definition. * + * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only "default" is + * allowed. * @param subscriptionId Microsoft Azure subscription ID. * @param policyDefinitionName Policy definition name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listQueryResultsForPolicyDefinition( - String subscriptionId, String policyDefinitionName); + PolicyEventsResourceType policyEventsResource, String subscriptionId, String policyDefinitionName); /** * Queries policy events for the subscription level policy definition. * + * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only "default" is + * allowed. * @param subscriptionId Microsoft Azure subscription ID. * @param policyDefinitionName Policy definition name. * @param top Maximum number of records to return. @@ -298,10 +332,11 @@ PagedIterable listQueryResultsForPolicyDefinition( * @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 query results. + * @return query results as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listQueryResultsForPolicyDefinition( + PolicyEventsResourceType policyEventsResource, String subscriptionId, String policyDefinitionName, Integer top, @@ -317,20 +352,24 @@ PagedIterable listQueryResultsForPolicyDefinition( /** * Queries policy events for the subscription level policy assignment. * + * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only "default" is + * allowed. * @param subscriptionId Microsoft Azure subscription ID. * @param policyAssignmentName Policy assignment name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listQueryResultsForSubscriptionLevelPolicyAssignment( - String subscriptionId, String policyAssignmentName); + PolicyEventsResourceType policyEventsResource, String subscriptionId, String policyAssignmentName); /** * Queries policy events for the subscription level policy assignment. * + * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only "default" is + * allowed. * @param subscriptionId Microsoft Azure subscription ID. * @param policyAssignmentName Policy assignment name. * @param top Maximum number of records to return. @@ -350,10 +389,11 @@ PagedIterable listQueryResultsForSubscriptionLevelPolicyAssign * @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 query results. + * @return query results as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listQueryResultsForSubscriptionLevelPolicyAssignment( + PolicyEventsResourceType policyEventsResource, String subscriptionId, String policyAssignmentName, Integer top, @@ -369,21 +409,28 @@ PagedIterable listQueryResultsForSubscriptionLevelPolicyAssign /** * Queries policy events for the resource group level policy assignment. * + * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only "default" is + * allowed. * @param subscriptionId Microsoft Azure subscription ID. * @param resourceGroupName Resource group name. * @param policyAssignmentName Policy assignment name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listQueryResultsForResourceGroupLevelPolicyAssignment( - String subscriptionId, String resourceGroupName, String policyAssignmentName); + PolicyEventsResourceType policyEventsResource, + String subscriptionId, + String resourceGroupName, + String policyAssignmentName); /** * Queries policy events for the resource group level policy assignment. * + * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only "default" is + * allowed. * @param subscriptionId Microsoft Azure subscription ID. * @param resourceGroupName Resource group name. * @param policyAssignmentName Policy assignment name. @@ -404,10 +451,11 @@ PagedIterable listQueryResultsForResourceGroupLevelPolicyAssig * @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 query results. + * @return query results as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listQueryResultsForResourceGroupLevelPolicyAssignment( + PolicyEventsResourceType policyEventsResource, String subscriptionId, String resourceGroupName, String policyAssignmentName, diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/fluent/PolicyMetadatasClient.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/fluent/PolicyMetadatasClient.java index 9a2b70311eaa..50215392d46b 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/fluent/PolicyMetadatasClient.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/fluent/PolicyMetadatasClient.java @@ -34,7 +34,7 @@ public interface PolicyMetadatasClient { * @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 policy metadata resource. + * @return policy metadata resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getResourceWithResponse(String resourceName, Context context); @@ -44,7 +44,7 @@ public interface PolicyMetadatasClient { * * @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 the policy metadata resources. + * @return a list of the policy metadata resources as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(); @@ -57,7 +57,7 @@ public interface PolicyMetadatasClient { * @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 the policy metadata resources. + * @return a list of the policy metadata resources as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(Integer top, Context context); diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/fluent/PolicyRestrictionsClient.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/fluent/PolicyRestrictionsClient.java index a08ccecbf477..b3a85082a49f 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/fluent/PolicyRestrictionsClient.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/fluent/PolicyRestrictionsClient.java @@ -9,6 +9,7 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; import com.azure.resourcemanager.policyinsights.fluent.models.CheckRestrictionsResultInner; +import com.azure.resourcemanager.policyinsights.models.CheckManagementGroupRestrictionsRequest; import com.azure.resourcemanager.policyinsights.models.CheckRestrictionsRequest; /** An instance of this class provides access to all the operations defined in PolicyRestrictionsClient. */ @@ -33,7 +34,7 @@ public interface PolicyRestrictionsClient { * @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 result of a check policy restrictions evaluation on a resource. + * @return the result of a check policy restrictions evaluation on a resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response checkAtSubscriptionScopeWithResponse( @@ -64,9 +65,38 @@ CheckRestrictionsResultInner checkAtResourceGroupScope( * @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 result of a check policy restrictions evaluation on a resource. + * @return the result of a check policy restrictions evaluation on a resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response checkAtResourceGroupScopeWithResponse( String resourceGroupName, CheckRestrictionsRequest parameters, Context context); + + /** + * Checks what restrictions Azure Policy will place on resources within a management group. + * + * @param managementGroupId Management group ID. + * @param parameters The check policy restrictions parameters. + * @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 result of a check policy restrictions evaluation on a resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CheckRestrictionsResultInner checkAtManagementGroupScope( + String managementGroupId, CheckManagementGroupRestrictionsRequest parameters); + + /** + * Checks what restrictions Azure Policy will place on resources within a management group. + * + * @param managementGroupId Management group ID. + * @param parameters The check policy restrictions parameters. + * @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 result of a check policy restrictions evaluation on a resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response checkAtManagementGroupScopeWithResponse( + String managementGroupId, CheckManagementGroupRestrictionsRequest parameters, Context context); } diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/fluent/PolicyStatesClient.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/fluent/PolicyStatesClient.java index 174231c66d88..0225dda114a6 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/fluent/PolicyStatesClient.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/fluent/PolicyStatesClient.java @@ -14,6 +14,7 @@ import com.azure.resourcemanager.policyinsights.fluent.models.PolicyStateInner; import com.azure.resourcemanager.policyinsights.fluent.models.SummarizeResultsInner; import com.azure.resourcemanager.policyinsights.models.PolicyStatesResource; +import com.azure.resourcemanager.policyinsights.models.PolicyStatesSummaryResourceType; import java.time.OffsetDateTime; /** An instance of this class provides access to all the operations defined in PolicyStatesClient. */ @@ -27,7 +28,7 @@ public interface PolicyStatesClient { * @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 query results. + * @return query results as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listQueryResultsForManagementGroup( @@ -56,7 +57,7 @@ PagedIterable listQueryResultsForManagementGroup( * @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 query results. + * @return query results as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listQueryResultsForManagementGroup( @@ -75,6 +76,8 @@ PagedIterable listQueryResultsForManagementGroup( /** * Summarizes policy states for the resources under the management group. * + * @param policyStatesSummaryResource The virtual resource under PolicyStates resource type for summarize action. In + * a given time range, 'latest' represents the latest policy state(s) and is the only allowed value. * @param managementGroupName Management group name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -82,11 +85,14 @@ PagedIterable listQueryResultsForManagementGroup( * @return summarize action results. */ @ServiceMethod(returns = ReturnType.SINGLE) - SummarizeResultsInner summarizeForManagementGroup(String managementGroupName); + SummarizeResultsInner summarizeForManagementGroup( + PolicyStatesSummaryResourceType policyStatesSummaryResource, String managementGroupName); /** * Summarizes policy states for the resources under the management group. * + * @param policyStatesSummaryResource The virtual resource under PolicyStates resource type for summarize action. In + * a given time range, 'latest' represents the latest policy state(s) and is the only allowed value. * @param managementGroupName Management group name. * @param top Maximum number of records to return. * @param from ISO 8601 formatted timestamp specifying the start time of the interval to query. When not specified, @@ -98,10 +104,11 @@ PagedIterable listQueryResultsForManagementGroup( * @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 summarize action results. + * @return summarize action results along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response summarizeForManagementGroupWithResponse( + PolicyStatesSummaryResourceType policyStatesSummaryResource, String managementGroupName, Integer top, OffsetDateTime from, @@ -118,7 +125,7 @@ Response summarizeForManagementGroupWithResponse( * @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 query results. + * @return query results as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listQueryResultsForSubscription( @@ -147,7 +154,7 @@ PagedIterable listQueryResultsForSubscription( * @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 query results. + * @return query results as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listQueryResultsForSubscription( @@ -166,6 +173,8 @@ PagedIterable listQueryResultsForSubscription( /** * Summarizes policy states for the resources under the subscription. * + * @param policyStatesSummaryResource The virtual resource under PolicyStates resource type for summarize action. In + * a given time range, 'latest' represents the latest policy state(s) and is the only allowed value. * @param subscriptionId Microsoft Azure subscription ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -173,11 +182,14 @@ PagedIterable listQueryResultsForSubscription( * @return summarize action results. */ @ServiceMethod(returns = ReturnType.SINGLE) - SummarizeResultsInner summarizeForSubscription(String subscriptionId); + SummarizeResultsInner summarizeForSubscription( + PolicyStatesSummaryResourceType policyStatesSummaryResource, String subscriptionId); /** * Summarizes policy states for the resources under the subscription. * + * @param policyStatesSummaryResource The virtual resource under PolicyStates resource type for summarize action. In + * a given time range, 'latest' represents the latest policy state(s) and is the only allowed value. * @param subscriptionId Microsoft Azure subscription ID. * @param top Maximum number of records to return. * @param from ISO 8601 formatted timestamp specifying the start time of the interval to query. When not specified, @@ -189,11 +201,17 @@ PagedIterable listQueryResultsForSubscription( * @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 summarize action results. + * @return summarize action results along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response summarizeForSubscriptionWithResponse( - String subscriptionId, Integer top, OffsetDateTime from, OffsetDateTime to, String filter, Context context); + PolicyStatesSummaryResourceType policyStatesSummaryResource, + String subscriptionId, + Integer top, + OffsetDateTime from, + OffsetDateTime to, + String filter, + Context context); /** * Queries policy states for the resources under the resource group. @@ -205,7 +223,7 @@ Response summarizeForSubscriptionWithResponse( * @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 query results. + * @return query results as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listQueryResultsForResourceGroup( @@ -235,7 +253,7 @@ PagedIterable listQueryResultsForResourceGroup( * @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 query results. + * @return query results as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listQueryResultsForResourceGroup( @@ -255,6 +273,8 @@ PagedIterable listQueryResultsForResourceGroup( /** * Summarizes policy states for the resources under the resource group. * + * @param policyStatesSummaryResource The virtual resource under PolicyStates resource type for summarize action. In + * a given time range, 'latest' represents the latest policy state(s) and is the only allowed value. * @param subscriptionId Microsoft Azure subscription ID. * @param resourceGroupName Resource group name. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -263,11 +283,14 @@ PagedIterable listQueryResultsForResourceGroup( * @return summarize action results. */ @ServiceMethod(returns = ReturnType.SINGLE) - SummarizeResultsInner summarizeForResourceGroup(String subscriptionId, String resourceGroupName); + SummarizeResultsInner summarizeForResourceGroup( + PolicyStatesSummaryResourceType policyStatesSummaryResource, String subscriptionId, String resourceGroupName); /** * Summarizes policy states for the resources under the resource group. * + * @param policyStatesSummaryResource The virtual resource under PolicyStates resource type for summarize action. In + * a given time range, 'latest' represents the latest policy state(s) and is the only allowed value. * @param subscriptionId Microsoft Azure subscription ID. * @param resourceGroupName Resource group name. * @param top Maximum number of records to return. @@ -280,10 +303,11 @@ PagedIterable listQueryResultsForResourceGroup( * @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 summarize action results. + * @return summarize action results along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response summarizeForResourceGroupWithResponse( + PolicyStatesSummaryResourceType policyStatesSummaryResource, String subscriptionId, String resourceGroupName, Integer top, @@ -301,7 +325,7 @@ Response summarizeForResourceGroupWithResponse( * @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 query results. + * @return query results as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listQueryResultsForResource( @@ -331,7 +355,7 @@ PagedIterable listQueryResultsForResource( * @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 query results. + * @return query results as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listQueryResultsForResource( @@ -351,6 +375,8 @@ PagedIterable listQueryResultsForResource( /** * Summarizes policy states for the resource. * + * @param policyStatesSummaryResource The virtual resource under PolicyStates resource type for summarize action. In + * a given time range, 'latest' represents the latest policy state(s) and is the only allowed value. * @param resourceId 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. @@ -358,11 +384,14 @@ PagedIterable listQueryResultsForResource( * @return summarize action results. */ @ServiceMethod(returns = ReturnType.SINGLE) - SummarizeResultsInner summarizeForResource(String resourceId); + SummarizeResultsInner summarizeForResource( + PolicyStatesSummaryResourceType policyStatesSummaryResource, String resourceId); /** * Summarizes policy states for the resource. * + * @param policyStatesSummaryResource The virtual resource under PolicyStates resource type for summarize action. In + * a given time range, 'latest' represents the latest policy state(s) and is the only allowed value. * @param resourceId Resource ID. * @param top Maximum number of records to return. * @param from ISO 8601 formatted timestamp specifying the start time of the interval to query. When not specified, @@ -374,11 +403,17 @@ PagedIterable listQueryResultsForResource( * @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 summarize action results. + * @return summarize action results along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response summarizeForResourceWithResponse( - String resourceId, Integer top, OffsetDateTime from, OffsetDateTime to, String filter, Context context); + PolicyStatesSummaryResourceType policyStatesSummaryResource, + String resourceId, + Integer top, + OffsetDateTime from, + OffsetDateTime to, + String filter, + Context context); /** * Triggers a policy evaluation scan for all the resources under the subscription. @@ -387,7 +422,7 @@ Response summarizeForResourceWithResponse( * @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 completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginTriggerSubscriptionEvaluation(String subscriptionId); @@ -400,7 +435,7 @@ Response summarizeForResourceWithResponse( * @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 completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginTriggerSubscriptionEvaluation(String subscriptionId, Context context); @@ -436,7 +471,7 @@ Response summarizeForResourceWithResponse( * @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 completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginTriggerResourceGroupEvaluation( @@ -451,7 +486,7 @@ SyncPoller, Void> beginTriggerResourceGroupEvaluation( * @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 completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginTriggerResourceGroupEvaluation( @@ -492,7 +527,7 @@ SyncPoller, Void> beginTriggerResourceGroupEvaluation( * @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 query results. + * @return query results as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listQueryResultsForPolicySetDefinition( @@ -522,7 +557,7 @@ PagedIterable listQueryResultsForPolicySetDefinition( * @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 query results. + * @return query results as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listQueryResultsForPolicySetDefinition( @@ -542,6 +577,8 @@ PagedIterable listQueryResultsForPolicySetDefinition( /** * Summarizes policy states for the subscription level policy set definition. * + * @param policyStatesSummaryResource The virtual resource under PolicyStates resource type for summarize action. In + * a given time range, 'latest' represents the latest policy state(s) and is the only allowed value. * @param subscriptionId Microsoft Azure subscription ID. * @param policySetDefinitionName Policy set definition name. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -550,11 +587,16 @@ PagedIterable listQueryResultsForPolicySetDefinition( * @return summarize action results. */ @ServiceMethod(returns = ReturnType.SINGLE) - SummarizeResultsInner summarizeForPolicySetDefinition(String subscriptionId, String policySetDefinitionName); + SummarizeResultsInner summarizeForPolicySetDefinition( + PolicyStatesSummaryResourceType policyStatesSummaryResource, + String subscriptionId, + String policySetDefinitionName); /** * Summarizes policy states for the subscription level policy set definition. * + * @param policyStatesSummaryResource The virtual resource under PolicyStates resource type for summarize action. In + * a given time range, 'latest' represents the latest policy state(s) and is the only allowed value. * @param subscriptionId Microsoft Azure subscription ID. * @param policySetDefinitionName Policy set definition name. * @param top Maximum number of records to return. @@ -567,10 +609,11 @@ PagedIterable listQueryResultsForPolicySetDefinition( * @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 summarize action results. + * @return summarize action results along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response summarizeForPolicySetDefinitionWithResponse( + PolicyStatesSummaryResourceType policyStatesSummaryResource, String subscriptionId, String policySetDefinitionName, Integer top, @@ -589,7 +632,7 @@ Response summarizeForPolicySetDefinitionWithResponse( * @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 query results. + * @return query results as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listQueryResultsForPolicyDefinition( @@ -619,7 +662,7 @@ PagedIterable listQueryResultsForPolicyDefinition( * @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 query results. + * @return query results as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listQueryResultsForPolicyDefinition( @@ -639,6 +682,8 @@ PagedIterable listQueryResultsForPolicyDefinition( /** * Summarizes policy states for the subscription level policy definition. * + * @param policyStatesSummaryResource The virtual resource under PolicyStates resource type for summarize action. In + * a given time range, 'latest' represents the latest policy state(s) and is the only allowed value. * @param subscriptionId Microsoft Azure subscription ID. * @param policyDefinitionName Policy definition name. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -647,11 +692,16 @@ PagedIterable listQueryResultsForPolicyDefinition( * @return summarize action results. */ @ServiceMethod(returns = ReturnType.SINGLE) - SummarizeResultsInner summarizeForPolicyDefinition(String subscriptionId, String policyDefinitionName); + SummarizeResultsInner summarizeForPolicyDefinition( + PolicyStatesSummaryResourceType policyStatesSummaryResource, + String subscriptionId, + String policyDefinitionName); /** * Summarizes policy states for the subscription level policy definition. * + * @param policyStatesSummaryResource The virtual resource under PolicyStates resource type for summarize action. In + * a given time range, 'latest' represents the latest policy state(s) and is the only allowed value. * @param subscriptionId Microsoft Azure subscription ID. * @param policyDefinitionName Policy definition name. * @param top Maximum number of records to return. @@ -664,10 +714,11 @@ PagedIterable listQueryResultsForPolicyDefinition( * @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 summarize action results. + * @return summarize action results along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response summarizeForPolicyDefinitionWithResponse( + PolicyStatesSummaryResourceType policyStatesSummaryResource, String subscriptionId, String policyDefinitionName, Integer top, @@ -686,7 +737,7 @@ Response summarizeForPolicyDefinitionWithResponse( * @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 query results. + * @return query results as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listQueryResultsForSubscriptionLevelPolicyAssignment( @@ -716,7 +767,7 @@ PagedIterable listQueryResultsForSubscriptionLevelPolicyAssign * @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 query results. + * @return query results as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listQueryResultsForSubscriptionLevelPolicyAssignment( @@ -736,6 +787,8 @@ PagedIterable listQueryResultsForSubscriptionLevelPolicyAssign /** * Summarizes policy states for the subscription level policy assignment. * + * @param policyStatesSummaryResource The virtual resource under PolicyStates resource type for summarize action. In + * a given time range, 'latest' represents the latest policy state(s) and is the only allowed value. * @param subscriptionId Microsoft Azure subscription ID. * @param policyAssignmentName Policy assignment name. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -745,11 +798,15 @@ PagedIterable listQueryResultsForSubscriptionLevelPolicyAssign */ @ServiceMethod(returns = ReturnType.SINGLE) SummarizeResultsInner summarizeForSubscriptionLevelPolicyAssignment( - String subscriptionId, String policyAssignmentName); + PolicyStatesSummaryResourceType policyStatesSummaryResource, + String subscriptionId, + String policyAssignmentName); /** * Summarizes policy states for the subscription level policy assignment. * + * @param policyStatesSummaryResource The virtual resource under PolicyStates resource type for summarize action. In + * a given time range, 'latest' represents the latest policy state(s) and is the only allowed value. * @param subscriptionId Microsoft Azure subscription ID. * @param policyAssignmentName Policy assignment name. * @param top Maximum number of records to return. @@ -762,10 +819,11 @@ SummarizeResultsInner summarizeForSubscriptionLevelPolicyAssignment( * @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 summarize action results. + * @return summarize action results along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response summarizeForSubscriptionLevelPolicyAssignmentWithResponse( + PolicyStatesSummaryResourceType policyStatesSummaryResource, String subscriptionId, String policyAssignmentName, Integer top, @@ -785,7 +843,7 @@ Response summarizeForSubscriptionLevelPolicyAssignmentWit * @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 query results. + * @return query results as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listQueryResultsForResourceGroupLevelPolicyAssignment( @@ -819,7 +877,7 @@ PagedIterable listQueryResultsForResourceGroupLevelPolicyAssig * @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 query results. + * @return query results as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listQueryResultsForResourceGroupLevelPolicyAssignment( @@ -840,6 +898,8 @@ PagedIterable listQueryResultsForResourceGroupLevelPolicyAssig /** * Summarizes policy states for the resource group level policy assignment. * + * @param policyStatesSummaryResource The virtual resource under PolicyStates resource type for summarize action. In + * a given time range, 'latest' represents the latest policy state(s) and is the only allowed value. * @param subscriptionId Microsoft Azure subscription ID. * @param resourceGroupName Resource group name. * @param policyAssignmentName Policy assignment name. @@ -850,11 +910,16 @@ PagedIterable listQueryResultsForResourceGroupLevelPolicyAssig */ @ServiceMethod(returns = ReturnType.SINGLE) SummarizeResultsInner summarizeForResourceGroupLevelPolicyAssignment( - String subscriptionId, String resourceGroupName, String policyAssignmentName); + PolicyStatesSummaryResourceType policyStatesSummaryResource, + String subscriptionId, + String resourceGroupName, + String policyAssignmentName); /** * Summarizes policy states for the resource group level policy assignment. * + * @param policyStatesSummaryResource The virtual resource under PolicyStates resource type for summarize action. In + * a given time range, 'latest' represents the latest policy state(s) and is the only allowed value. * @param subscriptionId Microsoft Azure subscription ID. * @param resourceGroupName Resource group name. * @param policyAssignmentName Policy assignment name. @@ -868,10 +933,11 @@ SummarizeResultsInner summarizeForResourceGroupLevelPolicyAssignment( * @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 summarize action results. + * @return summarize action results along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response summarizeForResourceGroupLevelPolicyAssignmentWithResponse( + PolicyStatesSummaryResourceType policyStatesSummaryResource, String subscriptionId, String resourceGroupName, String policyAssignmentName, diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/fluent/PolicyTrackedResourcesClient.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/fluent/PolicyTrackedResourcesClient.java index b5d666030045..4c2fde558440 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/fluent/PolicyTrackedResourcesClient.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/fluent/PolicyTrackedResourcesClient.java @@ -9,6 +9,7 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.util.Context; import com.azure.resourcemanager.policyinsights.fluent.models.PolicyTrackedResourceInner; +import com.azure.resourcemanager.policyinsights.models.PolicyTrackedResourcesResourceType; /** An instance of this class provides access to all the operations defined in PolicyTrackedResourcesClient. */ public interface PolicyTrackedResourcesClient { @@ -16,108 +17,141 @@ public interface PolicyTrackedResourcesClient { * Queries policy tracked resources under the management group. * * @param managementGroupName Management group name. + * @param policyTrackedResourcesResource The name of the virtual resource under PolicyTrackedResources resource + * type; only "default" is allowed. * @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 query results. + * @return query results as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listQueryResultsForManagementGroup(String managementGroupName); + PagedIterable listQueryResultsForManagementGroup( + String managementGroupName, PolicyTrackedResourcesResourceType policyTrackedResourcesResource); /** * Queries policy tracked resources under the management group. * * @param managementGroupName Management group name. + * @param policyTrackedResourcesResource The name of the virtual resource under PolicyTrackedResources resource + * type; only "default" is allowed. * @param top Maximum number of records to return. * @param filter OData filter expression. * @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 query results. + * @return query results as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listQueryResultsForManagementGroup( - String managementGroupName, Integer top, String filter, Context context); + String managementGroupName, + PolicyTrackedResourcesResourceType policyTrackedResourcesResource, + Integer top, + String filter, + Context context); /** * Queries policy tracked resources under the subscription. * + * @param policyTrackedResourcesResource The name of the virtual resource under PolicyTrackedResources resource + * type; only "default" is allowed. + * @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 query results. + * @return query results as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listQueryResultsForSubscription(); + PagedIterable listQueryResultsForSubscription( + PolicyTrackedResourcesResourceType policyTrackedResourcesResource); /** * Queries policy tracked resources under the subscription. * + * @param policyTrackedResourcesResource The name of the virtual resource under PolicyTrackedResources resource + * type; only "default" is allowed. * @param top Maximum number of records to return. * @param filter OData filter expression. * @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 query results. + * @return query results as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listQueryResultsForSubscription( - Integer top, String filter, Context context); + PolicyTrackedResourcesResourceType policyTrackedResourcesResource, Integer top, String filter, Context context); /** * Queries policy tracked resources under the resource group. * * @param resourceGroupName Resource group name. + * @param policyTrackedResourcesResource The name of the virtual resource under PolicyTrackedResources resource + * type; only "default" is allowed. * @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 query results. + * @return query results as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listQueryResultsForResourceGroup(String resourceGroupName); + PagedIterable listQueryResultsForResourceGroup( + String resourceGroupName, PolicyTrackedResourcesResourceType policyTrackedResourcesResource); /** * Queries policy tracked resources under the resource group. * * @param resourceGroupName Resource group name. + * @param policyTrackedResourcesResource The name of the virtual resource under PolicyTrackedResources resource + * type; only "default" is allowed. * @param top Maximum number of records to return. * @param filter OData filter expression. * @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 query results. + * @return query results as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listQueryResultsForResourceGroup( - String resourceGroupName, Integer top, String filter, Context context); + String resourceGroupName, + PolicyTrackedResourcesResourceType policyTrackedResourcesResource, + Integer top, + String filter, + Context context); /** * Queries policy tracked resources under the resource. * * @param resourceId Resource ID. + * @param policyTrackedResourcesResource The name of the virtual resource under PolicyTrackedResources resource + * type; only "default" is allowed. * @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 query results. + * @return query results as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listQueryResultsForResource(String resourceId); + PagedIterable listQueryResultsForResource( + String resourceId, PolicyTrackedResourcesResourceType policyTrackedResourcesResource); /** * Queries policy tracked resources under the resource. * * @param resourceId Resource ID. + * @param policyTrackedResourcesResource The name of the virtual resource under PolicyTrackedResources resource + * type; only "default" is allowed. * @param top Maximum number of records to return. * @param filter OData filter expression. * @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 query results. + * @return query results as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listQueryResultsForResource( - String resourceId, Integer top, String filter, Context context); + String resourceId, + PolicyTrackedResourcesResourceType policyTrackedResourcesResource, + Integer top, + String filter, + Context context); } diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/fluent/RemediationsClient.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/fluent/RemediationsClient.java index 9e0e7fcaf5b8..14fc4d02baac 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/fluent/RemediationsClient.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/fluent/RemediationsClient.java @@ -22,7 +22,8 @@ public interface RemediationsClient { * @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 all deployments for a remediation at management group scope. + * @return all deployments for a remediation at management group scope as paginated response with {@link + * PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listDeploymentsAtManagementGroup( @@ -38,7 +39,8 @@ PagedIterable listDeploymentsAtManagementGroup( * @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 all deployments for a remediation at management group scope. + * @return all deployments for a remediation at management group scope as paginated response with {@link + * PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listDeploymentsAtManagementGroup( @@ -66,7 +68,7 @@ PagedIterable listDeploymentsAtManagementGroup( * @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 remediation definition. + * @return the remediation definition along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response cancelAtManagementGroupWithResponse( @@ -79,7 +81,7 @@ Response cancelAtManagementGroupWithResponse( * @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 all remediations for the management group. + * @return all remediations for the management group as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listForManagementGroup(String managementGroupId); @@ -94,7 +96,7 @@ Response cancelAtManagementGroupWithResponse( * @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 all remediations for the management group. + * @return all remediations for the management group as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listForManagementGroup( @@ -125,7 +127,7 @@ RemediationInner createOrUpdateAtManagementGroup( * @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 remediation definition. + * @return the remediation definition along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response createOrUpdateAtManagementGroupWithResponse( @@ -153,7 +155,7 @@ Response createOrUpdateAtManagementGroupWithResponse( * @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 an existing remediation at management group scope. + * @return an existing remediation at management group scope along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getAtManagementGroupWithResponse( @@ -181,7 +183,7 @@ Response getAtManagementGroupWithResponse( * @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 remediation definition. + * @return the remediation definition along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response deleteAtManagementGroupWithResponse( @@ -194,7 +196,7 @@ Response deleteAtManagementGroupWithResponse( * @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 all deployments for a remediation at subscription scope. + * @return all deployments for a remediation at subscription scope as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listDeploymentsAtSubscription(String remediationName); @@ -208,7 +210,7 @@ Response deleteAtManagementGroupWithResponse( * @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 all deployments for a remediation at subscription scope. + * @return all deployments for a remediation at subscription scope as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listDeploymentsAtSubscription( @@ -234,7 +236,7 @@ PagedIterable listDeploymentsAtSubscription( * @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 remediation definition. + * @return the remediation definition along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response cancelAtSubscriptionWithResponse(String remediationName, Context context); @@ -244,7 +246,7 @@ PagedIterable listDeploymentsAtSubscription( * * @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 all remediations for the subscription. + * @return all remediations for the subscription as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(); @@ -258,7 +260,7 @@ PagedIterable listDeploymentsAtSubscription( * @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 all remediations for the subscription. + * @return all remediations for the subscription as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(Integer top, String filter, Context context); @@ -285,7 +287,7 @@ PagedIterable listDeploymentsAtSubscription( * @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 remediation definition. + * @return the remediation definition along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response createOrUpdateAtSubscriptionWithResponse( @@ -311,7 +313,7 @@ Response createOrUpdateAtSubscriptionWithResponse( * @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 an existing remediation at subscription scope. + * @return an existing remediation at subscription scope along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getAtSubscriptionWithResponse(String remediationName, Context context); @@ -336,7 +338,7 @@ Response createOrUpdateAtSubscriptionWithResponse( * @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 remediation definition. + * @return the remediation definition along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response deleteAtSubscriptionWithResponse(String remediationName, Context context); @@ -349,7 +351,8 @@ Response createOrUpdateAtSubscriptionWithResponse( * @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 all deployments for a remediation at resource group scope. + * @return all deployments for a remediation at resource group scope as paginated response with {@link + * PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listDeploymentsAtResourceGroup( @@ -365,7 +368,8 @@ PagedIterable listDeploymentsAtResourceGroup( * @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 all deployments for a remediation at resource group scope. + * @return all deployments for a remediation at resource group scope as paginated response with {@link + * PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listDeploymentsAtResourceGroup( @@ -393,7 +397,7 @@ PagedIterable listDeploymentsAtResourceGroup( * @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 remediation definition. + * @return the remediation definition along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response cancelAtResourceGroupWithResponse( @@ -406,7 +410,7 @@ Response cancelAtResourceGroupWithResponse( * @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 all remediations for the subscription. + * @return all remediations for the subscription as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByResourceGroup(String resourceGroupName); @@ -421,7 +425,7 @@ Response cancelAtResourceGroupWithResponse( * @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 all remediations for the subscription. + * @return all remediations for the subscription as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByResourceGroup( @@ -452,7 +456,7 @@ RemediationInner createOrUpdateAtResourceGroup( * @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 remediation definition. + * @return the remediation definition along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response createOrUpdateAtResourceGroupWithResponse( @@ -480,7 +484,7 @@ Response createOrUpdateAtResourceGroupWithResponse( * @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 an existing remediation at resource group scope. + * @return an existing remediation at resource group scope along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getByResourceGroupWithResponse( @@ -508,7 +512,7 @@ Response getByResourceGroupWithResponse( * @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 remediation definition. + * @return the remediation definition along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response deleteWithResponse(String resourceGroupName, String remediationName, Context context); @@ -521,7 +525,7 @@ Response getByResourceGroupWithResponse( * @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 all deployments for a remediation at resource scope. + * @return all deployments for a remediation at resource scope as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listDeploymentsAtResource(String resourceId, String remediationName); @@ -536,7 +540,7 @@ Response getByResourceGroupWithResponse( * @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 all deployments for a remediation at resource scope. + * @return all deployments for a remediation at resource scope as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listDeploymentsAtResource( @@ -564,7 +568,7 @@ PagedIterable listDeploymentsAtResource( * @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 remediation definition. + * @return the remediation definition along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response cancelAtResourceWithResponse(String resourceId, String remediationName, Context context); @@ -576,7 +580,7 @@ PagedIterable listDeploymentsAtResource( * @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 all remediations for a resource. + * @return all remediations for a resource as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listForResource(String resourceId); @@ -591,7 +595,7 @@ PagedIterable listDeploymentsAtResource( * @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 all remediations for a resource. + * @return all remediations for a resource as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listForResource(String resourceId, Integer top, String filter, Context context); @@ -620,7 +624,7 @@ PagedIterable listDeploymentsAtResource( * @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 remediation definition. + * @return the remediation definition along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response createOrUpdateAtResourceWithResponse( @@ -648,7 +652,7 @@ Response createOrUpdateAtResourceWithResponse( * @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 an existing remediation at resource scope. + * @return an existing remediation at resource scope along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getAtResourceWithResponse(String resourceId, String remediationName, Context context); @@ -675,7 +679,7 @@ Response createOrUpdateAtResourceWithResponse( * @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 remediation definition. + * @return the remediation definition along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response deleteAtResourceWithResponse(String resourceId, String remediationName, Context context); diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/fluent/models/AttestationInner.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/fluent/models/AttestationInner.java index a449e250c40f..e21d96b22733 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/fluent/models/AttestationInner.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/fluent/models/AttestationInner.java @@ -10,7 +10,6 @@ import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.policyinsights.models.AttestationEvidence; import com.azure.resourcemanager.policyinsights.models.ComplianceState; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; import java.util.List; @@ -18,8 +17,6 @@ /** An attestation resource. */ @Fluent public final class AttestationInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AttestationInner.class); - /* * Properties for the attestation. */ @@ -27,8 +24,7 @@ public final class AttestationInner extends ProxyResource { private AttestationProperties innerProperties = new AttestationProperties(); /* - * Azure Resource Manager metadata containing createdBy and modifiedBy - * information. + * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; @@ -240,6 +236,52 @@ public OffsetDateTime lastComplianceStateChangeAt() { return this.innerProperties() == null ? null : this.innerProperties().lastComplianceStateChangeAt(); } + /** + * Get the assessmentDate property: The time the evidence was assessed. + * + * @return the assessmentDate value. + */ + public OffsetDateTime assessmentDate() { + return this.innerProperties() == null ? null : this.innerProperties().assessmentDate(); + } + + /** + * Set the assessmentDate property: The time the evidence was assessed. + * + * @param assessmentDate the assessmentDate value to set. + * @return the AttestationInner object itself. + */ + public AttestationInner withAssessmentDate(OffsetDateTime assessmentDate) { + if (this.innerProperties() == null) { + this.innerProperties = new AttestationProperties(); + } + this.innerProperties().withAssessmentDate(assessmentDate); + return this; + } + + /** + * Get the metadata property: Additional metadata for this attestation. + * + * @return the metadata value. + */ + public Object metadata() { + return this.innerProperties() == null ? null : this.innerProperties().metadata(); + } + + /** + * Set the metadata property: Additional metadata for this attestation. + * + * @param metadata the metadata value to set. + * @return the AttestationInner object itself. + */ + public AttestationInner withMetadata(Object metadata) { + if (this.innerProperties() == null) { + this.innerProperties = new AttestationProperties(); + } + this.innerProperties().withMetadata(metadata); + return this; + } + /** * Validates the instance. * @@ -247,7 +289,7 @@ public OffsetDateTime lastComplianceStateChangeAt() { */ public void validate() { if (innerProperties() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property innerProperties in model AttestationInner")); @@ -255,4 +297,6 @@ public void validate() { innerProperties().validate(); } } + + private static final ClientLogger LOGGER = new ClientLogger(AttestationInner.class); } diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/fluent/models/AttestationProperties.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/fluent/models/AttestationProperties.java index d5cef83d128d..bfa0e761f83f 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/fluent/models/AttestationProperties.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/fluent/models/AttestationProperties.java @@ -8,7 +8,6 @@ import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.policyinsights.models.AttestationEvidence; import com.azure.resourcemanager.policyinsights.models.ComplianceState; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; import java.util.List; @@ -16,21 +15,16 @@ /** The properties of an attestation resource. */ @Fluent public final class AttestationProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AttestationProperties.class); - /* - * The resource ID of the policy assignment that the attestation is setting - * the state for. + * The resource ID of the policy assignment that the attestation is setting the state for. */ @JsonProperty(value = "policyAssignmentId", required = true) private String policyAssignmentId; /* - * The policy definition reference ID from a policy set definition that the - * attestation is setting the state for. If the policy assignment assigns a - * policy set definition the attestation can choose a definition within the - * set definition with this property or omit this and set the state for the - * entire set definition. + * The policy definition reference ID from a policy set definition that the attestation is setting the state for. + * If the policy assignment assigns a policy set definition the attestation can choose a definition within the set + * definition with this property or omit this and set the state for the entire set definition. */ @JsonProperty(value = "policyDefinitionReferenceId") private String policyDefinitionReferenceId; @@ -48,8 +42,8 @@ public final class AttestationProperties { private OffsetDateTime expiresOn; /* - * The person responsible for setting the state of the resource. This value - * is typically an Azure Active Directory object ID. + * The person responsible for setting the state of the resource. This value is typically an Azure Active Directory + * object ID. */ @JsonProperty(value = "owner") private String owner; @@ -78,6 +72,18 @@ public final class AttestationProperties { @JsonProperty(value = "lastComplianceStateChangeAt", access = JsonProperty.Access.WRITE_ONLY) private OffsetDateTime lastComplianceStateChangeAt; + /* + * The time the evidence was assessed + */ + @JsonProperty(value = "assessmentDate") + private OffsetDateTime assessmentDate; + + /* + * Additional metadata for this attestation + */ + @JsonProperty(value = "metadata") + private Object metadata; + /** * Get the policyAssignmentId property: The resource ID of the policy assignment that the attestation is setting the * state for. @@ -246,6 +252,46 @@ public OffsetDateTime lastComplianceStateChangeAt() { return this.lastComplianceStateChangeAt; } + /** + * Get the assessmentDate property: The time the evidence was assessed. + * + * @return the assessmentDate value. + */ + public OffsetDateTime assessmentDate() { + return this.assessmentDate; + } + + /** + * Set the assessmentDate property: The time the evidence was assessed. + * + * @param assessmentDate the assessmentDate value to set. + * @return the AttestationProperties object itself. + */ + public AttestationProperties withAssessmentDate(OffsetDateTime assessmentDate) { + this.assessmentDate = assessmentDate; + return this; + } + + /** + * Get the metadata property: Additional metadata for this attestation. + * + * @return the metadata value. + */ + public Object metadata() { + return this.metadata; + } + + /** + * Set the metadata property: Additional metadata for this attestation. + * + * @param metadata the metadata value to set. + * @return the AttestationProperties object itself. + */ + public AttestationProperties withMetadata(Object metadata) { + this.metadata = metadata; + return this; + } + /** * Validates the instance. * @@ -253,7 +299,7 @@ public OffsetDateTime lastComplianceStateChangeAt() { */ public void validate() { if (policyAssignmentId() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property policyAssignmentId in model AttestationProperties")); @@ -262,4 +308,6 @@ public void validate() { evidence().forEach(e -> e.validate()); } } + + private static final ClientLogger LOGGER = new ClientLogger(AttestationProperties.class); } diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/fluent/models/CheckRestrictionsResultInner.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/fluent/models/CheckRestrictionsResultInner.java index 70ec0ae7e3b4..bb65659b0f7f 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/fluent/models/CheckRestrictionsResultInner.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/fluent/models/CheckRestrictionsResultInner.java @@ -5,21 +5,16 @@ package com.azure.resourcemanager.policyinsights.fluent.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.policyinsights.models.CheckRestrictionsResultContentEvaluationResult; import com.azure.resourcemanager.policyinsights.models.FieldRestrictions; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** The result of a check policy restrictions evaluation on a resource. */ @Immutable public final class CheckRestrictionsResultInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(CheckRestrictionsResultInner.class); - /* - * The restrictions that will be placed on various fields in the resource - * by policy. + * The restrictions that will be placed on various fields in the resource by policy. */ @JsonProperty(value = "fieldRestrictions", access = JsonProperty.Access.WRITE_ONLY) private List fieldRestrictions; diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/fluent/models/OperationsListResultsInner.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/fluent/models/OperationsListResultsInner.java index dc796d05fa03..aa2a6285c37b 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/fluent/models/OperationsListResultsInner.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/fluent/models/OperationsListResultsInner.java @@ -5,17 +5,13 @@ package com.azure.resourcemanager.policyinsights.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.policyinsights.models.Operation; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** List of available operations. */ @Fluent public final class OperationsListResultsInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationsListResultsInner.class); - /* * OData entity count; represents the number of operations returned. */ diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/fluent/models/PolicyEventInner.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/fluent/models/PolicyEventInner.java index 06aced09743c..70a2bf276786 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/fluent/models/PolicyEventInner.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/fluent/models/PolicyEventInner.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.policyinsights.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.policyinsights.models.ComponentEventDetails; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -19,18 +18,14 @@ /** Policy event record. */ @Fluent public final class PolicyEventInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PolicyEventInner.class); - /* - * OData entity ID; always set to null since policy event records do not - * have an entity ID. + * OData entity ID; always set to null since policy event records do not have an entity ID. */ @JsonProperty(value = "@odata.id") private String odataId; /* - * OData context string; used by OData clients to resolve type information - * based on metadata. + * OData context string; used by OData clients to resolve type information based on metadata. */ @JsonProperty(value = "@odata.context") private String odataContext; @@ -66,8 +61,7 @@ public final class PolicyEventInner { private String effectiveParameters; /* - * Flag which states whether the resource is compliant against the policy - * assignment it was evaluated against. + * Flag which states whether the resource is compliant against the policy assignment it was evaluated against. */ @JsonProperty(value = "isCompliant") private Boolean isCompliant; @@ -151,43 +145,38 @@ public final class PolicyEventInner { private String policySetDefinitionId; /* - * Policy set definition name, if the policy assignment is for a policy - * set. + * Policy set definition name, if the policy assignment is for a policy set. */ @JsonProperty(value = "policySetDefinitionName") private String policySetDefinitionName; /* - * Policy set definition owner, if the policy assignment is for a policy - * set. + * Policy set definition owner, if the policy assignment is for a policy set. */ @JsonProperty(value = "policySetDefinitionOwner") private String policySetDefinitionOwner; /* - * Policy set definition category, if the policy assignment is for a policy - * set. + * Policy set definition category, if the policy assignment is for a policy set. */ @JsonProperty(value = "policySetDefinitionCategory") private String policySetDefinitionCategory; /* - * Policy set definition parameters, if the policy assignment is for a - * policy set. + * Policy set definition parameters, if the policy assignment is for a policy set. */ @JsonProperty(value = "policySetDefinitionParameters") private String policySetDefinitionParameters; /* - * Comma separated list of management group IDs, which represent the - * hierarchy of the management groups the resource is under. + * Comma separated list of management group IDs, which represent the hierarchy of the management groups the + * resource is under. */ @JsonProperty(value = "managementGroupIds") private String managementGroupIds; /* - * Reference ID for the policy definition inside the policy set, if the - * policy assignment is for a policy set. + * Reference ID for the policy definition inside the policy set, if the policy assignment is for a policy set. */ @JsonProperty(value = "policyDefinitionReferenceId") private String policyDefinitionReferenceId; @@ -205,15 +194,13 @@ public final class PolicyEventInner { private String tenantId; /* - * Principal object ID for the user who initiated the resource operation - * that triggered the policy event. + * Principal object ID for the user who initiated the resource operation that triggered the policy event. */ @JsonProperty(value = "principalOid") private String principalOid; /* - * Components events records populated only when URL contains - * $expand=components clause. + * Components events records populated only when URL contains $expand=components clause. */ @JsonProperty(value = "components") private List components; diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/fluent/models/PolicyMetadataInner.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/fluent/models/PolicyMetadataInner.java index a98066f53746..7a19ceb2db15 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/fluent/models/PolicyMetadataInner.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/fluent/models/PolicyMetadataInner.java @@ -5,15 +5,11 @@ package com.azure.resourcemanager.policyinsights.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** Policy metadata resource definition. */ @Fluent public final class PolicyMetadataInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PolicyMetadataInner.class); - /* * Properties of the policy metadata. */ diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/fluent/models/PolicyMetadataProperties.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/fluent/models/PolicyMetadataProperties.java index 0f2769e9e4c4..fd17e61cda65 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/fluent/models/PolicyMetadataProperties.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/fluent/models/PolicyMetadataProperties.java @@ -5,15 +5,11 @@ package com.azure.resourcemanager.policyinsights.fluent.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** The properties of the policy metadata. */ @Immutable public final class PolicyMetadataProperties extends PolicyMetadataSlimProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PolicyMetadataProperties.class); - /* * The description of the policy metadata. */ diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/fluent/models/PolicyMetadataSlimProperties.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/fluent/models/PolicyMetadataSlimProperties.java index b493ad2333d0..ca2b46f1cbce 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/fluent/models/PolicyMetadataSlimProperties.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/fluent/models/PolicyMetadataSlimProperties.java @@ -5,15 +5,11 @@ package com.azure.resourcemanager.policyinsights.fluent.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** The properties of the policy metadata, excluding properties containing large strings. */ @Immutable public class PolicyMetadataSlimProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PolicyMetadataSlimProperties.class); - /* * The policy metadata identifier. */ diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/fluent/models/PolicyStateInner.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/fluent/models/PolicyStateInner.java index 26d0333302e2..ba8e6eba6c36 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/fluent/models/PolicyStateInner.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/fluent/models/PolicyStateInner.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.policyinsights.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.policyinsights.models.ComponentStateDetails; import com.azure.resourcemanager.policyinsights.models.PolicyEvaluationDetails; import com.fasterxml.jackson.annotation.JsonAnyGetter; @@ -20,18 +19,14 @@ /** Policy state record. */ @Fluent public final class PolicyStateInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PolicyStateInner.class); - /* - * OData entity ID; always set to null since policy state records do not - * have an entity ID. + * OData entity ID; always set to null since policy state records do not have an entity ID. */ @JsonProperty(value = "@odata.id") private String odataId; /* - * OData context string; used by OData clients to resolve type information - * based on metadata. + * OData context string; used by OData clients to resolve type information based on metadata. */ @JsonProperty(value = "@odata.context") private String odataContext; @@ -67,9 +62,8 @@ public final class PolicyStateInner { private String effectiveParameters; /* - * Flag which states whether the resource is compliant against the policy - * assignment it was evaluated against. This property is deprecated; please - * use ComplianceState instead. + * Flag which states whether the resource is compliant against the policy assignment it was evaluated against. This + * property is deprecated; please use ComplianceState instead. */ @JsonProperty(value = "isCompliant") private Boolean isCompliant; @@ -153,43 +147,38 @@ public final class PolicyStateInner { private String policySetDefinitionId; /* - * Policy set definition name, if the policy assignment is for a policy - * set. + * Policy set definition name, if the policy assignment is for a policy set. */ @JsonProperty(value = "policySetDefinitionName") private String policySetDefinitionName; /* - * Policy set definition owner, if the policy assignment is for a policy - * set. + * Policy set definition owner, if the policy assignment is for a policy set. */ @JsonProperty(value = "policySetDefinitionOwner") private String policySetDefinitionOwner; /* - * Policy set definition category, if the policy assignment is for a policy - * set. + * Policy set definition category, if the policy assignment is for a policy set. */ @JsonProperty(value = "policySetDefinitionCategory") private String policySetDefinitionCategory; /* - * Policy set definition parameters, if the policy assignment is for a - * policy set. + * Policy set definition parameters, if the policy assignment is for a policy set. */ @JsonProperty(value = "policySetDefinitionParameters") private String policySetDefinitionParameters; /* - * Comma separated list of management group IDs, which represent the - * hierarchy of the management groups the resource is under. + * Comma separated list of management group IDs, which represent the hierarchy of the management groups the + * resource is under. */ @JsonProperty(value = "managementGroupIds") private String managementGroupIds; /* - * Reference ID for the policy definition inside the policy set, if the - * policy assignment is for a policy set. + * Reference ID for the policy definition inside the policy set, if the policy assignment is for a policy set. */ @JsonProperty(value = "policyDefinitionReferenceId") private String policyDefinitionReferenceId; @@ -213,8 +202,7 @@ public final class PolicyStateInner { private List policyDefinitionGroupNames; /* - * Components state compliance records populated only when URL contains - * $expand=components clause. + * Components state compliance records populated only when URL contains $expand=components clause. */ @JsonProperty(value = "components") private List components; diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/fluent/models/PolicyTrackedResourceInner.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/fluent/models/PolicyTrackedResourceInner.java index 30d61cb870c4..69d28afe1e44 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/fluent/models/PolicyTrackedResourceInner.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/fluent/models/PolicyTrackedResourceInner.java @@ -5,18 +5,14 @@ package com.azure.resourcemanager.policyinsights.fluent.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.policyinsights.models.PolicyDetails; import com.azure.resourcemanager.policyinsights.models.TrackedResourceModificationDetails; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; /** Policy tracked resource record. */ @Immutable public final class PolicyTrackedResourceInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PolicyTrackedResourceInner.class); - /* * The ID of the policy tracked resource. */ @@ -30,15 +26,13 @@ public final class PolicyTrackedResourceInner { private PolicyDetails policyDetails; /* - * The details of the policy triggered deployment that created the tracked - * resource. + * The details of the policy triggered deployment that created the tracked resource. */ @JsonProperty(value = "createdBy", access = JsonProperty.Access.WRITE_ONLY) private TrackedResourceModificationDetails createdBy; /* - * The details of the policy triggered deployment that modified the tracked - * resource. + * The details of the policy triggered deployment that modified the tracked resource. */ @JsonProperty(value = "lastModifiedBy", access = JsonProperty.Access.WRITE_ONLY) private TrackedResourceModificationDetails lastModifiedBy; diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/fluent/models/RemediationDeploymentInner.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/fluent/models/RemediationDeploymentInner.java index ce34b4798317..f2fedde30554 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/fluent/models/RemediationDeploymentInner.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/fluent/models/RemediationDeploymentInner.java @@ -6,16 +6,12 @@ import com.azure.core.annotation.Immutable; import com.azure.core.management.exception.ManagementError; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; /** Details of a single deployment created by the remediation. */ @Immutable public final class RemediationDeploymentInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RemediationDeploymentInner.class); - /* * Resource ID of the resource that is being remediated by the deployment. */ diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/fluent/models/RemediationInner.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/fluent/models/RemediationInner.java index 597536a1d097..db54bd890c89 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/fluent/models/RemediationInner.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/fluent/models/RemediationInner.java @@ -7,20 +7,16 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.policyinsights.models.RemediationDeploymentSummary; import com.azure.resourcemanager.policyinsights.models.RemediationFilters; import com.azure.resourcemanager.policyinsights.models.RemediationPropertiesFailureThreshold; import com.azure.resourcemanager.policyinsights.models.ResourceDiscoveryMode; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; /** The remediation definition. */ @Fluent public final class RemediationInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RemediationInner.class); - /* * Properties for the remediation. */ @@ -28,8 +24,7 @@ public final class RemediationInner extends ProxyResource { private RemediationProperties innerProperties; /* - * Azure Resource Manager metadata containing createdBy and modifiedBy - * information. + * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/fluent/models/RemediationProperties.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/fluent/models/RemediationProperties.java index 65f0de7f1511..9610a6981116 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/fluent/models/RemediationProperties.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/fluent/models/RemediationProperties.java @@ -5,20 +5,16 @@ package com.azure.resourcemanager.policyinsights.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.policyinsights.models.RemediationDeploymentSummary; import com.azure.resourcemanager.policyinsights.models.RemediationFilters; import com.azure.resourcemanager.policyinsights.models.RemediationPropertiesFailureThreshold; import com.azure.resourcemanager.policyinsights.models.ResourceDiscoveryMode; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; /** The remediation properties. */ @Fluent public final class RemediationProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RemediationProperties.class); - /* * The resource ID of the policy assignment that should be remediated. */ @@ -26,16 +22,14 @@ public final class RemediationProperties { private String policyAssignmentId; /* - * The policy definition reference ID of the individual definition that - * should be remediated. Required when the policy assignment being - * remediated assigns a policy set definition. + * The policy definition reference ID of the individual definition that should be remediated. Required when the + * policy assignment being remediated assigns a policy set definition. */ @JsonProperty(value = "policyDefinitionReferenceId") private String policyDefinitionReferenceId; /* - * The way resources to remediate are discovered. Defaults to - * ExistingNonCompliant if not specified. + * The way resources to remediate are discovered. Defaults to ExistingNonCompliant if not specified. */ @JsonProperty(value = "resourceDiscoveryMode") private ResourceDiscoveryMode resourceDiscoveryMode; @@ -59,44 +53,39 @@ public final class RemediationProperties { private OffsetDateTime lastUpdatedOn; /* - * The filters that will be applied to determine which resources to - * remediate. + * The filters that will be applied to determine which resources to remediate. */ @JsonProperty(value = "filters") private RemediationFilters filters; /* - * The deployment status summary for all deployments created by the - * remediation. + * The deployment status summary for all deployments created by the remediation. */ @JsonProperty(value = "deploymentStatus", access = JsonProperty.Access.WRITE_ONLY) private RemediationDeploymentSummary deploymentStatus; /* - * The remediation status message. Provides additional details regarding - * the state of the remediation. + * The remediation status message. Provides additional details regarding the state of the remediation. */ @JsonProperty(value = "statusMessage", access = JsonProperty.Access.WRITE_ONLY) private String statusMessage; /* - * The remediation correlation Id. Can be used to find events related to - * the remediation in the activity log. + * The remediation correlation Id. Can be used to find events related to the remediation in the activity log. */ @JsonProperty(value = "correlationId", access = JsonProperty.Access.WRITE_ONLY) private String correlationId; /* - * Determines the max number of resources that can be remediated by the - * remediation job. If not provided, the default resource count is used. + * Determines the max number of resources that can be remediated by the remediation job. If not provided, the + * default resource count is used. */ @JsonProperty(value = "resourceCount") private Integer resourceCount; /* - * Determines how many resources to remediate at any given time. Can be - * used to increase or reduce the pace of the remediation. If not provided, - * the default parallel deployments value is used. + * Determines how many resources to remediate at any given time. Can be used to increase or reduce the pace of the + * remediation. If not provided, the default parallel deployments value is used. */ @JsonProperty(value = "parallelDeployments") private Integer parallelDeployments; diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/fluent/models/SlimPolicyMetadataInner.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/fluent/models/SlimPolicyMetadataInner.java index df64930f9da9..1ef942f1369e 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/fluent/models/SlimPolicyMetadataInner.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/fluent/models/SlimPolicyMetadataInner.java @@ -5,15 +5,11 @@ package com.azure.resourcemanager.policyinsights.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** Slim version of policy metadata resource definition, excluding properties with large strings. */ @Fluent public final class SlimPolicyMetadataInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SlimPolicyMetadataInner.class); - /* * Properties of the policy metadata. */ diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/fluent/models/SummarizeResultsInner.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/fluent/models/SummarizeResultsInner.java index bb2301c080c5..c6434ce42866 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/fluent/models/SummarizeResultsInner.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/fluent/models/SummarizeResultsInner.java @@ -5,27 +5,21 @@ package com.azure.resourcemanager.policyinsights.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.policyinsights.models.Summary; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** Summarize action results. */ @Fluent public final class SummarizeResultsInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SummarizeResultsInner.class); - /* - * OData context string; used by OData clients to resolve type information - * based on metadata. + * OData context string; used by OData clients to resolve type information based on metadata. */ @JsonProperty(value = "@odata.context") private String odataContext; /* - * OData entity count; represents the number of summaries returned; always - * set to 1. + * OData entity count; represents the number of summaries returned; always set to 1. */ @JsonProperty(value = "@odata.count") private Integer odataCount; diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/implementation/AttestationImpl.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/implementation/AttestationImpl.java index 552246275e4c..8699c693296d 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/implementation/AttestationImpl.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/implementation/AttestationImpl.java @@ -76,6 +76,18 @@ public OffsetDateTime lastComplianceStateChangeAt() { return this.innerModel().lastComplianceStateChangeAt(); } + public OffsetDateTime assessmentDate() { + return this.innerModel().assessmentDate(); + } + + public Object metadata() { + return this.innerModel().metadata(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + public AttestationInner innerModel() { return this.innerObject; } @@ -201,4 +213,14 @@ public AttestationImpl withEvidence(List evidence) { this.innerModel().withEvidence(evidence); return this; } + + public AttestationImpl withAssessmentDate(OffsetDateTime assessmentDate) { + this.innerModel().withAssessmentDate(assessmentDate); + return this; + } + + public AttestationImpl withMetadata(Object metadata) { + this.innerModel().withMetadata(metadata); + return this; + } } diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/implementation/AttestationsClientImpl.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/implementation/AttestationsClientImpl.java index 0d8ac5a09c73..3a2b3fc2dfe0 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/implementation/AttestationsClientImpl.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/implementation/AttestationsClientImpl.java @@ -29,7 +29,6 @@ import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.policyinsights.fluent.AttestationsClient; @@ -41,8 +40,6 @@ /** An instance of this class provides access to all the operations defined in AttestationsClient. */ public final class AttestationsClientImpl implements AttestationsClient { - private final ClientLogger logger = new ClientLogger(AttestationsClientImpl.class); - /** The proxy service used to perform REST calls. */ private final AttestationsService service; @@ -268,7 +265,8 @@ Mono> listForResourceNext( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all attestations for the subscription. + * @return all attestations for the subscription along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(Integer top, String filter) { @@ -284,7 +282,7 @@ private Mono> listSinglePageAsync(Integer top, S new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2021-01-01"; + final String apiVersion = "2022-09-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -319,7 +317,8 @@ private Mono> listSinglePageAsync(Integer top, 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 all attestations for the subscription. + * @return all attestations for the subscription along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(Integer top, String filter, Context context) { @@ -335,7 +334,7 @@ private Mono> listSinglePageAsync(Integer top, S new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2021-01-01"; + final String apiVersion = "2022-09-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -359,7 +358,7 @@ private Mono> listSinglePageAsync(Integer top, 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 all attestations for the subscription. + * @return all attestations for the subscription as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(Integer top, String filter) { @@ -372,7 +371,7 @@ private PagedFlux listAsync(Integer top, String filter) { * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all attestations for the subscription. + * @return all attestations for the subscription as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync() { @@ -391,7 +390,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 all attestations for the subscription. + * @return all attestations for the subscription as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(Integer top, String filter, Context context) { @@ -405,7 +404,7 @@ private PagedFlux listAsync(Integer top, String filter, Contex * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all attestations for the subscription. + * @return all attestations for the subscription as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { @@ -423,7 +422,7 @@ 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 all attestations for the subscription. + * @return all attestations for the subscription as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(Integer top, String filter, Context context) { @@ -438,7 +437,7 @@ public PagedIterable list(Integer top, String filter, 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 an attestation resource. + * @return an attestation resource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateAtSubscriptionWithResponseAsync( @@ -464,7 +463,7 @@ private Mono>> createOrUpdateAtSubscriptionWithRespons } else { parameters.validate(); } - final String apiVersion = "2021-01-01"; + final String apiVersion = "2022-09-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -490,7 +489,7 @@ private Mono>> createOrUpdateAtSubscriptionWithRespons * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an attestation resource. + * @return an attestation resource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateAtSubscriptionWithResponseAsync( @@ -516,7 +515,7 @@ private Mono>> createOrUpdateAtSubscriptionWithRespons } else { parameters.validate(); } - final String apiVersion = "2021-01-01"; + final String apiVersion = "2022-09-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -538,7 +537,7 @@ private Mono>> createOrUpdateAtSubscriptionWithRespons * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an attestation resource. + * @return the {@link PollerFlux} for polling of an attestation resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, AttestationInner> beginCreateOrUpdateAtSubscriptionAsync( @@ -564,7 +563,7 @@ private PollerFlux, AttestationInner> beginCreateOr * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an attestation resource. + * @return the {@link PollerFlux} for polling of an attestation resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, AttestationInner> beginCreateOrUpdateAtSubscriptionAsync( @@ -586,7 +585,7 @@ private PollerFlux, AttestationInner> beginCreateOr * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an attestation resource. + * @return the {@link SyncPoller} for polling of an attestation resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, AttestationInner> beginCreateOrUpdateAtSubscription( @@ -603,7 +602,7 @@ public SyncPoller, AttestationInner> beginCreateOrU * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an attestation resource. + * @return the {@link SyncPoller} for polling of an attestation resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, AttestationInner> beginCreateOrUpdateAtSubscription( @@ -619,7 +618,7 @@ public SyncPoller, AttestationInner> beginCreateOrU * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an attestation resource. + * @return an attestation resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAtSubscriptionAsync( @@ -638,7 +637,7 @@ private Mono createOrUpdateAtSubscriptionAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an attestation resource. + * @return an attestation resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAtSubscriptionAsync( @@ -687,7 +686,8 @@ public AttestationInner createOrUpdateAtSubscription( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an existing attestation at subscription scope. + * @return an existing attestation at subscription scope along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getAtSubscriptionWithResponseAsync(String attestationName) { @@ -707,7 +707,7 @@ private Mono> getAtSubscriptionWithResponseAsync(Stri return Mono .error(new IllegalArgumentException("Parameter attestationName is required and cannot be null.")); } - final String apiVersion = "2021-01-01"; + final String apiVersion = "2022-09-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -731,7 +731,8 @@ private Mono> getAtSubscriptionWithResponseAsync(Stri * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an existing attestation at subscription scope. + * @return an existing attestation at subscription scope along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getAtSubscriptionWithResponseAsync( @@ -752,7 +753,7 @@ private Mono> getAtSubscriptionWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter attestationName is required and cannot be null.")); } - final String apiVersion = "2021-01-01"; + final String apiVersion = "2022-09-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -772,19 +773,11 @@ private Mono> getAtSubscriptionWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an existing attestation at subscription scope. + * @return an existing attestation at subscription scope on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAtSubscriptionAsync(String attestationName) { - return getAtSubscriptionWithResponseAsync(attestationName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + return getAtSubscriptionWithResponseAsync(attestationName).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -809,7 +802,7 @@ public AttestationInner getAtSubscription(String attestationName) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an existing attestation at subscription scope. + * @return an existing attestation at subscription scope along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getAtSubscriptionWithResponse(String attestationName, Context context) { @@ -823,7 +816,7 @@ public Response getAtSubscriptionWithResponse(String attestati * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteAtSubscriptionWithResponseAsync(String attestationName) { @@ -843,7 +836,7 @@ private Mono> deleteAtSubscriptionWithResponseAsync(String attest return Mono .error(new IllegalArgumentException("Parameter attestationName is required and cannot be null.")); } - final String apiVersion = "2021-01-01"; + final String apiVersion = "2022-09-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -867,7 +860,7 @@ private Mono> deleteAtSubscriptionWithResponseAsync(String attest * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteAtSubscriptionWithResponseAsync(String attestationName, Context context) { @@ -887,7 +880,7 @@ private Mono> deleteAtSubscriptionWithResponseAsync(String attest return Mono .error(new IllegalArgumentException("Parameter attestationName is required and cannot be null.")); } - final String apiVersion = "2021-01-01"; + final String apiVersion = "2022-09-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -907,11 +900,11 @@ private Mono> deleteAtSubscriptionWithResponseAsync(String attest * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAtSubscriptionAsync(String attestationName) { - return deleteAtSubscriptionWithResponseAsync(attestationName).flatMap((Response res) -> Mono.empty()); + return deleteAtSubscriptionWithResponseAsync(attestationName).flatMap(ignored -> Mono.empty()); } /** @@ -935,7 +928,7 @@ public void deleteAtSubscription(String attestationName) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 response. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteAtSubscriptionWithResponse(String attestationName, Context context) { @@ -951,7 +944,8 @@ public Response deleteAtSubscriptionWithResponse(String attestationName, C * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all attestations for the resource group. + * @return all attestations for the resource group along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync( @@ -972,7 +966,7 @@ private Mono> listByResourceGroupSinglePageAsync return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - final String apiVersion = "2021-01-01"; + final String apiVersion = "2022-09-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -1009,7 +1003,8 @@ private Mono> listByResourceGroupSinglePageAsync * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all attestations for the resource group. + * @return all attestations for the resource group along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync( @@ -1030,7 +1025,7 @@ private Mono> listByResourceGroupSinglePageAsync return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - final String apiVersion = "2021-01-01"; + final String apiVersion = "2022-09-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -1063,7 +1058,7 @@ private Mono> listByResourceGroupSinglePageAsync * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all attestations for the resource group. + * @return all attestations for the resource group as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName, Integer top, String filter) { @@ -1079,7 +1074,7 @@ private PagedFlux listByResourceGroupAsync(String resourceGrou * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all attestations for the resource group. + * @return all attestations for the resource group as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName) { @@ -1100,7 +1095,7 @@ private PagedFlux listByResourceGroupAsync(String resourceGrou * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all attestations for the resource group. + * @return all attestations for the resource group as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync( @@ -1117,7 +1112,7 @@ private PagedFlux listByResourceGroupAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all attestations for the resource group. + * @return all attestations for the resource group as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String resourceGroupName) { @@ -1136,7 +1131,7 @@ public PagedIterable listByResourceGroup(String resourceGroupN * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all attestations for the resource group. + * @return all attestations for the resource group as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup( @@ -1153,7 +1148,7 @@ public PagedIterable listByResourceGroup( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an attestation resource. + * @return an attestation resource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateAtResourceGroupWithResponseAsync( @@ -1183,7 +1178,7 @@ private Mono>> createOrUpdateAtResourceGroupWithRespon } else { parameters.validate(); } - final String apiVersion = "2021-01-01"; + final String apiVersion = "2022-09-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -1211,7 +1206,7 @@ private Mono>> createOrUpdateAtResourceGroupWithRespon * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an attestation resource. + * @return an attestation resource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateAtResourceGroupWithResponseAsync( @@ -1241,7 +1236,7 @@ private Mono>> createOrUpdateAtResourceGroupWithRespon } else { parameters.validate(); } - final String apiVersion = "2021-01-01"; + final String apiVersion = "2022-09-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -1265,7 +1260,7 @@ private Mono>> createOrUpdateAtResourceGroupWithRespon * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an attestation resource. + * @return the {@link PollerFlux} for polling of an attestation resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, AttestationInner> beginCreateOrUpdateAtResourceGroupAsync( @@ -1292,7 +1287,7 @@ private PollerFlux, AttestationInner> beginCreateOr * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an attestation resource. + * @return the {@link PollerFlux} for polling of an attestation resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, AttestationInner> beginCreateOrUpdateAtResourceGroupAsync( @@ -1315,7 +1310,7 @@ private PollerFlux, AttestationInner> beginCreateOr * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an attestation resource. + * @return the {@link SyncPoller} for polling of an attestation resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, AttestationInner> beginCreateOrUpdateAtResourceGroup( @@ -1333,7 +1328,7 @@ public SyncPoller, AttestationInner> beginCreateOrU * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an attestation resource. + * @return the {@link SyncPoller} for polling of an attestation resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, AttestationInner> beginCreateOrUpdateAtResourceGroup( @@ -1351,7 +1346,7 @@ public SyncPoller, AttestationInner> beginCreateOrU * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an attestation resource. + * @return an attestation resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAtResourceGroupAsync( @@ -1371,7 +1366,7 @@ private Mono createOrUpdateAtResourceGroupAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an attestation resource. + * @return an attestation resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAtResourceGroupAsync( @@ -1424,7 +1419,8 @@ public AttestationInner createOrUpdateAtResourceGroup( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an existing attestation at resource group scope. + * @return an existing attestation at resource group scope along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync( @@ -1449,7 +1445,7 @@ private Mono> getByResourceGroupWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter attestationName is required and cannot be null.")); } - final String apiVersion = "2021-01-01"; + final String apiVersion = "2022-09-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -1475,7 +1471,8 @@ private Mono> getByResourceGroupWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an existing attestation at resource group scope. + * @return an existing attestation at resource group scope along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync( @@ -1500,7 +1497,7 @@ private Mono> getByResourceGroupWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter attestationName is required and cannot be null.")); } - final String apiVersion = "2021-01-01"; + final String apiVersion = "2022-09-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -1522,19 +1519,12 @@ private Mono> getByResourceGroupWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an existing attestation at resource group scope. + * @return an existing attestation at resource group scope on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getByResourceGroupAsync(String resourceGroupName, String attestationName) { return getByResourceGroupWithResponseAsync(resourceGroupName, attestationName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -1561,7 +1551,7 @@ public AttestationInner getByResourceGroup(String resourceGroupName, String atte * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an existing attestation at resource group scope. + * @return an existing attestation at resource group scope along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getByResourceGroupWithResponse( @@ -1577,7 +1567,7 @@ public Response getByResourceGroupWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteWithResponseAsync(String resourceGroupName, String attestationName) { @@ -1601,7 +1591,7 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S return Mono .error(new IllegalArgumentException("Parameter attestationName is required and cannot be null.")); } - final String apiVersion = "2021-01-01"; + final String apiVersion = "2022-09-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -1627,7 +1617,7 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, 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 the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteWithResponseAsync( @@ -1652,7 +1642,7 @@ private Mono> deleteWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter attestationName is required and cannot be null.")); } - final String apiVersion = "2021-01-01"; + final String apiVersion = "2022-09-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -1674,12 +1664,11 @@ private Mono> deleteWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String attestationName) { - return deleteWithResponseAsync(resourceGroupName, attestationName) - .flatMap((Response res) -> Mono.empty()); + return deleteWithResponseAsync(resourceGroupName, attestationName).flatMap(ignored -> Mono.empty()); } /** @@ -1705,7 +1694,7 @@ public void delete(String resourceGroupName, String attestationName) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 response. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteWithResponse(String resourceGroupName, String attestationName, Context context) { @@ -1721,7 +1710,8 @@ public Response deleteWithResponse(String resourceGroupName, String attest * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all attestations for a resource. + * @return all attestations for a resource along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listForResourceSinglePageAsync( @@ -1735,7 +1725,7 @@ private Mono> listForResourceSinglePageAsync( if (resourceId == null) { return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); } - final String apiVersion = "2021-01-01"; + final String apiVersion = "2022-09-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -1765,7 +1755,8 @@ private Mono> listForResourceSinglePageAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all attestations for a resource. + * @return all attestations for a resource along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listForResourceSinglePageAsync( @@ -1779,7 +1770,7 @@ private Mono> listForResourceSinglePageAsync( if (resourceId == null) { return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); } - final String apiVersion = "2021-01-01"; + final String apiVersion = "2022-09-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -1804,7 +1795,7 @@ private Mono> listForResourceSinglePageAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all attestations for a resource. + * @return all attestations for a resource as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listForResourceAsync(String resourceId, Integer top, String filter) { @@ -1820,7 +1811,7 @@ private PagedFlux listForResourceAsync(String resourceId, Inte * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all attestations for a resource. + * @return all attestations for a resource as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listForResourceAsync(String resourceId) { @@ -1841,7 +1832,7 @@ private PagedFlux listForResourceAsync(String resourceId) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all attestations for a resource. + * @return all attestations for a resource as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listForResourceAsync( @@ -1858,7 +1849,7 @@ private PagedFlux listForResourceAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all attestations for a resource. + * @return all attestations for a resource as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listForResource(String resourceId) { @@ -1877,7 +1868,7 @@ public PagedIterable listForResource(String resourceId) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all attestations for a resource. + * @return all attestations for a resource as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listForResource( @@ -1894,7 +1885,7 @@ public PagedIterable listForResource( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an attestation resource. + * @return an attestation resource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateAtResourceWithResponseAsync( @@ -1917,7 +1908,7 @@ private Mono>> createOrUpdateAtResourceWithResponseAsy } else { parameters.validate(); } - final String apiVersion = "2021-01-01"; + final String apiVersion = "2022-09-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -1944,7 +1935,7 @@ private Mono>> createOrUpdateAtResourceWithResponseAsy * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an attestation resource. + * @return an attestation resource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateAtResourceWithResponseAsync( @@ -1967,7 +1958,7 @@ private Mono>> createOrUpdateAtResourceWithResponseAsy } else { parameters.validate(); } - final String apiVersion = "2021-01-01"; + final String apiVersion = "2022-09-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -1984,7 +1975,7 @@ private Mono>> createOrUpdateAtResourceWithResponseAsy * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an attestation resource. + * @return the {@link PollerFlux} for polling of an attestation resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, AttestationInner> beginCreateOrUpdateAtResourceAsync( @@ -2011,7 +2002,7 @@ private PollerFlux, AttestationInner> beginCreateOr * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an attestation resource. + * @return the {@link PollerFlux} for polling of an attestation resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, AttestationInner> beginCreateOrUpdateAtResourceAsync( @@ -2034,7 +2025,7 @@ private PollerFlux, AttestationInner> beginCreateOr * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an attestation resource. + * @return the {@link SyncPoller} for polling of an attestation resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, AttestationInner> beginCreateOrUpdateAtResource( @@ -2052,7 +2043,7 @@ public SyncPoller, AttestationInner> beginCreateOrU * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an attestation resource. + * @return the {@link SyncPoller} for polling of an attestation resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, AttestationInner> beginCreateOrUpdateAtResource( @@ -2069,7 +2060,7 @@ public SyncPoller, AttestationInner> beginCreateOrU * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an attestation resource. + * @return an attestation resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAtResourceAsync( @@ -2089,7 +2080,7 @@ private Mono createOrUpdateAtResourceAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an attestation resource. + * @return an attestation resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAtResourceAsync( @@ -2142,7 +2133,8 @@ public AttestationInner createOrUpdateAtResource( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an existing attestation at resource scope. + * @return an existing attestation at resource scope along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getAtResourceWithResponseAsync(String resourceId, String attestationName) { @@ -2159,7 +2151,7 @@ private Mono> getAtResourceWithResponseAsync(String r return Mono .error(new IllegalArgumentException("Parameter attestationName is required and cannot be null.")); } - final String apiVersion = "2021-01-01"; + final String apiVersion = "2022-09-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -2179,7 +2171,8 @@ private Mono> getAtResourceWithResponseAsync(String r * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an existing attestation at resource scope. + * @return an existing attestation at resource scope along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getAtResourceWithResponseAsync( @@ -2197,7 +2190,7 @@ private Mono> getAtResourceWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter attestationName is required and cannot be null.")); } - final String apiVersion = "2021-01-01"; + final String apiVersion = "2022-09-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -2212,19 +2205,12 @@ private Mono> getAtResourceWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an existing attestation at resource scope. + * @return an existing attestation at resource scope on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAtResourceAsync(String resourceId, String attestationName) { return getAtResourceWithResponseAsync(resourceId, attestationName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -2251,7 +2237,7 @@ public AttestationInner getAtResource(String resourceId, String attestationName) * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an existing attestation at resource scope. + * @return an existing attestation at resource scope along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getAtResourceWithResponse( @@ -2267,7 +2253,7 @@ public Response getAtResourceWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteAtResourceWithResponseAsync(String resourceId, String attestationName) { @@ -2284,7 +2270,7 @@ private Mono> deleteAtResourceWithResponseAsync(String resourceId return Mono .error(new IllegalArgumentException("Parameter attestationName is required and cannot be null.")); } - final String apiVersion = "2021-01-01"; + final String apiVersion = "2022-09-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -2304,7 +2290,7 @@ private Mono> deleteAtResourceWithResponseAsync(String resourceId * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteAtResourceWithResponseAsync( @@ -2322,7 +2308,7 @@ private Mono> deleteAtResourceWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter attestationName is required and cannot be null.")); } - final String apiVersion = "2021-01-01"; + final String apiVersion = "2022-09-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -2337,12 +2323,11 @@ private Mono> deleteAtResourceWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAtResourceAsync(String resourceId, String attestationName) { - return deleteAtResourceWithResponseAsync(resourceId, attestationName) - .flatMap((Response res) -> Mono.empty()); + return deleteAtResourceWithResponseAsync(resourceId, attestationName).flatMap(ignored -> Mono.empty()); } /** @@ -2368,7 +2353,7 @@ public void deleteAtResource(String resourceId, String attestationName) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 response. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteAtResourceWithResponse(String resourceId, String attestationName, Context context) { @@ -2378,11 +2363,12 @@ public Response deleteAtResourceWithResponse(String resourceId, String att /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @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 list of attestations. + * @return list of attestations along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listForSubscriptionNextSinglePageAsync(String nextLink) { @@ -2414,12 +2400,13 @@ private Mono> listForSubscriptionNextSinglePageA /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @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 list of attestations. + * @return list of attestations along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listForSubscriptionNextSinglePageAsync( @@ -2451,11 +2438,12 @@ private Mono> listForSubscriptionNextSinglePageA /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @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 list of attestations. + * @return list of attestations along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listForResourceGroupNextSinglePageAsync(String nextLink) { @@ -2487,12 +2475,13 @@ private Mono> listForResourceGroupNextSinglePage /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @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 list of attestations. + * @return list of attestations along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listForResourceGroupNextSinglePageAsync( @@ -2524,11 +2513,12 @@ private Mono> listForResourceGroupNextSinglePage /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @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 list of attestations. + * @return list of attestations along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listForResourceNextSinglePageAsync(String nextLink) { @@ -2559,12 +2549,13 @@ private Mono> listForResourceNextSinglePageAsync /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @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 list of attestations. + * @return list of attestations along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listForResourceNextSinglePageAsync(String nextLink, Context context) { diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/implementation/AttestationsImpl.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/implementation/AttestationsImpl.java index c21be06c0cfa..e314d8cf49b0 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/implementation/AttestationsImpl.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/implementation/AttestationsImpl.java @@ -13,10 +13,9 @@ import com.azure.resourcemanager.policyinsights.fluent.models.AttestationInner; import com.azure.resourcemanager.policyinsights.models.Attestation; import com.azure.resourcemanager.policyinsights.models.Attestations; -import com.fasterxml.jackson.annotation.JsonIgnore; public final class AttestationsImpl implements Attestations { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AttestationsImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(AttestationsImpl.class); private final AttestationsClient innerClient; @@ -197,7 +196,7 @@ public Response deleteAtResourceWithResponse(String resourceId, String att public Attestation getById(String id) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -205,7 +204,7 @@ public Attestation getById(String id) { } String attestationName = Utils.getValueFromIdByName(id, "attestations"); if (attestationName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'attestations'.", id))); @@ -216,7 +215,7 @@ public Attestation getById(String id) { public Response getByIdWithResponse(String id, Context context) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -224,7 +223,7 @@ public Response getByIdWithResponse(String id, Context context) { } String attestationName = Utils.getValueFromIdByName(id, "attestations"); if (attestationName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'attestations'.", id))); @@ -235,7 +234,7 @@ public Response getByIdWithResponse(String id, Context context) { public void deleteById(String id) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -243,7 +242,7 @@ public void deleteById(String id) { } String attestationName = Utils.getValueFromIdByName(id, "attestations"); if (attestationName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'attestations'.", id))); @@ -254,7 +253,7 @@ public void deleteById(String id) { public Response deleteByIdWithResponse(String id, Context context) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -262,7 +261,7 @@ public Response deleteByIdWithResponse(String id, Context context) { } String attestationName = Utils.getValueFromIdByName(id, "attestations"); if (attestationName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'attestations'.", id))); diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/implementation/OperationsClientImpl.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/implementation/OperationsClientImpl.java index 39d095ff4d2c..7e132db72b34 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/implementation/OperationsClientImpl.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/implementation/OperationsClientImpl.java @@ -20,15 +20,12 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.policyinsights.fluent.OperationsClient; import com.azure.resourcemanager.policyinsights.fluent.models.OperationsListResultsInner; import reactor.core.publisher.Mono; /** An instance of this class provides access to all the operations defined in OperationsClient. */ public final class OperationsClientImpl implements OperationsClient { - private final ClientLogger logger = new ClientLogger(OperationsClientImpl.class); - /** The proxy service used to perform REST calls. */ private final OperationsService service; @@ -69,7 +66,7 @@ Mono> list( * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of available operations. + * @return list of available operations along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listWithResponseAsync() { @@ -93,7 +90,7 @@ private Mono> listWithResponseAsync() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of available operations. + * @return list of available operations along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listWithResponseAsync(Context context) { @@ -114,19 +111,11 @@ private Mono> listWithResponseAsync(Context * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of available operations. + * @return list of available operations on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono listAsync() { - return listWithResponseAsync() - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + return listWithResponseAsync().flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -148,7 +137,7 @@ public OperationsListResultsInner 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 list of available operations. + * @return list of available operations along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response listWithResponse(Context context) { diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/implementation/OperationsImpl.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/implementation/OperationsImpl.java index 8a75ad96f169..7a9fe17e4395 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/implementation/OperationsImpl.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/implementation/OperationsImpl.java @@ -12,10 +12,9 @@ import com.azure.resourcemanager.policyinsights.fluent.models.OperationsListResultsInner; import com.azure.resourcemanager.policyinsights.models.Operations; import com.azure.resourcemanager.policyinsights.models.OperationsListResults; -import com.fasterxml.jackson.annotation.JsonIgnore; public final class OperationsImpl implements Operations { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationsImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(OperationsImpl.class); private final OperationsClient innerClient; diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/implementation/PolicyEventsClientImpl.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/implementation/PolicyEventsClientImpl.java index 000c8e026abb..27e6f889639b 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/implementation/PolicyEventsClientImpl.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/implementation/PolicyEventsClientImpl.java @@ -26,17 +26,15 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.policyinsights.fluent.PolicyEventsClient; import com.azure.resourcemanager.policyinsights.fluent.models.PolicyEventInner; import com.azure.resourcemanager.policyinsights.models.PolicyEventsQueryResults; +import com.azure.resourcemanager.policyinsights.models.PolicyEventsResourceType; import java.time.OffsetDateTime; import reactor.core.publisher.Mono; /** An instance of this class provides access to all the operations defined in PolicyEventsClient. */ public final class PolicyEventsClientImpl implements PolicyEventsClient { - private final ClientLogger logger = new ClientLogger(PolicyEventsClientImpl.class); - /** The proxy service used to perform REST calls. */ private final PolicyEventsService service; @@ -69,7 +67,7 @@ private interface PolicyEventsService { @UnexpectedResponseExceptionType(ManagementException.class) Mono> listQueryResultsForManagementGroup( @HostParam("$host") String endpoint, - @PathParam("policyEventsResource") String policyEventsResource, + @PathParam("policyEventsResource") PolicyEventsResourceType policyEventsResource, @PathParam("managementGroupsNamespace") String managementGroupsNamespace, @PathParam("managementGroupName") String managementGroupName, @QueryParam("api-version") String apiVersion, @@ -92,7 +90,7 @@ Mono> listQueryResultsForManagementGroup( @UnexpectedResponseExceptionType(ManagementException.class) Mono> listQueryResultsForSubscription( @HostParam("$host") String endpoint, - @PathParam("policyEventsResource") String policyEventsResource, + @PathParam("policyEventsResource") PolicyEventsResourceType policyEventsResource, @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, @QueryParam("$top") Integer top, @@ -114,7 +112,7 @@ Mono> listQueryResultsForSubscription( @UnexpectedResponseExceptionType(ManagementException.class) Mono> listQueryResultsForResourceGroup( @HostParam("$host") String endpoint, - @PathParam("policyEventsResource") String policyEventsResource, + @PathParam("policyEventsResource") PolicyEventsResourceType policyEventsResource, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, @@ -135,7 +133,7 @@ Mono> listQueryResultsForResourceGroup( @UnexpectedResponseExceptionType(ManagementException.class) Mono> listQueryResultsForResource( @HostParam("$host") String endpoint, - @PathParam("policyEventsResource") String policyEventsResource, + @PathParam("policyEventsResource") PolicyEventsResourceType policyEventsResource, @PathParam(value = "resourceId", encoded = true) String resourceId, @QueryParam("api-version") String apiVersion, @QueryParam("$top") Integer top, @@ -159,7 +157,7 @@ Mono> listQueryResultsForResource( @UnexpectedResponseExceptionType(ManagementException.class) Mono> listQueryResultsForPolicySetDefinition( @HostParam("$host") String endpoint, - @PathParam("policyEventsResource") String policyEventsResource, + @PathParam("policyEventsResource") PolicyEventsResourceType policyEventsResource, @PathParam("subscriptionId") String subscriptionId, @PathParam("authorizationNamespace") String authorizationNamespace, @PathParam("policySetDefinitionName") String policySetDefinitionName, @@ -184,7 +182,7 @@ Mono> listQueryResultsForPolicySetDefinition( @UnexpectedResponseExceptionType(ManagementException.class) Mono> listQueryResultsForPolicyDefinition( @HostParam("$host") String endpoint, - @PathParam("policyEventsResource") String policyEventsResource, + @PathParam("policyEventsResource") PolicyEventsResourceType policyEventsResource, @PathParam("subscriptionId") String subscriptionId, @PathParam("authorizationNamespace") String authorizationNamespace, @PathParam("policyDefinitionName") String policyDefinitionName, @@ -209,7 +207,7 @@ Mono> listQueryResultsForPolicyDefinition( @UnexpectedResponseExceptionType(ManagementException.class) Mono> listQueryResultsForSubscriptionLevelPolicyAssignment( @HostParam("$host") String endpoint, - @PathParam("policyEventsResource") String policyEventsResource, + @PathParam("policyEventsResource") PolicyEventsResourceType policyEventsResource, @PathParam("subscriptionId") String subscriptionId, @PathParam("authorizationNamespace") String authorizationNamespace, @PathParam("policyAssignmentName") String policyAssignmentName, @@ -234,7 +232,7 @@ Mono> listQueryResultsForSubscriptionLevelPol @UnexpectedResponseExceptionType(ManagementException.class) Mono> listQueryResultsForResourceGroupLevelPolicyAssignment( @HostParam("$host") String endpoint, - @PathParam("policyEventsResource") String policyEventsResource, + @PathParam("policyEventsResource") PolicyEventsResourceType policyEventsResource, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("authorizationNamespace") String authorizationNamespace, @@ -262,6 +260,8 @@ Mono> nextLink( /** * Queries policy events for the resources under the management group. * + * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only "default" is + * allowed. * @param managementGroupName Management group name. * @param top Maximum number of records to return. * @param orderBy Ordering expression using OData notation. One or more comma-separated column names with an @@ -279,10 +279,11 @@ Mono> nextLink( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listQueryResultsForManagementGroupSinglePageAsync( + PolicyEventsResourceType policyEventsResource, String managementGroupName, Integer top, String orderBy, @@ -298,11 +299,14 @@ private Mono> listQueryResultsForManagementGroup new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } + if (policyEventsResource == null) { + return Mono + .error(new IllegalArgumentException("Parameter policyEventsResource is required and cannot be null.")); + } if (managementGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter managementGroupName is required and cannot be null.")); } - final String policyEventsResource = "default"; final String managementGroupsNamespace = "Microsoft.Management"; final String apiVersion = "2019-10-01"; final String accept = "application/json"; @@ -341,6 +345,8 @@ private Mono> listQueryResultsForManagementGroup /** * Queries policy events for the resources under the management group. * + * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only "default" is + * allowed. * @param managementGroupName Management group name. * @param top Maximum number of records to return. * @param orderBy Ordering expression using OData notation. One or more comma-separated column names with an @@ -359,10 +365,11 @@ private Mono> listQueryResultsForManagementGroup * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listQueryResultsForManagementGroupSinglePageAsync( + PolicyEventsResourceType policyEventsResource, String managementGroupName, Integer top, String orderBy, @@ -379,11 +386,14 @@ private Mono> listQueryResultsForManagementGroup new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } + if (policyEventsResource == null) { + return Mono + .error(new IllegalArgumentException("Parameter policyEventsResource is required and cannot be null.")); + } if (managementGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter managementGroupName is required and cannot be null.")); } - final String policyEventsResource = "default"; final String managementGroupsNamespace = "Microsoft.Management"; final String apiVersion = "2019-10-01"; final String accept = "application/json"; @@ -419,6 +429,8 @@ private Mono> listQueryResultsForManagementGroup /** * Queries policy events for the resources under the management group. * + * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only "default" is + * allowed. * @param managementGroupName Management group name. * @param top Maximum number of records to return. * @param orderBy Ordering expression using OData notation. One or more comma-separated column names with an @@ -436,10 +448,11 @@ private Mono> listQueryResultsForManagementGroup * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listQueryResultsForManagementGroupAsync( + PolicyEventsResourceType policyEventsResource, String managementGroupName, Integer top, String orderBy, @@ -452,21 +465,33 @@ private PagedFlux listQueryResultsForManagementGroupAsync( return new PagedFlux<>( () -> listQueryResultsForManagementGroupSinglePageAsync( - managementGroupName, top, orderBy, select, from, to, filter, apply, skipToken), + policyEventsResource, + managementGroupName, + top, + orderBy, + select, + from, + to, + filter, + apply, + skipToken), nextLink -> nextLinkSinglePageAsync(nextLink)); } /** * Queries policy events for the resources under the management group. * + * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only "default" is + * allowed. * @param managementGroupName Management group name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listQueryResultsForManagementGroupAsync(String managementGroupName) { + private PagedFlux listQueryResultsForManagementGroupAsync( + PolicyEventsResourceType policyEventsResource, String managementGroupName) { final Integer top = null; final String orderBy = null; final String select = null; @@ -478,13 +503,24 @@ private PagedFlux listQueryResultsForManagementGroupAsync(Stri return new PagedFlux<>( () -> listQueryResultsForManagementGroupSinglePageAsync( - managementGroupName, top, orderBy, select, from, to, filter, apply, skipToken), + policyEventsResource, + managementGroupName, + top, + orderBy, + select, + from, + to, + filter, + apply, + skipToken), nextLink -> nextLinkSinglePageAsync(nextLink)); } /** * Queries policy events for the resources under the management group. * + * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only "default" is + * allowed. * @param managementGroupName Management group name. * @param top Maximum number of records to return. * @param orderBy Ordering expression using OData notation. One or more comma-separated column names with an @@ -503,10 +539,11 @@ private PagedFlux listQueryResultsForManagementGroupAsync(Stri * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listQueryResultsForManagementGroupAsync( + PolicyEventsResourceType policyEventsResource, String managementGroupName, Integer top, String orderBy, @@ -520,21 +557,34 @@ private PagedFlux listQueryResultsForManagementGroupAsync( return new PagedFlux<>( () -> listQueryResultsForManagementGroupSinglePageAsync( - managementGroupName, top, orderBy, select, from, to, filter, apply, skipToken, context), + policyEventsResource, + managementGroupName, + top, + orderBy, + select, + from, + to, + filter, + apply, + skipToken, + context), nextLink -> nextLinkSinglePageAsync(nextLink, context)); } /** * Queries policy events for the resources under the management group. * + * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only "default" is + * allowed. * @param managementGroupName Management group name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listQueryResultsForManagementGroup(String managementGroupName) { + public PagedIterable listQueryResultsForManagementGroup( + PolicyEventsResourceType policyEventsResource, String managementGroupName) { final Integer top = null; final String orderBy = null; final String select = null; @@ -545,12 +595,14 @@ public PagedIterable listQueryResultsForManagementGroup(String final String skipToken = null; return new PagedIterable<>( listQueryResultsForManagementGroupAsync( - managementGroupName, top, orderBy, select, from, to, filter, apply, skipToken)); + policyEventsResource, managementGroupName, top, orderBy, select, from, to, filter, apply, skipToken)); } /** * Queries policy events for the resources under the management group. * + * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only "default" is + * allowed. * @param managementGroupName Management group name. * @param top Maximum number of records to return. * @param orderBy Ordering expression using OData notation. One or more comma-separated column names with an @@ -569,10 +621,11 @@ public PagedIterable listQueryResultsForManagementGroup(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 query results. + * @return query results as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listQueryResultsForManagementGroup( + PolicyEventsResourceType policyEventsResource, String managementGroupName, Integer top, String orderBy, @@ -585,12 +638,24 @@ public PagedIterable listQueryResultsForManagementGroup( Context context) { return new PagedIterable<>( listQueryResultsForManagementGroupAsync( - managementGroupName, top, orderBy, select, from, to, filter, apply, skipToken, context)); + policyEventsResource, + managementGroupName, + top, + orderBy, + select, + from, + to, + filter, + apply, + skipToken, + context)); } /** * Queries policy events for the resources under the subscription. * + * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only "default" is + * allowed. * @param subscriptionId Microsoft Azure subscription ID. * @param top Maximum number of records to return. * @param orderBy Ordering expression using OData notation. One or more comma-separated column names with an @@ -608,10 +673,11 @@ public PagedIterable listQueryResultsForManagementGroup( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listQueryResultsForSubscriptionSinglePageAsync( + PolicyEventsResourceType policyEventsResource, String subscriptionId, Integer top, String orderBy, @@ -627,10 +693,13 @@ private Mono> listQueryResultsForSubscriptionSin new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } + if (policyEventsResource == null) { + return Mono + .error(new IllegalArgumentException("Parameter policyEventsResource is required and cannot be null.")); + } if (subscriptionId == null) { return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); } - final String policyEventsResource = "default"; final String apiVersion = "2019-10-01"; final String accept = "application/json"; return FluxUtil @@ -667,6 +736,8 @@ private Mono> listQueryResultsForSubscriptionSin /** * Queries policy events for the resources under the subscription. * + * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only "default" is + * allowed. * @param subscriptionId Microsoft Azure subscription ID. * @param top Maximum number of records to return. * @param orderBy Ordering expression using OData notation. One or more comma-separated column names with an @@ -685,10 +756,11 @@ private Mono> listQueryResultsForSubscriptionSin * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listQueryResultsForSubscriptionSinglePageAsync( + PolicyEventsResourceType policyEventsResource, String subscriptionId, Integer top, String orderBy, @@ -705,10 +777,13 @@ private Mono> listQueryResultsForSubscriptionSin new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } + if (policyEventsResource == null) { + return Mono + .error(new IllegalArgumentException("Parameter policyEventsResource is required and cannot be null.")); + } if (subscriptionId == null) { return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); } - final String policyEventsResource = "default"; final String apiVersion = "2019-10-01"; final String accept = "application/json"; context = this.client.mergeContext(context); @@ -742,6 +817,8 @@ private Mono> listQueryResultsForSubscriptionSin /** * Queries policy events for the resources under the subscription. * + * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only "default" is + * allowed. * @param subscriptionId Microsoft Azure subscription ID. * @param top Maximum number of records to return. * @param orderBy Ordering expression using OData notation. One or more comma-separated column names with an @@ -759,10 +836,11 @@ private Mono> listQueryResultsForSubscriptionSin * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listQueryResultsForSubscriptionAsync( + PolicyEventsResourceType policyEventsResource, String subscriptionId, Integer top, String orderBy, @@ -775,21 +853,24 @@ private PagedFlux listQueryResultsForSubscriptionAsync( return new PagedFlux<>( () -> listQueryResultsForSubscriptionSinglePageAsync( - subscriptionId, top, orderBy, select, from, to, filter, apply, skipToken), + policyEventsResource, subscriptionId, top, orderBy, select, from, to, filter, apply, skipToken), nextLink -> nextLinkSinglePageAsync(nextLink)); } /** * Queries policy events for the resources under the subscription. * + * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only "default" is + * allowed. * @param subscriptionId Microsoft Azure subscription 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 query results. + * @return query results as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listQueryResultsForSubscriptionAsync(String subscriptionId) { + private PagedFlux listQueryResultsForSubscriptionAsync( + PolicyEventsResourceType policyEventsResource, String subscriptionId) { final Integer top = null; final String orderBy = null; final String select = null; @@ -801,13 +882,15 @@ private PagedFlux listQueryResultsForSubscriptionAsync(String return new PagedFlux<>( () -> listQueryResultsForSubscriptionSinglePageAsync( - subscriptionId, top, orderBy, select, from, to, filter, apply, skipToken), + policyEventsResource, subscriptionId, top, orderBy, select, from, to, filter, apply, skipToken), nextLink -> nextLinkSinglePageAsync(nextLink)); } /** * Queries policy events for the resources under the subscription. * + * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only "default" is + * allowed. * @param subscriptionId Microsoft Azure subscription ID. * @param top Maximum number of records to return. * @param orderBy Ordering expression using OData notation. One or more comma-separated column names with an @@ -826,10 +909,11 @@ private PagedFlux listQueryResultsForSubscriptionAsync(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 query results. + * @return query results as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listQueryResultsForSubscriptionAsync( + PolicyEventsResourceType policyEventsResource, String subscriptionId, Integer top, String orderBy, @@ -843,21 +927,34 @@ private PagedFlux listQueryResultsForSubscriptionAsync( return new PagedFlux<>( () -> listQueryResultsForSubscriptionSinglePageAsync( - subscriptionId, top, orderBy, select, from, to, filter, apply, skipToken, context), + policyEventsResource, + subscriptionId, + top, + orderBy, + select, + from, + to, + filter, + apply, + skipToken, + context), nextLink -> nextLinkSinglePageAsync(nextLink, context)); } /** * Queries policy events for the resources under the subscription. * + * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only "default" is + * allowed. * @param subscriptionId Microsoft Azure subscription 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 query results. + * @return query results as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listQueryResultsForSubscription(String subscriptionId) { + public PagedIterable listQueryResultsForSubscription( + PolicyEventsResourceType policyEventsResource, String subscriptionId) { final Integer top = null; final String orderBy = null; final String select = null; @@ -868,12 +965,14 @@ public PagedIterable listQueryResultsForSubscription(String su final String skipToken = null; return new PagedIterable<>( listQueryResultsForSubscriptionAsync( - subscriptionId, top, orderBy, select, from, to, filter, apply, skipToken)); + policyEventsResource, subscriptionId, top, orderBy, select, from, to, filter, apply, skipToken)); } /** * Queries policy events for the resources under the subscription. * + * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only "default" is + * allowed. * @param subscriptionId Microsoft Azure subscription ID. * @param top Maximum number of records to return. * @param orderBy Ordering expression using OData notation. One or more comma-separated column names with an @@ -892,10 +991,11 @@ public PagedIterable listQueryResultsForSubscription(String su * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listQueryResultsForSubscription( + PolicyEventsResourceType policyEventsResource, String subscriptionId, Integer top, String orderBy, @@ -908,12 +1008,24 @@ public PagedIterable listQueryResultsForSubscription( Context context) { return new PagedIterable<>( listQueryResultsForSubscriptionAsync( - subscriptionId, top, orderBy, select, from, to, filter, apply, skipToken, context)); + policyEventsResource, + subscriptionId, + top, + orderBy, + select, + from, + to, + filter, + apply, + skipToken, + context)); } /** * Queries policy events for the resources under the resource group. * + * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only "default" is + * allowed. * @param subscriptionId Microsoft Azure subscription ID. * @param resourceGroupName Resource group name. * @param top Maximum number of records to return. @@ -932,10 +1044,11 @@ public PagedIterable listQueryResultsForSubscription( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listQueryResultsForResourceGroupSinglePageAsync( + PolicyEventsResourceType policyEventsResource, String subscriptionId, String resourceGroupName, Integer top, @@ -952,6 +1065,10 @@ private Mono> listQueryResultsForResourceGroupSi new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } + if (policyEventsResource == null) { + return Mono + .error(new IllegalArgumentException("Parameter policyEventsResource is required and cannot be null.")); + } if (subscriptionId == null) { return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); } @@ -959,7 +1076,6 @@ private Mono> listQueryResultsForResourceGroupSi return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - final String policyEventsResource = "default"; final String apiVersion = "2019-10-01"; final String accept = "application/json"; return FluxUtil @@ -997,6 +1113,8 @@ private Mono> listQueryResultsForResourceGroupSi /** * Queries policy events for the resources under the resource group. * + * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only "default" is + * allowed. * @param subscriptionId Microsoft Azure subscription ID. * @param resourceGroupName Resource group name. * @param top Maximum number of records to return. @@ -1016,10 +1134,11 @@ private Mono> listQueryResultsForResourceGroupSi * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listQueryResultsForResourceGroupSinglePageAsync( + PolicyEventsResourceType policyEventsResource, String subscriptionId, String resourceGroupName, Integer top, @@ -1037,6 +1156,10 @@ private Mono> listQueryResultsForResourceGroupSi new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } + if (policyEventsResource == null) { + return Mono + .error(new IllegalArgumentException("Parameter policyEventsResource is required and cannot be null.")); + } if (subscriptionId == null) { return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); } @@ -1044,7 +1167,6 @@ private Mono> listQueryResultsForResourceGroupSi return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - final String policyEventsResource = "default"; final String apiVersion = "2019-10-01"; final String accept = "application/json"; context = this.client.mergeContext(context); @@ -1079,6 +1201,8 @@ private Mono> listQueryResultsForResourceGroupSi /** * Queries policy events for the resources under the resource group. * + * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only "default" is + * allowed. * @param subscriptionId Microsoft Azure subscription ID. * @param resourceGroupName Resource group name. * @param top Maximum number of records to return. @@ -1097,10 +1221,11 @@ private Mono> listQueryResultsForResourceGroupSi * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listQueryResultsForResourceGroupAsync( + PolicyEventsResourceType policyEventsResource, String subscriptionId, String resourceGroupName, Integer top, @@ -1114,23 +1239,35 @@ private PagedFlux listQueryResultsForResourceGroupAsync( return new PagedFlux<>( () -> listQueryResultsForResourceGroupSinglePageAsync( - subscriptionId, resourceGroupName, top, orderBy, select, from, to, filter, apply, skipToken), + policyEventsResource, + subscriptionId, + resourceGroupName, + top, + orderBy, + select, + from, + to, + filter, + apply, + skipToken), nextLink -> nextLinkSinglePageAsync(nextLink)); } /** * Queries policy events for the resources under the resource group. * + * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only "default" is + * allowed. * @param subscriptionId Microsoft Azure subscription ID. * @param resourceGroupName Resource group name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listQueryResultsForResourceGroupAsync( - String subscriptionId, String resourceGroupName) { + PolicyEventsResourceType policyEventsResource, String subscriptionId, String resourceGroupName) { final Integer top = null; final String orderBy = null; final String select = null; @@ -1142,13 +1279,25 @@ private PagedFlux listQueryResultsForResourceGroupAsync( return new PagedFlux<>( () -> listQueryResultsForResourceGroupSinglePageAsync( - subscriptionId, resourceGroupName, top, orderBy, select, from, to, filter, apply, skipToken), + policyEventsResource, + subscriptionId, + resourceGroupName, + top, + orderBy, + select, + from, + to, + filter, + apply, + skipToken), nextLink -> nextLinkSinglePageAsync(nextLink)); } /** * Queries policy events for the resources under the resource group. * + * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only "default" is + * allowed. * @param subscriptionId Microsoft Azure subscription ID. * @param resourceGroupName Resource group name. * @param top Maximum number of records to return. @@ -1168,10 +1317,11 @@ private PagedFlux listQueryResultsForResourceGroupAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listQueryResultsForResourceGroupAsync( + PolicyEventsResourceType policyEventsResource, String subscriptionId, String resourceGroupName, Integer top, @@ -1186,6 +1336,7 @@ private PagedFlux listQueryResultsForResourceGroupAsync( return new PagedFlux<>( () -> listQueryResultsForResourceGroupSinglePageAsync( + policyEventsResource, subscriptionId, resourceGroupName, top, @@ -1203,16 +1354,18 @@ private PagedFlux listQueryResultsForResourceGroupAsync( /** * Queries policy events for the resources under the resource group. * + * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only "default" is + * allowed. * @param subscriptionId Microsoft Azure subscription ID. * @param resourceGroupName Resource group name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listQueryResultsForResourceGroup( - String subscriptionId, String resourceGroupName) { + PolicyEventsResourceType policyEventsResource, String subscriptionId, String resourceGroupName) { final Integer top = null; final String orderBy = null; final String select = null; @@ -1223,12 +1376,24 @@ public PagedIterable listQueryResultsForResourceGroup( final String skipToken = null; return new PagedIterable<>( listQueryResultsForResourceGroupAsync( - subscriptionId, resourceGroupName, top, orderBy, select, from, to, filter, apply, skipToken)); + policyEventsResource, + subscriptionId, + resourceGroupName, + top, + orderBy, + select, + from, + to, + filter, + apply, + skipToken)); } /** * Queries policy events for the resources under the resource group. * + * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only "default" is + * allowed. * @param subscriptionId Microsoft Azure subscription ID. * @param resourceGroupName Resource group name. * @param top Maximum number of records to return. @@ -1248,10 +1413,11 @@ public PagedIterable listQueryResultsForResourceGroup( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listQueryResultsForResourceGroup( + PolicyEventsResourceType policyEventsResource, String subscriptionId, String resourceGroupName, Integer top, @@ -1265,12 +1431,25 @@ public PagedIterable listQueryResultsForResourceGroup( Context context) { return new PagedIterable<>( listQueryResultsForResourceGroupAsync( - subscriptionId, resourceGroupName, top, orderBy, select, from, to, filter, apply, skipToken, context)); + policyEventsResource, + subscriptionId, + resourceGroupName, + top, + orderBy, + select, + from, + to, + filter, + apply, + skipToken, + context)); } /** * Queries policy events for the resource. * + * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only "default" is + * allowed. * @param resourceId Resource ID. * @param top Maximum number of records to return. * @param orderBy Ordering expression using OData notation. One or more comma-separated column names with an @@ -1289,10 +1468,11 @@ public PagedIterable listQueryResultsForResourceGroup( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listQueryResultsForResourceSinglePageAsync( + PolicyEventsResourceType policyEventsResource, String resourceId, Integer top, String orderBy, @@ -1309,10 +1489,13 @@ private Mono> listQueryResultsForResourceSingleP new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } + if (policyEventsResource == null) { + return Mono + .error(new IllegalArgumentException("Parameter policyEventsResource is required and cannot be null.")); + } if (resourceId == null) { return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); } - final String policyEventsResource = "default"; final String apiVersion = "2019-10-01"; final String accept = "application/json"; return FluxUtil @@ -1350,6 +1533,8 @@ private Mono> listQueryResultsForResourceSingleP /** * Queries policy events for the resource. * + * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only "default" is + * allowed. * @param resourceId Resource ID. * @param top Maximum number of records to return. * @param orderBy Ordering expression using OData notation. One or more comma-separated column names with an @@ -1369,10 +1554,11 @@ private Mono> listQueryResultsForResourceSingleP * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listQueryResultsForResourceSinglePageAsync( + PolicyEventsResourceType policyEventsResource, String resourceId, Integer top, String orderBy, @@ -1390,10 +1576,13 @@ private Mono> listQueryResultsForResourceSingleP new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } + if (policyEventsResource == null) { + return Mono + .error(new IllegalArgumentException("Parameter policyEventsResource is required and cannot be null.")); + } if (resourceId == null) { return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); } - final String policyEventsResource = "default"; final String apiVersion = "2019-10-01"; final String accept = "application/json"; context = this.client.mergeContext(context); @@ -1428,6 +1617,8 @@ private Mono> listQueryResultsForResourceSingleP /** * Queries policy events for the resource. * + * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only "default" is + * allowed. * @param resourceId Resource ID. * @param top Maximum number of records to return. * @param orderBy Ordering expression using OData notation. One or more comma-separated column names with an @@ -1446,10 +1637,11 @@ private Mono> listQueryResultsForResourceSingleP * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listQueryResultsForResourceAsync( + PolicyEventsResourceType policyEventsResource, String resourceId, Integer top, String orderBy, @@ -1463,21 +1655,24 @@ private PagedFlux listQueryResultsForResourceAsync( return new PagedFlux<>( () -> listQueryResultsForResourceSinglePageAsync( - resourceId, top, orderBy, select, from, to, filter, apply, expand, skipToken), + policyEventsResource, resourceId, top, orderBy, select, from, to, filter, apply, expand, skipToken), nextLink -> nextLinkSinglePageAsync(nextLink)); } /** * Queries policy events for the resource. * + * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only "default" is + * allowed. * @param resourceId Resource 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 query results. + * @return query results as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listQueryResultsForResourceAsync(String resourceId) { + private PagedFlux listQueryResultsForResourceAsync( + PolicyEventsResourceType policyEventsResource, String resourceId) { final Integer top = null; final String orderBy = null; final String select = null; @@ -1490,13 +1685,15 @@ private PagedFlux listQueryResultsForResourceAsync(String reso return new PagedFlux<>( () -> listQueryResultsForResourceSinglePageAsync( - resourceId, top, orderBy, select, from, to, filter, apply, expand, skipToken), + policyEventsResource, resourceId, top, orderBy, select, from, to, filter, apply, expand, skipToken), nextLink -> nextLinkSinglePageAsync(nextLink)); } /** * Queries policy events for the resource. * + * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only "default" is + * allowed. * @param resourceId Resource ID. * @param top Maximum number of records to return. * @param orderBy Ordering expression using OData notation. One or more comma-separated column names with an @@ -1516,10 +1713,11 @@ private PagedFlux listQueryResultsForResourceAsync(String reso * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listQueryResultsForResourceAsync( + PolicyEventsResourceType policyEventsResource, String resourceId, Integer top, String orderBy, @@ -1534,21 +1732,35 @@ private PagedFlux listQueryResultsForResourceAsync( return new PagedFlux<>( () -> listQueryResultsForResourceSinglePageAsync( - resourceId, top, orderBy, select, from, to, filter, apply, expand, skipToken, context), + policyEventsResource, + resourceId, + top, + orderBy, + select, + from, + to, + filter, + apply, + expand, + skipToken, + context), nextLink -> nextLinkSinglePageAsync(nextLink, context)); } /** * Queries policy events for the resource. * + * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only "default" is + * allowed. * @param resourceId Resource 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 query results. + * @return query results as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listQueryResultsForResource(String resourceId) { + public PagedIterable listQueryResultsForResource( + PolicyEventsResourceType policyEventsResource, String resourceId) { final Integer top = null; final String orderBy = null; final String select = null; @@ -1560,12 +1772,14 @@ public PagedIterable listQueryResultsForResource(String resour final String skipToken = null; return new PagedIterable<>( listQueryResultsForResourceAsync( - resourceId, top, orderBy, select, from, to, filter, apply, expand, skipToken)); + policyEventsResource, resourceId, top, orderBy, select, from, to, filter, apply, expand, skipToken)); } /** * Queries policy events for the resource. * + * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only "default" is + * allowed. * @param resourceId Resource ID. * @param top Maximum number of records to return. * @param orderBy Ordering expression using OData notation. One or more comma-separated column names with an @@ -1585,10 +1799,11 @@ public PagedIterable listQueryResultsForResource(String resour * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listQueryResultsForResource( + PolicyEventsResourceType policyEventsResource, String resourceId, Integer top, String orderBy, @@ -1602,12 +1817,25 @@ public PagedIterable listQueryResultsForResource( Context context) { return new PagedIterable<>( listQueryResultsForResourceAsync( - resourceId, top, orderBy, select, from, to, filter, apply, expand, skipToken, context)); + policyEventsResource, + resourceId, + top, + orderBy, + select, + from, + to, + filter, + apply, + expand, + skipToken, + context)); } /** * Queries policy events for the subscription level policy set definition. * + * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only "default" is + * allowed. * @param subscriptionId Microsoft Azure subscription ID. * @param policySetDefinitionName Policy set definition name. * @param top Maximum number of records to return. @@ -1626,10 +1854,11 @@ public PagedIterable listQueryResultsForResource( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listQueryResultsForPolicySetDefinitionSinglePageAsync( + PolicyEventsResourceType policyEventsResource, String subscriptionId, String policySetDefinitionName, Integer top, @@ -1646,6 +1875,10 @@ private Mono> listQueryResultsForPolicySetDefini new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } + if (policyEventsResource == null) { + return Mono + .error(new IllegalArgumentException("Parameter policyEventsResource is required and cannot be null.")); + } if (subscriptionId == null) { return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); } @@ -1654,7 +1887,6 @@ private Mono> listQueryResultsForPolicySetDefini .error( new IllegalArgumentException("Parameter policySetDefinitionName is required and cannot be null.")); } - final String policyEventsResource = "default"; final String authorizationNamespace = "Microsoft.Authorization"; final String apiVersion = "2019-10-01"; final String accept = "application/json"; @@ -1694,6 +1926,8 @@ private Mono> listQueryResultsForPolicySetDefini /** * Queries policy events for the subscription level policy set definition. * + * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only "default" is + * allowed. * @param subscriptionId Microsoft Azure subscription ID. * @param policySetDefinitionName Policy set definition name. * @param top Maximum number of records to return. @@ -1713,10 +1947,11 @@ private Mono> listQueryResultsForPolicySetDefini * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listQueryResultsForPolicySetDefinitionSinglePageAsync( + PolicyEventsResourceType policyEventsResource, String subscriptionId, String policySetDefinitionName, Integer top, @@ -1734,6 +1969,10 @@ private Mono> listQueryResultsForPolicySetDefini new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } + if (policyEventsResource == null) { + return Mono + .error(new IllegalArgumentException("Parameter policyEventsResource is required and cannot be null.")); + } if (subscriptionId == null) { return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); } @@ -1742,7 +1981,6 @@ private Mono> listQueryResultsForPolicySetDefini .error( new IllegalArgumentException("Parameter policySetDefinitionName is required and cannot be null.")); } - final String policyEventsResource = "default"; final String authorizationNamespace = "Microsoft.Authorization"; final String apiVersion = "2019-10-01"; final String accept = "application/json"; @@ -1779,6 +2017,8 @@ private Mono> listQueryResultsForPolicySetDefini /** * Queries policy events for the subscription level policy set definition. * + * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only "default" is + * allowed. * @param subscriptionId Microsoft Azure subscription ID. * @param policySetDefinitionName Policy set definition name. * @param top Maximum number of records to return. @@ -1797,10 +2037,11 @@ private Mono> listQueryResultsForPolicySetDefini * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listQueryResultsForPolicySetDefinitionAsync( + PolicyEventsResourceType policyEventsResource, String subscriptionId, String policySetDefinitionName, Integer top, @@ -1814,23 +2055,35 @@ private PagedFlux listQueryResultsForPolicySetDefinitionAsync( return new PagedFlux<>( () -> listQueryResultsForPolicySetDefinitionSinglePageAsync( - subscriptionId, policySetDefinitionName, top, orderBy, select, from, to, filter, apply, skipToken), + policyEventsResource, + subscriptionId, + policySetDefinitionName, + top, + orderBy, + select, + from, + to, + filter, + apply, + skipToken), nextLink -> nextLinkSinglePageAsync(nextLink)); } /** * Queries policy events for the subscription level policy set definition. * + * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only "default" is + * allowed. * @param subscriptionId Microsoft Azure subscription ID. * @param policySetDefinitionName Policy set definition name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listQueryResultsForPolicySetDefinitionAsync( - String subscriptionId, String policySetDefinitionName) { + PolicyEventsResourceType policyEventsResource, String subscriptionId, String policySetDefinitionName) { final Integer top = null; final String orderBy = null; final String select = null; @@ -1842,13 +2095,25 @@ private PagedFlux listQueryResultsForPolicySetDefinitionAsync( return new PagedFlux<>( () -> listQueryResultsForPolicySetDefinitionSinglePageAsync( - subscriptionId, policySetDefinitionName, top, orderBy, select, from, to, filter, apply, skipToken), + policyEventsResource, + subscriptionId, + policySetDefinitionName, + top, + orderBy, + select, + from, + to, + filter, + apply, + skipToken), nextLink -> nextLinkSinglePageAsync(nextLink)); } /** * Queries policy events for the subscription level policy set definition. * + * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only "default" is + * allowed. * @param subscriptionId Microsoft Azure subscription ID. * @param policySetDefinitionName Policy set definition name. * @param top Maximum number of records to return. @@ -1868,10 +2133,11 @@ private PagedFlux listQueryResultsForPolicySetDefinitionAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listQueryResultsForPolicySetDefinitionAsync( + PolicyEventsResourceType policyEventsResource, String subscriptionId, String policySetDefinitionName, Integer top, @@ -1886,6 +2152,7 @@ private PagedFlux listQueryResultsForPolicySetDefinitionAsync( return new PagedFlux<>( () -> listQueryResultsForPolicySetDefinitionSinglePageAsync( + policyEventsResource, subscriptionId, policySetDefinitionName, top, @@ -1903,16 +2170,18 @@ private PagedFlux listQueryResultsForPolicySetDefinitionAsync( /** * Queries policy events for the subscription level policy set definition. * + * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only "default" is + * allowed. * @param subscriptionId Microsoft Azure subscription ID. * @param policySetDefinitionName Policy set definition name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listQueryResultsForPolicySetDefinition( - String subscriptionId, String policySetDefinitionName) { + PolicyEventsResourceType policyEventsResource, String subscriptionId, String policySetDefinitionName) { final Integer top = null; final String orderBy = null; final String select = null; @@ -1923,12 +2192,24 @@ public PagedIterable listQueryResultsForPolicySetDefinition( final String skipToken = null; return new PagedIterable<>( listQueryResultsForPolicySetDefinitionAsync( - subscriptionId, policySetDefinitionName, top, orderBy, select, from, to, filter, apply, skipToken)); + policyEventsResource, + subscriptionId, + policySetDefinitionName, + top, + orderBy, + select, + from, + to, + filter, + apply, + skipToken)); } /** * Queries policy events for the subscription level policy set definition. * + * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only "default" is + * allowed. * @param subscriptionId Microsoft Azure subscription ID. * @param policySetDefinitionName Policy set definition name. * @param top Maximum number of records to return. @@ -1948,10 +2229,11 @@ public PagedIterable listQueryResultsForPolicySetDefinition( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listQueryResultsForPolicySetDefinition( + PolicyEventsResourceType policyEventsResource, String subscriptionId, String policySetDefinitionName, Integer top, @@ -1965,6 +2247,7 @@ public PagedIterable listQueryResultsForPolicySetDefinition( Context context) { return new PagedIterable<>( listQueryResultsForPolicySetDefinitionAsync( + policyEventsResource, subscriptionId, policySetDefinitionName, top, @@ -1981,6 +2264,8 @@ public PagedIterable listQueryResultsForPolicySetDefinition( /** * Queries policy events for the subscription level policy definition. * + * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only "default" is + * allowed. * @param subscriptionId Microsoft Azure subscription ID. * @param policyDefinitionName Policy definition name. * @param top Maximum number of records to return. @@ -1999,10 +2284,11 @@ public PagedIterable listQueryResultsForPolicySetDefinition( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listQueryResultsForPolicyDefinitionSinglePageAsync( + PolicyEventsResourceType policyEventsResource, String subscriptionId, String policyDefinitionName, Integer top, @@ -2019,6 +2305,10 @@ private Mono> listQueryResultsForPolicyDefinitio new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } + if (policyEventsResource == null) { + return Mono + .error(new IllegalArgumentException("Parameter policyEventsResource is required and cannot be null.")); + } if (subscriptionId == null) { return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); } @@ -2026,7 +2316,6 @@ private Mono> listQueryResultsForPolicyDefinitio return Mono .error(new IllegalArgumentException("Parameter policyDefinitionName is required and cannot be null.")); } - final String policyEventsResource = "default"; final String authorizationNamespace = "Microsoft.Authorization"; final String apiVersion = "2019-10-01"; final String accept = "application/json"; @@ -2066,6 +2355,8 @@ private Mono> listQueryResultsForPolicyDefinitio /** * Queries policy events for the subscription level policy definition. * + * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only "default" is + * allowed. * @param subscriptionId Microsoft Azure subscription ID. * @param policyDefinitionName Policy definition name. * @param top Maximum number of records to return. @@ -2085,10 +2376,11 @@ private Mono> listQueryResultsForPolicyDefinitio * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listQueryResultsForPolicyDefinitionSinglePageAsync( + PolicyEventsResourceType policyEventsResource, String subscriptionId, String policyDefinitionName, Integer top, @@ -2106,6 +2398,10 @@ private Mono> listQueryResultsForPolicyDefinitio new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } + if (policyEventsResource == null) { + return Mono + .error(new IllegalArgumentException("Parameter policyEventsResource is required and cannot be null.")); + } if (subscriptionId == null) { return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); } @@ -2113,7 +2409,6 @@ private Mono> listQueryResultsForPolicyDefinitio return Mono .error(new IllegalArgumentException("Parameter policyDefinitionName is required and cannot be null.")); } - final String policyEventsResource = "default"; final String authorizationNamespace = "Microsoft.Authorization"; final String apiVersion = "2019-10-01"; final String accept = "application/json"; @@ -2150,6 +2445,8 @@ private Mono> listQueryResultsForPolicyDefinitio /** * Queries policy events for the subscription level policy definition. * + * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only "default" is + * allowed. * @param subscriptionId Microsoft Azure subscription ID. * @param policyDefinitionName Policy definition name. * @param top Maximum number of records to return. @@ -2168,10 +2465,11 @@ private Mono> listQueryResultsForPolicyDefinitio * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listQueryResultsForPolicyDefinitionAsync( + PolicyEventsResourceType policyEventsResource, String subscriptionId, String policyDefinitionName, Integer top, @@ -2185,23 +2483,35 @@ private PagedFlux listQueryResultsForPolicyDefinitionAsync( return new PagedFlux<>( () -> listQueryResultsForPolicyDefinitionSinglePageAsync( - subscriptionId, policyDefinitionName, top, orderBy, select, from, to, filter, apply, skipToken), + policyEventsResource, + subscriptionId, + policyDefinitionName, + top, + orderBy, + select, + from, + to, + filter, + apply, + skipToken), nextLink -> nextLinkSinglePageAsync(nextLink)); } /** * Queries policy events for the subscription level policy definition. * + * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only "default" is + * allowed. * @param subscriptionId Microsoft Azure subscription ID. * @param policyDefinitionName Policy definition name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listQueryResultsForPolicyDefinitionAsync( - String subscriptionId, String policyDefinitionName) { + PolicyEventsResourceType policyEventsResource, String subscriptionId, String policyDefinitionName) { final Integer top = null; final String orderBy = null; final String select = null; @@ -2213,13 +2523,25 @@ private PagedFlux listQueryResultsForPolicyDefinitionAsync( return new PagedFlux<>( () -> listQueryResultsForPolicyDefinitionSinglePageAsync( - subscriptionId, policyDefinitionName, top, orderBy, select, from, to, filter, apply, skipToken), + policyEventsResource, + subscriptionId, + policyDefinitionName, + top, + orderBy, + select, + from, + to, + filter, + apply, + skipToken), nextLink -> nextLinkSinglePageAsync(nextLink)); } /** * Queries policy events for the subscription level policy definition. * + * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only "default" is + * allowed. * @param subscriptionId Microsoft Azure subscription ID. * @param policyDefinitionName Policy definition name. * @param top Maximum number of records to return. @@ -2239,10 +2561,11 @@ private PagedFlux listQueryResultsForPolicyDefinitionAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listQueryResultsForPolicyDefinitionAsync( + PolicyEventsResourceType policyEventsResource, String subscriptionId, String policyDefinitionName, Integer top, @@ -2257,6 +2580,7 @@ private PagedFlux listQueryResultsForPolicyDefinitionAsync( return new PagedFlux<>( () -> listQueryResultsForPolicyDefinitionSinglePageAsync( + policyEventsResource, subscriptionId, policyDefinitionName, top, @@ -2274,16 +2598,18 @@ private PagedFlux listQueryResultsForPolicyDefinitionAsync( /** * Queries policy events for the subscription level policy definition. * + * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only "default" is + * allowed. * @param subscriptionId Microsoft Azure subscription ID. * @param policyDefinitionName Policy definition name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listQueryResultsForPolicyDefinition( - String subscriptionId, String policyDefinitionName) { + PolicyEventsResourceType policyEventsResource, String subscriptionId, String policyDefinitionName) { final Integer top = null; final String orderBy = null; final String select = null; @@ -2294,12 +2620,24 @@ public PagedIterable listQueryResultsForPolicyDefinition( final String skipToken = null; return new PagedIterable<>( listQueryResultsForPolicyDefinitionAsync( - subscriptionId, policyDefinitionName, top, orderBy, select, from, to, filter, apply, skipToken)); + policyEventsResource, + subscriptionId, + policyDefinitionName, + top, + orderBy, + select, + from, + to, + filter, + apply, + skipToken)); } /** * Queries policy events for the subscription level policy definition. * + * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only "default" is + * allowed. * @param subscriptionId Microsoft Azure subscription ID. * @param policyDefinitionName Policy definition name. * @param top Maximum number of records to return. @@ -2319,10 +2657,11 @@ public PagedIterable listQueryResultsForPolicyDefinition( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listQueryResultsForPolicyDefinition( + PolicyEventsResourceType policyEventsResource, String subscriptionId, String policyDefinitionName, Integer top, @@ -2336,6 +2675,7 @@ public PagedIterable listQueryResultsForPolicyDefinition( Context context) { return new PagedIterable<>( listQueryResultsForPolicyDefinitionAsync( + policyEventsResource, subscriptionId, policyDefinitionName, top, @@ -2352,6 +2692,8 @@ public PagedIterable listQueryResultsForPolicyDefinition( /** * Queries policy events for the subscription level policy assignment. * + * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only "default" is + * allowed. * @param subscriptionId Microsoft Azure subscription ID. * @param policyAssignmentName Policy assignment name. * @param top Maximum number of records to return. @@ -2370,10 +2712,11 @@ public PagedIterable listQueryResultsForPolicyDefinition( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listQueryResultsForSubscriptionLevelPolicyAssignmentSinglePageAsync( + PolicyEventsResourceType policyEventsResource, String subscriptionId, String policyAssignmentName, Integer top, @@ -2390,6 +2733,10 @@ private Mono> listQueryResultsForSubscriptionLev new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } + if (policyEventsResource == null) { + return Mono + .error(new IllegalArgumentException("Parameter policyEventsResource is required and cannot be null.")); + } if (subscriptionId == null) { return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); } @@ -2397,7 +2744,6 @@ private Mono> listQueryResultsForSubscriptionLev return Mono .error(new IllegalArgumentException("Parameter policyAssignmentName is required and cannot be null.")); } - final String policyEventsResource = "default"; final String authorizationNamespace = "Microsoft.Authorization"; final String apiVersion = "2019-10-01"; final String accept = "application/json"; @@ -2437,6 +2783,8 @@ private Mono> listQueryResultsForSubscriptionLev /** * Queries policy events for the subscription level policy assignment. * + * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only "default" is + * allowed. * @param subscriptionId Microsoft Azure subscription ID. * @param policyAssignmentName Policy assignment name. * @param top Maximum number of records to return. @@ -2456,10 +2804,11 @@ private Mono> listQueryResultsForSubscriptionLev * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listQueryResultsForSubscriptionLevelPolicyAssignmentSinglePageAsync( + PolicyEventsResourceType policyEventsResource, String subscriptionId, String policyAssignmentName, Integer top, @@ -2477,6 +2826,10 @@ private Mono> listQueryResultsForSubscriptionLev new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } + if (policyEventsResource == null) { + return Mono + .error(new IllegalArgumentException("Parameter policyEventsResource is required and cannot be null.")); + } if (subscriptionId == null) { return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); } @@ -2484,7 +2837,6 @@ private Mono> listQueryResultsForSubscriptionLev return Mono .error(new IllegalArgumentException("Parameter policyAssignmentName is required and cannot be null.")); } - final String policyEventsResource = "default"; final String authorizationNamespace = "Microsoft.Authorization"; final String apiVersion = "2019-10-01"; final String accept = "application/json"; @@ -2521,6 +2873,8 @@ private Mono> listQueryResultsForSubscriptionLev /** * Queries policy events for the subscription level policy assignment. * + * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only "default" is + * allowed. * @param subscriptionId Microsoft Azure subscription ID. * @param policyAssignmentName Policy assignment name. * @param top Maximum number of records to return. @@ -2539,10 +2893,11 @@ private Mono> listQueryResultsForSubscriptionLev * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listQueryResultsForSubscriptionLevelPolicyAssignmentAsync( + PolicyEventsResourceType policyEventsResource, String subscriptionId, String policyAssignmentName, Integer top, @@ -2556,23 +2911,35 @@ private PagedFlux listQueryResultsForSubscriptionLevelPolicyAs return new PagedFlux<>( () -> listQueryResultsForSubscriptionLevelPolicyAssignmentSinglePageAsync( - subscriptionId, policyAssignmentName, top, orderBy, select, from, to, filter, apply, skipToken), + policyEventsResource, + subscriptionId, + policyAssignmentName, + top, + orderBy, + select, + from, + to, + filter, + apply, + skipToken), nextLink -> nextLinkSinglePageAsync(nextLink)); } /** * Queries policy events for the subscription level policy assignment. * + * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only "default" is + * allowed. * @param subscriptionId Microsoft Azure subscription ID. * @param policyAssignmentName Policy assignment name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listQueryResultsForSubscriptionLevelPolicyAssignmentAsync( - String subscriptionId, String policyAssignmentName) { + PolicyEventsResourceType policyEventsResource, String subscriptionId, String policyAssignmentName) { final Integer top = null; final String orderBy = null; final String select = null; @@ -2584,13 +2951,25 @@ private PagedFlux listQueryResultsForSubscriptionLevelPolicyAs return new PagedFlux<>( () -> listQueryResultsForSubscriptionLevelPolicyAssignmentSinglePageAsync( - subscriptionId, policyAssignmentName, top, orderBy, select, from, to, filter, apply, skipToken), + policyEventsResource, + subscriptionId, + policyAssignmentName, + top, + orderBy, + select, + from, + to, + filter, + apply, + skipToken), nextLink -> nextLinkSinglePageAsync(nextLink)); } /** * Queries policy events for the subscription level policy assignment. * + * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only "default" is + * allowed. * @param subscriptionId Microsoft Azure subscription ID. * @param policyAssignmentName Policy assignment name. * @param top Maximum number of records to return. @@ -2610,10 +2989,11 @@ private PagedFlux listQueryResultsForSubscriptionLevelPolicyAs * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listQueryResultsForSubscriptionLevelPolicyAssignmentAsync( + PolicyEventsResourceType policyEventsResource, String subscriptionId, String policyAssignmentName, Integer top, @@ -2628,6 +3008,7 @@ private PagedFlux listQueryResultsForSubscriptionLevelPolicyAs return new PagedFlux<>( () -> listQueryResultsForSubscriptionLevelPolicyAssignmentSinglePageAsync( + policyEventsResource, subscriptionId, policyAssignmentName, top, @@ -2645,16 +3026,18 @@ private PagedFlux listQueryResultsForSubscriptionLevelPolicyAs /** * Queries policy events for the subscription level policy assignment. * + * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only "default" is + * allowed. * @param subscriptionId Microsoft Azure subscription ID. * @param policyAssignmentName Policy assignment name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listQueryResultsForSubscriptionLevelPolicyAssignment( - String subscriptionId, String policyAssignmentName) { + PolicyEventsResourceType policyEventsResource, String subscriptionId, String policyAssignmentName) { final Integer top = null; final String orderBy = null; final String select = null; @@ -2665,12 +3048,24 @@ public PagedIterable listQueryResultsForSubscriptionLevelPolic final String skipToken = null; return new PagedIterable<>( listQueryResultsForSubscriptionLevelPolicyAssignmentAsync( - subscriptionId, policyAssignmentName, top, orderBy, select, from, to, filter, apply, skipToken)); + policyEventsResource, + subscriptionId, + policyAssignmentName, + top, + orderBy, + select, + from, + to, + filter, + apply, + skipToken)); } /** * Queries policy events for the subscription level policy assignment. * + * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only "default" is + * allowed. * @param subscriptionId Microsoft Azure subscription ID. * @param policyAssignmentName Policy assignment name. * @param top Maximum number of records to return. @@ -2690,10 +3085,11 @@ public PagedIterable listQueryResultsForSubscriptionLevelPolic * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listQueryResultsForSubscriptionLevelPolicyAssignment( + PolicyEventsResourceType policyEventsResource, String subscriptionId, String policyAssignmentName, Integer top, @@ -2707,6 +3103,7 @@ public PagedIterable listQueryResultsForSubscriptionLevelPolic Context context) { return new PagedIterable<>( listQueryResultsForSubscriptionLevelPolicyAssignmentAsync( + policyEventsResource, subscriptionId, policyAssignmentName, top, @@ -2723,6 +3120,8 @@ public PagedIterable listQueryResultsForSubscriptionLevelPolic /** * Queries policy events for the resource group level policy assignment. * + * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only "default" is + * allowed. * @param subscriptionId Microsoft Azure subscription ID. * @param resourceGroupName Resource group name. * @param policyAssignmentName Policy assignment name. @@ -2742,10 +3141,11 @@ public PagedIterable listQueryResultsForSubscriptionLevelPolic * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listQueryResultsForResourceGroupLevelPolicyAssignmentSinglePageAsync( + PolicyEventsResourceType policyEventsResource, String subscriptionId, String resourceGroupName, String policyAssignmentName, @@ -2763,6 +3163,10 @@ private Mono> listQueryResultsForResourceGroupLe new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } + if (policyEventsResource == null) { + return Mono + .error(new IllegalArgumentException("Parameter policyEventsResource is required and cannot be null.")); + } if (subscriptionId == null) { return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); } @@ -2774,7 +3178,6 @@ private Mono> listQueryResultsForResourceGroupLe return Mono .error(new IllegalArgumentException("Parameter policyAssignmentName is required and cannot be null.")); } - final String policyEventsResource = "default"; final String authorizationNamespace = "Microsoft.Authorization"; final String apiVersion = "2019-10-01"; final String accept = "application/json"; @@ -2815,6 +3218,8 @@ private Mono> listQueryResultsForResourceGroupLe /** * Queries policy events for the resource group level policy assignment. * + * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only "default" is + * allowed. * @param subscriptionId Microsoft Azure subscription ID. * @param resourceGroupName Resource group name. * @param policyAssignmentName Policy assignment name. @@ -2835,10 +3240,11 @@ private Mono> listQueryResultsForResourceGroupLe * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listQueryResultsForResourceGroupLevelPolicyAssignmentSinglePageAsync( + PolicyEventsResourceType policyEventsResource, String subscriptionId, String resourceGroupName, String policyAssignmentName, @@ -2857,6 +3263,10 @@ private Mono> listQueryResultsForResourceGroupLe new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } + if (policyEventsResource == null) { + return Mono + .error(new IllegalArgumentException("Parameter policyEventsResource is required and cannot be null.")); + } if (subscriptionId == null) { return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); } @@ -2868,7 +3278,6 @@ private Mono> listQueryResultsForResourceGroupLe return Mono .error(new IllegalArgumentException("Parameter policyAssignmentName is required and cannot be null.")); } - final String policyEventsResource = "default"; final String authorizationNamespace = "Microsoft.Authorization"; final String apiVersion = "2019-10-01"; final String accept = "application/json"; @@ -2906,6 +3315,8 @@ private Mono> listQueryResultsForResourceGroupLe /** * Queries policy events for the resource group level policy assignment. * + * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only "default" is + * allowed. * @param subscriptionId Microsoft Azure subscription ID. * @param resourceGroupName Resource group name. * @param policyAssignmentName Policy assignment name. @@ -2925,10 +3336,11 @@ private Mono> listQueryResultsForResourceGroupLe * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listQueryResultsForResourceGroupLevelPolicyAssignmentAsync( + PolicyEventsResourceType policyEventsResource, String subscriptionId, String resourceGroupName, String policyAssignmentName, @@ -2943,6 +3355,7 @@ private PagedFlux listQueryResultsForResourceGroupLevelPolicyA return new PagedFlux<>( () -> listQueryResultsForResourceGroupLevelPolicyAssignmentSinglePageAsync( + policyEventsResource, subscriptionId, resourceGroupName, policyAssignmentName, @@ -2960,17 +3373,22 @@ private PagedFlux listQueryResultsForResourceGroupLevelPolicyA /** * Queries policy events for the resource group level policy assignment. * + * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only "default" is + * allowed. * @param subscriptionId Microsoft Azure subscription ID. * @param resourceGroupName Resource group name. * @param policyAssignmentName Policy assignment name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listQueryResultsForResourceGroupLevelPolicyAssignmentAsync( - String subscriptionId, String resourceGroupName, String policyAssignmentName) { + PolicyEventsResourceType policyEventsResource, + String subscriptionId, + String resourceGroupName, + String policyAssignmentName) { final Integer top = null; final String orderBy = null; final String select = null; @@ -2982,6 +3400,7 @@ private PagedFlux listQueryResultsForResourceGroupLevelPolicyA return new PagedFlux<>( () -> listQueryResultsForResourceGroupLevelPolicyAssignmentSinglePageAsync( + policyEventsResource, subscriptionId, resourceGroupName, policyAssignmentName, @@ -2999,6 +3418,8 @@ private PagedFlux listQueryResultsForResourceGroupLevelPolicyA /** * Queries policy events for the resource group level policy assignment. * + * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only "default" is + * allowed. * @param subscriptionId Microsoft Azure subscription ID. * @param resourceGroupName Resource group name. * @param policyAssignmentName Policy assignment name. @@ -3019,10 +3440,11 @@ private PagedFlux listQueryResultsForResourceGroupLevelPolicyA * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listQueryResultsForResourceGroupLevelPolicyAssignmentAsync( + PolicyEventsResourceType policyEventsResource, String subscriptionId, String resourceGroupName, String policyAssignmentName, @@ -3038,6 +3460,7 @@ private PagedFlux listQueryResultsForResourceGroupLevelPolicyA return new PagedFlux<>( () -> listQueryResultsForResourceGroupLevelPolicyAssignmentSinglePageAsync( + policyEventsResource, subscriptionId, resourceGroupName, policyAssignmentName, @@ -3056,17 +3479,22 @@ private PagedFlux listQueryResultsForResourceGroupLevelPolicyA /** * Queries policy events for the resource group level policy assignment. * + * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only "default" is + * allowed. * @param subscriptionId Microsoft Azure subscription ID. * @param resourceGroupName Resource group name. * @param policyAssignmentName Policy assignment name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listQueryResultsForResourceGroupLevelPolicyAssignment( - String subscriptionId, String resourceGroupName, String policyAssignmentName) { + PolicyEventsResourceType policyEventsResource, + String subscriptionId, + String resourceGroupName, + String policyAssignmentName) { final Integer top = null; final String orderBy = null; final String select = null; @@ -3077,6 +3505,7 @@ public PagedIterable listQueryResultsForResourceGroupLevelPoli final String skipToken = null; return new PagedIterable<>( listQueryResultsForResourceGroupLevelPolicyAssignmentAsync( + policyEventsResource, subscriptionId, resourceGroupName, policyAssignmentName, @@ -3093,6 +3522,8 @@ public PagedIterable listQueryResultsForResourceGroupLevelPoli /** * Queries policy events for the resource group level policy assignment. * + * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only "default" is + * allowed. * @param subscriptionId Microsoft Azure subscription ID. * @param resourceGroupName Resource group name. * @param policyAssignmentName Policy assignment name. @@ -3113,10 +3544,11 @@ public PagedIterable listQueryResultsForResourceGroupLevelPoli * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listQueryResultsForResourceGroupLevelPolicyAssignment( + PolicyEventsResourceType policyEventsResource, String subscriptionId, String resourceGroupName, String policyAssignmentName, @@ -3131,6 +3563,7 @@ public PagedIterable listQueryResultsForResourceGroupLevelPoli Context context) { return new PagedIterable<>( listQueryResultsForResourceGroupLevelPolicyAssignmentAsync( + policyEventsResource, subscriptionId, resourceGroupName, policyAssignmentName, @@ -3148,11 +3581,12 @@ public PagedIterable listQueryResultsForResourceGroupLevelPoli /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @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 query results. + * @return query results along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> nextLinkSinglePageAsync(String nextLink) { @@ -3176,12 +3610,13 @@ private Mono> nextLinkSinglePageAsync(String nex /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @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 query results. + * @return query results along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> nextLinkSinglePageAsync(String nextLink, Context context) { diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/implementation/PolicyEventsImpl.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/implementation/PolicyEventsImpl.java index 6c29f0f18858..f4ad89712c58 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/implementation/PolicyEventsImpl.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/implementation/PolicyEventsImpl.java @@ -11,11 +11,11 @@ import com.azure.resourcemanager.policyinsights.fluent.models.PolicyEventInner; import com.azure.resourcemanager.policyinsights.models.PolicyEvent; import com.azure.resourcemanager.policyinsights.models.PolicyEvents; -import com.fasterxml.jackson.annotation.JsonIgnore; +import com.azure.resourcemanager.policyinsights.models.PolicyEventsResourceType; import java.time.OffsetDateTime; public final class PolicyEventsImpl implements PolicyEvents { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PolicyEventsImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(PolicyEventsImpl.class); private final PolicyEventsClient innerClient; @@ -27,13 +27,15 @@ public PolicyEventsImpl( this.serviceManager = serviceManager; } - public PagedIterable listQueryResultsForManagementGroup(String managementGroupName) { + public PagedIterable listQueryResultsForManagementGroup( + PolicyEventsResourceType policyEventsResource, String managementGroupName) { PagedIterable inner = - this.serviceClient().listQueryResultsForManagementGroup(managementGroupName); + this.serviceClient().listQueryResultsForManagementGroup(policyEventsResource, managementGroupName); return Utils.mapPage(inner, inner1 -> new PolicyEventImpl(inner1, this.manager())); } public PagedIterable listQueryResultsForManagementGroup( + PolicyEventsResourceType policyEventsResource, String managementGroupName, Integer top, String orderBy, @@ -48,16 +50,29 @@ public PagedIterable listQueryResultsForManagementGroup( this .serviceClient() .listQueryResultsForManagementGroup( - managementGroupName, top, orderBy, select, from, to, filter, apply, skipToken, context); + policyEventsResource, + managementGroupName, + top, + orderBy, + select, + from, + to, + filter, + apply, + skipToken, + context); return Utils.mapPage(inner, inner1 -> new PolicyEventImpl(inner1, this.manager())); } - public PagedIterable listQueryResultsForSubscription(String subscriptionId) { - PagedIterable inner = this.serviceClient().listQueryResultsForSubscription(subscriptionId); + public PagedIterable listQueryResultsForSubscription( + PolicyEventsResourceType policyEventsResource, String subscriptionId) { + PagedIterable inner = + this.serviceClient().listQueryResultsForSubscription(policyEventsResource, subscriptionId); return Utils.mapPage(inner, inner1 -> new PolicyEventImpl(inner1, this.manager())); } public PagedIterable listQueryResultsForSubscription( + PolicyEventsResourceType policyEventsResource, String subscriptionId, Integer top, String orderBy, @@ -72,18 +87,31 @@ public PagedIterable listQueryResultsForSubscription( this .serviceClient() .listQueryResultsForSubscription( - subscriptionId, top, orderBy, select, from, to, filter, apply, skipToken, context); + policyEventsResource, + subscriptionId, + top, + orderBy, + select, + from, + to, + filter, + apply, + skipToken, + context); return Utils.mapPage(inner, inner1 -> new PolicyEventImpl(inner1, this.manager())); } public PagedIterable listQueryResultsForResourceGroup( - String subscriptionId, String resourceGroupName) { + PolicyEventsResourceType policyEventsResource, String subscriptionId, String resourceGroupName) { PagedIterable inner = - this.serviceClient().listQueryResultsForResourceGroup(subscriptionId, resourceGroupName); + this + .serviceClient() + .listQueryResultsForResourceGroup(policyEventsResource, subscriptionId, resourceGroupName); return Utils.mapPage(inner, inner1 -> new PolicyEventImpl(inner1, this.manager())); } public PagedIterable listQueryResultsForResourceGroup( + PolicyEventsResourceType policyEventsResource, String subscriptionId, String resourceGroupName, Integer top, @@ -99,6 +127,7 @@ public PagedIterable listQueryResultsForResourceGroup( this .serviceClient() .listQueryResultsForResourceGroup( + policyEventsResource, subscriptionId, resourceGroupName, top, @@ -113,12 +142,15 @@ public PagedIterable listQueryResultsForResourceGroup( return Utils.mapPage(inner, inner1 -> new PolicyEventImpl(inner1, this.manager())); } - public PagedIterable listQueryResultsForResource(String resourceId) { - PagedIterable inner = this.serviceClient().listQueryResultsForResource(resourceId); + public PagedIterable listQueryResultsForResource( + PolicyEventsResourceType policyEventsResource, String resourceId) { + PagedIterable inner = + this.serviceClient().listQueryResultsForResource(policyEventsResource, resourceId); return Utils.mapPage(inner, inner1 -> new PolicyEventImpl(inner1, this.manager())); } public PagedIterable listQueryResultsForResource( + PolicyEventsResourceType policyEventsResource, String resourceId, Integer top, String orderBy, @@ -134,18 +166,32 @@ public PagedIterable listQueryResultsForResource( this .serviceClient() .listQueryResultsForResource( - resourceId, top, orderBy, select, from, to, filter, apply, expand, skipToken, context); + policyEventsResource, + resourceId, + top, + orderBy, + select, + from, + to, + filter, + apply, + expand, + skipToken, + context); return Utils.mapPage(inner, inner1 -> new PolicyEventImpl(inner1, this.manager())); } public PagedIterable listQueryResultsForPolicySetDefinition( - String subscriptionId, String policySetDefinitionName) { + PolicyEventsResourceType policyEventsResource, String subscriptionId, String policySetDefinitionName) { PagedIterable inner = - this.serviceClient().listQueryResultsForPolicySetDefinition(subscriptionId, policySetDefinitionName); + this + .serviceClient() + .listQueryResultsForPolicySetDefinition(policyEventsResource, subscriptionId, policySetDefinitionName); return Utils.mapPage(inner, inner1 -> new PolicyEventImpl(inner1, this.manager())); } public PagedIterable listQueryResultsForPolicySetDefinition( + PolicyEventsResourceType policyEventsResource, String subscriptionId, String policySetDefinitionName, Integer top, @@ -161,6 +207,7 @@ public PagedIterable listQueryResultsForPolicySetDefinition( this .serviceClient() .listQueryResultsForPolicySetDefinition( + policyEventsResource, subscriptionId, policySetDefinitionName, top, @@ -176,13 +223,16 @@ public PagedIterable listQueryResultsForPolicySetDefinition( } public PagedIterable listQueryResultsForPolicyDefinition( - String subscriptionId, String policyDefinitionName) { + PolicyEventsResourceType policyEventsResource, String subscriptionId, String policyDefinitionName) { PagedIterable inner = - this.serviceClient().listQueryResultsForPolicyDefinition(subscriptionId, policyDefinitionName); + this + .serviceClient() + .listQueryResultsForPolicyDefinition(policyEventsResource, subscriptionId, policyDefinitionName); return Utils.mapPage(inner, inner1 -> new PolicyEventImpl(inner1, this.manager())); } public PagedIterable listQueryResultsForPolicyDefinition( + PolicyEventsResourceType policyEventsResource, String subscriptionId, String policyDefinitionName, Integer top, @@ -198,6 +248,7 @@ public PagedIterable listQueryResultsForPolicyDefinition( this .serviceClient() .listQueryResultsForPolicyDefinition( + policyEventsResource, subscriptionId, policyDefinitionName, top, @@ -213,15 +264,17 @@ public PagedIterable listQueryResultsForPolicyDefinition( } public PagedIterable listQueryResultsForSubscriptionLevelPolicyAssignment( - String subscriptionId, String policyAssignmentName) { + PolicyEventsResourceType policyEventsResource, String subscriptionId, String policyAssignmentName) { PagedIterable inner = this .serviceClient() - .listQueryResultsForSubscriptionLevelPolicyAssignment(subscriptionId, policyAssignmentName); + .listQueryResultsForSubscriptionLevelPolicyAssignment( + policyEventsResource, subscriptionId, policyAssignmentName); return Utils.mapPage(inner, inner1 -> new PolicyEventImpl(inner1, this.manager())); } public PagedIterable listQueryResultsForSubscriptionLevelPolicyAssignment( + PolicyEventsResourceType policyEventsResource, String subscriptionId, String policyAssignmentName, Integer top, @@ -237,6 +290,7 @@ public PagedIterable listQueryResultsForSubscriptionLevelPolicyAssi this .serviceClient() .listQueryResultsForSubscriptionLevelPolicyAssignment( + policyEventsResource, subscriptionId, policyAssignmentName, top, @@ -252,16 +306,20 @@ public PagedIterable listQueryResultsForSubscriptionLevelPolicyAssi } public PagedIterable listQueryResultsForResourceGroupLevelPolicyAssignment( - String subscriptionId, String resourceGroupName, String policyAssignmentName) { + PolicyEventsResourceType policyEventsResource, + String subscriptionId, + String resourceGroupName, + String policyAssignmentName) { PagedIterable inner = this .serviceClient() .listQueryResultsForResourceGroupLevelPolicyAssignment( - subscriptionId, resourceGroupName, policyAssignmentName); + policyEventsResource, subscriptionId, resourceGroupName, policyAssignmentName); return Utils.mapPage(inner, inner1 -> new PolicyEventImpl(inner1, this.manager())); } public PagedIterable listQueryResultsForResourceGroupLevelPolicyAssignment( + PolicyEventsResourceType policyEventsResource, String subscriptionId, String resourceGroupName, String policyAssignmentName, @@ -278,6 +336,7 @@ public PagedIterable listQueryResultsForResourceGroupLevelPolicyAss this .serviceClient() .listQueryResultsForResourceGroupLevelPolicyAssignment( + policyEventsResource, subscriptionId, resourceGroupName, policyAssignmentName, diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/implementation/PolicyInsightsClientBuilder.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/implementation/PolicyInsightsClientBuilder.java index e11a30c78ed2..5c5ddc1fa4c9 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/implementation/PolicyInsightsClientBuilder.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/implementation/PolicyInsightsClientBuilder.java @@ -7,7 +7,6 @@ import com.azure.core.annotation.ServiceClientBuilder; import com.azure.core.http.HttpPipeline; import com.azure.core.http.HttpPipelineBuilder; -import com.azure.core.http.policy.CookiePolicy; import com.azure.core.http.policy.RetryPolicy; import com.azure.core.http.policy.UserAgentPolicy; import com.azure.core.management.AzureEnvironment; @@ -67,34 +66,34 @@ public PolicyInsightsClientBuilder environment(AzureEnvironment environment) { } /* - * The default poll interval for long-running operation + * The HTTP pipeline to send requests through */ - private Duration defaultPollInterval; + private HttpPipeline pipeline; /** - * Sets The default poll interval for long-running operation. + * Sets The HTTP pipeline to send requests through. * - * @param defaultPollInterval the defaultPollInterval value. + * @param pipeline the pipeline value. * @return the PolicyInsightsClientBuilder. */ - public PolicyInsightsClientBuilder defaultPollInterval(Duration defaultPollInterval) { - this.defaultPollInterval = defaultPollInterval; + public PolicyInsightsClientBuilder pipeline(HttpPipeline pipeline) { + this.pipeline = pipeline; return this; } /* - * The HTTP pipeline to send requests through + * The default poll interval for long-running operation */ - private HttpPipeline pipeline; + private Duration defaultPollInterval; /** - * Sets The HTTP pipeline to send requests through. + * Sets The default poll interval for long-running operation. * - * @param pipeline the pipeline value. + * @param defaultPollInterval the defaultPollInterval value. * @return the PolicyInsightsClientBuilder. */ - public PolicyInsightsClientBuilder pipeline(HttpPipeline pipeline) { - this.pipeline = pipeline; + public PolicyInsightsClientBuilder defaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = defaultPollInterval; return this; } @@ -120,27 +119,26 @@ public PolicyInsightsClientBuilder serializerAdapter(SerializerAdapter serialize * @return an instance of PolicyInsightsClientImpl. */ public PolicyInsightsClientImpl buildClient() { - if (endpoint == null) { - this.endpoint = "https://management.azure.com"; - } - if (environment == null) { - this.environment = AzureEnvironment.AZURE; - } - if (defaultPollInterval == null) { - this.defaultPollInterval = Duration.ofSeconds(30); - } - if (pipeline == null) { - this.pipeline = - new HttpPipelineBuilder() - .policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy()) - .build(); - } - if (serializerAdapter == null) { - this.serializerAdapter = SerializerFactory.createDefaultManagementSerializerAdapter(); - } + String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com"; + AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE; + HttpPipeline localPipeline = + (pipeline != null) + ? pipeline + : new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); + Duration localDefaultPollInterval = + (defaultPollInterval != null) ? defaultPollInterval : Duration.ofSeconds(30); + SerializerAdapter localSerializerAdapter = + (serializerAdapter != null) + ? serializerAdapter + : SerializerFactory.createDefaultManagementSerializerAdapter(); PolicyInsightsClientImpl client = new PolicyInsightsClientImpl( - pipeline, serializerAdapter, defaultPollInterval, environment, subscriptionId, endpoint); + localPipeline, + localSerializerAdapter, + localDefaultPollInterval, + localEnvironment, + subscriptionId, + localEndpoint); return client; } } diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/implementation/PolicyInsightsClientImpl.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/implementation/PolicyInsightsClientImpl.java index a50c41f4ce8d..a0824d9f3d92 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/implementation/PolicyInsightsClientImpl.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/implementation/PolicyInsightsClientImpl.java @@ -15,6 +15,7 @@ import com.azure.core.management.polling.PollResult; import com.azure.core.management.polling.PollerFactory; import com.azure.core.util.Context; +import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.AsyncPollResponse; import com.azure.core.util.polling.LongRunningOperationStatus; @@ -36,15 +37,12 @@ import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; import java.time.Duration; -import java.util.Map; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; /** Initializes a new instance of the PolicyInsightsClientImpl type. */ @ServiceClient(builder = PolicyInsightsClientBuilder.class) public final class PolicyInsightsClientImpl implements PolicyInsightsClient { - private final ClientLogger logger = new ClientLogger(PolicyInsightsClientImpl.class); - /** Microsoft Azure subscription ID. */ private final String subscriptionId; @@ -249,10 +247,7 @@ public Context getContext() { * @return the merged context. */ public Context mergeContext(Context context) { - for (Map.Entry entry : this.getContext().getValues().entrySet()) { - context = context.addData(entry.getKey(), entry.getValue()); - } - return context; + return CoreUtils.mergeContexts(this.getContext(), context); } /** @@ -316,7 +311,7 @@ public Mono getLroFinalResultOrError(AsyncPollResponse, managementError = null; } } catch (IOException | RuntimeException ioe) { - logger.logThrowableAsWarning(ioe); + LOGGER.logThrowableAsWarning(ioe); } } } else { @@ -375,4 +370,6 @@ public Mono getBodyAsString(Charset charset) { return Mono.just(new String(responseBody, charset)); } } + + private static final ClientLogger LOGGER = new ClientLogger(PolicyInsightsClientImpl.class); } diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/implementation/PolicyMetadatasClientImpl.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/implementation/PolicyMetadatasClientImpl.java index 2d2a19c27e15..ebdb2c9765b7 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/implementation/PolicyMetadatasClientImpl.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/implementation/PolicyMetadatasClientImpl.java @@ -25,7 +25,6 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.policyinsights.fluent.PolicyMetadatasClient; import com.azure.resourcemanager.policyinsights.fluent.models.PolicyMetadataInner; import com.azure.resourcemanager.policyinsights.fluent.models.SlimPolicyMetadataInner; @@ -34,8 +33,6 @@ /** An instance of this class provides access to all the operations defined in PolicyMetadatasClient. */ public final class PolicyMetadatasClientImpl implements PolicyMetadatasClient { - private final ClientLogger logger = new ClientLogger(PolicyMetadatasClientImpl.class); - /** The proxy service used to perform REST calls. */ private final PolicyMetadatasService service; @@ -100,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 policy metadata resource. + * @return policy metadata resource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getResourceWithResponseAsync(String resourceName) { @@ -129,7 +126,7 @@ private Mono> getResourceWithResponseAsync(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 policy metadata resource. + * @return policy metadata resource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getResourceWithResponseAsync(String resourceName, Context context) { @@ -155,19 +152,11 @@ private Mono> getResourceWithResponseAsync(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 policy metadata resource. + * @return policy metadata resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getResourceAsync(String resourceName) { - return getResourceWithResponseAsync(resourceName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + return getResourceWithResponseAsync(resourceName).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -192,7 +181,7 @@ public PolicyMetadataInner getResource(String resourceName) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return policy metadata resource. + * @return policy metadata resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getResourceWithResponse(String resourceName, Context context) { @@ -206,7 +195,8 @@ public Response getResourceWithResponse(String resourceName * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 the policy metadata resources. + * @return a list of the policy metadata resources along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(Integer top) { @@ -240,7 +230,8 @@ private Mono> listSinglePageAsync(Integer * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 the policy metadata resources. + * @return a list of the policy metadata resources along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(Integer top, Context context) { @@ -273,7 +264,7 @@ private Mono> listSinglePageAsync(Integer * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 the policy metadata resources. + * @return a list of the policy metadata resources as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(Integer top) { @@ -285,7 +276,7 @@ private PagedFlux listAsync(Integer top) { * * @throws 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 the policy metadata resources. + * @return a list of the policy metadata resources as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync() { @@ -301,7 +292,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 the policy metadata resources. + * @return a list of the policy metadata resources as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(Integer top, Context context) { @@ -314,7 +305,7 @@ private PagedFlux listAsync(Integer top, Context contex * * @throws 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 the policy metadata resources. + * @return a list of the policy metadata resources as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { @@ -330,7 +321,7 @@ 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 a list of the policy metadata resources. + * @return a list of the policy metadata resources as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(Integer top, Context context) { @@ -340,11 +331,13 @@ public PagedIterable list(Integer top, Context context) /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @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 collection of policy metadata resources. + * @return collection of policy metadata resources along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -375,12 +368,14 @@ private Mono> listNextSinglePageAsync(Str /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @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 collection of policy metadata resources. + * @return collection of policy metadata resources 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/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/implementation/PolicyMetadatasImpl.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/implementation/PolicyMetadatasImpl.java index dbe92ddfcf85..fa410bc74ee7 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/implementation/PolicyMetadatasImpl.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/implementation/PolicyMetadatasImpl.java @@ -15,10 +15,9 @@ import com.azure.resourcemanager.policyinsights.models.PolicyMetadata; import com.azure.resourcemanager.policyinsights.models.PolicyMetadatas; import com.azure.resourcemanager.policyinsights.models.SlimPolicyMetadata; -import com.fasterxml.jackson.annotation.JsonIgnore; public final class PolicyMetadatasImpl implements PolicyMetadatas { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PolicyMetadatasImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(PolicyMetadatasImpl.class); private final PolicyMetadatasClient innerClient; diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/implementation/PolicyRestrictionsClientImpl.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/implementation/PolicyRestrictionsClientImpl.java index a072a599a08a..a7bae2bc996f 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/implementation/PolicyRestrictionsClientImpl.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/implementation/PolicyRestrictionsClientImpl.java @@ -22,16 +22,14 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.policyinsights.fluent.PolicyRestrictionsClient; import com.azure.resourcemanager.policyinsights.fluent.models.CheckRestrictionsResultInner; +import com.azure.resourcemanager.policyinsights.models.CheckManagementGroupRestrictionsRequest; import com.azure.resourcemanager.policyinsights.models.CheckRestrictionsRequest; import reactor.core.publisher.Mono; /** An instance of this class provides access to all the operations defined in PolicyRestrictionsClient. */ public final class PolicyRestrictionsClientImpl implements PolicyRestrictionsClient { - private final ClientLogger logger = new ClientLogger(PolicyRestrictionsClientImpl.class); - /** The proxy service used to perform REST calls. */ private final PolicyRestrictionsService service; @@ -82,6 +80,21 @@ Mono> checkAtResourceGroupScope( @BodyParam("application/json") CheckRestrictionsRequest parameters, @HeaderParam("Accept") String accept, Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/providers/{managementGroupsNamespace}/managementGroups/{managementGroupId}/providers" + + "/Microsoft.PolicyInsights/checkPolicyRestrictions") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> checkAtManagementGroupScope( + @HostParam("$host") String endpoint, + @PathParam("managementGroupsNamespace") String managementGroupsNamespace, + @PathParam("managementGroupId") String managementGroupId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") CheckManagementGroupRestrictionsRequest parameters, + @HeaderParam("Accept") String accept, + Context context); } /** @@ -91,7 +104,8 @@ Mono> checkAtResourceGroupScope( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 result of a check policy restrictions evaluation on a resource. + * @return the result of a check policy restrictions evaluation on a resource along with {@link Response} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> checkAtSubscriptionScopeWithResponseAsync( @@ -113,7 +127,7 @@ private Mono> checkAtSubscriptionScopeWit } else { parameters.validate(); } - final String apiVersion = "2020-07-01"; + final String apiVersion = "2022-03-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -137,7 +151,8 @@ private Mono> checkAtSubscriptionScopeWit * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 result of a check policy restrictions evaluation on a resource. + * @return the result of a check policy restrictions evaluation on a resource along with {@link Response} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> checkAtSubscriptionScopeWithResponseAsync( @@ -159,7 +174,7 @@ private Mono> checkAtSubscriptionScopeWit } else { parameters.validate(); } - final String apiVersion = "2020-07-01"; + final String apiVersion = "2022-03-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -174,19 +189,12 @@ private Mono> checkAtSubscriptionScopeWit * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 result of a check policy restrictions evaluation on a resource. + * @return the result of a check policy restrictions evaluation on a resource on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono checkAtSubscriptionScopeAsync(CheckRestrictionsRequest parameters) { - return checkAtSubscriptionScopeWithResponseAsync(parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + return checkAtSubscriptionScopeWithResponseAsync(parameters).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -211,7 +219,7 @@ public CheckRestrictionsResultInner checkAtSubscriptionScope(CheckRestrictionsRe * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 result of a check policy restrictions evaluation on a resource. + * @return the result of a check policy restrictions evaluation on a resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response checkAtSubscriptionScopeWithResponse( @@ -228,7 +236,8 @@ public Response checkAtSubscriptionScopeWithRespon * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 result of a check policy restrictions evaluation on a resource. + * @return the result of a check policy restrictions evaluation on a resource along with {@link Response} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> checkAtResourceGroupScopeWithResponseAsync( @@ -254,7 +263,7 @@ private Mono> checkAtResourceGroupScopeWi } else { parameters.validate(); } - final String apiVersion = "2020-07-01"; + final String apiVersion = "2022-03-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -281,7 +290,8 @@ private Mono> checkAtResourceGroupScopeWi * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 result of a check policy restrictions evaluation on a resource. + * @return the result of a check policy restrictions evaluation on a resource along with {@link Response} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> checkAtResourceGroupScopeWithResponseAsync( @@ -307,7 +317,7 @@ private Mono> checkAtResourceGroupScopeWi } else { parameters.validate(); } - final String apiVersion = "2020-07-01"; + final String apiVersion = "2022-03-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -330,20 +340,14 @@ private Mono> checkAtResourceGroupScopeWi * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 result of a check policy restrictions evaluation on a resource. + * @return the result of a check policy restrictions evaluation on a resource on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono checkAtResourceGroupScopeAsync( String resourceGroupName, CheckRestrictionsRequest parameters) { return checkAtResourceGroupScopeWithResponseAsync(resourceGroupName, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -373,11 +377,154 @@ public CheckRestrictionsResultInner checkAtResourceGroupScope( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 result of a check policy restrictions evaluation on a resource. + * @return the result of a check policy restrictions evaluation on a resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response checkAtResourceGroupScopeWithResponse( String resourceGroupName, CheckRestrictionsRequest parameters, Context context) { return checkAtResourceGroupScopeWithResponseAsync(resourceGroupName, parameters, context).block(); } + + /** + * Checks what restrictions Azure Policy will place on resources within a management group. + * + * @param managementGroupId Management group ID. + * @param parameters The check policy restrictions parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 result of a check policy restrictions evaluation on a resource along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkAtManagementGroupScopeWithResponseAsync( + String managementGroupId, CheckManagementGroupRestrictionsRequest parameters) { + 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 (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String managementGroupsNamespace = "Microsoft.Management"; + final String apiVersion = "2022-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .checkAtManagementGroupScope( + this.client.getEndpoint(), + managementGroupsNamespace, + managementGroupId, + apiVersion, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Checks what restrictions Azure Policy will place on resources within a management group. + * + * @param managementGroupId Management group ID. + * @param parameters The check policy restrictions parameters. + * @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 result of a check policy restrictions evaluation on a resource along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkAtManagementGroupScopeWithResponseAsync( + String managementGroupId, CheckManagementGroupRestrictionsRequest parameters, 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 (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String managementGroupsNamespace = "Microsoft.Management"; + final String apiVersion = "2022-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .checkAtManagementGroupScope( + this.client.getEndpoint(), + managementGroupsNamespace, + managementGroupId, + apiVersion, + parameters, + accept, + context); + } + + /** + * Checks what restrictions Azure Policy will place on resources within a management group. + * + * @param managementGroupId Management group ID. + * @param parameters The check policy restrictions parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 result of a check policy restrictions evaluation on a resource on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono checkAtManagementGroupScopeAsync( + String managementGroupId, CheckManagementGroupRestrictionsRequest parameters) { + return checkAtManagementGroupScopeWithResponseAsync(managementGroupId, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Checks what restrictions Azure Policy will place on resources within a management group. + * + * @param managementGroupId Management group ID. + * @param parameters The check policy restrictions parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 result of a check policy restrictions evaluation on a resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CheckRestrictionsResultInner checkAtManagementGroupScope( + String managementGroupId, CheckManagementGroupRestrictionsRequest parameters) { + return checkAtManagementGroupScopeAsync(managementGroupId, parameters).block(); + } + + /** + * Checks what restrictions Azure Policy will place on resources within a management group. + * + * @param managementGroupId Management group ID. + * @param parameters The check policy restrictions parameters. + * @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 result of a check policy restrictions evaluation on a resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response checkAtManagementGroupScopeWithResponse( + String managementGroupId, CheckManagementGroupRestrictionsRequest parameters, Context context) { + return checkAtManagementGroupScopeWithResponseAsync(managementGroupId, parameters, context).block(); + } } diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/implementation/PolicyRestrictionsImpl.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/implementation/PolicyRestrictionsImpl.java index b03110c9f083..00865aea629b 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/implementation/PolicyRestrictionsImpl.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/implementation/PolicyRestrictionsImpl.java @@ -10,13 +10,13 @@ import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.policyinsights.fluent.PolicyRestrictionsClient; import com.azure.resourcemanager.policyinsights.fluent.models.CheckRestrictionsResultInner; +import com.azure.resourcemanager.policyinsights.models.CheckManagementGroupRestrictionsRequest; import com.azure.resourcemanager.policyinsights.models.CheckRestrictionsRequest; import com.azure.resourcemanager.policyinsights.models.CheckRestrictionsResult; import com.azure.resourcemanager.policyinsights.models.PolicyRestrictions; -import com.fasterxml.jackson.annotation.JsonIgnore; public final class PolicyRestrictionsImpl implements PolicyRestrictions { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PolicyRestrictionsImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(PolicyRestrictionsImpl.class); private final PolicyRestrictionsClient innerClient; @@ -79,6 +79,32 @@ public Response checkAtResourceGroupScopeWithResponse( } } + public CheckRestrictionsResult checkAtManagementGroupScope( + String managementGroupId, CheckManagementGroupRestrictionsRequest parameters) { + CheckRestrictionsResultInner inner = + this.serviceClient().checkAtManagementGroupScope(managementGroupId, parameters); + if (inner != null) { + return new CheckRestrictionsResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response checkAtManagementGroupScopeWithResponse( + String managementGroupId, CheckManagementGroupRestrictionsRequest parameters, Context context) { + Response inner = + this.serviceClient().checkAtManagementGroupScopeWithResponse(managementGroupId, parameters, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new CheckRestrictionsResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + private PolicyRestrictionsClient serviceClient() { return this.innerClient; } diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/implementation/PolicyStatesClientImpl.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/implementation/PolicyStatesClientImpl.java index af1660f69c5a..6de3d5a08e96 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/implementation/PolicyStatesClientImpl.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/implementation/PolicyStatesClientImpl.java @@ -27,7 +27,6 @@ import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.policyinsights.fluent.PolicyStatesClient; @@ -35,6 +34,7 @@ import com.azure.resourcemanager.policyinsights.fluent.models.SummarizeResultsInner; import com.azure.resourcemanager.policyinsights.models.PolicyStatesQueryResults; import com.azure.resourcemanager.policyinsights.models.PolicyStatesResource; +import com.azure.resourcemanager.policyinsights.models.PolicyStatesSummaryResourceType; import java.nio.ByteBuffer; import java.time.OffsetDateTime; import reactor.core.publisher.Flux; @@ -42,8 +42,6 @@ /** An instance of this class provides access to all the operations defined in PolicyStatesClient. */ public final class PolicyStatesClientImpl implements PolicyStatesClient { - private final ClientLogger logger = new ClientLogger(PolicyStatesClientImpl.class); - /** The proxy service used to perform REST calls. */ private final PolicyStatesService service; @@ -99,7 +97,7 @@ Mono> listQueryResultsForManagementGroup( @UnexpectedResponseExceptionType(ManagementException.class) Mono> summarizeForManagementGroup( @HostParam("$host") String endpoint, - @PathParam("policyStatesSummaryResource") String policyStatesSummaryResource, + @PathParam("policyStatesSummaryResource") PolicyStatesSummaryResourceType policyStatesSummaryResource, @PathParam("managementGroupsNamespace") String managementGroupsNamespace, @PathParam("managementGroupName") String managementGroupName, @QueryParam("api-version") String apiVersion, @@ -140,7 +138,7 @@ Mono> listQueryResultsForSubscription( @UnexpectedResponseExceptionType(ManagementException.class) Mono> summarizeForSubscription( @HostParam("$host") String endpoint, - @PathParam("policyStatesSummaryResource") String policyStatesSummaryResource, + @PathParam("policyStatesSummaryResource") PolicyStatesSummaryResourceType policyStatesSummaryResource, @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, @QueryParam("$top") Integer top, @@ -181,7 +179,7 @@ Mono> listQueryResultsForResourceGroup( @UnexpectedResponseExceptionType(ManagementException.class) Mono> summarizeForResourceGroup( @HostParam("$host") String endpoint, - @PathParam("policyStatesSummaryResource") String policyStatesSummaryResource, + @PathParam("policyStatesSummaryResource") PolicyStatesSummaryResourceType policyStatesSummaryResource, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, @@ -219,7 +217,7 @@ Mono> listQueryResultsForResource( @UnexpectedResponseExceptionType(ManagementException.class) Mono> summarizeForResource( @HostParam("$host") String endpoint, - @PathParam("policyStatesSummaryResource") String policyStatesSummaryResource, + @PathParam("policyStatesSummaryResource") PolicyStatesSummaryResourceType policyStatesSummaryResource, @PathParam(value = "resourceId", encoded = true) String resourceId, @QueryParam("api-version") String apiVersion, @QueryParam("$top") Integer top, @@ -289,7 +287,7 @@ Mono> listQueryResultsForPolicySetDefinition( @UnexpectedResponseExceptionType(ManagementException.class) Mono> summarizeForPolicySetDefinition( @HostParam("$host") String endpoint, - @PathParam("policyStatesSummaryResource") String policyStatesSummaryResource, + @PathParam("policyStatesSummaryResource") PolicyStatesSummaryResourceType policyStatesSummaryResource, @PathParam("subscriptionId") String subscriptionId, @PathParam("authorizationNamespace") String authorizationNamespace, @PathParam("policySetDefinitionName") String policySetDefinitionName, @@ -335,7 +333,7 @@ Mono> listQueryResultsForPolicyDefinition( @UnexpectedResponseExceptionType(ManagementException.class) Mono> summarizeForPolicyDefinition( @HostParam("$host") String endpoint, - @PathParam("policyStatesSummaryResource") String policyStatesSummaryResource, + @PathParam("policyStatesSummaryResource") PolicyStatesSummaryResourceType policyStatesSummaryResource, @PathParam("subscriptionId") String subscriptionId, @PathParam("authorizationNamespace") String authorizationNamespace, @PathParam("policyDefinitionName") String policyDefinitionName, @@ -381,7 +379,7 @@ Mono> listQueryResultsForSubscriptionLevelPol @UnexpectedResponseExceptionType(ManagementException.class) Mono> summarizeForSubscriptionLevelPolicyAssignment( @HostParam("$host") String endpoint, - @PathParam("policyStatesSummaryResource") String policyStatesSummaryResource, + @PathParam("policyStatesSummaryResource") PolicyStatesSummaryResourceType policyStatesSummaryResource, @PathParam("subscriptionId") String subscriptionId, @PathParam("authorizationNamespace") String authorizationNamespace, @PathParam("policyAssignmentName") String policyAssignmentName, @@ -428,7 +426,7 @@ Mono> listQueryResultsForResourceGroupLevelPo @UnexpectedResponseExceptionType(ManagementException.class) Mono> summarizeForResourceGroupLevelPolicyAssignment( @HostParam("$host") String endpoint, - @PathParam("policyStatesSummaryResource") String policyStatesSummaryResource, + @PathParam("policyStatesSummaryResource") PolicyStatesSummaryResourceType policyStatesSummaryResource, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("authorizationNamespace") String authorizationNamespace, @@ -471,7 +469,7 @@ Mono> nextLink( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listQueryResultsForManagementGroupSinglePageAsync( @@ -557,7 +555,7 @@ private Mono> listQueryResultsForManagementGroup * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listQueryResultsForManagementGroupSinglePageAsync( @@ -640,7 +638,7 @@ private Mono> listQueryResultsForManagementGroup * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listQueryResultsForManagementGroupAsync( @@ -679,7 +677,7 @@ private PagedFlux listQueryResultsForManagementGroupAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listQueryResultsForManagementGroupAsync( @@ -731,7 +729,7 @@ private PagedFlux listQueryResultsForManagementGroupAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listQueryResultsForManagementGroupAsync( @@ -772,7 +770,7 @@ private PagedFlux listQueryResultsForManagementGroupAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listQueryResultsForManagementGroup( @@ -813,7 +811,7 @@ public PagedIterable listQueryResultsForManagementGroup( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listQueryResultsForManagementGroup( @@ -846,6 +844,8 @@ public PagedIterable listQueryResultsForManagementGroup( /** * Summarizes policy states for the resources under the management group. * + * @param policyStatesSummaryResource The virtual resource under PolicyStates resource type for summarize action. In + * a given time range, 'latest' represents the latest policy state(s) and is the only allowed value. * @param managementGroupName Management group name. * @param top Maximum number of records to return. * @param from ISO 8601 formatted timestamp specifying the start time of the interval to query. When not specified, @@ -856,22 +856,32 @@ public PagedIterable listQueryResultsForManagementGroup( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return summarize action results. + * @return summarize action results along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> summarizeForManagementGroupWithResponseAsync( - String managementGroupName, Integer top, OffsetDateTime from, OffsetDateTime to, String filter) { + PolicyStatesSummaryResourceType policyStatesSummaryResource, + String managementGroupName, + Integer top, + OffsetDateTime from, + OffsetDateTime to, + String filter) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } + if (policyStatesSummaryResource == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter policyStatesSummaryResource is required and cannot be null.")); + } if (managementGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter managementGroupName is required and cannot be null.")); } - final String policyStatesSummaryResource = "latest"; final String managementGroupsNamespace = "Microsoft.Management"; final String apiVersion = "2019-10-01"; final String accept = "application/json"; @@ -897,6 +907,8 @@ private Mono> summarizeForManagementGroupWithRes /** * Summarizes policy states for the resources under the management group. * + * @param policyStatesSummaryResource The virtual resource under PolicyStates resource type for summarize action. In + * a given time range, 'latest' represents the latest policy state(s) and is the only allowed value. * @param managementGroupName Management group name. * @param top Maximum number of records to return. * @param from ISO 8601 formatted timestamp specifying the start time of the interval to query. When not specified, @@ -908,10 +920,11 @@ private Mono> summarizeForManagementGroupWithRes * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return summarize action results. + * @return summarize action results along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> summarizeForManagementGroupWithResponseAsync( + PolicyStatesSummaryResourceType policyStatesSummaryResource, String managementGroupName, Integer top, OffsetDateTime from, @@ -924,11 +937,16 @@ private Mono> summarizeForManagementGroupWithRes new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } + if (policyStatesSummaryResource == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter policyStatesSummaryResource is required and cannot be null.")); + } if (managementGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter managementGroupName is required and cannot be null.")); } - final String policyStatesSummaryResource = "latest"; final String managementGroupsNamespace = "Microsoft.Management"; final String apiVersion = "2019-10-01"; final String accept = "application/json"; @@ -951,6 +969,8 @@ private Mono> summarizeForManagementGroupWithRes /** * Summarizes policy states for the resources under the management group. * + * @param policyStatesSummaryResource The virtual resource under PolicyStates resource type for summarize action. In + * a given time range, 'latest' represents the latest policy state(s) and is the only allowed value. * @param managementGroupName Management group name. * @param top Maximum number of records to return. * @param from ISO 8601 formatted timestamp specifying the start time of the interval to query. When not specified, @@ -961,51 +981,49 @@ private Mono> summarizeForManagementGroupWithRes * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return summarize action results. + * @return summarize action results on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono summarizeForManagementGroupAsync( - String managementGroupName, Integer top, OffsetDateTime from, OffsetDateTime to, String filter) { - return summarizeForManagementGroupWithResponseAsync(managementGroupName, top, from, to, filter) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + PolicyStatesSummaryResourceType policyStatesSummaryResource, + String managementGroupName, + Integer top, + OffsetDateTime from, + OffsetDateTime to, + String filter) { + return summarizeForManagementGroupWithResponseAsync( + policyStatesSummaryResource, managementGroupName, top, from, to, filter) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Summarizes policy states for the resources under the management group. * + * @param policyStatesSummaryResource The virtual resource under PolicyStates resource type for summarize action. In + * a given time range, 'latest' represents the latest policy state(s) and is the only allowed value. * @param managementGroupName Management group name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return summarize action results. + * @return summarize action results on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono summarizeForManagementGroupAsync(String managementGroupName) { + private Mono summarizeForManagementGroupAsync( + PolicyStatesSummaryResourceType policyStatesSummaryResource, String managementGroupName) { final Integer top = null; final OffsetDateTime from = null; final OffsetDateTime to = null; final String filter = null; - return summarizeForManagementGroupWithResponseAsync(managementGroupName, top, from, to, filter) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + return summarizeForManagementGroupWithResponseAsync( + policyStatesSummaryResource, managementGroupName, top, from, to, filter) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Summarizes policy states for the resources under the management group. * + * @param policyStatesSummaryResource The virtual resource under PolicyStates resource type for summarize action. In + * a given time range, 'latest' represents the latest policy state(s) and is the only allowed value. * @param managementGroupName Management group name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1013,17 +1031,21 @@ private Mono summarizeForManagementGroupAsync(String mana * @return summarize action results. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SummarizeResultsInner summarizeForManagementGroup(String managementGroupName) { + public SummarizeResultsInner summarizeForManagementGroup( + PolicyStatesSummaryResourceType policyStatesSummaryResource, String managementGroupName) { final Integer top = null; final OffsetDateTime from = null; final OffsetDateTime to = null; final String filter = null; - return summarizeForManagementGroupAsync(managementGroupName, top, from, to, filter).block(); + return summarizeForManagementGroupAsync(policyStatesSummaryResource, managementGroupName, top, from, to, filter) + .block(); } /** * Summarizes policy states for the resources under the management group. * + * @param policyStatesSummaryResource The virtual resource under PolicyStates resource type for summarize action. In + * a given time range, 'latest' represents the latest policy state(s) and is the only allowed value. * @param managementGroupName Management group name. * @param top Maximum number of records to return. * @param from ISO 8601 formatted timestamp specifying the start time of the interval to query. When not specified, @@ -1035,17 +1057,19 @@ public SummarizeResultsInner summarizeForManagementGroup(String managementGroupN * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return summarize action results. + * @return summarize action results along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response summarizeForManagementGroupWithResponse( + PolicyStatesSummaryResourceType policyStatesSummaryResource, String managementGroupName, Integer top, OffsetDateTime from, OffsetDateTime to, String filter, Context context) { - return summarizeForManagementGroupWithResponseAsync(managementGroupName, top, from, to, filter, context) + return summarizeForManagementGroupWithResponseAsync( + policyStatesSummaryResource, managementGroupName, top, from, to, filter, context) .block(); } @@ -1071,7 +1095,7 @@ public Response summarizeForManagementGroupWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listQueryResultsForSubscriptionSinglePageAsync( @@ -1154,7 +1178,7 @@ private Mono> listQueryResultsForSubscriptionSin * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listQueryResultsForSubscriptionSinglePageAsync( @@ -1234,7 +1258,7 @@ private Mono> listQueryResultsForSubscriptionSin * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listQueryResultsForSubscriptionAsync( @@ -1264,7 +1288,7 @@ private PagedFlux listQueryResultsForSubscriptionAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listQueryResultsForSubscriptionAsync( @@ -1307,7 +1331,7 @@ private PagedFlux listQueryResultsForSubscriptionAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listQueryResultsForSubscriptionAsync( @@ -1348,7 +1372,7 @@ private PagedFlux listQueryResultsForSubscriptionAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listQueryResultsForSubscription( @@ -1389,7 +1413,7 @@ public PagedIterable listQueryResultsForSubscription( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listQueryResultsForSubscription( @@ -1422,6 +1446,8 @@ public PagedIterable listQueryResultsForSubscription( /** * Summarizes policy states for the resources under the subscription. * + * @param policyStatesSummaryResource The virtual resource under PolicyStates resource type for summarize action. In + * a given time range, 'latest' represents the latest policy state(s) and is the only allowed value. * @param subscriptionId Microsoft Azure subscription ID. * @param top Maximum number of records to return. * @param from ISO 8601 formatted timestamp specifying the start time of the interval to query. When not specified, @@ -1432,21 +1458,31 @@ public PagedIterable listQueryResultsForSubscription( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return summarize action results. + * @return summarize action results along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> summarizeForSubscriptionWithResponseAsync( - String subscriptionId, Integer top, OffsetDateTime from, OffsetDateTime to, String filter) { + PolicyStatesSummaryResourceType policyStatesSummaryResource, + String subscriptionId, + Integer top, + OffsetDateTime from, + OffsetDateTime to, + String filter) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } + if (policyStatesSummaryResource == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter policyStatesSummaryResource is required and cannot be null.")); + } if (subscriptionId == null) { return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); } - final String policyStatesSummaryResource = "latest"; final String apiVersion = "2019-10-01"; final String accept = "application/json"; return FluxUtil @@ -1470,6 +1506,8 @@ private Mono> summarizeForSubscriptionWithRespon /** * Summarizes policy states for the resources under the subscription. * + * @param policyStatesSummaryResource The virtual resource under PolicyStates resource type for summarize action. In + * a given time range, 'latest' represents the latest policy state(s) and is the only allowed value. * @param subscriptionId Microsoft Azure subscription ID. * @param top Maximum number of records to return. * @param from ISO 8601 formatted timestamp specifying the start time of the interval to query. When not specified, @@ -1481,21 +1519,32 @@ private Mono> summarizeForSubscriptionWithRespon * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return summarize action results. + * @return summarize action results along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> summarizeForSubscriptionWithResponseAsync( - String subscriptionId, Integer top, OffsetDateTime from, OffsetDateTime to, String filter, Context context) { + PolicyStatesSummaryResourceType policyStatesSummaryResource, + String subscriptionId, + Integer top, + OffsetDateTime from, + OffsetDateTime to, + String filter, + Context context) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } + if (policyStatesSummaryResource == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter policyStatesSummaryResource is required and cannot be null.")); + } if (subscriptionId == null) { return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); } - final String policyStatesSummaryResource = "latest"; final String apiVersion = "2019-10-01"; final String accept = "application/json"; context = this.client.mergeContext(context); @@ -1516,6 +1565,8 @@ private Mono> summarizeForSubscriptionWithRespon /** * Summarizes policy states for the resources under the subscription. * + * @param policyStatesSummaryResource The virtual resource under PolicyStates resource type for summarize action. In + * a given time range, 'latest' represents the latest policy state(s) and is the only allowed value. * @param subscriptionId Microsoft Azure subscription ID. * @param top Maximum number of records to return. * @param from ISO 8601 formatted timestamp specifying the start time of the interval to query. When not specified, @@ -1526,51 +1577,49 @@ private Mono> summarizeForSubscriptionWithRespon * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return summarize action results. + * @return summarize action results on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono summarizeForSubscriptionAsync( - String subscriptionId, Integer top, OffsetDateTime from, OffsetDateTime to, String filter) { - return summarizeForSubscriptionWithResponseAsync(subscriptionId, top, from, to, filter) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + PolicyStatesSummaryResourceType policyStatesSummaryResource, + String subscriptionId, + Integer top, + OffsetDateTime from, + OffsetDateTime to, + String filter) { + return summarizeForSubscriptionWithResponseAsync( + policyStatesSummaryResource, subscriptionId, top, from, to, filter) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Summarizes policy states for the resources under the subscription. * + * @param policyStatesSummaryResource The virtual resource under PolicyStates resource type for summarize action. In + * a given time range, 'latest' represents the latest policy state(s) and is the only allowed value. * @param subscriptionId Microsoft Azure subscription 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 summarize action results. + * @return summarize action results on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono summarizeForSubscriptionAsync(String subscriptionId) { + private Mono summarizeForSubscriptionAsync( + PolicyStatesSummaryResourceType policyStatesSummaryResource, String subscriptionId) { final Integer top = null; final OffsetDateTime from = null; final OffsetDateTime to = null; final String filter = null; - return summarizeForSubscriptionWithResponseAsync(subscriptionId, top, from, to, filter) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + return summarizeForSubscriptionWithResponseAsync( + policyStatesSummaryResource, subscriptionId, top, from, to, filter) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Summarizes policy states for the resources under the subscription. * + * @param policyStatesSummaryResource The virtual resource under PolicyStates resource type for summarize action. In + * a given time range, 'latest' represents the latest policy state(s) and is the only allowed value. * @param subscriptionId Microsoft Azure subscription ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1578,17 +1627,21 @@ private Mono summarizeForSubscriptionAsync(String subscri * @return summarize action results. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SummarizeResultsInner summarizeForSubscription(String subscriptionId) { + public SummarizeResultsInner summarizeForSubscription( + PolicyStatesSummaryResourceType policyStatesSummaryResource, String subscriptionId) { final Integer top = null; final OffsetDateTime from = null; final OffsetDateTime to = null; final String filter = null; - return summarizeForSubscriptionAsync(subscriptionId, top, from, to, filter).block(); + return summarizeForSubscriptionAsync(policyStatesSummaryResource, subscriptionId, top, from, to, filter) + .block(); } /** * Summarizes policy states for the resources under the subscription. * + * @param policyStatesSummaryResource The virtual resource under PolicyStates resource type for summarize action. In + * a given time range, 'latest' represents the latest policy state(s) and is the only allowed value. * @param subscriptionId Microsoft Azure subscription ID. * @param top Maximum number of records to return. * @param from ISO 8601 formatted timestamp specifying the start time of the interval to query. When not specified, @@ -1600,12 +1653,20 @@ public SummarizeResultsInner summarizeForSubscription(String subscriptionId) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return summarize action results. + * @return summarize action results along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response summarizeForSubscriptionWithResponse( - String subscriptionId, Integer top, OffsetDateTime from, OffsetDateTime to, String filter, Context context) { - return summarizeForSubscriptionWithResponseAsync(subscriptionId, top, from, to, filter, context).block(); + PolicyStatesSummaryResourceType policyStatesSummaryResource, + String subscriptionId, + Integer top, + OffsetDateTime from, + OffsetDateTime to, + String filter, + Context context) { + return summarizeForSubscriptionWithResponseAsync( + policyStatesSummaryResource, subscriptionId, top, from, to, filter, context) + .block(); } /** @@ -1631,7 +1692,7 @@ public Response summarizeForSubscriptionWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listQueryResultsForResourceGroupSinglePageAsync( @@ -1721,7 +1782,7 @@ private Mono> listQueryResultsForResourceGroupSi * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listQueryResultsForResourceGroupSinglePageAsync( @@ -1808,7 +1869,7 @@ private Mono> listQueryResultsForResourceGroupSi * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listQueryResultsForResourceGroupAsync( @@ -1850,7 +1911,7 @@ private PagedFlux listQueryResultsForResourceGroupAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listQueryResultsForResourceGroupAsync( @@ -1904,7 +1965,7 @@ private PagedFlux listQueryResultsForResourceGroupAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listQueryResultsForResourceGroupAsync( @@ -1948,7 +2009,7 @@ private PagedFlux listQueryResultsForResourceGroupAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listQueryResultsForResourceGroup( @@ -2000,7 +2061,7 @@ public PagedIterable listQueryResultsForResourceGroup( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listQueryResultsForResourceGroup( @@ -2035,6 +2096,8 @@ public PagedIterable listQueryResultsForResourceGroup( /** * Summarizes policy states for the resources under the resource group. * + * @param policyStatesSummaryResource The virtual resource under PolicyStates resource type for summarize action. In + * a given time range, 'latest' represents the latest policy state(s) and is the only allowed value. * @param subscriptionId Microsoft Azure subscription ID. * @param resourceGroupName Resource group name. * @param top Maximum number of records to return. @@ -2046,10 +2109,11 @@ public PagedIterable listQueryResultsForResourceGroup( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return summarize action results. + * @return summarize action results along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> summarizeForResourceGroupWithResponseAsync( + PolicyStatesSummaryResourceType policyStatesSummaryResource, String subscriptionId, String resourceGroupName, Integer top, @@ -2062,6 +2126,12 @@ private Mono> summarizeForResourceGroupWithRespo new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } + if (policyStatesSummaryResource == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter policyStatesSummaryResource is required and cannot be null.")); + } if (subscriptionId == null) { return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); } @@ -2069,7 +2139,6 @@ private Mono> summarizeForResourceGroupWithRespo return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - final String policyStatesSummaryResource = "latest"; final String apiVersion = "2019-10-01"; final String accept = "application/json"; return FluxUtil @@ -2094,6 +2163,8 @@ private Mono> summarizeForResourceGroupWithRespo /** * Summarizes policy states for the resources under the resource group. * + * @param policyStatesSummaryResource The virtual resource under PolicyStates resource type for summarize action. In + * a given time range, 'latest' represents the latest policy state(s) and is the only allowed value. * @param subscriptionId Microsoft Azure subscription ID. * @param resourceGroupName Resource group name. * @param top Maximum number of records to return. @@ -2106,10 +2177,11 @@ private Mono> summarizeForResourceGroupWithRespo * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return summarize action results. + * @return summarize action results along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> summarizeForResourceGroupWithResponseAsync( + PolicyStatesSummaryResourceType policyStatesSummaryResource, String subscriptionId, String resourceGroupName, Integer top, @@ -2123,6 +2195,12 @@ private Mono> summarizeForResourceGroupWithRespo new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } + if (policyStatesSummaryResource == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter policyStatesSummaryResource is required and cannot be null.")); + } if (subscriptionId == null) { return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); } @@ -2130,7 +2208,6 @@ private Mono> summarizeForResourceGroupWithRespo return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - final String policyStatesSummaryResource = "latest"; final String apiVersion = "2019-10-01"; final String accept = "application/json"; context = this.client.mergeContext(context); @@ -2152,6 +2229,8 @@ private Mono> summarizeForResourceGroupWithRespo /** * Summarizes policy states for the resources under the resource group. * + * @param policyStatesSummaryResource The virtual resource under PolicyStates resource type for summarize action. In + * a given time range, 'latest' represents the latest policy state(s) and is the only allowed value. * @param subscriptionId Microsoft Azure subscription ID. * @param resourceGroupName Resource group name. * @param top Maximum number of records to return. @@ -2163,58 +2242,51 @@ private Mono> summarizeForResourceGroupWithRespo * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return summarize action results. + * @return summarize action results on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono summarizeForResourceGroupAsync( + PolicyStatesSummaryResourceType policyStatesSummaryResource, String subscriptionId, String resourceGroupName, Integer top, OffsetDateTime from, OffsetDateTime to, String filter) { - return summarizeForResourceGroupWithResponseAsync(subscriptionId, resourceGroupName, top, from, to, filter) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + return summarizeForResourceGroupWithResponseAsync( + policyStatesSummaryResource, subscriptionId, resourceGroupName, top, from, to, filter) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Summarizes policy states for the resources under the resource group. * + * @param policyStatesSummaryResource The virtual resource under PolicyStates resource type for summarize action. In + * a given time range, 'latest' represents the latest policy state(s) and is the only allowed value. * @param subscriptionId Microsoft Azure subscription ID. * @param resourceGroupName Resource group name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return summarize action results. + * @return summarize action results on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono summarizeForResourceGroupAsync( - String subscriptionId, String resourceGroupName) { + PolicyStatesSummaryResourceType policyStatesSummaryResource, String subscriptionId, String resourceGroupName) { final Integer top = null; final OffsetDateTime from = null; final OffsetDateTime to = null; final String filter = null; - return summarizeForResourceGroupWithResponseAsync(subscriptionId, resourceGroupName, top, from, to, filter) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + return summarizeForResourceGroupWithResponseAsync( + policyStatesSummaryResource, subscriptionId, resourceGroupName, top, from, to, filter) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Summarizes policy states for the resources under the resource group. * + * @param policyStatesSummaryResource The virtual resource under PolicyStates resource type for summarize action. In + * a given time range, 'latest' represents the latest policy state(s) and is the only allowed value. * @param subscriptionId Microsoft Azure subscription ID. * @param resourceGroupName Resource group name. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2223,17 +2295,22 @@ private Mono summarizeForResourceGroupAsync( * @return summarize action results. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SummarizeResultsInner summarizeForResourceGroup(String subscriptionId, String resourceGroupName) { + public SummarizeResultsInner summarizeForResourceGroup( + PolicyStatesSummaryResourceType policyStatesSummaryResource, String subscriptionId, String resourceGroupName) { final Integer top = null; final OffsetDateTime from = null; final OffsetDateTime to = null; final String filter = null; - return summarizeForResourceGroupAsync(subscriptionId, resourceGroupName, top, from, to, filter).block(); + return summarizeForResourceGroupAsync( + policyStatesSummaryResource, subscriptionId, resourceGroupName, top, from, to, filter) + .block(); } /** * Summarizes policy states for the resources under the resource group. * + * @param policyStatesSummaryResource The virtual resource under PolicyStates resource type for summarize action. In + * a given time range, 'latest' represents the latest policy state(s) and is the only allowed value. * @param subscriptionId Microsoft Azure subscription ID. * @param resourceGroupName Resource group name. * @param top Maximum number of records to return. @@ -2246,10 +2323,11 @@ public SummarizeResultsInner summarizeForResourceGroup(String subscriptionId, St * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return summarize action results. + * @return summarize action results along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response summarizeForResourceGroupWithResponse( + PolicyStatesSummaryResourceType policyStatesSummaryResource, String subscriptionId, String resourceGroupName, Integer top, @@ -2258,7 +2336,7 @@ public Response summarizeForResourceGroupWithResponse( String filter, Context context) { return summarizeForResourceGroupWithResponseAsync( - subscriptionId, resourceGroupName, top, from, to, filter, context) + policyStatesSummaryResource, subscriptionId, resourceGroupName, top, from, to, filter, context) .block(); } @@ -2285,7 +2363,7 @@ public Response summarizeForResourceGroupWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listQueryResultsForResourceSinglePageAsync( @@ -2371,7 +2449,7 @@ private Mono> listQueryResultsForResourceSingleP * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listQueryResultsForResourceSinglePageAsync( @@ -2454,7 +2532,7 @@ private Mono> listQueryResultsForResourceSingleP * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listQueryResultsForResourceAsync( @@ -2485,7 +2563,7 @@ private PagedFlux listQueryResultsForResourceAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listQueryResultsForResourceAsync( @@ -2530,7 +2608,7 @@ private PagedFlux listQueryResultsForResourceAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listQueryResultsForResourceAsync( @@ -2573,7 +2651,7 @@ private PagedFlux listQueryResultsForResourceAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listQueryResultsForResource( @@ -2616,7 +2694,7 @@ public PagedIterable listQueryResultsForResource( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listQueryResultsForResource( @@ -2651,6 +2729,8 @@ public PagedIterable listQueryResultsForResource( /** * Summarizes policy states for the resource. * + * @param policyStatesSummaryResource The virtual resource under PolicyStates resource type for summarize action. In + * a given time range, 'latest' represents the latest policy state(s) and is the only allowed value. * @param resourceId Resource ID. * @param top Maximum number of records to return. * @param from ISO 8601 formatted timestamp specifying the start time of the interval to query. When not specified, @@ -2661,21 +2741,31 @@ public PagedIterable listQueryResultsForResource( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return summarize action results. + * @return summarize action results along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> summarizeForResourceWithResponseAsync( - String resourceId, Integer top, OffsetDateTime from, OffsetDateTime to, String filter) { + PolicyStatesSummaryResourceType policyStatesSummaryResource, + String resourceId, + Integer top, + OffsetDateTime from, + OffsetDateTime to, + String filter) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } + if (policyStatesSummaryResource == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter policyStatesSummaryResource is required and cannot be null.")); + } if (resourceId == null) { return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); } - final String policyStatesSummaryResource = "latest"; final String apiVersion = "2019-10-01"; final String accept = "application/json"; return FluxUtil @@ -2699,6 +2789,8 @@ private Mono> summarizeForResourceWithResponseAs /** * Summarizes policy states for the resource. * + * @param policyStatesSummaryResource The virtual resource under PolicyStates resource type for summarize action. In + * a given time range, 'latest' represents the latest policy state(s) and is the only allowed value. * @param resourceId Resource ID. * @param top Maximum number of records to return. * @param from ISO 8601 formatted timestamp specifying the start time of the interval to query. When not specified, @@ -2710,21 +2802,32 @@ private Mono> summarizeForResourceWithResponseAs * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return summarize action results. + * @return summarize action results along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> summarizeForResourceWithResponseAsync( - String resourceId, Integer top, OffsetDateTime from, OffsetDateTime to, String filter, Context context) { + PolicyStatesSummaryResourceType policyStatesSummaryResource, + String resourceId, + Integer top, + OffsetDateTime from, + OffsetDateTime to, + String filter, + Context context) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } + if (policyStatesSummaryResource == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter policyStatesSummaryResource is required and cannot be null.")); + } if (resourceId == null) { return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); } - final String policyStatesSummaryResource = "latest"; final String apiVersion = "2019-10-01"; final String accept = "application/json"; context = this.client.mergeContext(context); @@ -2745,6 +2848,8 @@ private Mono> summarizeForResourceWithResponseAs /** * Summarizes policy states for the resource. * + * @param policyStatesSummaryResource The virtual resource under PolicyStates resource type for summarize action. In + * a given time range, 'latest' represents the latest policy state(s) and is the only allowed value. * @param resourceId Resource ID. * @param top Maximum number of records to return. * @param from ISO 8601 formatted timestamp specifying the start time of the interval to query. When not specified, @@ -2755,51 +2860,47 @@ private Mono> summarizeForResourceWithResponseAs * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return summarize action results. + * @return summarize action results on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono summarizeForResourceAsync( - String resourceId, Integer top, OffsetDateTime from, OffsetDateTime to, String filter) { - return summarizeForResourceWithResponseAsync(resourceId, top, from, to, filter) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + PolicyStatesSummaryResourceType policyStatesSummaryResource, + String resourceId, + Integer top, + OffsetDateTime from, + OffsetDateTime to, + String filter) { + return summarizeForResourceWithResponseAsync(policyStatesSummaryResource, resourceId, top, from, to, filter) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Summarizes policy states for the resource. * + * @param policyStatesSummaryResource The virtual resource under PolicyStates resource type for summarize action. In + * a given time range, 'latest' represents the latest policy state(s) and is the only allowed value. * @param resourceId Resource 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 summarize action results. + * @return summarize action results on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono summarizeForResourceAsync(String resourceId) { + private Mono summarizeForResourceAsync( + PolicyStatesSummaryResourceType policyStatesSummaryResource, String resourceId) { final Integer top = null; final OffsetDateTime from = null; final OffsetDateTime to = null; final String filter = null; - return summarizeForResourceWithResponseAsync(resourceId, top, from, to, filter) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + return summarizeForResourceWithResponseAsync(policyStatesSummaryResource, resourceId, top, from, to, filter) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Summarizes policy states for the resource. * + * @param policyStatesSummaryResource The virtual resource under PolicyStates resource type for summarize action. In + * a given time range, 'latest' represents the latest policy state(s) and is the only allowed value. * @param resourceId Resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -2807,17 +2908,20 @@ private Mono summarizeForResourceAsync(String resourceId) * @return summarize action results. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SummarizeResultsInner summarizeForResource(String resourceId) { + public SummarizeResultsInner summarizeForResource( + PolicyStatesSummaryResourceType policyStatesSummaryResource, String resourceId) { final Integer top = null; final OffsetDateTime from = null; final OffsetDateTime to = null; final String filter = null; - return summarizeForResourceAsync(resourceId, top, from, to, filter).block(); + return summarizeForResourceAsync(policyStatesSummaryResource, resourceId, top, from, to, filter).block(); } /** * Summarizes policy states for the resource. * + * @param policyStatesSummaryResource The virtual resource under PolicyStates resource type for summarize action. In + * a given time range, 'latest' represents the latest policy state(s) and is the only allowed value. * @param resourceId Resource ID. * @param top Maximum number of records to return. * @param from ISO 8601 formatted timestamp specifying the start time of the interval to query. When not specified, @@ -2829,12 +2933,20 @@ public SummarizeResultsInner summarizeForResource(String resourceId) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return summarize action results. + * @return summarize action results along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response summarizeForResourceWithResponse( - String resourceId, Integer top, OffsetDateTime from, OffsetDateTime to, String filter, Context context) { - return summarizeForResourceWithResponseAsync(resourceId, top, from, to, filter, context).block(); + PolicyStatesSummaryResourceType policyStatesSummaryResource, + String resourceId, + Integer top, + OffsetDateTime from, + OffsetDateTime to, + String filter, + Context context) { + return summarizeForResourceWithResponseAsync( + policyStatesSummaryResource, resourceId, top, from, to, filter, context) + .block(); } /** @@ -2844,7 +2956,7 @@ public Response summarizeForResourceWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> triggerSubscriptionEvaluationWithResponseAsync(String subscriptionId) { @@ -2876,7 +2988,7 @@ private Mono>> triggerSubscriptionEvaluationWithRespon * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> triggerSubscriptionEvaluationWithResponseAsync( @@ -2904,7 +3016,7 @@ private Mono>> triggerSubscriptionEvaluationWithRespon * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 completion. + * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginTriggerSubscriptionEvaluationAsync(String subscriptionId) { @@ -2923,7 +3035,7 @@ private PollerFlux, Void> beginTriggerSubscriptionEvaluationAsy * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 completion. + * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginTriggerSubscriptionEvaluationAsync( @@ -2942,7 +3054,7 @@ private PollerFlux, Void> beginTriggerSubscriptionEvaluationAsy * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginTriggerSubscriptionEvaluation(String subscriptionId) { @@ -2957,7 +3069,7 @@ public SyncPoller, Void> beginTriggerSubscriptionEvaluation(Str * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginTriggerSubscriptionEvaluation( @@ -2972,7 +3084,7 @@ public SyncPoller, Void> beginTriggerSubscriptionEvaluation( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono triggerSubscriptionEvaluationAsync(String subscriptionId) { @@ -2989,7 +3101,7 @@ private Mono triggerSubscriptionEvaluationAsync(String subscriptionId) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono triggerSubscriptionEvaluationAsync(String subscriptionId, Context context) { @@ -3033,7 +3145,7 @@ public void triggerSubscriptionEvaluation(String subscriptionId, 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 the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> triggerResourceGroupEvaluationWithResponseAsync( @@ -3071,7 +3183,7 @@ private Mono>> triggerResourceGroupEvaluationWithRespo * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> triggerResourceGroupEvaluationWithResponseAsync( @@ -3105,7 +3217,7 @@ private Mono>> triggerResourceGroupEvaluationWithRespo * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 completion. + * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginTriggerResourceGroupEvaluationAsync( @@ -3127,7 +3239,7 @@ private PollerFlux, Void> beginTriggerResourceGroupEvaluationAs * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 completion. + * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginTriggerResourceGroupEvaluationAsync( @@ -3148,7 +3260,7 @@ private PollerFlux, Void> beginTriggerResourceGroupEvaluationAs * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginTriggerResourceGroupEvaluation( @@ -3165,7 +3277,7 @@ public SyncPoller, Void> beginTriggerResourceGroupEvaluation( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginTriggerResourceGroupEvaluation( @@ -3181,7 +3293,7 @@ public SyncPoller, Void> beginTriggerResourceGroupEvaluation( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono triggerResourceGroupEvaluationAsync(String subscriptionId, String resourceGroupName) { @@ -3199,7 +3311,7 @@ private Mono triggerResourceGroupEvaluationAsync(String subscriptionId, St * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono triggerResourceGroupEvaluationAsync( @@ -3261,7 +3373,7 @@ public void triggerResourceGroupEvaluation(String subscriptionId, String resourc * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listQueryResultsForPolicySetDefinitionSinglePageAsync( @@ -3354,7 +3466,7 @@ private Mono> listQueryResultsForPolicySetDefini * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listQueryResultsForPolicySetDefinitionSinglePageAsync( @@ -3444,7 +3556,7 @@ private Mono> listQueryResultsForPolicySetDefini * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listQueryResultsForPolicySetDefinitionAsync( @@ -3486,7 +3598,7 @@ private PagedFlux listQueryResultsForPolicySetDefinitionAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listQueryResultsForPolicySetDefinitionAsync( @@ -3540,7 +3652,7 @@ private PagedFlux listQueryResultsForPolicySetDefinitionAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listQueryResultsForPolicySetDefinitionAsync( @@ -3584,7 +3696,7 @@ private PagedFlux listQueryResultsForPolicySetDefinitionAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listQueryResultsForPolicySetDefinition( @@ -3636,7 +3748,7 @@ public PagedIterable listQueryResultsForPolicySetDefinition( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listQueryResultsForPolicySetDefinition( @@ -3671,6 +3783,8 @@ public PagedIterable listQueryResultsForPolicySetDefinition( /** * Summarizes policy states for the subscription level policy set definition. * + * @param policyStatesSummaryResource The virtual resource under PolicyStates resource type for summarize action. In + * a given time range, 'latest' represents the latest policy state(s) and is the only allowed value. * @param subscriptionId Microsoft Azure subscription ID. * @param policySetDefinitionName Policy set definition name. * @param top Maximum number of records to return. @@ -3682,10 +3796,11 @@ public PagedIterable listQueryResultsForPolicySetDefinition( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return summarize action results. + * @return summarize action results along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> summarizeForPolicySetDefinitionWithResponseAsync( + PolicyStatesSummaryResourceType policyStatesSummaryResource, String subscriptionId, String policySetDefinitionName, Integer top, @@ -3698,6 +3813,12 @@ private Mono> summarizeForPolicySetDefinitionWit new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } + if (policyStatesSummaryResource == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter policyStatesSummaryResource is required and cannot be null.")); + } if (subscriptionId == null) { return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); } @@ -3706,7 +3827,6 @@ private Mono> summarizeForPolicySetDefinitionWit .error( new IllegalArgumentException("Parameter policySetDefinitionName is required and cannot be null.")); } - final String policyStatesSummaryResource = "latest"; final String authorizationNamespace = "Microsoft.Authorization"; final String apiVersion = "2019-10-01"; final String accept = "application/json"; @@ -3733,6 +3853,8 @@ private Mono> summarizeForPolicySetDefinitionWit /** * Summarizes policy states for the subscription level policy set definition. * + * @param policyStatesSummaryResource The virtual resource under PolicyStates resource type for summarize action. In + * a given time range, 'latest' represents the latest policy state(s) and is the only allowed value. * @param subscriptionId Microsoft Azure subscription ID. * @param policySetDefinitionName Policy set definition name. * @param top Maximum number of records to return. @@ -3745,10 +3867,11 @@ private Mono> summarizeForPolicySetDefinitionWit * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return summarize action results. + * @return summarize action results along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> summarizeForPolicySetDefinitionWithResponseAsync( + PolicyStatesSummaryResourceType policyStatesSummaryResource, String subscriptionId, String policySetDefinitionName, Integer top, @@ -3762,6 +3885,12 @@ private Mono> summarizeForPolicySetDefinitionWit new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } + if (policyStatesSummaryResource == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter policyStatesSummaryResource is required and cannot be null.")); + } if (subscriptionId == null) { return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); } @@ -3770,7 +3899,6 @@ private Mono> summarizeForPolicySetDefinitionWit .error( new IllegalArgumentException("Parameter policySetDefinitionName is required and cannot be null.")); } - final String policyStatesSummaryResource = "latest"; final String authorizationNamespace = "Microsoft.Authorization"; final String apiVersion = "2019-10-01"; final String accept = "application/json"; @@ -3794,6 +3922,8 @@ private Mono> summarizeForPolicySetDefinitionWit /** * Summarizes policy states for the subscription level policy set definition. * + * @param policyStatesSummaryResource The virtual resource under PolicyStates resource type for summarize action. In + * a given time range, 'latest' represents the latest policy state(s) and is the only allowed value. * @param subscriptionId Microsoft Azure subscription ID. * @param policySetDefinitionName Policy set definition name. * @param top Maximum number of records to return. @@ -3805,10 +3935,11 @@ private Mono> summarizeForPolicySetDefinitionWit * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return summarize action results. + * @return summarize action results on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono summarizeForPolicySetDefinitionAsync( + PolicyStatesSummaryResourceType policyStatesSummaryResource, String subscriptionId, String policySetDefinitionName, Integer top, @@ -3816,49 +3947,41 @@ private Mono summarizeForPolicySetDefinitionAsync( OffsetDateTime to, String filter) { return summarizeForPolicySetDefinitionWithResponseAsync( - subscriptionId, policySetDefinitionName, top, from, to, filter) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + policyStatesSummaryResource, subscriptionId, policySetDefinitionName, top, from, to, filter) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Summarizes policy states for the subscription level policy set definition. * + * @param policyStatesSummaryResource The virtual resource under PolicyStates resource type for summarize action. In + * a given time range, 'latest' represents the latest policy state(s) and is the only allowed value. * @param subscriptionId Microsoft Azure subscription ID. * @param policySetDefinitionName Policy set definition name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return summarize action results. + * @return summarize action results on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono summarizeForPolicySetDefinitionAsync( - String subscriptionId, String policySetDefinitionName) { + PolicyStatesSummaryResourceType policyStatesSummaryResource, + String subscriptionId, + String policySetDefinitionName) { final Integer top = null; final OffsetDateTime from = null; final OffsetDateTime to = null; final String filter = null; return summarizeForPolicySetDefinitionWithResponseAsync( - subscriptionId, policySetDefinitionName, top, from, to, filter) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + policyStatesSummaryResource, subscriptionId, policySetDefinitionName, top, from, to, filter) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Summarizes policy states for the subscription level policy set definition. * + * @param policyStatesSummaryResource The virtual resource under PolicyStates resource type for summarize action. In + * a given time range, 'latest' represents the latest policy state(s) and is the only allowed value. * @param subscriptionId Microsoft Azure subscription ID. * @param policySetDefinitionName Policy set definition name. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -3868,18 +3991,23 @@ private Mono summarizeForPolicySetDefinitionAsync( */ @ServiceMethod(returns = ReturnType.SINGLE) public SummarizeResultsInner summarizeForPolicySetDefinition( - String subscriptionId, String policySetDefinitionName) { + PolicyStatesSummaryResourceType policyStatesSummaryResource, + String subscriptionId, + String policySetDefinitionName) { final Integer top = null; final OffsetDateTime from = null; final OffsetDateTime to = null; final String filter = null; - return summarizeForPolicySetDefinitionAsync(subscriptionId, policySetDefinitionName, top, from, to, filter) + return summarizeForPolicySetDefinitionAsync( + policyStatesSummaryResource, subscriptionId, policySetDefinitionName, top, from, to, filter) .block(); } /** * Summarizes policy states for the subscription level policy set definition. * + * @param policyStatesSummaryResource The virtual resource under PolicyStates resource type for summarize action. In + * a given time range, 'latest' represents the latest policy state(s) and is the only allowed value. * @param subscriptionId Microsoft Azure subscription ID. * @param policySetDefinitionName Policy set definition name. * @param top Maximum number of records to return. @@ -3892,10 +4020,11 @@ public SummarizeResultsInner summarizeForPolicySetDefinition( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return summarize action results. + * @return summarize action results along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response summarizeForPolicySetDefinitionWithResponse( + PolicyStatesSummaryResourceType policyStatesSummaryResource, String subscriptionId, String policySetDefinitionName, Integer top, @@ -3904,7 +4033,7 @@ public Response summarizeForPolicySetDefinitionWithRespon String filter, Context context) { return summarizeForPolicySetDefinitionWithResponseAsync( - subscriptionId, policySetDefinitionName, top, from, to, filter, context) + policyStatesSummaryResource, subscriptionId, policySetDefinitionName, top, from, to, filter, context) .block(); } @@ -3931,7 +4060,7 @@ public Response summarizeForPolicySetDefinitionWithRespon * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listQueryResultsForPolicyDefinitionSinglePageAsync( @@ -4023,7 +4152,7 @@ private Mono> listQueryResultsForPolicyDefinitio * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listQueryResultsForPolicyDefinitionSinglePageAsync( @@ -4112,7 +4241,7 @@ private Mono> listQueryResultsForPolicyDefinitio * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listQueryResultsForPolicyDefinitionAsync( @@ -4154,7 +4283,7 @@ private PagedFlux listQueryResultsForPolicyDefinitionAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listQueryResultsForPolicyDefinitionAsync( @@ -4208,7 +4337,7 @@ private PagedFlux listQueryResultsForPolicyDefinitionAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listQueryResultsForPolicyDefinitionAsync( @@ -4252,7 +4381,7 @@ private PagedFlux listQueryResultsForPolicyDefinitionAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listQueryResultsForPolicyDefinition( @@ -4304,7 +4433,7 @@ public PagedIterable listQueryResultsForPolicyDefinition( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listQueryResultsForPolicyDefinition( @@ -4339,6 +4468,8 @@ public PagedIterable listQueryResultsForPolicyDefinition( /** * Summarizes policy states for the subscription level policy definition. * + * @param policyStatesSummaryResource The virtual resource under PolicyStates resource type for summarize action. In + * a given time range, 'latest' represents the latest policy state(s) and is the only allowed value. * @param subscriptionId Microsoft Azure subscription ID. * @param policyDefinitionName Policy definition name. * @param top Maximum number of records to return. @@ -4350,10 +4481,11 @@ public PagedIterable listQueryResultsForPolicyDefinition( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return summarize action results. + * @return summarize action results along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> summarizeForPolicyDefinitionWithResponseAsync( + PolicyStatesSummaryResourceType policyStatesSummaryResource, String subscriptionId, String policyDefinitionName, Integer top, @@ -4366,6 +4498,12 @@ private Mono> summarizeForPolicyDefinitionWithRe new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } + if (policyStatesSummaryResource == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter policyStatesSummaryResource is required and cannot be null.")); + } if (subscriptionId == null) { return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); } @@ -4373,7 +4511,6 @@ private Mono> summarizeForPolicyDefinitionWithRe return Mono .error(new IllegalArgumentException("Parameter policyDefinitionName is required and cannot be null.")); } - final String policyStatesSummaryResource = "latest"; final String authorizationNamespace = "Microsoft.Authorization"; final String apiVersion = "2019-10-01"; final String accept = "application/json"; @@ -4400,6 +4537,8 @@ private Mono> summarizeForPolicyDefinitionWithRe /** * Summarizes policy states for the subscription level policy definition. * + * @param policyStatesSummaryResource The virtual resource under PolicyStates resource type for summarize action. In + * a given time range, 'latest' represents the latest policy state(s) and is the only allowed value. * @param subscriptionId Microsoft Azure subscription ID. * @param policyDefinitionName Policy definition name. * @param top Maximum number of records to return. @@ -4412,10 +4551,11 @@ private Mono> summarizeForPolicyDefinitionWithRe * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return summarize action results. + * @return summarize action results along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> summarizeForPolicyDefinitionWithResponseAsync( + PolicyStatesSummaryResourceType policyStatesSummaryResource, String subscriptionId, String policyDefinitionName, Integer top, @@ -4429,6 +4569,12 @@ private Mono> summarizeForPolicyDefinitionWithRe new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } + if (policyStatesSummaryResource == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter policyStatesSummaryResource is required and cannot be null.")); + } if (subscriptionId == null) { return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); } @@ -4436,7 +4582,6 @@ private Mono> summarizeForPolicyDefinitionWithRe return Mono .error(new IllegalArgumentException("Parameter policyDefinitionName is required and cannot be null.")); } - final String policyStatesSummaryResource = "latest"; final String authorizationNamespace = "Microsoft.Authorization"; final String apiVersion = "2019-10-01"; final String accept = "application/json"; @@ -4460,6 +4605,8 @@ private Mono> summarizeForPolicyDefinitionWithRe /** * Summarizes policy states for the subscription level policy definition. * + * @param policyStatesSummaryResource The virtual resource under PolicyStates resource type for summarize action. In + * a given time range, 'latest' represents the latest policy state(s) and is the only allowed value. * @param subscriptionId Microsoft Azure subscription ID. * @param policyDefinitionName Policy definition name. * @param top Maximum number of records to return. @@ -4471,10 +4618,11 @@ private Mono> summarizeForPolicyDefinitionWithRe * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return summarize action results. + * @return summarize action results on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono summarizeForPolicyDefinitionAsync( + PolicyStatesSummaryResourceType policyStatesSummaryResource, String subscriptionId, String policyDefinitionName, Integer top, @@ -4482,49 +4630,41 @@ private Mono summarizeForPolicyDefinitionAsync( OffsetDateTime to, String filter) { return summarizeForPolicyDefinitionWithResponseAsync( - subscriptionId, policyDefinitionName, top, from, to, filter) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + policyStatesSummaryResource, subscriptionId, policyDefinitionName, top, from, to, filter) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Summarizes policy states for the subscription level policy definition. * + * @param policyStatesSummaryResource The virtual resource under PolicyStates resource type for summarize action. In + * a given time range, 'latest' represents the latest policy state(s) and is the only allowed value. * @param subscriptionId Microsoft Azure subscription ID. * @param policyDefinitionName Policy definition name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return summarize action results. + * @return summarize action results on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono summarizeForPolicyDefinitionAsync( - String subscriptionId, String policyDefinitionName) { + PolicyStatesSummaryResourceType policyStatesSummaryResource, + String subscriptionId, + String policyDefinitionName) { final Integer top = null; final OffsetDateTime from = null; final OffsetDateTime to = null; final String filter = null; return summarizeForPolicyDefinitionWithResponseAsync( - subscriptionId, policyDefinitionName, top, from, to, filter) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + policyStatesSummaryResource, subscriptionId, policyDefinitionName, top, from, to, filter) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Summarizes policy states for the subscription level policy definition. * + * @param policyStatesSummaryResource The virtual resource under PolicyStates resource type for summarize action. In + * a given time range, 'latest' represents the latest policy state(s) and is the only allowed value. * @param subscriptionId Microsoft Azure subscription ID. * @param policyDefinitionName Policy definition name. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -4533,17 +4673,24 @@ private Mono summarizeForPolicyDefinitionAsync( * @return summarize action results. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SummarizeResultsInner summarizeForPolicyDefinition(String subscriptionId, String policyDefinitionName) { + public SummarizeResultsInner summarizeForPolicyDefinition( + PolicyStatesSummaryResourceType policyStatesSummaryResource, + String subscriptionId, + String policyDefinitionName) { final Integer top = null; final OffsetDateTime from = null; final OffsetDateTime to = null; final String filter = null; - return summarizeForPolicyDefinitionAsync(subscriptionId, policyDefinitionName, top, from, to, filter).block(); + return summarizeForPolicyDefinitionAsync( + policyStatesSummaryResource, subscriptionId, policyDefinitionName, top, from, to, filter) + .block(); } /** * Summarizes policy states for the subscription level policy definition. * + * @param policyStatesSummaryResource The virtual resource under PolicyStates resource type for summarize action. In + * a given time range, 'latest' represents the latest policy state(s) and is the only allowed value. * @param subscriptionId Microsoft Azure subscription ID. * @param policyDefinitionName Policy definition name. * @param top Maximum number of records to return. @@ -4556,10 +4703,11 @@ public SummarizeResultsInner summarizeForPolicyDefinition(String subscriptionId, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return summarize action results. + * @return summarize action results along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response summarizeForPolicyDefinitionWithResponse( + PolicyStatesSummaryResourceType policyStatesSummaryResource, String subscriptionId, String policyDefinitionName, Integer top, @@ -4568,7 +4716,7 @@ public Response summarizeForPolicyDefinitionWithResponse( String filter, Context context) { return summarizeForPolicyDefinitionWithResponseAsync( - subscriptionId, policyDefinitionName, top, from, to, filter, context) + policyStatesSummaryResource, subscriptionId, policyDefinitionName, top, from, to, filter, context) .block(); } @@ -4595,7 +4743,7 @@ public Response summarizeForPolicyDefinitionWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listQueryResultsForSubscriptionLevelPolicyAssignmentSinglePageAsync( @@ -4687,7 +4835,7 @@ private Mono> listQueryResultsForSubscriptionLev * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listQueryResultsForSubscriptionLevelPolicyAssignmentSinglePageAsync( @@ -4776,7 +4924,7 @@ private Mono> listQueryResultsForSubscriptionLev * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listQueryResultsForSubscriptionLevelPolicyAssignmentAsync( @@ -4818,7 +4966,7 @@ private PagedFlux listQueryResultsForSubscriptionLevelPolicyAs * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listQueryResultsForSubscriptionLevelPolicyAssignmentAsync( @@ -4872,7 +5020,7 @@ private PagedFlux listQueryResultsForSubscriptionLevelPolicyAs * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listQueryResultsForSubscriptionLevelPolicyAssignmentAsync( @@ -4916,7 +5064,7 @@ private PagedFlux listQueryResultsForSubscriptionLevelPolicyAs * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listQueryResultsForSubscriptionLevelPolicyAssignment( @@ -4968,7 +5116,7 @@ public PagedIterable listQueryResultsForSubscriptionLevelPolic * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listQueryResultsForSubscriptionLevelPolicyAssignment( @@ -5003,6 +5151,8 @@ public PagedIterable listQueryResultsForSubscriptionLevelPolic /** * Summarizes policy states for the subscription level policy assignment. * + * @param policyStatesSummaryResource The virtual resource under PolicyStates resource type for summarize action. In + * a given time range, 'latest' represents the latest policy state(s) and is the only allowed value. * @param subscriptionId Microsoft Azure subscription ID. * @param policyAssignmentName Policy assignment name. * @param top Maximum number of records to return. @@ -5014,10 +5164,11 @@ public PagedIterable listQueryResultsForSubscriptionLevelPolic * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return summarize action results. + * @return summarize action results along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> summarizeForSubscriptionLevelPolicyAssignmentWithResponseAsync( + PolicyStatesSummaryResourceType policyStatesSummaryResource, String subscriptionId, String policyAssignmentName, Integer top, @@ -5030,6 +5181,12 @@ private Mono> summarizeForSubscriptionLevelPolic new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } + if (policyStatesSummaryResource == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter policyStatesSummaryResource is required and cannot be null.")); + } if (subscriptionId == null) { return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); } @@ -5037,7 +5194,6 @@ private Mono> summarizeForSubscriptionLevelPolic return Mono .error(new IllegalArgumentException("Parameter policyAssignmentName is required and cannot be null.")); } - final String policyStatesSummaryResource = "latest"; final String authorizationNamespace = "Microsoft.Authorization"; final String apiVersion = "2019-10-01"; final String accept = "application/json"; @@ -5064,6 +5220,8 @@ private Mono> summarizeForSubscriptionLevelPolic /** * Summarizes policy states for the subscription level policy assignment. * + * @param policyStatesSummaryResource The virtual resource under PolicyStates resource type for summarize action. In + * a given time range, 'latest' represents the latest policy state(s) and is the only allowed value. * @param subscriptionId Microsoft Azure subscription ID. * @param policyAssignmentName Policy assignment name. * @param top Maximum number of records to return. @@ -5076,10 +5234,11 @@ private Mono> summarizeForSubscriptionLevelPolic * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return summarize action results. + * @return summarize action results along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> summarizeForSubscriptionLevelPolicyAssignmentWithResponseAsync( + PolicyStatesSummaryResourceType policyStatesSummaryResource, String subscriptionId, String policyAssignmentName, Integer top, @@ -5093,6 +5252,12 @@ private Mono> summarizeForSubscriptionLevelPolic new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } + if (policyStatesSummaryResource == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter policyStatesSummaryResource is required and cannot be null.")); + } if (subscriptionId == null) { return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); } @@ -5100,7 +5265,6 @@ private Mono> summarizeForSubscriptionLevelPolic return Mono .error(new IllegalArgumentException("Parameter policyAssignmentName is required and cannot be null.")); } - final String policyStatesSummaryResource = "latest"; final String authorizationNamespace = "Microsoft.Authorization"; final String apiVersion = "2019-10-01"; final String accept = "application/json"; @@ -5124,6 +5288,8 @@ private Mono> summarizeForSubscriptionLevelPolic /** * Summarizes policy states for the subscription level policy assignment. * + * @param policyStatesSummaryResource The virtual resource under PolicyStates resource type for summarize action. In + * a given time range, 'latest' represents the latest policy state(s) and is the only allowed value. * @param subscriptionId Microsoft Azure subscription ID. * @param policyAssignmentName Policy assignment name. * @param top Maximum number of records to return. @@ -5135,10 +5301,11 @@ private Mono> summarizeForSubscriptionLevelPolic * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return summarize action results. + * @return summarize action results on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono summarizeForSubscriptionLevelPolicyAssignmentAsync( + PolicyStatesSummaryResourceType policyStatesSummaryResource, String subscriptionId, String policyAssignmentName, Integer top, @@ -5146,49 +5313,41 @@ private Mono summarizeForSubscriptionLevelPolicyAssignmen OffsetDateTime to, String filter) { return summarizeForSubscriptionLevelPolicyAssignmentWithResponseAsync( - subscriptionId, policyAssignmentName, top, from, to, filter) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + policyStatesSummaryResource, subscriptionId, policyAssignmentName, top, from, to, filter) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Summarizes policy states for the subscription level policy assignment. * + * @param policyStatesSummaryResource The virtual resource under PolicyStates resource type for summarize action. In + * a given time range, 'latest' represents the latest policy state(s) and is the only allowed value. * @param subscriptionId Microsoft Azure subscription ID. * @param policyAssignmentName Policy assignment name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return summarize action results. + * @return summarize action results on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono summarizeForSubscriptionLevelPolicyAssignmentAsync( - String subscriptionId, String policyAssignmentName) { + PolicyStatesSummaryResourceType policyStatesSummaryResource, + String subscriptionId, + String policyAssignmentName) { final Integer top = null; final OffsetDateTime from = null; final OffsetDateTime to = null; final String filter = null; return summarizeForSubscriptionLevelPolicyAssignmentWithResponseAsync( - subscriptionId, policyAssignmentName, top, from, to, filter) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + policyStatesSummaryResource, subscriptionId, policyAssignmentName, top, from, to, filter) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Summarizes policy states for the subscription level policy assignment. * + * @param policyStatesSummaryResource The virtual resource under PolicyStates resource type for summarize action. In + * a given time range, 'latest' represents the latest policy state(s) and is the only allowed value. * @param subscriptionId Microsoft Azure subscription ID. * @param policyAssignmentName Policy assignment name. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -5198,19 +5357,23 @@ private Mono summarizeForSubscriptionLevelPolicyAssignmen */ @ServiceMethod(returns = ReturnType.SINGLE) public SummarizeResultsInner summarizeForSubscriptionLevelPolicyAssignment( - String subscriptionId, String policyAssignmentName) { + PolicyStatesSummaryResourceType policyStatesSummaryResource, + String subscriptionId, + String policyAssignmentName) { final Integer top = null; final OffsetDateTime from = null; final OffsetDateTime to = null; final String filter = null; return summarizeForSubscriptionLevelPolicyAssignmentAsync( - subscriptionId, policyAssignmentName, top, from, to, filter) + policyStatesSummaryResource, subscriptionId, policyAssignmentName, top, from, to, filter) .block(); } /** * Summarizes policy states for the subscription level policy assignment. * + * @param policyStatesSummaryResource The virtual resource under PolicyStates resource type for summarize action. In + * a given time range, 'latest' represents the latest policy state(s) and is the only allowed value. * @param subscriptionId Microsoft Azure subscription ID. * @param policyAssignmentName Policy assignment name. * @param top Maximum number of records to return. @@ -5223,10 +5386,11 @@ public SummarizeResultsInner summarizeForSubscriptionLevelPolicyAssignment( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return summarize action results. + * @return summarize action results along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response summarizeForSubscriptionLevelPolicyAssignmentWithResponse( + PolicyStatesSummaryResourceType policyStatesSummaryResource, String subscriptionId, String policyAssignmentName, Integer top, @@ -5235,7 +5399,7 @@ public Response summarizeForSubscriptionLevelPolicyAssign String filter, Context context) { return summarizeForSubscriptionLevelPolicyAssignmentWithResponseAsync( - subscriptionId, policyAssignmentName, top, from, to, filter, context) + policyStatesSummaryResource, subscriptionId, policyAssignmentName, top, from, to, filter, context) .block(); } @@ -5263,7 +5427,7 @@ public Response summarizeForSubscriptionLevelPolicyAssign * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listQueryResultsForResourceGroupLevelPolicyAssignmentSinglePageAsync( @@ -5362,7 +5526,7 @@ private Mono> listQueryResultsForResourceGroupLe * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listQueryResultsForResourceGroupLevelPolicyAssignmentSinglePageAsync( @@ -5458,7 +5622,7 @@ private Mono> listQueryResultsForResourceGroupLe * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listQueryResultsForResourceGroupLevelPolicyAssignmentAsync( @@ -5503,7 +5667,7 @@ private PagedFlux listQueryResultsForResourceGroupLevelPolicyA * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listQueryResultsForResourceGroupLevelPolicyAssignmentAsync( @@ -5562,7 +5726,7 @@ private PagedFlux listQueryResultsForResourceGroupLevelPolicyA * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listQueryResultsForResourceGroupLevelPolicyAssignmentAsync( @@ -5609,7 +5773,7 @@ private PagedFlux listQueryResultsForResourceGroupLevelPolicyA * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listQueryResultsForResourceGroupLevelPolicyAssignment( @@ -5666,7 +5830,7 @@ public PagedIterable listQueryResultsForResourceGroupLevelPoli * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listQueryResultsForResourceGroupLevelPolicyAssignment( @@ -5703,6 +5867,8 @@ public PagedIterable listQueryResultsForResourceGroupLevelPoli /** * Summarizes policy states for the resource group level policy assignment. * + * @param policyStatesSummaryResource The virtual resource under PolicyStates resource type for summarize action. In + * a given time range, 'latest' represents the latest policy state(s) and is the only allowed value. * @param subscriptionId Microsoft Azure subscription ID. * @param resourceGroupName Resource group name. * @param policyAssignmentName Policy assignment name. @@ -5715,10 +5881,11 @@ public PagedIterable listQueryResultsForResourceGroupLevelPoli * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return summarize action results. + * @return summarize action results along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> summarizeForResourceGroupLevelPolicyAssignmentWithResponseAsync( + PolicyStatesSummaryResourceType policyStatesSummaryResource, String subscriptionId, String resourceGroupName, String policyAssignmentName, @@ -5732,6 +5899,12 @@ private Mono> summarizeForResourceGroupLevelPoli new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } + if (policyStatesSummaryResource == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter policyStatesSummaryResource is required and cannot be null.")); + } if (subscriptionId == null) { return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); } @@ -5743,7 +5916,6 @@ private Mono> summarizeForResourceGroupLevelPoli return Mono .error(new IllegalArgumentException("Parameter policyAssignmentName is required and cannot be null.")); } - final String policyStatesSummaryResource = "latest"; final String authorizationNamespace = "Microsoft.Authorization"; final String apiVersion = "2019-10-01"; final String accept = "application/json"; @@ -5771,6 +5943,8 @@ private Mono> summarizeForResourceGroupLevelPoli /** * Summarizes policy states for the resource group level policy assignment. * + * @param policyStatesSummaryResource The virtual resource under PolicyStates resource type for summarize action. In + * a given time range, 'latest' represents the latest policy state(s) and is the only allowed value. * @param subscriptionId Microsoft Azure subscription ID. * @param resourceGroupName Resource group name. * @param policyAssignmentName Policy assignment name. @@ -5784,10 +5958,11 @@ private Mono> summarizeForResourceGroupLevelPoli * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return summarize action results. + * @return summarize action results along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> summarizeForResourceGroupLevelPolicyAssignmentWithResponseAsync( + PolicyStatesSummaryResourceType policyStatesSummaryResource, String subscriptionId, String resourceGroupName, String policyAssignmentName, @@ -5802,6 +5977,12 @@ private Mono> summarizeForResourceGroupLevelPoli new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } + if (policyStatesSummaryResource == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter policyStatesSummaryResource is required and cannot be null.")); + } if (subscriptionId == null) { return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); } @@ -5813,7 +5994,6 @@ private Mono> summarizeForResourceGroupLevelPoli return Mono .error(new IllegalArgumentException("Parameter policyAssignmentName is required and cannot be null.")); } - final String policyStatesSummaryResource = "latest"; final String authorizationNamespace = "Microsoft.Authorization"; final String apiVersion = "2019-10-01"; final String accept = "application/json"; @@ -5838,6 +6018,8 @@ private Mono> summarizeForResourceGroupLevelPoli /** * Summarizes policy states for the resource group level policy assignment. * + * @param policyStatesSummaryResource The virtual resource under PolicyStates resource type for summarize action. In + * a given time range, 'latest' represents the latest policy state(s) and is the only allowed value. * @param subscriptionId Microsoft Azure subscription ID. * @param resourceGroupName Resource group name. * @param policyAssignmentName Policy assignment name. @@ -5850,10 +6032,11 @@ private Mono> summarizeForResourceGroupLevelPoli * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return summarize action results. + * @return summarize action results on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono summarizeForResourceGroupLevelPolicyAssignmentAsync( + PolicyStatesSummaryResourceType policyStatesSummaryResource, String subscriptionId, String resourceGroupName, String policyAssignmentName, @@ -5862,50 +6045,57 @@ private Mono summarizeForResourceGroupLevelPolicyAssignme OffsetDateTime to, String filter) { return summarizeForResourceGroupLevelPolicyAssignmentWithResponseAsync( - subscriptionId, resourceGroupName, policyAssignmentName, top, from, to, filter) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + policyStatesSummaryResource, + subscriptionId, + resourceGroupName, + policyAssignmentName, + top, + from, + to, + filter) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Summarizes policy states for the resource group level policy assignment. * + * @param policyStatesSummaryResource The virtual resource under PolicyStates resource type for summarize action. In + * a given time range, 'latest' represents the latest policy state(s) and is the only allowed value. * @param subscriptionId Microsoft Azure subscription ID. * @param resourceGroupName Resource group name. * @param policyAssignmentName Policy assignment name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return summarize action results. + * @return summarize action results on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono summarizeForResourceGroupLevelPolicyAssignmentAsync( - String subscriptionId, String resourceGroupName, String policyAssignmentName) { + PolicyStatesSummaryResourceType policyStatesSummaryResource, + String subscriptionId, + String resourceGroupName, + String policyAssignmentName) { final Integer top = null; final OffsetDateTime from = null; final OffsetDateTime to = null; final String filter = null; return summarizeForResourceGroupLevelPolicyAssignmentWithResponseAsync( - subscriptionId, resourceGroupName, policyAssignmentName, top, from, to, filter) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + policyStatesSummaryResource, + subscriptionId, + resourceGroupName, + policyAssignmentName, + top, + from, + to, + filter) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Summarizes policy states for the resource group level policy assignment. * + * @param policyStatesSummaryResource The virtual resource under PolicyStates resource type for summarize action. In + * a given time range, 'latest' represents the latest policy state(s) and is the only allowed value. * @param subscriptionId Microsoft Azure subscription ID. * @param resourceGroupName Resource group name. * @param policyAssignmentName Policy assignment name. @@ -5916,19 +6106,31 @@ private Mono summarizeForResourceGroupLevelPolicyAssignme */ @ServiceMethod(returns = ReturnType.SINGLE) public SummarizeResultsInner summarizeForResourceGroupLevelPolicyAssignment( - String subscriptionId, String resourceGroupName, String policyAssignmentName) { + PolicyStatesSummaryResourceType policyStatesSummaryResource, + String subscriptionId, + String resourceGroupName, + String policyAssignmentName) { final Integer top = null; final OffsetDateTime from = null; final OffsetDateTime to = null; final String filter = null; return summarizeForResourceGroupLevelPolicyAssignmentAsync( - subscriptionId, resourceGroupName, policyAssignmentName, top, from, to, filter) + policyStatesSummaryResource, + subscriptionId, + resourceGroupName, + policyAssignmentName, + top, + from, + to, + filter) .block(); } /** * Summarizes policy states for the resource group level policy assignment. * + * @param policyStatesSummaryResource The virtual resource under PolicyStates resource type for summarize action. In + * a given time range, 'latest' represents the latest policy state(s) and is the only allowed value. * @param subscriptionId Microsoft Azure subscription ID. * @param resourceGroupName Resource group name. * @param policyAssignmentName Policy assignment name. @@ -5942,10 +6144,11 @@ public SummarizeResultsInner summarizeForResourceGroupLevelPolicyAssignment( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return summarize action results. + * @return summarize action results along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response summarizeForResourceGroupLevelPolicyAssignmentWithResponse( + PolicyStatesSummaryResourceType policyStatesSummaryResource, String subscriptionId, String resourceGroupName, String policyAssignmentName, @@ -5955,18 +6158,27 @@ public Response summarizeForResourceGroupLevelPolicyAssig String filter, Context context) { return summarizeForResourceGroupLevelPolicyAssignmentWithResponseAsync( - subscriptionId, resourceGroupName, policyAssignmentName, top, from, to, filter, context) + policyStatesSummaryResource, + subscriptionId, + resourceGroupName, + policyAssignmentName, + top, + from, + to, + filter, + context) .block(); } /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @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 query results. + * @return query results along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> nextLinkSinglePageAsync(String nextLink) { @@ -5990,12 +6202,13 @@ private Mono> nextLinkSinglePageAsync(String nex /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @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 query results. + * @return query results along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> nextLinkSinglePageAsync(String nextLink, Context context) { diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/implementation/PolicyStatesImpl.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/implementation/PolicyStatesImpl.java index c9891b3a616d..a66a1dedb787 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/implementation/PolicyStatesImpl.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/implementation/PolicyStatesImpl.java @@ -15,12 +15,12 @@ import com.azure.resourcemanager.policyinsights.models.PolicyState; import com.azure.resourcemanager.policyinsights.models.PolicyStates; import com.azure.resourcemanager.policyinsights.models.PolicyStatesResource; +import com.azure.resourcemanager.policyinsights.models.PolicyStatesSummaryResourceType; import com.azure.resourcemanager.policyinsights.models.SummarizeResults; -import com.fasterxml.jackson.annotation.JsonIgnore; import java.time.OffsetDateTime; public final class PolicyStatesImpl implements PolicyStates { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PolicyStatesImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(PolicyStatesImpl.class); private final PolicyStatesClient innerClient; @@ -69,8 +69,10 @@ public PagedIterable listQueryResultsForManagementGroup( return Utils.mapPage(inner, inner1 -> new PolicyStateImpl(inner1, this.manager())); } - public SummarizeResults summarizeForManagementGroup(String managementGroupName) { - SummarizeResultsInner inner = this.serviceClient().summarizeForManagementGroup(managementGroupName); + public SummarizeResults summarizeForManagementGroup( + PolicyStatesSummaryResourceType policyStatesSummaryResource, String managementGroupName) { + SummarizeResultsInner inner = + this.serviceClient().summarizeForManagementGroup(policyStatesSummaryResource, managementGroupName); if (inner != null) { return new SummarizeResultsImpl(inner, this.manager()); } else { @@ -79,6 +81,7 @@ public SummarizeResults summarizeForManagementGroup(String managementGroupName) } public Response summarizeForManagementGroupWithResponse( + PolicyStatesSummaryResourceType policyStatesSummaryResource, String managementGroupName, Integer top, OffsetDateTime from, @@ -88,7 +91,8 @@ public Response summarizeForManagementGroupWithResponse( Response inner = this .serviceClient() - .summarizeForManagementGroupWithResponse(managementGroupName, top, from, to, filter, context); + .summarizeForManagementGroupWithResponse( + policyStatesSummaryResource, managementGroupName, top, from, to, filter, context); if (inner != null) { return new SimpleResponse<>( inner.getRequest(), @@ -137,8 +141,10 @@ public PagedIterable listQueryResultsForSubscription( return Utils.mapPage(inner, inner1 -> new PolicyStateImpl(inner1, this.manager())); } - public SummarizeResults summarizeForSubscription(String subscriptionId) { - SummarizeResultsInner inner = this.serviceClient().summarizeForSubscription(subscriptionId); + public SummarizeResults summarizeForSubscription( + PolicyStatesSummaryResourceType policyStatesSummaryResource, String subscriptionId) { + SummarizeResultsInner inner = + this.serviceClient().summarizeForSubscription(policyStatesSummaryResource, subscriptionId); if (inner != null) { return new SummarizeResultsImpl(inner, this.manager()); } else { @@ -147,9 +153,18 @@ public SummarizeResults summarizeForSubscription(String subscriptionId) { } public Response summarizeForSubscriptionWithResponse( - String subscriptionId, Integer top, OffsetDateTime from, OffsetDateTime to, String filter, Context context) { + PolicyStatesSummaryResourceType policyStatesSummaryResource, + String subscriptionId, + Integer top, + OffsetDateTime from, + OffsetDateTime to, + String filter, + Context context) { Response inner = - this.serviceClient().summarizeForSubscriptionWithResponse(subscriptionId, top, from, to, filter, context); + this + .serviceClient() + .summarizeForSubscriptionWithResponse( + policyStatesSummaryResource, subscriptionId, top, from, to, filter, context); if (inner != null) { return new SimpleResponse<>( inner.getRequest(), @@ -202,8 +217,12 @@ public PagedIterable listQueryResultsForResourceGroup( return Utils.mapPage(inner, inner1 -> new PolicyStateImpl(inner1, this.manager())); } - public SummarizeResults summarizeForResourceGroup(String subscriptionId, String resourceGroupName) { - SummarizeResultsInner inner = this.serviceClient().summarizeForResourceGroup(subscriptionId, resourceGroupName); + public SummarizeResults summarizeForResourceGroup( + PolicyStatesSummaryResourceType policyStatesSummaryResource, String subscriptionId, String resourceGroupName) { + SummarizeResultsInner inner = + this + .serviceClient() + .summarizeForResourceGroup(policyStatesSummaryResource, subscriptionId, resourceGroupName); if (inner != null) { return new SummarizeResultsImpl(inner, this.manager()); } else { @@ -212,6 +231,7 @@ public SummarizeResults summarizeForResourceGroup(String subscriptionId, String } public Response summarizeForResourceGroupWithResponse( + PolicyStatesSummaryResourceType policyStatesSummaryResource, String subscriptionId, String resourceGroupName, Integer top, @@ -223,7 +243,7 @@ public Response summarizeForResourceGroupWithResponse( this .serviceClient() .summarizeForResourceGroupWithResponse( - subscriptionId, resourceGroupName, top, from, to, filter, context); + policyStatesSummaryResource, subscriptionId, resourceGroupName, top, from, to, filter, context); if (inner != null) { return new SimpleResponse<>( inner.getRequest(), @@ -274,8 +294,10 @@ public PagedIterable listQueryResultsForResource( return Utils.mapPage(inner, inner1 -> new PolicyStateImpl(inner1, this.manager())); } - public SummarizeResults summarizeForResource(String resourceId) { - SummarizeResultsInner inner = this.serviceClient().summarizeForResource(resourceId); + public SummarizeResults summarizeForResource( + PolicyStatesSummaryResourceType policyStatesSummaryResource, String resourceId) { + SummarizeResultsInner inner = + this.serviceClient().summarizeForResource(policyStatesSummaryResource, resourceId); if (inner != null) { return new SummarizeResultsImpl(inner, this.manager()); } else { @@ -284,9 +306,18 @@ public SummarizeResults summarizeForResource(String resourceId) { } public Response summarizeForResourceWithResponse( - String resourceId, Integer top, OffsetDateTime from, OffsetDateTime to, String filter, Context context) { + PolicyStatesSummaryResourceType policyStatesSummaryResource, + String resourceId, + Integer top, + OffsetDateTime from, + OffsetDateTime to, + String filter, + Context context) { Response inner = - this.serviceClient().summarizeForResourceWithResponse(resourceId, top, from, to, filter, context); + this + .serviceClient() + .summarizeForResourceWithResponse( + policyStatesSummaryResource, resourceId, top, from, to, filter, context); if (inner != null) { return new SimpleResponse<>( inner.getRequest(), @@ -355,9 +386,14 @@ public PagedIterable listQueryResultsForPolicySetDefinition( return Utils.mapPage(inner, inner1 -> new PolicyStateImpl(inner1, this.manager())); } - public SummarizeResults summarizeForPolicySetDefinition(String subscriptionId, String policySetDefinitionName) { + public SummarizeResults summarizeForPolicySetDefinition( + PolicyStatesSummaryResourceType policyStatesSummaryResource, + String subscriptionId, + String policySetDefinitionName) { SummarizeResultsInner inner = - this.serviceClient().summarizeForPolicySetDefinition(subscriptionId, policySetDefinitionName); + this + .serviceClient() + .summarizeForPolicySetDefinition(policyStatesSummaryResource, subscriptionId, policySetDefinitionName); if (inner != null) { return new SummarizeResultsImpl(inner, this.manager()); } else { @@ -366,6 +402,7 @@ public SummarizeResults summarizeForPolicySetDefinition(String subscriptionId, S } public Response summarizeForPolicySetDefinitionWithResponse( + PolicyStatesSummaryResourceType policyStatesSummaryResource, String subscriptionId, String policySetDefinitionName, Integer top, @@ -377,7 +414,14 @@ public Response summarizeForPolicySetDefinitionWithResponse( this .serviceClient() .summarizeForPolicySetDefinitionWithResponse( - subscriptionId, policySetDefinitionName, top, from, to, filter, context); + policyStatesSummaryResource, + subscriptionId, + policySetDefinitionName, + top, + from, + to, + filter, + context); if (inner != null) { return new SimpleResponse<>( inner.getRequest(), @@ -430,9 +474,14 @@ public PagedIterable listQueryResultsForPolicyDefinition( return Utils.mapPage(inner, inner1 -> new PolicyStateImpl(inner1, this.manager())); } - public SummarizeResults summarizeForPolicyDefinition(String subscriptionId, String policyDefinitionName) { + public SummarizeResults summarizeForPolicyDefinition( + PolicyStatesSummaryResourceType policyStatesSummaryResource, + String subscriptionId, + String policyDefinitionName) { SummarizeResultsInner inner = - this.serviceClient().summarizeForPolicyDefinition(subscriptionId, policyDefinitionName); + this + .serviceClient() + .summarizeForPolicyDefinition(policyStatesSummaryResource, subscriptionId, policyDefinitionName); if (inner != null) { return new SummarizeResultsImpl(inner, this.manager()); } else { @@ -441,6 +490,7 @@ public SummarizeResults summarizeForPolicyDefinition(String subscriptionId, Stri } public Response summarizeForPolicyDefinitionWithResponse( + PolicyStatesSummaryResourceType policyStatesSummaryResource, String subscriptionId, String policyDefinitionName, Integer top, @@ -452,7 +502,7 @@ public Response summarizeForPolicyDefinitionWithResponse( this .serviceClient() .summarizeForPolicyDefinitionWithResponse( - subscriptionId, policyDefinitionName, top, from, to, filter, context); + policyStatesSummaryResource, subscriptionId, policyDefinitionName, top, from, to, filter, context); if (inner != null) { return new SimpleResponse<>( inner.getRequest(), @@ -507,9 +557,14 @@ public PagedIterable listQueryResultsForSubscriptionLevelPolicyAssi } public SummarizeResults summarizeForSubscriptionLevelPolicyAssignment( - String subscriptionId, String policyAssignmentName) { + PolicyStatesSummaryResourceType policyStatesSummaryResource, + String subscriptionId, + String policyAssignmentName) { SummarizeResultsInner inner = - this.serviceClient().summarizeForSubscriptionLevelPolicyAssignment(subscriptionId, policyAssignmentName); + this + .serviceClient() + .summarizeForSubscriptionLevelPolicyAssignment( + policyStatesSummaryResource, subscriptionId, policyAssignmentName); if (inner != null) { return new SummarizeResultsImpl(inner, this.manager()); } else { @@ -518,6 +573,7 @@ public SummarizeResults summarizeForSubscriptionLevelPolicyAssignment( } public Response summarizeForSubscriptionLevelPolicyAssignmentWithResponse( + PolicyStatesSummaryResourceType policyStatesSummaryResource, String subscriptionId, String policyAssignmentName, Integer top, @@ -529,7 +585,7 @@ public Response summarizeForSubscriptionLevelPolicyAssignmentW this .serviceClient() .summarizeForSubscriptionLevelPolicyAssignmentWithResponse( - subscriptionId, policyAssignmentName, top, from, to, filter, context); + policyStatesSummaryResource, subscriptionId, policyAssignmentName, top, from, to, filter, context); if (inner != null) { return new SimpleResponse<>( inner.getRequest(), @@ -589,12 +645,15 @@ public PagedIterable listQueryResultsForResourceGroupLevelPolicyAss } public SummarizeResults summarizeForResourceGroupLevelPolicyAssignment( - String subscriptionId, String resourceGroupName, String policyAssignmentName) { + PolicyStatesSummaryResourceType policyStatesSummaryResource, + String subscriptionId, + String resourceGroupName, + String policyAssignmentName) { SummarizeResultsInner inner = this .serviceClient() .summarizeForResourceGroupLevelPolicyAssignment( - subscriptionId, resourceGroupName, policyAssignmentName); + policyStatesSummaryResource, subscriptionId, resourceGroupName, policyAssignmentName); if (inner != null) { return new SummarizeResultsImpl(inner, this.manager()); } else { @@ -603,6 +662,7 @@ public SummarizeResults summarizeForResourceGroupLevelPolicyAssignment( } public Response summarizeForResourceGroupLevelPolicyAssignmentWithResponse( + PolicyStatesSummaryResourceType policyStatesSummaryResource, String subscriptionId, String resourceGroupName, String policyAssignmentName, @@ -615,7 +675,15 @@ public Response summarizeForResourceGroupLevelPolicyAssignment this .serviceClient() .summarizeForResourceGroupLevelPolicyAssignmentWithResponse( - subscriptionId, resourceGroupName, policyAssignmentName, top, from, to, filter, context); + policyStatesSummaryResource, + subscriptionId, + resourceGroupName, + policyAssignmentName, + top, + from, + to, + filter, + context); if (inner != null) { return new SimpleResponse<>( inner.getRequest(), diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/implementation/PolicyTrackedResourcesClientImpl.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/implementation/PolicyTrackedResourcesClientImpl.java index d9d2ada0359d..c6bdb4c75ee0 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/implementation/PolicyTrackedResourcesClientImpl.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/implementation/PolicyTrackedResourcesClientImpl.java @@ -26,16 +26,14 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.policyinsights.fluent.PolicyTrackedResourcesClient; import com.azure.resourcemanager.policyinsights.fluent.models.PolicyTrackedResourceInner; import com.azure.resourcemanager.policyinsights.models.PolicyTrackedResourcesQueryResults; +import com.azure.resourcemanager.policyinsights.models.PolicyTrackedResourcesResourceType; import reactor.core.publisher.Mono; /** An instance of this class provides access to all the operations defined in PolicyTrackedResourcesClient. */ public final class PolicyTrackedResourcesClientImpl implements PolicyTrackedResourcesClient { - private final ClientLogger logger = new ClientLogger(PolicyTrackedResourcesClientImpl.class); - /** The proxy service used to perform REST calls. */ private final PolicyTrackedResourcesService service; @@ -71,7 +69,8 @@ Mono> listQueryResultsForManagement @HostParam("$host") String endpoint, @PathParam("managementGroupsNamespace") String managementGroupsNamespace, @PathParam("managementGroupName") String managementGroupName, - @PathParam("policyTrackedResourcesResource") String policyTrackedResourcesResource, + @PathParam("policyTrackedResourcesResource") + PolicyTrackedResourcesResourceType policyTrackedResourcesResource, @QueryParam("$top") Integer top, @QueryParam("$filter") String filter, @QueryParam("api-version") String apiVersion, @@ -86,7 +85,8 @@ Mono> listQueryResultsForManagement @UnexpectedResponseExceptionType(ManagementException.class) Mono> listQueryResultsForSubscription( @HostParam("$host") String endpoint, - @PathParam("policyTrackedResourcesResource") String policyTrackedResourcesResource, + @PathParam("policyTrackedResourcesResource") + PolicyTrackedResourcesResourceType policyTrackedResourcesResource, @QueryParam("$top") Integer top, @QueryParam("$filter") String filter, @PathParam("subscriptionId") String subscriptionId, @@ -103,7 +103,8 @@ Mono> listQueryResultsForSubscripti Mono> listQueryResultsForResourceGroup( @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("policyTrackedResourcesResource") String policyTrackedResourcesResource, + @PathParam("policyTrackedResourcesResource") + PolicyTrackedResourcesResourceType policyTrackedResourcesResource, @QueryParam("$top") Integer top, @QueryParam("$filter") String filter, @PathParam("subscriptionId") String subscriptionId, @@ -120,7 +121,8 @@ Mono> listQueryResultsForResourceGr Mono> listQueryResultsForResource( @HostParam("$host") String endpoint, @PathParam(value = "resourceId", encoded = true) String resourceId, - @PathParam("policyTrackedResourcesResource") String policyTrackedResourcesResource, + @PathParam("policyTrackedResourcesResource") + PolicyTrackedResourcesResourceType policyTrackedResourcesResource, @QueryParam("$top") Integer top, @QueryParam("$filter") String filter, @QueryParam("api-version") String apiVersion, @@ -172,16 +174,21 @@ Mono> listQueryResultsForResourceNe * Queries policy tracked resources under the management group. * * @param managementGroupName Management group name. + * @param policyTrackedResourcesResource The name of the virtual resource under PolicyTrackedResources resource + * type; only "default" is allowed. * @param top Maximum number of records to return. * @param filter OData filter expression. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listQueryResultsForManagementGroupSinglePageAsync( - String managementGroupName, Integer top, String filter) { + String managementGroupName, + PolicyTrackedResourcesResourceType policyTrackedResourcesResource, + Integer top, + String filter) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -192,8 +199,13 @@ private Mono> listQueryResultsForManag return Mono .error(new IllegalArgumentException("Parameter managementGroupName is required and cannot be null.")); } + if (policyTrackedResourcesResource == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter policyTrackedResourcesResource is required and cannot be null.")); + } final String managementGroupsNamespace = "Microsoft.Management"; - final String policyTrackedResourcesResource = "default"; final String apiVersion = "2018-07-01-preview"; final String accept = "application/json"; return FluxUtil @@ -226,17 +238,23 @@ private Mono> listQueryResultsForManag * Queries policy tracked resources under the management group. * * @param managementGroupName Management group name. + * @param policyTrackedResourcesResource The name of the virtual resource under PolicyTrackedResources resource + * type; only "default" is allowed. * @param top Maximum number of records to return. * @param filter OData filter expression. * @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 query results. + * @return query results along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listQueryResultsForManagementGroupSinglePageAsync( - String managementGroupName, Integer top, String filter, Context context) { + String managementGroupName, + PolicyTrackedResourcesResourceType policyTrackedResourcesResource, + Integer top, + String filter, + Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -247,8 +265,13 @@ private Mono> listQueryResultsForManag return Mono .error(new IllegalArgumentException("Parameter managementGroupName is required and cannot be null.")); } + if (policyTrackedResourcesResource == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter policyTrackedResourcesResource is required and cannot be null.")); + } final String managementGroupsNamespace = "Microsoft.Management"; - final String policyTrackedResourcesResource = "default"; final String apiVersion = "2018-07-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); @@ -278,18 +301,25 @@ private Mono> listQueryResultsForManag * Queries policy tracked resources under the management group. * * @param managementGroupName Management group name. + * @param policyTrackedResourcesResource The name of the virtual resource under PolicyTrackedResources resource + * type; only "default" is allowed. * @param top Maximum number of records to return. * @param filter OData filter expression. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listQueryResultsForManagementGroupAsync( - String managementGroupName, Integer top, String filter) { + String managementGroupName, + PolicyTrackedResourcesResourceType policyTrackedResourcesResource, + Integer top, + String filter) { return new PagedFlux<>( - () -> listQueryResultsForManagementGroupSinglePageAsync(managementGroupName, top, filter), + () -> + listQueryResultsForManagementGroupSinglePageAsync( + managementGroupName, policyTrackedResourcesResource, top, filter), nextLink -> listQueryResultsForManagementGroupNextSinglePageAsync(nextLink)); } @@ -297,17 +327,22 @@ private PagedFlux listQueryResultsForManagementGroup * Queries policy tracked resources under the management group. * * @param managementGroupName Management group name. + * @param policyTrackedResourcesResource The name of the virtual resource under PolicyTrackedResources resource + * type; only "default" is allowed. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listQueryResultsForManagementGroupAsync(String managementGroupName) { + private PagedFlux listQueryResultsForManagementGroupAsync( + String managementGroupName, PolicyTrackedResourcesResourceType policyTrackedResourcesResource) { final Integer top = null; final String filter = null; return new PagedFlux<>( - () -> listQueryResultsForManagementGroupSinglePageAsync(managementGroupName, top, filter), + () -> + listQueryResultsForManagementGroupSinglePageAsync( + managementGroupName, policyTrackedResourcesResource, top, filter), nextLink -> listQueryResultsForManagementGroupNextSinglePageAsync(nextLink)); } @@ -315,19 +350,27 @@ private PagedFlux listQueryResultsForManagementGroup * Queries policy tracked resources under the management group. * * @param managementGroupName Management group name. + * @param policyTrackedResourcesResource The name of the virtual resource under PolicyTrackedResources resource + * type; only "default" is allowed. * @param top Maximum number of records to return. * @param filter OData filter expression. * @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 query results. + * @return query results as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listQueryResultsForManagementGroupAsync( - String managementGroupName, Integer top, String filter, Context context) { + String managementGroupName, + PolicyTrackedResourcesResourceType policyTrackedResourcesResource, + Integer top, + String filter, + Context context) { return new PagedFlux<>( - () -> listQueryResultsForManagementGroupSinglePageAsync(managementGroupName, top, filter, context), + () -> + listQueryResultsForManagementGroupSinglePageAsync( + managementGroupName, policyTrackedResourcesResource, top, filter, context), nextLink -> listQueryResultsForManagementGroupNextSinglePageAsync(nextLink, context)); } @@ -335,62 +378,81 @@ private PagedFlux listQueryResultsForManagementGroup * Queries policy tracked resources under the management group. * * @param managementGroupName Management group name. + * @param policyTrackedResourcesResource The name of the virtual resource under PolicyTrackedResources resource + * type; only "default" is allowed. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listQueryResultsForManagementGroup(String managementGroupName) { + public PagedIterable listQueryResultsForManagementGroup( + String managementGroupName, PolicyTrackedResourcesResourceType policyTrackedResourcesResource) { final Integer top = null; final String filter = null; - return new PagedIterable<>(listQueryResultsForManagementGroupAsync(managementGroupName, top, filter)); + return new PagedIterable<>( + listQueryResultsForManagementGroupAsync(managementGroupName, policyTrackedResourcesResource, top, filter)); } /** * Queries policy tracked resources under the management group. * * @param managementGroupName Management group name. + * @param policyTrackedResourcesResource The name of the virtual resource under PolicyTrackedResources resource + * type; only "default" is allowed. * @param top Maximum number of records to return. * @param filter OData filter expression. * @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 query results. + * @return query results as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listQueryResultsForManagementGroup( - String managementGroupName, Integer top, String filter, Context context) { - return new PagedIterable<>(listQueryResultsForManagementGroupAsync(managementGroupName, top, filter, context)); + String managementGroupName, + PolicyTrackedResourcesResourceType policyTrackedResourcesResource, + Integer top, + String filter, + Context context) { + return new PagedIterable<>( + listQueryResultsForManagementGroupAsync( + managementGroupName, policyTrackedResourcesResource, top, filter, context)); } /** * Queries policy tracked resources under the subscription. * + * @param policyTrackedResourcesResource The name of the virtual resource under PolicyTrackedResources resource + * type; only "default" is allowed. * @param top Maximum number of records to return. * @param filter OData filter expression. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listQueryResultsForSubscriptionSinglePageAsync( - Integer top, String filter) { + PolicyTrackedResourcesResourceType policyTrackedResourcesResource, Integer top, String filter) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } + if (policyTrackedResourcesResource == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter policyTrackedResourcesResource 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.")); } - final String policyTrackedResourcesResource = "default"; final String apiVersion = "2018-07-01-preview"; final String accept = "application/json"; return FluxUtil @@ -421,30 +483,40 @@ private Mono> listQueryResultsForSubsc /** * Queries policy tracked resources under the subscription. * + * @param policyTrackedResourcesResource The name of the virtual resource under PolicyTrackedResources resource + * type; only "default" is allowed. * @param top Maximum number of records to return. * @param filter OData filter expression. * @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 query results. + * @return query results along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listQueryResultsForSubscriptionSinglePageAsync( - Integer top, String filter, Context context) { + PolicyTrackedResourcesResourceType policyTrackedResourcesResource, + Integer top, + String filter, + Context context) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } + if (policyTrackedResourcesResource == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter policyTrackedResourcesResource 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.")); } - final String policyTrackedResourcesResource = "default"; final String apiVersion = "2018-07-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); @@ -472,100 +544,127 @@ private Mono> listQueryResultsForSubsc /** * Queries policy tracked resources under the subscription. * + * @param policyTrackedResourcesResource The name of the virtual resource under PolicyTrackedResources resource + * type; only "default" is allowed. * @param top Maximum number of records to return. * @param filter OData filter expression. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listQueryResultsForSubscriptionAsync(Integer top, String filter) { + private PagedFlux listQueryResultsForSubscriptionAsync( + PolicyTrackedResourcesResourceType policyTrackedResourcesResource, Integer top, String filter) { return new PagedFlux<>( - () -> listQueryResultsForSubscriptionSinglePageAsync(top, filter), + () -> listQueryResultsForSubscriptionSinglePageAsync(policyTrackedResourcesResource, top, filter), nextLink -> listQueryResultsForSubscriptionNextSinglePageAsync(nextLink)); } /** * Queries policy tracked resources under the subscription. * + * @param policyTrackedResourcesResource The name of the virtual resource under PolicyTrackedResources resource + * type; only "default" is allowed. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listQueryResultsForSubscriptionAsync() { + private PagedFlux listQueryResultsForSubscriptionAsync( + PolicyTrackedResourcesResourceType policyTrackedResourcesResource) { final Integer top = null; final String filter = null; return new PagedFlux<>( - () -> listQueryResultsForSubscriptionSinglePageAsync(top, filter), + () -> listQueryResultsForSubscriptionSinglePageAsync(policyTrackedResourcesResource, top, filter), nextLink -> listQueryResultsForSubscriptionNextSinglePageAsync(nextLink)); } /** * Queries policy tracked resources under the subscription. * + * @param policyTrackedResourcesResource The name of the virtual resource under PolicyTrackedResources resource + * type; only "default" is allowed. * @param top Maximum number of records to return. * @param filter OData filter expression. * @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 query results. + * @return query results as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listQueryResultsForSubscriptionAsync( - Integer top, String filter, Context context) { + PolicyTrackedResourcesResourceType policyTrackedResourcesResource, + Integer top, + String filter, + Context context) { return new PagedFlux<>( - () -> listQueryResultsForSubscriptionSinglePageAsync(top, filter, context), + () -> listQueryResultsForSubscriptionSinglePageAsync(policyTrackedResourcesResource, top, filter, context), nextLink -> listQueryResultsForSubscriptionNextSinglePageAsync(nextLink, context)); } /** * Queries policy tracked resources under the subscription. * + * @param policyTrackedResourcesResource The name of the virtual resource under PolicyTrackedResources resource + * type; only "default" is allowed. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listQueryResultsForSubscription() { + public PagedIterable listQueryResultsForSubscription( + PolicyTrackedResourcesResourceType policyTrackedResourcesResource) { final Integer top = null; final String filter = null; - return new PagedIterable<>(listQueryResultsForSubscriptionAsync(top, filter)); + return new PagedIterable<>(listQueryResultsForSubscriptionAsync(policyTrackedResourcesResource, top, filter)); } /** * Queries policy tracked resources under the subscription. * + * @param policyTrackedResourcesResource The name of the virtual resource under PolicyTrackedResources resource + * type; only "default" is allowed. * @param top Maximum number of records to return. * @param filter OData filter expression. * @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 query results. + * @return query results as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listQueryResultsForSubscription( - Integer top, String filter, Context context) { - return new PagedIterable<>(listQueryResultsForSubscriptionAsync(top, filter, context)); + PolicyTrackedResourcesResourceType policyTrackedResourcesResource, + Integer top, + String filter, + Context context) { + return new PagedIterable<>( + listQueryResultsForSubscriptionAsync(policyTrackedResourcesResource, top, filter, context)); } /** * Queries policy tracked resources under the resource group. * * @param resourceGroupName Resource group name. + * @param policyTrackedResourcesResource The name of the virtual resource under PolicyTrackedResources resource + * type; only "default" is allowed. * @param top Maximum number of records to return. * @param filter OData filter expression. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listQueryResultsForResourceGroupSinglePageAsync( - String resourceGroupName, Integer top, String filter) { + String resourceGroupName, + PolicyTrackedResourcesResourceType policyTrackedResourcesResource, + Integer top, + String filter) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -576,13 +675,18 @@ private Mono> listQueryResultsForResou return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } + if (policyTrackedResourcesResource == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter policyTrackedResourcesResource 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.")); } - final String policyTrackedResourcesResource = "default"; final String apiVersion = "2018-07-01-preview"; final String accept = "application/json"; return FluxUtil @@ -615,17 +719,23 @@ private Mono> listQueryResultsForResou * Queries policy tracked resources under the resource group. * * @param resourceGroupName Resource group name. + * @param policyTrackedResourcesResource The name of the virtual resource under PolicyTrackedResources resource + * type; only "default" is allowed. * @param top Maximum number of records to return. * @param filter OData filter expression. * @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 query results. + * @return query results along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listQueryResultsForResourceGroupSinglePageAsync( - String resourceGroupName, Integer top, String filter, Context context) { + String resourceGroupName, + PolicyTrackedResourcesResourceType policyTrackedResourcesResource, + Integer top, + String filter, + Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -636,13 +746,18 @@ private Mono> listQueryResultsForResou return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } + if (policyTrackedResourcesResource == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter policyTrackedResourcesResource 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.")); } - final String policyTrackedResourcesResource = "default"; final String apiVersion = "2018-07-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); @@ -672,18 +787,25 @@ private Mono> listQueryResultsForResou * Queries policy tracked resources under the resource group. * * @param resourceGroupName Resource group name. + * @param policyTrackedResourcesResource The name of the virtual resource under PolicyTrackedResources resource + * type; only "default" is allowed. * @param top Maximum number of records to return. * @param filter OData filter expression. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listQueryResultsForResourceGroupAsync( - String resourceGroupName, Integer top, String filter) { + String resourceGroupName, + PolicyTrackedResourcesResourceType policyTrackedResourcesResource, + Integer top, + String filter) { return new PagedFlux<>( - () -> listQueryResultsForResourceGroupSinglePageAsync(resourceGroupName, top, filter), + () -> + listQueryResultsForResourceGroupSinglePageAsync( + resourceGroupName, policyTrackedResourcesResource, top, filter), nextLink -> listQueryResultsForResourceGroupNextSinglePageAsync(nextLink)); } @@ -691,17 +813,22 @@ private PagedFlux listQueryResultsForResourceGroupAs * Queries policy tracked resources under the resource group. * * @param resourceGroupName Resource group name. + * @param policyTrackedResourcesResource The name of the virtual resource under PolicyTrackedResources resource + * type; only "default" is allowed. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listQueryResultsForResourceGroupAsync(String resourceGroupName) { + private PagedFlux listQueryResultsForResourceGroupAsync( + String resourceGroupName, PolicyTrackedResourcesResourceType policyTrackedResourcesResource) { final Integer top = null; final String filter = null; return new PagedFlux<>( - () -> listQueryResultsForResourceGroupSinglePageAsync(resourceGroupName, top, filter), + () -> + listQueryResultsForResourceGroupSinglePageAsync( + resourceGroupName, policyTrackedResourcesResource, top, filter), nextLink -> listQueryResultsForResourceGroupNextSinglePageAsync(nextLink)); } @@ -709,19 +836,27 @@ private PagedFlux listQueryResultsForResourceGroupAs * Queries policy tracked resources under the resource group. * * @param resourceGroupName Resource group name. + * @param policyTrackedResourcesResource The name of the virtual resource under PolicyTrackedResources resource + * type; only "default" is allowed. * @param top Maximum number of records to return. * @param filter OData filter expression. * @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 query results. + * @return query results as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listQueryResultsForResourceGroupAsync( - String resourceGroupName, Integer top, String filter, Context context) { + String resourceGroupName, + PolicyTrackedResourcesResourceType policyTrackedResourcesResource, + Integer top, + String filter, + Context context) { return new PagedFlux<>( - () -> listQueryResultsForResourceGroupSinglePageAsync(resourceGroupName, top, filter, context), + () -> + listQueryResultsForResourceGroupSinglePageAsync( + resourceGroupName, policyTrackedResourcesResource, top, filter, context), nextLink -> listQueryResultsForResourceGroupNextSinglePageAsync(nextLink, context)); } @@ -729,50 +864,67 @@ private PagedFlux listQueryResultsForResourceGroupAs * Queries policy tracked resources under the resource group. * * @param resourceGroupName Resource group name. + * @param policyTrackedResourcesResource The name of the virtual resource under PolicyTrackedResources resource + * type; only "default" is allowed. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listQueryResultsForResourceGroup(String resourceGroupName) { + public PagedIterable listQueryResultsForResourceGroup( + String resourceGroupName, PolicyTrackedResourcesResourceType policyTrackedResourcesResource) { final Integer top = null; final String filter = null; - return new PagedIterable<>(listQueryResultsForResourceGroupAsync(resourceGroupName, top, filter)); + return new PagedIterable<>( + listQueryResultsForResourceGroupAsync(resourceGroupName, policyTrackedResourcesResource, top, filter)); } /** * Queries policy tracked resources under the resource group. * * @param resourceGroupName Resource group name. + * @param policyTrackedResourcesResource The name of the virtual resource under PolicyTrackedResources resource + * type; only "default" is allowed. * @param top Maximum number of records to return. * @param filter OData filter expression. * @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 query results. + * @return query results as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listQueryResultsForResourceGroup( - String resourceGroupName, Integer top, String filter, Context context) { - return new PagedIterable<>(listQueryResultsForResourceGroupAsync(resourceGroupName, top, filter, context)); + String resourceGroupName, + PolicyTrackedResourcesResourceType policyTrackedResourcesResource, + Integer top, + String filter, + Context context) { + return new PagedIterable<>( + listQueryResultsForResourceGroupAsync( + resourceGroupName, policyTrackedResourcesResource, top, filter, context)); } /** * Queries policy tracked resources under the resource. * * @param resourceId Resource ID. + * @param policyTrackedResourcesResource The name of the virtual resource under PolicyTrackedResources resource + * type; only "default" is allowed. * @param top Maximum number of records to return. * @param filter OData filter expression. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listQueryResultsForResourceSinglePageAsync( - String resourceId, Integer top, String filter) { + String resourceId, + PolicyTrackedResourcesResourceType policyTrackedResourcesResource, + Integer top, + String filter) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -782,7 +934,12 @@ private Mono> listQueryResultsForResou if (resourceId == null) { return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); } - final String policyTrackedResourcesResource = "default"; + if (policyTrackedResourcesResource == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter policyTrackedResourcesResource is required and cannot be null.")); + } final String apiVersion = "2018-07-01-preview"; final String accept = "application/json"; return FluxUtil @@ -814,17 +971,23 @@ private Mono> listQueryResultsForResou * Queries policy tracked resources under the resource. * * @param resourceId Resource ID. + * @param policyTrackedResourcesResource The name of the virtual resource under PolicyTrackedResources resource + * type; only "default" is allowed. * @param top Maximum number of records to return. * @param filter OData filter expression. * @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 query results. + * @return query results along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listQueryResultsForResourceSinglePageAsync( - String resourceId, Integer top, String filter, Context context) { + String resourceId, + PolicyTrackedResourcesResourceType policyTrackedResourcesResource, + Integer top, + String filter, + Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -834,7 +997,12 @@ private Mono> listQueryResultsForResou if (resourceId == null) { return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); } - final String policyTrackedResourcesResource = "default"; + if (policyTrackedResourcesResource == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter policyTrackedResourcesResource is required and cannot be null.")); + } final String apiVersion = "2018-07-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); @@ -863,18 +1031,23 @@ private Mono> listQueryResultsForResou * Queries policy tracked resources under the resource. * * @param resourceId Resource ID. + * @param policyTrackedResourcesResource The name of the virtual resource under PolicyTrackedResources resource + * type; only "default" is allowed. * @param top Maximum number of records to return. * @param filter OData filter expression. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listQueryResultsForResourceAsync( - String resourceId, Integer top, String filter) { + String resourceId, + PolicyTrackedResourcesResourceType policyTrackedResourcesResource, + Integer top, + String filter) { return new PagedFlux<>( - () -> listQueryResultsForResourceSinglePageAsync(resourceId, top, filter), + () -> listQueryResultsForResourceSinglePageAsync(resourceId, policyTrackedResourcesResource, top, filter), nextLink -> listQueryResultsForResourceNextSinglePageAsync(nextLink)); } @@ -882,17 +1055,20 @@ private PagedFlux listQueryResultsForResourceAsync( * Queries policy tracked resources under the resource. * * @param resourceId Resource ID. + * @param policyTrackedResourcesResource The name of the virtual resource under PolicyTrackedResources resource + * type; only "default" is allowed. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listQueryResultsForResourceAsync(String resourceId) { + private PagedFlux listQueryResultsForResourceAsync( + String resourceId, PolicyTrackedResourcesResourceType policyTrackedResourcesResource) { final Integer top = null; final String filter = null; return new PagedFlux<>( - () -> listQueryResultsForResourceSinglePageAsync(resourceId, top, filter), + () -> listQueryResultsForResourceSinglePageAsync(resourceId, policyTrackedResourcesResource, top, filter), nextLink -> listQueryResultsForResourceNextSinglePageAsync(nextLink)); } @@ -900,19 +1076,27 @@ private PagedFlux listQueryResultsForResourceAsync(S * Queries policy tracked resources under the resource. * * @param resourceId Resource ID. + * @param policyTrackedResourcesResource The name of the virtual resource under PolicyTrackedResources resource + * type; only "default" is allowed. * @param top Maximum number of records to return. * @param filter OData filter expression. * @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 query results. + * @return query results as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listQueryResultsForResourceAsync( - String resourceId, Integer top, String filter, Context context) { + String resourceId, + PolicyTrackedResourcesResourceType policyTrackedResourcesResource, + Integer top, + String filter, + Context context) { return new PagedFlux<>( - () -> listQueryResultsForResourceSinglePageAsync(resourceId, top, filter, context), + () -> + listQueryResultsForResourceSinglePageAsync( + resourceId, policyTrackedResourcesResource, top, filter, context), nextLink -> listQueryResultsForResourceNextSinglePageAsync(nextLink, context)); } @@ -920,44 +1104,56 @@ private PagedFlux listQueryResultsForResourceAsync( * Queries policy tracked resources under the resource. * * @param resourceId Resource ID. + * @param policyTrackedResourcesResource The name of the virtual resource under PolicyTrackedResources resource + * type; only "default" is allowed. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listQueryResultsForResource(String resourceId) { + public PagedIterable listQueryResultsForResource( + String resourceId, PolicyTrackedResourcesResourceType policyTrackedResourcesResource) { final Integer top = null; final String filter = null; - return new PagedIterable<>(listQueryResultsForResourceAsync(resourceId, top, filter)); + return new PagedIterable<>( + listQueryResultsForResourceAsync(resourceId, policyTrackedResourcesResource, top, filter)); } /** * Queries policy tracked resources under the resource. * * @param resourceId Resource ID. + * @param policyTrackedResourcesResource The name of the virtual resource under PolicyTrackedResources resource + * type; only "default" is allowed. * @param top Maximum number of records to return. * @param filter OData filter expression. * @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 query results. + * @return query results as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listQueryResultsForResource( - String resourceId, Integer top, String filter, Context context) { - return new PagedIterable<>(listQueryResultsForResourceAsync(resourceId, top, filter, context)); + String resourceId, + PolicyTrackedResourcesResourceType policyTrackedResourcesResource, + Integer top, + String filter, + Context context) { + return new PagedIterable<>( + listQueryResultsForResourceAsync(resourceId, policyTrackedResourcesResource, top, filter, context)); } /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @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 query results. + * @return query results along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listQueryResultsForManagementGroupNextSinglePageAsync( @@ -992,12 +1188,13 @@ private Mono> listQueryResultsForManag /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @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 query results. + * @return query results along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listQueryResultsForManagementGroupNextSinglePageAsync( @@ -1029,11 +1226,12 @@ private Mono> listQueryResultsForManag /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @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 query results. + * @return query results along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listQueryResultsForSubscriptionNextSinglePageAsync( @@ -1067,12 +1265,13 @@ private Mono> listQueryResultsForSubsc /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @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 query results. + * @return query results along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listQueryResultsForSubscriptionNextSinglePageAsync( @@ -1104,11 +1303,12 @@ private Mono> listQueryResultsForSubsc /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @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 query results. + * @return query results along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listQueryResultsForResourceGroupNextSinglePageAsync( @@ -1142,12 +1342,13 @@ private Mono> listQueryResultsForResou /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @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 query results. + * @return query results along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listQueryResultsForResourceGroupNextSinglePageAsync( @@ -1179,11 +1380,12 @@ private Mono> listQueryResultsForResou /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @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 query results. + * @return query results along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listQueryResultsForResourceNextSinglePageAsync( @@ -1217,12 +1419,13 @@ private Mono> listQueryResultsForResou /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @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 query results. + * @return query results along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listQueryResultsForResourceNextSinglePageAsync( diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/implementation/PolicyTrackedResourcesImpl.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/implementation/PolicyTrackedResourcesImpl.java index 90c7c3d56356..74ac50cba35c 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/implementation/PolicyTrackedResourcesImpl.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/implementation/PolicyTrackedResourcesImpl.java @@ -11,10 +11,10 @@ import com.azure.resourcemanager.policyinsights.fluent.models.PolicyTrackedResourceInner; import com.azure.resourcemanager.policyinsights.models.PolicyTrackedResource; import com.azure.resourcemanager.policyinsights.models.PolicyTrackedResources; -import com.fasterxml.jackson.annotation.JsonIgnore; +import com.azure.resourcemanager.policyinsights.models.PolicyTrackedResourcesResourceType; public final class PolicyTrackedResourcesImpl implements PolicyTrackedResources { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PolicyTrackedResourcesImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(PolicyTrackedResourcesImpl.class); private final PolicyTrackedResourcesClient innerClient; @@ -27,53 +27,84 @@ public PolicyTrackedResourcesImpl( this.serviceManager = serviceManager; } - public PagedIterable listQueryResultsForManagementGroup(String managementGroupName) { + public PagedIterable listQueryResultsForManagementGroup( + String managementGroupName, PolicyTrackedResourcesResourceType policyTrackedResourcesResource) { PagedIterable inner = - this.serviceClient().listQueryResultsForManagementGroup(managementGroupName); + this + .serviceClient() + .listQueryResultsForManagementGroup(managementGroupName, policyTrackedResourcesResource); return Utils.mapPage(inner, inner1 -> new PolicyTrackedResourceImpl(inner1, this.manager())); } public PagedIterable listQueryResultsForManagementGroup( - String managementGroupName, Integer top, String filter, Context context) { + String managementGroupName, + PolicyTrackedResourcesResourceType policyTrackedResourcesResource, + Integer top, + String filter, + Context context) { PagedIterable inner = - this.serviceClient().listQueryResultsForManagementGroup(managementGroupName, top, filter, context); + this + .serviceClient() + .listQueryResultsForManagementGroup( + managementGroupName, policyTrackedResourcesResource, top, filter, context); return Utils.mapPage(inner, inner1 -> new PolicyTrackedResourceImpl(inner1, this.manager())); } - public PagedIterable listQueryResultsForSubscription() { - PagedIterable inner = this.serviceClient().listQueryResultsForSubscription(); + public PagedIterable listQueryResultsForSubscription( + PolicyTrackedResourcesResourceType policyTrackedResourcesResource) { + PagedIterable inner = + this.serviceClient().listQueryResultsForSubscription(policyTrackedResourcesResource); return Utils.mapPage(inner, inner1 -> new PolicyTrackedResourceImpl(inner1, this.manager())); } public PagedIterable listQueryResultsForSubscription( - Integer top, String filter, Context context) { + PolicyTrackedResourcesResourceType policyTrackedResourcesResource, + Integer top, + String filter, + Context context) { PagedIterable inner = - this.serviceClient().listQueryResultsForSubscription(top, filter, context); + this.serviceClient().listQueryResultsForSubscription(policyTrackedResourcesResource, top, filter, context); return Utils.mapPage(inner, inner1 -> new PolicyTrackedResourceImpl(inner1, this.manager())); } - public PagedIterable listQueryResultsForResourceGroup(String resourceGroupName) { + public PagedIterable listQueryResultsForResourceGroup( + String resourceGroupName, PolicyTrackedResourcesResourceType policyTrackedResourcesResource) { PagedIterable inner = - this.serviceClient().listQueryResultsForResourceGroup(resourceGroupName); + this.serviceClient().listQueryResultsForResourceGroup(resourceGroupName, policyTrackedResourcesResource); return Utils.mapPage(inner, inner1 -> new PolicyTrackedResourceImpl(inner1, this.manager())); } public PagedIterable listQueryResultsForResourceGroup( - String resourceGroupName, Integer top, String filter, Context context) { + String resourceGroupName, + PolicyTrackedResourcesResourceType policyTrackedResourcesResource, + Integer top, + String filter, + Context context) { PagedIterable inner = - this.serviceClient().listQueryResultsForResourceGroup(resourceGroupName, top, filter, context); + this + .serviceClient() + .listQueryResultsForResourceGroup( + resourceGroupName, policyTrackedResourcesResource, top, filter, context); return Utils.mapPage(inner, inner1 -> new PolicyTrackedResourceImpl(inner1, this.manager())); } - public PagedIterable listQueryResultsForResource(String resourceId) { - PagedIterable inner = this.serviceClient().listQueryResultsForResource(resourceId); + public PagedIterable listQueryResultsForResource( + String resourceId, PolicyTrackedResourcesResourceType policyTrackedResourcesResource) { + PagedIterable inner = + this.serviceClient().listQueryResultsForResource(resourceId, policyTrackedResourcesResource); return Utils.mapPage(inner, inner1 -> new PolicyTrackedResourceImpl(inner1, this.manager())); } public PagedIterable listQueryResultsForResource( - String resourceId, Integer top, String filter, Context context) { + String resourceId, + PolicyTrackedResourcesResourceType policyTrackedResourcesResource, + Integer top, + String filter, + Context context) { PagedIterable inner = - this.serviceClient().listQueryResultsForResource(resourceId, top, filter, context); + this + .serviceClient() + .listQueryResultsForResource(resourceId, policyTrackedResourcesResource, top, filter, context); return Utils.mapPage(inner, inner1 -> new PolicyTrackedResourceImpl(inner1, this.manager())); } diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/implementation/RemediationImpl.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/implementation/RemediationImpl.java index 2ea8054111e7..86458d798edd 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/implementation/RemediationImpl.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/implementation/RemediationImpl.java @@ -90,6 +90,10 @@ public RemediationPropertiesFailureThreshold failureThreshold() { return this.innerModel().failureThreshold(); } + public String resourceGroupName() { + return resourceGroupName; + } + public RemediationInner innerModel() { return this.innerObject; } diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/implementation/RemediationsClientImpl.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/implementation/RemediationsClientImpl.java index ead084752cb6..7a186f96de44 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/implementation/RemediationsClientImpl.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/implementation/RemediationsClientImpl.java @@ -29,7 +29,6 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.policyinsights.fluent.RemediationsClient; import com.azure.resourcemanager.policyinsights.fluent.models.RemediationDeploymentInner; import com.azure.resourcemanager.policyinsights.fluent.models.RemediationInner; @@ -39,8 +38,6 @@ /** An instance of this class provides access to all the operations defined in RemediationsClient. */ public final class RemediationsClientImpl implements RemediationsClient { - private final ClientLogger logger = new ClientLogger(RemediationsClientImpl.class); - /** The proxy service used to perform REST calls. */ private final RemediationsService service; @@ -494,7 +491,8 @@ Mono> listForResourceNext( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all deployments for a remediation at management group scope. + * @return all deployments for a remediation at management group scope along with {@link PagedResponse} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listDeploymentsAtManagementGroupSinglePageAsync( @@ -551,7 +549,8 @@ private Mono> listDeploymentsAtManagem * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all deployments for a remediation at management group scope. + * @return all deployments for a remediation at management group scope along with {@link PagedResponse} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listDeploymentsAtManagementGroupSinglePageAsync( @@ -604,7 +603,7 @@ private Mono> listDeploymentsAtManagem * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all deployments for a remediation at management group scope. + * @return all deployments for a remediation at management group scope as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listDeploymentsAtManagementGroupAsync( @@ -622,7 +621,7 @@ private PagedFlux listDeploymentsAtManagementGroupAs * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all deployments for a remediation at management group scope. + * @return all deployments for a remediation at management group scope as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listDeploymentsAtManagementGroupAsync( @@ -643,7 +642,7 @@ private PagedFlux listDeploymentsAtManagementGroupAs * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all deployments for a remediation at management group scope. + * @return all deployments for a remediation at management group scope as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listDeploymentsAtManagementGroupAsync( @@ -661,7 +660,8 @@ private PagedFlux listDeploymentsAtManagementGroupAs * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all deployments for a remediation at management group scope. + * @return all deployments for a remediation at management group scope as paginated response with {@link + * PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listDeploymentsAtManagementGroup( @@ -680,7 +680,8 @@ public PagedIterable listDeploymentsAtManagementGrou * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all deployments for a remediation at management group scope. + * @return all deployments for a remediation at management group scope as paginated response with {@link + * PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listDeploymentsAtManagementGroup( @@ -697,7 +698,7 @@ public PagedIterable listDeploymentsAtManagementGrou * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 remediation definition. + * @return the remediation definition along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> cancelAtManagementGroupWithResponseAsync( @@ -743,7 +744,7 @@ private Mono> cancelAtManagementGroupWithResponseAsyn * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 remediation definition. + * @return the remediation definition along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> cancelAtManagementGroupWithResponseAsync( @@ -785,19 +786,12 @@ private Mono> cancelAtManagementGroupWithResponseAsyn * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 remediation definition. + * @return the remediation definition on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono cancelAtManagementGroupAsync(String managementGroupId, String remediationName) { return cancelAtManagementGroupWithResponseAsync(managementGroupId, remediationName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -824,7 +818,7 @@ public RemediationInner cancelAtManagementGroup(String managementGroupId, 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 the remediation definition. + * @return the remediation definition along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response cancelAtManagementGroupWithResponse( @@ -841,7 +835,8 @@ public Response cancelAtManagementGroupWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all remediations for the management group. + * @return all remediations for the management group along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listForManagementGroupSinglePageAsync( @@ -894,7 +889,8 @@ private Mono> listForManagementGroupSinglePageAs * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all remediations for the management group. + * @return all remediations for the management group along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listForManagementGroupSinglePageAsync( @@ -943,7 +939,7 @@ private Mono> listForManagementGroupSinglePageAs * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all remediations for the management group. + * @return all remediations for the management group as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listForManagementGroupAsync( @@ -960,7 +956,7 @@ private PagedFlux listForManagementGroupAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all remediations for the management group. + * @return all remediations for the management group as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listForManagementGroupAsync(String managementGroupId) { @@ -981,7 +977,7 @@ private PagedFlux listForManagementGroupAsync(String managemen * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all remediations for the management group. + * @return all remediations for the management group as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listForManagementGroupAsync( @@ -998,7 +994,7 @@ private PagedFlux listForManagementGroupAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all remediations for the management group. + * @return all remediations for the management group as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listForManagementGroup(String managementGroupId) { @@ -1017,7 +1013,7 @@ public PagedIterable listForManagementGroup(String managementG * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all remediations for the management group. + * @return all remediations for the management group as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listForManagementGroup( @@ -1034,7 +1030,7 @@ public PagedIterable listForManagementGroup( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 remediation definition. + * @return the remediation definition along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrUpdateAtManagementGroupWithResponseAsync( @@ -1087,7 +1083,7 @@ private Mono> createOrUpdateAtManagementGroupWithResp * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 remediation definition. + * @return the remediation definition along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrUpdateAtManagementGroupWithResponseAsync( @@ -1136,20 +1132,13 @@ private Mono> createOrUpdateAtManagementGroupWithResp * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 remediation definition. + * @return the remediation definition on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAtManagementGroupAsync( String managementGroupId, String remediationName, RemediationInner parameters) { return createOrUpdateAtManagementGroupWithResponseAsync(managementGroupId, remediationName, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -1179,7 +1168,7 @@ public RemediationInner createOrUpdateAtManagementGroup( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 remediation definition. + * @return the remediation definition along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response createOrUpdateAtManagementGroupWithResponse( @@ -1196,7 +1185,8 @@ public Response createOrUpdateAtManagementGroupWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an existing remediation at management group scope. + * @return an existing remediation at management group scope along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getAtManagementGroupWithResponseAsync( @@ -1242,7 +1232,8 @@ private Mono> getAtManagementGroupWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an existing remediation at management group scope. + * @return an existing remediation at management group scope along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getAtManagementGroupWithResponseAsync( @@ -1284,19 +1275,12 @@ private Mono> getAtManagementGroupWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an existing remediation at management group scope. + * @return an existing remediation at management group scope on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAtManagementGroupAsync(String managementGroupId, String remediationName) { return getAtManagementGroupWithResponseAsync(managementGroupId, remediationName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -1323,7 +1307,7 @@ public RemediationInner getAtManagementGroup(String managementGroupId, String re * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an existing remediation at management group scope. + * @return an existing remediation at management group scope along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getAtManagementGroupWithResponse( @@ -1339,7 +1323,7 @@ public Response getAtManagementGroupWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 remediation definition. + * @return the remediation definition along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteAtManagementGroupWithResponseAsync( @@ -1385,7 +1369,7 @@ private Mono> deleteAtManagementGroupWithResponseAsyn * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 remediation definition. + * @return the remediation definition along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteAtManagementGroupWithResponseAsync( @@ -1427,19 +1411,12 @@ private Mono> deleteAtManagementGroupWithResponseAsyn * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 remediation definition. + * @return the remediation definition on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAtManagementGroupAsync(String managementGroupId, String remediationName) { return deleteAtManagementGroupWithResponseAsync(managementGroupId, remediationName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -1466,7 +1443,7 @@ public RemediationInner deleteAtManagementGroup(String managementGroupId, 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 the remediation definition. + * @return the remediation definition along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteAtManagementGroupWithResponse( @@ -1482,7 +1459,8 @@ public Response deleteAtManagementGroupWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all deployments for a remediation at subscription scope. + * @return all deployments for a remediation at subscription scope along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listDeploymentsAtSubscriptionSinglePageAsync( @@ -1538,7 +1516,8 @@ private Mono> listDeploymentsAtSubscri * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all deployments for a remediation at subscription scope. + * @return all deployments for a remediation at subscription scope along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listDeploymentsAtSubscriptionSinglePageAsync( @@ -1590,7 +1569,7 @@ private Mono> listDeploymentsAtSubscri * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all deployments for a remediation at subscription scope. + * @return all deployments for a remediation at subscription scope as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listDeploymentsAtSubscriptionAsync( @@ -1607,7 +1586,7 @@ private PagedFlux listDeploymentsAtSubscriptionAsync * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all deployments for a remediation at subscription scope. + * @return all deployments for a remediation at subscription scope as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listDeploymentsAtSubscriptionAsync(String remediationName) { @@ -1626,7 +1605,7 @@ private PagedFlux listDeploymentsAtSubscriptionAsync * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all deployments for a remediation at subscription scope. + * @return all deployments for a remediation at subscription scope as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listDeploymentsAtSubscriptionAsync( @@ -1643,7 +1622,7 @@ private PagedFlux listDeploymentsAtSubscriptionAsync * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all deployments for a remediation at subscription scope. + * @return all deployments for a remediation at subscription scope as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listDeploymentsAtSubscription(String remediationName) { @@ -1660,7 +1639,7 @@ public PagedIterable listDeploymentsAtSubscription(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 all deployments for a remediation at subscription scope. + * @return all deployments for a remediation at subscription scope as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listDeploymentsAtSubscription( @@ -1675,7 +1654,7 @@ public PagedIterable listDeploymentsAtSubscription( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 remediation definition. + * @return the remediation definition along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> cancelAtSubscriptionWithResponseAsync(String remediationName) { @@ -1719,7 +1698,7 @@ private Mono> cancelAtSubscriptionWithResponseAsync(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 the remediation definition. + * @return the remediation definition along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> cancelAtSubscriptionWithResponseAsync( @@ -1760,19 +1739,11 @@ private Mono> cancelAtSubscriptionWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 remediation definition. + * @return the remediation definition on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono cancelAtSubscriptionAsync(String remediationName) { - return cancelAtSubscriptionWithResponseAsync(remediationName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + return cancelAtSubscriptionWithResponseAsync(remediationName).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -1797,7 +1768,7 @@ public RemediationInner cancelAtSubscription(String remediationName) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 remediation definition. + * @return the remediation definition along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response cancelAtSubscriptionWithResponse(String remediationName, Context context) { @@ -1812,7 +1783,8 @@ public Response cancelAtSubscriptionWithResponse(String remedi * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all remediations for the subscription. + * @return all remediations for the subscription along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(Integer top, String filter) { @@ -1863,7 +1835,8 @@ private Mono> listSinglePageAsync(Integer top, 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 all remediations for the subscription. + * @return all remediations for the subscription along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(Integer top, String filter, Context context) { @@ -1903,7 +1876,7 @@ private Mono> listSinglePageAsync(Integer top, 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 all remediations for the subscription. + * @return all remediations for the subscription as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(Integer top, String filter) { @@ -1916,7 +1889,7 @@ private PagedFlux listAsync(Integer top, String filter) { * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all remediations for the subscription. + * @return all remediations for the subscription as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync() { @@ -1935,7 +1908,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 all remediations for the subscription. + * @return all remediations for the subscription as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(Integer top, String filter, Context context) { @@ -1949,7 +1922,7 @@ private PagedFlux listAsync(Integer top, String filter, Contex * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all remediations for the subscription. + * @return all remediations for the subscription as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { @@ -1967,7 +1940,7 @@ 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 all remediations for the subscription. + * @return all remediations for the subscription as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(Integer top, String filter, Context context) { @@ -1982,7 +1955,7 @@ public PagedIterable list(Integer top, String filter, 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 the remediation definition. + * @return the remediation definition along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrUpdateAtSubscriptionWithResponseAsync( @@ -2034,7 +2007,7 @@ private Mono> createOrUpdateAtSubscriptionWithRespons * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 remediation definition. + * @return the remediation definition along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrUpdateAtSubscriptionWithResponseAsync( @@ -2082,20 +2055,13 @@ private Mono> createOrUpdateAtSubscriptionWithRespons * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 remediation definition. + * @return the remediation definition on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAtSubscriptionAsync( String remediationName, RemediationInner parameters) { return createOrUpdateAtSubscriptionWithResponseAsync(remediationName, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -2122,7 +2088,7 @@ public RemediationInner createOrUpdateAtSubscription(String remediationName, Rem * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 remediation definition. + * @return the remediation definition along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response createOrUpdateAtSubscriptionWithResponse( @@ -2137,7 +2103,8 @@ public Response createOrUpdateAtSubscriptionWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an existing remediation at subscription scope. + * @return an existing remediation at subscription scope along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getAtSubscriptionWithResponseAsync(String remediationName) { @@ -2181,7 +2148,8 @@ private Mono> getAtSubscriptionWithResponseAsync(Stri * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an existing remediation at subscription scope. + * @return an existing remediation at subscription scope along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getAtSubscriptionWithResponseAsync( @@ -2222,19 +2190,11 @@ private Mono> getAtSubscriptionWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an existing remediation at subscription scope. + * @return an existing remediation at subscription scope on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAtSubscriptionAsync(String remediationName) { - return getAtSubscriptionWithResponseAsync(remediationName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + return getAtSubscriptionWithResponseAsync(remediationName).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -2259,7 +2219,7 @@ public RemediationInner getAtSubscription(String remediationName) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an existing remediation at subscription scope. + * @return an existing remediation at subscription scope along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getAtSubscriptionWithResponse(String remediationName, Context context) { @@ -2273,7 +2233,7 @@ public Response getAtSubscriptionWithResponse(String remediati * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 remediation definition. + * @return the remediation definition along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteAtSubscriptionWithResponseAsync(String remediationName) { @@ -2317,7 +2277,7 @@ private Mono> deleteAtSubscriptionWithResponseAsync(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 the remediation definition. + * @return the remediation definition along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteAtSubscriptionWithResponseAsync( @@ -2358,19 +2318,11 @@ private Mono> deleteAtSubscriptionWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 remediation definition. + * @return the remediation definition on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAtSubscriptionAsync(String remediationName) { - return deleteAtSubscriptionWithResponseAsync(remediationName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + return deleteAtSubscriptionWithResponseAsync(remediationName).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -2395,7 +2347,7 @@ public RemediationInner deleteAtSubscription(String remediationName) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 remediation definition. + * @return the remediation definition along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteAtSubscriptionWithResponse(String remediationName, Context context) { @@ -2411,7 +2363,8 @@ public Response deleteAtSubscriptionWithResponse(String remedi * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all deployments for a remediation at resource group scope. + * @return all deployments for a remediation at resource group scope along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listDeploymentsAtResourceGroupSinglePageAsync( @@ -2473,7 +2426,8 @@ private Mono> listDeploymentsAtResourc * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all deployments for a remediation at resource group scope. + * @return all deployments for a remediation at resource group scope along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listDeploymentsAtResourceGroupSinglePageAsync( @@ -2531,7 +2485,7 @@ private Mono> listDeploymentsAtResourc * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all deployments for a remediation at resource group scope. + * @return all deployments for a remediation at resource group scope as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listDeploymentsAtResourceGroupAsync( @@ -2549,7 +2503,7 @@ private PagedFlux listDeploymentsAtResourceGroupAsyn * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all deployments for a remediation at resource group scope. + * @return all deployments for a remediation at resource group scope as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listDeploymentsAtResourceGroupAsync( @@ -2570,7 +2524,7 @@ private PagedFlux listDeploymentsAtResourceGroupAsyn * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all deployments for a remediation at resource group scope. + * @return all deployments for a remediation at resource group scope as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listDeploymentsAtResourceGroupAsync( @@ -2588,7 +2542,8 @@ private PagedFlux listDeploymentsAtResourceGroupAsyn * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all deployments for a remediation at resource group scope. + * @return all deployments for a remediation at resource group scope as paginated response with {@link + * PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listDeploymentsAtResourceGroup( @@ -2607,7 +2562,8 @@ public PagedIterable listDeploymentsAtResourceGroup( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all deployments for a remediation at resource group scope. + * @return all deployments for a remediation at resource group scope as paginated response with {@link + * PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listDeploymentsAtResourceGroup( @@ -2624,7 +2580,7 @@ public PagedIterable listDeploymentsAtResourceGroup( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 remediation definition. + * @return the remediation definition along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> cancelAtResourceGroupWithResponseAsync( @@ -2675,7 +2631,7 @@ private Mono> cancelAtResourceGroupWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 remediation definition. + * @return the remediation definition along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> cancelAtResourceGroupWithResponseAsync( @@ -2722,19 +2678,12 @@ private Mono> cancelAtResourceGroupWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 remediation definition. + * @return the remediation definition on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono cancelAtResourceGroupAsync(String resourceGroupName, String remediationName) { return cancelAtResourceGroupWithResponseAsync(resourceGroupName, remediationName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -2761,7 +2710,7 @@ public RemediationInner cancelAtResourceGroup(String resourceGroupName, String r * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 remediation definition. + * @return the remediation definition along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response cancelAtResourceGroupWithResponse( @@ -2778,7 +2727,8 @@ public Response cancelAtResourceGroupWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all remediations for the subscription. + * @return all remediations for the subscription along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync( @@ -2836,7 +2786,8 @@ private Mono> listByResourceGroupSinglePageAsync * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all remediations for the subscription. + * @return all remediations for the subscription along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync( @@ -2890,7 +2841,7 @@ private Mono> listByResourceGroupSinglePageAsync * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all remediations for the subscription. + * @return all remediations for the subscription as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName, Integer top, String filter) { @@ -2906,7 +2857,7 @@ private PagedFlux listByResourceGroupAsync(String resourceGrou * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all remediations for the subscription. + * @return all remediations for the subscription as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName) { @@ -2927,7 +2878,7 @@ private PagedFlux listByResourceGroupAsync(String resourceGrou * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all remediations for the subscription. + * @return all remediations for the subscription as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync( @@ -2944,7 +2895,7 @@ private PagedFlux listByResourceGroupAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all remediations for the subscription. + * @return all remediations for the subscription as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String resourceGroupName) { @@ -2963,7 +2914,7 @@ public PagedIterable listByResourceGroup(String resourceGroupN * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all remediations for the subscription. + * @return all remediations for the subscription as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup( @@ -2980,7 +2931,7 @@ public PagedIterable listByResourceGroup( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 remediation definition. + * @return the remediation definition along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrUpdateAtResourceGroupWithResponseAsync( @@ -3038,7 +2989,7 @@ private Mono> createOrUpdateAtResourceGroupWithRespon * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 remediation definition. + * @return the remediation definition along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrUpdateAtResourceGroupWithResponseAsync( @@ -3092,20 +3043,13 @@ private Mono> createOrUpdateAtResourceGroupWithRespon * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 remediation definition. + * @return the remediation definition on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAtResourceGroupAsync( String resourceGroupName, String remediationName, RemediationInner parameters) { return createOrUpdateAtResourceGroupWithResponseAsync(resourceGroupName, remediationName, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -3135,7 +3079,7 @@ public RemediationInner createOrUpdateAtResourceGroup( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 remediation definition. + * @return the remediation definition along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response createOrUpdateAtResourceGroupWithResponse( @@ -3152,7 +3096,8 @@ public Response createOrUpdateAtResourceGroupWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an existing remediation at resource group scope. + * @return an existing remediation at resource group scope along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync( @@ -3203,7 +3148,8 @@ private Mono> getByResourceGroupWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an existing remediation at resource group scope. + * @return an existing remediation at resource group scope along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync( @@ -3250,19 +3196,12 @@ private Mono> getByResourceGroupWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an existing remediation at resource group scope. + * @return an existing remediation at resource group scope on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getByResourceGroupAsync(String resourceGroupName, String remediationName) { return getByResourceGroupWithResponseAsync(resourceGroupName, remediationName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -3289,7 +3228,7 @@ public RemediationInner getByResourceGroup(String resourceGroupName, String reme * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an existing remediation at resource group scope. + * @return an existing remediation at resource group scope along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getByResourceGroupWithResponse( @@ -3305,7 +3244,7 @@ public Response getByResourceGroupWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 remediation definition. + * @return the remediation definition along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteWithResponseAsync(String resourceGroupName, String remediationName) { @@ -3355,7 +3294,7 @@ private Mono> deleteWithResponseAsync(String resource * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 remediation definition. + * @return the remediation definition along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteWithResponseAsync( @@ -3402,19 +3341,12 @@ private Mono> deleteWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 remediation definition. + * @return the remediation definition on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String remediationName) { return deleteWithResponseAsync(resourceGroupName, remediationName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -3441,7 +3373,7 @@ public RemediationInner delete(String resourceGroupName, String remediationName) * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 remediation definition. + * @return the remediation definition along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteWithResponse( @@ -3458,7 +3390,8 @@ public Response deleteWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all deployments for a remediation at resource scope. + * @return all deployments for a remediation at resource scope along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listDeploymentsAtResourceSinglePageAsync( @@ -3506,7 +3439,8 @@ private Mono> listDeploymentsAtResourc * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all deployments for a remediation at resource scope. + * @return all deployments for a remediation at resource scope along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listDeploymentsAtResourceSinglePageAsync( @@ -3550,7 +3484,7 @@ private Mono> listDeploymentsAtResourc * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all deployments for a remediation at resource scope. + * @return all deployments for a remediation at resource scope as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listDeploymentsAtResourceAsync( @@ -3568,7 +3502,7 @@ private PagedFlux listDeploymentsAtResourceAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all deployments for a remediation at resource scope. + * @return all deployments for a remediation at resource scope as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listDeploymentsAtResourceAsync( @@ -3589,7 +3523,7 @@ private PagedFlux listDeploymentsAtResourceAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all deployments for a remediation at resource scope. + * @return all deployments for a remediation at resource scope as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listDeploymentsAtResourceAsync( @@ -3607,7 +3541,7 @@ private PagedFlux listDeploymentsAtResourceAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all deployments for a remediation at resource scope. + * @return all deployments for a remediation at resource scope as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listDeploymentsAtResource( @@ -3626,7 +3560,7 @@ public PagedIterable listDeploymentsAtResource( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all deployments for a remediation at resource scope. + * @return all deployments for a remediation at resource scope as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listDeploymentsAtResource( @@ -3642,7 +3576,7 @@ public PagedIterable listDeploymentsAtResource( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 remediation definition. + * @return the remediation definition along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> cancelAtResourceWithResponseAsync( @@ -3680,7 +3614,7 @@ private Mono> cancelAtResourceWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 remediation definition. + * @return the remediation definition along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> cancelAtResourceWithResponseAsync( @@ -3713,19 +3647,12 @@ private Mono> cancelAtResourceWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 remediation definition. + * @return the remediation definition on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono cancelAtResourceAsync(String resourceId, String remediationName) { return cancelAtResourceWithResponseAsync(resourceId, remediationName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -3752,7 +3679,7 @@ public RemediationInner cancelAtResource(String resourceId, String remediationNa * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 remediation definition. + * @return the remediation definition along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response cancelAtResourceWithResponse( @@ -3769,7 +3696,8 @@ public Response cancelAtResourceWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all remediations for a resource. + * @return all remediations for a resource along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listForResourceSinglePageAsync( @@ -3813,7 +3741,8 @@ private Mono> listForResourceSinglePageAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all remediations for a resource. + * @return all remediations for a resource along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listForResourceSinglePageAsync( @@ -3852,7 +3781,7 @@ private Mono> listForResourceSinglePageAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all remediations for a resource. + * @return all remediations for a resource as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listForResourceAsync(String resourceId, Integer top, String filter) { @@ -3868,7 +3797,7 @@ private PagedFlux listForResourceAsync(String resourceId, Inte * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all remediations for a resource. + * @return all remediations for a resource as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listForResourceAsync(String resourceId) { @@ -3889,7 +3818,7 @@ private PagedFlux listForResourceAsync(String resourceId) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all remediations for a resource. + * @return all remediations for a resource as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listForResourceAsync( @@ -3906,7 +3835,7 @@ private PagedFlux listForResourceAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all remediations for a resource. + * @return all remediations for a resource as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listForResource(String resourceId) { @@ -3925,7 +3854,7 @@ public PagedIterable listForResource(String resourceId) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all remediations for a resource. + * @return all remediations for a resource as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listForResource( @@ -3942,7 +3871,7 @@ public PagedIterable listForResource( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 remediation definition. + * @return the remediation definition along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrUpdateAtResourceWithResponseAsync( @@ -3992,7 +3921,7 @@ private Mono> createOrUpdateAtResourceWithResponseAsy * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 remediation definition. + * @return the remediation definition along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrUpdateAtResourceWithResponseAsync( @@ -4032,20 +3961,13 @@ private Mono> createOrUpdateAtResourceWithResponseAsy * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 remediation definition. + * @return the remediation definition on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAtResourceAsync( String resourceId, String remediationName, RemediationInner parameters) { return createOrUpdateAtResourceWithResponseAsync(resourceId, remediationName, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -4075,7 +3997,7 @@ public RemediationInner createOrUpdateAtResource( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 remediation definition. + * @return the remediation definition along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response createOrUpdateAtResourceWithResponse( @@ -4091,7 +4013,8 @@ public Response createOrUpdateAtResourceWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an existing remediation at resource scope. + * @return an existing remediation at resource scope along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getAtResourceWithResponseAsync(String resourceId, String remediationName) { @@ -4128,7 +4051,8 @@ private Mono> getAtResourceWithResponseAsync(String r * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an existing remediation at resource scope. + * @return an existing remediation at resource scope along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getAtResourceWithResponseAsync( @@ -4161,19 +4085,12 @@ private Mono> getAtResourceWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an existing remediation at resource scope. + * @return an existing remediation at resource scope on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAtResourceAsync(String resourceId, String remediationName) { return getAtResourceWithResponseAsync(resourceId, remediationName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -4200,7 +4117,7 @@ public RemediationInner getAtResource(String resourceId, String remediationName) * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an existing remediation at resource scope. + * @return an existing remediation at resource scope along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getAtResourceWithResponse( @@ -4216,7 +4133,7 @@ public Response getAtResourceWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 remediation definition. + * @return the remediation definition along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteAtResourceWithResponseAsync( @@ -4254,7 +4171,7 @@ private Mono> deleteAtResourceWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 remediation definition. + * @return the remediation definition along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteAtResourceWithResponseAsync( @@ -4287,19 +4204,12 @@ private Mono> deleteAtResourceWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 remediation definition. + * @return the remediation definition on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAtResourceAsync(String resourceId, String remediationName) { return deleteAtResourceWithResponseAsync(resourceId, remediationName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -4326,7 +4236,7 @@ public RemediationInner deleteAtResource(String resourceId, String remediationNa * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 remediation definition. + * @return the remediation definition along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteAtResourceWithResponse( @@ -4337,11 +4247,13 @@ public Response deleteAtResourceWithResponse( /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @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 list of deployments for a remediation. + * @return list of deployments for a remediation along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listDeploymentsAtManagementGroupNextSinglePageAsync( @@ -4375,12 +4287,14 @@ private Mono> listDeploymentsAtManagem /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @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 list of deployments for a remediation. + * @return list of deployments for a remediation along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listDeploymentsAtManagementGroupNextSinglePageAsync( @@ -4412,11 +4326,12 @@ private Mono> listDeploymentsAtManagem /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @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 list of remediations. + * @return list of remediations along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listForManagementGroupNextSinglePageAsync(String nextLink) { @@ -4448,12 +4363,13 @@ private Mono> listForManagementGroupNextSinglePa /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @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 list of remediations. + * @return list of remediations along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listForManagementGroupNextSinglePageAsync( @@ -4485,11 +4401,13 @@ private Mono> listForManagementGroupNextSinglePa /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @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 list of deployments for a remediation. + * @return list of deployments for a remediation along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listDeploymentsAtSubscriptionNextSinglePageAsync( @@ -4523,12 +4441,14 @@ private Mono> listDeploymentsAtSubscri /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @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 list of deployments for a remediation. + * @return list of deployments for a remediation along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listDeploymentsAtSubscriptionNextSinglePageAsync( @@ -4560,11 +4480,12 @@ private Mono> listDeploymentsAtSubscri /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @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 list of remediations. + * @return list of remediations along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listForSubscriptionNextSinglePageAsync(String nextLink) { @@ -4596,12 +4517,13 @@ private Mono> listForSubscriptionNextSinglePageA /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @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 list of remediations. + * @return list of remediations along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listForSubscriptionNextSinglePageAsync( @@ -4633,11 +4555,13 @@ private Mono> listForSubscriptionNextSinglePageA /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @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 list of deployments for a remediation. + * @return list of deployments for a remediation along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listDeploymentsAtResourceGroupNextSinglePageAsync( @@ -4671,12 +4595,14 @@ private Mono> listDeploymentsAtResourc /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @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 list of deployments for a remediation. + * @return list of deployments for a remediation along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listDeploymentsAtResourceGroupNextSinglePageAsync( @@ -4708,11 +4634,12 @@ private Mono> listDeploymentsAtResourc /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @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 list of remediations. + * @return list of remediations along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listForResourceGroupNextSinglePageAsync(String nextLink) { @@ -4744,12 +4671,13 @@ private Mono> listForResourceGroupNextSinglePage /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @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 list of remediations. + * @return list of remediations along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listForResourceGroupNextSinglePageAsync( @@ -4781,11 +4709,13 @@ private Mono> listForResourceGroupNextSinglePage /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @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 list of deployments for a remediation. + * @return list of deployments for a remediation along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listDeploymentsAtResourceNextSinglePageAsync( @@ -4818,12 +4748,14 @@ private Mono> listDeploymentsAtResourc /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @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 list of deployments for a remediation. + * @return list of deployments for a remediation along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listDeploymentsAtResourceNextSinglePageAsync( @@ -4855,11 +4787,12 @@ private Mono> listDeploymentsAtResourc /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @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 list of remediations. + * @return list of remediations along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listForResourceNextSinglePageAsync(String nextLink) { @@ -4890,12 +4823,13 @@ private Mono> listForResourceNextSinglePageAsync /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @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 list of remediations. + * @return list of remediations along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listForResourceNextSinglePageAsync(String nextLink, Context context) { diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/implementation/RemediationsImpl.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/implementation/RemediationsImpl.java index fd83c8acc2e3..c04733adb427 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/implementation/RemediationsImpl.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/implementation/RemediationsImpl.java @@ -15,10 +15,9 @@ import com.azure.resourcemanager.policyinsights.models.Remediation; import com.azure.resourcemanager.policyinsights.models.RemediationDeployment; import com.azure.resourcemanager.policyinsights.models.Remediations; -import com.fasterxml.jackson.annotation.JsonIgnore; public final class RemediationsImpl implements Remediations { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RemediationsImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(RemediationsImpl.class); private final RemediationsClient innerClient; @@ -490,7 +489,7 @@ public Response deleteAtResourceWithResponse( public Remediation getById(String id) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -498,7 +497,7 @@ public Remediation getById(String id) { } String remediationName = Utils.getValueFromIdByName(id, "remediations"); if (remediationName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'remediations'.", id))); @@ -509,7 +508,7 @@ public Remediation getById(String id) { public Response getByIdWithResponse(String id, Context context) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -517,7 +516,7 @@ public Response getByIdWithResponse(String id, Context context) { } String remediationName = Utils.getValueFromIdByName(id, "remediations"); if (remediationName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'remediations'.", id))); @@ -528,7 +527,7 @@ public Response getByIdWithResponse(String id, Context context) { public Remediation deleteById(String id) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -536,7 +535,7 @@ public Remediation deleteById(String id) { } String remediationName = Utils.getValueFromIdByName(id, "remediations"); if (remediationName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'remediations'.", id))); @@ -547,7 +546,7 @@ public Remediation deleteById(String id) { public Response deleteByIdWithResponse(String id, Context context) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -555,7 +554,7 @@ public Response deleteByIdWithResponse(String id, Context context) } String remediationName = Utils.getValueFromIdByName(id, "remediations"); if (remediationName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'remediations'.", id))); diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/Attestation.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/Attestation.java index 2cdd5e437dc5..e80a644ce15e 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/Attestation.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/Attestation.java @@ -109,6 +109,27 @@ public interface Attestation { */ OffsetDateTime lastComplianceStateChangeAt(); + /** + * Gets the assessmentDate property: The time the evidence was assessed. + * + * @return the assessmentDate value. + */ + OffsetDateTime assessmentDate(); + + /** + * Gets the metadata property: Additional metadata for this attestation. + * + * @return the metadata value. + */ + Object metadata(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + /** * Gets the inner com.azure.resourcemanager.policyinsights.fluent.models.AttestationInner object. * @@ -160,7 +181,9 @@ interface WithCreate DefinitionStages.WithExpiresOn, DefinitionStages.WithOwner, DefinitionStages.WithComments, - DefinitionStages.WithEvidence { + DefinitionStages.WithEvidence, + DefinitionStages.WithAssessmentDate, + DefinitionStages.WithMetadata { /** * Executes the create request. * @@ -244,6 +267,26 @@ interface WithEvidence { */ WithCreate withEvidence(List evidence); } + /** The stage of the Attestation definition allowing to specify assessmentDate. */ + interface WithAssessmentDate { + /** + * Specifies the assessmentDate property: The time the evidence was assessed. + * + * @param assessmentDate The time the evidence was assessed. + * @return the next definition stage. + */ + WithCreate withAssessmentDate(OffsetDateTime assessmentDate); + } + /** The stage of the Attestation definition allowing to specify metadata. */ + interface WithMetadata { + /** + * Specifies the metadata property: Additional metadata for this attestation. + * + * @param metadata Additional metadata for this attestation. + * @return the next definition stage. + */ + WithCreate withMetadata(Object metadata); + } } /** * Begins update for the Attestation resource. @@ -260,7 +303,9 @@ interface Update UpdateStages.WithExpiresOn, UpdateStages.WithOwner, UpdateStages.WithComments, - UpdateStages.WithEvidence { + UpdateStages.WithEvidence, + UpdateStages.WithAssessmentDate, + UpdateStages.WithMetadata { /** * Executes the update request. * @@ -358,6 +403,26 @@ interface WithEvidence { */ Update withEvidence(List evidence); } + /** The stage of the Attestation update allowing to specify assessmentDate. */ + interface WithAssessmentDate { + /** + * Specifies the assessmentDate property: The time the evidence was assessed. + * + * @param assessmentDate The time the evidence was assessed. + * @return the next definition stage. + */ + Update withAssessmentDate(OffsetDateTime assessmentDate); + } + /** The stage of the Attestation update allowing to specify metadata. */ + interface WithMetadata { + /** + * Specifies the metadata property: Additional metadata for this attestation. + * + * @param metadata Additional metadata for this attestation. + * @return the next definition stage. + */ + Update withMetadata(Object metadata); + } } /** * Refreshes the resource to sync with Azure. diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/AttestationEvidence.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/AttestationEvidence.java index 576cec7b4c2e..461d915b8591 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/AttestationEvidence.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/AttestationEvidence.java @@ -5,15 +5,11 @@ package com.azure.resourcemanager.policyinsights.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** A piece of evidence supporting the compliance state set in the attestation. */ @Fluent public final class AttestationEvidence { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AttestationEvidence.class); - /* * The description for this piece of evidence. */ diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/AttestationListResult.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/AttestationListResult.java index 62d02e6c2b5e..dea1fcc10d48 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/AttestationListResult.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/AttestationListResult.java @@ -5,17 +5,13 @@ package com.azure.resourcemanager.policyinsights.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.policyinsights.fluent.models.AttestationInner; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** List of attestations. */ @Immutable public final class AttestationListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AttestationListResult.class); - /* * Array of attestation definitions. */ diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/Attestations.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/Attestations.java index 669dfadfb845..75968a5af538 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/Attestations.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/Attestations.java @@ -16,7 +16,7 @@ public interface Attestations { * * @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 all attestations for the subscription. + * @return all attestations for the subscription as paginated response with {@link PagedIterable}. */ PagedIterable list(); @@ -29,7 +29,7 @@ public interface Attestations { * @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 all attestations for the subscription. + * @return all attestations for the subscription as paginated response with {@link PagedIterable}. */ PagedIterable list(Integer top, String filter, Context context); @@ -77,7 +77,7 @@ public interface Attestations { * @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 an existing attestation at subscription scope. + * @return an existing attestation at subscription scope along with {@link Response}. */ Response getAtSubscriptionWithResponse(String attestationName, Context context); @@ -99,7 +99,7 @@ public interface Attestations { * @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 response. + * @return the {@link Response}. */ Response deleteAtSubscriptionWithResponse(String attestationName, Context context); @@ -110,7 +110,7 @@ public interface Attestations { * @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 all attestations for the resource group. + * @return all attestations for the resource group as paginated response with {@link PagedIterable}. */ PagedIterable listByResourceGroup(String resourceGroupName); @@ -124,7 +124,7 @@ public interface Attestations { * @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 all attestations for the resource group. + * @return all attestations for the resource group as paginated response with {@link PagedIterable}. */ PagedIterable listByResourceGroup( String resourceGroupName, Integer top, String filter, Context context); @@ -150,7 +150,7 @@ PagedIterable listByResourceGroup( * @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 an existing attestation at resource group scope. + * @return an existing attestation at resource group scope along with {@link Response}. */ Response getByResourceGroupWithResponse( String resourceGroupName, String attestationName, Context context); @@ -175,7 +175,7 @@ Response getByResourceGroupWithResponse( * @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 response. + * @return the {@link Response}. */ Response deleteWithResponse(String resourceGroupName, String attestationName, Context context); @@ -186,7 +186,7 @@ Response getByResourceGroupWithResponse( * @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 all attestations for a resource. + * @return all attestations for a resource as paginated response with {@link PagedIterable}. */ PagedIterable listForResource(String resourceId); @@ -200,7 +200,7 @@ Response getByResourceGroupWithResponse( * @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 all attestations for a resource. + * @return all attestations for a resource as paginated response with {@link PagedIterable}. */ PagedIterable listForResource(String resourceId, Integer top, String filter, Context context); @@ -253,7 +253,7 @@ Attestation createOrUpdateAtResource( * @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 an existing attestation at resource scope. + * @return an existing attestation at resource scope along with {@link Response}. */ Response getAtResourceWithResponse(String resourceId, String attestationName, Context context); @@ -277,7 +277,7 @@ Attestation createOrUpdateAtResource( * @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 response. + * @return the {@link Response}. */ Response deleteAtResourceWithResponse(String resourceId, String attestationName, Context context); @@ -288,7 +288,7 @@ Attestation createOrUpdateAtResource( * @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 an existing attestation at resource group scope. + * @return an existing attestation at resource group scope along with {@link Response}. */ Attestation getById(String id); @@ -300,7 +300,7 @@ Attestation createOrUpdateAtResource( * @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 an existing attestation at resource group scope. + * @return an existing attestation at resource group scope along with {@link Response}. */ Response getByIdWithResponse(String id, Context context); @@ -322,7 +322,7 @@ Attestation createOrUpdateAtResource( * @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 response. + * @return the {@link Response}. */ Response deleteByIdWithResponse(String id, Context context); diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/CheckManagementGroupRestrictionsRequest.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/CheckManagementGroupRestrictionsRequest.java new file mode 100644 index 000000000000..4acca578d9d4 --- /dev/null +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/CheckManagementGroupRestrictionsRequest.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.policyinsights.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The check policy restrictions parameters describing the resource that is being evaluated. */ +@Fluent +public final class CheckManagementGroupRestrictionsRequest { + /* + * The information about the resource that will be evaluated. + */ + @JsonProperty(value = "resourceDetails") + private CheckRestrictionsResourceDetails resourceDetails; + + /* + * The list of fields and values that should be evaluated for potential restrictions. + */ + @JsonProperty(value = "pendingFields") + private List pendingFields; + + /** + * Get the resourceDetails property: The information about the resource that will be evaluated. + * + * @return the resourceDetails value. + */ + public CheckRestrictionsResourceDetails resourceDetails() { + return this.resourceDetails; + } + + /** + * Set the resourceDetails property: The information about the resource that will be evaluated. + * + * @param resourceDetails the resourceDetails value to set. + * @return the CheckManagementGroupRestrictionsRequest object itself. + */ + public CheckManagementGroupRestrictionsRequest withResourceDetails( + CheckRestrictionsResourceDetails resourceDetails) { + this.resourceDetails = resourceDetails; + return this; + } + + /** + * Get the pendingFields property: The list of fields and values that should be evaluated for potential + * restrictions. + * + * @return the pendingFields value. + */ + public List pendingFields() { + return this.pendingFields; + } + + /** + * Set the pendingFields property: The list of fields and values that should be evaluated for potential + * restrictions. + * + * @param pendingFields the pendingFields value to set. + * @return the CheckManagementGroupRestrictionsRequest object itself. + */ + public CheckManagementGroupRestrictionsRequest withPendingFields(List pendingFields) { + this.pendingFields = pendingFields; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (resourceDetails() != null) { + resourceDetails().validate(); + } + if (pendingFields() != null) { + pendingFields().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/CheckRestrictionsRequest.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/CheckRestrictionsRequest.java index 25e04a6db9de..69d08f553b7d 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/CheckRestrictionsRequest.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/CheckRestrictionsRequest.java @@ -6,15 +6,12 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** The check policy restrictions parameters describing the resource that is being evaluated. */ @Fluent public final class CheckRestrictionsRequest { - @JsonIgnore private final ClientLogger logger = new ClientLogger(CheckRestrictionsRequest.class); - /* * The information about the resource that will be evaluated. */ @@ -22,8 +19,7 @@ public final class CheckRestrictionsRequest { private CheckRestrictionsResourceDetails resourceDetails; /* - * The list of fields and values that should be evaluated for potential - * restrictions. + * The list of fields and values that should be evaluated for potential restrictions. */ @JsonProperty(value = "pendingFields") private List pendingFields; @@ -77,7 +73,7 @@ public CheckRestrictionsRequest withPendingFields(List pendingFiel */ public void validate() { if (resourceDetails() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property resourceDetails in model CheckRestrictionsRequest")); @@ -88,4 +84,6 @@ public void validate() { pendingFields().forEach(e -> e.validate()); } } + + private static final ClientLogger LOGGER = new ClientLogger(CheckRestrictionsRequest.class); } diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/CheckRestrictionsResourceDetails.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/CheckRestrictionsResourceDetails.java index e8906f3a7843..e203a925df65 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/CheckRestrictionsResourceDetails.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/CheckRestrictionsResourceDetails.java @@ -6,17 +6,14 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** The information about the resource that will be evaluated. */ @Fluent public final class CheckRestrictionsResourceDetails { - @JsonIgnore private final ClientLogger logger = new ClientLogger(CheckRestrictionsResourceDetails.class); - /* - * The resource content. This should include whatever properties are - * already known and can be a partial set of all resource properties. + * The resource content. This should include whatever properties are already known and can be a partial set of all + * resource properties. */ @JsonProperty(value = "resourceContent", required = true) private Object resourceContent; @@ -28,9 +25,8 @@ public final class CheckRestrictionsResourceDetails { private String apiVersion; /* - * The scope where the resource is being created. For example, if the - * resource is a child resource this would be the parent resource's - * resource ID. + * The scope where the resource is being created. For example, if the resource is a child resource this would be + * the parent resource's resource ID. */ @JsonProperty(value = "scope") private String scope; @@ -106,10 +102,12 @@ public CheckRestrictionsResourceDetails withScope(String scope) { */ public void validate() { if (resourceContent() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property resourceContent in model CheckRestrictionsResourceDetails")); } } + + private static final ClientLogger LOGGER = new ClientLogger(CheckRestrictionsResourceDetails.class); } diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/CheckRestrictionsResultContentEvaluationResult.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/CheckRestrictionsResultContentEvaluationResult.java index eb8c34ae27f8..cfed6b5f2fcb 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/CheckRestrictionsResultContentEvaluationResult.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/CheckRestrictionsResultContentEvaluationResult.java @@ -5,20 +5,15 @@ package com.azure.resourcemanager.policyinsights.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** Evaluation results for the provided partial resource content. */ @Fluent public final class CheckRestrictionsResultContentEvaluationResult { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(CheckRestrictionsResultContentEvaluationResult.class); - /* - * Policy evaluation results against the given resource content. This will - * indicate if the partial content that was provided will be denied as-is. + * Policy evaluation results against the given resource content. This will indicate if the partial content that was + * provided will be denied as-is. */ @JsonProperty(value = "policyEvaluations") private List policyEvaluations; diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/ComplianceDetail.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/ComplianceDetail.java index 795ae4785fea..1865acd37a3d 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/ComplianceDetail.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/ComplianceDetail.java @@ -5,15 +5,11 @@ package com.azure.resourcemanager.policyinsights.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** The compliance state rollup. */ @Fluent public final class ComplianceDetail { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ComplianceDetail.class); - /* * The compliance state. */ diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/ComplianceState.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/ComplianceState.java index be16554d9584..e37433d898ea 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/ComplianceState.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/ComplianceState.java @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for ComplianceState. */ +/** The compliance state that should be set on the resource. */ public final class ComplianceState extends ExpandableStringEnum { /** Static value Compliant for ComplianceState. */ public static final ComplianceState COMPLIANT = fromString("Compliant"); @@ -30,7 +30,11 @@ public static ComplianceState fromString(String name) { return fromString(name, ComplianceState.class); } - /** @return known ComplianceState values. */ + /** + * Gets known ComplianceState values. + * + * @return known ComplianceState values. + */ public static Collection values() { return values(ComplianceState.class); } diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/ComponentEventDetails.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/ComponentEventDetails.java index 8a0e9aa3c1f1..ade2f9249035 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/ComponentEventDetails.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/ComponentEventDetails.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.policyinsights.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; import com.fasterxml.jackson.annotation.JsonIgnore; @@ -17,8 +16,6 @@ /** Component event details. */ @Fluent public final class ComponentEventDetails { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ComponentEventDetails.class); - /* * Component Id. */ @@ -50,8 +47,7 @@ public final class ComponentEventDetails { private String tenantId; /* - * Principal object ID for the user who initiated the resource component - * operation that triggered the policy event. + * Principal object ID for the user who initiated the resource component operation that triggered the policy event. */ @JsonProperty(value = "principalOid") private String principalOid; diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/ComponentStateDetails.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/ComponentStateDetails.java index b87ffeda1a70..b427c3d44fae 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/ComponentStateDetails.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/ComponentStateDetails.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.policyinsights.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; import com.fasterxml.jackson.annotation.JsonIgnore; @@ -17,8 +16,6 @@ /** Component state details. */ @Fluent public final class ComponentStateDetails { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ComponentStateDetails.class); - /* * Component Id. */ diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/ExpressionEvaluationDetails.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/ExpressionEvaluationDetails.java index 39a03720e89e..07976026e6bf 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/ExpressionEvaluationDetails.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/ExpressionEvaluationDetails.java @@ -5,15 +5,11 @@ package com.azure.resourcemanager.policyinsights.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** Evaluation details of policy language expressions. */ @Fluent public final class ExpressionEvaluationDetails { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressionEvaluationDetails.class); - /* * Evaluation result. */ diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/FieldRestriction.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/FieldRestriction.java index 8478afa851b1..cd48ca6eb738 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/FieldRestriction.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/FieldRestriction.java @@ -5,16 +5,12 @@ package com.azure.resourcemanager.policyinsights.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** The restrictions on a field imposed by a specific policy. */ @Immutable public final class FieldRestriction { - @JsonIgnore private final ClientLogger logger = new ClientLogger(FieldRestriction.class); - /* * The type of restriction that is imposed on the field. */ @@ -22,8 +18,7 @@ public final class FieldRestriction { private FieldRestrictionResult result; /* - * The value that policy will set for the field if the user does not - * provide a value. + * The value that policy will set for the field if the user does not provide a value. */ @JsonProperty(value = "defaultValue", access = JsonProperty.Access.WRITE_ONLY) private String defaultValue; diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/FieldRestrictionResult.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/FieldRestrictionResult.java index fe3743e86d0b..3eab9dec375f 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/FieldRestrictionResult.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/FieldRestrictionResult.java @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for FieldRestrictionResult. */ +/** The type of restriction that is imposed on the field. */ public final class FieldRestrictionResult extends ExpandableStringEnum { /** Static value Required for FieldRestrictionResult. */ public static final FieldRestrictionResult REQUIRED = fromString("Required"); @@ -30,7 +30,11 @@ public static FieldRestrictionResult fromString(String name) { return fromString(name, FieldRestrictionResult.class); } - /** @return known FieldRestrictionResult values. */ + /** + * Gets known FieldRestrictionResult values. + * + * @return known FieldRestrictionResult values. + */ public static Collection values() { return values(FieldRestrictionResult.class); } diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/FieldRestrictions.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/FieldRestrictions.java index 97a44fe94ad2..921af1e76bb6 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/FieldRestrictions.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/FieldRestrictions.java @@ -5,19 +5,14 @@ package com.azure.resourcemanager.policyinsights.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** The restrictions that will be placed on a field in the resource by policy. */ @Fluent public final class FieldRestrictions { - @JsonIgnore private final ClientLogger logger = new ClientLogger(FieldRestrictions.class); - /* - * The name of the field. This can be a top-level property like 'name' or - * 'type' or an Azure Policy field alias. + * The name of the field. This can be a top-level property like 'name' or 'type' or an Azure Policy field alias. */ @JsonProperty(value = "field", access = JsonProperty.Access.WRITE_ONLY) private String field; diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/IfNotExistsEvaluationDetails.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/IfNotExistsEvaluationDetails.java index de3ccf04e56e..fe94eb75310c 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/IfNotExistsEvaluationDetails.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/IfNotExistsEvaluationDetails.java @@ -5,15 +5,11 @@ package com.azure.resourcemanager.policyinsights.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** Evaluation details of IfNotExists effect. */ @Fluent public final class IfNotExistsEvaluationDetails { - @JsonIgnore private final ClientLogger logger = new ClientLogger(IfNotExistsEvaluationDetails.class); - /* * ID of the last evaluated resource for IfNotExists effect. */ @@ -21,8 +17,7 @@ public final class IfNotExistsEvaluationDetails { private String resourceId; /* - * Total number of resources to which the existence condition is - * applicable. + * Total number of resources to which the existence condition is applicable. */ @JsonProperty(value = "totalResources") private Integer totalResources; diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/Operation.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/Operation.java index 2d2f22c4d4d6..cad80315321f 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/Operation.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/Operation.java @@ -5,15 +5,11 @@ package com.azure.resourcemanager.policyinsights.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** Operation definition. */ @Fluent public final class Operation { - @JsonIgnore private final ClientLogger logger = new ClientLogger(Operation.class); - /* * Operation name. */ diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/OperationDisplay.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/OperationDisplay.java index 80e0867206a7..daf88646f5c1 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/OperationDisplay.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/OperationDisplay.java @@ -5,15 +5,11 @@ package com.azure.resourcemanager.policyinsights.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** Display metadata associated with the operation. */ @Fluent public final class OperationDisplay { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationDisplay.class); - /* * Resource provider name. */ diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/Operations.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/Operations.java index 858697fb3c5d..e0571a096d0a 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/Operations.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/Operations.java @@ -25,7 +25,7 @@ public interface Operations { * @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 list of available operations. + * @return list of available operations along with {@link Response}. */ Response listWithResponse(Context context); } diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/PendingField.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/PendingField.java index 95ce0bbe6696..fcde8e5501c7 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/PendingField.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/PendingField.java @@ -6,25 +6,20 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** A field that should be evaluated against Azure Policy to determine restrictions. */ @Fluent public final class PendingField { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PendingField.class); - /* - * The name of the field. This can be a top-level property like 'name' or - * 'type' or an Azure Policy field alias. + * The name of the field. This can be a top-level property like 'name' or 'type' or an Azure Policy field alias. */ @JsonProperty(value = "field", required = true) private String field; /* - * The list of potential values for the field that should be evaluated - * against Azure Policy. + * The list of potential values for the field that should be evaluated against Azure Policy. */ @JsonProperty(value = "values") private List values; @@ -80,9 +75,11 @@ public PendingField withValues(List values) { */ public void validate() { if (field() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property field in model PendingField")); } } + + private static final ClientLogger LOGGER = new ClientLogger(PendingField.class); } diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/PolicyAssignmentSummary.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/PolicyAssignmentSummary.java index 062b5c9e4a82..283569c9c11c 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/PolicyAssignmentSummary.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/PolicyAssignmentSummary.java @@ -5,16 +5,12 @@ package com.azure.resourcemanager.policyinsights.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** Policy assignment summary. */ @Fluent public final class PolicyAssignmentSummary { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PolicyAssignmentSummary.class); - /* * Policy assignment ID. */ diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/PolicyDefinitionSummary.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/PolicyDefinitionSummary.java index bf320e56f822..f571c5748ef3 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/PolicyDefinitionSummary.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/PolicyDefinitionSummary.java @@ -5,16 +5,12 @@ package com.azure.resourcemanager.policyinsights.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** Policy definition summary. */ @Fluent public final class PolicyDefinitionSummary { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PolicyDefinitionSummary.class); - /* * Policy definition ID. */ diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/PolicyDetails.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/PolicyDetails.java index 1aa19eaea8b8..ce8805e3f678 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/PolicyDetails.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/PolicyDetails.java @@ -5,15 +5,11 @@ package com.azure.resourcemanager.policyinsights.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** The policy details. */ @Immutable public final class PolicyDetails { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PolicyDetails.class); - /* * The ID of the policy definition. */ diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/PolicyEvaluationDetails.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/PolicyEvaluationDetails.java index 88e3ab39f00c..b05d66fb0cb5 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/PolicyEvaluationDetails.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/PolicyEvaluationDetails.java @@ -5,16 +5,12 @@ package com.azure.resourcemanager.policyinsights.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** Policy evaluation details. */ @Fluent public final class PolicyEvaluationDetails { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PolicyEvaluationDetails.class); - /* * Details of the evaluated expressions. */ diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/PolicyEvaluationResult.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/PolicyEvaluationResult.java index 7fe782cf69b8..d7f6bca25b91 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/PolicyEvaluationResult.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/PolicyEvaluationResult.java @@ -5,15 +5,11 @@ package com.azure.resourcemanager.policyinsights.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** The result of a non-compliant policy evaluation against the given resource content. */ @Immutable public final class PolicyEvaluationResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PolicyEvaluationResult.class); - /* * The details of the policy that was evaluated. */ @@ -21,16 +17,14 @@ public final class PolicyEvaluationResult { private PolicyReference policyInfo; /* - * The result of the policy evaluation against the resource. This will - * typically be 'NonCompliant' but may contain other values if errors were - * encountered. + * The result of the policy evaluation against the resource. This will typically be 'NonCompliant' but may contain + * other values if errors were encountered. */ @JsonProperty(value = "evaluationResult", access = JsonProperty.Access.WRITE_ONLY) private String evaluationResult; /* - * The detailed results of the policy expressions and values that were - * evaluated. + * The detailed results of the policy expressions and values that were evaluated. */ @JsonProperty(value = "evaluationDetails", access = JsonProperty.Access.WRITE_ONLY) private PolicyEvaluationDetails evaluationDetails; diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/PolicyEvents.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/PolicyEvents.java index f2e70aacd457..8afe284b7029 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/PolicyEvents.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/PolicyEvents.java @@ -13,17 +13,22 @@ public interface PolicyEvents { /** * Queries policy events for the resources under the management group. * + * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only "default" is + * allowed. * @param managementGroupName Management group name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results as paginated response with {@link PagedIterable}. */ - PagedIterable listQueryResultsForManagementGroup(String managementGroupName); + PagedIterable listQueryResultsForManagementGroup( + PolicyEventsResourceType policyEventsResource, String managementGroupName); /** * Queries policy events for the resources under the management group. * + * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only "default" is + * allowed. * @param managementGroupName Management group name. * @param top Maximum number of records to return. * @param orderBy Ordering expression using OData notation. One or more comma-separated column names with an @@ -42,9 +47,10 @@ public interface PolicyEvents { * @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 query results. + * @return query results as paginated response with {@link PagedIterable}. */ PagedIterable listQueryResultsForManagementGroup( + PolicyEventsResourceType policyEventsResource, String managementGroupName, Integer top, String orderBy, @@ -59,17 +65,22 @@ PagedIterable listQueryResultsForManagementGroup( /** * Queries policy events for the resources under the subscription. * + * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only "default" is + * allowed. * @param subscriptionId Microsoft Azure subscription 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 query results. + * @return query results as paginated response with {@link PagedIterable}. */ - PagedIterable listQueryResultsForSubscription(String subscriptionId); + PagedIterable listQueryResultsForSubscription( + PolicyEventsResourceType policyEventsResource, String subscriptionId); /** * Queries policy events for the resources under the subscription. * + * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only "default" is + * allowed. * @param subscriptionId Microsoft Azure subscription ID. * @param top Maximum number of records to return. * @param orderBy Ordering expression using OData notation. One or more comma-separated column names with an @@ -88,9 +99,10 @@ PagedIterable listQueryResultsForManagementGroup( * @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 query results. + * @return query results as paginated response with {@link PagedIterable}. */ PagedIterable listQueryResultsForSubscription( + PolicyEventsResourceType policyEventsResource, String subscriptionId, Integer top, String orderBy, @@ -105,18 +117,23 @@ PagedIterable listQueryResultsForSubscription( /** * Queries policy events for the resources under the resource group. * + * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only "default" is + * allowed. * @param subscriptionId Microsoft Azure subscription ID. * @param resourceGroupName Resource group name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results as paginated response with {@link PagedIterable}. */ - PagedIterable listQueryResultsForResourceGroup(String subscriptionId, String resourceGroupName); + PagedIterable listQueryResultsForResourceGroup( + PolicyEventsResourceType policyEventsResource, String subscriptionId, String resourceGroupName); /** * Queries policy events for the resources under the resource group. * + * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only "default" is + * allowed. * @param subscriptionId Microsoft Azure subscription ID. * @param resourceGroupName Resource group name. * @param top Maximum number of records to return. @@ -136,9 +153,10 @@ PagedIterable listQueryResultsForSubscription( * @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 query results. + * @return query results as paginated response with {@link PagedIterable}. */ PagedIterable listQueryResultsForResourceGroup( + PolicyEventsResourceType policyEventsResource, String subscriptionId, String resourceGroupName, Integer top, @@ -154,17 +172,22 @@ PagedIterable listQueryResultsForResourceGroup( /** * Queries policy events for the resource. * + * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only "default" is + * allowed. * @param resourceId 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 query results. + * @return query results as paginated response with {@link PagedIterable}. */ - PagedIterable listQueryResultsForResource(String resourceId); + PagedIterable listQueryResultsForResource( + PolicyEventsResourceType policyEventsResource, String resourceId); /** * Queries policy events for the resource. * + * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only "default" is + * allowed. * @param resourceId Resource ID. * @param top Maximum number of records to return. * @param orderBy Ordering expression using OData notation. One or more comma-separated column names with an @@ -184,9 +207,10 @@ PagedIterable listQueryResultsForResourceGroup( * @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 query results. + * @return query results as paginated response with {@link PagedIterable}. */ PagedIterable listQueryResultsForResource( + PolicyEventsResourceType policyEventsResource, String resourceId, Integer top, String orderBy, @@ -202,19 +226,23 @@ PagedIterable listQueryResultsForResource( /** * Queries policy events for the subscription level policy set definition. * + * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only "default" is + * allowed. * @param subscriptionId Microsoft Azure subscription ID. * @param policySetDefinitionName Policy set definition name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results as paginated response with {@link PagedIterable}. */ PagedIterable listQueryResultsForPolicySetDefinition( - String subscriptionId, String policySetDefinitionName); + PolicyEventsResourceType policyEventsResource, String subscriptionId, String policySetDefinitionName); /** * Queries policy events for the subscription level policy set definition. * + * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only "default" is + * allowed. * @param subscriptionId Microsoft Azure subscription ID. * @param policySetDefinitionName Policy set definition name. * @param top Maximum number of records to return. @@ -234,9 +262,10 @@ PagedIterable listQueryResultsForPolicySetDefinition( * @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 query results. + * @return query results as paginated response with {@link PagedIterable}. */ PagedIterable listQueryResultsForPolicySetDefinition( + PolicyEventsResourceType policyEventsResource, String subscriptionId, String policySetDefinitionName, Integer top, @@ -252,18 +281,23 @@ PagedIterable listQueryResultsForPolicySetDefinition( /** * Queries policy events for the subscription level policy definition. * + * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only "default" is + * allowed. * @param subscriptionId Microsoft Azure subscription ID. * @param policyDefinitionName Policy definition name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results as paginated response with {@link PagedIterable}. */ - PagedIterable listQueryResultsForPolicyDefinition(String subscriptionId, String policyDefinitionName); + PagedIterable listQueryResultsForPolicyDefinition( + PolicyEventsResourceType policyEventsResource, String subscriptionId, String policyDefinitionName); /** * Queries policy events for the subscription level policy definition. * + * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only "default" is + * allowed. * @param subscriptionId Microsoft Azure subscription ID. * @param policyDefinitionName Policy definition name. * @param top Maximum number of records to return. @@ -283,9 +317,10 @@ PagedIterable listQueryResultsForPolicySetDefinition( * @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 query results. + * @return query results as paginated response with {@link PagedIterable}. */ PagedIterable listQueryResultsForPolicyDefinition( + PolicyEventsResourceType policyEventsResource, String subscriptionId, String policyDefinitionName, Integer top, @@ -301,19 +336,23 @@ PagedIterable listQueryResultsForPolicyDefinition( /** * Queries policy events for the subscription level policy assignment. * + * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only "default" is + * allowed. * @param subscriptionId Microsoft Azure subscription ID. * @param policyAssignmentName Policy assignment name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results as paginated response with {@link PagedIterable}. */ PagedIterable listQueryResultsForSubscriptionLevelPolicyAssignment( - String subscriptionId, String policyAssignmentName); + PolicyEventsResourceType policyEventsResource, String subscriptionId, String policyAssignmentName); /** * Queries policy events for the subscription level policy assignment. * + * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only "default" is + * allowed. * @param subscriptionId Microsoft Azure subscription ID. * @param policyAssignmentName Policy assignment name. * @param top Maximum number of records to return. @@ -333,9 +372,10 @@ PagedIterable listQueryResultsForSubscriptionLevelPolicyAssignment( * @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 query results. + * @return query results as paginated response with {@link PagedIterable}. */ PagedIterable listQueryResultsForSubscriptionLevelPolicyAssignment( + PolicyEventsResourceType policyEventsResource, String subscriptionId, String policyAssignmentName, Integer top, @@ -351,20 +391,27 @@ PagedIterable listQueryResultsForSubscriptionLevelPolicyAssignment( /** * Queries policy events for the resource group level policy assignment. * + * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only "default" is + * allowed. * @param subscriptionId Microsoft Azure subscription ID. * @param resourceGroupName Resource group name. * @param policyAssignmentName Policy assignment name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return query results. + * @return query results as paginated response with {@link PagedIterable}. */ PagedIterable listQueryResultsForResourceGroupLevelPolicyAssignment( - String subscriptionId, String resourceGroupName, String policyAssignmentName); + PolicyEventsResourceType policyEventsResource, + String subscriptionId, + String resourceGroupName, + String policyAssignmentName); /** * Queries policy events for the resource group level policy assignment. * + * @param policyEventsResource The name of the virtual resource under PolicyEvents resource type; only "default" is + * allowed. * @param subscriptionId Microsoft Azure subscription ID. * @param resourceGroupName Resource group name. * @param policyAssignmentName Policy assignment name. @@ -385,9 +432,10 @@ PagedIterable listQueryResultsForResourceGroupLevelPolicyAssignment * @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 query results. + * @return query results as paginated response with {@link PagedIterable}. */ PagedIterable listQueryResultsForResourceGroupLevelPolicyAssignment( + PolicyEventsResourceType policyEventsResource, String subscriptionId, String resourceGroupName, String policyAssignmentName, diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/PolicyEventsQueryResults.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/PolicyEventsQueryResults.java index 3635bf1d5c0d..935970fe8e40 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/PolicyEventsQueryResults.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/PolicyEventsQueryResults.java @@ -5,27 +5,21 @@ package com.azure.resourcemanager.policyinsights.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.policyinsights.fluent.models.PolicyEventInner; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** Query results. */ @Fluent public final class PolicyEventsQueryResults { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PolicyEventsQueryResults.class); - /* - * OData context string; used by OData clients to resolve type information - * based on metadata. + * OData context string; used by OData clients to resolve type information based on metadata. */ @JsonProperty(value = "@odata.context") private String odataContext; /* - * OData entity count; represents the number of policy event records - * returned. + * OData entity count; represents the number of policy event records returned. */ @JsonProperty(value = "@odata.count") private Integer odataCount; diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/PolicyEventsResourceType.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/PolicyEventsResourceType.java new file mode 100644 index 000000000000..746f1b00fa3f --- /dev/null +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/PolicyEventsResourceType.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.policyinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for PolicyEventsResourceType. */ +public final class PolicyEventsResourceType extends ExpandableStringEnum { + /** Static value default for PolicyEventsResourceType. */ + public static final PolicyEventsResourceType DEFAULT = fromString("default"); + + /** + * Creates or finds a PolicyEventsResourceType from its string representation. + * + * @param name a name to look for. + * @return the corresponding PolicyEventsResourceType. + */ + @JsonCreator + public static PolicyEventsResourceType fromString(String name) { + return fromString(name, PolicyEventsResourceType.class); + } + + /** + * Gets known PolicyEventsResourceType values. + * + * @return known PolicyEventsResourceType values. + */ + public static Collection values() { + return values(PolicyEventsResourceType.class); + } +} diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/PolicyGroupSummary.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/PolicyGroupSummary.java index f902f7f88c49..ec88bad23f28 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/PolicyGroupSummary.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/PolicyGroupSummary.java @@ -5,15 +5,11 @@ package com.azure.resourcemanager.policyinsights.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** Policy definition group summary. */ @Fluent public final class PolicyGroupSummary { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PolicyGroupSummary.class); - /* * Policy group name. */ diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/PolicyMetadataCollection.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/PolicyMetadataCollection.java index ac531d61e5fc..01c0aecca90d 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/PolicyMetadataCollection.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/PolicyMetadataCollection.java @@ -5,17 +5,13 @@ package com.azure.resourcemanager.policyinsights.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.policyinsights.fluent.models.SlimPolicyMetadataInner; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** Collection of policy metadata resources. */ @Immutable public final class PolicyMetadataCollection { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PolicyMetadataCollection.class); - /* * Array of policy metadata definitions. */ diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/PolicyMetadatas.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/PolicyMetadatas.java index 760da5118a60..36e65a944a74 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/PolicyMetadatas.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/PolicyMetadatas.java @@ -29,7 +29,7 @@ public interface PolicyMetadatas { * @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 policy metadata resource. + * @return policy metadata resource along with {@link Response}. */ Response getResourceWithResponse(String resourceName, Context context); @@ -38,7 +38,7 @@ public interface PolicyMetadatas { * * @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 the policy metadata resources. + * @return a list of the policy metadata resources as paginated response with {@link PagedIterable}. */ PagedIterable list(); @@ -50,7 +50,7 @@ public interface PolicyMetadatas { * @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 the policy metadata resources. + * @return a list of the policy metadata resources as paginated response with {@link PagedIterable}. */ PagedIterable list(Integer top, Context context); } diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/PolicyReference.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/PolicyReference.java index d4b93773eeb5..afb17541d987 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/PolicyReference.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/PolicyReference.java @@ -5,15 +5,11 @@ package com.azure.resourcemanager.policyinsights.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** Resource identifiers for a policy. */ @Immutable public final class PolicyReference { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PolicyReference.class); - /* * The resource identifier of the policy definition. */ @@ -27,8 +23,7 @@ public final class PolicyReference { private String policySetDefinitionId; /* - * The reference identifier of a specific policy definition within a policy - * set definition. + * The reference identifier of a specific policy definition within a policy set definition. */ @JsonProperty(value = "policyDefinitionReferenceId", access = JsonProperty.Access.WRITE_ONLY) private String policyDefinitionReferenceId; diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/PolicyRestrictions.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/PolicyRestrictions.java index f60fe4204967..16d56e79b905 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/PolicyRestrictions.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/PolicyRestrictions.java @@ -28,7 +28,7 @@ public interface PolicyRestrictions { * @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 result of a check policy restrictions evaluation on a resource. + * @return the result of a check policy restrictions evaluation on a resource along with {@link Response}. */ Response checkAtSubscriptionScopeWithResponse( CheckRestrictionsRequest parameters, Context context); @@ -56,8 +56,35 @@ Response checkAtSubscriptionScopeWithResponse( * @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 result of a check policy restrictions evaluation on a resource. + * @return the result of a check policy restrictions evaluation on a resource along with {@link Response}. */ Response checkAtResourceGroupScopeWithResponse( String resourceGroupName, CheckRestrictionsRequest parameters, Context context); + + /** + * Checks what restrictions Azure Policy will place on resources within a management group. + * + * @param managementGroupId Management group ID. + * @param parameters The check policy restrictions parameters. + * @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 result of a check policy restrictions evaluation on a resource. + */ + CheckRestrictionsResult checkAtManagementGroupScope( + String managementGroupId, CheckManagementGroupRestrictionsRequest parameters); + + /** + * Checks what restrictions Azure Policy will place on resources within a management group. + * + * @param managementGroupId Management group ID. + * @param parameters The check policy restrictions parameters. + * @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 result of a check policy restrictions evaluation on a resource along with {@link Response}. + */ + Response checkAtManagementGroupScopeWithResponse( + String managementGroupId, CheckManagementGroupRestrictionsRequest parameters, Context context); } diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/PolicyStates.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/PolicyStates.java index 6e62e30e007b..f0456b6fcbe2 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/PolicyStates.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/PolicyStates.java @@ -20,7 +20,7 @@ public interface PolicyStates { * @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 query results. + * @return query results as paginated response with {@link PagedIterable}. */ PagedIterable listQueryResultsForManagementGroup( PolicyStatesResource policyStatesResource, String managementGroupName); @@ -48,7 +48,7 @@ PagedIterable listQueryResultsForManagementGroup( * @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 query results. + * @return query results as paginated response with {@link PagedIterable}. */ PagedIterable listQueryResultsForManagementGroup( PolicyStatesResource policyStatesResource, @@ -66,17 +66,22 @@ PagedIterable listQueryResultsForManagementGroup( /** * Summarizes policy states for the resources under the management group. * + * @param policyStatesSummaryResource The virtual resource under PolicyStates resource type for summarize action. In + * a given time range, 'latest' represents the latest policy state(s) and is the only allowed value. * @param managementGroupName Management group name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return summarize action results. */ - SummarizeResults summarizeForManagementGroup(String managementGroupName); + SummarizeResults summarizeForManagementGroup( + PolicyStatesSummaryResourceType policyStatesSummaryResource, String managementGroupName); /** * Summarizes policy states for the resources under the management group. * + * @param policyStatesSummaryResource The virtual resource under PolicyStates resource type for summarize action. In + * a given time range, 'latest' represents the latest policy state(s) and is the only allowed value. * @param managementGroupName Management group name. * @param top Maximum number of records to return. * @param from ISO 8601 formatted timestamp specifying the start time of the interval to query. When not specified, @@ -88,9 +93,10 @@ PagedIterable listQueryResultsForManagementGroup( * @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 summarize action results. + * @return summarize action results along with {@link Response}. */ Response summarizeForManagementGroupWithResponse( + PolicyStatesSummaryResourceType policyStatesSummaryResource, String managementGroupName, Integer top, OffsetDateTime from, @@ -107,7 +113,7 @@ Response summarizeForManagementGroupWithResponse( * @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 query results. + * @return query results as paginated response with {@link PagedIterable}. */ PagedIterable listQueryResultsForSubscription( PolicyStatesResource policyStatesResource, String subscriptionId); @@ -135,7 +141,7 @@ PagedIterable listQueryResultsForSubscription( * @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 query results. + * @return query results as paginated response with {@link PagedIterable}. */ PagedIterable listQueryResultsForSubscription( PolicyStatesResource policyStatesResource, @@ -153,17 +159,22 @@ PagedIterable listQueryResultsForSubscription( /** * Summarizes policy states for the resources under the subscription. * + * @param policyStatesSummaryResource The virtual resource under PolicyStates resource type for summarize action. In + * a given time range, 'latest' represents the latest policy state(s) and is the only allowed value. * @param subscriptionId Microsoft Azure subscription 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 summarize action results. */ - SummarizeResults summarizeForSubscription(String subscriptionId); + SummarizeResults summarizeForSubscription( + PolicyStatesSummaryResourceType policyStatesSummaryResource, String subscriptionId); /** * Summarizes policy states for the resources under the subscription. * + * @param policyStatesSummaryResource The virtual resource under PolicyStates resource type for summarize action. In + * a given time range, 'latest' represents the latest policy state(s) and is the only allowed value. * @param subscriptionId Microsoft Azure subscription ID. * @param top Maximum number of records to return. * @param from ISO 8601 formatted timestamp specifying the start time of the interval to query. When not specified, @@ -175,10 +186,16 @@ PagedIterable listQueryResultsForSubscription( * @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 summarize action results. + * @return summarize action results along with {@link Response}. */ Response summarizeForSubscriptionWithResponse( - String subscriptionId, Integer top, OffsetDateTime from, OffsetDateTime to, String filter, Context context); + PolicyStatesSummaryResourceType policyStatesSummaryResource, + String subscriptionId, + Integer top, + OffsetDateTime from, + OffsetDateTime to, + String filter, + Context context); /** * Queries policy states for the resources under the resource group. @@ -190,7 +207,7 @@ Response summarizeForSubscriptionWithResponse( * @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 query results. + * @return query results as paginated response with {@link PagedIterable}. */ PagedIterable listQueryResultsForResourceGroup( PolicyStatesResource policyStatesResource, String subscriptionId, String resourceGroupName); @@ -219,7 +236,7 @@ PagedIterable listQueryResultsForResourceGroup( * @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 query results. + * @return query results as paginated response with {@link PagedIterable}. */ PagedIterable listQueryResultsForResourceGroup( PolicyStatesResource policyStatesResource, @@ -238,6 +255,8 @@ PagedIterable listQueryResultsForResourceGroup( /** * Summarizes policy states for the resources under the resource group. * + * @param policyStatesSummaryResource The virtual resource under PolicyStates resource type for summarize action. In + * a given time range, 'latest' represents the latest policy state(s) and is the only allowed value. * @param subscriptionId Microsoft Azure subscription ID. * @param resourceGroupName Resource group name. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -245,11 +264,14 @@ PagedIterable listQueryResultsForResourceGroup( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return summarize action results. */ - SummarizeResults summarizeForResourceGroup(String subscriptionId, String resourceGroupName); + SummarizeResults summarizeForResourceGroup( + PolicyStatesSummaryResourceType policyStatesSummaryResource, String subscriptionId, String resourceGroupName); /** * Summarizes policy states for the resources under the resource group. * + * @param policyStatesSummaryResource The virtual resource under PolicyStates resource type for summarize action. In + * a given time range, 'latest' represents the latest policy state(s) and is the only allowed value. * @param subscriptionId Microsoft Azure subscription ID. * @param resourceGroupName Resource group name. * @param top Maximum number of records to return. @@ -262,9 +284,10 @@ PagedIterable listQueryResultsForResourceGroup( * @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 summarize action results. + * @return summarize action results along with {@link Response}. */ Response summarizeForResourceGroupWithResponse( + PolicyStatesSummaryResourceType policyStatesSummaryResource, String subscriptionId, String resourceGroupName, Integer top, @@ -282,7 +305,7 @@ Response summarizeForResourceGroupWithResponse( * @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 query results. + * @return query results as paginated response with {@link PagedIterable}. */ PagedIterable listQueryResultsForResource( PolicyStatesResource policyStatesResource, String resourceId); @@ -311,7 +334,7 @@ PagedIterable listQueryResultsForResource( * @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 query results. + * @return query results as paginated response with {@link PagedIterable}. */ PagedIterable listQueryResultsForResource( PolicyStatesResource policyStatesResource, @@ -330,17 +353,22 @@ PagedIterable listQueryResultsForResource( /** * Summarizes policy states for the resource. * + * @param policyStatesSummaryResource The virtual resource under PolicyStates resource type for summarize action. In + * a given time range, 'latest' represents the latest policy state(s) and is the only allowed value. * @param resourceId 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 summarize action results. */ - SummarizeResults summarizeForResource(String resourceId); + SummarizeResults summarizeForResource( + PolicyStatesSummaryResourceType policyStatesSummaryResource, String resourceId); /** * Summarizes policy states for the resource. * + * @param policyStatesSummaryResource The virtual resource under PolicyStates resource type for summarize action. In + * a given time range, 'latest' represents the latest policy state(s) and is the only allowed value. * @param resourceId Resource ID. * @param top Maximum number of records to return. * @param from ISO 8601 formatted timestamp specifying the start time of the interval to query. When not specified, @@ -352,10 +380,16 @@ PagedIterable listQueryResultsForResource( * @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 summarize action results. + * @return summarize action results along with {@link Response}. */ Response summarizeForResourceWithResponse( - String resourceId, Integer top, OffsetDateTime from, OffsetDateTime to, String filter, Context context); + PolicyStatesSummaryResourceType policyStatesSummaryResource, + String resourceId, + Integer top, + OffsetDateTime from, + OffsetDateTime to, + String filter, + Context context); /** * Triggers a policy evaluation scan for all the resources under the subscription. @@ -411,7 +445,7 @@ Response summarizeForResourceWithResponse( * @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 query results. + * @return query results as paginated response with {@link PagedIterable}. */ PagedIterable listQueryResultsForPolicySetDefinition( PolicyStatesResource policyStatesResource, String subscriptionId, String policySetDefinitionName); @@ -440,7 +474,7 @@ PagedIterable listQueryResultsForPolicySetDefinition( * @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 query results. + * @return query results as paginated response with {@link PagedIterable}. */ PagedIterable listQueryResultsForPolicySetDefinition( PolicyStatesResource policyStatesResource, @@ -459,6 +493,8 @@ PagedIterable listQueryResultsForPolicySetDefinition( /** * Summarizes policy states for the subscription level policy set definition. * + * @param policyStatesSummaryResource The virtual resource under PolicyStates resource type for summarize action. In + * a given time range, 'latest' represents the latest policy state(s) and is the only allowed value. * @param subscriptionId Microsoft Azure subscription ID. * @param policySetDefinitionName Policy set definition name. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -466,11 +502,16 @@ PagedIterable listQueryResultsForPolicySetDefinition( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return summarize action results. */ - SummarizeResults summarizeForPolicySetDefinition(String subscriptionId, String policySetDefinitionName); + SummarizeResults summarizeForPolicySetDefinition( + PolicyStatesSummaryResourceType policyStatesSummaryResource, + String subscriptionId, + String policySetDefinitionName); /** * Summarizes policy states for the subscription level policy set definition. * + * @param policyStatesSummaryResource The virtual resource under PolicyStates resource type for summarize action. In + * a given time range, 'latest' represents the latest policy state(s) and is the only allowed value. * @param subscriptionId Microsoft Azure subscription ID. * @param policySetDefinitionName Policy set definition name. * @param top Maximum number of records to return. @@ -483,9 +524,10 @@ PagedIterable listQueryResultsForPolicySetDefinition( * @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 summarize action results. + * @return summarize action results along with {@link Response}. */ Response summarizeForPolicySetDefinitionWithResponse( + PolicyStatesSummaryResourceType policyStatesSummaryResource, String subscriptionId, String policySetDefinitionName, Integer top, @@ -504,7 +546,7 @@ Response summarizeForPolicySetDefinitionWithResponse( * @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 query results. + * @return query results as paginated response with {@link PagedIterable}. */ PagedIterable listQueryResultsForPolicyDefinition( PolicyStatesResource policyStatesResource, String subscriptionId, String policyDefinitionName); @@ -533,7 +575,7 @@ PagedIterable listQueryResultsForPolicyDefinition( * @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 query results. + * @return query results as paginated response with {@link PagedIterable}. */ PagedIterable listQueryResultsForPolicyDefinition( PolicyStatesResource policyStatesResource, @@ -552,6 +594,8 @@ PagedIterable listQueryResultsForPolicyDefinition( /** * Summarizes policy states for the subscription level policy definition. * + * @param policyStatesSummaryResource The virtual resource under PolicyStates resource type for summarize action. In + * a given time range, 'latest' represents the latest policy state(s) and is the only allowed value. * @param subscriptionId Microsoft Azure subscription ID. * @param policyDefinitionName Policy definition name. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -559,11 +603,16 @@ PagedIterable listQueryResultsForPolicyDefinition( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return summarize action results. */ - SummarizeResults summarizeForPolicyDefinition(String subscriptionId, String policyDefinitionName); + SummarizeResults summarizeForPolicyDefinition( + PolicyStatesSummaryResourceType policyStatesSummaryResource, + String subscriptionId, + String policyDefinitionName); /** * Summarizes policy states for the subscription level policy definition. * + * @param policyStatesSummaryResource The virtual resource under PolicyStates resource type for summarize action. In + * a given time range, 'latest' represents the latest policy state(s) and is the only allowed value. * @param subscriptionId Microsoft Azure subscription ID. * @param policyDefinitionName Policy definition name. * @param top Maximum number of records to return. @@ -576,9 +625,10 @@ PagedIterable listQueryResultsForPolicyDefinition( * @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 summarize action results. + * @return summarize action results along with {@link Response}. */ Response summarizeForPolicyDefinitionWithResponse( + PolicyStatesSummaryResourceType policyStatesSummaryResource, String subscriptionId, String policyDefinitionName, Integer top, @@ -597,7 +647,7 @@ Response summarizeForPolicyDefinitionWithResponse( * @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 query results. + * @return query results as paginated response with {@link PagedIterable}. */ PagedIterable listQueryResultsForSubscriptionLevelPolicyAssignment( PolicyStatesResource policyStatesResource, String subscriptionId, String policyAssignmentName); @@ -626,7 +676,7 @@ PagedIterable listQueryResultsForSubscriptionLevelPolicyAssignment( * @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 query results. + * @return query results as paginated response with {@link PagedIterable}. */ PagedIterable listQueryResultsForSubscriptionLevelPolicyAssignment( PolicyStatesResource policyStatesResource, @@ -645,6 +695,8 @@ PagedIterable listQueryResultsForSubscriptionLevelPolicyAssignment( /** * Summarizes policy states for the subscription level policy assignment. * + * @param policyStatesSummaryResource The virtual resource under PolicyStates resource type for summarize action. In + * a given time range, 'latest' represents the latest policy state(s) and is the only allowed value. * @param subscriptionId Microsoft Azure subscription ID. * @param policyAssignmentName Policy assignment name. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -652,11 +704,16 @@ PagedIterable listQueryResultsForSubscriptionLevelPolicyAssignment( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return summarize action results. */ - SummarizeResults summarizeForSubscriptionLevelPolicyAssignment(String subscriptionId, String policyAssignmentName); + SummarizeResults summarizeForSubscriptionLevelPolicyAssignment( + PolicyStatesSummaryResourceType policyStatesSummaryResource, + String subscriptionId, + String policyAssignmentName); /** * Summarizes policy states for the subscription level policy assignment. * + * @param policyStatesSummaryResource The virtual resource under PolicyStates resource type for summarize action. In + * a given time range, 'latest' represents the latest policy state(s) and is the only allowed value. * @param subscriptionId Microsoft Azure subscription ID. * @param policyAssignmentName Policy assignment name. * @param top Maximum number of records to return. @@ -669,9 +726,10 @@ PagedIterable listQueryResultsForSubscriptionLevelPolicyAssignment( * @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 summarize action results. + * @return summarize action results along with {@link Response}. */ Response summarizeForSubscriptionLevelPolicyAssignmentWithResponse( + PolicyStatesSummaryResourceType policyStatesSummaryResource, String subscriptionId, String policyAssignmentName, Integer top, @@ -691,7 +749,7 @@ Response summarizeForSubscriptionLevelPolicyAssignmentWithResp * @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 query results. + * @return query results as paginated response with {@link PagedIterable}. */ PagedIterable listQueryResultsForResourceGroupLevelPolicyAssignment( PolicyStatesResource policyStatesResource, @@ -724,7 +782,7 @@ PagedIterable listQueryResultsForResourceGroupLevelPolicyAssignment * @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 query results. + * @return query results as paginated response with {@link PagedIterable}. */ PagedIterable listQueryResultsForResourceGroupLevelPolicyAssignment( PolicyStatesResource policyStatesResource, @@ -744,6 +802,8 @@ PagedIterable listQueryResultsForResourceGroupLevelPolicyAssignment /** * Summarizes policy states for the resource group level policy assignment. * + * @param policyStatesSummaryResource The virtual resource under PolicyStates resource type for summarize action. In + * a given time range, 'latest' represents the latest policy state(s) and is the only allowed value. * @param subscriptionId Microsoft Azure subscription ID. * @param resourceGroupName Resource group name. * @param policyAssignmentName Policy assignment name. @@ -753,11 +813,16 @@ PagedIterable listQueryResultsForResourceGroupLevelPolicyAssignment * @return summarize action results. */ SummarizeResults summarizeForResourceGroupLevelPolicyAssignment( - String subscriptionId, String resourceGroupName, String policyAssignmentName); + PolicyStatesSummaryResourceType policyStatesSummaryResource, + String subscriptionId, + String resourceGroupName, + String policyAssignmentName); /** * Summarizes policy states for the resource group level policy assignment. * + * @param policyStatesSummaryResource The virtual resource under PolicyStates resource type for summarize action. In + * a given time range, 'latest' represents the latest policy state(s) and is the only allowed value. * @param subscriptionId Microsoft Azure subscription ID. * @param resourceGroupName Resource group name. * @param policyAssignmentName Policy assignment name. @@ -771,9 +836,10 @@ SummarizeResults summarizeForResourceGroupLevelPolicyAssignment( * @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 summarize action results. + * @return summarize action results along with {@link Response}. */ Response summarizeForResourceGroupLevelPolicyAssignmentWithResponse( + PolicyStatesSummaryResourceType policyStatesSummaryResource, String subscriptionId, String resourceGroupName, String policyAssignmentName, diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/PolicyStatesQueryResults.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/PolicyStatesQueryResults.java index 1d467dcbae0a..e0c6b457f0f1 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/PolicyStatesQueryResults.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/PolicyStatesQueryResults.java @@ -5,27 +5,21 @@ package com.azure.resourcemanager.policyinsights.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.policyinsights.fluent.models.PolicyStateInner; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** Query results. */ @Fluent public final class PolicyStatesQueryResults { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PolicyStatesQueryResults.class); - /* - * OData context string; used by OData clients to resolve type information - * based on metadata. + * OData context string; used by OData clients to resolve type information based on metadata. */ @JsonProperty(value = "@odata.context") private String odataContext; /* - * OData entity count; represents the number of policy state records - * returned. + * OData entity count; represents the number of policy state records returned. */ @JsonProperty(value = "@odata.count") private Integer odataCount; diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/PolicyStatesResource.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/PolicyStatesResource.java index 873c9754e477..410fa1ae9bc7 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/PolicyStatesResource.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/PolicyStatesResource.java @@ -27,7 +27,11 @@ public static PolicyStatesResource fromString(String name) { return fromString(name, PolicyStatesResource.class); } - /** @return known PolicyStatesResource values. */ + /** + * Gets known PolicyStatesResource values. + * + * @return known PolicyStatesResource values. + */ public static Collection values() { return values(PolicyStatesResource.class); } diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/PolicyStatesSummaryResourceType.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/PolicyStatesSummaryResourceType.java new file mode 100644 index 000000000000..eb70932532c5 --- /dev/null +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/PolicyStatesSummaryResourceType.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.policyinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for PolicyStatesSummaryResourceType. */ +public final class PolicyStatesSummaryResourceType extends ExpandableStringEnum { + /** Static value latest for PolicyStatesSummaryResourceType. */ + public static final PolicyStatesSummaryResourceType LATEST = fromString("latest"); + + /** + * Creates or finds a PolicyStatesSummaryResourceType from its string representation. + * + * @param name a name to look for. + * @return the corresponding PolicyStatesSummaryResourceType. + */ + @JsonCreator + public static PolicyStatesSummaryResourceType fromString(String name) { + return fromString(name, PolicyStatesSummaryResourceType.class); + } + + /** + * Gets known PolicyStatesSummaryResourceType values. + * + * @return known PolicyStatesSummaryResourceType values. + */ + public static Collection values() { + return values(PolicyStatesSummaryResourceType.class); + } +} diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/PolicyTrackedResources.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/PolicyTrackedResources.java index 0740c8cea4e4..982903f5f461 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/PolicyTrackedResources.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/PolicyTrackedResources.java @@ -13,99 +13,133 @@ public interface PolicyTrackedResources { * Queries policy tracked resources under the management group. * * @param managementGroupName Management group name. + * @param policyTrackedResourcesResource The name of the virtual resource under PolicyTrackedResources resource + * type; only "default" is allowed. * @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 query results. + * @return query results as paginated response with {@link PagedIterable}. */ - PagedIterable listQueryResultsForManagementGroup(String managementGroupName); + PagedIterable listQueryResultsForManagementGroup( + String managementGroupName, PolicyTrackedResourcesResourceType policyTrackedResourcesResource); /** * Queries policy tracked resources under the management group. * * @param managementGroupName Management group name. + * @param policyTrackedResourcesResource The name of the virtual resource under PolicyTrackedResources resource + * type; only "default" is allowed. * @param top Maximum number of records to return. * @param filter OData filter expression. * @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 query results. + * @return query results as paginated response with {@link PagedIterable}. */ PagedIterable listQueryResultsForManagementGroup( - String managementGroupName, Integer top, String filter, Context context); + String managementGroupName, + PolicyTrackedResourcesResourceType policyTrackedResourcesResource, + Integer top, + String filter, + Context context); /** * Queries policy tracked resources under the subscription. * + * @param policyTrackedResourcesResource The name of the virtual resource under PolicyTrackedResources resource + * type; only "default" is allowed. + * @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 query results. + * @return query results as paginated response with {@link PagedIterable}. */ - PagedIterable listQueryResultsForSubscription(); + PagedIterable listQueryResultsForSubscription( + PolicyTrackedResourcesResourceType policyTrackedResourcesResource); /** * Queries policy tracked resources under the subscription. * + * @param policyTrackedResourcesResource The name of the virtual resource under PolicyTrackedResources resource + * type; only "default" is allowed. * @param top Maximum number of records to return. * @param filter OData filter expression. * @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 query results. + * @return query results as paginated response with {@link PagedIterable}. */ - PagedIterable listQueryResultsForSubscription(Integer top, String filter, Context context); + PagedIterable listQueryResultsForSubscription( + PolicyTrackedResourcesResourceType policyTrackedResourcesResource, Integer top, String filter, Context context); /** * Queries policy tracked resources under the resource group. * * @param resourceGroupName Resource group name. + * @param policyTrackedResourcesResource The name of the virtual resource under PolicyTrackedResources resource + * type; only "default" is allowed. * @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 query results. + * @return query results as paginated response with {@link PagedIterable}. */ - PagedIterable listQueryResultsForResourceGroup(String resourceGroupName); + PagedIterable listQueryResultsForResourceGroup( + String resourceGroupName, PolicyTrackedResourcesResourceType policyTrackedResourcesResource); /** * Queries policy tracked resources under the resource group. * * @param resourceGroupName Resource group name. + * @param policyTrackedResourcesResource The name of the virtual resource under PolicyTrackedResources resource + * type; only "default" is allowed. * @param top Maximum number of records to return. * @param filter OData filter expression. * @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 query results. + * @return query results as paginated response with {@link PagedIterable}. */ PagedIterable listQueryResultsForResourceGroup( - String resourceGroupName, Integer top, String filter, Context context); + String resourceGroupName, + PolicyTrackedResourcesResourceType policyTrackedResourcesResource, + Integer top, + String filter, + Context context); /** * Queries policy tracked resources under the resource. * * @param resourceId Resource ID. + * @param policyTrackedResourcesResource The name of the virtual resource under PolicyTrackedResources resource + * type; only "default" is allowed. * @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 query results. + * @return query results as paginated response with {@link PagedIterable}. */ - PagedIterable listQueryResultsForResource(String resourceId); + PagedIterable listQueryResultsForResource( + String resourceId, PolicyTrackedResourcesResourceType policyTrackedResourcesResource); /** * Queries policy tracked resources under the resource. * * @param resourceId Resource ID. + * @param policyTrackedResourcesResource The name of the virtual resource under PolicyTrackedResources resource + * type; only "default" is allowed. * @param top Maximum number of records to return. * @param filter OData filter expression. * @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 query results. + * @return query results as paginated response with {@link PagedIterable}. */ PagedIterable listQueryResultsForResource( - String resourceId, Integer top, String filter, Context context); + String resourceId, + PolicyTrackedResourcesResourceType policyTrackedResourcesResource, + Integer top, + String filter, + Context context); } diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/PolicyTrackedResourcesQueryResults.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/PolicyTrackedResourcesQueryResults.java index 5dda36550b4a..90cf0bb66748 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/PolicyTrackedResourcesQueryResults.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/PolicyTrackedResourcesQueryResults.java @@ -5,17 +5,13 @@ package com.azure.resourcemanager.policyinsights.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.policyinsights.fluent.models.PolicyTrackedResourceInner; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** Query results. */ @Immutable public final class PolicyTrackedResourcesQueryResults { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PolicyTrackedResourcesQueryResults.class); - /* * Query results. */ diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/PolicyTrackedResourcesResourceType.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/PolicyTrackedResourcesResourceType.java new file mode 100644 index 000000000000..b72f5ae00c92 --- /dev/null +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/PolicyTrackedResourcesResourceType.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.policyinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for PolicyTrackedResourcesResourceType. */ +public final class PolicyTrackedResourcesResourceType extends ExpandableStringEnum { + /** Static value default for PolicyTrackedResourcesResourceType. */ + public static final PolicyTrackedResourcesResourceType DEFAULT = fromString("default"); + + /** + * Creates or finds a PolicyTrackedResourcesResourceType from its string representation. + * + * @param name a name to look for. + * @return the corresponding PolicyTrackedResourcesResourceType. + */ + @JsonCreator + public static PolicyTrackedResourcesResourceType fromString(String name) { + return fromString(name, PolicyTrackedResourcesResourceType.class); + } + + /** + * Gets known PolicyTrackedResourcesResourceType values. + * + * @return known PolicyTrackedResourcesResourceType values. + */ + public static Collection values() { + return values(PolicyTrackedResourcesResourceType.class); + } +} diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/Remediation.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/Remediation.java index 14ea6273b82f..30b82291dbe0 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/Remediation.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/Remediation.java @@ -139,6 +139,13 @@ public interface Remediation { */ RemediationPropertiesFailureThreshold failureThreshold(); + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + /** * Gets the inner com.azure.resourcemanager.policyinsights.fluent.models.RemediationInner object. * @@ -415,7 +422,8 @@ interface WithFailureThreshold { * * @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 all deployments for a remediation at resource group scope. + * @return all deployments for a remediation at resource group scope as paginated response with {@link + * PagedIterable}. */ PagedIterable listDeploymentsAtResourceGroup(); @@ -427,7 +435,8 @@ interface WithFailureThreshold { * @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 all deployments for a remediation at resource group scope. + * @return all deployments for a remediation at resource group scope as paginated response with {@link + * PagedIterable}. */ PagedIterable listDeploymentsAtResourceGroup(Integer top, Context context); @@ -447,7 +456,7 @@ interface WithFailureThreshold { * @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 remediation definition. + * @return the remediation definition along with {@link Response}. */ Response cancelAtResourceGroupWithResponse(Context context); } diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/RemediationDeploymentSummary.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/RemediationDeploymentSummary.java index 1f6744557b8a..1843d50aff35 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/RemediationDeploymentSummary.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/RemediationDeploymentSummary.java @@ -5,15 +5,11 @@ package com.azure.resourcemanager.policyinsights.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** The deployment status summary for all deployments created by the remediation. */ @Immutable public final class RemediationDeploymentSummary { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RemediationDeploymentSummary.class); - /* * The number of deployments required by the remediation. */ @@ -21,8 +17,7 @@ public final class RemediationDeploymentSummary { private Integer totalDeployments; /* - * The number of deployments required by the remediation that have - * succeeded. + * The number of deployments required by the remediation that have succeeded. */ @JsonProperty(value = "successfulDeployments", access = JsonProperty.Access.WRITE_ONLY) private Integer successfulDeployments; diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/RemediationDeploymentsListResult.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/RemediationDeploymentsListResult.java index 52cbdd04c24a..ff12693dc2b6 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/RemediationDeploymentsListResult.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/RemediationDeploymentsListResult.java @@ -5,17 +5,13 @@ package com.azure.resourcemanager.policyinsights.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.policyinsights.fluent.models.RemediationDeploymentInner; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** List of deployments for a remediation. */ @Immutable public final class RemediationDeploymentsListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RemediationDeploymentsListResult.class); - /* * Array of deployments for the remediation. */ diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/RemediationFilters.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/RemediationFilters.java index 0db5215ee432..4d0a366fb23e 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/RemediationFilters.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/RemediationFilters.java @@ -5,16 +5,12 @@ package com.azure.resourcemanager.policyinsights.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** The filters that will be applied to determine which resources to remediate. */ @Fluent public final class RemediationFilters { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RemediationFilters.class); - /* * The resource locations that will be remediated. */ diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/RemediationListResult.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/RemediationListResult.java index 2b742f9bb6af..8ed8b883480c 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/RemediationListResult.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/RemediationListResult.java @@ -5,17 +5,13 @@ package com.azure.resourcemanager.policyinsights.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.policyinsights.fluent.models.RemediationInner; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** List of remediations. */ @Immutable public final class RemediationListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RemediationListResult.class); - /* * Array of remediation definitions. */ diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/RemediationPropertiesFailureThreshold.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/RemediationPropertiesFailureThreshold.java index 4c64f6d798a8..f2ba2cf882b5 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/RemediationPropertiesFailureThreshold.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/RemediationPropertiesFailureThreshold.java @@ -5,19 +5,14 @@ package com.azure.resourcemanager.policyinsights.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** The remediation failure threshold settings. */ @Fluent public final class RemediationPropertiesFailureThreshold { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RemediationPropertiesFailureThreshold.class); - /* - * A number between 0.0 to 1.0 representing the percentage failure - * threshold. The remediation will fail if the percentage of failed - * remediation operations (i.e. failed deployments) exceeds this threshold. + * A number between 0.0 to 1.0 representing the percentage failure threshold. The remediation will fail if the + * percentage of failed remediation operations (i.e. failed deployments) exceeds this threshold. */ @JsonProperty(value = "percentage") private Float percentage; diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/Remediations.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/Remediations.java index 5054e4f5312b..1ce65706bf3d 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/Remediations.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/Remediations.java @@ -19,7 +19,8 @@ public interface Remediations { * @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 all deployments for a remediation at management group scope. + * @return all deployments for a remediation at management group scope as paginated response with {@link + * PagedIterable}. */ PagedIterable listDeploymentsAtManagementGroup( String managementGroupId, String remediationName); @@ -34,7 +35,8 @@ PagedIterable listDeploymentsAtManagementGroup( * @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 all deployments for a remediation at management group scope. + * @return all deployments for a remediation at management group scope as paginated response with {@link + * PagedIterable}. */ PagedIterable listDeploymentsAtManagementGroup( String managementGroupId, String remediationName, Integer top, Context context); @@ -60,7 +62,7 @@ PagedIterable listDeploymentsAtManagementGroup( * @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 remediation definition. + * @return the remediation definition along with {@link Response}. */ Response cancelAtManagementGroupWithResponse( String managementGroupId, String remediationName, Context context); @@ -72,7 +74,7 @@ Response cancelAtManagementGroupWithResponse( * @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 all remediations for the management group. + * @return all remediations for the management group as paginated response with {@link PagedIterable}. */ PagedIterable listForManagementGroup(String managementGroupId); @@ -86,7 +88,7 @@ Response cancelAtManagementGroupWithResponse( * @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 all remediations for the management group. + * @return all remediations for the management group as paginated response with {@link PagedIterable}. */ PagedIterable listForManagementGroup( String managementGroupId, Integer top, String filter, Context context); @@ -115,7 +117,7 @@ Remediation createOrUpdateAtManagementGroup( * @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 remediation definition. + * @return the remediation definition along with {@link Response}. */ Response createOrUpdateAtManagementGroupWithResponse( String managementGroupId, String remediationName, RemediationInner parameters, Context context); @@ -141,7 +143,7 @@ Response createOrUpdateAtManagementGroupWithResponse( * @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 an existing remediation at management group scope. + * @return an existing remediation at management group scope along with {@link Response}. */ Response getAtManagementGroupWithResponse( String managementGroupId, String remediationName, Context context); @@ -167,7 +169,7 @@ Response getAtManagementGroupWithResponse( * @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 remediation definition. + * @return the remediation definition along with {@link Response}. */ Response deleteAtManagementGroupWithResponse( String managementGroupId, String remediationName, Context context); @@ -179,7 +181,7 @@ Response deleteAtManagementGroupWithResponse( * @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 all deployments for a remediation at subscription scope. + * @return all deployments for a remediation at subscription scope as paginated response with {@link PagedIterable}. */ PagedIterable listDeploymentsAtSubscription(String remediationName); @@ -192,7 +194,7 @@ Response deleteAtManagementGroupWithResponse( * @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 all deployments for a remediation at subscription scope. + * @return all deployments for a remediation at subscription scope as paginated response with {@link PagedIterable}. */ PagedIterable listDeploymentsAtSubscription( String remediationName, Integer top, Context context); @@ -216,7 +218,7 @@ PagedIterable listDeploymentsAtSubscription( * @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 remediation definition. + * @return the remediation definition along with {@link Response}. */ Response cancelAtSubscriptionWithResponse(String remediationName, Context context); @@ -225,7 +227,7 @@ PagedIterable listDeploymentsAtSubscription( * * @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 all remediations for the subscription. + * @return all remediations for the subscription as paginated response with {@link PagedIterable}. */ PagedIterable list(); @@ -238,7 +240,7 @@ PagedIterable listDeploymentsAtSubscription( * @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 all remediations for the subscription. + * @return all remediations for the subscription as paginated response with {@link PagedIterable}. */ PagedIterable list(Integer top, String filter, Context context); @@ -263,7 +265,7 @@ PagedIterable listDeploymentsAtSubscription( * @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 remediation definition. + * @return the remediation definition along with {@link Response}. */ Response createOrUpdateAtSubscriptionWithResponse( String remediationName, RemediationInner parameters, Context context); @@ -287,7 +289,7 @@ Response createOrUpdateAtSubscriptionWithResponse( * @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 an existing remediation at subscription scope. + * @return an existing remediation at subscription scope along with {@link Response}. */ Response getAtSubscriptionWithResponse(String remediationName, Context context); @@ -310,7 +312,7 @@ Response createOrUpdateAtSubscriptionWithResponse( * @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 remediation definition. + * @return the remediation definition along with {@link Response}. */ Response deleteAtSubscriptionWithResponse(String remediationName, Context context); @@ -322,7 +324,8 @@ Response createOrUpdateAtSubscriptionWithResponse( * @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 all deployments for a remediation at resource group scope. + * @return all deployments for a remediation at resource group scope as paginated response with {@link + * PagedIterable}. */ PagedIterable listDeploymentsAtResourceGroup( String resourceGroupName, String remediationName); @@ -337,7 +340,8 @@ PagedIterable listDeploymentsAtResourceGroup( * @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 all deployments for a remediation at resource group scope. + * @return all deployments for a remediation at resource group scope as paginated response with {@link + * PagedIterable}. */ PagedIterable listDeploymentsAtResourceGroup( String resourceGroupName, String remediationName, Integer top, Context context); @@ -363,7 +367,7 @@ PagedIterable listDeploymentsAtResourceGroup( * @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 remediation definition. + * @return the remediation definition along with {@link Response}. */ Response cancelAtResourceGroupWithResponse( String resourceGroupName, String remediationName, Context context); @@ -375,7 +379,7 @@ Response cancelAtResourceGroupWithResponse( * @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 all remediations for the subscription. + * @return all remediations for the subscription as paginated response with {@link PagedIterable}. */ PagedIterable listByResourceGroup(String resourceGroupName); @@ -389,7 +393,7 @@ Response cancelAtResourceGroupWithResponse( * @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 all remediations for the subscription. + * @return all remediations for the subscription as paginated response with {@link PagedIterable}. */ PagedIterable listByResourceGroup( String resourceGroupName, Integer top, String filter, Context context); @@ -415,7 +419,7 @@ PagedIterable listByResourceGroup( * @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 an existing remediation at resource group scope. + * @return an existing remediation at resource group scope along with {@link Response}. */ Response getByResourceGroupWithResponse( String resourceGroupName, String remediationName, Context context); @@ -441,7 +445,7 @@ Response getByResourceGroupWithResponse( * @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 remediation definition. + * @return the remediation definition along with {@link Response}. */ Response deleteWithResponse(String resourceGroupName, String remediationName, Context context); @@ -453,7 +457,7 @@ Response getByResourceGroupWithResponse( * @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 all deployments for a remediation at resource scope. + * @return all deployments for a remediation at resource scope as paginated response with {@link PagedIterable}. */ PagedIterable listDeploymentsAtResource(String resourceId, String remediationName); @@ -467,7 +471,7 @@ Response getByResourceGroupWithResponse( * @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 all deployments for a remediation at resource scope. + * @return all deployments for a remediation at resource scope as paginated response with {@link PagedIterable}. */ PagedIterable listDeploymentsAtResource( String resourceId, String remediationName, Integer top, Context context); @@ -493,7 +497,7 @@ PagedIterable listDeploymentsAtResource( * @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 remediation definition. + * @return the remediation definition along with {@link Response}. */ Response cancelAtResourceWithResponse(String resourceId, String remediationName, Context context); @@ -504,7 +508,7 @@ PagedIterable listDeploymentsAtResource( * @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 all remediations for a resource. + * @return all remediations for a resource as paginated response with {@link PagedIterable}. */ PagedIterable listForResource(String resourceId); @@ -518,7 +522,7 @@ PagedIterable listDeploymentsAtResource( * @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 all remediations for a resource. + * @return all remediations for a resource as paginated response with {@link PagedIterable}. */ PagedIterable listForResource(String resourceId, Integer top, String filter, Context context); @@ -545,7 +549,7 @@ PagedIterable listDeploymentsAtResource( * @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 remediation definition. + * @return the remediation definition along with {@link Response}. */ Response createOrUpdateAtResourceWithResponse( String resourceId, String remediationName, RemediationInner parameters, Context context); @@ -571,7 +575,7 @@ Response createOrUpdateAtResourceWithResponse( * @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 an existing remediation at resource scope. + * @return an existing remediation at resource scope along with {@link Response}. */ Response getAtResourceWithResponse(String resourceId, String remediationName, Context context); @@ -596,7 +600,7 @@ Response createOrUpdateAtResourceWithResponse( * @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 remediation definition. + * @return the remediation definition along with {@link Response}. */ Response deleteAtResourceWithResponse(String resourceId, String remediationName, Context context); @@ -607,7 +611,7 @@ Response createOrUpdateAtResourceWithResponse( * @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 an existing remediation at resource group scope. + * @return an existing remediation at resource group scope along with {@link Response}. */ Remediation getById(String id); @@ -619,7 +623,7 @@ Response createOrUpdateAtResourceWithResponse( * @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 an existing remediation at resource group scope. + * @return an existing remediation at resource group scope along with {@link Response}. */ Response getByIdWithResponse(String id, Context context); @@ -630,7 +634,7 @@ Response createOrUpdateAtResourceWithResponse( * @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 remediation definition. + * @return the remediation definition along with {@link Response}. */ Remediation deleteById(String id); @@ -642,7 +646,7 @@ Response createOrUpdateAtResourceWithResponse( * @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 remediation definition. + * @return the remediation definition along with {@link Response}. */ Response deleteByIdWithResponse(String id, Context context); diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/ResourceDiscoveryMode.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/ResourceDiscoveryMode.java index 540cf1456dcb..4c5165a357bd 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/ResourceDiscoveryMode.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/ResourceDiscoveryMode.java @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for ResourceDiscoveryMode. */ +/** The way resources to remediate are discovered. Defaults to ExistingNonCompliant if not specified. */ public final class ResourceDiscoveryMode extends ExpandableStringEnum { /** Static value ExistingNonCompliant for ResourceDiscoveryMode. */ public static final ResourceDiscoveryMode EXISTING_NON_COMPLIANT = fromString("ExistingNonCompliant"); @@ -27,7 +27,11 @@ public static ResourceDiscoveryMode fromString(String name) { return fromString(name, ResourceDiscoveryMode.class); } - /** @return known ResourceDiscoveryMode values. */ + /** + * Gets known ResourceDiscoveryMode values. + * + * @return known ResourceDiscoveryMode values. + */ public static Collection values() { return values(ResourceDiscoveryMode.class); } diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/Summary.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/Summary.java index c1145ff9e2df..390a912bfe10 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/Summary.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/Summary.java @@ -5,26 +5,20 @@ package com.azure.resourcemanager.policyinsights.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** Summary results. */ @Fluent public final class Summary { - @JsonIgnore private final ClientLogger logger = new ClientLogger(Summary.class); - /* - * OData entity ID; always set to null since summaries do not have an - * entity ID. + * OData entity ID; always set to null since summaries do not have an entity ID. */ @JsonProperty(value = "@odata.id") private String odataId; /* - * OData context string; used by OData clients to resolve type information - * based on metadata. + * OData context string; used by OData clients to resolve type information based on metadata. */ @JsonProperty(value = "@odata.context") private String odataContext; diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/SummaryResults.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/SummaryResults.java index 10914420d896..3b3297e9eceb 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/SummaryResults.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/SummaryResults.java @@ -5,21 +5,15 @@ package com.azure.resourcemanager.policyinsights.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** Compliance summary on a particular summary level. */ @Fluent public final class SummaryResults { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SummaryResults.class); - /* - * HTTP POST URI for queryResults action on Microsoft.PolicyInsights to - * retrieve raw results for the compliance summary. This property will not - * be available by default in future API versions, but could be queried - * explicitly. + * HTTP POST URI for queryResults action on Microsoft.PolicyInsights to retrieve raw results for the compliance + * summary. This property will not be available by default in future API versions, but could be queried explicitly. */ @JsonProperty(value = "queryResultsUri") private String queryResultsUri; @@ -43,9 +37,8 @@ public final class SummaryResults { private List resourceDetails; /* - * The policy artifact summary at this level. For query scope level, it - * represents policy assignment summary. For policy assignment level, it - * represents policy definitions summary. + * The policy artifact summary at this level. For query scope level, it represents policy assignment summary. For + * policy assignment level, it represents policy definitions summary. */ @JsonProperty(value = "policyDetails") private List policyDetails; diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/TrackedResourceModificationDetails.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/TrackedResourceModificationDetails.java index e5b60fa8260b..82b23c1f9277 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/TrackedResourceModificationDetails.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/models/TrackedResourceModificationDetails.java @@ -5,16 +5,12 @@ package com.azure.resourcemanager.policyinsights.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; /** The details of the policy triggered deployment that created or modified the tracked resource. */ @Immutable public final class TrackedResourceModificationDetails { - @JsonIgnore private final ClientLogger logger = new ClientLogger(TrackedResourceModificationDetails.class); - /* * The details of the policy that created or modified the tracked resource. */ @@ -28,8 +24,7 @@ public final class TrackedResourceModificationDetails { private String deploymentId; /* - * Timestamp of the deployment that created or modified the tracked - * resource. + * Timestamp of the deployment that created or modified the tracked resource. */ @JsonProperty(value = "deploymentTime", access = JsonProperty.Access.WRITE_ONLY) private OffsetDateTime deploymentTime; diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/AttestationsCreateOrUpdateAtResourceGroupSamples.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/AttestationsCreateOrUpdateAtResourceGroupSamples.java index bb01c09ca854..d120afcc9943 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/AttestationsCreateOrUpdateAtResourceGroupSamples.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/AttestationsCreateOrUpdateAtResourceGroupSamples.java @@ -4,15 +4,18 @@ package com.azure.resourcemanager.policyinsights.generated; +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; import com.azure.resourcemanager.policyinsights.models.AttestationEvidence; import com.azure.resourcemanager.policyinsights.models.ComplianceState; +import java.io.IOException; import java.time.OffsetDateTime; import java.util.Arrays; /** Samples for Attestations CreateOrUpdateAtResourceGroup. */ public final class AttestationsCreateOrUpdateAtResourceGroupSamples { /* - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_CreateResourceGroupScope.json + * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-09-01/examples/Attestations_CreateResourceGroupScope.json */ /** * Sample code: Create attestation at resource group scope. @@ -20,7 +23,7 @@ public final class AttestationsCreateOrUpdateAtResourceGroupSamples { * @param manager Entry point to PolicyInsightsManager. */ public static void createAttestationAtResourceGroupScope( - com.azure.resourcemanager.policyinsights.PolicyInsightsManager manager) { + com.azure.resourcemanager.policyinsights.PolicyInsightsManager manager) throws IOException { manager .attestations() .define("790996e6-9871-4b1f-9cd9-ec42cd6ced1e") @@ -38,6 +41,11 @@ public static void createAttestationAtResourceGroupScope( new AttestationEvidence() .withDescription("The results of the security audit.") .withSourceUri("https://gist.github.com/contoso/9573e238762c60166c090ae16b814011"))) + .withAssessmentDate(OffsetDateTime.parse("2021-06-10T00:00:00Z")) + .withMetadata( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize("{\"departmentId\":\"NYC-MARKETING-1\"}", Object.class, SerializerEncoding.JSON)) .create(); } } diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/AttestationsCreateOrUpdateAtResourceSamples.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/AttestationsCreateOrUpdateAtResourceSamples.java index 27c90bcf92bd..98e2df9bf5c6 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/AttestationsCreateOrUpdateAtResourceSamples.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/AttestationsCreateOrUpdateAtResourceSamples.java @@ -4,17 +4,20 @@ package com.azure.resourcemanager.policyinsights.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.policyinsights.fluent.models.AttestationInner; import com.azure.resourcemanager.policyinsights.models.AttestationEvidence; import com.azure.resourcemanager.policyinsights.models.ComplianceState; +import java.io.IOException; import java.time.OffsetDateTime; import java.util.Arrays; /** Samples for Attestations CreateOrUpdateAtResource. */ public final class AttestationsCreateOrUpdateAtResourceSamples { /* - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_CreateResourceScope.json + * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-09-01/examples/Attestations_CreateResourceScope.json */ /** * Sample code: Create attestation at individual resource scope. @@ -22,7 +25,7 @@ public final class AttestationsCreateOrUpdateAtResourceSamples { * @param manager Entry point to PolicyInsightsManager. */ public static void createAttestationAtIndividualResourceScope( - com.azure.resourcemanager.policyinsights.PolicyInsightsManager manager) { + com.azure.resourcemanager.policyinsights.PolicyInsightsManager manager) throws IOException { manager .attestations() .createOrUpdateAtResource( @@ -41,8 +44,13 @@ public static void createAttestationAtIndividualResourceScope( .asList( new AttestationEvidence() .withDescription("The results of the security audit.") - .withSourceUri( - "https://gist.github.com/contoso/9573e238762c60166c090ae16b814011"))), + .withSourceUri("https://gist.github.com/contoso/9573e238762c60166c090ae16b814011"))) + .withAssessmentDate(OffsetDateTime.parse("2021-06-10T00:00:00Z")) + .withMetadata( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize( + "{\"departmentId\":\"NYC-MARKETING-1\"}", Object.class, SerializerEncoding.JSON)), Context.NONE); } } diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/AttestationsCreateOrUpdateAtSubscriptionSamples.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/AttestationsCreateOrUpdateAtSubscriptionSamples.java index 30f08f4ea19e..16673863eb32 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/AttestationsCreateOrUpdateAtSubscriptionSamples.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/AttestationsCreateOrUpdateAtSubscriptionSamples.java @@ -4,17 +4,20 @@ package com.azure.resourcemanager.policyinsights.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.policyinsights.fluent.models.AttestationInner; import com.azure.resourcemanager.policyinsights.models.AttestationEvidence; import com.azure.resourcemanager.policyinsights.models.ComplianceState; +import java.io.IOException; import java.time.OffsetDateTime; import java.util.Arrays; /** Samples for Attestations CreateOrUpdateAtSubscription. */ public final class AttestationsCreateOrUpdateAtSubscriptionSamples { /* - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_CreateSubscriptionScope.json + * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-09-01/examples/Attestations_CreateSubscriptionScope.json */ /** * Sample code: Create attestation at subscription scope. @@ -35,7 +38,7 @@ public static void createAttestationAtSubscriptionScope( } /* - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_CreateSubscriptionScope_AllProperties.json + * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-09-01/examples/Attestations_CreateSubscriptionScope_AllProperties.json */ /** * Sample code: Create attestation at subscription scope with all properties. @@ -43,7 +46,7 @@ public static void createAttestationAtSubscriptionScope( * @param manager Entry point to PolicyInsightsManager. */ public static void createAttestationAtSubscriptionScopeWithAllProperties( - com.azure.resourcemanager.policyinsights.PolicyInsightsManager manager) { + com.azure.resourcemanager.policyinsights.PolicyInsightsManager manager) throws IOException { manager .attestations() .createOrUpdateAtSubscription( @@ -61,8 +64,13 @@ public static void createAttestationAtSubscriptionScopeWithAllProperties( .asList( new AttestationEvidence() .withDescription("The results of the security audit.") - .withSourceUri( - "https://gist.github.com/contoso/9573e238762c60166c090ae16b814011"))), + .withSourceUri("https://gist.github.com/contoso/9573e238762c60166c090ae16b814011"))) + .withAssessmentDate(OffsetDateTime.parse("2021-06-10T00:00:00Z")) + .withMetadata( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize( + "{\"departmentId\":\"NYC-MARKETING-1\"}", Object.class, SerializerEncoding.JSON)), Context.NONE); } } diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/AttestationsDeleteAtResourceSamples.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/AttestationsDeleteAtResourceSamples.java index 1107cd478613..867cde2185e1 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/AttestationsDeleteAtResourceSamples.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/AttestationsDeleteAtResourceSamples.java @@ -9,7 +9,7 @@ /** Samples for Attestations DeleteAtResource. */ public final class AttestationsDeleteAtResourceSamples { /* - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_DeleteResourceScope.json + * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-09-01/examples/Attestations_DeleteResourceScope.json */ /** * Sample code: Delete attestation at individual resource scope. diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/AttestationsDeleteAtSubscriptionSamples.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/AttestationsDeleteAtSubscriptionSamples.java index c87523eb85b5..aadc4930874c 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/AttestationsDeleteAtSubscriptionSamples.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/AttestationsDeleteAtSubscriptionSamples.java @@ -9,7 +9,7 @@ /** Samples for Attestations DeleteAtSubscription. */ public final class AttestationsDeleteAtSubscriptionSamples { /* - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_DeleteSubscriptionScope.json + * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-09-01/examples/Attestations_DeleteSubscriptionScope.json */ /** * Sample code: Delete attestation at subscription scope. diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/AttestationsDeleteSamples.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/AttestationsDeleteSamples.java index 4d84d9811911..da1cbdfa18f5 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/AttestationsDeleteSamples.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/AttestationsDeleteSamples.java @@ -9,7 +9,7 @@ /** Samples for Attestations Delete. */ public final class AttestationsDeleteSamples { /* - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_DeleteResourceGroupScope.json + * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-09-01/examples/Attestations_DeleteResourceGroupScope.json */ /** * Sample code: Delete attestation at resource group scope. diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/AttestationsGetAtResourceSamples.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/AttestationsGetAtResourceSamples.java index 894d95cb393d..63cce34c1ca1 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/AttestationsGetAtResourceSamples.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/AttestationsGetAtResourceSamples.java @@ -9,7 +9,7 @@ /** Samples for Attestations GetAtResource. */ public final class AttestationsGetAtResourceSamples { /* - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_GetResourceScope.json + * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-09-01/examples/Attestations_GetResourceScope.json */ /** * Sample code: Get attestation at individual resource scope. diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/AttestationsGetAtSubscriptionSamples.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/AttestationsGetAtSubscriptionSamples.java index 3fee411d5392..b080b571b694 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/AttestationsGetAtSubscriptionSamples.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/AttestationsGetAtSubscriptionSamples.java @@ -9,7 +9,7 @@ /** Samples for Attestations GetAtSubscription. */ public final class AttestationsGetAtSubscriptionSamples { /* - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_GetSubscriptionScope.json + * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-09-01/examples/Attestations_GetSubscriptionScope.json */ /** * Sample code: Get attestation at subscription scope. diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/AttestationsGetByResourceGroupSamples.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/AttestationsGetByResourceGroupSamples.java index 5b19dd6e2542..7d932463297a 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/AttestationsGetByResourceGroupSamples.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/AttestationsGetByResourceGroupSamples.java @@ -9,7 +9,7 @@ /** Samples for Attestations GetByResourceGroup. */ public final class AttestationsGetByResourceGroupSamples { /* - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_GetResourceGroupScope.json + * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-09-01/examples/Attestations_GetResourceGroupScope.json */ /** * Sample code: Get attestation at resource group scope. diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/AttestationsListByResourceGroupSamples.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/AttestationsListByResourceGroupSamples.java index f3d713d16781..0041640c7088 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/AttestationsListByResourceGroupSamples.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/AttestationsListByResourceGroupSamples.java @@ -9,7 +9,7 @@ /** Samples for Attestations ListByResourceGroup. */ public final class AttestationsListByResourceGroupSamples { /* - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_ListResourceGroupScope_WithQuery.json + * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-09-01/examples/Attestations_ListResourceGroupScope_WithQuery.json */ /** * Sample code: List attestations at resource group scope with query parameters. @@ -30,7 +30,7 @@ public static void listAttestationsAtResourceGroupScopeWithQueryParameters( } /* - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_ListResourceGroupScope.json + * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-09-01/examples/Attestations_ListResourceGroupScope.json */ /** * Sample code: List attestations at resource group scope. diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/AttestationsListForResourceSamples.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/AttestationsListForResourceSamples.java index 8459563fb689..ffe55115a0e9 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/AttestationsListForResourceSamples.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/AttestationsListForResourceSamples.java @@ -9,7 +9,7 @@ /** Samples for Attestations ListForResource. */ public final class AttestationsListForResourceSamples { /* - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_ListResourceScope_WithQuery.json + * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-09-01/examples/Attestations_ListResourceScope_WithQuery.json */ /** * Sample code: List attestations at individual resource scope with query parameters. @@ -30,7 +30,7 @@ public static void listAttestationsAtIndividualResourceScopeWithQueryParameters( } /* - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_ListResourceScope.json + * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-09-01/examples/Attestations_ListResourceScope.json */ /** * Sample code: List attestations at individual resource scope. diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/AttestationsListSamples.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/AttestationsListSamples.java index 6dee39087f16..757f34c33b8e 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/AttestationsListSamples.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/AttestationsListSamples.java @@ -9,7 +9,7 @@ /** Samples for Attestations List. */ public final class AttestationsListSamples { /* - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_ListSubscriptionScope.json + * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-09-01/examples/Attestations_ListSubscriptionScope.json */ /** * Sample code: List attestations at subscription scope. @@ -22,7 +22,7 @@ public static void listAttestationsAtSubscriptionScope( } /* - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-01-01/examples/Attestations_ListSubscriptionScope_WithQuery.json + * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-09-01/examples/Attestations_ListSubscriptionScope_WithQuery.json */ /** * Sample code: List attestations at subscription scope with query parameters. diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/PolicyEventsListQueryResultsForManagementGroupSamples.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/PolicyEventsListQueryResultsForManagementGroupSamples.java index 830851bce11a..389d6482fb91 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/PolicyEventsListQueryResultsForManagementGroupSamples.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/PolicyEventsListQueryResultsForManagementGroupSamples.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.policyinsights.generated; import com.azure.core.util.Context; +import com.azure.resourcemanager.policyinsights.models.PolicyEventsResourceType; /** Samples for PolicyEvents ListQueryResultsForManagementGroup. */ public final class PolicyEventsListQueryResultsForManagementGroupSamples { @@ -21,7 +22,17 @@ public static void queryAtManagementGroupScopeWithNextLink( manager .policyEvents() .listQueryResultsForManagementGroup( - "myManagementGroup", null, null, null, null, null, null, null, "WpmWfBSvPhkAK6QD", Context.NONE); + PolicyEventsResourceType.DEFAULT, + "myManagementGroup", + null, + null, + null, + null, + null, + null, + null, + "WpmWfBSvPhkAK6QD", + Context.NONE); } /* @@ -37,6 +48,16 @@ public static void queryAtManagementGroupScope( manager .policyEvents() .listQueryResultsForManagementGroup( - "myManagementGroup", null, null, null, null, null, null, null, null, Context.NONE); + PolicyEventsResourceType.DEFAULT, + "myManagementGroup", + null, + null, + null, + null, + null, + null, + null, + null, + Context.NONE); } } diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/PolicyEventsListQueryResultsForPolicyDefinitionSamples.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/PolicyEventsListQueryResultsForPolicyDefinitionSamples.java index eea88259465a..fbfccd233a4a 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/PolicyEventsListQueryResultsForPolicyDefinitionSamples.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/PolicyEventsListQueryResultsForPolicyDefinitionSamples.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.policyinsights.generated; import com.azure.core.util.Context; +import com.azure.resourcemanager.policyinsights.models.PolicyEventsResourceType; /** Samples for PolicyEvents ListQueryResultsForPolicyDefinition. */ public final class PolicyEventsListQueryResultsForPolicyDefinitionSamples { @@ -21,6 +22,7 @@ public static void queryAtSubscriptionLevelPolicyDefinitionScope( manager .policyEvents() .listQueryResultsForPolicyDefinition( + PolicyEventsResourceType.DEFAULT, "fffedd8f-ffff-fffd-fffd-fffed2f84852", "24813039-7534-408a-9842-eb99f45721b1", null, @@ -47,6 +49,7 @@ public static void queryAtSubscriptionLevelPolicyDefinitionScopeWithNextLink( manager .policyEvents() .listQueryResultsForPolicyDefinition( + PolicyEventsResourceType.DEFAULT, "fffedd8f-ffff-fffd-fffd-fffed2f84852", "24813039-7534-408a-9842-eb99f45721b1", null, diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/PolicyEventsListQueryResultsForPolicySetDefinitionSamples.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/PolicyEventsListQueryResultsForPolicySetDefinitionSamples.java index 276529e421f8..9c517f246ae4 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/PolicyEventsListQueryResultsForPolicySetDefinitionSamples.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/PolicyEventsListQueryResultsForPolicySetDefinitionSamples.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.policyinsights.generated; import com.azure.core.util.Context; +import com.azure.resourcemanager.policyinsights.models.PolicyEventsResourceType; /** Samples for PolicyEvents ListQueryResultsForPolicySetDefinition. */ public final class PolicyEventsListQueryResultsForPolicySetDefinitionSamples { @@ -21,6 +22,7 @@ public static void queryAtSubscriptionLevelPolicySetDefinitionScope( manager .policyEvents() .listQueryResultsForPolicySetDefinition( + PolicyEventsResourceType.DEFAULT, "fffedd8f-ffff-fffd-fffd-fffed2f84852", "3e3807c1-65c9-49e0-a406-82d8ae3e338c", null, @@ -47,6 +49,7 @@ public static void queryAtSubscriptionLevelPolicySetDefinitionScopeWithNextLink( manager .policyEvents() .listQueryResultsForPolicySetDefinition( + PolicyEventsResourceType.DEFAULT, "fffedd8f-ffff-fffd-fffd-fffed2f84852", "3e3807c1-65c9-49e0-a406-82d8ae3e338c", null, diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/PolicyEventsListQueryResultsForResourceGroupLevelPolicyAssignmentSamples.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/PolicyEventsListQueryResultsForResourceGroupLevelPolicyAssignmentSamples.java index 8a164439b529..a639f4253e2c 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/PolicyEventsListQueryResultsForResourceGroupLevelPolicyAssignmentSamples.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/PolicyEventsListQueryResultsForResourceGroupLevelPolicyAssignmentSamples.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.policyinsights.generated; import com.azure.core.util.Context; +import com.azure.resourcemanager.policyinsights.models.PolicyEventsResourceType; /** Samples for PolicyEvents ListQueryResultsForResourceGroupLevelPolicyAssignment. */ public final class PolicyEventsListQueryResultsForResourceGroupLevelPolicyAssignmentSamples { @@ -21,6 +22,7 @@ public static void queryAtResourceGroupLevelPolicyAssignmentScope( manager .policyEvents() .listQueryResultsForResourceGroupLevelPolicyAssignment( + PolicyEventsResourceType.DEFAULT, "fffedd8f-ffff-fffd-fffd-fffed2f84852", "myResourceGroup", "myPolicyAssignment", @@ -48,6 +50,7 @@ public static void queryAtResourceGroupLevelPolicyAssignmentScopeWithNextLink( manager .policyEvents() .listQueryResultsForResourceGroupLevelPolicyAssignment( + PolicyEventsResourceType.DEFAULT, "fffedd8f-ffff-fffd-fffd-fffed2f84852", "myResourceGroup", "myPolicyAssignment", diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/PolicyEventsListQueryResultsForResourceGroupSamples.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/PolicyEventsListQueryResultsForResourceGroupSamples.java index e501d26d55a3..05125bde73a0 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/PolicyEventsListQueryResultsForResourceGroupSamples.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/PolicyEventsListQueryResultsForResourceGroupSamples.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.policyinsights.generated; import com.azure.core.util.Context; +import com.azure.resourcemanager.policyinsights.models.PolicyEventsResourceType; /** Samples for PolicyEvents ListQueryResultsForResourceGroup. */ public final class PolicyEventsListQueryResultsForResourceGroupSamples { @@ -21,6 +22,7 @@ public static void queryAtResourceGroupScope( manager .policyEvents() .listQueryResultsForResourceGroup( + PolicyEventsResourceType.DEFAULT, "fffedd8f-ffff-fffd-fffd-fffed2f84852", "myResourceGroup", null, @@ -47,6 +49,7 @@ public static void queryAtResourceGroupScopeWithNextLink( manager .policyEvents() .listQueryResultsForResourceGroup( + PolicyEventsResourceType.DEFAULT, "fffedd8f-ffff-fffd-fffd-fffed2f84852", "myResourceGroup", null, diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/PolicyEventsListQueryResultsForResourceSamples.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/PolicyEventsListQueryResultsForResourceSamples.java index d24c61f0cd5d..bbaa24575634 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/PolicyEventsListQueryResultsForResourceSamples.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/PolicyEventsListQueryResultsForResourceSamples.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.policyinsights.generated; import com.azure.core.util.Context; +import com.azure.resourcemanager.policyinsights.models.PolicyEventsResourceType; /** Samples for PolicyEvents ListQueryResultsForResource. */ public final class PolicyEventsListQueryResultsForResourceSamples { @@ -21,6 +22,7 @@ public static void queryAtSubscriptionLevelResourceScope( manager .policyEvents() .listQueryResultsForResource( + PolicyEventsResourceType.DEFAULT, "subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.SomeNamespace/someResourceType/someResourceName", null, null, @@ -47,6 +49,7 @@ public static void queryAtNestedResourceScope( manager .policyEvents() .listQueryResultsForResource( + PolicyEventsResourceType.DEFAULT, "subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.ServiceFabric/clusters/myCluster/applications/myApplication", null, null, @@ -73,6 +76,7 @@ public static void queryAtSubscriptionLevelNestedResourceScope( manager .policyEvents() .listQueryResultsForResource( + PolicyEventsResourceType.DEFAULT, "subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/providers/Microsoft.SomeNamespace/someResourceType/someResource/someNestedResourceType/someNestedResource", null, null, @@ -98,6 +102,7 @@ public static void queryAtResourceScope(com.azure.resourcemanager.policyinsights manager .policyEvents() .listQueryResultsForResource( + PolicyEventsResourceType.DEFAULT, "subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.ClassicCompute/domainNames/myDomainName", null, null, @@ -124,6 +129,7 @@ public static void queryComponentsPolicyEventsForResourceScopeFilteredByGivenAss manager .policyEvents() .listQueryResultsForResource( + PolicyEventsResourceType.DEFAULT, "subscriptions/e78961ba-36fe-4739-9212-e3031b4c8db7/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/Vaults/myKVName", null, null, @@ -153,6 +159,7 @@ public static void queryComponentsPolicyEventsForResourceScopeFilteredByGivenAss manager .policyEvents() .listQueryResultsForResource( + PolicyEventsResourceType.DEFAULT, "subscriptions/e78961ba-36fe-4739-9212-e3031b4c8db7/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/Vaults/myKVName", null, null, @@ -181,6 +188,7 @@ public static void queryAtResourceScopeWithNextLink( manager .policyEvents() .listQueryResultsForResource( + PolicyEventsResourceType.DEFAULT, "subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.ClassicCompute/domainNames/myDomainName", null, null, diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/PolicyEventsListQueryResultsForSubscriptionLevelPolicyAssignmentSamples.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/PolicyEventsListQueryResultsForSubscriptionLevelPolicyAssignmentSamples.java index b41f3ba299ff..8e34ed1ba880 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/PolicyEventsListQueryResultsForSubscriptionLevelPolicyAssignmentSamples.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/PolicyEventsListQueryResultsForSubscriptionLevelPolicyAssignmentSamples.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.policyinsights.generated; import com.azure.core.util.Context; +import com.azure.resourcemanager.policyinsights.models.PolicyEventsResourceType; /** Samples for PolicyEvents ListQueryResultsForSubscriptionLevelPolicyAssignment. */ public final class PolicyEventsListQueryResultsForSubscriptionLevelPolicyAssignmentSamples { @@ -21,6 +22,7 @@ public static void queryAtSubscriptionLevelPolicyAssignmentScope( manager .policyEvents() .listQueryResultsForSubscriptionLevelPolicyAssignment( + PolicyEventsResourceType.DEFAULT, "fffedd8f-ffff-fffd-fffd-fffed2f84852", "ec8f9645-8ecb-4abb-9c0b-5292f19d4003", null, @@ -47,6 +49,7 @@ public static void queryAtSubscriptionLevelPolicyAssignmentScopeWithNextLink( manager .policyEvents() .listQueryResultsForSubscriptionLevelPolicyAssignment( + PolicyEventsResourceType.DEFAULT, "fffedd8f-ffff-fffd-fffd-fffed2f84852", "ec8f9645-8ecb-4abb-9c0b-5292f19d4003", null, diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/PolicyEventsListQueryResultsForSubscriptionSamples.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/PolicyEventsListQueryResultsForSubscriptionSamples.java index 0991c33e17d7..96bb9005a075 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/PolicyEventsListQueryResultsForSubscriptionSamples.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/PolicyEventsListQueryResultsForSubscriptionSamples.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.policyinsights.generated; import com.azure.core.util.Context; +import com.azure.resourcemanager.policyinsights.models.PolicyEventsResourceType; import java.time.OffsetDateTime; /** Samples for PolicyEvents ListQueryResultsForSubscription. */ @@ -22,6 +23,7 @@ public static void timeRangeSortSelectAndLimit( manager .policyEvents() .listQueryResultsForSubscription( + PolicyEventsResourceType.DEFAULT, "fffedd8f-ffff-fffd-fffd-fffed2f84852", 2, "Timestamp desc, PolicyAssignmentId asc, SubscriptionId asc, ResourceGroup asc, ResourceId", @@ -46,6 +48,7 @@ public static void filterAndAggregateOnly(com.azure.resourcemanager.policyinsigh manager .policyEvents() .listQueryResultsForSubscription( + PolicyEventsResourceType.DEFAULT, "fffedd8f-ffff-fffd-fffd-fffed2f84852", null, null, @@ -71,6 +74,7 @@ public static void filterAndGroupWithoutAggregate( manager .policyEvents() .listQueryResultsForSubscription( + PolicyEventsResourceType.DEFAULT, "fffedd8f-ffff-fffd-fffd-fffed2f84852", 2, null, @@ -96,6 +100,7 @@ public static void queryAtSubscriptionScopeWithNextLink( manager .policyEvents() .listQueryResultsForSubscription( + PolicyEventsResourceType.DEFAULT, "fffedd8f-ffff-fffd-fffd-fffed2f84852", null, null, @@ -120,6 +125,7 @@ public static void filterAndMultipleGroups(com.azure.resourcemanager.policyinsig manager .policyEvents() .listQueryResultsForSubscription( + PolicyEventsResourceType.DEFAULT, "fffedd8f-ffff-fffd-fffd-fffed2f84852", 10, "NumDeniedResources desc", @@ -146,6 +152,7 @@ public static void filterAndGroupWithAggregate( manager .policyEvents() .listQueryResultsForSubscription( + PolicyEventsResourceType.DEFAULT, "fffedd8f-ffff-fffd-fffd-fffed2f84852", 2, null, @@ -172,6 +179,16 @@ public static void queryAtSubscriptionScope( manager .policyEvents() .listQueryResultsForSubscription( - "fffedd8f-ffff-fffd-fffd-fffed2f84852", null, null, null, null, null, null, null, null, Context.NONE); + PolicyEventsResourceType.DEFAULT, + "fffedd8f-ffff-fffd-fffd-fffed2f84852", + null, + null, + null, + null, + null, + null, + null, + null, + Context.NONE); } } diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/PolicyRestrictionsCheckAtManagementGroupScopeSamples.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/PolicyRestrictionsCheckAtManagementGroupScopeSamples.java new file mode 100644 index 000000000000..1ccfe7f112d0 --- /dev/null +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/PolicyRestrictionsCheckAtManagementGroupScopeSamples.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.policyinsights.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.policyinsights.models.CheckManagementGroupRestrictionsRequest; +import com.azure.resourcemanager.policyinsights.models.PendingField; +import java.util.Arrays; + +/** Samples for PolicyRestrictions CheckAtManagementGroupScope. */ +public final class PolicyRestrictionsCheckAtManagementGroupScopeSamples { + /* + * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-03-01/examples/PolicyRestrictions_CheckAtManagementGroupScope.json + */ + /** + * Sample code: Check policy restrictions at management group scope. + * + * @param manager Entry point to PolicyInsightsManager. + */ + public static void checkPolicyRestrictionsAtManagementGroupScope( + com.azure.resourcemanager.policyinsights.PolicyInsightsManager manager) { + manager + .policyRestrictions() + .checkAtManagementGroupScopeWithResponse( + "financeMg", + new CheckManagementGroupRestrictionsRequest() + .withPendingFields(Arrays.asList(new PendingField().withField("type"))), + Context.NONE); + } +} diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/PolicyRestrictionsCheckAtResourceGroupScopeSamples.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/PolicyRestrictionsCheckAtResourceGroupScopeSamples.java index 796e120d2ad0..708591a13155 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/PolicyRestrictionsCheckAtResourceGroupScopeSamples.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/PolicyRestrictionsCheckAtResourceGroupScopeSamples.java @@ -16,7 +16,7 @@ /** Samples for PolicyRestrictions CheckAtResourceGroupScope. */ public final class PolicyRestrictionsCheckAtResourceGroupScopeSamples { /* - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2020-07-01/examples/PolicyRestrictions_CheckAtResourceGroupScope.json + * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-03-01/examples/PolicyRestrictions_CheckAtResourceGroupScope.json */ /** * Sample code: Check policy restrictions at resource group scope. diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/PolicyRestrictionsCheckAtSubscriptionScopeSamples.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/PolicyRestrictionsCheckAtSubscriptionScopeSamples.java index 232bbb2ebc87..79d7f2d069bf 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/PolicyRestrictionsCheckAtSubscriptionScopeSamples.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/PolicyRestrictionsCheckAtSubscriptionScopeSamples.java @@ -16,7 +16,7 @@ /** Samples for PolicyRestrictions CheckAtSubscriptionScope. */ public final class PolicyRestrictionsCheckAtSubscriptionScopeSamples { /* - * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2020-07-01/examples/PolicyRestrictions_CheckAtSubscriptionScope.json + * x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-03-01/examples/PolicyRestrictions_CheckAtSubscriptionScope.json */ /** * Sample code: Check policy restrictions at subscription scope. diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/PolicyStatesSummarizeForManagementGroupSamples.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/PolicyStatesSummarizeForManagementGroupSamples.java index bcdddffa8004..319dc7280a72 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/PolicyStatesSummarizeForManagementGroupSamples.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/PolicyStatesSummarizeForManagementGroupSamples.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.policyinsights.generated; import com.azure.core.util.Context; +import com.azure.resourcemanager.policyinsights.models.PolicyStatesSummaryResourceType; import java.time.OffsetDateTime; /** Samples for PolicyStates SummarizeForManagementGroup. */ @@ -22,6 +23,7 @@ public static void summarizeAtManagementGroupScope( manager .policyStates() .summarizeForManagementGroupWithResponse( + PolicyStatesSummaryResourceType.LATEST, "myManagementGroup", 0, OffsetDateTime.parse("2019-10-05T18:00:00Z"), diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/PolicyStatesSummarizeForPolicyDefinitionSamples.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/PolicyStatesSummarizeForPolicyDefinitionSamples.java index 566d2a128d97..d1b1fc8e6b6c 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/PolicyStatesSummarizeForPolicyDefinitionSamples.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/PolicyStatesSummarizeForPolicyDefinitionSamples.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.policyinsights.generated; import com.azure.core.util.Context; +import com.azure.resourcemanager.policyinsights.models.PolicyStatesSummaryResourceType; /** Samples for PolicyStates SummarizeForPolicyDefinition. */ public final class PolicyStatesSummarizeForPolicyDefinitionSamples { @@ -21,6 +22,7 @@ public static void summarizeAtPolicyDefinitionScope( manager .policyStates() .summarizeForPolicyDefinitionWithResponse( + PolicyStatesSummaryResourceType.LATEST, "fffedd8f-ffff-fffd-fffd-fffed2f84852", "24813039-7534-408a-9842-eb99f45721b1", null, diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/PolicyStatesSummarizeForPolicySetDefinitionSamples.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/PolicyStatesSummarizeForPolicySetDefinitionSamples.java index a8b8afd55657..f33017ea12d4 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/PolicyStatesSummarizeForPolicySetDefinitionSamples.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/PolicyStatesSummarizeForPolicySetDefinitionSamples.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.policyinsights.generated; import com.azure.core.util.Context; +import com.azure.resourcemanager.policyinsights.models.PolicyStatesSummaryResourceType; import java.time.OffsetDateTime; /** Samples for PolicyStates SummarizeForPolicySetDefinition. */ @@ -22,6 +23,7 @@ public static void summarizeAtPolicySetDefinitionScope( manager .policyStates() .summarizeForPolicySetDefinitionWithResponse( + PolicyStatesSummaryResourceType.LATEST, "fffedd8f-ffff-fffd-fffd-fffed2f84852", "3e3807c1-65c9-49e0-a406-82d8ae3e338c", 1, diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/PolicyStatesSummarizeForResourceGroupLevelPolicyAssignmentSamples.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/PolicyStatesSummarizeForResourceGroupLevelPolicyAssignmentSamples.java index 553478a305a8..b5702096b900 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/PolicyStatesSummarizeForResourceGroupLevelPolicyAssignmentSamples.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/PolicyStatesSummarizeForResourceGroupLevelPolicyAssignmentSamples.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.policyinsights.generated; import com.azure.core.util.Context; +import com.azure.resourcemanager.policyinsights.models.PolicyStatesSummaryResourceType; /** Samples for PolicyStates SummarizeForResourceGroupLevelPolicyAssignment. */ public final class PolicyStatesSummarizeForResourceGroupLevelPolicyAssignmentSamples { @@ -21,6 +22,7 @@ public static void summarizeAtPolicyAssignmentScope( manager .policyStates() .summarizeForResourceGroupLevelPolicyAssignmentWithResponse( + PolicyStatesSummaryResourceType.LATEST, "fffedd8f-ffff-fffd-fffd-fffed2f84852", "myResourceGroup", "b7a1ca2596524e3ab19597f2", diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/PolicyStatesSummarizeForResourceGroupSamples.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/PolicyStatesSummarizeForResourceGroupSamples.java index b74ca603452d..f36115a8a2e0 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/PolicyStatesSummarizeForResourceGroupSamples.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/PolicyStatesSummarizeForResourceGroupSamples.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.policyinsights.generated; import com.azure.core.util.Context; +import com.azure.resourcemanager.policyinsights.models.PolicyStatesSummaryResourceType; /** Samples for PolicyStates SummarizeForResourceGroup. */ public final class PolicyStatesSummarizeForResourceGroupSamples { @@ -21,6 +22,13 @@ public static void summarizeAtResourceGroupScope( manager .policyStates() .summarizeForResourceGroupWithResponse( - "fffedd8f-ffff-fffd-fffd-fffed2f84852", "myResourceGroup", null, null, null, null, Context.NONE); + PolicyStatesSummaryResourceType.LATEST, + "fffedd8f-ffff-fffd-fffd-fffed2f84852", + "myResourceGroup", + null, + null, + null, + null, + Context.NONE); } } diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/PolicyStatesSummarizeForResourceSamples.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/PolicyStatesSummarizeForResourceSamples.java index 7dd78ad26114..4579de186742 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/PolicyStatesSummarizeForResourceSamples.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/PolicyStatesSummarizeForResourceSamples.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.policyinsights.generated; import com.azure.core.util.Context; +import com.azure.resourcemanager.policyinsights.models.PolicyStatesSummaryResourceType; /** Samples for PolicyStates SummarizeForResource. */ public final class PolicyStatesSummarizeForResourceSamples { @@ -21,6 +22,7 @@ public static void summarizeAtResourceScope( manager .policyStates() .summarizeForResourceWithResponse( + PolicyStatesSummaryResourceType.LATEST, "subscriptions/fff10b27-fff3-fff5-fff8-fffbe01e86a5/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/my-vault", 2, null, diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/PolicyStatesSummarizeForSubscriptionLevelPolicyAssignmentSamples.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/PolicyStatesSummarizeForSubscriptionLevelPolicyAssignmentSamples.java index 76bbb54c9372..957a00eb1870 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/PolicyStatesSummarizeForSubscriptionLevelPolicyAssignmentSamples.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/PolicyStatesSummarizeForSubscriptionLevelPolicyAssignmentSamples.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.policyinsights.generated; import com.azure.core.util.Context; +import com.azure.resourcemanager.policyinsights.models.PolicyStatesSummaryResourceType; /** Samples for PolicyStates SummarizeForSubscriptionLevelPolicyAssignment. */ public final class PolicyStatesSummarizeForSubscriptionLevelPolicyAssignmentSamples { @@ -21,6 +22,7 @@ public static void summarizeAtPolicyAssignmentScope( manager .policyStates() .summarizeForSubscriptionLevelPolicyAssignmentWithResponse( + PolicyStatesSummaryResourceType.LATEST, "fffedd8f-ffff-fffd-fffd-fffed2f84852", "ec8f9645-8ecb-4abb-9c0b-5292f19d4003", null, diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/PolicyStatesSummarizeForSubscriptionSamples.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/PolicyStatesSummarizeForSubscriptionSamples.java index 4a08f761f79d..4ced13172e70 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/PolicyStatesSummarizeForSubscriptionSamples.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/PolicyStatesSummarizeForSubscriptionSamples.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.policyinsights.generated; import com.azure.core.util.Context; +import com.azure.resourcemanager.policyinsights.models.PolicyStatesSummaryResourceType; /** Samples for PolicyStates SummarizeForSubscription. */ public final class PolicyStatesSummarizeForSubscriptionSamples { @@ -21,6 +22,7 @@ public static void summarizeAtSubscriptionScopeForAPolicyDefinitionGroup( manager .policyStates() .summarizeForSubscriptionWithResponse( + PolicyStatesSummaryResourceType.LATEST, "fffedd8f-ffff-fffd-fffd-fffed2f84852", 1, null, @@ -42,6 +44,12 @@ public static void summarizeAtSubscriptionScope( manager .policyStates() .summarizeForSubscriptionWithResponse( - "fffedd8f-ffff-fffd-fffd-fffed2f84852", 5, null, null, null, Context.NONE); + PolicyStatesSummaryResourceType.LATEST, + "fffedd8f-ffff-fffd-fffd-fffed2f84852", + 5, + null, + null, + null, + Context.NONE); } } diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/PolicyTrackedResourcesListQueryResultsForManagementGroupSamples.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/PolicyTrackedResourcesListQueryResultsForManagementGroupSamples.java index 2298c52af7f3..92ef8dabae55 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/PolicyTrackedResourcesListQueryResultsForManagementGroupSamples.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/PolicyTrackedResourcesListQueryResultsForManagementGroupSamples.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.policyinsights.generated; import com.azure.core.util.Context; +import com.azure.resourcemanager.policyinsights.models.PolicyTrackedResourcesResourceType; /** Samples for PolicyTrackedResources ListQueryResultsForManagementGroup. */ public final class PolicyTrackedResourcesListQueryResultsForManagementGroupSamples { @@ -22,6 +23,7 @@ public static void queryAtManagementGroupScopeUsingQueryParameters( .policyTrackedResources() .listQueryResultsForManagementGroup( "myManagementGroup", + PolicyTrackedResourcesResourceType.DEFAULT, 1, "PolicyAssignmentId eq" + " '/subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Authorization/policyAssignments/myPolicyAssignment'" @@ -42,6 +44,7 @@ public static void queryAtManagementGroupScope( com.azure.resourcemanager.policyinsights.PolicyInsightsManager manager) { manager .policyTrackedResources() - .listQueryResultsForManagementGroup("myManagementGroup", null, null, Context.NONE); + .listQueryResultsForManagementGroup( + "myManagementGroup", PolicyTrackedResourcesResourceType.DEFAULT, null, null, Context.NONE); } } diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/PolicyTrackedResourcesListQueryResultsForResourceGroupSamples.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/PolicyTrackedResourcesListQueryResultsForResourceGroupSamples.java index 3d915eb978b0..9a7a4b77e3b4 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/PolicyTrackedResourcesListQueryResultsForResourceGroupSamples.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/PolicyTrackedResourcesListQueryResultsForResourceGroupSamples.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.policyinsights.generated; import com.azure.core.util.Context; +import com.azure.resourcemanager.policyinsights.models.PolicyTrackedResourcesResourceType; /** Samples for PolicyTrackedResources ListQueryResultsForResourceGroup. */ public final class PolicyTrackedResourcesListQueryResultsForResourceGroupSamples { @@ -22,6 +23,7 @@ public static void queryAtResourceGroupScopeUsingQueryParameters( .policyTrackedResources() .listQueryResultsForResourceGroup( "myResourceGroup", + PolicyTrackedResourcesResourceType.DEFAULT, 1, "PolicyAssignmentId eq" + " '/subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Authorization/policyAssignments/myPolicyAssignment'" @@ -40,6 +42,9 @@ public static void queryAtResourceGroupScopeUsingQueryParameters( */ public static void queryAtResourceGroupScope( com.azure.resourcemanager.policyinsights.PolicyInsightsManager manager) { - manager.policyTrackedResources().listQueryResultsForResourceGroup("myResourceGroup", null, null, Context.NONE); + manager + .policyTrackedResources() + .listQueryResultsForResourceGroup( + "myResourceGroup", PolicyTrackedResourcesResourceType.DEFAULT, null, null, Context.NONE); } } diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/PolicyTrackedResourcesListQueryResultsForResourceSamples.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/PolicyTrackedResourcesListQueryResultsForResourceSamples.java index 87aea76d3b91..42c857ceec6c 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/PolicyTrackedResourcesListQueryResultsForResourceSamples.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/PolicyTrackedResourcesListQueryResultsForResourceSamples.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.policyinsights.generated; import com.azure.core.util.Context; +import com.azure.resourcemanager.policyinsights.models.PolicyTrackedResourcesResourceType; /** Samples for PolicyTrackedResources ListQueryResultsForResource. */ public final class PolicyTrackedResourcesListQueryResultsForResourceSamples { @@ -22,6 +23,7 @@ public static void queryAtResourceScopeUsingQueryParameters( .policyTrackedResources() .listQueryResultsForResource( "subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Example/exampleResourceType/myResource", + PolicyTrackedResourcesResourceType.DEFAULT, 1, "PolicyAssignmentId eq" + " '/subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Authorization/policyAssignments/myPolicyAssignment'" @@ -43,6 +45,7 @@ public static void queryAtResourceScope(com.azure.resourcemanager.policyinsights .policyTrackedResources() .listQueryResultsForResource( "subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Example/exampleResourceType/myResource", + PolicyTrackedResourcesResourceType.DEFAULT, null, null, Context.NONE); diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/PolicyTrackedResourcesListQueryResultsForSubscriptionSamples.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/PolicyTrackedResourcesListQueryResultsForSubscriptionSamples.java index 1907604147b3..51f4d174233d 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/PolicyTrackedResourcesListQueryResultsForSubscriptionSamples.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/PolicyTrackedResourcesListQueryResultsForSubscriptionSamples.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.policyinsights.generated; import com.azure.core.util.Context; +import com.azure.resourcemanager.policyinsights.models.PolicyTrackedResourcesResourceType; /** Samples for PolicyTrackedResources ListQueryResultsForSubscription. */ public final class PolicyTrackedResourcesListQueryResultsForSubscriptionSamples { @@ -21,6 +22,7 @@ public static void queryAtSubscriptionScopeUsingQueryParameters( manager .policyTrackedResources() .listQueryResultsForSubscription( + PolicyTrackedResourcesResourceType.DEFAULT, 1, "PolicyAssignmentId eq" + " '/subscriptions/fff8dfdb-fff3-fff0-fff4-fffdcbe6b2ef/resourceGroups/myResourceGroup/providers/Microsoft.Authorization/policyAssignments/myPolicyAssignment'" @@ -39,6 +41,8 @@ public static void queryAtSubscriptionScopeUsingQueryParameters( */ public static void queryAtSubscriptionScope( com.azure.resourcemanager.policyinsights.PolicyInsightsManager manager) { - manager.policyTrackedResources().listQueryResultsForSubscription(null, null, Context.NONE); + manager + .policyTrackedResources() + .listQueryResultsForSubscription(PolicyTrackedResourcesResourceType.DEFAULT, null, null, Context.NONE); } } diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/RemediationsCreateOrUpdateAtSubscriptionSamples.java b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/RemediationsCreateOrUpdateAtSubscriptionSamples.java index c83ba403b2ef..99d8a9e63390 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/RemediationsCreateOrUpdateAtSubscriptionSamples.java +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/src/samples/java/com/azure/resourcemanager/policyinsights/generated/RemediationsCreateOrUpdateAtSubscriptionSamples.java @@ -55,7 +55,7 @@ public static void createRemediationAtSubscriptionScopeWithAllProperties( .withFilters(new RemediationFilters().withLocations(Arrays.asList("eastus", "westus"))) .withResourceCount(42) .withParallelDeployments(6) - .withFailureThreshold(new RemediationPropertiesFailureThreshold().withPercentage(0.1f)), + .withFailureThreshold(new RemediationPropertiesFailureThreshold().withPercentage(0.1F)), Context.NONE); } }