Skip to content

Commit a6b54f5

Browse files
authored
Update PolicyInsights SDK to api-version 2024-10-01 (#51073)
1 parent 7e1e0c4 commit a6b54f5

File tree

70 files changed

+5684
-271
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+5684
-271
lines changed

sdk/policyinsights/Azure.ResourceManager.PolicyInsights/CHANGELOG.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
11
# Release History
22

3-
## 1.3.0-beta.1 (Unreleased)
3+
## 1.3.0 (2025-10-22)
44

55
### Features Added
66

7-
### Breaking Changes
8-
9-
### Bugs Fixed
10-
11-
### Other Changes
7+
- Upgraded API version of Policy Insights to 2024-10-01.
8+
- Make `Azure.ResourceManager.Compute` AOT-compatible.
129

1310
## 1.2.1 (2025-03-11)
1411

sdk/policyinsights/Azure.ResourceManager.PolicyInsights/api/Azure.ResourceManager.PolicyInsights.net8.0.cs

Lines changed: 237 additions & 2 deletions
Large diffs are not rendered by default.

sdk/policyinsights/Azure.ResourceManager.PolicyInsights/api/Azure.ResourceManager.PolicyInsights.netstandard2.0.cs

Lines changed: 237 additions & 2 deletions
Large diffs are not rendered by default.

sdk/policyinsights/Azure.ResourceManager.PolicyInsights/src/Azure.ResourceManager.PolicyInsights.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<Version>1.3.0-beta.1</Version>
3+
<Version>1.3.0</Version>
44
<!--The ApiCompatVersion is managed automatically and should not generally be modified manually.-->
55
<ApiCompatVersion>1.2.1</ApiCompatVersion>
66
<PackageId>Azure.ResourceManager.PolicyInsights</PackageId>
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License.
3+
4+
#nullable disable
5+
6+
using System;
7+
using System.Collections.Generic;
8+
using System.ComponentModel;
9+
using System.Linq;
10+
using Azure.Core;
11+
using Azure.ResourceManager.Models;
12+
13+
namespace Azure.ResourceManager.PolicyInsights.Models
14+
{
15+
public static partial class ArmPolicyInsightsModelFactory
16+
{
17+
/// <summary> Initializes a new instance of <see cref="PolicyInsights.PolicyRemediationData"/>. </summary>
18+
/// <param name="id"> The id. </param>
19+
/// <param name="name"> The name. </param>
20+
/// <param name="resourceType"> The resourceType. </param>
21+
/// <param name="systemData"> The systemData. </param>
22+
/// <param name="policyAssignmentId"> The resource ID of the policy assignment that should be remediated. </param>
23+
/// <param name="policyDefinitionReferenceId"> The policy definition reference ID of the individual definition that should be remediated. Required when the policy assignment being remediated assigns a policy set definition. </param>
24+
/// <param name="resourceDiscoveryMode"> The way resources to remediate are discovered. Defaults to ExistingNonCompliant if not specified. </param>
25+
/// <param name="provisioningState"> The status of the remediation. </param>
26+
/// <param name="createdOn"> The time at which the remediation was created. </param>
27+
/// <param name="lastUpdatedOn"> The time at which the remediation was last updated. </param>
28+
/// <param name="filterLocations"> The filters that will be applied to determine which resources to remediate. </param>
29+
/// <param name="deploymentStatus"> The deployment status summary for all deployments created by the remediation. </param>
30+
/// <param name="statusMessage"> The remediation status message. Provides additional details regarding the state of the remediation. </param>
31+
/// <param name="correlationId"> The remediation correlation Id. Can be used to find events related to the remediation in the activity log. </param>
32+
/// <param name="resourceCount"> Determines the max number of resources that can be remediated by the remediation job. If not provided, the default resource count is used. </param>
33+
/// <param name="parallelDeployments"> Determines how many resources to remediate at any given time. Can be used to increase or reduce the pace of the remediation. If not provided, the default parallel deployments value is used. </param>
34+
/// <param name="failureThresholdPercentage"> The remediation failure threshold settings. </param>
35+
/// <returns> A new <see cref="PolicyInsights.PolicyRemediationData"/> instance for mocking. </returns>
36+
[EditorBrowsable(EditorBrowsableState.Never)]
37+
public static PolicyRemediationData PolicyRemediationData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, ResourceIdentifier policyAssignmentId = null, string policyDefinitionReferenceId = null, ResourceDiscoveryMode? resourceDiscoveryMode = null, string provisioningState = null, DateTimeOffset? createdOn = null, DateTimeOffset? lastUpdatedOn = null, IEnumerable<AzureLocation> filterLocations = null, RemediationDeploymentSummary deploymentStatus = null, string statusMessage = null, string correlationId = null, int? resourceCount = null, int? parallelDeployments = null, float? failureThresholdPercentage = null)
38+
{
39+
filterLocations ??= new List<AzureLocation>();
40+
41+
return new PolicyRemediationData(
42+
id,
43+
name,
44+
resourceType,
45+
systemData,
46+
policyAssignmentId,
47+
policyDefinitionReferenceId,
48+
resourceDiscoveryMode,
49+
provisioningState,
50+
createdOn,
51+
lastUpdatedOn,
52+
filterLocations != null ? new RemediationFilters(filterLocations?.ToList(), new List<string>(), serializedAdditionalRawData: null) : null,
53+
deploymentStatus,
54+
statusMessage,
55+
correlationId,
56+
resourceCount,
57+
parallelDeployments,
58+
failureThresholdPercentage != null ? new RemediationPropertiesFailureThreshold(failureThresholdPercentage, serializedAdditionalRawData: null) : null,
59+
serializedAdditionalRawData: null);
60+
}
61+
62+
/// <summary> Initializes a new instance of <see cref="Models.PolicyEvaluationResult"/>. </summary>
63+
/// <param name="policyInfo"> The details of the policy that was evaluated. </param>
64+
/// <param name="evaluationResult"> The result of the policy evaluation against the resource. This will typically be 'NonCompliant' but may contain other values if errors were encountered. </param>
65+
/// <param name="evaluationDetails"> The detailed results of the policy expressions and values that were evaluated. </param>
66+
/// <returns> A new <see cref="Models.PolicyEvaluationResult"/> instance for mocking. </returns>
67+
[EditorBrowsable(EditorBrowsableState.Never)]
68+
public static PolicyEvaluationResult PolicyEvaluationResult(PolicyReference policyInfo = null, string evaluationResult = null, PolicyEvaluationDetails evaluationDetails = null)
69+
{
70+
var checkRestrictionEvaluationDetails = new CheckRestrictionEvaluationDetails();
71+
if (evaluationResult != null)
72+
{
73+
checkRestrictionEvaluationDetails = new CheckRestrictionEvaluationDetails(evaluationDetails.EvaluatedExpressions, evaluationDetails.IfNotExistsDetails, null, null);
74+
}
75+
return new PolicyEvaluationResult(policyInfo, evaluationResult, checkRestrictionEvaluationDetails, null, serializedAdditionalRawData: null);
76+
}
77+
}
78+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License.
3+
4+
#nullable disable
5+
6+
using System.Collections.Generic;
7+
using System.ComponentModel;
8+
9+
namespace Azure.ResourceManager.PolicyInsights.Models
10+
{
11+
public partial class PolicyEvaluationResult
12+
{
13+
/// <summary> The detailed results of the policy expressions and values that were evaluated. </summary>
14+
[EditorBrowsable(EditorBrowsableState.Never)]
15+
public PolicyEvaluationDetails EvaluationDetails
16+
{
17+
get
18+
{
19+
return CheckRestrictionEvaluationDetails != null
20+
? new PolicyEvaluationDetails(CheckRestrictionEvaluationDetails.EvaluatedExpressions, CheckRestrictionEvaluationDetails.IfNotExistsDetails, null)
21+
: null;
22+
}
23+
}
24+
}
25+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License.
3+
4+
#nullable disable
5+
6+
using System.Collections.Generic;
7+
using System.ComponentModel;
8+
using Azure.Core;
9+
using Azure.ResourceManager.Models;
10+
using Azure.ResourceManager.PolicyInsights.Models;
11+
12+
namespace Azure.ResourceManager.PolicyInsights
13+
{
14+
public partial class PolicyRemediationData : ResourceData
15+
{
16+
/// <summary> The resource locations that will be remediated. </summary>
17+
[EditorBrowsable(EditorBrowsableState.Never)]
18+
public IList<AzureLocation> FilterLocations
19+
{
20+
get
21+
{
22+
if (Filter is null)
23+
Filter = new RemediationFilters();
24+
return Filter.Locations;
25+
}
26+
}
27+
}
28+
}

0 commit comments

Comments
 (0)