diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/CHANGELOG.md b/sdk/eventgrid/Azure.Messaging.EventGrid/CHANGELOG.md index cfdfbcce52d07..a58a3538399d5 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/CHANGELOG.md +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/CHANGELOG.md @@ -1,14 +1,11 @@ # Release History -## 4.28.0-beta.1 (Unreleased) +## 4.28.0 (2024-11-18) ### Features Added -### Breaking Changes - -### Bugs Fixed - -### Other Changes +- Added `ResourceNotificationsContainerServiceEventResourcesScheduledEventData` event. +- Added `PolicyRunSummary` property to `StorageLifecyclePolicyCompletedEventData` event. ## 4.27.0 (2024-10-14) diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/api/Azure.Messaging.EventGrid.netstandard2.0.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/api/Azure.Messaging.EventGrid.netstandard2.0.cs index b5a2de6e80e09..59b388e308f6a 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/api/Azure.Messaging.EventGrid.netstandard2.0.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/api/Azure.Messaging.EventGrid.netstandard2.0.cs @@ -322,6 +322,7 @@ public static partial class EventGridModelFactory public static Azure.Messaging.EventGrid.SystemEvents.ResourceDeleteFailureEventData ResourceDeleteFailureEventData(string tenantId = null, string subscriptionId = null, string resourceGroup = null, string resourceProvider = null, string resourceUri = null, string operationName = null, string status = null, string authorization = null, string claims = null, string correlationId = null, string httpRequest = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.ResourceDeleteSuccessEventData ResourceDeleteSuccessEventData(string tenantId = null, string subscriptionId = null, string resourceGroup = null, string resourceProvider = null, string resourceUri = null, string operationName = null, string status = null, string authorization = null, string claims = null, string correlationId = null, string httpRequest = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.ResourceHttpRequest ResourceHttpRequest(string clientRequestId = null, string clientIpAddress = null, Azure.Core.RequestMethod? method = default(Azure.Core.RequestMethod?), string url = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsContainerServiceEventResourcesScheduledEventData ResourceNotificationsContainerServiceEventResourcesScheduledEventData(Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceUpdatedDetails resourceDetails = null, Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsOperationalDetails operationalDetails = null, string apiVersion = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsHealthResourcesAnnotatedEventData ResourceNotificationsHealthResourcesAnnotatedEventData(Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceUpdatedDetails resourceDetails = null, Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsOperationalDetails operationalDetails = null, string apiVersion = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsHealthResourcesAvailabilityStatusChangedEventData ResourceNotificationsHealthResourcesAvailabilityStatusChangedEventData(Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceUpdatedDetails resourceDetails = null, Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsOperationalDetails operationalDetails = null, string apiVersion = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsOperationalDetails ResourceNotificationsOperationalDetails(System.DateTimeOffset? resourceEventTime = default(System.DateTimeOffset?)) { throw null; } @@ -358,7 +359,10 @@ public static partial class EventGridModelFactory public static Azure.Messaging.EventGrid.SystemEvents.StorageLifecyclePolicyActionSummaryDetail StorageLifecyclePolicyActionSummaryDetail(long? totalObjectsCount = default(long?), long? successCount = default(long?), string errorList = null) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.Messaging.EventGrid.SystemEvents.StorageLifecyclePolicyCompletedEventData StorageLifecyclePolicyCompletedEventData(string scheduleTime, Azure.Messaging.EventGrid.SystemEvents.StorageLifecyclePolicyActionSummaryDetail deleteSummary, Azure.Messaging.EventGrid.SystemEvents.StorageLifecyclePolicyActionSummaryDetail tierToCoolSummary, Azure.Messaging.EventGrid.SystemEvents.StorageLifecyclePolicyActionSummaryDetail tierToArchiveSummary) { throw null; } - public static Azure.Messaging.EventGrid.SystemEvents.StorageLifecyclePolicyCompletedEventData StorageLifecyclePolicyCompletedEventData(string scheduleTime = null, Azure.Messaging.EventGrid.SystemEvents.StorageLifecyclePolicyActionSummaryDetail deleteSummary = null, Azure.Messaging.EventGrid.SystemEvents.StorageLifecyclePolicyActionSummaryDetail tierToCoolSummary = null, Azure.Messaging.EventGrid.SystemEvents.StorageLifecyclePolicyActionSummaryDetail tierToColdSummary = null, Azure.Messaging.EventGrid.SystemEvents.StorageLifecyclePolicyActionSummaryDetail tierToArchiveSummary = null) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static Azure.Messaging.EventGrid.SystemEvents.StorageLifecyclePolicyCompletedEventData StorageLifecyclePolicyCompletedEventData(string scheduleTime, Azure.Messaging.EventGrid.SystemEvents.StorageLifecyclePolicyActionSummaryDetail deleteSummary, Azure.Messaging.EventGrid.SystemEvents.StorageLifecyclePolicyActionSummaryDetail tierToCoolSummary, Azure.Messaging.EventGrid.SystemEvents.StorageLifecyclePolicyActionSummaryDetail tierToColdSummary, Azure.Messaging.EventGrid.SystemEvents.StorageLifecyclePolicyActionSummaryDetail tierToArchiveSummary) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.StorageLifecyclePolicyCompletedEventData StorageLifecyclePolicyCompletedEventData(string scheduleTime = null, Azure.Messaging.EventGrid.SystemEvents.StorageLifecyclePolicyRunSummary policyRunSummary = null, Azure.Messaging.EventGrid.SystemEvents.StorageLifecyclePolicyActionSummaryDetail deleteSummary = null, Azure.Messaging.EventGrid.SystemEvents.StorageLifecyclePolicyActionSummaryDetail tierToCoolSummary = null, Azure.Messaging.EventGrid.SystemEvents.StorageLifecyclePolicyActionSummaryDetail tierToColdSummary = null, Azure.Messaging.EventGrid.SystemEvents.StorageLifecyclePolicyActionSummaryDetail tierToArchiveSummary = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.StorageLifecyclePolicyRunSummary StorageLifecyclePolicyRunSummary(Azure.Messaging.EventGrid.SystemEvents.StorageLifecycleCompletionStatus completionStatus = default(Azure.Messaging.EventGrid.SystemEvents.StorageLifecycleCompletionStatus)) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.StorageTaskAssignmentCompletedEventData StorageTaskAssignmentCompletedEventData(Azure.Messaging.EventGrid.SystemEvents.StorageTaskAssignmentCompletedStatus? status = default(Azure.Messaging.EventGrid.SystemEvents.StorageTaskAssignmentCompletedStatus?), System.DateTimeOffset? completedOn = default(System.DateTimeOffset?), string taskExecutionId = null, string taskName = null, System.Uri summaryReportBlobUri = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.StorageTaskAssignmentQueuedEventData StorageTaskAssignmentQueuedEventData(System.DateTimeOffset? queuedOn = default(System.DateTimeOffset?), string taskExecutionId = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.StorageTaskCompletedEventData StorageTaskCompletedEventData(Azure.Messaging.EventGrid.SystemEvents.StorageTaskCompletedStatus? status = default(Azure.Messaging.EventGrid.SystemEvents.StorageTaskCompletedStatus?), System.DateTimeOffset? completedDateTime = default(System.DateTimeOffset?), string taskExecutionId = null, string taskName = null, System.Uri summaryReportBlobUri = null) { throw null; } @@ -606,6 +610,7 @@ public static partial class SystemEventNames public const string ResourceDeleteCancel = "Microsoft.Resources.ResourceDeleteCancel"; public const string ResourceDeleteFailure = "Microsoft.Resources.ResourceDeleteFailure"; public const string ResourceDeleteSuccess = "Microsoft.Resources.ResourceDeleteSuccess"; + public const string ResourceNotificationsContainerServiceEventResourcesScheduled = "Microsoft.ResourceNotifications.ContainerServiceEventResources.ScheduledEventEmitted"; public const string ResourceNotificationsHealthResourcesAnnotated = "Microsoft.ResourceNotifications.HealthResources.ResourceAnnotated"; public const string ResourceNotificationsHealthResourcesAvailabilityStatusChanged = "Microsoft.ResourceNotifications.HealthResources.AvailabilityStatusChanged"; public const string ResourceNotificationsResourceManagementCreatedOrUpdated = "Microsoft.ResourceNotifications.Resources.CreatedOrUpdated"; @@ -3174,6 +3179,10 @@ internal ResourceHttpRequest() { } public Azure.Core.RequestMethod Method { get { throw null; } } public string Url { get { throw null; } } } + public partial class ResourceNotificationsContainerServiceEventResourcesScheduledEventData : Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceUpdatedEventData + { + internal ResourceNotificationsContainerServiceEventResourcesScheduledEventData() { } + } public partial class ResourceNotificationsHealthResourcesAnnotatedEventData : Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceUpdatedEventData { internal ResourceNotificationsHealthResourcesAnnotatedEventData() { } @@ -3510,6 +3519,25 @@ internal StorageDirectoryRenamedEventData() { } public string SourceUrl { get { throw null; } } public object StorageDiagnostics { get { throw null; } } } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct StorageLifecycleCompletionStatus : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public StorageLifecycleCompletionStatus(string value) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.StorageLifecycleCompletionStatus Completed { get { throw null; } } + public static Azure.Messaging.EventGrid.SystemEvents.StorageLifecycleCompletionStatus CompletedWithError { get { throw null; } } + public static Azure.Messaging.EventGrid.SystemEvents.StorageLifecycleCompletionStatus Incomplete { get { throw null; } } + public bool Equals(Azure.Messaging.EventGrid.SystemEvents.StorageLifecycleCompletionStatus other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.Messaging.EventGrid.SystemEvents.StorageLifecycleCompletionStatus left, Azure.Messaging.EventGrid.SystemEvents.StorageLifecycleCompletionStatus right) { throw null; } + public static implicit operator Azure.Messaging.EventGrid.SystemEvents.StorageLifecycleCompletionStatus (string value) { throw null; } + public static bool operator !=(Azure.Messaging.EventGrid.SystemEvents.StorageLifecycleCompletionStatus left, Azure.Messaging.EventGrid.SystemEvents.StorageLifecycleCompletionStatus right) { throw null; } + public override string ToString() { throw null; } + } public partial class StorageLifecyclePolicyActionSummaryDetail { internal StorageLifecyclePolicyActionSummaryDetail() { } @@ -3521,11 +3549,17 @@ public partial class StorageLifecyclePolicyCompletedEventData { internal StorageLifecyclePolicyCompletedEventData() { } public Azure.Messaging.EventGrid.SystemEvents.StorageLifecyclePolicyActionSummaryDetail DeleteSummary { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.StorageLifecyclePolicyRunSummary PolicyRunSummary { get { throw null; } } public string ScheduleTime { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.StorageLifecyclePolicyActionSummaryDetail TierToArchiveSummary { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.StorageLifecyclePolicyActionSummaryDetail TierToColdSummary { get { throw null; } } public Azure.Messaging.EventGrid.SystemEvents.StorageLifecyclePolicyActionSummaryDetail TierToCoolSummary { get { throw null; } } } + public partial class StorageLifecyclePolicyRunSummary + { + internal StorageLifecyclePolicyRunSummary() { } + public Azure.Messaging.EventGrid.SystemEvents.StorageLifecycleCompletionStatus CompletionStatus { get { throw null; } } + } public partial class StorageTaskAssignmentCompletedEventData { internal StorageTaskAssignmentCompletedEventData() { } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Azure.Messaging.EventGrid.csproj b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Azure.Messaging.EventGrid.csproj index 2b4743a842a8c..8aef18eb07104 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Azure.Messaging.EventGrid.csproj +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Azure.Messaging.EventGrid.csproj @@ -2,7 +2,7 @@ This library can be used to publish events to Azure Event Grid and to consume events delivered by EventGrid. It also defines the event schemas for the events published to EventGrid by various Azure services. Microsoft Azure.Messaging.EventGrid client library - 4.28.0-beta.1 + 4.28.0 4.27.0 Microsoft Azure EventGrid;Event Grid;Event Grid Publishing; diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Customization/EventGridModelFactory.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Customization/EventGridModelFactory.cs index 0a20091e92abd..bf12c3062f57b 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Customization/EventGridModelFactory.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Customization/EventGridModelFactory.cs @@ -822,7 +822,20 @@ public static StorageBlobTierChangedEventData StorageBlobTierChangedEventData(st [EditorBrowsable(EditorBrowsableState.Never)] public static StorageLifecyclePolicyCompletedEventData StorageLifecyclePolicyCompletedEventData(string scheduleTime, StorageLifecyclePolicyActionSummaryDetail deleteSummary, StorageLifecyclePolicyActionSummaryDetail tierToCoolSummary, StorageLifecyclePolicyActionSummaryDetail tierToArchiveSummary) { - return StorageLifecyclePolicyCompletedEventData(scheduleTime, deleteSummary, tierToCoolSummary, default, tierToArchiveSummary); + return StorageLifecyclePolicyCompletedEventData(scheduleTime, null, deleteSummary, tierToCoolSummary, default, tierToArchiveSummary); + } + + /// Initializes a new instance of . + /// The time the policy task was scheduled. + /// Execution statistics of a specific policy action in a Blob Management cycle. + /// Execution statistics of a specific policy action in a Blob Management cycle. + /// Execution statistics of a specific policy action in a Blob Management cycle. + /// Execution statistics of a specific policy action in a Blob Management cycle. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static StorageLifecyclePolicyCompletedEventData StorageLifecyclePolicyCompletedEventData(string scheduleTime, StorageLifecyclePolicyActionSummaryDetail deleteSummary, StorageLifecyclePolicyActionSummaryDetail tierToCoolSummary, StorageLifecyclePolicyActionSummaryDetail tierToColdSummary, StorageLifecyclePolicyActionSummaryDetail tierToArchiveSummary) + { + return new StorageLifecyclePolicyCompletedEventData(scheduleTime, null, deleteSummary, tierToCoolSummary, tierToColdSummary, tierToArchiveSummary); } } #pragma warning restore CA1054 // URI-like parameters should not be strings diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/EventGridModelFactory.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/EventGridModelFactory.cs index 36bbe3accadf9..9a17e21d11f03 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/EventGridModelFactory.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/EventGridModelFactory.cs @@ -144,14 +144,29 @@ public static StorageDirectoryRenamedEventData StorageDirectoryRenamedEventData( /// Initializes a new instance of . /// The time the policy task was scheduled. + /// Policy run status of an account in a Blob Management cycle. /// Execution statistics of a specific policy action in a Blob Management cycle. /// Execution statistics of a specific policy action in a Blob Management cycle. /// Execution statistics of a specific policy action in a Blob Management cycle. /// Execution statistics of a specific policy action in a Blob Management cycle. /// A new instance for mocking. - public static StorageLifecyclePolicyCompletedEventData StorageLifecyclePolicyCompletedEventData(string scheduleTime = null, StorageLifecyclePolicyActionSummaryDetail deleteSummary = null, StorageLifecyclePolicyActionSummaryDetail tierToCoolSummary = null, StorageLifecyclePolicyActionSummaryDetail tierToColdSummary = null, StorageLifecyclePolicyActionSummaryDetail tierToArchiveSummary = null) + public static StorageLifecyclePolicyCompletedEventData StorageLifecyclePolicyCompletedEventData(string scheduleTime = null, StorageLifecyclePolicyRunSummary policyRunSummary = null, StorageLifecyclePolicyActionSummaryDetail deleteSummary = null, StorageLifecyclePolicyActionSummaryDetail tierToCoolSummary = null, StorageLifecyclePolicyActionSummaryDetail tierToColdSummary = null, StorageLifecyclePolicyActionSummaryDetail tierToArchiveSummary = null) { - return new StorageLifecyclePolicyCompletedEventData(scheduleTime, deleteSummary, tierToCoolSummary, tierToColdSummary, tierToArchiveSummary); + return new StorageLifecyclePolicyCompletedEventData( + scheduleTime, + policyRunSummary, + deleteSummary, + tierToCoolSummary, + tierToColdSummary, + tierToArchiveSummary); + } + + /// Initializes a new instance of . + /// Policy status can be Completed/CompletedWithError/Incomplete. + /// A new instance for mocking. + public static StorageLifecyclePolicyRunSummary StorageLifecyclePolicyRunSummary(StorageLifecycleCompletionStatus completionStatus = default) + { + return new StorageLifecyclePolicyRunSummary(completionStatus); } /// Initializes a new instance of . @@ -4059,6 +4074,16 @@ public static ResourceNotificationsResourceManagementDeletedEventData ResourceNo return new ResourceNotificationsResourceManagementDeletedEventData(resourceDetails, operationalDetails); } + /// Initializes a new instance of . + /// resourceInfo details for update event. + /// details about operational info. + /// api version of the resource properties bag. + /// A new instance for mocking. + public static ResourceNotificationsContainerServiceEventResourcesScheduledEventData ResourceNotificationsContainerServiceEventResourcesScheduledEventData(ResourceNotificationsResourceUpdatedDetails resourceDetails = null, ResourceNotificationsOperationalDetails operationalDetails = null, string apiVersion = null) + { + return new ResourceNotificationsContainerServiceEventResourcesScheduledEventData(resourceDetails, operationalDetails, apiVersion); + } + /// Initializes a new instance of . /// Id of the operation that caused this event. /// A new instance for mocking. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ResourceNotificationsContainerServiceEventResourcesScheduledEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ResourceNotificationsContainerServiceEventResourcesScheduledEventData.Serialization.cs new file mode 100644 index 0000000000000..ef47b6cf4a61b --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ResourceNotificationsContainerServiceEventResourcesScheduledEventData.Serialization.cs @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + [JsonConverter(typeof(ResourceNotificationsContainerServiceEventResourcesScheduledEventDataConverter))] + public partial class ResourceNotificationsContainerServiceEventResourcesScheduledEventData + { + internal static ResourceNotificationsContainerServiceEventResourcesScheduledEventData DeserializeResourceNotificationsContainerServiceEventResourcesScheduledEventData(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceNotificationsResourceUpdatedDetails resourceInfo = default; + ResourceNotificationsOperationalDetails operationalInfo = default; + string apiVersion = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("resourceInfo"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + resourceInfo = ResourceNotificationsResourceUpdatedDetails.DeserializeResourceNotificationsResourceUpdatedDetails(property.Value); + continue; + } + if (property.NameEquals("operationalInfo"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + operationalInfo = ResourceNotificationsOperationalDetails.DeserializeResourceNotificationsOperationalDetails(property.Value); + continue; + } + if (property.NameEquals("apiVersion"u8)) + { + apiVersion = property.Value.GetString(); + continue; + } + } + return new ResourceNotificationsContainerServiceEventResourcesScheduledEventData(resourceInfo, operationalInfo, apiVersion); + } + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new ResourceNotificationsContainerServiceEventResourcesScheduledEventData FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeResourceNotificationsContainerServiceEventResourcesScheduledEventData(document.RootElement); + } + + internal partial class ResourceNotificationsContainerServiceEventResourcesScheduledEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, ResourceNotificationsContainerServiceEventResourcesScheduledEventData model, JsonSerializerOptions options) + { + throw new NotImplementedException(); + } + + public override ResourceNotificationsContainerServiceEventResourcesScheduledEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeResourceNotificationsContainerServiceEventResourcesScheduledEventData(document.RootElement); + } + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ResourceNotificationsContainerServiceEventResourcesScheduledEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ResourceNotificationsContainerServiceEventResourcesScheduledEventData.cs new file mode 100644 index 0000000000000..e3e7ad6dd304b --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ResourceNotificationsContainerServiceEventResourcesScheduledEventData.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + /// Schema of the Data property of an event grid event for a Microsoft.ResourceNotifications.ContainerServiceEventResources.ScheduledEventEmitted preview event. + public partial class ResourceNotificationsContainerServiceEventResourcesScheduledEventData : ResourceNotificationsResourceUpdatedEventData + { + /// Initializes a new instance of . + internal ResourceNotificationsContainerServiceEventResourcesScheduledEventData() + { + } + + /// Initializes a new instance of . + /// resourceInfo details for update event. + /// details about operational info. + /// api version of the resource properties bag. + internal ResourceNotificationsContainerServiceEventResourcesScheduledEventData(ResourceNotificationsResourceUpdatedDetails resourceDetails, ResourceNotificationsOperationalDetails operationalDetails, string apiVersion) : base(resourceDetails, operationalDetails, apiVersion) + { + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/StorageLifecycleCompletionStatus.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/StorageLifecycleCompletionStatus.cs new file mode 100644 index 0000000000000..2338d83606880 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/StorageLifecycleCompletionStatus.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + /// Policy status can be Completed/CompletedWithError/Incomplete. + public readonly partial struct StorageLifecycleCompletionStatus : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public StorageLifecycleCompletionStatus(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string CompletedValue = "Completed"; + private const string CompletedWithErrorValue = "CompletedWithError"; + private const string IncompleteValue = "Incomplete"; + + /// Completed. + public static StorageLifecycleCompletionStatus Completed { get; } = new StorageLifecycleCompletionStatus(CompletedValue); + /// CompletedWithError. + public static StorageLifecycleCompletionStatus CompletedWithError { get; } = new StorageLifecycleCompletionStatus(CompletedWithErrorValue); + /// Incomplete. + public static StorageLifecycleCompletionStatus Incomplete { get; } = new StorageLifecycleCompletionStatus(IncompleteValue); + /// Determines if two values are the same. + public static bool operator ==(StorageLifecycleCompletionStatus left, StorageLifecycleCompletionStatus right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(StorageLifecycleCompletionStatus left, StorageLifecycleCompletionStatus right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator StorageLifecycleCompletionStatus(string value) => new StorageLifecycleCompletionStatus(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is StorageLifecycleCompletionStatus other && Equals(other); + /// + public bool Equals(StorageLifecycleCompletionStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/StorageLifecyclePolicyCompletedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/StorageLifecyclePolicyCompletedEventData.Serialization.cs index 9004c16737e77..7c7c082f9b70f 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/StorageLifecyclePolicyCompletedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/StorageLifecyclePolicyCompletedEventData.Serialization.cs @@ -21,6 +21,7 @@ internal static StorageLifecyclePolicyCompletedEventData DeserializeStorageLifec return null; } string scheduleTime = default; + StorageLifecyclePolicyRunSummary policyRunSummary = default; StorageLifecyclePolicyActionSummaryDetail deleteSummary = default; StorageLifecyclePolicyActionSummaryDetail tierToCoolSummary = default; StorageLifecyclePolicyActionSummaryDetail tierToColdSummary = default; @@ -32,6 +33,15 @@ internal static StorageLifecyclePolicyCompletedEventData DeserializeStorageLifec scheduleTime = property.Value.GetString(); continue; } + if (property.NameEquals("policyRunSummary"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + policyRunSummary = StorageLifecyclePolicyRunSummary.DeserializeStorageLifecyclePolicyRunSummary(property.Value); + continue; + } if (property.NameEquals("deleteSummary"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -69,7 +79,13 @@ internal static StorageLifecyclePolicyCompletedEventData DeserializeStorageLifec continue; } } - return new StorageLifecyclePolicyCompletedEventData(scheduleTime, deleteSummary, tierToCoolSummary, tierToColdSummary, tierToArchiveSummary); + return new StorageLifecyclePolicyCompletedEventData( + scheduleTime, + policyRunSummary, + deleteSummary, + tierToCoolSummary, + tierToColdSummary, + tierToArchiveSummary); } /// Deserializes the model from a raw response. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/StorageLifecyclePolicyCompletedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/StorageLifecyclePolicyCompletedEventData.cs index 18e8da2d42ca4..9e34b2e11d7d3 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/StorageLifecyclePolicyCompletedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/StorageLifecyclePolicyCompletedEventData.cs @@ -17,13 +17,15 @@ internal StorageLifecyclePolicyCompletedEventData() /// Initializes a new instance of . /// The time the policy task was scheduled. + /// Policy run status of an account in a Blob Management cycle. /// Execution statistics of a specific policy action in a Blob Management cycle. /// Execution statistics of a specific policy action in a Blob Management cycle. /// Execution statistics of a specific policy action in a Blob Management cycle. /// Execution statistics of a specific policy action in a Blob Management cycle. - internal StorageLifecyclePolicyCompletedEventData(string scheduleTime, StorageLifecyclePolicyActionSummaryDetail deleteSummary, StorageLifecyclePolicyActionSummaryDetail tierToCoolSummary, StorageLifecyclePolicyActionSummaryDetail tierToColdSummary, StorageLifecyclePolicyActionSummaryDetail tierToArchiveSummary) + internal StorageLifecyclePolicyCompletedEventData(string scheduleTime, StorageLifecyclePolicyRunSummary policyRunSummary, StorageLifecyclePolicyActionSummaryDetail deleteSummary, StorageLifecyclePolicyActionSummaryDetail tierToCoolSummary, StorageLifecyclePolicyActionSummaryDetail tierToColdSummary, StorageLifecyclePolicyActionSummaryDetail tierToArchiveSummary) { ScheduleTime = scheduleTime; + PolicyRunSummary = policyRunSummary; DeleteSummary = deleteSummary; TierToCoolSummary = tierToCoolSummary; TierToColdSummary = tierToColdSummary; @@ -32,6 +34,8 @@ internal StorageLifecyclePolicyCompletedEventData(string scheduleTime, StorageLi /// The time the policy task was scheduled. public string ScheduleTime { get; } + /// Policy run status of an account in a Blob Management cycle. + public StorageLifecyclePolicyRunSummary PolicyRunSummary { get; } /// Execution statistics of a specific policy action in a Blob Management cycle. public StorageLifecyclePolicyActionSummaryDetail DeleteSummary { get; } /// Execution statistics of a specific policy action in a Blob Management cycle. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/StorageLifecyclePolicyRunSummary.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/StorageLifecyclePolicyRunSummary.Serialization.cs new file mode 100644 index 0000000000000..a4385c7cf76bf --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/StorageLifecyclePolicyRunSummary.Serialization.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + public partial class StorageLifecyclePolicyRunSummary + { + internal static StorageLifecyclePolicyRunSummary DeserializeStorageLifecyclePolicyRunSummary(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + StorageLifecycleCompletionStatus completionStatus = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("completionStatus"u8)) + { + completionStatus = new StorageLifecycleCompletionStatus(property.Value.GetString()); + continue; + } + } + return new StorageLifecyclePolicyRunSummary(completionStatus); + } + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static StorageLifecyclePolicyRunSummary FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeStorageLifecyclePolicyRunSummary(document.RootElement); + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/StorageLifecyclePolicyRunSummary.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/StorageLifecyclePolicyRunSummary.cs new file mode 100644 index 0000000000000..b4d6b90a6aaee --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/StorageLifecyclePolicyRunSummary.cs @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + /// Policy run status of an account in a Blob Management cycle. + public partial class StorageLifecyclePolicyRunSummary + { + /// Initializes a new instance of . + /// Policy status can be Completed/CompletedWithError/Incomplete. + internal StorageLifecyclePolicyRunSummary(StorageLifecycleCompletionStatus completionStatus) + { + CompletionStatus = completionStatus; + } + + /// Policy status can be Completed/CompletedWithError/Incomplete. + public StorageLifecycleCompletionStatus CompletionStatus { get; } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/autorest.md b/sdk/eventgrid/Azure.Messaging.EventGrid/src/autorest.md index da4fb78ad757e..801b14ee09fcc 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/autorest.md +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/autorest.md @@ -4,7 +4,7 @@ Run `dotnet build /t:GenerateCode` to generate code. ``` yaml title: EventGridClient -require: https://github.com/Azure/azure-rest-api-specs/blob/012021c786c360e0c34faf7af888c7fd7dbe2df5/specification/eventgrid/data-plane/readme.md +require: https://github.com/Azure/azure-rest-api-specs/blob/fb64eaa0dfc7ee8abc8e10369495729d5b3c1cc5/specification/eventgrid/data-plane/readme.md generation1-convenience-client: true model-factory-for-hlc: - MediaJobOutputAsset @@ -181,6 +181,10 @@ directive: { $[path]["properties"]["type"]["x-namespace"] = namespace; } + if (path.includes("StorageLifecyclePolicyRunSummary")) + { + $[path]["properties"]["completionStatus"]["x-namespace"] = namespace; + } } ```