diff --git a/sdk/policyinsights/Azure.ResourceManager.PolicyInsights/api/Azure.ResourceManager.PolicyInsights.netstandard2.0.cs b/sdk/policyinsights/Azure.ResourceManager.PolicyInsights/api/Azure.ResourceManager.PolicyInsights.netstandard2.0.cs index 0f333827d337..56dc7a0bdbcb 100644 --- a/sdk/policyinsights/Azure.ResourceManager.PolicyInsights/api/Azure.ResourceManager.PolicyInsights.netstandard2.0.cs +++ b/sdk/policyinsights/Azure.ResourceManager.PolicyInsights/api/Azure.ResourceManager.PolicyInsights.netstandard2.0.cs @@ -18,11 +18,13 @@ protected PolicyAttestationCollection() { } public partial class PolicyAttestationData : Azure.ResourceManager.Models.ResourceData { public PolicyAttestationData(Azure.Core.ResourceIdentifier policyAssignmentId) { } + public System.DateTimeOffset? AssessmentOn { get { throw null; } set { } } public string Comments { get { throw null; } set { } } public Azure.ResourceManager.PolicyInsights.Models.PolicyComplianceState? ComplianceState { get { throw null; } set { } } public System.Collections.Generic.IList Evidence { get { throw null; } } public System.DateTimeOffset? ExpireOn { get { throw null; } set { } } public System.DateTimeOffset? LastComplianceStateChangeOn { get { throw null; } } + public System.BinaryData Metadata { get { throw null; } set { } } public string Owner { get { throw null; } set { } } public Azure.Core.ResourceIdentifier PolicyAssignmentId { get { throw null; } set { } } public string PolicyDefinitionReferenceId { get { throw null; } set { } } diff --git a/sdk/policyinsights/Azure.ResourceManager.PolicyInsights/src/Generated/Models/PolicyAttestationData.Serialization.cs b/sdk/policyinsights/Azure.ResourceManager.PolicyInsights/src/Generated/Models/PolicyAttestationData.Serialization.cs index 33afb0a644c8..7b91cf7538fa 100644 --- a/sdk/policyinsights/Azure.ResourceManager.PolicyInsights/src/Generated/Models/PolicyAttestationData.Serialization.cs +++ b/sdk/policyinsights/Azure.ResourceManager.PolicyInsights/src/Generated/Models/PolicyAttestationData.Serialization.cs @@ -58,6 +58,20 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) } writer.WriteEndArray(); } + if (Optional.IsDefined(AssessmentOn)) + { + writer.WritePropertyName("assessmentDate"); + writer.WriteStringValue(AssessmentOn.Value, "O"); + } + if (Optional.IsDefined(Metadata)) + { + writer.WritePropertyName("metadata"); +#if NET6_0_OR_GREATER + writer.WriteRawValue(Metadata); +#else + JsonSerializer.Serialize(writer, JsonDocument.Parse(Metadata.ToString()).RootElement); +#endif + } writer.WriteEndObject(); writer.WriteEndObject(); } @@ -77,6 +91,8 @@ internal static PolicyAttestationData DeserializePolicyAttestationData(JsonEleme Optional> evidence = default; Optional provisioningState = default; Optional lastComplianceStateChangeAt = default; + Optional assessmentDate = default; + Optional metadata = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("id")) @@ -183,11 +199,31 @@ internal static PolicyAttestationData DeserializePolicyAttestationData(JsonEleme lastComplianceStateChangeAt = property0.Value.GetDateTimeOffset("O"); continue; } + if (property0.NameEquals("assessmentDate")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + assessmentDate = property0.Value.GetDateTimeOffset("O"); + continue; + } + if (property0.NameEquals("metadata")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + metadata = BinaryData.FromString(property0.Value.GetRawText()); + continue; + } } continue; } } - return new PolicyAttestationData(id, name, type, systemData.Value, policyAssignmentId, policyDefinitionReferenceId.Value, Optional.ToNullable(complianceState), Optional.ToNullable(expiresOn), owner.Value, comments.Value, Optional.ToList(evidence), provisioningState.Value, Optional.ToNullable(lastComplianceStateChangeAt)); + return new PolicyAttestationData(id, name, type, systemData.Value, policyAssignmentId, policyDefinitionReferenceId.Value, Optional.ToNullable(complianceState), Optional.ToNullable(expiresOn), owner.Value, comments.Value, Optional.ToList(evidence), provisioningState.Value, Optional.ToNullable(lastComplianceStateChangeAt), Optional.ToNullable(assessmentDate), metadata.Value); } } } diff --git a/sdk/policyinsights/Azure.ResourceManager.PolicyInsights/src/Generated/PolicyAttestationData.cs b/sdk/policyinsights/Azure.ResourceManager.PolicyInsights/src/Generated/PolicyAttestationData.cs index 400eca61c9c0..e5d948d55432 100644 --- a/sdk/policyinsights/Azure.ResourceManager.PolicyInsights/src/Generated/PolicyAttestationData.cs +++ b/sdk/policyinsights/Azure.ResourceManager.PolicyInsights/src/Generated/PolicyAttestationData.cs @@ -41,7 +41,9 @@ public PolicyAttestationData(ResourceIdentifier policyAssignmentId) /// The evidence supporting the compliance state set in this attestation. /// The status of the attestation. /// The time the compliance state was last changed in this attestation. - internal PolicyAttestationData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, ResourceIdentifier policyAssignmentId, string policyDefinitionReferenceId, PolicyComplianceState? complianceState, DateTimeOffset? expireOn, string owner, string comments, IList evidence, string provisioningState, DateTimeOffset? lastComplianceStateChangeOn) : base(id, name, resourceType, systemData) + /// The time the evidence was assessed. + /// Additional metadata for this attestation. + internal PolicyAttestationData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, ResourceIdentifier policyAssignmentId, string policyDefinitionReferenceId, PolicyComplianceState? complianceState, DateTimeOffset? expireOn, string owner, string comments, IList evidence, string provisioningState, DateTimeOffset? lastComplianceStateChangeOn, DateTimeOffset? assessmentOn, BinaryData metadata) : base(id, name, resourceType, systemData) { PolicyAssignmentId = policyAssignmentId; PolicyDefinitionReferenceId = policyDefinitionReferenceId; @@ -52,6 +54,8 @@ internal PolicyAttestationData(ResourceIdentifier id, string name, ResourceType Evidence = evidence; ProvisioningState = provisioningState; LastComplianceStateChangeOn = lastComplianceStateChangeOn; + AssessmentOn = assessmentOn; + Metadata = metadata; } /// The resource ID of the policy assignment that the attestation is setting the state for. @@ -72,5 +76,38 @@ internal PolicyAttestationData(ResourceIdentifier id, string name, ResourceType public string ProvisioningState { get; } /// The time the compliance state was last changed in this attestation. public DateTimeOffset? LastComplianceStateChangeOn { get; } + /// The time the evidence was assessed. + public DateTimeOffset? AssessmentOn { get; set; } + /// + /// Additional metadata for this attestation + /// + /// To assign an object to this property use . + /// + /// + /// To assign an already formated json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + public BinaryData Metadata { get; set; } } } diff --git a/sdk/policyinsights/Azure.ResourceManager.PolicyInsights/src/Generated/RestOperations/AttestationsRestOperations.cs b/sdk/policyinsights/Azure.ResourceManager.PolicyInsights/src/Generated/RestOperations/AttestationsRestOperations.cs index 6af87e83e1f5..67bc5bbcee05 100644 --- a/sdk/policyinsights/Azure.ResourceManager.PolicyInsights/src/Generated/RestOperations/AttestationsRestOperations.cs +++ b/sdk/policyinsights/Azure.ResourceManager.PolicyInsights/src/Generated/RestOperations/AttestationsRestOperations.cs @@ -33,7 +33,7 @@ public AttestationsRestOperations(HttpPipeline pipeline, string applicationId, U { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2021-01-01"; + _apiVersion = apiVersion ?? "2022-09-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/policyinsights/Azure.ResourceManager.PolicyInsights/src/autorest.md b/sdk/policyinsights/Azure.ResourceManager.PolicyInsights/src/autorest.md index 42e7d5d59d24..a739bf1f9bae 100644 --- a/sdk/policyinsights/Azure.ResourceManager.PolicyInsights/src/autorest.md +++ b/sdk/policyinsights/Azure.ResourceManager.PolicyInsights/src/autorest.md @@ -8,7 +8,7 @@ azure-arm: true csharp: true library-name: PolicyInsights namespace: Azure.ResourceManager.PolicyInsights -require: https://github.com/Azure/azure-rest-api-specs/blob/aa8a23b8f92477d0fdce7af6ccffee1c604b3c56/specification/policyinsights/resource-manager/readme.md +require: /mnt/vss/_work/1/s/azure-rest-api-specs/specification/policyinsights/resource-manager/readme.md output-folder: $(this-folder)/Generated clear-output-folder: true skip-csproj: true