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 c87ff101479a..6c67f0a0ed56 100644
--- a/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/IPolicyEventsOperations.cs
+++ b/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/IPolicyEventsOperations.cs
@@ -264,7 +264,7 @@ public partial interface IPolicyEventsOperations
///
/// Thrown when a required parameter is null
///
- Task>> ListQueryResultsForManagementGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task>> NextLinkWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
/// Queries policy events for the resources under the subscription.
///
@@ -286,7 +286,7 @@ public partial interface IPolicyEventsOperations
///
/// Thrown when a required parameter is null
///
- Task>> ListQueryResultsForSubscriptionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task>> NextLink1WithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
/// Queries policy events for the resources under the resource group.
///
@@ -308,7 +308,7 @@ public partial interface IPolicyEventsOperations
///
/// Thrown when a required parameter is null
///
- Task>> ListQueryResultsForResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task>> NextLink2WithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
/// Queries policy events for the resource.
///
@@ -330,7 +330,7 @@ public partial interface IPolicyEventsOperations
///
/// Thrown when a required parameter is null
///
- Task>> ListQueryResultsForResourceNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task>> NextLink3WithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
/// Queries policy events for the subscription level policy set
/// definition.
@@ -353,7 +353,7 @@ public partial interface IPolicyEventsOperations
///
/// Thrown when a required parameter is null
///
- Task>> ListQueryResultsForPolicySetDefinitionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task>> NextLink4WithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
/// Queries policy events for the subscription level policy definition.
///
@@ -375,7 +375,7 @@ public partial interface IPolicyEventsOperations
///
/// Thrown when a required parameter is null
///
- Task>> ListQueryResultsForPolicyDefinitionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task>> NextLink5WithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
/// Queries policy events for the subscription level policy assignment.
///
@@ -397,7 +397,7 @@ public partial interface IPolicyEventsOperations
///
/// Thrown when a required parameter is null
///
- Task>> ListQueryResultsForSubscriptionLevelPolicyAssignmentNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task>> NextLink6WithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
/// Queries policy events for the resource group level policy
/// assignment.
@@ -420,6 +420,6 @@ public partial interface IPolicyEventsOperations
///
/// Thrown when a required parameter is null
///
- Task>> ListQueryResultsForResourceGroupLevelPolicyAssignmentNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task>> NextLink7WithHttpMessagesAsync(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 6cec7a59f814..bbc298705a97 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.
///
diff --git a/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/IPolicyRestrictionsOperations.cs b/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/IPolicyRestrictionsOperations.cs
index 67a77a6ec610..b701b3288609 100644
--- a/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/IPolicyRestrictionsOperations.cs
+++ b/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/IPolicyRestrictionsOperations.cs
@@ -79,5 +79,31 @@ public partial interface IPolicyRestrictionsOperations
/// Thrown when a required parameter is null
///
Task> CheckAtResourceGroupScopeWithHttpMessagesAsync(string subscriptionId, string resourceGroupName, CheckRestrictionsRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Checks what restrictions Azure Policy will place on resources
+ /// within a management group.
+ ///
+ ///
+ /// Management group ID.
+ ///
+ ///
+ /// 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> CheckAtManagementGroupScopeWithHttpMessagesAsync(string managementGroupId, CheckManagementGroupRestrictionsRequest 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 823d7d7d6c44..9c1ec1f83a91 100644
--- a/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/IPolicyStatesOperations.cs
+++ b/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/IPolicyStatesOperations.cs
@@ -622,7 +622,7 @@ public partial interface IPolicyStatesOperations
///
/// Thrown when a required parameter is null
///
- Task>> ListQueryResultsForManagementGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task>> NextLinkWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
/// Queries policy states for the resources under the subscription.
///
@@ -644,7 +644,7 @@ public partial interface IPolicyStatesOperations
///
/// Thrown when a required parameter is null
///
- Task>> ListQueryResultsForSubscriptionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task>> NextLink1WithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
/// Queries policy states for the resources under the resource group.
///
@@ -666,7 +666,7 @@ public partial interface IPolicyStatesOperations
///
/// Thrown when a required parameter is null
///
- Task>> ListQueryResultsForResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task>> NextLink2WithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
/// Queries policy states for the resource.
///
@@ -688,7 +688,7 @@ public partial interface IPolicyStatesOperations
///
/// Thrown when a required parameter is null
///
- Task>> ListQueryResultsForResourceNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task>> NextLink3WithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
/// Queries policy states for the subscription level policy set
/// definition.
@@ -711,7 +711,7 @@ public partial interface IPolicyStatesOperations
///
/// Thrown when a required parameter is null
///
- Task>> ListQueryResultsForPolicySetDefinitionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task>> NextLink4WithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
/// Queries policy states for the subscription level policy definition.
///
@@ -733,7 +733,7 @@ public partial interface IPolicyStatesOperations
///
/// Thrown when a required parameter is null
///
- Task>> ListQueryResultsForPolicyDefinitionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task>> NextLink5WithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
/// Queries policy states for the subscription level policy assignment.
///
@@ -755,7 +755,7 @@ public partial interface IPolicyStatesOperations
///
/// Thrown when a required parameter is null
///
- Task>> ListQueryResultsForSubscriptionLevelPolicyAssignmentNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task>> NextLink6WithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
/// Queries policy states for the resource group level policy
/// assignment.
@@ -778,6 +778,6 @@ public partial interface IPolicyStatesOperations
///
/// Thrown when a required parameter is null
///
- Task>> ListQueryResultsForResourceGroupLevelPolicyAssignmentNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task>> NextLink7WithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
}
}
diff --git a/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/Models/CheckManagementGroupRestrictionsRequest.cs b/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/Models/CheckManagementGroupRestrictionsRequest.cs
new file mode 100644
index 000000000000..54d35eaa3214
--- /dev/null
+++ b/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/Models/CheckManagementGroupRestrictionsRequest.cs
@@ -0,0 +1,91 @@
+//
+// 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 check policy restrictions parameters describing the resource that
+ /// is being evaluated.
+ ///
+ public partial class CheckManagementGroupRestrictionsRequest
+ {
+ ///
+ /// Initializes a new instance of the
+ /// CheckManagementGroupRestrictionsRequest class.
+ ///
+ public CheckManagementGroupRestrictionsRequest()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the
+ /// CheckManagementGroupRestrictionsRequest class.
+ ///
+ /// The information about the resource
+ /// that will be evaluated.
+ /// The list of fields and values that
+ /// should be evaluated for potential restrictions.
+ public CheckManagementGroupRestrictionsRequest(CheckRestrictionsResourceDetails resourceDetails = default(CheckRestrictionsResourceDetails), 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)
+ {
+ 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/TrackedResource.cs b/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/Models/TrackedResource.cs
new file mode 100644
index 000000000000..06944c9077a5
--- /dev/null
+++ b/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/Models/TrackedResource.cs
@@ -0,0 +1,87 @@
+//
+// 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;
+
+ ///
+ /// Tracked Resource
+ ///
+ ///
+ /// The resource model definition for an Azure Resource Manager tracked top
+ /// level resource which has 'tags' and a 'location'
+ ///
+ public partial class TrackedResource : Resource
+ {
+ ///
+ /// Initializes a new instance of the TrackedResource class.
+ ///
+ public TrackedResource()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the TrackedResource class.
+ ///
+ /// The geo-location where the resource
+ /// lives
+ /// Fully qualified resource ID for the resource. Ex -
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
+ /// The name of the resource
+ /// The type of the resource. E.g.
+ /// "Microsoft.Compute/virtualMachines" or
+ /// "Microsoft.Storage/storageAccounts"
+ /// Resource tags.
+ public TrackedResource(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary))
+ : base(id, name, type)
+ {
+ Tags = tags;
+ Location = location;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets or sets resource tags.
+ ///
+ [JsonProperty(PropertyName = "tags")]
+ public IDictionary Tags { get; set; }
+
+ ///
+ /// Gets or sets the geo-location where the resource lives
+ ///
+ [JsonProperty(PropertyName = "location")]
+ public string Location { get; set; }
+
+ ///
+ /// Validate the object.
+ ///
+ ///
+ /// Thrown if validation fails
+ ///
+ public virtual void Validate()
+ {
+ if (Location == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "Location");
+ }
+ }
+ }
+}
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 3547e3184289..b5882343811c 100644
--- a/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/PolicyEventsOperations.cs
+++ b/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/PolicyEventsOperations.cs
@@ -2244,7 +2244,7 @@ internal PolicyEventsOperations(PolicyInsightsClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task>> ListQueryResultsForManagementGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task>> NextLinkWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (nextPageLink == null)
{
@@ -2259,7 +2259,7 @@ internal PolicyEventsOperations(PolicyInsightsClient client)
Dictionary tracingParameters = new Dictionary();
tracingParameters.Add("nextPageLink", nextPageLink);
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "ListQueryResultsForManagementGroupNext", tracingParameters);
+ ServiceClientTracing.Enter(_invocationId, this, "NextLink", tracingParameters);
}
// Construct URL
string _url = "{nextLink}";
@@ -2412,7 +2412,7 @@ internal PolicyEventsOperations(PolicyInsightsClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task>> ListQueryResultsForSubscriptionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task>> NextLink1WithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (nextPageLink == null)
{
@@ -2427,7 +2427,7 @@ internal PolicyEventsOperations(PolicyInsightsClient client)
Dictionary tracingParameters = new Dictionary();
tracingParameters.Add("nextPageLink", nextPageLink);
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "ListQueryResultsForSubscriptionNext", tracingParameters);
+ ServiceClientTracing.Enter(_invocationId, this, "NextLink1", tracingParameters);
}
// Construct URL
string _url = "{nextLink}";
@@ -2580,7 +2580,7 @@ internal PolicyEventsOperations(PolicyInsightsClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task>> ListQueryResultsForResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task>> NextLink2WithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (nextPageLink == null)
{
@@ -2595,7 +2595,7 @@ internal PolicyEventsOperations(PolicyInsightsClient client)
Dictionary tracingParameters = new Dictionary();
tracingParameters.Add("nextPageLink", nextPageLink);
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "ListQueryResultsForResourceGroupNext", tracingParameters);
+ ServiceClientTracing.Enter(_invocationId, this, "NextLink2", tracingParameters);
}
// Construct URL
string _url = "{nextLink}";
@@ -2748,7 +2748,7 @@ internal PolicyEventsOperations(PolicyInsightsClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task>> ListQueryResultsForResourceNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task>> NextLink3WithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (nextPageLink == null)
{
@@ -2763,7 +2763,7 @@ internal PolicyEventsOperations(PolicyInsightsClient client)
Dictionary tracingParameters = new Dictionary();
tracingParameters.Add("nextPageLink", nextPageLink);
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "ListQueryResultsForResourceNext", tracingParameters);
+ ServiceClientTracing.Enter(_invocationId, this, "NextLink3", tracingParameters);
}
// Construct URL
string _url = "{nextLink}";
@@ -2916,7 +2916,7 @@ internal PolicyEventsOperations(PolicyInsightsClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task>> ListQueryResultsForPolicySetDefinitionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task>> NextLink4WithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (nextPageLink == null)
{
@@ -2931,7 +2931,7 @@ internal PolicyEventsOperations(PolicyInsightsClient client)
Dictionary tracingParameters = new Dictionary();
tracingParameters.Add("nextPageLink", nextPageLink);
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "ListQueryResultsForPolicySetDefinitionNext", tracingParameters);
+ ServiceClientTracing.Enter(_invocationId, this, "NextLink4", tracingParameters);
}
// Construct URL
string _url = "{nextLink}";
@@ -3084,7 +3084,7 @@ internal PolicyEventsOperations(PolicyInsightsClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task>> ListQueryResultsForPolicyDefinitionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task>> NextLink5WithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (nextPageLink == null)
{
@@ -3099,7 +3099,7 @@ internal PolicyEventsOperations(PolicyInsightsClient client)
Dictionary tracingParameters = new Dictionary();
tracingParameters.Add("nextPageLink", nextPageLink);
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "ListQueryResultsForPolicyDefinitionNext", tracingParameters);
+ ServiceClientTracing.Enter(_invocationId, this, "NextLink5", tracingParameters);
}
// Construct URL
string _url = "{nextLink}";
@@ -3252,7 +3252,7 @@ internal PolicyEventsOperations(PolicyInsightsClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task>> ListQueryResultsForSubscriptionLevelPolicyAssignmentNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task>> NextLink6WithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (nextPageLink == null)
{
@@ -3267,7 +3267,7 @@ internal PolicyEventsOperations(PolicyInsightsClient client)
Dictionary tracingParameters = new Dictionary();
tracingParameters.Add("nextPageLink", nextPageLink);
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "ListQueryResultsForSubscriptionLevelPolicyAssignmentNext", tracingParameters);
+ ServiceClientTracing.Enter(_invocationId, this, "NextLink6", tracingParameters);
}
// Construct URL
string _url = "{nextLink}";
@@ -3420,7 +3420,7 @@ internal PolicyEventsOperations(PolicyInsightsClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task>> ListQueryResultsForResourceGroupLevelPolicyAssignmentNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task>> NextLink7WithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (nextPageLink == null)
{
@@ -3435,7 +3435,7 @@ internal PolicyEventsOperations(PolicyInsightsClient client)
Dictionary tracingParameters = new Dictionary();
tracingParameters.Add("nextPageLink", nextPageLink);
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "ListQueryResultsForResourceGroupLevelPolicyAssignmentNext", tracingParameters);
+ ServiceClientTracing.Enter(_invocationId, this, "NextLink7", tracingParameters);
}
// Construct URL
string _url = "{nextLink}";
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 2103d7ebc712..8ec53c4ecb29 100644
--- a/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/PolicyEventsOperationsExtensions.cs
+++ b/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/PolicyEventsOperationsExtensions.cs
@@ -386,9 +386,9 @@ public static partial class PolicyEventsOperationsExtensions
///
/// The NextLink from the previous successful call to List operation.
///
- public static IPage ListQueryResultsForManagementGroupNext(this IPolicyEventsOperations operations, string nextPageLink)
+ public static IPage NextLink(this IPolicyEventsOperations operations, string nextPageLink)
{
- return operations.ListQueryResultsForManagementGroupNextAsync(nextPageLink).GetAwaiter().GetResult();
+ return operations.NextLinkAsync(nextPageLink).GetAwaiter().GetResult();
}
///
@@ -403,9 +403,9 @@ public static IPage ListQueryResultsForManagementGroupNext(this IPo
///
/// The cancellation token.
///
- public static async Task> ListQueryResultsForManagementGroupNextAsync(this IPolicyEventsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken))
+ public static async Task> NextLinkAsync(this IPolicyEventsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken))
{
- using (var _result = await operations.ListQueryResultsForManagementGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false))
+ using (var _result = await operations.NextLinkWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
@@ -420,9 +420,9 @@ public static IPage ListQueryResultsForManagementGroupNext(this IPo
///
/// The NextLink from the previous successful call to List operation.
///
- public static IPage ListQueryResultsForSubscriptionNext(this IPolicyEventsOperations operations, string nextPageLink)
+ public static IPage NextLink1(this IPolicyEventsOperations operations, string nextPageLink)
{
- return operations.ListQueryResultsForSubscriptionNextAsync(nextPageLink).GetAwaiter().GetResult();
+ return operations.NextLink1Async(nextPageLink).GetAwaiter().GetResult();
}
///
@@ -437,9 +437,9 @@ public static IPage ListQueryResultsForSubscriptionNext(this IPolic
///
/// The cancellation token.
///
- public static async Task> ListQueryResultsForSubscriptionNextAsync(this IPolicyEventsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken))
+ public static async Task> NextLink1Async(this IPolicyEventsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken))
{
- using (var _result = await operations.ListQueryResultsForSubscriptionNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false))
+ using (var _result = await operations.NextLink1WithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
@@ -454,9 +454,9 @@ public static IPage ListQueryResultsForSubscriptionNext(this IPolic
///
/// The NextLink from the previous successful call to List operation.
///
- public static IPage ListQueryResultsForResourceGroupNext(this IPolicyEventsOperations operations, string nextPageLink)
+ public static IPage NextLink2(this IPolicyEventsOperations operations, string nextPageLink)
{
- return operations.ListQueryResultsForResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult();
+ return operations.NextLink2Async(nextPageLink).GetAwaiter().GetResult();
}
///
@@ -471,9 +471,9 @@ public static IPage ListQueryResultsForResourceGroupNext(this IPoli
///
/// The cancellation token.
///
- public static async Task> ListQueryResultsForResourceGroupNextAsync(this IPolicyEventsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken))
+ public static async Task> NextLink2Async(this IPolicyEventsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken))
{
- using (var _result = await operations.ListQueryResultsForResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false))
+ using (var _result = await operations.NextLink2WithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
@@ -488,9 +488,9 @@ public static IPage ListQueryResultsForResourceGroupNext(this IPoli
///
/// The NextLink from the previous successful call to List operation.
///
- public static IPage ListQueryResultsForResourceNext(this IPolicyEventsOperations operations, string nextPageLink)
+ public static IPage NextLink3(this IPolicyEventsOperations operations, string nextPageLink)
{
- return operations.ListQueryResultsForResourceNextAsync(nextPageLink).GetAwaiter().GetResult();
+ return operations.NextLink3Async(nextPageLink).GetAwaiter().GetResult();
}
///
@@ -505,9 +505,9 @@ public static IPage ListQueryResultsForResourceNext(this IPolicyEve
///
/// The cancellation token.
///
- public static async Task> ListQueryResultsForResourceNextAsync(this IPolicyEventsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken))
+ public static async Task> NextLink3Async(this IPolicyEventsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken))
{
- using (var _result = await operations.ListQueryResultsForResourceNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false))
+ using (var _result = await operations.NextLink3WithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
@@ -522,9 +522,9 @@ public static IPage ListQueryResultsForResourceNext(this IPolicyEve
///
/// The NextLink from the previous successful call to List operation.
///
- public static IPage ListQueryResultsForPolicySetDefinitionNext(this IPolicyEventsOperations operations, string nextPageLink)
+ public static IPage NextLink4(this IPolicyEventsOperations operations, string nextPageLink)
{
- return operations.ListQueryResultsForPolicySetDefinitionNextAsync(nextPageLink).GetAwaiter().GetResult();
+ return operations.NextLink4Async(nextPageLink).GetAwaiter().GetResult();
}
///
@@ -539,9 +539,9 @@ public static IPage ListQueryResultsForPolicySetDefinitionNext(this
///
/// The cancellation token.
///
- public static async Task> ListQueryResultsForPolicySetDefinitionNextAsync(this IPolicyEventsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken))
+ public static async Task> NextLink4Async(this IPolicyEventsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken))
{
- using (var _result = await operations.ListQueryResultsForPolicySetDefinitionNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false))
+ using (var _result = await operations.NextLink4WithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
@@ -556,9 +556,9 @@ public static IPage ListQueryResultsForPolicySetDefinitionNext(this
///
/// The NextLink from the previous successful call to List operation.
///
- public static IPage ListQueryResultsForPolicyDefinitionNext(this IPolicyEventsOperations operations, string nextPageLink)
+ public static IPage NextLink5(this IPolicyEventsOperations operations, string nextPageLink)
{
- return operations.ListQueryResultsForPolicyDefinitionNextAsync(nextPageLink).GetAwaiter().GetResult();
+ return operations.NextLink5Async(nextPageLink).GetAwaiter().GetResult();
}
///
@@ -573,9 +573,9 @@ public static IPage ListQueryResultsForPolicyDefinitionNext(this IP
///
/// The cancellation token.
///
- public static async Task> ListQueryResultsForPolicyDefinitionNextAsync(this IPolicyEventsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken))
+ public static async Task> NextLink5Async(this IPolicyEventsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken))
{
- using (var _result = await operations.ListQueryResultsForPolicyDefinitionNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false))
+ using (var _result = await operations.NextLink5WithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
@@ -590,9 +590,9 @@ public static IPage ListQueryResultsForPolicyDefinitionNext(this IP
///
/// The NextLink from the previous successful call to List operation.
///
- public static IPage ListQueryResultsForSubscriptionLevelPolicyAssignmentNext(this IPolicyEventsOperations operations, string nextPageLink)
+ public static IPage NextLink6(this IPolicyEventsOperations operations, string nextPageLink)
{
- return operations.ListQueryResultsForSubscriptionLevelPolicyAssignmentNextAsync(nextPageLink).GetAwaiter().GetResult();
+ return operations.NextLink6Async(nextPageLink).GetAwaiter().GetResult();
}
///
@@ -607,9 +607,9 @@ public static IPage ListQueryResultsForSubscriptionLevelPolicyAssig
///
/// The cancellation token.
///
- public static async Task> ListQueryResultsForSubscriptionLevelPolicyAssignmentNextAsync(this IPolicyEventsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken))
+ public static async Task> NextLink6Async(this IPolicyEventsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken))
{
- using (var _result = await operations.ListQueryResultsForSubscriptionLevelPolicyAssignmentNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false))
+ using (var _result = await operations.NextLink6WithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
@@ -624,9 +624,9 @@ public static IPage ListQueryResultsForSubscriptionLevelPolicyAssig
///
/// The NextLink from the previous successful call to List operation.
///
- public static IPage ListQueryResultsForResourceGroupLevelPolicyAssignmentNext(this IPolicyEventsOperations operations, string nextPageLink)
+ public static IPage NextLink7(this IPolicyEventsOperations operations, string nextPageLink)
{
- return operations.ListQueryResultsForResourceGroupLevelPolicyAssignmentNextAsync(nextPageLink).GetAwaiter().GetResult();
+ return operations.NextLink7Async(nextPageLink).GetAwaiter().GetResult();
}
///
@@ -641,9 +641,9 @@ public static IPage ListQueryResultsForResourceGroupLevelPolicyAssi
///
/// The cancellation token.
///
- public static async Task> ListQueryResultsForResourceGroupLevelPolicyAssignmentNextAsync(this IPolicyEventsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken))
+ public static async Task> NextLink7Async(this IPolicyEventsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken))
{
- using (var _result = await operations.ListQueryResultsForResourceGroupLevelPolicyAssignmentNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false))
+ using (var _result = await operations.NextLink7WithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
diff --git a/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/PolicyInsightsClient.cs b/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/PolicyInsightsClient.cs
index 13047da699f4..43a27cbd9875 100644
--- a/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/PolicyInsightsClient.cs
+++ b/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/PolicyInsightsClient.cs
@@ -43,6 +43,11 @@ public partial class PolicyInsightsClient : ServiceClient,
///
public ServiceClientCredentials Credentials { get; private set; }
+ ///
+ /// The ID of the target subscription.
+ ///
+ public string SubscriptionId2 { get; set; }
+
///
/// The preferred language for the response.
///
diff --git a/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/PolicyRestrictionsOperations.cs b/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/PolicyRestrictionsOperations.cs
index 46719bc87086..966c3bacaa19 100644
--- a/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/PolicyRestrictionsOperations.cs
+++ b/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/PolicyRestrictionsOperations.cs
@@ -102,7 +102,7 @@ internal PolicyRestrictionsOperations(PolicyInsightsClient client)
{
parameters.Validate();
}
- string apiVersion = "2020-07-01";
+ string apiVersion = "2022-03-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -322,7 +322,7 @@ internal PolicyRestrictionsOperations(PolicyInsightsClient client)
{
parameters.Validate();
}
- string apiVersion = "2020-07-01";
+ string apiVersion = "2022-03-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -473,5 +473,202 @@ internal PolicyRestrictionsOperations(PolicyInsightsClient client)
return _result;
}
+ ///
+ /// Checks what restrictions Azure Policy will place on resources within a
+ /// management group.
+ ///
+ ///
+ /// Management group ID.
+ ///
+ ///
+ /// The check policy restrictions parameters.
+ ///
+ ///
+ /// 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> CheckAtManagementGroupScopeWithHttpMessagesAsync(string managementGroupId, CheckManagementGroupRestrictionsRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (managementGroupId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "managementGroupId");
+ }
+ if (parameters == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "parameters");
+ }
+ if (parameters != null)
+ {
+ parameters.Validate();
+ }
+ string managementGroupsNamespace = "Microsoft.Management";
+ string apiVersion = "2022-03-01";
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("managementGroupsNamespace", managementGroupsNamespace);
+ tracingParameters.Add("managementGroupId", managementGroupId);
+ tracingParameters.Add("apiVersion", apiVersion);
+ tracingParameters.Add("parameters", parameters);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "CheckAtManagementGroupScope", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/{managementGroupsNamespace}/managementGroups/{managementGroupId}/providers/Microsoft.PolicyInsights/checkPolicyRestrictions").ToString();
+ _url = _url.Replace("{managementGroupsNamespace}", System.Uri.EscapeDataString(managementGroupsNamespace));
+ _url = _url.Replace("{managementGroupId}", System.Uri.EscapeDataString(managementGroupId));
+ List _queryParameters = new List();
+ if (apiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ }
+ 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;
+ if(parameters != null)
+ {
+ _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings);
+ _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8);
+ _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8");
+ }
+ // 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 ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ ErrorResponse _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;
+ }
+
}
}
diff --git a/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/PolicyRestrictionsOperationsExtensions.cs b/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/PolicyRestrictionsOperationsExtensions.cs
index 289cb05b148c..1c7d55b3de78 100644
--- a/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/PolicyRestrictionsOperationsExtensions.cs
+++ b/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/PolicyRestrictionsOperationsExtensions.cs
@@ -113,5 +113,47 @@ public static CheckRestrictionsResult CheckAtResourceGroupScope(this IPolicyRest
}
}
+ ///
+ /// Checks what restrictions Azure Policy will place on resources within a
+ /// management group.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// Management group ID.
+ ///
+ ///
+ /// The check policy restrictions parameters.
+ ///
+ public static CheckRestrictionsResult CheckAtManagementGroupScope(this IPolicyRestrictionsOperations operations, string managementGroupId, CheckManagementGroupRestrictionsRequest parameters)
+ {
+ return operations.CheckAtManagementGroupScopeAsync(managementGroupId, parameters).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Checks what restrictions Azure Policy will place on resources within a
+ /// management group.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// Management group ID.
+ ///
+ ///
+ /// The check policy restrictions parameters.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task CheckAtManagementGroupScopeAsync(this IPolicyRestrictionsOperations operations, string managementGroupId, CheckManagementGroupRestrictionsRequest parameters, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.CheckAtManagementGroupScopeWithHttpMessagesAsync(managementGroupId, parameters, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
}
}
diff --git a/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/PolicyStatesOperations.cs b/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/PolicyStatesOperations.cs
index d7e6ec67c539..bfbe757cea91 100644
--- a/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/PolicyStatesOperations.cs
+++ b/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/PolicyStatesOperations.cs
@@ -4515,7 +4515,7 @@ internal PolicyStatesOperations(PolicyInsightsClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task>> ListQueryResultsForManagementGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task>> NextLinkWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (nextPageLink == null)
{
@@ -4530,7 +4530,7 @@ internal PolicyStatesOperations(PolicyInsightsClient client)
Dictionary tracingParameters = new Dictionary();
tracingParameters.Add("nextPageLink", nextPageLink);
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "ListQueryResultsForManagementGroupNext", tracingParameters);
+ ServiceClientTracing.Enter(_invocationId, this, "NextLink", tracingParameters);
}
// Construct URL
string _url = "{nextLink}";
@@ -4683,7 +4683,7 @@ internal PolicyStatesOperations(PolicyInsightsClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task>> ListQueryResultsForSubscriptionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task>> NextLink1WithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (nextPageLink == null)
{
@@ -4698,7 +4698,7 @@ internal PolicyStatesOperations(PolicyInsightsClient client)
Dictionary tracingParameters = new Dictionary();
tracingParameters.Add("nextPageLink", nextPageLink);
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "ListQueryResultsForSubscriptionNext", tracingParameters);
+ ServiceClientTracing.Enter(_invocationId, this, "NextLink1", tracingParameters);
}
// Construct URL
string _url = "{nextLink}";
@@ -4851,7 +4851,7 @@ internal PolicyStatesOperations(PolicyInsightsClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task>> ListQueryResultsForResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task>> NextLink2WithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (nextPageLink == null)
{
@@ -4866,7 +4866,7 @@ internal PolicyStatesOperations(PolicyInsightsClient client)
Dictionary tracingParameters = new Dictionary();
tracingParameters.Add("nextPageLink", nextPageLink);
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "ListQueryResultsForResourceGroupNext", tracingParameters);
+ ServiceClientTracing.Enter(_invocationId, this, "NextLink2", tracingParameters);
}
// Construct URL
string _url = "{nextLink}";
@@ -5019,7 +5019,7 @@ internal PolicyStatesOperations(PolicyInsightsClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task>> ListQueryResultsForResourceNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task>> NextLink3WithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (nextPageLink == null)
{
@@ -5034,7 +5034,7 @@ internal PolicyStatesOperations(PolicyInsightsClient client)
Dictionary tracingParameters = new Dictionary();
tracingParameters.Add("nextPageLink", nextPageLink);
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "ListQueryResultsForResourceNext", tracingParameters);
+ ServiceClientTracing.Enter(_invocationId, this, "NextLink3", tracingParameters);
}
// Construct URL
string _url = "{nextLink}";
@@ -5187,7 +5187,7 @@ internal PolicyStatesOperations(PolicyInsightsClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task>> ListQueryResultsForPolicySetDefinitionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task>> NextLink4WithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (nextPageLink == null)
{
@@ -5202,7 +5202,7 @@ internal PolicyStatesOperations(PolicyInsightsClient client)
Dictionary tracingParameters = new Dictionary();
tracingParameters.Add("nextPageLink", nextPageLink);
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "ListQueryResultsForPolicySetDefinitionNext", tracingParameters);
+ ServiceClientTracing.Enter(_invocationId, this, "NextLink4", tracingParameters);
}
// Construct URL
string _url = "{nextLink}";
@@ -5355,7 +5355,7 @@ internal PolicyStatesOperations(PolicyInsightsClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task>> ListQueryResultsForPolicyDefinitionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task>> NextLink5WithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (nextPageLink == null)
{
@@ -5370,7 +5370,7 @@ internal PolicyStatesOperations(PolicyInsightsClient client)
Dictionary tracingParameters = new Dictionary();
tracingParameters.Add("nextPageLink", nextPageLink);
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "ListQueryResultsForPolicyDefinitionNext", tracingParameters);
+ ServiceClientTracing.Enter(_invocationId, this, "NextLink5", tracingParameters);
}
// Construct URL
string _url = "{nextLink}";
@@ -5523,7 +5523,7 @@ internal PolicyStatesOperations(PolicyInsightsClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task>> ListQueryResultsForSubscriptionLevelPolicyAssignmentNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task>> NextLink6WithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (nextPageLink == null)
{
@@ -5538,7 +5538,7 @@ internal PolicyStatesOperations(PolicyInsightsClient client)
Dictionary tracingParameters = new Dictionary();
tracingParameters.Add("nextPageLink", nextPageLink);
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "ListQueryResultsForSubscriptionLevelPolicyAssignmentNext", tracingParameters);
+ ServiceClientTracing.Enter(_invocationId, this, "NextLink6", tracingParameters);
}
// Construct URL
string _url = "{nextLink}";
@@ -5691,7 +5691,7 @@ internal PolicyStatesOperations(PolicyInsightsClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task>> ListQueryResultsForResourceGroupLevelPolicyAssignmentNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task>> NextLink7WithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (nextPageLink == null)
{
@@ -5706,7 +5706,7 @@ internal PolicyStatesOperations(PolicyInsightsClient client)
Dictionary tracingParameters = new Dictionary();
tracingParameters.Add("nextPageLink", nextPageLink);
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "ListQueryResultsForResourceGroupLevelPolicyAssignmentNext", tracingParameters);
+ ServiceClientTracing.Enter(_invocationId, this, "NextLink7", tracingParameters);
}
// Construct URL
string _url = "{nextLink}";
diff --git a/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/PolicyStatesOperationsExtensions.cs b/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/PolicyStatesOperationsExtensions.cs
index 0d96e68dc822..698e66a1a4a1 100644
--- a/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/PolicyStatesOperationsExtensions.cs
+++ b/sdk/policyinsights/Microsoft.Azure.Management.PolicyInsights/src/Generated/PolicyStatesOperationsExtensions.cs
@@ -982,9 +982,9 @@ public static void BeginTriggerResourceGroupEvaluation(this IPolicyStatesOperati
///
/// The NextLink from the previous successful call to List operation.
///
- public static IPage ListQueryResultsForManagementGroupNext(this IPolicyStatesOperations operations, string nextPageLink)
+ public static IPage NextLink(this IPolicyStatesOperations operations, string nextPageLink)
{
- return operations.ListQueryResultsForManagementGroupNextAsync(nextPageLink).GetAwaiter().GetResult();
+ return operations.NextLinkAsync(nextPageLink).GetAwaiter().GetResult();
}
///
@@ -999,9 +999,9 @@ public static IPage ListQueryResultsForManagementGroupNext(this IPo
///
/// The cancellation token.
///
- public static async Task> ListQueryResultsForManagementGroupNextAsync(this IPolicyStatesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken))
+ public static async Task> NextLinkAsync(this IPolicyStatesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken))
{
- using (var _result = await operations.ListQueryResultsForManagementGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false))
+ using (var _result = await operations.NextLinkWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
@@ -1016,9 +1016,9 @@ public static IPage ListQueryResultsForManagementGroupNext(this IPo
///
/// The NextLink from the previous successful call to List operation.
///
- public static IPage ListQueryResultsForSubscriptionNext(this IPolicyStatesOperations operations, string nextPageLink)
+ public static IPage NextLink1(this IPolicyStatesOperations operations, string nextPageLink)
{
- return operations.ListQueryResultsForSubscriptionNextAsync(nextPageLink).GetAwaiter().GetResult();
+ return operations.NextLink1Async(nextPageLink).GetAwaiter().GetResult();
}
///
@@ -1033,9 +1033,9 @@ public static IPage ListQueryResultsForSubscriptionNext(this IPolic
///
/// The cancellation token.
///
- public static async Task> ListQueryResultsForSubscriptionNextAsync(this IPolicyStatesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken))
+ public static async Task> NextLink1Async(this IPolicyStatesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken))
{
- using (var _result = await operations.ListQueryResultsForSubscriptionNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false))
+ using (var _result = await operations.NextLink1WithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
@@ -1050,9 +1050,9 @@ public static IPage ListQueryResultsForSubscriptionNext(this IPolic
///
/// The NextLink from the previous successful call to List operation.
///
- public static IPage ListQueryResultsForResourceGroupNext(this IPolicyStatesOperations operations, string nextPageLink)
+ public static IPage NextLink2(this IPolicyStatesOperations operations, string nextPageLink)
{
- return operations.ListQueryResultsForResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult();
+ return operations.NextLink2Async(nextPageLink).GetAwaiter().GetResult();
}
///
@@ -1067,9 +1067,9 @@ public static IPage ListQueryResultsForResourceGroupNext(this IPoli
///
/// The cancellation token.
///
- public static async Task> ListQueryResultsForResourceGroupNextAsync(this IPolicyStatesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken))
+ public static async Task> NextLink2Async(this IPolicyStatesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken))
{
- using (var _result = await operations.ListQueryResultsForResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false))
+ using (var _result = await operations.NextLink2WithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
@@ -1084,9 +1084,9 @@ public static IPage ListQueryResultsForResourceGroupNext(this IPoli
///
/// The NextLink from the previous successful call to List operation.
///
- public static IPage ListQueryResultsForResourceNext(this IPolicyStatesOperations operations, string nextPageLink)
+ public static IPage NextLink3(this IPolicyStatesOperations operations, string nextPageLink)
{
- return operations.ListQueryResultsForResourceNextAsync(nextPageLink).GetAwaiter().GetResult();
+ return operations.NextLink3Async(nextPageLink).GetAwaiter().GetResult();
}
///
@@ -1101,9 +1101,9 @@ public static IPage