diff --git a/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/IPolicyEventsOperations.cs b/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/IPolicyEventsOperations.cs
index e90994caa876..c87ff101479a 100644
--- a/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/IPolicyEventsOperations.cs
+++ b/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/IPolicyEventsOperations.cs
@@ -47,7 +47,7 @@ public partial interface IPolicyEventsOperations
///
/// Thrown when a required parameter is null
///
- Task> ListQueryResultsForManagementGroupWithHttpMessagesAsync(string managementGroupName, QueryOptions queryOptions = default(QueryOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task>> ListQueryResultsForManagementGroupWithHttpMessagesAsync(string managementGroupName, QueryOptions queryOptions = default(QueryOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
/// Queries policy events for the resources under the subscription.
///
@@ -72,7 +72,7 @@ public partial interface IPolicyEventsOperations
///
/// Thrown when a required parameter is null
///
- Task> ListQueryResultsForSubscriptionWithHttpMessagesAsync(string subscriptionId, QueryOptions queryOptions = default(QueryOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task>> ListQueryResultsForSubscriptionWithHttpMessagesAsync(string subscriptionId, QueryOptions queryOptions = default(QueryOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
/// Queries policy events for the resources under the resource group.
///
@@ -100,7 +100,7 @@ public partial interface IPolicyEventsOperations
///
/// Thrown when a required parameter is null
///
- Task> ListQueryResultsForResourceGroupWithHttpMessagesAsync(string subscriptionId, string resourceGroupName, QueryOptions queryOptions = default(QueryOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task>> ListQueryResultsForResourceGroupWithHttpMessagesAsync(string subscriptionId, string resourceGroupName, QueryOptions queryOptions = default(QueryOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
/// Queries policy events for the resource.
///
@@ -125,7 +125,7 @@ public partial interface IPolicyEventsOperations
///
/// Thrown when a required parameter is null
///
- Task> ListQueryResultsForResourceWithHttpMessagesAsync(string resourceId, QueryOptions queryOptions = default(QueryOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task>> ListQueryResultsForResourceWithHttpMessagesAsync(string resourceId, QueryOptions queryOptions = default(QueryOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
/// Queries policy events for the subscription level policy set
/// definition.
@@ -154,7 +154,7 @@ public partial interface IPolicyEventsOperations
///
/// Thrown when a required parameter is null
///
- Task> ListQueryResultsForPolicySetDefinitionWithHttpMessagesAsync(string subscriptionId, string policySetDefinitionName, QueryOptions queryOptions = default(QueryOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task>> ListQueryResultsForPolicySetDefinitionWithHttpMessagesAsync(string subscriptionId, string policySetDefinitionName, QueryOptions queryOptions = default(QueryOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
/// Queries policy events for the subscription level policy definition.
///
@@ -182,7 +182,7 @@ public partial interface IPolicyEventsOperations
///
/// Thrown when a required parameter is null
///
- Task> ListQueryResultsForPolicyDefinitionWithHttpMessagesAsync(string subscriptionId, string policyDefinitionName, QueryOptions queryOptions = default(QueryOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task>> ListQueryResultsForPolicyDefinitionWithHttpMessagesAsync(string subscriptionId, string policyDefinitionName, QueryOptions queryOptions = default(QueryOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
/// Queries policy events for the subscription level policy assignment.
///
@@ -210,7 +210,7 @@ public partial interface IPolicyEventsOperations
///
/// Thrown when a required parameter is null
///
- Task> ListQueryResultsForSubscriptionLevelPolicyAssignmentWithHttpMessagesAsync(string subscriptionId, string policyAssignmentName, QueryOptions queryOptions = default(QueryOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task>> ListQueryResultsForSubscriptionLevelPolicyAssignmentWithHttpMessagesAsync(string subscriptionId, string policyAssignmentName, QueryOptions queryOptions = default(QueryOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
/// Queries policy events for the resource group level policy
/// assignment.
@@ -242,13 +242,168 @@ public partial interface IPolicyEventsOperations
///
/// Thrown when a required parameter is null
///
- Task> ListQueryResultsForResourceGroupLevelPolicyAssignmentWithHttpMessagesAsync(string subscriptionId, string resourceGroupName, string policyAssignmentName, QueryOptions queryOptions = default(QueryOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task>> ListQueryResultsForResourceGroupLevelPolicyAssignmentWithHttpMessagesAsync(string subscriptionId, string resourceGroupName, string policyAssignmentName, QueryOptions queryOptions = default(QueryOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
- /// Gets OData metadata XML document.
+ /// Queries policy events for the resources under the management group.
+ ///
+ ///
+ /// The NextLink from the previous successful call to List operation.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task>> ListQueryResultsForManagementGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Queries policy events for the resources under the subscription.
+ ///
+ ///
+ /// The NextLink from the previous successful call to List operation.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task>> ListQueryResultsForSubscriptionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Queries policy events for the resources under the resource group.
+ ///
+ ///
+ /// The NextLink from the previous successful call to List operation.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task>> ListQueryResultsForResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Queries policy events for the resource.
+ ///
+ ///
+ /// The NextLink from the previous successful call to List operation.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task>> ListQueryResultsForResourceNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Queries policy events for the subscription level policy set
+ /// definition.
+ ///
+ ///
+ /// The NextLink from the previous successful call to List operation.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task>> ListQueryResultsForPolicySetDefinitionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Queries policy events for the subscription level policy definition.
+ ///
+ ///
+ /// The NextLink from the previous successful call to List operation.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task>> ListQueryResultsForPolicyDefinitionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Queries policy events for the subscription level policy assignment.
+ ///
+ ///
+ /// The NextLink from the previous successful call to List operation.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task>> ListQueryResultsForSubscriptionLevelPolicyAssignmentNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Queries policy events for the resource group level policy
+ /// assignment.
///
- ///
- /// A valid scope, i.e. management group, subscription, resource group,
- /// or resource ID. Scope used has no effect on metadata returned.
+ ///
+ /// The NextLink from the previous successful call to List operation.
///
///
/// The headers that will be added to request.
@@ -265,6 +420,6 @@ public partial interface IPolicyEventsOperations
///
/// Thrown when a required parameter is null
///
- Task> GetMetadataWithHttpMessagesAsync(string scope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task>> ListQueryResultsForResourceGroupLevelPolicyAssignmentNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
}
}
diff --git a/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/IPolicyInsightsClient.cs b/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/IPolicyInsightsClient.cs
index 4a5a154b404f..629ed9584163 100644
--- a/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/IPolicyInsightsClient.cs
+++ b/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/IPolicyInsightsClient.cs
@@ -39,6 +39,11 @@ public partial interface IPolicyInsightsClient : System.IDisposable
///
ServiceClientCredentials Credentials { get; }
+ ///
+ /// The ID of the target subscription.
+ ///
+ string SubscriptionId2 { get; set; }
+
///
/// The preferred language for the response.
///
@@ -88,5 +93,10 @@ public partial interface IPolicyInsightsClient : System.IDisposable
///
IPolicyMetadataOperations PolicyMetadata { get; }
+ ///
+ /// Gets the IPolicyRestrictionsOperations.
+ ///
+ IPolicyRestrictionsOperations PolicyRestrictions { get; }
+
}
}
diff --git a/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/IPolicyRestrictionsOperations.cs b/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/IPolicyRestrictionsOperations.cs
new file mode 100644
index 000000000000..67a77a6ec610
--- /dev/null
+++ b/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/IPolicyRestrictionsOperations.cs
@@ -0,0 +1,83 @@
+//
+// 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.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.PolicyInsights
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Azure;
+ using Models;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Threading;
+ using System.Threading.Tasks;
+
+ ///
+ /// PolicyRestrictionsOperations operations.
+ ///
+ public partial interface IPolicyRestrictionsOperations
+ {
+ ///
+ /// Checks what restrictions Azure Policy will place on a resource
+ /// within a subscription.
+ ///
+ ///
+ /// The ID of the target subscription.
+ ///
+ ///
+ /// The check policy restrictions parameters.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task> CheckAtSubscriptionScopeWithHttpMessagesAsync(string subscriptionId, CheckRestrictionsRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Checks what restrictions Azure Policy will place on a resource
+ /// within a resource group. Use this when the resource group the
+ /// resource will be created in is already known.
+ ///
+ ///
+ /// The ID of the target subscription.
+ ///
+ ///
+ /// The name of the resource group. The name is case insensitive.
+ ///
+ ///
+ /// The check policy restrictions parameters.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task> CheckAtResourceGroupScopeWithHttpMessagesAsync(string subscriptionId, string resourceGroupName, CheckRestrictionsRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ }
+}
diff --git a/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/IPolicyStatesOperations.cs b/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/IPolicyStatesOperations.cs
index 3c1afc8af939..823d7d7d6c44 100644
--- a/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/IPolicyStatesOperations.cs
+++ b/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/IPolicyStatesOperations.cs
@@ -53,7 +53,7 @@ public partial interface IPolicyStatesOperations
///
/// Thrown when a required parameter is null
///
- Task> ListQueryResultsForManagementGroupWithHttpMessagesAsync(string policyStatesResource, string managementGroupName, QueryOptions queryOptions = default(QueryOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task>> ListQueryResultsForManagementGroupWithHttpMessagesAsync(string policyStatesResource, string managementGroupName, QueryOptions queryOptions = default(QueryOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
/// Summarizes policy states for the resources under the management
/// group.
@@ -110,7 +110,7 @@ public partial interface IPolicyStatesOperations
///
/// Thrown when a required parameter is null
///
- Task> ListQueryResultsForSubscriptionWithHttpMessagesAsync(string policyStatesResource, string subscriptionId, QueryOptions queryOptions = default(QueryOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task>> ListQueryResultsForSubscriptionWithHttpMessagesAsync(string policyStatesResource, string subscriptionId, QueryOptions queryOptions = default(QueryOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
/// Summarizes policy states for the resources under the subscription.
///
@@ -169,7 +169,7 @@ public partial interface IPolicyStatesOperations
///
/// Thrown when a required parameter is null
///
- Task> ListQueryResultsForResourceGroupWithHttpMessagesAsync(string policyStatesResource, string subscriptionId, string resourceGroupName, QueryOptions queryOptions = default(QueryOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task>> ListQueryResultsForResourceGroupWithHttpMessagesAsync(string policyStatesResource, string subscriptionId, string resourceGroupName, QueryOptions queryOptions = default(QueryOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
/// Summarizes policy states for the resources under the resource
/// group.
@@ -229,7 +229,7 @@ public partial interface IPolicyStatesOperations
///
/// Thrown when a required parameter is null
///
- Task> ListQueryResultsForResourceWithHttpMessagesAsync(string policyStatesResource, string resourceId, QueryOptions queryOptions = default(QueryOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task>> ListQueryResultsForResourceWithHttpMessagesAsync(string policyStatesResource, string resourceId, QueryOptions queryOptions = default(QueryOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
/// Summarizes policy states for the resource.
///
@@ -332,7 +332,7 @@ public partial interface IPolicyStatesOperations
///
/// Thrown when a required parameter is null
///
- Task> ListQueryResultsForPolicySetDefinitionWithHttpMessagesAsync(string policyStatesResource, string subscriptionId, string policySetDefinitionName, QueryOptions queryOptions = default(QueryOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task>> ListQueryResultsForPolicySetDefinitionWithHttpMessagesAsync(string policyStatesResource, string subscriptionId, string policySetDefinitionName, QueryOptions queryOptions = default(QueryOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
/// Summarizes policy states for the subscription level policy set
/// definition.
@@ -395,7 +395,7 @@ public partial interface IPolicyStatesOperations
///
/// Thrown when a required parameter is null
///
- Task> ListQueryResultsForPolicyDefinitionWithHttpMessagesAsync(string policyStatesResource, string subscriptionId, string policyDefinitionName, QueryOptions queryOptions = default(QueryOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task>> ListQueryResultsForPolicyDefinitionWithHttpMessagesAsync(string policyStatesResource, string subscriptionId, string policyDefinitionName, QueryOptions queryOptions = default(QueryOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
/// Summarizes policy states for the subscription level policy
/// definition.
@@ -458,7 +458,7 @@ public partial interface IPolicyStatesOperations
///
/// Thrown when a required parameter is null
///
- Task> ListQueryResultsForSubscriptionLevelPolicyAssignmentWithHttpMessagesAsync(string policyStatesResource, string subscriptionId, string policyAssignmentName, QueryOptions queryOptions = default(QueryOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task>> ListQueryResultsForSubscriptionLevelPolicyAssignmentWithHttpMessagesAsync(string policyStatesResource, string subscriptionId, string policyAssignmentName, QueryOptions queryOptions = default(QueryOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
/// Summarizes policy states for the subscription level policy
/// assignment.
@@ -525,7 +525,7 @@ public partial interface IPolicyStatesOperations
///
/// Thrown when a required parameter is null
///
- Task> ListQueryResultsForResourceGroupLevelPolicyAssignmentWithHttpMessagesAsync(string policyStatesResource, string subscriptionId, string resourceGroupName, string policyAssignmentName, QueryOptions queryOptions = default(QueryOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task>> ListQueryResultsForResourceGroupLevelPolicyAssignmentWithHttpMessagesAsync(string policyStatesResource, string subscriptionId, string resourceGroupName, string policyAssignmentName, QueryOptions queryOptions = default(QueryOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
/// Summarizes policy states for the resource group level policy
/// assignment.
@@ -601,5 +601,183 @@ public partial interface IPolicyStatesOperations
/// Thrown when a required parameter is null
///
Task BeginTriggerResourceGroupEvaluationWithHttpMessagesAsync(string subscriptionId, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Queries policy states for the resources under the management group.
+ ///
+ ///
+ /// The NextLink from the previous successful call to List operation.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task>> ListQueryResultsForManagementGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Queries policy states for the resources under the subscription.
+ ///
+ ///
+ /// The NextLink from the previous successful call to List operation.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task>> ListQueryResultsForSubscriptionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Queries policy states for the resources under the resource group.
+ ///
+ ///
+ /// The NextLink from the previous successful call to List operation.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task>> ListQueryResultsForResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Queries policy states for the resource.
+ ///
+ ///
+ /// The NextLink from the previous successful call to List operation.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task>> ListQueryResultsForResourceNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Queries policy states for the subscription level policy set
+ /// definition.
+ ///
+ ///
+ /// The NextLink from the previous successful call to List operation.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task>> ListQueryResultsForPolicySetDefinitionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Queries policy states for the subscription level policy definition.
+ ///
+ ///
+ /// The NextLink from the previous successful call to List operation.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task>> ListQueryResultsForPolicyDefinitionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Queries policy states for the subscription level policy assignment.
+ ///
+ ///
+ /// The NextLink from the previous successful call to List operation.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task>> ListQueryResultsForSubscriptionLevelPolicyAssignmentNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Queries policy states for the resource group level policy
+ /// assignment.
+ ///
+ ///
+ /// The NextLink from the previous successful call to List operation.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task>> ListQueryResultsForResourceGroupLevelPolicyAssignmentNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
}
}
diff --git a/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/Models/CheckRestrictionsRequest.cs b/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/Models/CheckRestrictionsRequest.cs
new file mode 100644
index 000000000000..4dfcb41ef228
--- /dev/null
+++ b/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/Models/CheckRestrictionsRequest.cs
@@ -0,0 +1,94 @@
+//
+// 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.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.PolicyInsights.Models
+{
+ using Microsoft.Rest;
+ using Newtonsoft.Json;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Linq;
+
+ ///
+ /// The check policy restrictions parameters describing the resource that
+ /// is being evaluated.
+ ///
+ public partial class CheckRestrictionsRequest
+ {
+ ///
+ /// Initializes a new instance of the CheckRestrictionsRequest class.
+ ///
+ public CheckRestrictionsRequest()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the CheckRestrictionsRequest class.
+ ///
+ /// The information about the resource
+ /// that will be evaluated.
+ /// The list of fields and values that
+ /// should be evaluated for potential restrictions.
+ public CheckRestrictionsRequest(CheckRestrictionsResourceDetails resourceDetails, IList pendingFields = default(IList))
+ {
+ ResourceDetails = resourceDetails;
+ PendingFields = pendingFields;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets or sets the information about the resource that will be
+ /// evaluated.
+ ///
+ [JsonProperty(PropertyName = "resourceDetails")]
+ public CheckRestrictionsResourceDetails ResourceDetails { get; set; }
+
+ ///
+ /// Gets or sets the list of fields and values that should be evaluated
+ /// for potential restrictions.
+ ///
+ [JsonProperty(PropertyName = "pendingFields")]
+ public IList PendingFields { get; set; }
+
+ ///
+ /// Validate the object.
+ ///
+ ///
+ /// Thrown if validation fails
+ ///
+ public virtual void Validate()
+ {
+ if (ResourceDetails == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "ResourceDetails");
+ }
+ if (ResourceDetails != null)
+ {
+ ResourceDetails.Validate();
+ }
+ if (PendingFields != null)
+ {
+ foreach (var element in PendingFields)
+ {
+ if (element != null)
+ {
+ element.Validate();
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/Models/CheckRestrictionsResourceDetails.cs b/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/Models/CheckRestrictionsResourceDetails.cs
new file mode 100644
index 000000000000..38c72215ce08
--- /dev/null
+++ b/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/Models/CheckRestrictionsResourceDetails.cs
@@ -0,0 +1,92 @@
+//
+// 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.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.PolicyInsights.Models
+{
+ using Microsoft.Rest;
+ using Newtonsoft.Json;
+ using System.Linq;
+
+ ///
+ /// The information about the resource that will be evaluated.
+ ///
+ public partial class CheckRestrictionsResourceDetails
+ {
+ ///
+ /// Initializes a new instance of the CheckRestrictionsResourceDetails
+ /// class.
+ ///
+ public CheckRestrictionsResourceDetails()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the CheckRestrictionsResourceDetails
+ /// class.
+ ///
+ /// The resource content. This should
+ /// include whatever properties are already known and can be a partial
+ /// set of all resource properties.
+ /// The api-version of the resource
+ /// content.
+ /// 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.
+ public CheckRestrictionsResourceDetails(object resourceContent, string apiVersion = default(string), string scope = default(string))
+ {
+ ResourceContent = resourceContent;
+ ApiVersion = apiVersion;
+ Scope = scope;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets or sets the resource content. This should include whatever
+ /// properties are already known and can be a partial set of all
+ /// resource properties.
+ ///
+ [JsonProperty(PropertyName = "resourceContent")]
+ public object ResourceContent { get; set; }
+
+ ///
+ /// Gets or sets the api-version of the resource content.
+ ///
+ [JsonProperty(PropertyName = "apiVersion")]
+ public string ApiVersion { get; set; }
+
+ ///
+ /// Gets or sets 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(PropertyName = "scope")]
+ public string Scope { get; set; }
+
+ ///
+ /// Validate the object.
+ ///
+ ///
+ /// Thrown if validation fails
+ ///
+ public virtual void Validate()
+ {
+ if (ResourceContent == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "ResourceContent");
+ }
+ }
+ }
+}
diff --git a/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/Models/CheckRestrictionsResult.cs b/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/Models/CheckRestrictionsResult.cs
new file mode 100644
index 000000000000..9016faf1818e
--- /dev/null
+++ b/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/Models/CheckRestrictionsResult.cs
@@ -0,0 +1,64 @@
+//
+// 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.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.PolicyInsights.Models
+{
+ using Newtonsoft.Json;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Linq;
+
+ ///
+ /// The result of a check policy restrictions evaluation on a resource.
+ ///
+ public partial class CheckRestrictionsResult
+ {
+ ///
+ /// Initializes a new instance of the CheckRestrictionsResult class.
+ ///
+ public CheckRestrictionsResult()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the CheckRestrictionsResult class.
+ ///
+ /// The restrictions that will be
+ /// placed on various fields in the resource by policy.
+ /// Evaluation results for the
+ /// provided partial resource content.
+ public CheckRestrictionsResult(IList fieldRestrictions = default(IList), CheckRestrictionsResultContentEvaluationResult contentEvaluationResult = default(CheckRestrictionsResultContentEvaluationResult))
+ {
+ FieldRestrictions = fieldRestrictions;
+ ContentEvaluationResult = contentEvaluationResult;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets the restrictions that will be placed on various fields in the
+ /// resource by policy.
+ ///
+ [JsonProperty(PropertyName = "fieldRestrictions")]
+ public IList FieldRestrictions { get; private set; }
+
+ ///
+ /// Gets evaluation results for the provided partial resource content.
+ ///
+ [JsonProperty(PropertyName = "contentEvaluationResult")]
+ public CheckRestrictionsResultContentEvaluationResult ContentEvaluationResult { get; private set; }
+
+ }
+}
diff --git a/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/Models/CheckRestrictionsResultContentEvaluationResult.cs b/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/Models/CheckRestrictionsResultContentEvaluationResult.cs
new file mode 100644
index 000000000000..22a854ef35cf
--- /dev/null
+++ b/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/Models/CheckRestrictionsResultContentEvaluationResult.cs
@@ -0,0 +1,59 @@
+//
+// 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.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.PolicyInsights.Models
+{
+ using Newtonsoft.Json;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Linq;
+
+ ///
+ /// Evaluation results for the provided partial resource content.
+ ///
+ public partial class CheckRestrictionsResultContentEvaluationResult
+ {
+ ///
+ /// Initializes a new instance of the
+ /// CheckRestrictionsResultContentEvaluationResult class.
+ ///
+ public CheckRestrictionsResultContentEvaluationResult()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the
+ /// 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.
+ public CheckRestrictionsResultContentEvaluationResult(IList policyEvaluations = default(IList))
+ {
+ PolicyEvaluations = policyEvaluations;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets or sets policy evaluation results against the given resource
+ /// content. This will indicate if the partial content that was
+ /// provided will be denied as-is.
+ ///
+ [JsonProperty(PropertyName = "policyEvaluations")]
+ public IList PolicyEvaluations { get; set; }
+
+ }
+}
diff --git a/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/Models/ComponentEventDetails.cs b/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/Models/ComponentEventDetails.cs
new file mode 100644
index 000000000000..0ed36f5d131b
--- /dev/null
+++ b/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/Models/ComponentEventDetails.cs
@@ -0,0 +1,117 @@
+//
+// 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.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.PolicyInsights.Models
+{
+ using Newtonsoft.Json;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Linq;
+
+ ///
+ /// Component event details.
+ ///
+ public partial class ComponentEventDetails
+ {
+ ///
+ /// Initializes a new instance of the ComponentEventDetails class.
+ ///
+ public ComponentEventDetails()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the ComponentEventDetails class.
+ ///
+ /// Unmatched properties from the
+ /// message are deserialized this collection
+ /// Component Id.
+ /// Component type.
+ /// Component name.
+ /// Timestamp for component policy event
+ /// record.
+ /// Tenant ID for the policy event
+ /// record.
+ /// Principal object ID for the user who
+ /// initiated the resource component operation that triggered the
+ /// policy event.
+ /// Policy definition action, i.e.
+ /// effect.
+ public ComponentEventDetails(IDictionary additionalProperties = default(IDictionary), string id = default(string), string type = default(string), string name = default(string), System.DateTime? timestamp = default(System.DateTime?), string tenantId = default(string), string principalOid = default(string), string policyDefinitionAction = default(string))
+ {
+ AdditionalProperties = additionalProperties;
+ Id = id;
+ Type = type;
+ Name = name;
+ Timestamp = timestamp;
+ TenantId = tenantId;
+ PrincipalOid = principalOid;
+ PolicyDefinitionAction = policyDefinitionAction;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets or sets unmatched properties from the message are deserialized
+ /// this collection
+ ///
+ [JsonExtensionData]
+ public IDictionary AdditionalProperties { get; set; }
+
+ ///
+ /// Gets or sets component Id.
+ ///
+ [JsonProperty(PropertyName = "id")]
+ public string Id { get; set; }
+
+ ///
+ /// Gets or sets component type.
+ ///
+ [JsonProperty(PropertyName = "type")]
+ public string Type { get; set; }
+
+ ///
+ /// Gets or sets component name.
+ ///
+ [JsonProperty(PropertyName = "name")]
+ public string Name { get; set; }
+
+ ///
+ /// Gets or sets timestamp for component policy event record.
+ ///
+ [JsonProperty(PropertyName = "timestamp")]
+ public System.DateTime? Timestamp { get; set; }
+
+ ///
+ /// Gets or sets tenant ID for the policy event record.
+ ///
+ [JsonProperty(PropertyName = "tenantId")]
+ public string TenantId { get; set; }
+
+ ///
+ /// Gets or sets principal object ID for the user who initiated the
+ /// resource component operation that triggered the policy event.
+ ///
+ [JsonProperty(PropertyName = "principalOid")]
+ public string PrincipalOid { get; set; }
+
+ ///
+ /// Gets or sets policy definition action, i.e. effect.
+ ///
+ [JsonProperty(PropertyName = "policyDefinitionAction")]
+ public string PolicyDefinitionAction { get; set; }
+
+ }
+}
diff --git a/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/Models/ComponentStateDetails.cs b/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/Models/ComponentStateDetails.cs
new file mode 100644
index 000000000000..14afe5cc32f1
--- /dev/null
+++ b/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/Models/ComponentStateDetails.cs
@@ -0,0 +1,96 @@
+//
+// 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.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.PolicyInsights.Models
+{
+ using Newtonsoft.Json;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Linq;
+
+ ///
+ /// Component state details.
+ ///
+ public partial class ComponentStateDetails
+ {
+ ///
+ /// Initializes a new instance of the ComponentStateDetails class.
+ ///
+ public ComponentStateDetails()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the ComponentStateDetails class.
+ ///
+ /// Unmatched properties from the
+ /// message are deserialized this collection
+ /// Component Id.
+ /// Component type.
+ /// Component name.
+ /// Component compliance evaluation
+ /// timestamp.
+ /// Component compliance state.
+ public ComponentStateDetails(IDictionary additionalProperties = default(IDictionary), string id = default(string), string type = default(string), string name = default(string), System.DateTime? timestamp = default(System.DateTime?), string complianceState = default(string))
+ {
+ AdditionalProperties = additionalProperties;
+ Id = id;
+ Type = type;
+ Name = name;
+ Timestamp = timestamp;
+ ComplianceState = complianceState;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets or sets unmatched properties from the message are deserialized
+ /// this collection
+ ///
+ [JsonExtensionData]
+ public IDictionary AdditionalProperties { get; set; }
+
+ ///
+ /// Gets or sets component Id.
+ ///
+ [JsonProperty(PropertyName = "id")]
+ public string Id { get; set; }
+
+ ///
+ /// Gets or sets component type.
+ ///
+ [JsonProperty(PropertyName = "type")]
+ public string Type { get; set; }
+
+ ///
+ /// Gets or sets component name.
+ ///
+ [JsonProperty(PropertyName = "name")]
+ public string Name { get; set; }
+
+ ///
+ /// Gets or sets component compliance evaluation timestamp.
+ ///
+ [JsonProperty(PropertyName = "timestamp")]
+ public System.DateTime? Timestamp { get; set; }
+
+ ///
+ /// Gets or sets component compliance state.
+ ///
+ [JsonProperty(PropertyName = "complianceState")]
+ public string ComplianceState { get; set; }
+
+ }
+}
diff --git a/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/Models/ExpressionEvaluationDetails.cs b/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/Models/ExpressionEvaluationDetails.cs
index bfcee28fd06f..53038318f51b 100644
--- a/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/Models/ExpressionEvaluationDetails.cs
+++ b/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/Models/ExpressionEvaluationDetails.cs
@@ -33,6 +33,8 @@ public ExpressionEvaluationDetails()
///
/// Evaluation result.
/// Expression evaluated.
+ /// The kind of expression that was
+ /// evaluated.
/// Property path if the expression is a field or an
/// alias.
/// Value of the expression.
@@ -40,10 +42,11 @@ public ExpressionEvaluationDetails()
/// expression value.
/// Operator to compare the expression
/// value and the target value.
- public ExpressionEvaluationDetails(string result = default(string), string expression = default(string), string path = default(string), object expressionValue = default(object), object targetValue = default(object), string operatorProperty = default(string))
+ public ExpressionEvaluationDetails(string result = default(string), string expression = default(string), string expressionKind = default(string), string path = default(string), object expressionValue = default(object), object targetValue = default(object), string operatorProperty = default(string))
{
Result = result;
Expression = expression;
+ ExpressionKind = expressionKind;
Path = path;
ExpressionValue = expressionValue;
TargetValue = targetValue;
@@ -68,6 +71,12 @@ public ExpressionEvaluationDetails()
[JsonProperty(PropertyName = "expression")]
public string Expression { get; set; }
+ ///
+ /// Gets the kind of expression that was evaluated.
+ ///
+ [JsonProperty(PropertyName = "expressionKind")]
+ public string ExpressionKind { get; private set; }
+
///
/// Gets or sets property path if the expression is a field or an
/// alias.
diff --git a/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/Models/FieldRestriction.cs b/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/Models/FieldRestriction.cs
new file mode 100644
index 000000000000..dd1e7178a607
--- /dev/null
+++ b/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/Models/FieldRestriction.cs
@@ -0,0 +1,86 @@
+//
+// 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.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.PolicyInsights.Models
+{
+ using Newtonsoft.Json;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Linq;
+
+ ///
+ /// The restrictions on a field imposed by a specific policy.
+ ///
+ public partial class FieldRestriction
+ {
+ ///
+ /// Initializes a new instance of the FieldRestriction class.
+ ///
+ public FieldRestriction()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the FieldRestriction class.
+ ///
+ /// The type of restriction that is imposed on the
+ /// field. Possible values include: 'Required', 'Removed',
+ /// 'Deny'
+ /// The value that policy will set for the
+ /// field if the user does not provide a value.
+ /// The values that policy either requires or
+ /// denies for the field.
+ /// The details of the policy that is causing the
+ /// field restriction.
+ public FieldRestriction(string result = default(string), string defaultValue = default(string), IList values = default(IList), PolicyReference policy = default(PolicyReference))
+ {
+ Result = result;
+ DefaultValue = defaultValue;
+ Values = values;
+ Policy = policy;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets the type of restriction that is imposed on the field. Possible
+ /// values include: 'Required', 'Removed', 'Deny'
+ ///
+ [JsonProperty(PropertyName = "result")]
+ public string Result { get; private set; }
+
+ ///
+ /// Gets the value that policy will set for the field if the user does
+ /// not provide a value.
+ ///
+ [JsonProperty(PropertyName = "defaultValue")]
+ public string DefaultValue { get; private set; }
+
+ ///
+ /// Gets the values that policy either requires or denies for the
+ /// field.
+ ///
+ [JsonProperty(PropertyName = "values")]
+ public IList Values { get; private set; }
+
+ ///
+ /// Gets the details of the policy that is causing the field
+ /// restriction.
+ ///
+ [JsonProperty(PropertyName = "policy")]
+ public PolicyReference Policy { get; private set; }
+
+ }
+}
diff --git a/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/Models/FieldRestrictionResult.cs b/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/Models/FieldRestrictionResult.cs
new file mode 100644
index 000000000000..c0c9e03c296d
--- /dev/null
+++ b/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/Models/FieldRestrictionResult.cs
@@ -0,0 +1,32 @@
+//
+// 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.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.PolicyInsights.Models
+{
+
+ ///
+ /// Defines values for FieldRestrictionResult.
+ ///
+ public static class FieldRestrictionResult
+ {
+ ///
+ /// The field and/or values are required by policy.
+ ///
+ public const string Required = "Required";
+ ///
+ /// The field will be removed by policy.
+ ///
+ public const string Removed = "Removed";
+ ///
+ /// The field and/or values will be denied by policy.
+ ///
+ public const string Deny = "Deny";
+ }
+}
diff --git a/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/Models/FieldRestrictions.cs b/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/Models/FieldRestrictions.cs
new file mode 100644
index 000000000000..c55ffafa2139
--- /dev/null
+++ b/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/Models/FieldRestrictions.cs
@@ -0,0 +1,66 @@
+//
+// 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.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.PolicyInsights.Models
+{
+ using Newtonsoft.Json;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Linq;
+
+ ///
+ /// The restrictions that will be placed on a field in the resource by
+ /// policy.
+ ///
+ public partial class FieldRestrictions
+ {
+ ///
+ /// Initializes a new instance of the FieldRestrictions class.
+ ///
+ public FieldRestrictions()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the 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 restrictions placed on that field by
+ /// policy.
+ public FieldRestrictions(string field = default(string), IList restrictions = default(IList))
+ {
+ Field = field;
+ Restrictions = restrictions;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets the name of the field. This can be a top-level property like
+ /// 'name' or 'type' or an Azure Policy field alias.
+ ///
+ [JsonProperty(PropertyName = "field")]
+ public string Field { get; private set; }
+
+ ///
+ /// Gets or sets the restrictions placed on that field by policy.
+ ///
+ [JsonProperty(PropertyName = "restrictions")]
+ public IList Restrictions { get; set; }
+
+ }
+}
diff --git a/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/Models/Page1.cs b/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/Models/Page1.cs
new file mode 100644
index 000000000000..b9cc3d418005
--- /dev/null
+++ b/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/Models/Page1.cs
@@ -0,0 +1,53 @@
+//
+// 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.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.PolicyInsights.Models
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Azure;
+ using Newtonsoft.Json;
+ using System.Collections;
+ using System.Collections.Generic;
+
+ ///
+ /// Defines a page in Azure responses.
+ ///
+ /// Type of the page content items
+ [JsonObject]
+ public class Page1 : IPage
+ {
+ ///
+ /// Gets the link to the next page.
+ ///
+ [JsonProperty("@odata.nextLink")]
+ public string NextPageLink { get; private set; }
+
+ [JsonProperty("value")]
+ private IList Items{ get; set; }
+
+ ///
+ /// Returns an enumerator that iterates through the collection.
+ ///
+ /// A an enumerator that can be used to iterate through the collection.
+ public IEnumerator GetEnumerator()
+ {
+ return Items == null ? System.Linq.Enumerable.Empty().GetEnumerator() : Items.GetEnumerator();
+ }
+
+ ///
+ /// Returns an enumerator that iterates through the collection.
+ ///
+ /// A an enumerator that can be used to iterate through the collection.
+ IEnumerator IEnumerable.GetEnumerator()
+ {
+ return GetEnumerator();
+ }
+ }
+}
diff --git a/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/Models/PendingField.cs b/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/Models/PendingField.cs
new file mode 100644
index 000000000000..854e36513ae8
--- /dev/null
+++ b/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/Models/PendingField.cs
@@ -0,0 +1,81 @@
+//
+// 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.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.PolicyInsights.Models
+{
+ using Microsoft.Rest;
+ using Newtonsoft.Json;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Linq;
+
+ ///
+ /// A field that should be evaluated against Azure Policy to determine
+ /// restrictions.
+ ///
+ public partial class PendingField
+ {
+ ///
+ /// Initializes a new instance of the PendingField class.
+ ///
+ public PendingField()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the 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 list of potential values for the field
+ /// that should be evaluated against Azure Policy.
+ public PendingField(string field, IList values = default(IList))
+ {
+ Field = field;
+ Values = values;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets or sets the name of the field. This can be a top-level
+ /// property like 'name' or 'type' or an Azure Policy field alias.
+ ///
+ [JsonProperty(PropertyName = "field")]
+ public string Field { get; set; }
+
+ ///
+ /// Gets or sets the list of potential values for the field that should
+ /// be evaluated against Azure Policy.
+ ///
+ [JsonProperty(PropertyName = "values")]
+ public IList Values { get; set; }
+
+ ///
+ /// Validate the object.
+ ///
+ ///
+ /// Thrown if validation fails
+ ///
+ public virtual void Validate()
+ {
+ if (Field == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "Field");
+ }
+ }
+ }
+}
diff --git a/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/Models/PolicyEvaluationResult.cs b/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/Models/PolicyEvaluationResult.cs
new file mode 100644
index 000000000000..cf9cd45d94ab
--- /dev/null
+++ b/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/Models/PolicyEvaluationResult.cs
@@ -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.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.PolicyInsights.Models
+{
+ using Newtonsoft.Json;
+ using System.Linq;
+
+ ///
+ /// The result of a non-compliant policy evaluation against the given
+ /// resource content.
+ ///
+ public partial class PolicyEvaluationResult
+ {
+ ///
+ /// Initializes a new instance of the PolicyEvaluationResult class.
+ ///
+ public PolicyEvaluationResult()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the PolicyEvaluationResult class.
+ ///
+ /// The details of the policy that was
+ /// evaluated.
+ /// The result of the policy evaluation
+ /// against the resource. This will typically be 'NonCompliant' but may
+ /// contain other values if errors were encountered.
+ /// The detailed results of the policy
+ /// expressions and values that were evaluated.
+ public PolicyEvaluationResult(PolicyReference policyInfo = default(PolicyReference), string evaluationResult = default(string), PolicyEvaluationDetails evaluationDetails = default(PolicyEvaluationDetails))
+ {
+ PolicyInfo = policyInfo;
+ EvaluationResult = evaluationResult;
+ EvaluationDetails = evaluationDetails;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets the details of the policy that was evaluated.
+ ///
+ [JsonProperty(PropertyName = "policyInfo")]
+ public PolicyReference PolicyInfo { get; private set; }
+
+ ///
+ /// Gets the result of the policy evaluation against the resource. This
+ /// will typically be 'NonCompliant' but may contain other values if
+ /// errors were encountered.
+ ///
+ [JsonProperty(PropertyName = "evaluationResult")]
+ public string EvaluationResult { get; private set; }
+
+ ///
+ /// Gets the detailed results of the policy expressions and values that
+ /// were evaluated.
+ ///
+ [JsonProperty(PropertyName = "evaluationDetails")]
+ public PolicyEvaluationDetails EvaluationDetails { get; private set; }
+
+ }
+}
diff --git a/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/Models/PolicyEvent.cs b/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/Models/PolicyEvent.cs
index 69b14afdfd22..91bc93d2ddd1 100644
--- a/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/Models/PolicyEvent.cs
+++ b/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/Models/PolicyEvent.cs
@@ -80,12 +80,16 @@ public PolicyEvent()
/// Reference ID for the
/// policy definition inside the policy set, if the policy assignment
/// is for a policy set.
+ /// Compliance state of the
+ /// resource.
/// Tenant ID for the policy event
/// record.
/// Principal object ID for the user who
/// initiated the resource operation that triggered the policy
/// event.
- public PolicyEvent(IDictionary additionalProperties = default(IDictionary), string odataid = default(string), string odatacontext = default(string), System.DateTime? timestamp = default(System.DateTime?), string resourceId = default(string), string policyAssignmentId = default(string), string policyDefinitionId = default(string), string effectiveParameters = default(string), bool? isCompliant = default(bool?), string subscriptionId = default(string), string resourceType = default(string), string resourceLocation = default(string), string resourceGroup = default(string), string resourceTags = default(string), string policyAssignmentName = default(string), string policyAssignmentOwner = default(string), string policyAssignmentParameters = default(string), string policyAssignmentScope = default(string), string policyDefinitionName = default(string), string policyDefinitionAction = default(string), string policyDefinitionCategory = default(string), string policySetDefinitionId = default(string), string policySetDefinitionName = default(string), string policySetDefinitionOwner = default(string), string policySetDefinitionCategory = default(string), string policySetDefinitionParameters = default(string), string managementGroupIds = default(string), string policyDefinitionReferenceId = default(string), string tenantId = default(string), string principalOid = default(string))
+ /// Components events records populated only
+ /// when URL contains $expand=components clause.
+ public PolicyEvent(IDictionary additionalProperties = default(IDictionary), string odataid = default(string), string odatacontext = default(string), System.DateTime? timestamp = default(System.DateTime?), string resourceId = default(string), string policyAssignmentId = default(string), string policyDefinitionId = default(string), string effectiveParameters = default(string), bool? isCompliant = default(bool?), string subscriptionId = default(string), string resourceType = default(string), string resourceLocation = default(string), string resourceGroup = default(string), string resourceTags = default(string), string policyAssignmentName = default(string), string policyAssignmentOwner = default(string), string policyAssignmentParameters = default(string), string policyAssignmentScope = default(string), string policyDefinitionName = default(string), string policyDefinitionAction = default(string), string policyDefinitionCategory = default(string), string policySetDefinitionId = default(string), string policySetDefinitionName = default(string), string policySetDefinitionOwner = default(string), string policySetDefinitionCategory = default(string), string policySetDefinitionParameters = default(string), string managementGroupIds = default(string), string policyDefinitionReferenceId = default(string), string complianceState = default(string), string tenantId = default(string), string principalOid = default(string), IList components = default(IList))
{
AdditionalProperties = additionalProperties;
Odataid = odataid;
@@ -115,8 +119,10 @@ public PolicyEvent()
PolicySetDefinitionParameters = policySetDefinitionParameters;
ManagementGroupIds = managementGroupIds;
PolicyDefinitionReferenceId = policyDefinitionReferenceId;
+ ComplianceState = complianceState;
TenantId = tenantId;
PrincipalOid = principalOid;
+ Components = components;
CustomInit();
}
@@ -305,6 +311,12 @@ public PolicyEvent()
[JsonProperty(PropertyName = "policyDefinitionReferenceId")]
public string PolicyDefinitionReferenceId { get; set; }
+ ///
+ /// Gets or sets compliance state of the resource.
+ ///
+ [JsonProperty(PropertyName = "complianceState")]
+ public string ComplianceState { get; set; }
+
///
/// Gets or sets tenant ID for the policy event record.
///
@@ -318,5 +330,12 @@ public PolicyEvent()
[JsonProperty(PropertyName = "principalOid")]
public string PrincipalOid { get; set; }
+ ///
+ /// Gets or sets components events records populated only when URL
+ /// contains $expand=components clause.
+ ///
+ [JsonProperty(PropertyName = "components")]
+ public IList Components { get; set; }
+
}
}
diff --git a/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/Models/PolicyEventsQueryResults.cs b/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/Models/PolicyEventsQueryResults.cs
deleted file mode 100644
index 7d194f68d0b7..000000000000
--- a/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/Models/PolicyEventsQueryResults.cs
+++ /dev/null
@@ -1,87 +0,0 @@
-//
-// 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.
-// Changes may cause incorrect behavior and will be lost if the code is
-// regenerated.
-//
-
-namespace Microsoft.Azure.Management.PolicyInsights.Models
-{
- using Microsoft.Rest;
- using Newtonsoft.Json;
- using System.Collections;
- using System.Collections.Generic;
- using System.Linq;
-
- ///
- /// Query results.
- ///
- public partial class PolicyEventsQueryResults
- {
- ///
- /// Initializes a new instance of the PolicyEventsQueryResults class.
- ///
- public PolicyEventsQueryResults()
- {
- CustomInit();
- }
-
- ///
- /// Initializes a new instance of the PolicyEventsQueryResults class.
- ///
- /// OData context string; used by OData
- /// clients to resolve type information based on metadata.
- /// OData entity count; represents the number
- /// of policy event records returned.
- /// Query results.
- public PolicyEventsQueryResults(string odatacontext = default(string), int? odatacount = default(int?), IList value = default(IList))
- {
- Odatacontext = odatacontext;
- Odatacount = odatacount;
- Value = value;
- CustomInit();
- }
-
- ///
- /// An initialization method that performs custom operations like setting defaults
- ///
- partial void CustomInit();
-
- ///
- /// Gets or sets oData context string; used by OData clients to resolve
- /// type information based on metadata.
- ///
- [JsonProperty(PropertyName = "@odata.context")]
- public string Odatacontext { get; set; }
-
- ///
- /// Gets or sets oData entity count; represents the number of policy
- /// event records returned.
- ///
- [JsonProperty(PropertyName = "@odata.count")]
- public int? Odatacount { get; set; }
-
- ///
- /// Gets or sets query results.
- ///
- [JsonProperty(PropertyName = "value")]
- public IList Value { get; set; }
-
- ///
- /// Validate the object.
- ///
- ///
- /// Thrown if validation fails
- ///
- public virtual void Validate()
- {
- if (Odatacount < 0)
- {
- throw new ValidationException(ValidationRules.InclusiveMinimum, "Odatacount", 0);
- }
- }
- }
-}
diff --git a/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/Models/PolicyReference.cs b/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/Models/PolicyReference.cs
new file mode 100644
index 000000000000..b496dd096e51
--- /dev/null
+++ b/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/Models/PolicyReference.cs
@@ -0,0 +1,81 @@
+//
+// 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.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.PolicyInsights.Models
+{
+ using Newtonsoft.Json;
+ using System.Linq;
+
+ ///
+ /// Resource identifiers for a policy.
+ ///
+ public partial class PolicyReference
+ {
+ ///
+ /// Initializes a new instance of the PolicyReference class.
+ ///
+ public PolicyReference()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the PolicyReference class.
+ ///
+ /// The resource identifier of the
+ /// policy definition.
+ /// The resource identifier of the
+ /// policy set definition.
+ /// The reference identifier
+ /// of a specific policy definition within a policy set
+ /// definition.
+ /// The resource identifier of the
+ /// policy assignment.
+ public PolicyReference(string policyDefinitionId = default(string), string policySetDefinitionId = default(string), string policyDefinitionReferenceId = default(string), string policyAssignmentId = default(string))
+ {
+ PolicyDefinitionId = policyDefinitionId;
+ PolicySetDefinitionId = policySetDefinitionId;
+ PolicyDefinitionReferenceId = policyDefinitionReferenceId;
+ PolicyAssignmentId = policyAssignmentId;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets the resource identifier of the policy definition.
+ ///
+ [JsonProperty(PropertyName = "policyDefinitionId")]
+ public string PolicyDefinitionId { get; private set; }
+
+ ///
+ /// Gets the resource identifier of the policy set definition.
+ ///
+ [JsonProperty(PropertyName = "policySetDefinitionId")]
+ public string PolicySetDefinitionId { get; private set; }
+
+ ///
+ /// Gets the reference identifier of a specific policy definition
+ /// within a policy set definition.
+ ///
+ [JsonProperty(PropertyName = "policyDefinitionReferenceId")]
+ public string PolicyDefinitionReferenceId { get; private set; }
+
+ ///
+ /// Gets the resource identifier of the policy assignment.
+ ///
+ [JsonProperty(PropertyName = "policyAssignmentId")]
+ public string PolicyAssignmentId { get; private set; }
+
+ }
+}
diff --git a/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/Models/PolicyState.cs b/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/Models/PolicyState.cs
index 0174fea40f82..a06ce2ee668f 100644
--- a/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/Models/PolicyState.cs
+++ b/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/Models/PolicyState.cs
@@ -87,13 +87,15 @@ public PolicyState()
/// details.
/// Policy definition group
/// names.
+ /// Components state compliance records
+ /// populated only when URL contains $expand=components clause.
/// Evaluated policy definition
/// version.
/// Evaluated policy set
/// definition version.
/// Evaluated policy assignment
/// version.
- public PolicyState(IDictionary additionalProperties = default(IDictionary), string odataid = default(string), string odatacontext = default(string), System.DateTime? timestamp = default(System.DateTime?), string resourceId = default(string), string policyAssignmentId = default(string), string policyDefinitionId = default(string), string effectiveParameters = default(string), bool? isCompliant = default(bool?), string subscriptionId = default(string), string resourceType = default(string), string resourceLocation = default(string), string resourceGroup = default(string), string resourceTags = default(string), string policyAssignmentName = default(string), string policyAssignmentOwner = default(string), string policyAssignmentParameters = default(string), string policyAssignmentScope = default(string), string policyDefinitionName = default(string), string policyDefinitionAction = default(string), string policyDefinitionCategory = default(string), string policySetDefinitionId = default(string), string policySetDefinitionName = default(string), string policySetDefinitionOwner = default(string), string policySetDefinitionCategory = default(string), string policySetDefinitionParameters = default(string), string managementGroupIds = default(string), string policyDefinitionReferenceId = default(string), string complianceState = default(string), PolicyEvaluationDetails policyEvaluationDetails = default(PolicyEvaluationDetails), IList policyDefinitionGroupNames = default(IList), string policyDefinitionVersion = default(string), string policySetDefinitionVersion = default(string), string policyAssignmentVersion = default(string))
+ public PolicyState(IDictionary additionalProperties = default(IDictionary), string odataid = default(string), string odatacontext = default(string), System.DateTime? timestamp = default(System.DateTime?), string resourceId = default(string), string policyAssignmentId = default(string), string policyDefinitionId = default(string), string effectiveParameters = default(string), bool? isCompliant = default(bool?), string subscriptionId = default(string), string resourceType = default(string), string resourceLocation = default(string), string resourceGroup = default(string), string resourceTags = default(string), string policyAssignmentName = default(string), string policyAssignmentOwner = default(string), string policyAssignmentParameters = default(string), string policyAssignmentScope = default(string), string policyDefinitionName = default(string), string policyDefinitionAction = default(string), string policyDefinitionCategory = default(string), string policySetDefinitionId = default(string), string policySetDefinitionName = default(string), string policySetDefinitionOwner = default(string), string policySetDefinitionCategory = default(string), string policySetDefinitionParameters = default(string), string managementGroupIds = default(string), string policyDefinitionReferenceId = default(string), string complianceState = default(string), PolicyEvaluationDetails policyEvaluationDetails = default(PolicyEvaluationDetails), IList policyDefinitionGroupNames = default(IList), IList components = default(IList), string policyDefinitionVersion = default(string), string policySetDefinitionVersion = default(string), string policyAssignmentVersion = default(string))
{
AdditionalProperties = additionalProperties;
Odataid = odataid;
@@ -126,6 +128,7 @@ public PolicyState()
ComplianceState = complianceState;
PolicyEvaluationDetails = policyEvaluationDetails;
PolicyDefinitionGroupNames = policyDefinitionGroupNames;
+ Components = components;
PolicyDefinitionVersion = policyDefinitionVersion;
PolicySetDefinitionVersion = policySetDefinitionVersion;
PolicyAssignmentVersion = policyAssignmentVersion;
@@ -336,6 +339,13 @@ public PolicyState()
[JsonProperty(PropertyName = "policyDefinitionGroupNames")]
public IList PolicyDefinitionGroupNames { get; set; }
+ ///
+ /// Gets or sets components state compliance records populated only
+ /// when URL contains $expand=components clause.
+ ///
+ [JsonProperty(PropertyName = "components")]
+ public IList Components { get; set; }
+
///
/// Gets evaluated policy definition version.
///
diff --git a/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/Models/PolicyStatesQueryResults.cs b/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/Models/PolicyStatesQueryResults.cs
deleted file mode 100644
index f13fbeec6a42..000000000000
--- a/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/Models/PolicyStatesQueryResults.cs
+++ /dev/null
@@ -1,87 +0,0 @@
-//
-// 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.
-// Changes may cause incorrect behavior and will be lost if the code is
-// regenerated.
-//
-
-namespace Microsoft.Azure.Management.PolicyInsights.Models
-{
- using Microsoft.Rest;
- using Newtonsoft.Json;
- using System.Collections;
- using System.Collections.Generic;
- using System.Linq;
-
- ///
- /// Query results.
- ///
- public partial class PolicyStatesQueryResults
- {
- ///
- /// Initializes a new instance of the PolicyStatesQueryResults class.
- ///
- public PolicyStatesQueryResults()
- {
- CustomInit();
- }
-
- ///
- /// Initializes a new instance of the PolicyStatesQueryResults class.
- ///
- /// OData context string; used by OData
- /// clients to resolve type information based on metadata.
- /// OData entity count; represents the number
- /// of policy state records returned.
- /// Query results.
- public PolicyStatesQueryResults(string odatacontext = default(string), int? odatacount = default(int?), IList value = default(IList))
- {
- Odatacontext = odatacontext;
- Odatacount = odatacount;
- Value = value;
- CustomInit();
- }
-
- ///
- /// An initialization method that performs custom operations like setting defaults
- ///
- partial void CustomInit();
-
- ///
- /// Gets or sets oData context string; used by OData clients to resolve
- /// type information based on metadata.
- ///
- [JsonProperty(PropertyName = "@odata.context")]
- public string Odatacontext { get; set; }
-
- ///
- /// Gets or sets oData entity count; represents the number of policy
- /// state records returned.
- ///
- [JsonProperty(PropertyName = "@odata.count")]
- public int? Odatacount { get; set; }
-
- ///
- /// Gets or sets query results.
- ///
- [JsonProperty(PropertyName = "value")]
- public IList Value { get; set; }
-
- ///
- /// Validate the object.
- ///
- ///
- /// Thrown if validation fails
- ///
- public virtual void Validate()
- {
- if (Odatacount < 0)
- {
- throw new ValidationException(ValidationRules.InclusiveMinimum, "Odatacount", 0);
- }
- }
- }
-}
diff --git a/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/Models/QueryOptions.cs b/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/Models/QueryOptions.cs
index 0ecdae47c4f4..aee423092b53 100644
--- a/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/Models/QueryOptions.cs
+++ b/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/Models/QueryOptions.cs
@@ -46,10 +46,12 @@ public QueryOptions()
/// request time.
/// OData apply expression for
/// aggregations.
+ /// Skiptoken is only provided if a previous
+ /// response returned a partial result as a part of nextLink
+ /// element.
/// The $expand query parameter. For example, to
- /// expand policyEvaluationDetails, use
- /// $expand=policyEvaluationDetails
- public QueryOptions(int? top = default(int?), string filter = default(string), string orderBy = default(string), string select = default(string), System.DateTime? fromProperty = default(System.DateTime?), System.DateTime? to = default(System.DateTime?), string apply = default(string), string expand = default(string))
+ /// expand components use $expand=components
+ public QueryOptions(int? top = default(int?), string filter = default(string), string orderBy = default(string), string select = default(string), System.DateTime? fromProperty = default(System.DateTime?), System.DateTime? to = default(System.DateTime?), string apply = default(string), string skipToken = default(string), string expand = default(string))
{
Top = top;
Filter = filter;
@@ -58,6 +60,7 @@ public QueryOptions()
FromProperty = fromProperty;
To = to;
Apply = apply;
+ SkipToken = skipToken;
Expand = expand;
CustomInit();
}
@@ -117,9 +120,16 @@ public QueryOptions()
[Newtonsoft.Json.JsonIgnore]
public string Apply { get; set; }
+ ///
+ /// Gets or sets skiptoken is only provided if a previous response
+ /// returned a partial result as a part of nextLink element.
+ ///
+ [Newtonsoft.Json.JsonIgnore]
+ public string SkipToken { get; set; }
+
///
/// Gets or sets the $expand query parameter. For example, to expand
- /// policyEvaluationDetails, use $expand=policyEvaluationDetails
+ /// components use $expand=components
///
[Newtonsoft.Json.JsonIgnore]
public string Expand { get; set; }
diff --git a/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/PolicyEventsOperations.cs b/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/PolicyEventsOperations.cs
index 1345262a8047..3547e3184289 100644
--- a/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/PolicyEventsOperations.cs
+++ b/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/PolicyEventsOperations.cs
@@ -80,7 +80,7 @@ internal PolicyEventsOperations(PolicyInsightsClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task> ListQueryResultsForManagementGroupWithHttpMessagesAsync(string managementGroupName, QueryOptions queryOptions = default(QueryOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task>> ListQueryResultsForManagementGroupWithHttpMessagesAsync(string managementGroupName, QueryOptions queryOptions = default(QueryOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (managementGroupName == null)
{
@@ -88,7 +88,7 @@ internal PolicyEventsOperations(PolicyInsightsClient client)
}
string policyEventsResource = "default";
string managementGroupsNamespace = "Microsoft.Management";
- string apiVersion = "2018-04-04";
+ string apiVersion = "2019-10-01";
int? top = default(int?);
if (queryOptions != null)
{
@@ -124,6 +124,11 @@ internal PolicyEventsOperations(PolicyInsightsClient client)
{
apply = queryOptions.Apply;
}
+ string skipToken = default(string);
+ if (queryOptions != null)
+ {
+ skipToken = queryOptions.SkipToken;
+ }
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -142,6 +147,7 @@ internal PolicyEventsOperations(PolicyInsightsClient client)
tracingParameters.Add("to", to);
tracingParameters.Add("filter", filter);
tracingParameters.Add("apply", apply);
+ tracingParameters.Add("skipToken", skipToken);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "ListQueryResultsForManagementGroup", tracingParameters);
}
@@ -184,6 +190,10 @@ internal PolicyEventsOperations(PolicyInsightsClient client)
{
_queryParameters.Add(string.Format("$apply={0}", System.Uri.EscapeDataString(apply)));
}
+ if (skipToken != null)
+ {
+ _queryParameters.Add(string.Format("$skiptoken={0}", System.Uri.EscapeDataString(skipToken)));
+ }
if (_queryParameters.Count > 0)
{
_url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
@@ -272,7 +282,7 @@ internal PolicyEventsOperations(PolicyInsightsClient client)
throw ex;
}
// Create Result
- var _result = new AzureOperationResponse();
+ var _result = new AzureOperationResponse>();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
if (_httpResponse.Headers.Contains("x-ms-request-id"))
@@ -285,7 +295,7 @@ internal PolicyEventsOperations(PolicyInsightsClient client)
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
}
catch (JsonException ex)
{
@@ -334,14 +344,14 @@ internal PolicyEventsOperations(PolicyInsightsClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task> ListQueryResultsForSubscriptionWithHttpMessagesAsync(string subscriptionId, QueryOptions queryOptions = default(QueryOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task>> ListQueryResultsForSubscriptionWithHttpMessagesAsync(string subscriptionId, QueryOptions queryOptions = default(QueryOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (subscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "subscriptionId");
}
string policyEventsResource = "default";
- string apiVersion = "2018-04-04";
+ string apiVersion = "2019-10-01";
int? top = default(int?);
if (queryOptions != null)
{
@@ -377,6 +387,11 @@ internal PolicyEventsOperations(PolicyInsightsClient client)
{
apply = queryOptions.Apply;
}
+ string skipToken = default(string);
+ if (queryOptions != null)
+ {
+ skipToken = queryOptions.SkipToken;
+ }
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -394,6 +409,7 @@ internal PolicyEventsOperations(PolicyInsightsClient client)
tracingParameters.Add("to", to);
tracingParameters.Add("filter", filter);
tracingParameters.Add("apply", apply);
+ tracingParameters.Add("skipToken", skipToken);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "ListQueryResultsForSubscription", tracingParameters);
}
@@ -435,6 +451,10 @@ internal PolicyEventsOperations(PolicyInsightsClient client)
{
_queryParameters.Add(string.Format("$apply={0}", System.Uri.EscapeDataString(apply)));
}
+ if (skipToken != null)
+ {
+ _queryParameters.Add(string.Format("$skiptoken={0}", System.Uri.EscapeDataString(skipToken)));
+ }
if (_queryParameters.Count > 0)
{
_url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
@@ -523,7 +543,7 @@ internal PolicyEventsOperations(PolicyInsightsClient client)
throw ex;
}
// Create Result
- var _result = new AzureOperationResponse();
+ var _result = new AzureOperationResponse>();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
if (_httpResponse.Headers.Contains("x-ms-request-id"))
@@ -536,7 +556,7 @@ internal PolicyEventsOperations(PolicyInsightsClient client)
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
}
catch (JsonException ex)
{
@@ -588,7 +608,7 @@ internal PolicyEventsOperations(PolicyInsightsClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task> ListQueryResultsForResourceGroupWithHttpMessagesAsync(string subscriptionId, string resourceGroupName, QueryOptions queryOptions = default(QueryOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task>> ListQueryResultsForResourceGroupWithHttpMessagesAsync(string subscriptionId, string resourceGroupName, QueryOptions queryOptions = default(QueryOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (subscriptionId == null)
{
@@ -599,7 +619,7 @@ internal PolicyEventsOperations(PolicyInsightsClient client)
throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
}
string policyEventsResource = "default";
- string apiVersion = "2018-04-04";
+ string apiVersion = "2019-10-01";
int? top = default(int?);
if (queryOptions != null)
{
@@ -635,6 +655,11 @@ internal PolicyEventsOperations(PolicyInsightsClient client)
{
apply = queryOptions.Apply;
}
+ string skipToken = default(string);
+ if (queryOptions != null)
+ {
+ skipToken = queryOptions.SkipToken;
+ }
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -653,6 +678,7 @@ internal PolicyEventsOperations(PolicyInsightsClient client)
tracingParameters.Add("to", to);
tracingParameters.Add("filter", filter);
tracingParameters.Add("apply", apply);
+ tracingParameters.Add("skipToken", skipToken);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "ListQueryResultsForResourceGroup", tracingParameters);
}
@@ -695,6 +721,10 @@ internal PolicyEventsOperations(PolicyInsightsClient client)
{
_queryParameters.Add(string.Format("$apply={0}", System.Uri.EscapeDataString(apply)));
}
+ if (skipToken != null)
+ {
+ _queryParameters.Add(string.Format("$skiptoken={0}", System.Uri.EscapeDataString(skipToken)));
+ }
if (_queryParameters.Count > 0)
{
_url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
@@ -783,7 +813,7 @@ internal PolicyEventsOperations(PolicyInsightsClient client)
throw ex;
}
// Create Result
- var _result = new AzureOperationResponse();
+ var _result = new AzureOperationResponse>();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
if (_httpResponse.Headers.Contains("x-ms-request-id"))
@@ -796,7 +826,7 @@ internal PolicyEventsOperations(PolicyInsightsClient client)
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
}
catch (JsonException ex)
{
@@ -845,14 +875,14 @@ internal PolicyEventsOperations(PolicyInsightsClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task> ListQueryResultsForResourceWithHttpMessagesAsync(string resourceId, QueryOptions queryOptions = default(QueryOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task>> ListQueryResultsForResourceWithHttpMessagesAsync(string resourceId, QueryOptions queryOptions = default(QueryOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (resourceId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "resourceId");
}
string policyEventsResource = "default";
- string apiVersion = "2018-04-04";
+ string apiVersion = "2019-10-01";
int? top = default(int?);
if (queryOptions != null)
{
@@ -888,6 +918,16 @@ internal PolicyEventsOperations(PolicyInsightsClient client)
{
apply = queryOptions.Apply;
}
+ string expand = default(string);
+ if (queryOptions != null)
+ {
+ expand = queryOptions.Expand;
+ }
+ string skipToken = default(string);
+ if (queryOptions != null)
+ {
+ skipToken = queryOptions.SkipToken;
+ }
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -905,6 +945,8 @@ internal PolicyEventsOperations(PolicyInsightsClient client)
tracingParameters.Add("to", to);
tracingParameters.Add("filter", filter);
tracingParameters.Add("apply", apply);
+ tracingParameters.Add("expand", expand);
+ tracingParameters.Add("skipToken", skipToken);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "ListQueryResultsForResource", tracingParameters);
}
@@ -946,6 +988,14 @@ internal PolicyEventsOperations(PolicyInsightsClient client)
{
_queryParameters.Add(string.Format("$apply={0}", System.Uri.EscapeDataString(apply)));
}
+ if (expand != null)
+ {
+ _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand)));
+ }
+ if (skipToken != null)
+ {
+ _queryParameters.Add(string.Format("$skiptoken={0}", System.Uri.EscapeDataString(skipToken)));
+ }
if (_queryParameters.Count > 0)
{
_url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
@@ -1034,7 +1084,7 @@ internal PolicyEventsOperations(PolicyInsightsClient client)
throw ex;
}
// Create Result
- var _result = new AzureOperationResponse();
+ var _result = new AzureOperationResponse>();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
if (_httpResponse.Headers.Contains("x-ms-request-id"))
@@ -1047,7 +1097,7 @@ internal PolicyEventsOperations(PolicyInsightsClient client)
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
}
catch (JsonException ex)
{
@@ -1099,7 +1149,7 @@ internal PolicyEventsOperations(PolicyInsightsClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task> ListQueryResultsForPolicySetDefinitionWithHttpMessagesAsync(string subscriptionId, string policySetDefinitionName, QueryOptions queryOptions = default(QueryOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task>> ListQueryResultsForPolicySetDefinitionWithHttpMessagesAsync(string subscriptionId, string policySetDefinitionName, QueryOptions queryOptions = default(QueryOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (subscriptionId == null)
{
@@ -1111,7 +1161,7 @@ internal PolicyEventsOperations(PolicyInsightsClient client)
}
string policyEventsResource = "default";
string authorizationNamespace = "Microsoft.Authorization";
- string apiVersion = "2018-04-04";
+ string apiVersion = "2019-10-01";
int? top = default(int?);
if (queryOptions != null)
{
@@ -1147,6 +1197,11 @@ internal PolicyEventsOperations(PolicyInsightsClient client)
{
apply = queryOptions.Apply;
}
+ string skipToken = default(string);
+ if (queryOptions != null)
+ {
+ skipToken = queryOptions.SkipToken;
+ }
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -1166,6 +1221,7 @@ internal PolicyEventsOperations(PolicyInsightsClient client)
tracingParameters.Add("to", to);
tracingParameters.Add("filter", filter);
tracingParameters.Add("apply", apply);
+ tracingParameters.Add("skipToken", skipToken);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "ListQueryResultsForPolicySetDefinition", tracingParameters);
}
@@ -1209,6 +1265,10 @@ internal PolicyEventsOperations(PolicyInsightsClient client)
{
_queryParameters.Add(string.Format("$apply={0}", System.Uri.EscapeDataString(apply)));
}
+ if (skipToken != null)
+ {
+ _queryParameters.Add(string.Format("$skiptoken={0}", System.Uri.EscapeDataString(skipToken)));
+ }
if (_queryParameters.Count > 0)
{
_url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
@@ -1297,7 +1357,7 @@ internal PolicyEventsOperations(PolicyInsightsClient client)
throw ex;
}
// Create Result
- var _result = new AzureOperationResponse();
+ var _result = new AzureOperationResponse>();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
if (_httpResponse.Headers.Contains("x-ms-request-id"))
@@ -1310,7 +1370,7 @@ internal PolicyEventsOperations(PolicyInsightsClient client)
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
}
catch (JsonException ex)
{
@@ -1362,7 +1422,7 @@ internal PolicyEventsOperations(PolicyInsightsClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task> ListQueryResultsForPolicyDefinitionWithHttpMessagesAsync(string subscriptionId, string policyDefinitionName, QueryOptions queryOptions = default(QueryOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task>> ListQueryResultsForPolicyDefinitionWithHttpMessagesAsync(string subscriptionId, string policyDefinitionName, QueryOptions queryOptions = default(QueryOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (subscriptionId == null)
{
@@ -1374,7 +1434,7 @@ internal PolicyEventsOperations(PolicyInsightsClient client)
}
string policyEventsResource = "default";
string authorizationNamespace = "Microsoft.Authorization";
- string apiVersion = "2018-04-04";
+ string apiVersion = "2019-10-01";
int? top = default(int?);
if (queryOptions != null)
{
@@ -1410,6 +1470,11 @@ internal PolicyEventsOperations(PolicyInsightsClient client)
{
apply = queryOptions.Apply;
}
+ string skipToken = default(string);
+ if (queryOptions != null)
+ {
+ skipToken = queryOptions.SkipToken;
+ }
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -1429,6 +1494,7 @@ internal PolicyEventsOperations(PolicyInsightsClient client)
tracingParameters.Add("to", to);
tracingParameters.Add("filter", filter);
tracingParameters.Add("apply", apply);
+ tracingParameters.Add("skipToken", skipToken);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "ListQueryResultsForPolicyDefinition", tracingParameters);
}
@@ -1472,6 +1538,10 @@ internal PolicyEventsOperations(PolicyInsightsClient client)
{
_queryParameters.Add(string.Format("$apply={0}", System.Uri.EscapeDataString(apply)));
}
+ if (skipToken != null)
+ {
+ _queryParameters.Add(string.Format("$skiptoken={0}", System.Uri.EscapeDataString(skipToken)));
+ }
if (_queryParameters.Count > 0)
{
_url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
@@ -1560,7 +1630,7 @@ internal PolicyEventsOperations(PolicyInsightsClient client)
throw ex;
}
// Create Result
- var _result = new AzureOperationResponse();
+ var _result = new AzureOperationResponse>();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
if (_httpResponse.Headers.Contains("x-ms-request-id"))
@@ -1573,7 +1643,7 @@ internal PolicyEventsOperations(PolicyInsightsClient client)
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
}
catch (JsonException ex)
{
@@ -1625,7 +1695,7 @@ internal PolicyEventsOperations(PolicyInsightsClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task> ListQueryResultsForSubscriptionLevelPolicyAssignmentWithHttpMessagesAsync(string subscriptionId, string policyAssignmentName, QueryOptions queryOptions = default(QueryOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task>> ListQueryResultsForSubscriptionLevelPolicyAssignmentWithHttpMessagesAsync(string subscriptionId, string policyAssignmentName, QueryOptions queryOptions = default(QueryOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (subscriptionId == null)
{
@@ -1637,7 +1707,7 @@ internal PolicyEventsOperations(PolicyInsightsClient client)
}
string policyEventsResource = "default";
string authorizationNamespace = "Microsoft.Authorization";
- string apiVersion = "2018-04-04";
+ string apiVersion = "2019-10-01";
int? top = default(int?);
if (queryOptions != null)
{
@@ -1673,6 +1743,11 @@ internal PolicyEventsOperations(PolicyInsightsClient client)
{
apply = queryOptions.Apply;
}
+ string skipToken = default(string);
+ if (queryOptions != null)
+ {
+ skipToken = queryOptions.SkipToken;
+ }
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -1692,6 +1767,7 @@ internal PolicyEventsOperations(PolicyInsightsClient client)
tracingParameters.Add("to", to);
tracingParameters.Add("filter", filter);
tracingParameters.Add("apply", apply);
+ tracingParameters.Add("skipToken", skipToken);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "ListQueryResultsForSubscriptionLevelPolicyAssignment", tracingParameters);
}
@@ -1735,6 +1811,10 @@ internal PolicyEventsOperations(PolicyInsightsClient client)
{
_queryParameters.Add(string.Format("$apply={0}", System.Uri.EscapeDataString(apply)));
}
+ if (skipToken != null)
+ {
+ _queryParameters.Add(string.Format("$skiptoken={0}", System.Uri.EscapeDataString(skipToken)));
+ }
if (_queryParameters.Count > 0)
{
_url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
@@ -1823,7 +1903,7 @@ internal PolicyEventsOperations(PolicyInsightsClient client)
throw ex;
}
// Create Result
- var _result = new AzureOperationResponse();
+ var _result = new AzureOperationResponse>();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
if (_httpResponse.Headers.Contains("x-ms-request-id"))
@@ -1836,7 +1916,7 @@ internal PolicyEventsOperations(PolicyInsightsClient client)
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
}
catch (JsonException ex)
{
@@ -1891,7 +1971,7 @@ internal PolicyEventsOperations(PolicyInsightsClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task> ListQueryResultsForResourceGroupLevelPolicyAssignmentWithHttpMessagesAsync(string subscriptionId, string resourceGroupName, string policyAssignmentName, QueryOptions queryOptions = default(QueryOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task>> ListQueryResultsForResourceGroupLevelPolicyAssignmentWithHttpMessagesAsync(string subscriptionId, string resourceGroupName, string policyAssignmentName, QueryOptions queryOptions = default(QueryOptions), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (subscriptionId == null)
{
@@ -1907,7 +1987,7 @@ internal PolicyEventsOperations(PolicyInsightsClient client)
}
string policyEventsResource = "default";
string authorizationNamespace = "Microsoft.Authorization";
- string apiVersion = "2018-04-04";
+ string apiVersion = "2019-10-01";
int? top = default(int?);
if (queryOptions != null)
{
@@ -1943,6 +2023,11 @@ internal PolicyEventsOperations(PolicyInsightsClient client)
{
apply = queryOptions.Apply;
}
+ string skipToken = default(string);
+ if (queryOptions != null)
+ {
+ skipToken = queryOptions.SkipToken;
+ }
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -1963,6 +2048,7 @@ internal PolicyEventsOperations(PolicyInsightsClient client)
tracingParameters.Add("to", to);
tracingParameters.Add("filter", filter);
tracingParameters.Add("apply", apply);
+ tracingParameters.Add("skipToken", skipToken);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "ListQueryResultsForResourceGroupLevelPolicyAssignment", tracingParameters);
}
@@ -2007,6 +2093,10 @@ internal PolicyEventsOperations(PolicyInsightsClient client)
{
_queryParameters.Add(string.Format("$apply={0}", System.Uri.EscapeDataString(apply)));
}
+ if (skipToken != null)
+ {
+ _queryParameters.Add(string.Format("$skiptoken={0}", System.Uri.EscapeDataString(skipToken)));
+ }
if (_queryParameters.Count > 0)
{
_url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
@@ -2095,7 +2185,7 @@ internal PolicyEventsOperations(PolicyInsightsClient client)
throw ex;
}
// Create Result
- var _result = new AzureOperationResponse();
+ var _result = new AzureOperationResponse>();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
if (_httpResponse.Headers.Contains("x-ms-request-id"))
@@ -2108,7 +2198,7 @@ internal PolicyEventsOperations(PolicyInsightsClient client)
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
}
catch (JsonException ex)
{
@@ -2128,11 +2218,10 @@ internal PolicyEventsOperations(PolicyInsightsClient client)
}
///
- /// Gets OData metadata XML document.
+ /// Queries policy events for the resources under the management group.
///
- ///
- /// A valid scope, i.e. management group, subscription, resource group, or
- /// resource ID. Scope used has no effect on metadata returned.
+ ///
+ /// The NextLink from the previous successful call to List operation.
///
///
/// Headers that will be added to request.
@@ -2155,13 +2244,12 @@ internal PolicyEventsOperations(PolicyInsightsClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task> GetMetadataWithHttpMessagesAsync(string scope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task>> ListQueryResultsForManagementGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
- if (scope == null)
+ if (nextPageLink == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "scope");
+ throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink");
}
- string apiVersion = "2018-04-04";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -2169,20 +2257,182 @@ internal PolicyEventsOperations(PolicyInsightsClient client)
{
_invocationId = ServiceClientTracing.NextInvocationId.ToString();
Dictionary tracingParameters = new Dictionary();
- tracingParameters.Add("scope", scope);
- tracingParameters.Add("apiVersion", apiVersion);
+ tracingParameters.Add("nextPageLink", nextPageLink);
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "GetMetadata", tracingParameters);
+ ServiceClientTracing.Enter(_invocationId, this, "ListQueryResultsForManagementGroupNext", tracingParameters);
}
// Construct URL
- var _baseUrl = Client.BaseUri.AbsoluteUri;
- var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "{scope}/providers/Microsoft.PolicyInsights/policyEvents/$metadata").ToString();
- _url = _url.Replace("{scope}", scope);
+ string _url = "{nextLink}";
+ _url = _url.Replace("{nextLink}", nextPageLink);
List _queryParameters = new List();
- if (apiVersion != null)
+ if (_queryParameters.Count > 0)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("POST");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200)
+ {
+ var ex = new QueryFailureException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ QueryFailure _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse>();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ ///
+ /// Queries policy events for the resources under the subscription.
+ ///
+ ///
+ /// The NextLink from the previous successful call to List operation.
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task>> ListQueryResultsForSubscriptionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (nextPageLink == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink");
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("nextPageLink", nextPageLink);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "ListQueryResultsForSubscriptionNext", tracingParameters);
}
+ // Construct URL
+ string _url = "{nextLink}";
+ _url = _url.Replace("{nextLink}", nextPageLink);
+ List _queryParameters = new List();
if (_queryParameters.Count > 0)
{
_url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
@@ -2190,7 +2440,1015 @@ internal PolicyEventsOperations(PolicyInsightsClient client)
// Create HTTP transport objects
var _httpRequest = new HttpRequestMessage();
HttpResponseMessage _httpResponse = null;
- _httpRequest.Method = new HttpMethod("GET");
+ _httpRequest.Method = new HttpMethod("POST");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200)
+ {
+ var ex = new QueryFailureException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ QueryFailure _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse>();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ ///
+ /// Queries policy events for the resources under the resource group.
+ ///
+ ///
+ /// The NextLink from the previous successful call to List operation.
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task>> ListQueryResultsForResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (nextPageLink == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink");
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("nextPageLink", nextPageLink);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "ListQueryResultsForResourceGroupNext", tracingParameters);
+ }
+ // Construct URL
+ string _url = "{nextLink}";
+ _url = _url.Replace("{nextLink}", nextPageLink);
+ List _queryParameters = new List();
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("POST");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200)
+ {
+ var ex = new QueryFailureException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ QueryFailure _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse>();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ ///
+ /// Queries policy events for the resource.
+ ///
+ ///
+ /// The NextLink from the previous successful call to List operation.
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task>> ListQueryResultsForResourceNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (nextPageLink == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink");
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("nextPageLink", nextPageLink);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "ListQueryResultsForResourceNext", tracingParameters);
+ }
+ // Construct URL
+ string _url = "{nextLink}";
+ _url = _url.Replace("{nextLink}", nextPageLink);
+ List _queryParameters = new List();
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("POST");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200)
+ {
+ var ex = new QueryFailureException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ QueryFailure _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse>();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ ///
+ /// Queries policy events for the subscription level policy set definition.
+ ///
+ ///
+ /// The NextLink from the previous successful call to List operation.
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task>> ListQueryResultsForPolicySetDefinitionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (nextPageLink == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink");
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("nextPageLink", nextPageLink);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "ListQueryResultsForPolicySetDefinitionNext", tracingParameters);
+ }
+ // Construct URL
+ string _url = "{nextLink}";
+ _url = _url.Replace("{nextLink}", nextPageLink);
+ List _queryParameters = new List();
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("POST");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200)
+ {
+ var ex = new QueryFailureException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ QueryFailure _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse>();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ ///
+ /// Queries policy events for the subscription level policy definition.
+ ///
+ ///
+ /// The NextLink from the previous successful call to List operation.
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task>> ListQueryResultsForPolicyDefinitionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (nextPageLink == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink");
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("nextPageLink", nextPageLink);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "ListQueryResultsForPolicyDefinitionNext", tracingParameters);
+ }
+ // Construct URL
+ string _url = "{nextLink}";
+ _url = _url.Replace("{nextLink}", nextPageLink);
+ List _queryParameters = new List();
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("POST");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200)
+ {
+ var ex = new QueryFailureException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ QueryFailure _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse>();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ ///
+ /// Queries policy events for the subscription level policy assignment.
+ ///
+ ///
+ /// The NextLink from the previous successful call to List operation.
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task>> ListQueryResultsForSubscriptionLevelPolicyAssignmentNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (nextPageLink == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink");
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("nextPageLink", nextPageLink);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "ListQueryResultsForSubscriptionLevelPolicyAssignmentNext", tracingParameters);
+ }
+ // Construct URL
+ string _url = "{nextLink}";
+ _url = _url.Replace("{nextLink}", nextPageLink);
+ List _queryParameters = new List();
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("POST");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200)
+ {
+ var ex = new QueryFailureException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ QueryFailure _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse>();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ ///
+ /// Queries policy events for the resource group level policy assignment.
+ ///
+ ///
+ /// The NextLink from the previous successful call to List operation.
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task>> ListQueryResultsForResourceGroupLevelPolicyAssignmentNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (nextPageLink == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink");
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("nextPageLink", nextPageLink);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "ListQueryResultsForResourceGroupLevelPolicyAssignmentNext", tracingParameters);
+ }
+ // Construct URL
+ string _url = "{nextLink}";
+ _url = _url.Replace("{nextLink}", nextPageLink);
+ List _queryParameters = new List();
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("POST");
_httpRequest.RequestUri = new System.Uri(_url);
// Set Headers
if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
@@ -2271,7 +3529,7 @@ internal PolicyEventsOperations(PolicyInsightsClient client)
throw ex;
}
// Create Result
- var _result = new AzureOperationResponse();
+ var _result = new AzureOperationResponse>();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
if (_httpResponse.Headers.Contains("x-ms-request-id"))
@@ -2284,7 +3542,7 @@ internal PolicyEventsOperations(PolicyInsightsClient client)
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
}
catch (JsonException ex)
{
diff --git a/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/PolicyEventsOperationsExtensions.cs b/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/PolicyEventsOperationsExtensions.cs
index 8992e8b3f09b..2103d7ebc712 100644
--- a/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/PolicyEventsOperationsExtensions.cs
+++ b/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/PolicyEventsOperationsExtensions.cs
@@ -33,7 +33,7 @@ public static partial class PolicyEventsOperationsExtensions
///
/// Additional parameters for the operation
///
- public static PolicyEventsQueryResults ListQueryResultsForManagementGroup(this IPolicyEventsOperations operations, string managementGroupName, QueryOptions queryOptions = default(QueryOptions))
+ public static IPage ListQueryResultsForManagementGroup(this IPolicyEventsOperations operations, string managementGroupName, QueryOptions queryOptions = default(QueryOptions))
{
return operations.ListQueryResultsForManagementGroupAsync(managementGroupName, queryOptions).GetAwaiter().GetResult();
}
@@ -53,7 +53,7 @@ public static partial class PolicyEventsOperationsExtensions
///
/// The cancellation token.
///
- public static async Task ListQueryResultsForManagementGroupAsync(this IPolicyEventsOperations operations, string managementGroupName, QueryOptions queryOptions = default(QueryOptions), CancellationToken cancellationToken = default(CancellationToken))
+ public static async Task> ListQueryResultsForManagementGroupAsync(this IPolicyEventsOperations operations, string managementGroupName, QueryOptions queryOptions = default(QueryOptions), CancellationToken cancellationToken = default(CancellationToken))
{
using (var _result = await operations.ListQueryResultsForManagementGroupWithHttpMessagesAsync(managementGroupName, queryOptions, null, cancellationToken).ConfigureAwait(false))
{
@@ -73,7 +73,7 @@ public static partial class PolicyEventsOperationsExtensions
///
/// Additional parameters for the operation
///
- public static PolicyEventsQueryResults ListQueryResultsForSubscription(this IPolicyEventsOperations operations, string subscriptionId, QueryOptions queryOptions = default(QueryOptions))
+ public static IPage ListQueryResultsForSubscription(this IPolicyEventsOperations operations, string subscriptionId, QueryOptions queryOptions = default(QueryOptions))
{
return operations.ListQueryResultsForSubscriptionAsync(subscriptionId, queryOptions).GetAwaiter().GetResult();
}
@@ -93,7 +93,7 @@ public static partial class PolicyEventsOperationsExtensions
///
/// The cancellation token.
///
- public static async Task ListQueryResultsForSubscriptionAsync(this IPolicyEventsOperations operations, string subscriptionId, QueryOptions queryOptions = default(QueryOptions), CancellationToken cancellationToken = default(CancellationToken))
+ public static async Task> ListQueryResultsForSubscriptionAsync(this IPolicyEventsOperations operations, string subscriptionId, QueryOptions queryOptions = default(QueryOptions), CancellationToken cancellationToken = default(CancellationToken))
{
using (var _result = await operations.ListQueryResultsForSubscriptionWithHttpMessagesAsync(subscriptionId, queryOptions, null, cancellationToken).ConfigureAwait(false))
{
@@ -116,7 +116,7 @@ public static partial class PolicyEventsOperationsExtensions
///
/// Additional parameters for the operation
///
- public static PolicyEventsQueryResults ListQueryResultsForResourceGroup(this IPolicyEventsOperations operations, string subscriptionId, string resourceGroupName, QueryOptions queryOptions = default(QueryOptions))
+ public static IPage ListQueryResultsForResourceGroup(this IPolicyEventsOperations operations, string subscriptionId, string resourceGroupName, QueryOptions queryOptions = default(QueryOptions))
{
return operations.ListQueryResultsForResourceGroupAsync(subscriptionId, resourceGroupName, queryOptions).GetAwaiter().GetResult();
}
@@ -139,7 +139,7 @@ public static partial class PolicyEventsOperationsExtensions
///
/// The cancellation token.
///
- public static async Task ListQueryResultsForResourceGroupAsync(this IPolicyEventsOperations operations, string subscriptionId, string resourceGroupName, QueryOptions queryOptions = default(QueryOptions), CancellationToken cancellationToken = default(CancellationToken))
+ public static async Task> ListQueryResultsForResourceGroupAsync(this IPolicyEventsOperations operations, string subscriptionId, string resourceGroupName, QueryOptions queryOptions = default(QueryOptions), CancellationToken cancellationToken = default(CancellationToken))
{
using (var _result = await operations.ListQueryResultsForResourceGroupWithHttpMessagesAsync(subscriptionId, resourceGroupName, queryOptions, null, cancellationToken).ConfigureAwait(false))
{
@@ -159,7 +159,7 @@ public static partial class PolicyEventsOperationsExtensions
///
/// Additional parameters for the operation
///
- public static PolicyEventsQueryResults ListQueryResultsForResource(this IPolicyEventsOperations operations, string resourceId, QueryOptions queryOptions = default(QueryOptions))
+ public static IPage ListQueryResultsForResource(this IPolicyEventsOperations operations, string resourceId, QueryOptions queryOptions = default(QueryOptions))
{
return operations.ListQueryResultsForResourceAsync(resourceId, queryOptions).GetAwaiter().GetResult();
}
@@ -179,7 +179,7 @@ public static partial class PolicyEventsOperationsExtensions
///
/// The cancellation token.
///
- public static async Task ListQueryResultsForResourceAsync(this IPolicyEventsOperations operations, string resourceId, QueryOptions queryOptions = default(QueryOptions), CancellationToken cancellationToken = default(CancellationToken))
+ public static async Task> ListQueryResultsForResourceAsync(this IPolicyEventsOperations operations, string resourceId, QueryOptions queryOptions = default(QueryOptions), CancellationToken cancellationToken = default(CancellationToken))
{
using (var _result = await operations.ListQueryResultsForResourceWithHttpMessagesAsync(resourceId, queryOptions, null, cancellationToken).ConfigureAwait(false))
{
@@ -202,7 +202,7 @@ public static partial class PolicyEventsOperationsExtensions
///
/// Additional parameters for the operation
///
- public static PolicyEventsQueryResults ListQueryResultsForPolicySetDefinition(this IPolicyEventsOperations operations, string subscriptionId, string policySetDefinitionName, QueryOptions queryOptions = default(QueryOptions))
+ public static IPage ListQueryResultsForPolicySetDefinition(this IPolicyEventsOperations operations, string subscriptionId, string policySetDefinitionName, QueryOptions queryOptions = default(QueryOptions))
{
return operations.ListQueryResultsForPolicySetDefinitionAsync(subscriptionId, policySetDefinitionName, queryOptions).GetAwaiter().GetResult();
}
@@ -225,7 +225,7 @@ public static partial class PolicyEventsOperationsExtensions
///
/// The cancellation token.
///
- public static async Task ListQueryResultsForPolicySetDefinitionAsync(this IPolicyEventsOperations operations, string subscriptionId, string policySetDefinitionName, QueryOptions queryOptions = default(QueryOptions), CancellationToken cancellationToken = default(CancellationToken))
+ public static async Task> ListQueryResultsForPolicySetDefinitionAsync(this IPolicyEventsOperations operations, string subscriptionId, string policySetDefinitionName, QueryOptions queryOptions = default(QueryOptions), CancellationToken cancellationToken = default(CancellationToken))
{
using (var _result = await operations.ListQueryResultsForPolicySetDefinitionWithHttpMessagesAsync(subscriptionId, policySetDefinitionName, queryOptions, null, cancellationToken).ConfigureAwait(false))
{
@@ -248,7 +248,7 @@ public static partial class PolicyEventsOperationsExtensions
///
/// Additional parameters for the operation
///
- public static PolicyEventsQueryResults ListQueryResultsForPolicyDefinition(this IPolicyEventsOperations operations, string subscriptionId, string policyDefinitionName, QueryOptions queryOptions = default(QueryOptions))
+ public static IPage ListQueryResultsForPolicyDefinition(this IPolicyEventsOperations operations, string subscriptionId, string policyDefinitionName, QueryOptions queryOptions = default(QueryOptions))
{
return operations.ListQueryResultsForPolicyDefinitionAsync(subscriptionId, policyDefinitionName, queryOptions).GetAwaiter().GetResult();
}
@@ -271,7 +271,7 @@ public static partial class PolicyEventsOperationsExtensions
///
/// The cancellation token.
///
- public static async Task ListQueryResultsForPolicyDefinitionAsync(this IPolicyEventsOperations operations, string subscriptionId, string policyDefinitionName, QueryOptions queryOptions = default(QueryOptions), CancellationToken cancellationToken = default(CancellationToken))
+ public static async Task> ListQueryResultsForPolicyDefinitionAsync(this IPolicyEventsOperations operations, string subscriptionId, string policyDefinitionName, QueryOptions queryOptions = default(QueryOptions), CancellationToken cancellationToken = default(CancellationToken))
{
using (var _result = await operations.ListQueryResultsForPolicyDefinitionWithHttpMessagesAsync(subscriptionId, policyDefinitionName, queryOptions, null, cancellationToken).ConfigureAwait(false))
{
@@ -294,7 +294,7 @@ public static partial class PolicyEventsOperationsExtensions
///