diff --git a/sdk/policyinsights/mgmt-v2019_10_01/pom.xml b/sdk/policyinsights/mgmt-v2019_10_01/pom.xml
index 1b09c2954250..025cea421db0 100644
--- a/sdk/policyinsights/mgmt-v2019_10_01/pom.xml
+++ b/sdk/policyinsights/mgmt-v2019_10_01/pom.xml
@@ -12,7 +12,7 @@
com.microsoft.azure
azure-arm-parent
1.1.0
- ../../parents/azure-arm-parent
+ ../../../pom.management.xml
azure-mgmt-policyinsights
1.0.0-beta
diff --git a/sdk/policyinsights/mgmt-v2019_10_01/src/main/java/com/microsoft/azure/management/policyinsights/v2019_10_01/ComponentEventDetails.java b/sdk/policyinsights/mgmt-v2019_10_01/src/main/java/com/microsoft/azure/management/policyinsights/v2019_10_01/ComponentEventDetails.java
new file mode 100644
index 000000000000..e6863e8515f0
--- /dev/null
+++ b/sdk/policyinsights/mgmt-v2019_10_01/src/main/java/com/microsoft/azure/management/policyinsights/v2019_10_01/ComponentEventDetails.java
@@ -0,0 +1,228 @@
+/**
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ */
+
+package com.microsoft.azure.management.policyinsights.v2019_10_01;
+
+import java.util.Map;
+import org.joda.time.DateTime;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/**
+ * Component event details.
+ */
+public class ComponentEventDetails {
+ /**
+ * Unmatched properties from the message are deserialized this collection.
+ */
+ @JsonProperty(value = "")
+ private Map additionalProperties;
+
+ /**
+ * Component Id.
+ */
+ @JsonProperty(value = "id")
+ private String id;
+
+ /**
+ * Component type.
+ */
+ @JsonProperty(value = "type")
+ private String type;
+
+ /**
+ * Component name.
+ */
+ @JsonProperty(value = "name")
+ private String name;
+
+ /**
+ * Timestamp for component policy event record.
+ */
+ @JsonProperty(value = "timestamp")
+ private DateTime timestamp;
+
+ /**
+ * Tenant ID for the policy event record.
+ */
+ @JsonProperty(value = "tenantId")
+ private String tenantId;
+
+ /**
+ * Principal object ID for the user who initiated the resource component
+ * operation that triggered the policy event.
+ */
+ @JsonProperty(value = "principalOid")
+ private String principalOid;
+
+ /**
+ * Policy definition action, i.e. effect.
+ */
+ @JsonProperty(value = "policyDefinitionAction")
+ private String policyDefinitionAction;
+
+ /**
+ * Get unmatched properties from the message are deserialized this collection.
+ *
+ * @return the additionalProperties value
+ */
+ public Map additionalProperties() {
+ return this.additionalProperties;
+ }
+
+ /**
+ * Set unmatched properties from the message are deserialized this collection.
+ *
+ * @param additionalProperties the additionalProperties value to set
+ * @return the ComponentEventDetails object itself.
+ */
+ public ComponentEventDetails withAdditionalProperties(Map additionalProperties) {
+ this.additionalProperties = additionalProperties;
+ return this;
+ }
+
+ /**
+ * Get component Id.
+ *
+ * @return the id value
+ */
+ public String id() {
+ return this.id;
+ }
+
+ /**
+ * Set component Id.
+ *
+ * @param id the id value to set
+ * @return the ComponentEventDetails object itself.
+ */
+ public ComponentEventDetails withId(String id) {
+ this.id = id;
+ return this;
+ }
+
+ /**
+ * Get component type.
+ *
+ * @return the type value
+ */
+ public String type() {
+ return this.type;
+ }
+
+ /**
+ * Set component type.
+ *
+ * @param type the type value to set
+ * @return the ComponentEventDetails object itself.
+ */
+ public ComponentEventDetails withType(String type) {
+ this.type = type;
+ return this;
+ }
+
+ /**
+ * Get component name.
+ *
+ * @return the name value
+ */
+ public String name() {
+ return this.name;
+ }
+
+ /**
+ * Set component name.
+ *
+ * @param name the name value to set
+ * @return the ComponentEventDetails object itself.
+ */
+ public ComponentEventDetails withName(String name) {
+ this.name = name;
+ return this;
+ }
+
+ /**
+ * Get timestamp for component policy event record.
+ *
+ * @return the timestamp value
+ */
+ public DateTime timestamp() {
+ return this.timestamp;
+ }
+
+ /**
+ * Set timestamp for component policy event record.
+ *
+ * @param timestamp the timestamp value to set
+ * @return the ComponentEventDetails object itself.
+ */
+ public ComponentEventDetails withTimestamp(DateTime timestamp) {
+ this.timestamp = timestamp;
+ return this;
+ }
+
+ /**
+ * Get tenant ID for the policy event record.
+ *
+ * @return the tenantId value
+ */
+ public String tenantId() {
+ return this.tenantId;
+ }
+
+ /**
+ * Set tenant ID for the policy event record.
+ *
+ * @param tenantId the tenantId value to set
+ * @return the ComponentEventDetails object itself.
+ */
+ public ComponentEventDetails withTenantId(String tenantId) {
+ this.tenantId = tenantId;
+ return this;
+ }
+
+ /**
+ * Get principal object ID for the user who initiated the resource component operation that triggered the policy event.
+ *
+ * @return the principalOid value
+ */
+ public String principalOid() {
+ return this.principalOid;
+ }
+
+ /**
+ * Set principal object ID for the user who initiated the resource component operation that triggered the policy event.
+ *
+ * @param principalOid the principalOid value to set
+ * @return the ComponentEventDetails object itself.
+ */
+ public ComponentEventDetails withPrincipalOid(String principalOid) {
+ this.principalOid = principalOid;
+ return this;
+ }
+
+ /**
+ * Get policy definition action, i.e. effect.
+ *
+ * @return the policyDefinitionAction value
+ */
+ public String policyDefinitionAction() {
+ return this.policyDefinitionAction;
+ }
+
+ /**
+ * Set policy definition action, i.e. effect.
+ *
+ * @param policyDefinitionAction the policyDefinitionAction value to set
+ * @return the ComponentEventDetails object itself.
+ */
+ public ComponentEventDetails withPolicyDefinitionAction(String policyDefinitionAction) {
+ this.policyDefinitionAction = policyDefinitionAction;
+ return this;
+ }
+
+}
diff --git a/sdk/policyinsights/mgmt-v2019_10_01/src/main/java/com/microsoft/azure/management/policyinsights/v2019_10_01/ComponentStateDetails.java b/sdk/policyinsights/mgmt-v2019_10_01/src/main/java/com/microsoft/azure/management/policyinsights/v2019_10_01/ComponentStateDetails.java
new file mode 100644
index 000000000000..c85a7ea16103
--- /dev/null
+++ b/sdk/policyinsights/mgmt-v2019_10_01/src/main/java/com/microsoft/azure/management/policyinsights/v2019_10_01/ComponentStateDetails.java
@@ -0,0 +1,175 @@
+/**
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ */
+
+package com.microsoft.azure.management.policyinsights.v2019_10_01;
+
+import java.util.Map;
+import org.joda.time.DateTime;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/**
+ * Component state details.
+ */
+public class ComponentStateDetails {
+ /**
+ * Unmatched properties from the message are deserialized this collection.
+ */
+ @JsonProperty(value = "")
+ private Map additionalProperties;
+
+ /**
+ * Component Id.
+ */
+ @JsonProperty(value = "id")
+ private String id;
+
+ /**
+ * Component type.
+ */
+ @JsonProperty(value = "type")
+ private String type;
+
+ /**
+ * Component name.
+ */
+ @JsonProperty(value = "name")
+ private String name;
+
+ /**
+ * Component compliance evaluation timestamp.
+ */
+ @JsonProperty(value = "timestamp")
+ private DateTime timestamp;
+
+ /**
+ * Component compliance state.
+ */
+ @JsonProperty(value = "complianceState")
+ private String complianceState;
+
+ /**
+ * Get unmatched properties from the message are deserialized this collection.
+ *
+ * @return the additionalProperties value
+ */
+ public Map additionalProperties() {
+ return this.additionalProperties;
+ }
+
+ /**
+ * Set unmatched properties from the message are deserialized this collection.
+ *
+ * @param additionalProperties the additionalProperties value to set
+ * @return the ComponentStateDetails object itself.
+ */
+ public ComponentStateDetails withAdditionalProperties(Map additionalProperties) {
+ this.additionalProperties = additionalProperties;
+ return this;
+ }
+
+ /**
+ * Get component Id.
+ *
+ * @return the id value
+ */
+ public String id() {
+ return this.id;
+ }
+
+ /**
+ * Set component Id.
+ *
+ * @param id the id value to set
+ * @return the ComponentStateDetails object itself.
+ */
+ public ComponentStateDetails withId(String id) {
+ this.id = id;
+ return this;
+ }
+
+ /**
+ * Get component type.
+ *
+ * @return the type value
+ */
+ public String type() {
+ return this.type;
+ }
+
+ /**
+ * Set component type.
+ *
+ * @param type the type value to set
+ * @return the ComponentStateDetails object itself.
+ */
+ public ComponentStateDetails withType(String type) {
+ this.type = type;
+ return this;
+ }
+
+ /**
+ * Get component name.
+ *
+ * @return the name value
+ */
+ public String name() {
+ return this.name;
+ }
+
+ /**
+ * Set component name.
+ *
+ * @param name the name value to set
+ * @return the ComponentStateDetails object itself.
+ */
+ public ComponentStateDetails withName(String name) {
+ this.name = name;
+ return this;
+ }
+
+ /**
+ * Get component compliance evaluation timestamp.
+ *
+ * @return the timestamp value
+ */
+ public DateTime timestamp() {
+ return this.timestamp;
+ }
+
+ /**
+ * Set component compliance evaluation timestamp.
+ *
+ * @param timestamp the timestamp value to set
+ * @return the ComponentStateDetails object itself.
+ */
+ public ComponentStateDetails withTimestamp(DateTime timestamp) {
+ this.timestamp = timestamp;
+ return this;
+ }
+
+ /**
+ * Get component compliance state.
+ *
+ * @return the complianceState value
+ */
+ public String complianceState() {
+ return this.complianceState;
+ }
+
+ /**
+ * Set component compliance state.
+ *
+ * @param complianceState the complianceState value to set
+ * @return the ComponentStateDetails object itself.
+ */
+ public ComponentStateDetails withComplianceState(String complianceState) {
+ this.complianceState = complianceState;
+ return this;
+ }
+
+}
diff --git a/sdk/policyinsights/mgmt-v2019_10_01/src/main/java/com/microsoft/azure/management/policyinsights/v2019_10_01/PolicyEvent.java b/sdk/policyinsights/mgmt-v2019_10_01/src/main/java/com/microsoft/azure/management/policyinsights/v2019_10_01/PolicyEvent.java
new file mode 100644
index 000000000000..87049467a64a
--- /dev/null
+++ b/sdk/policyinsights/mgmt-v2019_10_01/src/main/java/com/microsoft/azure/management/policyinsights/v2019_10_01/PolicyEvent.java
@@ -0,0 +1,183 @@
+/**
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ */
+
+package com.microsoft.azure.management.policyinsights.v2019_10_01;
+
+import com.microsoft.azure.arm.model.HasInner;
+import com.microsoft.azure.arm.resources.models.HasManager;
+import com.microsoft.azure.management.policyinsights.v2019_10_01.implementation.PolicyInsightsManager;
+import com.microsoft.azure.management.policyinsights.v2019_10_01.implementation.PolicyEventInner;
+import java.util.Map;
+import java.util.List;
+import org.joda.time.DateTime;
+
+/**
+ * Type representing PolicyEvent.
+ */
+public interface PolicyEvent extends HasInner, HasManager {
+ /**
+ * @return the additionalProperties value.
+ */
+ Map additionalProperties();
+
+ /**
+ * @return the complianceState value.
+ */
+ String complianceState();
+
+ /**
+ * @return the components value.
+ */
+ List components();
+
+ /**
+ * @return the effectiveParameters value.
+ */
+ String effectiveParameters();
+
+ /**
+ * @return the isCompliant value.
+ */
+ Boolean isCompliant();
+
+ /**
+ * @return the managementGroupIds value.
+ */
+ String managementGroupIds();
+
+ /**
+ * @return the odatacontext value.
+ */
+ String odatacontext();
+
+ /**
+ * @return the odataid value.
+ */
+ String odataid();
+
+ /**
+ * @return the policyAssignmentId value.
+ */
+ String policyAssignmentId();
+
+ /**
+ * @return the policyAssignmentName value.
+ */
+ String policyAssignmentName();
+
+ /**
+ * @return the policyAssignmentOwner value.
+ */
+ String policyAssignmentOwner();
+
+ /**
+ * @return the policyAssignmentParameters value.
+ */
+ String policyAssignmentParameters();
+
+ /**
+ * @return the policyAssignmentScope value.
+ */
+ String policyAssignmentScope();
+
+ /**
+ * @return the policyDefinitionAction value.
+ */
+ String policyDefinitionAction();
+
+ /**
+ * @return the policyDefinitionCategory value.
+ */
+ String policyDefinitionCategory();
+
+ /**
+ * @return the policyDefinitionId value.
+ */
+ String policyDefinitionId();
+
+ /**
+ * @return the policyDefinitionName value.
+ */
+ String policyDefinitionName();
+
+ /**
+ * @return the policyDefinitionReferenceId value.
+ */
+ String policyDefinitionReferenceId();
+
+ /**
+ * @return the policySetDefinitionCategory value.
+ */
+ String policySetDefinitionCategory();
+
+ /**
+ * @return the policySetDefinitionId value.
+ */
+ String policySetDefinitionId();
+
+ /**
+ * @return the policySetDefinitionName value.
+ */
+ String policySetDefinitionName();
+
+ /**
+ * @return the policySetDefinitionOwner value.
+ */
+ String policySetDefinitionOwner();
+
+ /**
+ * @return the policySetDefinitionParameters value.
+ */
+ String policySetDefinitionParameters();
+
+ /**
+ * @return the principalOid value.
+ */
+ String principalOid();
+
+ /**
+ * @return the resourceGroup value.
+ */
+ String resourceGroup();
+
+ /**
+ * @return the resourceId value.
+ */
+ String resourceId();
+
+ /**
+ * @return the resourceLocation value.
+ */
+ String resourceLocation();
+
+ /**
+ * @return the resourceTags value.
+ */
+ String resourceTags();
+
+ /**
+ * @return the resourceType value.
+ */
+ String resourceType();
+
+ /**
+ * @return the subscriptionId value.
+ */
+ String subscriptionId();
+
+ /**
+ * @return the tenantId value.
+ */
+ String tenantId();
+
+ /**
+ * @return the timestamp value.
+ */
+ DateTime timestamp();
+
+}
diff --git a/sdk/policyinsights/mgmt-v2019_10_01/src/main/java/com/microsoft/azure/management/policyinsights/v2019_10_01/PolicyEvents.java b/sdk/policyinsights/mgmt-v2019_10_01/src/main/java/com/microsoft/azure/management/policyinsights/v2019_10_01/PolicyEvents.java
index 1d788d1cddad..2198ba63a4bc 100644
--- a/sdk/policyinsights/mgmt-v2019_10_01/src/main/java/com/microsoft/azure/management/policyinsights/v2019_10_01/PolicyEvents.java
+++ b/sdk/policyinsights/mgmt-v2019_10_01/src/main/java/com/microsoft/azure/management/policyinsights/v2019_10_01/PolicyEvents.java
@@ -21,7 +21,7 @@ public interface PolicyEvents {
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
- Observable listQueryResultsForManagementGroupAsync(String managementGroupName);
+ Observable listQueryResultsForManagementGroupAsync(final String managementGroupName);
/**
* Queries policy events for the resources under the subscription.
@@ -30,7 +30,7 @@ public interface PolicyEvents {
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
- Observable listQueryResultsForSubscriptionAsync(String subscriptionId);
+ Observable listQueryResultsForSubscriptionAsync(final String subscriptionId);
/**
* Queries policy events for the resources under the resource group.
@@ -40,7 +40,7 @@ public interface PolicyEvents {
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
- Observable listQueryResultsForResourceGroupAsync(String subscriptionId, String resourceGroupName);
+ Observable listQueryResultsForResourceGroupAsync(final String subscriptionId, final String resourceGroupName);
/**
* Queries policy events for the resource.
@@ -49,7 +49,7 @@ public interface PolicyEvents {
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
- Observable listQueryResultsForResourceAsync(String resourceId);
+ Observable listQueryResultsForResourceAsync(final String resourceId);
/**
* Queries policy events for the subscription level policy set definition.
@@ -59,7 +59,7 @@ public interface PolicyEvents {
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
- Observable listQueryResultsForPolicySetDefinitionAsync(String subscriptionId, String policySetDefinitionName);
+ Observable listQueryResultsForPolicySetDefinitionAsync(final String subscriptionId, final String policySetDefinitionName);
/**
* Queries policy events for the subscription level policy definition.
@@ -69,7 +69,7 @@ public interface PolicyEvents {
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
- Observable listQueryResultsForPolicyDefinitionAsync(String subscriptionId, String policyDefinitionName);
+ Observable listQueryResultsForPolicyDefinitionAsync(final String subscriptionId, final String policyDefinitionName);
/**
* Queries policy events for the subscription level policy assignment.
@@ -79,7 +79,7 @@ public interface PolicyEvents {
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
- Observable listQueryResultsForSubscriptionLevelPolicyAssignmentAsync(String subscriptionId, String policyAssignmentName);
+ Observable listQueryResultsForSubscriptionLevelPolicyAssignmentAsync(final String subscriptionId, final String policyAssignmentName);
/**
* Queries policy events for the resource group level policy assignment.
@@ -90,15 +90,6 @@ public interface PolicyEvents {
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
- Observable listQueryResultsForResourceGroupLevelPolicyAssignmentAsync(String subscriptionId, String resourceGroupName, String policyAssignmentName);
-
- /**
- * Gets OData metadata XML document.
- *
- * @param scope A valid scope, i.e. management group, subscription, resource group, or resource ID. Scope used has no effect on metadata returned.
- * @throws IllegalArgumentException thrown if parameters fail the validation
- * @return the observable for the request
- */
- Observable getMetadataAsync(String scope);
+ Observable listQueryResultsForResourceGroupLevelPolicyAssignmentAsync(final String subscriptionId, final String resourceGroupName, final String policyAssignmentName);
}
diff --git a/sdk/policyinsights/mgmt-v2019_10_01/src/main/java/com/microsoft/azure/management/policyinsights/v2019_10_01/PolicyState.java b/sdk/policyinsights/mgmt-v2019_10_01/src/main/java/com/microsoft/azure/management/policyinsights/v2019_10_01/PolicyState.java
new file mode 100644
index 000000000000..0f50580abc7f
--- /dev/null
+++ b/sdk/policyinsights/mgmt-v2019_10_01/src/main/java/com/microsoft/azure/management/policyinsights/v2019_10_01/PolicyState.java
@@ -0,0 +1,198 @@
+/**
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ */
+
+package com.microsoft.azure.management.policyinsights.v2019_10_01;
+
+import com.microsoft.azure.arm.model.HasInner;
+import com.microsoft.azure.arm.resources.models.HasManager;
+import com.microsoft.azure.management.policyinsights.v2019_10_01.implementation.PolicyInsightsManager;
+import com.microsoft.azure.management.policyinsights.v2019_10_01.implementation.PolicyStateInner;
+import java.util.Map;
+import java.util.List;
+import org.joda.time.DateTime;
+
+/**
+ * Type representing PolicyState.
+ */
+public interface PolicyState extends HasInner, HasManager {
+ /**
+ * @return the additionalProperties value.
+ */
+ Map additionalProperties();
+
+ /**
+ * @return the complianceState value.
+ */
+ String complianceState();
+
+ /**
+ * @return the components value.
+ */
+ List components();
+
+ /**
+ * @return the effectiveParameters value.
+ */
+ String effectiveParameters();
+
+ /**
+ * @return the isCompliant value.
+ */
+ Boolean isCompliant();
+
+ /**
+ * @return the managementGroupIds value.
+ */
+ String managementGroupIds();
+
+ /**
+ * @return the odatacontext value.
+ */
+ String odatacontext();
+
+ /**
+ * @return the odataid value.
+ */
+ String odataid();
+
+ /**
+ * @return the policyAssignmentId value.
+ */
+ String policyAssignmentId();
+
+ /**
+ * @return the policyAssignmentName value.
+ */
+ String policyAssignmentName();
+
+ /**
+ * @return the policyAssignmentOwner value.
+ */
+ String policyAssignmentOwner();
+
+ /**
+ * @return the policyAssignmentParameters value.
+ */
+ String policyAssignmentParameters();
+
+ /**
+ * @return the policyAssignmentScope value.
+ */
+ String policyAssignmentScope();
+
+ /**
+ * @return the policyAssignmentVersion value.
+ */
+ String policyAssignmentVersion();
+
+ /**
+ * @return the policyDefinitionAction value.
+ */
+ String policyDefinitionAction();
+
+ /**
+ * @return the policyDefinitionCategory value.
+ */
+ String policyDefinitionCategory();
+
+ /**
+ * @return the policyDefinitionGroupNames value.
+ */
+ List policyDefinitionGroupNames();
+
+ /**
+ * @return the policyDefinitionId value.
+ */
+ String policyDefinitionId();
+
+ /**
+ * @return the policyDefinitionName value.
+ */
+ String policyDefinitionName();
+
+ /**
+ * @return the policyDefinitionReferenceId value.
+ */
+ String policyDefinitionReferenceId();
+
+ /**
+ * @return the policyDefinitionVersion value.
+ */
+ String policyDefinitionVersion();
+
+ /**
+ * @return the policyEvaluationDetails value.
+ */
+ PolicyEvaluationDetails policyEvaluationDetails();
+
+ /**
+ * @return the policySetDefinitionCategory value.
+ */
+ String policySetDefinitionCategory();
+
+ /**
+ * @return the policySetDefinitionId value.
+ */
+ String policySetDefinitionId();
+
+ /**
+ * @return the policySetDefinitionName value.
+ */
+ String policySetDefinitionName();
+
+ /**
+ * @return the policySetDefinitionOwner value.
+ */
+ String policySetDefinitionOwner();
+
+ /**
+ * @return the policySetDefinitionParameters value.
+ */
+ String policySetDefinitionParameters();
+
+ /**
+ * @return the policySetDefinitionVersion value.
+ */
+ String policySetDefinitionVersion();
+
+ /**
+ * @return the resourceGroup value.
+ */
+ String resourceGroup();
+
+ /**
+ * @return the resourceId value.
+ */
+ String resourceId();
+
+ /**
+ * @return the resourceLocation value.
+ */
+ String resourceLocation();
+
+ /**
+ * @return the resourceTags value.
+ */
+ String resourceTags();
+
+ /**
+ * @return the resourceType value.
+ */
+ String resourceType();
+
+ /**
+ * @return the subscriptionId value.
+ */
+ String subscriptionId();
+
+ /**
+ * @return the timestamp value.
+ */
+ DateTime timestamp();
+
+}
diff --git a/sdk/policyinsights/mgmt-v2019_10_01/src/main/java/com/microsoft/azure/management/policyinsights/v2019_10_01/PolicyStates.java b/sdk/policyinsights/mgmt-v2019_10_01/src/main/java/com/microsoft/azure/management/policyinsights/v2019_10_01/PolicyStates.java
index 91c835ae3b6f..916ddac40338 100644
--- a/sdk/policyinsights/mgmt-v2019_10_01/src/main/java/com/microsoft/azure/management/policyinsights/v2019_10_01/PolicyStates.java
+++ b/sdk/policyinsights/mgmt-v2019_10_01/src/main/java/com/microsoft/azure/management/policyinsights/v2019_10_01/PolicyStates.java
@@ -8,6 +8,7 @@
package com.microsoft.azure.management.policyinsights.v2019_10_01;
+import rx.Completable;
import rx.Observable;
/**
@@ -22,7 +23,7 @@ public interface PolicyStates {
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
- Observable listQueryResultsForManagementGroupAsync(PolicyStatesResource policyStatesResource, String managementGroupName);
+ Observable listQueryResultsForManagementGroupAsync(final PolicyStatesResource policyStatesResource, final String managementGroupName);
/**
* Summarizes policy states for the resources under the management group.
@@ -41,7 +42,7 @@ public interface PolicyStates {
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
- Observable listQueryResultsForSubscriptionAsync(PolicyStatesResource policyStatesResource, String subscriptionId);
+ Observable listQueryResultsForSubscriptionAsync(final PolicyStatesResource policyStatesResource, final String subscriptionId);
/**
* Summarizes policy states for the resources under the subscription.
@@ -61,7 +62,7 @@ public interface PolicyStates {
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
- Observable listQueryResultsForResourceGroupAsync(PolicyStatesResource policyStatesResource, String subscriptionId, String resourceGroupName);
+ Observable listQueryResultsForResourceGroupAsync(final PolicyStatesResource policyStatesResource, final String subscriptionId, final String resourceGroupName);
/**
* Summarizes policy states for the resources under the resource group.
@@ -81,7 +82,7 @@ public interface PolicyStates {
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
- Observable listQueryResultsForResourceAsync(PolicyStatesResource policyStatesResource, String resourceId);
+ Observable listQueryResultsForResourceAsync(final PolicyStatesResource policyStatesResource, final String resourceId);
/**
* Summarizes policy states for the resource.
@@ -92,6 +93,25 @@ public interface PolicyStates {
*/
Observable summarizeForResourceAsync(String resourceId);
+ /**
+ * Triggers a policy evaluation scan for all the resources under the subscription.
+ *
+ * @param subscriptionId Microsoft Azure subscription ID.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable for the request
+ */
+ Completable triggerSubscriptionEvaluationAsync(String subscriptionId);
+
+ /**
+ * Triggers a policy evaluation scan for all the resources under the resource group.
+ *
+ * @param subscriptionId Microsoft Azure subscription ID.
+ * @param resourceGroupName Resource group name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable for the request
+ */
+ Completable triggerResourceGroupEvaluationAsync(String subscriptionId, String resourceGroupName);
+
/**
* Queries policy states for the subscription level policy set definition.
*
@@ -101,7 +121,7 @@ public interface PolicyStates {
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
- Observable listQueryResultsForPolicySetDefinitionAsync(PolicyStatesResource policyStatesResource, String subscriptionId, String policySetDefinitionName);
+ Observable listQueryResultsForPolicySetDefinitionAsync(final PolicyStatesResource policyStatesResource, final String subscriptionId, final String policySetDefinitionName);
/**
* Summarizes policy states for the subscription level policy set definition.
@@ -122,7 +142,7 @@ public interface PolicyStates {
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
- Observable listQueryResultsForPolicyDefinitionAsync(PolicyStatesResource policyStatesResource, String subscriptionId, String policyDefinitionName);
+ Observable listQueryResultsForPolicyDefinitionAsync(final PolicyStatesResource policyStatesResource, final String subscriptionId, final String policyDefinitionName);
/**
* Summarizes policy states for the subscription level policy definition.
@@ -143,7 +163,7 @@ public interface PolicyStates {
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
- Observable listQueryResultsForSubscriptionLevelPolicyAssignmentAsync(PolicyStatesResource policyStatesResource, String subscriptionId, String policyAssignmentName);
+ Observable listQueryResultsForSubscriptionLevelPolicyAssignmentAsync(final PolicyStatesResource policyStatesResource, final String subscriptionId, final String policyAssignmentName);
/**
* Summarizes policy states for the subscription level policy assignment.
@@ -165,7 +185,7 @@ public interface PolicyStates {
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
- Observable listQueryResultsForResourceGroupLevelPolicyAssignmentAsync(PolicyStatesResource policyStatesResource, String subscriptionId, String resourceGroupName, String policyAssignmentName);
+ Observable listQueryResultsForResourceGroupLevelPolicyAssignmentAsync(final PolicyStatesResource policyStatesResource, final String subscriptionId, final String resourceGroupName, final String policyAssignmentName);
/**
* Summarizes policy states for the resource group level policy assignment.
diff --git a/sdk/policyinsights/mgmt-v2019_10_01/src/main/java/com/microsoft/azure/management/policyinsights/v2019_10_01/QueryOptions.java b/sdk/policyinsights/mgmt-v2019_10_01/src/main/java/com/microsoft/azure/management/policyinsights/v2019_10_01/QueryOptions.java
index 5289127854c7..caeccbd74410 100644
--- a/sdk/policyinsights/mgmt-v2019_10_01/src/main/java/com/microsoft/azure/management/policyinsights/v2019_10_01/QueryOptions.java
+++ b/sdk/policyinsights/mgmt-v2019_10_01/src/main/java/com/microsoft/azure/management/policyinsights/v2019_10_01/QueryOptions.java
@@ -64,8 +64,15 @@ public class QueryOptions {
private String apply;
/**
- * The $expand query parameter. For example, to expand
- * policyEvaluationDetails, use $expand=policyEvaluationDetails.
+ * Skiptoken is only provided if a previous response returned a partial
+ * result as a part of nextLink element.
+ */
+ @JsonProperty(value = "")
+ private String skipToken;
+
+ /**
+ * The $expand query parameter. For example, to expand components use
+ * $expand=components.
*/
@JsonProperty(value = "")
private String expand;
@@ -211,7 +218,27 @@ public QueryOptions withApply(String apply) {
}
/**
- * Get the $expand query parameter. For example, to expand policyEvaluationDetails, use $expand=policyEvaluationDetails.
+ * Get skiptoken is only provided if a previous response returned a partial result as a part of nextLink element.
+ *
+ * @return the skipToken value
+ */
+ public String skipToken() {
+ return this.skipToken;
+ }
+
+ /**
+ * Set skiptoken is only provided if a previous response returned a partial result as a part of nextLink element.
+ *
+ * @param skipToken the skipToken value to set
+ * @return the QueryOptions object itself.
+ */
+ public QueryOptions withSkipToken(String skipToken) {
+ this.skipToken = skipToken;
+ return this;
+ }
+
+ /**
+ * Get the $expand query parameter. For example, to expand components use $expand=components.
*
* @return the expand value
*/
@@ -220,7 +247,7 @@ public String expand() {
}
/**
- * Set the $expand query parameter. For example, to expand policyEvaluationDetails, use $expand=policyEvaluationDetails.
+ * Set the $expand query parameter. For example, to expand components use $expand=components.
*
* @param expand the expand value to set
* @return the QueryOptions object itself.
diff --git a/sdk/policyinsights/mgmt-v2019_10_01/src/main/java/com/microsoft/azure/management/policyinsights/v2019_10_01/Remediation.java b/sdk/policyinsights/mgmt-v2019_10_01/src/main/java/com/microsoft/azure/management/policyinsights/v2019_10_01/Remediation.java
index 2cb39df9700f..11e7d513d28f 100644
--- a/sdk/policyinsights/mgmt-v2019_10_01/src/main/java/com/microsoft/azure/management/policyinsights/v2019_10_01/Remediation.java
+++ b/sdk/policyinsights/mgmt-v2019_10_01/src/main/java/com/microsoft/azure/management/policyinsights/v2019_10_01/Remediation.java
@@ -80,7 +80,7 @@ public interface Remediation extends HasInner, Indexable, Upda
/**
* The entirety of the Remediation definition.
*/
- interface Definition extends DefinitionStages.Blank, DefinitionStages.WithManagementGroupId, DefinitionStages.WithCreate {
+ interface Definition extends DefinitionStages.Blank, DefinitionStages.WithMicrosoft.PolicyInsight, DefinitionStages.WithCreate {
}
/**
@@ -90,19 +90,19 @@ interface DefinitionStages {
/**
* The first stage of a Remediation definition.
*/
- interface Blank extends WithManagementGroupId {
+ interface Blank extends WithMicrosoft.PolicyInsight {
}
/**
- * The stage of the remediation definition allowing to specify ManagementGroupId.
+ * The stage of the remediation definition allowing to specify Microsoft.PolicyInsight.
*/
- interface WithManagementGroupId {
+ interface WithMicrosoft.PolicyInsight {
/**
* Specifies managementGroupId.
* @param managementGroupId Management group ID
* @return the next definition stage
*/
- WithCreate withExistingManagementGroupId(String managementGroupId);
+ WithCreate withExistingMicrosoft.PolicyInsight(String managementGroupId);
}
/**
diff --git a/sdk/policyinsights/mgmt-v2019_10_01/src/main/java/com/microsoft/azure/management/policyinsights/v2019_10_01/implementation/PageImpl1.java b/sdk/policyinsights/mgmt-v2019_10_01/src/main/java/com/microsoft/azure/management/policyinsights/v2019_10_01/implementation/PageImpl1.java
new file mode 100644
index 000000000000..deeaea3a0776
--- /dev/null
+++ b/sdk/policyinsights/mgmt-v2019_10_01/src/main/java/com/microsoft/azure/management/policyinsights/v2019_10_01/implementation/PageImpl1.java
@@ -0,0 +1,75 @@
+/**
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ */
+
+package com.microsoft.azure.management.policyinsights.v2019_10_01.implementation;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.microsoft.azure.Page;
+import java.util.List;
+
+/**
+ * An instance of this class defines a page of Azure resources and a link to
+ * get the next page of resources, if any.
+ *
+ * @param type of Azure resource
+ */
+public class PageImpl1 implements Page {
+ /**
+ * The link to the next page.
+ */
+ @JsonProperty("@odata.nextLink")
+ private String nextPageLink;
+
+ /**
+ * The list of items.
+ */
+ @JsonProperty("value")
+ private List items;
+
+ /**
+ * Gets the link to the next page.
+ *
+ * @return the link to the next page.
+ */
+ @Override
+ public String nextPageLink() {
+ return this.nextPageLink;
+ }
+
+ /**
+ * Gets the list of items.
+ *
+ * @return the list of items in {@link List}.
+ */
+ @Override
+ public List items() {
+ return items;
+ }
+
+ /**
+ * Sets the link to the next page.
+ *
+ * @param nextPageLink the link to the next page.
+ * @return this Page object itself.
+ */
+ public PageImpl1 setNextPageLink(String nextPageLink) {
+ this.nextPageLink = nextPageLink;
+ return this;
+ }
+
+ /**
+ * Sets the list of items.
+ *
+ * @param items the list of items in {@link List}.
+ * @return this Page object itself.
+ */
+ public PageImpl1 setItems(List items) {
+ this.items = items;
+ return this;
+ }
+}
diff --git a/sdk/policyinsights/mgmt-v2019_10_01/src/main/java/com/microsoft/azure/management/policyinsights/v2019_10_01/implementation/PolicyEventImpl.java b/sdk/policyinsights/mgmt-v2019_10_01/src/main/java/com/microsoft/azure/management/policyinsights/v2019_10_01/implementation/PolicyEventImpl.java
new file mode 100644
index 000000000000..4a6770fe0b1b
--- /dev/null
+++ b/sdk/policyinsights/mgmt-v2019_10_01/src/main/java/com/microsoft/azure/management/policyinsights/v2019_10_01/implementation/PolicyEventImpl.java
@@ -0,0 +1,190 @@
+/**
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ */
+
+package com.microsoft.azure.management.policyinsights.v2019_10_01.implementation;
+
+import com.microsoft.azure.management.policyinsights.v2019_10_01.PolicyEvent;
+import com.microsoft.azure.arm.model.implementation.WrapperImpl;
+import java.util.Map;
+import java.util.List;
+import com.microsoft.azure.management.policyinsights.v2019_10_01.ComponentEventDetails;
+import org.joda.time.DateTime;
+
+class PolicyEventImpl extends WrapperImpl implements PolicyEvent {
+ private final PolicyInsightsManager manager;
+ PolicyEventImpl(PolicyEventInner inner, PolicyInsightsManager manager) {
+ super(inner);
+ this.manager = manager;
+ }
+
+ @Override
+ public PolicyInsightsManager manager() {
+ return this.manager;
+ }
+
+ @Override
+ public Map additionalProperties() {
+ return this.inner().additionalProperties();
+ }
+
+ @Override
+ public String complianceState() {
+ return this.inner().complianceState();
+ }
+
+ @Override
+ public List components() {
+ return this.inner().components();
+ }
+
+ @Override
+ public String effectiveParameters() {
+ return this.inner().effectiveParameters();
+ }
+
+ @Override
+ public Boolean isCompliant() {
+ return this.inner().isCompliant();
+ }
+
+ @Override
+ public String managementGroupIds() {
+ return this.inner().managementGroupIds();
+ }
+
+ @Override
+ public String odatacontext() {
+ return this.inner().odatacontext();
+ }
+
+ @Override
+ public String odataid() {
+ return this.inner().odataid();
+ }
+
+ @Override
+ public String policyAssignmentId() {
+ return this.inner().policyAssignmentId();
+ }
+
+ @Override
+ public String policyAssignmentName() {
+ return this.inner().policyAssignmentName();
+ }
+
+ @Override
+ public String policyAssignmentOwner() {
+ return this.inner().policyAssignmentOwner();
+ }
+
+ @Override
+ public String policyAssignmentParameters() {
+ return this.inner().policyAssignmentParameters();
+ }
+
+ @Override
+ public String policyAssignmentScope() {
+ return this.inner().policyAssignmentScope();
+ }
+
+ @Override
+ public String policyDefinitionAction() {
+ return this.inner().policyDefinitionAction();
+ }
+
+ @Override
+ public String policyDefinitionCategory() {
+ return this.inner().policyDefinitionCategory();
+ }
+
+ @Override
+ public String policyDefinitionId() {
+ return this.inner().policyDefinitionId();
+ }
+
+ @Override
+ public String policyDefinitionName() {
+ return this.inner().policyDefinitionName();
+ }
+
+ @Override
+ public String policyDefinitionReferenceId() {
+ return this.inner().policyDefinitionReferenceId();
+ }
+
+ @Override
+ public String policySetDefinitionCategory() {
+ return this.inner().policySetDefinitionCategory();
+ }
+
+ @Override
+ public String policySetDefinitionId() {
+ return this.inner().policySetDefinitionId();
+ }
+
+ @Override
+ public String policySetDefinitionName() {
+ return this.inner().policySetDefinitionName();
+ }
+
+ @Override
+ public String policySetDefinitionOwner() {
+ return this.inner().policySetDefinitionOwner();
+ }
+
+ @Override
+ public String policySetDefinitionParameters() {
+ return this.inner().policySetDefinitionParameters();
+ }
+
+ @Override
+ public String principalOid() {
+ return this.inner().principalOid();
+ }
+
+ @Override
+ public String resourceGroup() {
+ return this.inner().resourceGroup();
+ }
+
+ @Override
+ public String resourceId() {
+ return this.inner().resourceId();
+ }
+
+ @Override
+ public String resourceLocation() {
+ return this.inner().resourceLocation();
+ }
+
+ @Override
+ public String resourceTags() {
+ return this.inner().resourceTags();
+ }
+
+ @Override
+ public String resourceType() {
+ return this.inner().resourceType();
+ }
+
+ @Override
+ public String subscriptionId() {
+ return this.inner().subscriptionId();
+ }
+
+ @Override
+ public String tenantId() {
+ return this.inner().tenantId();
+ }
+
+ @Override
+ public DateTime timestamp() {
+ return this.inner().timestamp();
+ }
+
+}
diff --git a/sdk/policyinsights/mgmt-v2019_10_01/src/main/java/com/microsoft/azure/management/policyinsights/v2019_10_01/implementation/PolicyEventInner.java b/sdk/policyinsights/mgmt-v2019_10_01/src/main/java/com/microsoft/azure/management/policyinsights/v2019_10_01/implementation/PolicyEventInner.java
index 52e79bbcadc6..f49e178d597a 100644
--- a/sdk/policyinsights/mgmt-v2019_10_01/src/main/java/com/microsoft/azure/management/policyinsights/v2019_10_01/implementation/PolicyEventInner.java
+++ b/sdk/policyinsights/mgmt-v2019_10_01/src/main/java/com/microsoft/azure/management/policyinsights/v2019_10_01/implementation/PolicyEventInner.java
@@ -10,6 +10,8 @@
import java.util.Map;
import org.joda.time.DateTime;
+import java.util.List;
+import com.microsoft.azure.management.policyinsights.v2019_10_01.ComponentEventDetails;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
@@ -193,6 +195,12 @@ public class PolicyEventInner {
@JsonProperty(value = "policyDefinitionReferenceId")
private String policyDefinitionReferenceId;
+ /**
+ * Compliance state of the resource.
+ */
+ @JsonProperty(value = "complianceState")
+ private String complianceState;
+
/**
* Tenant ID for the policy event record.
*/
@@ -206,6 +214,13 @@ public class PolicyEventInner {
@JsonProperty(value = "principalOid")
private String principalOid;
+ /**
+ * Components events records populated only when URL contains
+ * $expand=components clause.
+ */
+ @JsonProperty(value = "components")
+ private List components;
+
/**
* Get unmatched properties from the message are deserialized this collection.
*
@@ -766,6 +781,26 @@ public PolicyEventInner withPolicyDefinitionReferenceId(String policyDefinitionR
return this;
}
+ /**
+ * Get compliance state of the resource.
+ *
+ * @return the complianceState value
+ */
+ public String complianceState() {
+ return this.complianceState;
+ }
+
+ /**
+ * Set compliance state of the resource.
+ *
+ * @param complianceState the complianceState value to set
+ * @return the PolicyEventInner object itself.
+ */
+ public PolicyEventInner withComplianceState(String complianceState) {
+ this.complianceState = complianceState;
+ return this;
+ }
+
/**
* Get tenant ID for the policy event record.
*
@@ -806,4 +841,24 @@ public PolicyEventInner withPrincipalOid(String principalOid) {
return this;
}
+ /**
+ * Get components events records populated only when URL contains $expand=components clause.
+ *
+ * @return the components value
+ */
+ public List components() {
+ return this.components;
+ }
+
+ /**
+ * Set components events records populated only when URL contains $expand=components clause.
+ *
+ * @param components the components value to set
+ * @return the PolicyEventInner object itself.
+ */
+ public PolicyEventInner withComponents(List components) {
+ this.components = components;
+ return this;
+ }
+
}
diff --git a/sdk/policyinsights/mgmt-v2019_10_01/src/main/java/com/microsoft/azure/management/policyinsights/v2019_10_01/implementation/PolicyEventsImpl.java b/sdk/policyinsights/mgmt-v2019_10_01/src/main/java/com/microsoft/azure/management/policyinsights/v2019_10_01/implementation/PolicyEventsImpl.java
index 9ec4f34bd53c..f535baecfffd 100644
--- a/sdk/policyinsights/mgmt-v2019_10_01/src/main/java/com/microsoft/azure/management/policyinsights/v2019_10_01/implementation/PolicyEventsImpl.java
+++ b/sdk/policyinsights/mgmt-v2019_10_01/src/main/java/com/microsoft/azure/management/policyinsights/v2019_10_01/implementation/PolicyEventsImpl.java
@@ -13,7 +13,8 @@
import com.microsoft.azure.management.policyinsights.v2019_10_01.PolicyEvents;
import rx.functions.Func1;
import rx.Observable;
-import com.microsoft.azure.management.policyinsights.v2019_10_01.PolicyEventsQueryResults;
+import com.microsoft.azure.Page;
+import com.microsoft.azure.management.policyinsights.v2019_10_01.PolicyEvent;
class PolicyEventsImpl extends WrapperImpl implements PolicyEvents {
private final PolicyInsightsManager manager;
@@ -28,105 +29,147 @@ public PolicyInsightsManager manager() {
}
@Override
- public Observable listQueryResultsForManagementGroupAsync(String managementGroupName) {
+ public Observable listQueryResultsForManagementGroupAsync(final String managementGroupName) {
PolicyEventsInner client = this.inner();
return client.listQueryResultsForManagementGroupAsync(managementGroupName)
- .map(new Func1() {
+ .flatMapIterable(new Func1, Iterable>() {
@Override
- public PolicyEventsQueryResults call(PolicyEventsQueryResultsInner inner) {
- return new PolicyEventsQueryResultsImpl(inner, manager());
+ public Iterable call(Page page) {
+ return page.items();
+ }
+ })
+ .map(new Func1() {
+ @Override
+ public PolicyEvent call(PolicyEventInner inner) {
+ return new PolicyEventImpl(inner, manager());
}
});
}
@Override
- public Observable listQueryResultsForSubscriptionAsync(String subscriptionId) {
+ public Observable listQueryResultsForSubscriptionAsync(final String subscriptionId) {
PolicyEventsInner client = this.inner();
return client.listQueryResultsForSubscriptionAsync(subscriptionId)
- .map(new Func1() {
+ .flatMapIterable(new Func1, Iterable>() {
@Override
- public PolicyEventsQueryResults call(PolicyEventsQueryResultsInner inner) {
- return new PolicyEventsQueryResultsImpl(inner, manager());
+ public Iterable call(Page page) {
+ return page.items();
+ }
+ })
+ .map(new Func1() {
+ @Override
+ public PolicyEvent call(PolicyEventInner inner) {
+ return new PolicyEventImpl(inner, manager());
}
});
}
@Override
- public Observable listQueryResultsForResourceGroupAsync(String subscriptionId, String resourceGroupName) {
+ public Observable listQueryResultsForResourceGroupAsync(final String subscriptionId, final String resourceGroupName) {
PolicyEventsInner client = this.inner();
return client.listQueryResultsForResourceGroupAsync(subscriptionId, resourceGroupName)
- .map(new Func1() {
+ .flatMapIterable(new Func1, Iterable>() {
+ @Override
+ public Iterable call(Page page) {
+ return page.items();
+ }
+ })
+ .map(new Func1() {
@Override
- public PolicyEventsQueryResults call(PolicyEventsQueryResultsInner inner) {
- return new PolicyEventsQueryResultsImpl(inner, manager());
+ public PolicyEvent call(PolicyEventInner inner) {
+ return new PolicyEventImpl(inner, manager());
}
});
}
@Override
- public Observable listQueryResultsForResourceAsync(String resourceId) {
+ public Observable listQueryResultsForResourceAsync(final String resourceId) {
PolicyEventsInner client = this.inner();
return client.listQueryResultsForResourceAsync(resourceId)
- .map(new Func1() {
+ .flatMapIterable(new Func1, Iterable>() {
+ @Override
+ public Iterable call(Page page) {
+ return page.items();
+ }
+ })
+ .map(new Func1() {
@Override
- public PolicyEventsQueryResults call(PolicyEventsQueryResultsInner inner) {
- return new PolicyEventsQueryResultsImpl(inner, manager());
+ public PolicyEvent call(PolicyEventInner inner) {
+ return new PolicyEventImpl(inner, manager());
}
});
}
@Override
- public Observable listQueryResultsForPolicySetDefinitionAsync(String subscriptionId, String policySetDefinitionName) {
+ public Observable listQueryResultsForPolicySetDefinitionAsync(final String subscriptionId, final String policySetDefinitionName) {
PolicyEventsInner client = this.inner();
return client.listQueryResultsForPolicySetDefinitionAsync(subscriptionId, policySetDefinitionName)
- .map(new Func1() {
+ .flatMapIterable(new Func1, Iterable>() {
+ @Override
+ public Iterable call(Page page) {
+ return page.items();
+ }
+ })
+ .map(new Func1() {
@Override
- public PolicyEventsQueryResults call(PolicyEventsQueryResultsInner inner) {
- return new PolicyEventsQueryResultsImpl(inner, manager());
+ public PolicyEvent call(PolicyEventInner inner) {
+ return new PolicyEventImpl(inner, manager());
}
});
}
@Override
- public Observable listQueryResultsForPolicyDefinitionAsync(String subscriptionId, String policyDefinitionName) {
+ public Observable listQueryResultsForPolicyDefinitionAsync(final String subscriptionId, final String policyDefinitionName) {
PolicyEventsInner client = this.inner();
return client.listQueryResultsForPolicyDefinitionAsync(subscriptionId, policyDefinitionName)
- .map(new Func1() {
+ .flatMapIterable(new Func1, Iterable>() {
@Override
- public PolicyEventsQueryResults call(PolicyEventsQueryResultsInner inner) {
- return new PolicyEventsQueryResultsImpl(inner, manager());
+ public Iterable call(Page page) {
+ return page.items();
+ }
+ })
+ .map(new Func1() {
+ @Override
+ public PolicyEvent call(PolicyEventInner inner) {
+ return new PolicyEventImpl(inner, manager());
}
});
}
@Override
- public Observable listQueryResultsForSubscriptionLevelPolicyAssignmentAsync(String subscriptionId, String policyAssignmentName) {
+ public Observable listQueryResultsForSubscriptionLevelPolicyAssignmentAsync(final String subscriptionId, final String policyAssignmentName) {
PolicyEventsInner client = this.inner();
return client.listQueryResultsForSubscriptionLevelPolicyAssignmentAsync(subscriptionId, policyAssignmentName)
- .map(new Func1() {
+ .flatMapIterable(new Func1, Iterable>() {
@Override
- public PolicyEventsQueryResults call(PolicyEventsQueryResultsInner inner) {
- return new PolicyEventsQueryResultsImpl(inner, manager());
+ public Iterable call(Page page) {
+ return page.items();
+ }
+ })
+ .map(new Func1() {
+ @Override
+ public PolicyEvent call(PolicyEventInner inner) {
+ return new PolicyEventImpl(inner, manager());
}
});
}
@Override
- public Observable listQueryResultsForResourceGroupLevelPolicyAssignmentAsync(String subscriptionId, String resourceGroupName, String policyAssignmentName) {
+ public Observable listQueryResultsForResourceGroupLevelPolicyAssignmentAsync(final String subscriptionId, final String resourceGroupName, final String policyAssignmentName) {
PolicyEventsInner client = this.inner();
return client.listQueryResultsForResourceGroupLevelPolicyAssignmentAsync(subscriptionId, resourceGroupName, policyAssignmentName)
- .map(new Func1() {
+ .flatMapIterable(new Func1, Iterable>() {
@Override
- public PolicyEventsQueryResults call(PolicyEventsQueryResultsInner inner) {
- return new PolicyEventsQueryResultsImpl(inner, manager());
+ public Iterable call(Page page) {
+ return page.items();
+ }
+ })
+ .map(new Func1() {
+ @Override
+ public PolicyEvent call(PolicyEventInner inner) {
+ return new PolicyEventImpl(inner, manager());
}
});
}
- @Override
- public Observable getMetadataAsync(String scope) {
- PolicyEventsInner client = this.inner();
- return client.getMetadataAsync(scope)
- ;}
-
}
diff --git a/sdk/policyinsights/mgmt-v2019_10_01/src/main/java/com/microsoft/azure/management/policyinsights/v2019_10_01/implementation/PolicyEventsInner.java b/sdk/policyinsights/mgmt-v2019_10_01/src/main/java/com/microsoft/azure/management/policyinsights/v2019_10_01/implementation/PolicyEventsInner.java
index d8ff1f941b71..cd9f1fc72f7e 100644
--- a/sdk/policyinsights/mgmt-v2019_10_01/src/main/java/com/microsoft/azure/management/policyinsights/v2019_10_01/implementation/PolicyEventsInner.java
+++ b/sdk/policyinsights/mgmt-v2019_10_01/src/main/java/com/microsoft/azure/management/policyinsights/v2019_10_01/implementation/PolicyEventsInner.java
@@ -10,13 +10,17 @@
import retrofit2.Retrofit;
import com.google.common.reflect.TypeToken;
+import com.microsoft.azure.AzureServiceFuture;
+import com.microsoft.azure.ListOperationCallback;
import com.microsoft.azure.management.policyinsights.v2019_10_01.QueryFailureException;
import com.microsoft.azure.management.policyinsights.v2019_10_01.QueryOptions;
-import com.microsoft.rest.ServiceCallback;
+import com.microsoft.azure.Page;
+import com.microsoft.azure.PagedList;
import com.microsoft.rest.ServiceFuture;
import com.microsoft.rest.ServiceResponse;
import com.microsoft.rest.Validator;
import java.io.IOException;
+import java.util.List;
import okhttp3.ResponseBody;
import org.joda.time.DateTime;
import retrofit2.http.GET;
@@ -25,6 +29,7 @@
import retrofit2.http.Path;
import retrofit2.http.POST;
import retrofit2.http.Query;
+import retrofit2.http.Url;
import retrofit2.Response;
import rx.functions.Func1;
import rx.Observable;
@@ -57,39 +62,67 @@ public PolicyEventsInner(Retrofit retrofit, PolicyInsightsClientImpl client) {
interface PolicyEventsService {
@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.policyinsights.v2019_10_01.PolicyEvents listQueryResultsForManagementGroup" })
@POST("providers/{managementGroupsNamespace}/managementGroups/{managementGroupName}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults")
- Observable> listQueryResultsForManagementGroup(@Path("policyEventsResource") String policyEventsResource, @Path("managementGroupsNamespace") String managementGroupsNamespace, @Path("managementGroupName") String managementGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Query("$top") Integer top, @Query("$orderby") String orderBy, @Query("$select") String select, @Query("$from") DateTime from, @Query("$to") DateTime to, @Query("$filter") String filter, @Query("$apply") String apply, @Header("User-Agent") String userAgent);
+ Observable> listQueryResultsForManagementGroup(@Path("policyEventsResource") String policyEventsResource, @Path("managementGroupsNamespace") String managementGroupsNamespace, @Path("managementGroupName") String managementGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Query("$top") Integer top, @Query("$orderby") String orderBy, @Query("$select") String select, @Query("$from") DateTime from, @Query("$to") DateTime to, @Query("$filter") String filter, @Query("$apply") String apply, @Query("$skiptoken") String skipToken, @Header("User-Agent") String userAgent);
@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.policyinsights.v2019_10_01.PolicyEvents listQueryResultsForSubscription" })
@POST("subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults")
- Observable> listQueryResultsForSubscription(@Path("policyEventsResource") String policyEventsResource, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Query("$top") Integer top, @Query("$orderby") String orderBy, @Query("$select") String select, @Query("$from") DateTime from, @Query("$to") DateTime to, @Query("$filter") String filter, @Query("$apply") String apply, @Header("User-Agent") String userAgent);
+ Observable> listQueryResultsForSubscription(@Path("policyEventsResource") String policyEventsResource, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Query("$top") Integer top, @Query("$orderby") String orderBy, @Query("$select") String select, @Query("$from") DateTime from, @Query("$to") DateTime to, @Query("$filter") String filter, @Query("$apply") String apply, @Query("$skiptoken") String skipToken, @Header("User-Agent") String userAgent);
@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.policyinsights.v2019_10_01.PolicyEvents listQueryResultsForResourceGroup" })
@POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults")
- Observable> listQueryResultsForResourceGroup(@Path("policyEventsResource") String policyEventsResource, @Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Query("$top") Integer top, @Query("$orderby") String orderBy, @Query("$select") String select, @Query("$from") DateTime from, @Query("$to") DateTime to, @Query("$filter") String filter, @Query("$apply") String apply, @Header("User-Agent") String userAgent);
+ Observable> listQueryResultsForResourceGroup(@Path("policyEventsResource") String policyEventsResource, @Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Query("$top") Integer top, @Query("$orderby") String orderBy, @Query("$select") String select, @Query("$from") DateTime from, @Query("$to") DateTime to, @Query("$filter") String filter, @Query("$apply") String apply, @Query("$skiptoken") String skipToken, @Header("User-Agent") String userAgent);
@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.policyinsights.v2019_10_01.PolicyEvents listQueryResultsForResource" })
@POST("{resourceId}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults")
- Observable> listQueryResultsForResource(@Path("policyEventsResource") String policyEventsResource, @Path(value = "resourceId", encoded = true) String resourceId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Query("$top") Integer top, @Query("$orderby") String orderBy, @Query("$select") String select, @Query("$from") DateTime from, @Query("$to") DateTime to, @Query("$filter") String filter, @Query("$apply") String apply, @Header("User-Agent") String userAgent);
+ Observable> listQueryResultsForResource(@Path("policyEventsResource") String policyEventsResource, @Path(value = "resourceId", encoded = true) String resourceId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Query("$top") Integer top, @Query("$orderby") String orderBy, @Query("$select") String select, @Query("$from") DateTime from, @Query("$to") DateTime to, @Query("$filter") String filter, @Query("$apply") String apply, @Query("$expand") String expand, @Query("$skiptoken") String skipToken, @Header("User-Agent") String userAgent);
@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.policyinsights.v2019_10_01.PolicyEvents listQueryResultsForPolicySetDefinition" })
@POST("subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policySetDefinitions/{policySetDefinitionName}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults")
- Observable> listQueryResultsForPolicySetDefinition(@Path("policyEventsResource") String policyEventsResource, @Path("subscriptionId") String subscriptionId, @Path("authorizationNamespace") String authorizationNamespace, @Path("policySetDefinitionName") String policySetDefinitionName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Query("$top") Integer top, @Query("$orderby") String orderBy, @Query("$select") String select, @Query("$from") DateTime from, @Query("$to") DateTime to, @Query("$filter") String filter, @Query("$apply") String apply, @Header("User-Agent") String userAgent);
+ Observable> listQueryResultsForPolicySetDefinition(@Path("policyEventsResource") String policyEventsResource, @Path("subscriptionId") String subscriptionId, @Path("authorizationNamespace") String authorizationNamespace, @Path("policySetDefinitionName") String policySetDefinitionName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Query("$top") Integer top, @Query("$orderby") String orderBy, @Query("$select") String select, @Query("$from") DateTime from, @Query("$to") DateTime to, @Query("$filter") String filter, @Query("$apply") String apply, @Query("$skiptoken") String skipToken, @Header("User-Agent") String userAgent);
@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.policyinsights.v2019_10_01.PolicyEvents listQueryResultsForPolicyDefinition" })
@POST("subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policyDefinitions/{policyDefinitionName}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults")
- Observable> listQueryResultsForPolicyDefinition(@Path("policyEventsResource") String policyEventsResource, @Path("subscriptionId") String subscriptionId, @Path("authorizationNamespace") String authorizationNamespace, @Path("policyDefinitionName") String policyDefinitionName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Query("$top") Integer top, @Query("$orderby") String orderBy, @Query("$select") String select, @Query("$from") DateTime from, @Query("$to") DateTime to, @Query("$filter") String filter, @Query("$apply") String apply, @Header("User-Agent") String userAgent);
+ Observable> listQueryResultsForPolicyDefinition(@Path("policyEventsResource") String policyEventsResource, @Path("subscriptionId") String subscriptionId, @Path("authorizationNamespace") String authorizationNamespace, @Path("policyDefinitionName") String policyDefinitionName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Query("$top") Integer top, @Query("$orderby") String orderBy, @Query("$select") String select, @Query("$from") DateTime from, @Query("$to") DateTime to, @Query("$filter") String filter, @Query("$apply") String apply, @Query("$skiptoken") String skipToken, @Header("User-Agent") String userAgent);
@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.policyinsights.v2019_10_01.PolicyEvents listQueryResultsForSubscriptionLevelPolicyAssignment" })
@POST("subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policyAssignments/{policyAssignmentName}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults")
- Observable> listQueryResultsForSubscriptionLevelPolicyAssignment(@Path("policyEventsResource") String policyEventsResource, @Path("subscriptionId") String subscriptionId, @Path("authorizationNamespace") String authorizationNamespace, @Path("policyAssignmentName") String policyAssignmentName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Query("$top") Integer top, @Query("$orderby") String orderBy, @Query("$select") String select, @Query("$from") DateTime from, @Query("$to") DateTime to, @Query("$filter") String filter, @Query("$apply") String apply, @Header("User-Agent") String userAgent);
+ Observable> listQueryResultsForSubscriptionLevelPolicyAssignment(@Path("policyEventsResource") String policyEventsResource, @Path("subscriptionId") String subscriptionId, @Path("authorizationNamespace") String authorizationNamespace, @Path("policyAssignmentName") String policyAssignmentName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Query("$top") Integer top, @Query("$orderby") String orderBy, @Query("$select") String select, @Query("$from") DateTime from, @Query("$to") DateTime to, @Query("$filter") String filter, @Query("$apply") String apply, @Query("$skiptoken") String skipToken, @Header("User-Agent") String userAgent);
@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.policyinsights.v2019_10_01.PolicyEvents listQueryResultsForResourceGroupLevelPolicyAssignment" })
@POST("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{authorizationNamespace}/policyAssignments/{policyAssignmentName}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults")
- Observable> listQueryResultsForResourceGroupLevelPolicyAssignment(@Path("policyEventsResource") String policyEventsResource, @Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("authorizationNamespace") String authorizationNamespace, @Path("policyAssignmentName") String policyAssignmentName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Query("$top") Integer top, @Query("$orderby") String orderBy, @Query("$select") String select, @Query("$from") DateTime from, @Query("$to") DateTime to, @Query("$filter") String filter, @Query("$apply") String apply, @Header("User-Agent") String userAgent);
+ Observable> listQueryResultsForResourceGroupLevelPolicyAssignment(@Path("policyEventsResource") String policyEventsResource, @Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("authorizationNamespace") String authorizationNamespace, @Path("policyAssignmentName") String policyAssignmentName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Query("$top") Integer top, @Query("$orderby") String orderBy, @Query("$select") String select, @Query("$from") DateTime from, @Query("$to") DateTime to, @Query("$filter") String filter, @Query("$apply") String apply, @Query("$skiptoken") String skipToken, @Header("User-Agent") String userAgent);
- @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.policyinsights.v2019_10_01.PolicyEvents getMetadata" })
- @GET("{scope}/providers/Microsoft.PolicyInsights/policyEvents/$metadata")
- Observable> getMetadata(@Path(value = "scope", encoded = true) String scope, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
+ @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.policyinsights.v2019_10_01.PolicyEvents listQueryResultsForManagementGroupNext" })
+ @GET
+ Observable> listQueryResultsForManagementGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
+
+ @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.policyinsights.v2019_10_01.PolicyEvents listQueryResultsForSubscriptionNext" })
+ @GET
+ Observable> listQueryResultsForSubscriptionNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
+
+ @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.policyinsights.v2019_10_01.PolicyEvents listQueryResultsForResourceGroupNext" })
+ @GET
+ Observable> listQueryResultsForResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
+
+ @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.policyinsights.v2019_10_01.PolicyEvents listQueryResultsForResourceNext" })
+ @GET
+ Observable> listQueryResultsForResourceNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
+
+ @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.policyinsights.v2019_10_01.PolicyEvents listQueryResultsForPolicySetDefinitionNext" })
+ @GET
+ Observable> listQueryResultsForPolicySetDefinitionNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
+
+ @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.policyinsights.v2019_10_01.PolicyEvents listQueryResultsForPolicyDefinitionNext" })
+ @GET
+ Observable> listQueryResultsForPolicyDefinitionNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
+
+ @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.policyinsights.v2019_10_01.PolicyEvents listQueryResultsForSubscriptionLevelPolicyAssignmentNext" })
+ @GET
+ Observable> listQueryResultsForSubscriptionLevelPolicyAssignmentNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
+
+ @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.policyinsights.v2019_10_01.PolicyEvents listQueryResultsForResourceGroupLevelPolicyAssignmentNext" })
+ @GET
+ Observable> listQueryResultsForResourceGroupLevelPolicyAssignmentNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
}
@@ -100,10 +133,16 @@ interface PolicyEventsService {
* @throws IllegalArgumentException thrown if parameters fail the validation
* @throws QueryFailureException thrown if the request is rejected by server
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
- * @return the PolicyEventsQueryResultsInner object if successful.
+ * @return the PagedList<PolicyEventInner> object if successful.
*/
- public PolicyEventsQueryResultsInner listQueryResultsForManagementGroup(String managementGroupName) {
- return listQueryResultsForManagementGroupWithServiceResponseAsync(managementGroupName).toBlocking().single().body();
+ public PagedList listQueryResultsForManagementGroup(final String managementGroupName) {
+ ServiceResponse> response = listQueryResultsForManagementGroupSinglePageAsync(managementGroupName).toBlocking().single();
+ return new PagedList(response.body()) {
+ @Override
+ public Page nextPage(String nextPageLink) {
+ return listQueryResultsForManagementGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body();
+ }
+ };
}
/**
@@ -114,8 +153,16 @@ public PolicyEventsQueryResultsInner listQueryResultsForManagementGroup(String m
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the {@link ServiceFuture} object
*/
- public ServiceFuture listQueryResultsForManagementGroupAsync(String managementGroupName, final ServiceCallback serviceCallback) {
- return ServiceFuture.fromResponse(listQueryResultsForManagementGroupWithServiceResponseAsync(managementGroupName), serviceCallback);
+ public ServiceFuture> listQueryResultsForManagementGroupAsync(final String managementGroupName, final ListOperationCallback serviceCallback) {
+ return AzureServiceFuture.fromPageResponse(
+ listQueryResultsForManagementGroupSinglePageAsync(managementGroupName),
+ new Func1>>>() {
+ @Override
+ public Observable>> call(String nextPageLink) {
+ return listQueryResultsForManagementGroupNextSinglePageAsync(nextPageLink);
+ }
+ },
+ serviceCallback);
}
/**
@@ -123,15 +170,16 @@ public ServiceFuture listQueryResultsForManagemen
*
* @param managementGroupName Management group name.
* @throws IllegalArgumentException thrown if parameters fail the validation
- * @return the observable to the PolicyEventsQueryResultsInner object
+ * @return the observable to the PagedList<PolicyEventInner> object
*/
- public Observable listQueryResultsForManagementGroupAsync(String managementGroupName) {
- return listQueryResultsForManagementGroupWithServiceResponseAsync(managementGroupName).map(new Func1, PolicyEventsQueryResultsInner>() {
- @Override
- public PolicyEventsQueryResultsInner call(ServiceResponse response) {
- return response.body();
- }
- });
+ public Observable> listQueryResultsForManagementGroupAsync(final String managementGroupName) {
+ return listQueryResultsForManagementGroupWithServiceResponseAsync(managementGroupName)
+ .map(new Func1>, Page>() {
+ @Override
+ public Page call(ServiceResponse> response) {
+ return response.body();
+ }
+ });
}
/**
@@ -139,15 +187,36 @@ public PolicyEventsQueryResultsInner call(ServiceResponse> listQueryResultsForManagementGroupWithServiceResponseAsync(String managementGroupName) {
+ public Observable>> listQueryResultsForManagementGroupWithServiceResponseAsync(final String managementGroupName) {
+ return listQueryResultsForManagementGroupSinglePageAsync(managementGroupName)
+ .concatMap(new Func1>, Observable>>>() {
+ @Override
+ public Observable>> call(ServiceResponse> page) {
+ String nextPageLink = page.body().nextPageLink();
+ if (nextPageLink == null) {
+ return Observable.just(page);
+ }
+ return Observable.just(page).concatWith(listQueryResultsForManagementGroupNextWithServiceResponseAsync(nextPageLink));
+ }
+ });
+ }
+
+ /**
+ * Queries policy events for the resources under the management group.
+ *
+ * @param managementGroupName Management group name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the PagedList<PolicyEventInner> object wrapped in {@link ServiceResponse} if successful.
+ */
+ public Observable>> listQueryResultsForManagementGroupSinglePageAsync(final String managementGroupName) {
if (managementGroupName == null) {
throw new IllegalArgumentException("Parameter managementGroupName is required and cannot be null.");
}
final String policyEventsResource = "default";
final String managementGroupsNamespace = "Microsoft.Management";
- final String apiVersion = "2018-04-04";
+ final String apiVersion = "2019-10-01";
final QueryOptions queryOptions = null;
Integer top = null;
String orderBy = null;
@@ -156,13 +225,14 @@ public Observable> listQueryResul
DateTime to = null;
String filter = null;
String apply = null;
- return service.listQueryResultsForManagementGroup(policyEventsResource, managementGroupsNamespace, managementGroupName, apiVersion, this.client.acceptLanguage(), top, orderBy, select, from, to, filter, apply, this.client.userAgent())
- .flatMap(new Func1, Observable>>() {
+ String skipToken = null;
+ return service.listQueryResultsForManagementGroup(policyEventsResource, managementGroupsNamespace, managementGroupName, apiVersion, this.client.acceptLanguage(), top, orderBy, select, from, to, filter, apply, skipToken, this.client.userAgent())
+ .flatMap(new Func1, Observable>>>() {
@Override
- public Observable> call(Response response) {
+ public Observable>> call(Response response) {
try {
- ServiceResponse clientResponse = listQueryResultsForManagementGroupDelegate(response);
- return Observable.just(clientResponse);
+ ServiceResponse> result = listQueryResultsForManagementGroupDelegate(response);
+ return Observable.just(new ServiceResponse>(result.body(), result.response()));
} catch (Throwable t) {
return Observable.error(t);
}
@@ -178,10 +248,16 @@ public Observable> call(Response<
* @throws IllegalArgumentException thrown if parameters fail the validation
* @throws QueryFailureException thrown if the request is rejected by server
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
- * @return the PolicyEventsQueryResultsInner object if successful.
+ * @return the PagedList<PolicyEventInner> object if successful.
*/
- public PolicyEventsQueryResultsInner listQueryResultsForManagementGroup(String managementGroupName, QueryOptions queryOptions) {
- return listQueryResultsForManagementGroupWithServiceResponseAsync(managementGroupName, queryOptions).toBlocking().single().body();
+ public PagedList listQueryResultsForManagementGroup(final String managementGroupName, final QueryOptions queryOptions) {
+ ServiceResponse> response = listQueryResultsForManagementGroupSinglePageAsync(managementGroupName, queryOptions).toBlocking().single();
+ return new PagedList(response.body()) {
+ @Override
+ public Page nextPage(String nextPageLink) {
+ return listQueryResultsForManagementGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body();
+ }
+ };
}
/**
@@ -193,8 +269,16 @@ public PolicyEventsQueryResultsInner listQueryResultsForManagementGroup(String m
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the {@link ServiceFuture} object
*/
- public ServiceFuture listQueryResultsForManagementGroupAsync(String managementGroupName, QueryOptions queryOptions, final ServiceCallback serviceCallback) {
- return ServiceFuture.fromResponse(listQueryResultsForManagementGroupWithServiceResponseAsync(managementGroupName, queryOptions), serviceCallback);
+ public ServiceFuture> listQueryResultsForManagementGroupAsync(final String managementGroupName, final QueryOptions queryOptions, final ListOperationCallback serviceCallback) {
+ return AzureServiceFuture.fromPageResponse(
+ listQueryResultsForManagementGroupSinglePageAsync(managementGroupName, queryOptions),
+ new Func1>>>() {
+ @Override
+ public Observable>> call(String nextPageLink) {
+ return listQueryResultsForManagementGroupNextSinglePageAsync(nextPageLink);
+ }
+ },
+ serviceCallback);
}
/**
@@ -203,15 +287,16 @@ public ServiceFuture listQueryResultsForManagemen
* @param managementGroupName Management group name.
* @param queryOptions Additional parameters for the operation
* @throws IllegalArgumentException thrown if parameters fail the validation
- * @return the observable to the PolicyEventsQueryResultsInner object
+ * @return the observable to the PagedList<PolicyEventInner> object
*/
- public Observable listQueryResultsForManagementGroupAsync(String managementGroupName, QueryOptions queryOptions) {
- return listQueryResultsForManagementGroupWithServiceResponseAsync(managementGroupName, queryOptions).map(new Func1, PolicyEventsQueryResultsInner>() {
- @Override
- public PolicyEventsQueryResultsInner call(ServiceResponse response) {
- return response.body();
- }
- });
+ public Observable> listQueryResultsForManagementGroupAsync(final String managementGroupName, final QueryOptions queryOptions) {
+ return listQueryResultsForManagementGroupWithServiceResponseAsync(managementGroupName, queryOptions)
+ .map(new Func1>, Page>() {
+ @Override
+ public Page call(ServiceResponse> response) {
+ return response.body();
+ }
+ });
}
/**
@@ -220,16 +305,38 @@ public PolicyEventsQueryResultsInner call(ServiceResponse>> listQueryResultsForManagementGroupWithServiceResponseAsync(final String managementGroupName, final QueryOptions queryOptions) {
+ return listQueryResultsForManagementGroupSinglePageAsync(managementGroupName, queryOptions)
+ .concatMap(new Func1>, Observable>>>() {
+ @Override
+ public Observable>> call(ServiceResponse> page) {
+ String nextPageLink = page.body().nextPageLink();
+ if (nextPageLink == null) {
+ return Observable.just(page);
+ }
+ return Observable.just(page).concatWith(listQueryResultsForManagementGroupNextWithServiceResponseAsync(nextPageLink));
+ }
+ });
+ }
+
+ /**
+ * Queries policy events for the resources under the management group.
+ *
+ ServiceResponse> * @param managementGroupName Management group name.
+ ServiceResponse> * @param queryOptions Additional parameters for the operation
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the PagedList<PolicyEventInner> object wrapped in {@link ServiceResponse} if successful.
*/
- public Observable> listQueryResultsForManagementGroupWithServiceResponseAsync(String managementGroupName, QueryOptions queryOptions) {
+ public Observable>> listQueryResultsForManagementGroupSinglePageAsync(final String managementGroupName, final QueryOptions queryOptions) {
if (managementGroupName == null) {
throw new IllegalArgumentException("Parameter managementGroupName is required and cannot be null.");
}
Validator.validate(queryOptions);
final String policyEventsResource = "default";
final String managementGroupsNamespace = "Microsoft.Management";
- final String apiVersion = "2018-04-04";
+ final String apiVersion = "2019-10-01";
Integer top = null;
if (queryOptions != null) {
top = queryOptions.top();
@@ -258,13 +365,17 @@ public Observable> listQueryResul
if (queryOptions != null) {
apply = queryOptions.apply();
}
- return service.listQueryResultsForManagementGroup(policyEventsResource, managementGroupsNamespace, managementGroupName, apiVersion, this.client.acceptLanguage(), top, orderBy, select, from, to, filter, apply, this.client.userAgent())
- .flatMap(new Func1, Observable>>() {
+ String skipToken = null;
+ if (queryOptions != null) {
+ skipToken = queryOptions.skipToken();
+ }
+ return service.listQueryResultsForManagementGroup(policyEventsResource, managementGroupsNamespace, managementGroupName, apiVersion, this.client.acceptLanguage(), top, orderBy, select, from, to, filter, apply, skipToken, this.client.userAgent())
+ .flatMap(new Func1, Observable>>>() {
@Override
- public Observable> call(Response response) {
+ public Observable>> call(Response response) {
try {
- ServiceResponse clientResponse = listQueryResultsForManagementGroupDelegate(response);
- return Observable.just(clientResponse);
+ ServiceResponse> result = listQueryResultsForManagementGroupDelegate(response);
+ return Observable.just(new ServiceResponse>(result.body(), result.response()));
} catch (Throwable t) {
return Observable.error(t);
}
@@ -272,9 +383,9 @@ public Observable> call(Response<
});
}
- private ServiceResponse listQueryResultsForManagementGroupDelegate(Response response) throws QueryFailureException, IOException, IllegalArgumentException {
- return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter())
- .register(200, new TypeToken() { }.getType())
+ private ServiceResponse> listQueryResultsForManagementGroupDelegate(Response response) throws QueryFailureException, IOException, IllegalArgumentException {
+ return this.client.restClient().responseBuilderFactory()., QueryFailureException>newInstance(this.client.serializerAdapter())
+ .register(200, new TypeToken>() { }.getType())
.registerError(QueryFailureException.class)
.build(response);
}
@@ -286,10 +397,16 @@ private ServiceResponse listQueryResultsForManage
* @throws IllegalArgumentException thrown if parameters fail the validation
* @throws QueryFailureException thrown if the request is rejected by server
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
- * @return the PolicyEventsQueryResultsInner object if successful.
+ * @return the PagedList<PolicyEventInner> object if successful.
*/
- public PolicyEventsQueryResultsInner listQueryResultsForSubscription(String subscriptionId) {
- return listQueryResultsForSubscriptionWithServiceResponseAsync(subscriptionId).toBlocking().single().body();
+ public PagedList listQueryResultsForSubscription(final String subscriptionId) {
+ ServiceResponse> response = listQueryResultsForSubscriptionSinglePageAsync(subscriptionId).toBlocking().single();
+ return new PagedList(response.body()) {
+ @Override
+ public Page nextPage(String nextPageLink) {
+ return listQueryResultsForSubscriptionNextSinglePageAsync(nextPageLink).toBlocking().single().body();
+ }
+ };
}
/**
@@ -300,8 +417,16 @@ public PolicyEventsQueryResultsInner listQueryResultsForSubscription(String subs
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the {@link ServiceFuture} object
*/
- public ServiceFuture listQueryResultsForSubscriptionAsync(String subscriptionId, final ServiceCallback serviceCallback) {
- return ServiceFuture.fromResponse(listQueryResultsForSubscriptionWithServiceResponseAsync(subscriptionId), serviceCallback);
+ public ServiceFuture> listQueryResultsForSubscriptionAsync(final String subscriptionId, final ListOperationCallback serviceCallback) {
+ return AzureServiceFuture.fromPageResponse(
+ listQueryResultsForSubscriptionSinglePageAsync(subscriptionId),
+ new Func1>>>() {
+ @Override
+ public Observable>> call(String nextPageLink) {
+ return listQueryResultsForSubscriptionNextSinglePageAsync(nextPageLink);
+ }
+ },
+ serviceCallback);
}
/**
@@ -309,15 +434,37 @@ public ServiceFuture