diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/CHANGELOG.md b/sdk/eventgrid/Azure.Messaging.EventGrid/CHANGELOG.md index d653ec7e92751..3ae84e7fbc46a 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/CHANGELOG.md +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/CHANGELOG.md @@ -1,14 +1,10 @@ # Release History -## 4.19.0-beta.1 (Unreleased) +## 4.19.0 (2023-10-11) ### Features Added -### Breaking Changes - -### Bugs Fixed - -### Other Changes +- Added new system events for Resource Notifications and Azure Communication Services. ## 4.18.0 (2023-09-12) diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/EventGridSourceGenerator/src/SourceVisitor.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/EventGridSourceGenerator/src/SourceVisitor.cs index 760cadaaf0ad6..e3a4bfead277a 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/EventGridSourceGenerator/src/SourceVisitor.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/EventGridSourceGenerator/src/SourceVisitor.cs @@ -30,7 +30,8 @@ public override void VisitNamedType(INamedTypeSymbol symbol) XmlDocument xmlDoc = new(); xmlDoc.LoadXml(symbol.GetDocumentationCommentXml()); var xmlNode = xmlDoc.SelectSingleNode("member/summary"); - var match = Regex.Match(xmlNode.InnerText, "[a-zA-Z]+\\.[a-zA-Z]+\\.[a-zA-Z]+"); + // the event name is either 3 or 4 parts, e.g. Microsoft.AppConfiguration.KeyValueDeleted or Microsoft.ResourceNotifications.HealthResources.AvailabilityStatusChanged + var match = Regex.Match(xmlNode.InnerText, "[a-zA-Z]+\\.[a-zA-Z]+\\.[a-zA-Z]+(\\.[a-zA-Z]+)?"); if (!match.Success) { // We expect some EventData to not have event types if they are base types, 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 cb342dde6dbff..33127bb2c8527 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 @@ -78,6 +78,31 @@ public static partial class EventGridModelFactory public static Azure.Messaging.EventGrid.SystemEvents.AcsRecordingStorageInfoProperties AcsRecordingStorageInfoProperties(System.Collections.Generic.IEnumerable recordingChunks = null) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.Messaging.EventGrid.SystemEvents.AcsRecordingStorageInfoProperties AcsRecordingStorageInfoProperties(System.Collections.Generic.IReadOnlyList recordingChunks) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsRouterChannelConfiguration AcsRouterChannelConfiguration(string channelId = null, int? capacityCostPerJob = default(int?), int? maxNumberOfJobs = default(int?)) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsRouterEventData AcsRouterEventData(string jobId = null, string channelReference = null, string channelId = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobCancelledEventData AcsRouterJobCancelledEventData(string jobId = null, string channelReference = null, string channelId = null, string queueId = null, System.Collections.Generic.IReadOnlyDictionary labels = null, System.Collections.Generic.IReadOnlyDictionary tags = null, string note = null, string dispositionCode = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobClassifiedEventData AcsRouterJobClassifiedEventData(string jobId = null, string channelReference = null, string channelId = null, string queueId = null, System.Collections.Generic.IReadOnlyDictionary labels = null, System.Collections.Generic.IReadOnlyDictionary tags = null, Azure.Messaging.EventGrid.SystemEvents.AcsRouterQueueDetails queueDetails = null, string classificationPolicyId = null, int? priority = default(int?), System.Collections.Generic.IEnumerable attachedWorkerSelectors = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobClosedEventData AcsRouterJobClosedEventData(string jobId = null, string channelReference = null, string channelId = null, string queueId = null, System.Collections.Generic.IReadOnlyDictionary labels = null, System.Collections.Generic.IReadOnlyDictionary tags = null, string assignmentId = null, string workerId = null, string dispositionCode = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobCompletedEventData AcsRouterJobCompletedEventData(string jobId = null, string channelReference = null, string channelId = null, string queueId = null, System.Collections.Generic.IReadOnlyDictionary labels = null, System.Collections.Generic.IReadOnlyDictionary tags = null, string assignmentId = null, string workerId = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobDeletedEventData AcsRouterJobDeletedEventData(string jobId = null, string channelReference = null, string channelId = null, string queueId = null, System.Collections.Generic.IReadOnlyDictionary labels = null, System.Collections.Generic.IReadOnlyDictionary tags = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobEventData AcsRouterJobEventData(string jobId = null, string channelReference = null, string channelId = null, string queueId = null, System.Collections.Generic.IReadOnlyDictionary labels = null, System.Collections.Generic.IReadOnlyDictionary tags = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobExceptionTriggeredEventData AcsRouterJobExceptionTriggeredEventData(string jobId = null, string channelReference = null, string channelId = null, string queueId = null, System.Collections.Generic.IReadOnlyDictionary labels = null, System.Collections.Generic.IReadOnlyDictionary tags = null, string ruleKey = null, string exceptionRuleId = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobQueuedEventData AcsRouterJobQueuedEventData(string jobId = null, string channelReference = null, string channelId = null, string queueId = null, System.Collections.Generic.IReadOnlyDictionary labels = null, System.Collections.Generic.IReadOnlyDictionary tags = null, int? priority = default(int?), System.Collections.Generic.IEnumerable attachedWorkerSelectors = null, System.Collections.Generic.IEnumerable requestedWorkerSelectors = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobReceivedEventData AcsRouterJobReceivedEventData(string jobId = null, string channelReference = null, string channelId = null, string queueId = null, System.Collections.Generic.IReadOnlyDictionary labels = null, System.Collections.Generic.IReadOnlyDictionary tags = null, Azure.Messaging.EventGrid.Models.AcsRouterJobStatus? jobStatus = default(Azure.Messaging.EventGrid.Models.AcsRouterJobStatus?), string classificationPolicyId = null, int? priority = default(int?), System.Collections.Generic.IEnumerable requestedWorkerSelectors = null, System.DateTimeOffset? scheduledOn = default(System.DateTimeOffset?), bool unavailableForMatching = false) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobSchedulingFailedEventData AcsRouterJobSchedulingFailedEventData(string jobId = null, string channelReference = null, string channelId = null, string queueId = null, System.Collections.Generic.IReadOnlyDictionary labels = null, System.Collections.Generic.IReadOnlyDictionary tags = null, int? priority = default(int?), System.Collections.Generic.IEnumerable expiredAttachedWorkerSelectors = null, System.Collections.Generic.IEnumerable expiredRequestedWorkerSelectors = null, System.DateTimeOffset? scheduledOn = default(System.DateTimeOffset?), string failureReason = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobUnassignedEventData AcsRouterJobUnassignedEventData(string jobId = null, string channelReference = null, string channelId = null, string queueId = null, System.Collections.Generic.IReadOnlyDictionary labels = null, System.Collections.Generic.IReadOnlyDictionary tags = null, string assignmentId = null, string workerId = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobWaitingForActivationEventData AcsRouterJobWaitingForActivationEventData(string jobId = null, string channelReference = null, string channelId = null, string queueId = null, System.Collections.Generic.IReadOnlyDictionary labels = null, System.Collections.Generic.IReadOnlyDictionary tags = null, int? priority = default(int?), System.Collections.Generic.IEnumerable expiredAttachedWorkerSelectors = null, System.Collections.Generic.IEnumerable expiredRequestedWorkerSelectors = null, System.DateTimeOffset? scheduledOn = default(System.DateTimeOffset?), bool unavailableForMatching = false) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobWorkerSelectorsExpiredEventData AcsRouterJobWorkerSelectorsExpiredEventData(string jobId = null, string channelReference = null, string channelId = null, string queueId = null, System.Collections.Generic.IReadOnlyDictionary labels = null, System.Collections.Generic.IReadOnlyDictionary tags = null, System.Collections.Generic.IEnumerable expiredRequestedWorkerSelectors = null, System.Collections.Generic.IEnumerable expiredAttachedWorkerSelectors = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsRouterQueueDetails AcsRouterQueueDetails(string id = null, string name = null, System.Collections.Generic.IReadOnlyDictionary labels = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerDeletedEventData AcsRouterWorkerDeletedEventData(string jobId = null, string channelReference = null, string channelId = null, string workerId = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerDeregisteredEventData AcsRouterWorkerDeregisteredEventData(string workerId = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerEventData AcsRouterWorkerEventData(string jobId = null, string channelReference = null, string channelId = null, string workerId = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerOfferAcceptedEventData AcsRouterWorkerOfferAcceptedEventData(string jobId = null, string channelReference = null, string channelId = null, string workerId = null, string queueId = null, string offerId = null, string assignmentId = null, int? jobPriority = default(int?), System.Collections.Generic.IReadOnlyDictionary workerLabels = null, System.Collections.Generic.IReadOnlyDictionary workerTags = null, System.Collections.Generic.IReadOnlyDictionary jobLabels = null, System.Collections.Generic.IReadOnlyDictionary jobTags = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerOfferDeclinedEventData AcsRouterWorkerOfferDeclinedEventData(string jobId = null, string channelReference = null, string channelId = null, string workerId = null, string queueId = null, string offerId = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerOfferExpiredEventData AcsRouterWorkerOfferExpiredEventData(string jobId = null, string channelReference = null, string channelId = null, string workerId = null, string queueId = null, string offerId = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerOfferIssuedEventData AcsRouterWorkerOfferIssuedEventData(string jobId = null, string channelReference = null, string channelId = null, string workerId = null, string queueId = null, string offerId = null, int? jobPriority = default(int?), System.Collections.Generic.IReadOnlyDictionary workerLabels = null, System.DateTimeOffset? offeredOn = default(System.DateTimeOffset?), System.DateTimeOffset? expiresOn = default(System.DateTimeOffset?), System.Collections.Generic.IReadOnlyDictionary workerTags = null, System.Collections.Generic.IReadOnlyDictionary jobLabels = null, System.Collections.Generic.IReadOnlyDictionary jobTags = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerOfferRevokedEventData AcsRouterWorkerOfferRevokedEventData(string jobId = null, string channelReference = null, string channelId = null, string workerId = null, string queueId = null, string offerId = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerRegisteredEventData AcsRouterWorkerRegisteredEventData(string workerId = null, System.Collections.Generic.IEnumerable queueAssignments = null, System.Collections.Generic.IEnumerable channelConfigurations = null, int? totalCapacity = default(int?), System.Collections.Generic.IReadOnlyDictionary labels = null, System.Collections.Generic.IReadOnlyDictionary tags = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AcsSmsDeliveryAttemptProperties AcsSmsDeliveryAttemptProperties(System.DateTimeOffset? timestamp = default(System.DateTimeOffset?), int? segmentsSucceeded = default(int?), int? segmentsFailed = default(int?)) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.AcsSmsDeliveryReportReceivedEventData AcsSmsDeliveryReportReceivedEventData(string messageId = null, string from = null, string to = null, string deliveryStatus = null, string deliveryStatusDetails = null, System.Collections.Generic.IEnumerable deliveryAttempts = null, System.DateTimeOffset? receivedTimestamp = default(System.DateTimeOffset?), string tag = null) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] @@ -255,6 +280,11 @@ 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.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; } + public static Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceUpdatedDetails ResourceNotificationsResourceUpdatedDetails(string id = null, string name = null, string type = null, string location = null, string tags = null, System.Collections.Generic.IReadOnlyDictionary properties = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceUpdatedEventData ResourceNotificationsResourceUpdatedEventData(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.ResourceWriteCancelEventData ResourceWriteCancelEventData(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.ResourceWriteFailureEventData ResourceWriteFailureEventData(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.ResourceWriteSuccessEventData ResourceWriteSuccessEventData(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; } @@ -362,6 +392,27 @@ public static partial class SystemEventNames public const string AcsEmailEngagementTrackingReportReceived = "Microsoft.Communication.EmailEngagementTrackingReportReceived"; public const string AcsIncomingCall = "Microsoft.Communication.IncomingCall"; public const string AcsRecordingFileStatusUpdated = "Microsoft.Communication.RecordingFileStatusUpdated"; + public const string AcsRouterJobCancelled = "Microsoft.Communication.RouterJobCancelled"; + public const string AcsRouterJobClassificationFailed = "Microsoft.Communication.RouterJobClassificationFailed"; + public const string AcsRouterJobClassified = "Microsoft.Communication.RouterJobClassified"; + public const string AcsRouterJobClosed = "Microsoft.Communication.RouterJobClosed"; + public const string AcsRouterJobCompleted = "Microsoft.Communication.RouterJobCompleted"; + public const string AcsRouterJobDeleted = "Microsoft.Communication.RouterJobDeleted"; + public const string AcsRouterJobExceptionTriggered = "Microsoft.Communication.RouterJobExceptionTriggered"; + public const string AcsRouterJobQueued = "Microsoft.Communication.RouterJobQueued"; + public const string AcsRouterJobReceived = "Microsoft.Communication.RouterJobReceived"; + public const string AcsRouterJobSchedulingFailed = "Microsoft.Communication.RouterJobSchedulingFailed"; + public const string AcsRouterJobUnassigned = "Microsoft.Communication.RouterJobUnassigned"; + public const string AcsRouterJobWaitingForActivation = "Microsoft.Communication.RouterJobWaitingForActivation"; + public const string AcsRouterJobWorkerSelectorsExpired = "Microsoft.Communication.RouterJobWorkerSelectorsExpired"; + public const string AcsRouterWorkerDeleted = "Microsoft.Communication.RouterWorkerDeleted"; + public const string AcsRouterWorkerDeregistered = "Microsoft.Communication.RouterWorkerDeregistered"; + public const string AcsRouterWorkerOfferAccepted = "Microsoft.Communication.RouterWorkerOfferAccepted"; + public const string AcsRouterWorkerOfferDeclined = "Microsoft.Communication.RouterWorkerOfferDeclined"; + public const string AcsRouterWorkerOfferExpired = "Microsoft.Communication.RouterWorkerOfferExpired"; + public const string AcsRouterWorkerOfferIssued = "Microsoft.Communication.RouterWorkerOfferIssued"; + public const string AcsRouterWorkerOfferRevoked = "Microsoft.Communication.RouterWorkerOfferRevoked"; + public const string AcsRouterWorkerRegistered = "Microsoft.Communication.RouterWorkerRegistered"; public const string AcsSmsDeliveryReportReceived = "Microsoft.Communication.SMSDeliveryReportReceived"; public const string AcsSmsReceived = "Microsoft.Communication.SMSReceived"; public const string AcsUserDisconnected = "Microsoft.Communication.UserDisconnected"; @@ -482,6 +533,8 @@ 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 ResourceNotificationsHealthResourcesAnnotated = "Microsoft.ResourceNotifications.HealthResources.ResourceAnnotated"; + public const string ResourceNotificationsHealthResourcesAvailabilityStatusChanged = "Microsoft.ResourceNotifications.HealthResources.AvailabilityStatusChanged"; public const string ResourceWriteCancel = "Microsoft.Resources.ResourceWriteCancel"; public const string ResourceWriteFailure = "Microsoft.Resources.ResourceWriteFailure"; public const string ResourceWriteSuccess = "Microsoft.Resources.ResourceWriteSuccess"; @@ -520,6 +573,74 @@ public static partial class SystemEventNames } namespace Azure.Messaging.EventGrid.Models { + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AcsRouterJobStatus : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AcsRouterJobStatus(string value) { throw null; } + public static Azure.Messaging.EventGrid.Models.AcsRouterJobStatus Assigned { get { throw null; } } + public static Azure.Messaging.EventGrid.Models.AcsRouterJobStatus Cancelled { get { throw null; } } + public static Azure.Messaging.EventGrid.Models.AcsRouterJobStatus ClassificationFailed { get { throw null; } } + public static Azure.Messaging.EventGrid.Models.AcsRouterJobStatus Closed { get { throw null; } } + public static Azure.Messaging.EventGrid.Models.AcsRouterJobStatus Completed { get { throw null; } } + public static Azure.Messaging.EventGrid.Models.AcsRouterJobStatus Created { get { throw null; } } + public static Azure.Messaging.EventGrid.Models.AcsRouterJobStatus PendingClassification { get { throw null; } } + public static Azure.Messaging.EventGrid.Models.AcsRouterJobStatus PendingSchedule { get { throw null; } } + public static Azure.Messaging.EventGrid.Models.AcsRouterJobStatus Queued { get { throw null; } } + public static Azure.Messaging.EventGrid.Models.AcsRouterJobStatus Scheduled { get { throw null; } } + public static Azure.Messaging.EventGrid.Models.AcsRouterJobStatus ScheduleFailed { get { throw null; } } + public static Azure.Messaging.EventGrid.Models.AcsRouterJobStatus WaitingForActivation { get { throw null; } } + public bool Equals(Azure.Messaging.EventGrid.Models.AcsRouterJobStatus 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.Models.AcsRouterJobStatus left, Azure.Messaging.EventGrid.Models.AcsRouterJobStatus right) { throw null; } + public static implicit operator Azure.Messaging.EventGrid.Models.AcsRouterJobStatus (string value) { throw null; } + public static bool operator !=(Azure.Messaging.EventGrid.Models.AcsRouterJobStatus left, Azure.Messaging.EventGrid.Models.AcsRouterJobStatus right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AcsRouterLabelOperator : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AcsRouterLabelOperator(string value) { throw null; } + public static Azure.Messaging.EventGrid.Models.AcsRouterLabelOperator Equal { get { throw null; } } + public static Azure.Messaging.EventGrid.Models.AcsRouterLabelOperator Greater { get { throw null; } } + public static Azure.Messaging.EventGrid.Models.AcsRouterLabelOperator GreaterThanOrEqual { get { throw null; } } + public static Azure.Messaging.EventGrid.Models.AcsRouterLabelOperator Less { get { throw null; } } + public static Azure.Messaging.EventGrid.Models.AcsRouterLabelOperator LessThanOrEqual { get { throw null; } } + public static Azure.Messaging.EventGrid.Models.AcsRouterLabelOperator NotEqual { get { throw null; } } + public bool Equals(Azure.Messaging.EventGrid.Models.AcsRouterLabelOperator 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.Models.AcsRouterLabelOperator left, Azure.Messaging.EventGrid.Models.AcsRouterLabelOperator right) { throw null; } + public static implicit operator Azure.Messaging.EventGrid.Models.AcsRouterLabelOperator (string value) { throw null; } + public static bool operator !=(Azure.Messaging.EventGrid.Models.AcsRouterLabelOperator left, Azure.Messaging.EventGrid.Models.AcsRouterLabelOperator right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AcsRouterWorkerSelectorState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AcsRouterWorkerSelectorState(string value) { throw null; } + public static Azure.Messaging.EventGrid.Models.AcsRouterWorkerSelectorState Active { get { throw null; } } + public static Azure.Messaging.EventGrid.Models.AcsRouterWorkerSelectorState Expired { get { throw null; } } + public bool Equals(Azure.Messaging.EventGrid.Models.AcsRouterWorkerSelectorState 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.Models.AcsRouterWorkerSelectorState left, Azure.Messaging.EventGrid.Models.AcsRouterWorkerSelectorState right) { throw null; } + public static implicit operator Azure.Messaging.EventGrid.Models.AcsRouterWorkerSelectorState (string value) { throw null; } + public static bool operator !=(Azure.Messaging.EventGrid.Models.AcsRouterWorkerSelectorState left, Azure.Messaging.EventGrid.Models.AcsRouterWorkerSelectorState right) { throw null; } + public override string ToString() { throw null; } + } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct RecordingChannelType : System.IEquatable @@ -890,6 +1011,201 @@ public partial class AcsRecordingStorageInfoProperties internal AcsRecordingStorageInfoProperties() { } public System.Collections.Generic.IReadOnlyList RecordingChunks { get { throw null; } } } + public partial class AcsRouterChannelConfiguration + { + internal AcsRouterChannelConfiguration() { } + public int? CapacityCostPerJob { get { throw null; } } + public string ChannelId { get { throw null; } } + public int? MaxNumberOfJobs { get { throw null; } } + } + public partial class AcsRouterEventData + { + internal AcsRouterEventData() { } + public string ChannelId { get { throw null; } } + public string ChannelReference { get { throw null; } } + public string JobId { get { throw null; } } + } + public partial class AcsRouterJobCancelledEventData : Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobEventData + { + internal AcsRouterJobCancelledEventData() { } + public string DispositionCode { get { throw null; } } + public string Note { get { throw null; } } + } + public partial class AcsRouterJobClassificationFailedEventData : Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobEventData + { + internal AcsRouterJobClassificationFailedEventData() { } + public string ClassificationPolicyId { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Errors { get { throw null; } } + } + public partial class AcsRouterJobClassifiedEventData : Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobEventData + { + internal AcsRouterJobClassifiedEventData() { } + public System.Collections.Generic.IReadOnlyList AttachedWorkerSelectors { get { throw null; } } + public string ClassificationPolicyId { get { throw null; } } + public int? Priority { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.AcsRouterQueueDetails QueueDetails { get { throw null; } } + } + public partial class AcsRouterJobClosedEventData : Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobEventData + { + internal AcsRouterJobClosedEventData() { } + public string AssignmentId { get { throw null; } } + public string DispositionCode { get { throw null; } } + public string WorkerId { get { throw null; } } + } + public partial class AcsRouterJobCompletedEventData : Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobEventData + { + internal AcsRouterJobCompletedEventData() { } + public string AssignmentId { get { throw null; } } + public string WorkerId { get { throw null; } } + } + public partial class AcsRouterJobDeletedEventData : Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobEventData + { + internal AcsRouterJobDeletedEventData() { } + } + public partial class AcsRouterJobEventData : Azure.Messaging.EventGrid.SystemEvents.AcsRouterEventData + { + internal AcsRouterJobEventData() { } + public System.Collections.Generic.IReadOnlyDictionary Labels { get { throw null; } } + public string QueueId { get { throw null; } } + public System.Collections.Generic.IReadOnlyDictionary Tags { get { throw null; } } + } + public partial class AcsRouterJobExceptionTriggeredEventData : Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobEventData + { + internal AcsRouterJobExceptionTriggeredEventData() { } + public string ExceptionRuleId { get { throw null; } } + public string RuleKey { get { throw null; } } + } + public partial class AcsRouterJobQueuedEventData : Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobEventData + { + internal AcsRouterJobQueuedEventData() { } + public System.Collections.Generic.IReadOnlyList AttachedWorkerSelectors { get { throw null; } } + public int? Priority { get { throw null; } } + public System.Collections.Generic.IReadOnlyList RequestedWorkerSelectors { get { throw null; } } + } + public partial class AcsRouterJobReceivedEventData : Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobEventData + { + internal AcsRouterJobReceivedEventData() { } + public string ClassificationPolicyId { get { throw null; } } + public Azure.Messaging.EventGrid.Models.AcsRouterJobStatus? JobStatus { get { throw null; } } + public int? Priority { get { throw null; } } + public System.Collections.Generic.IReadOnlyList RequestedWorkerSelectors { get { throw null; } } + public System.DateTimeOffset? ScheduledOn { get { throw null; } } + public bool UnavailableForMatching { get { throw null; } } + } + public partial class AcsRouterJobSchedulingFailedEventData : Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobEventData + { + internal AcsRouterJobSchedulingFailedEventData() { } + public System.Collections.Generic.IReadOnlyList ExpiredAttachedWorkerSelectors { get { throw null; } } + public System.Collections.Generic.IReadOnlyList ExpiredRequestedWorkerSelectors { get { throw null; } } + public string FailureReason { get { throw null; } } + public int? Priority { get { throw null; } } + public System.DateTimeOffset? ScheduledOn { get { throw null; } } + } + public partial class AcsRouterJobUnassignedEventData : Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobEventData + { + internal AcsRouterJobUnassignedEventData() { } + public string AssignmentId { get { throw null; } } + public string WorkerId { get { throw null; } } + } + public partial class AcsRouterJobWaitingForActivationEventData : Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobEventData + { + internal AcsRouterJobWaitingForActivationEventData() { } + public System.Collections.Generic.IReadOnlyList ExpiredAttachedWorkerSelectors { get { throw null; } } + public System.Collections.Generic.IReadOnlyList ExpiredRequestedWorkerSelectors { get { throw null; } } + public int? Priority { get { throw null; } } + public System.DateTimeOffset? ScheduledOn { get { throw null; } } + public bool UnavailableForMatching { get { throw null; } } + } + public partial class AcsRouterJobWorkerSelectorsExpiredEventData : Azure.Messaging.EventGrid.SystemEvents.AcsRouterJobEventData + { + internal AcsRouterJobWorkerSelectorsExpiredEventData() { } + public System.Collections.Generic.IReadOnlyList ExpiredAttachedWorkerSelectors { get { throw null; } } + public System.Collections.Generic.IReadOnlyList ExpiredRequestedWorkerSelectors { get { throw null; } } + } + public partial class AcsRouterQueueDetails + { + internal AcsRouterQueueDetails() { } + public string Id { get { throw null; } } + public System.Collections.Generic.IReadOnlyDictionary Labels { get { throw null; } } + public string Name { get { throw null; } } + } + public partial class AcsRouterWorkerDeletedEventData : Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerEventData + { + internal AcsRouterWorkerDeletedEventData() { } + } + public partial class AcsRouterWorkerDeregisteredEventData + { + internal AcsRouterWorkerDeregisteredEventData() { } + public string WorkerId { get { throw null; } } + } + public partial class AcsRouterWorkerEventData : Azure.Messaging.EventGrid.SystemEvents.AcsRouterEventData + { + internal AcsRouterWorkerEventData() { } + public string WorkerId { get { throw null; } } + } + public partial class AcsRouterWorkerOfferAcceptedEventData : Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerEventData + { + internal AcsRouterWorkerOfferAcceptedEventData() { } + public string AssignmentId { get { throw null; } } + public System.Collections.Generic.IReadOnlyDictionary JobLabels { get { throw null; } } + public int? JobPriority { get { throw null; } } + public System.Collections.Generic.IReadOnlyDictionary JobTags { get { throw null; } } + public string OfferId { get { throw null; } } + public string QueueId { get { throw null; } } + public System.Collections.Generic.IReadOnlyDictionary WorkerLabels { get { throw null; } } + public System.Collections.Generic.IReadOnlyDictionary WorkerTags { get { throw null; } } + } + public partial class AcsRouterWorkerOfferDeclinedEventData : Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerEventData + { + internal AcsRouterWorkerOfferDeclinedEventData() { } + public string OfferId { get { throw null; } } + public string QueueId { get { throw null; } } + } + public partial class AcsRouterWorkerOfferExpiredEventData : Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerEventData + { + internal AcsRouterWorkerOfferExpiredEventData() { } + public string OfferId { get { throw null; } } + public string QueueId { get { throw null; } } + } + public partial class AcsRouterWorkerOfferIssuedEventData : Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerEventData + { + internal AcsRouterWorkerOfferIssuedEventData() { } + public System.DateTimeOffset? ExpiresOn { get { throw null; } } + public System.Collections.Generic.IReadOnlyDictionary JobLabels { get { throw null; } } + public int? JobPriority { get { throw null; } } + public System.Collections.Generic.IReadOnlyDictionary JobTags { get { throw null; } } + public System.DateTimeOffset? OfferedOn { get { throw null; } } + public string OfferId { get { throw null; } } + public string QueueId { get { throw null; } } + public System.Collections.Generic.IReadOnlyDictionary WorkerLabels { get { throw null; } } + public System.Collections.Generic.IReadOnlyDictionary WorkerTags { get { throw null; } } + } + public partial class AcsRouterWorkerOfferRevokedEventData : Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerEventData + { + internal AcsRouterWorkerOfferRevokedEventData() { } + public string OfferId { get { throw null; } } + public string QueueId { get { throw null; } } + } + public partial class AcsRouterWorkerRegisteredEventData + { + internal AcsRouterWorkerRegisteredEventData() { } + public System.Collections.Generic.IReadOnlyList ChannelConfigurations { get { throw null; } } + public System.Collections.Generic.IReadOnlyDictionary Labels { get { throw null; } } + public System.Collections.Generic.IReadOnlyList QueueAssignments { get { throw null; } } + public System.Collections.Generic.IReadOnlyDictionary Tags { get { throw null; } } + public int? TotalCapacity { get { throw null; } } + public string WorkerId { get { throw null; } } + } + public partial class AcsRouterWorkerSelector + { + internal AcsRouterWorkerSelector() { } + public System.DateTimeOffset? ExpirationTime { get { throw null; } } + public string Key { get { throw null; } } + public Azure.Messaging.EventGrid.Models.AcsRouterLabelOperator? LabelOperator { get { throw null; } } + public object LabelValue { get { throw null; } } + public Azure.Messaging.EventGrid.Models.AcsRouterWorkerSelectorState? State { get { throw null; } } + public System.TimeSpan? TimeToLive { get { throw null; } } + } public partial class AcsSmsDeliveryAttemptProperties { internal AcsSmsDeliveryAttemptProperties() { } @@ -2421,6 +2737,36 @@ internal ResourceHttpRequest() { } public Azure.Core.RequestMethod Method { get { throw null; } } public string Url { get { throw null; } } } + public partial class ResourceNotificationsHealthResourcesAnnotatedEventData : Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceUpdatedEventData + { + internal ResourceNotificationsHealthResourcesAnnotatedEventData() { } + } + public partial class ResourceNotificationsHealthResourcesAvailabilityStatusChangedEventData : Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceUpdatedEventData + { + internal ResourceNotificationsHealthResourcesAvailabilityStatusChangedEventData() { } + } + public partial class ResourceNotificationsOperationalDetails + { + internal ResourceNotificationsOperationalDetails() { } + public System.DateTimeOffset? ResourceEventTime { get { throw null; } } + } + public partial class ResourceNotificationsResourceUpdatedDetails + { + internal ResourceNotificationsResourceUpdatedDetails() { } + public string Id { get { throw null; } } + public string Location { get { throw null; } } + public string Name { get { throw null; } } + public System.Collections.Generic.IReadOnlyDictionary Properties { get { throw null; } } + public string Tags { get { throw null; } } + public string Type { get { throw null; } } + } + public partial class ResourceNotificationsResourceUpdatedEventData + { + internal ResourceNotificationsResourceUpdatedEventData() { } + public string ApiVersion { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsOperationalDetails OperationalDetails { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.ResourceNotificationsResourceUpdatedDetails ResourceDetails { get { throw null; } } + } public partial class ResourceWriteCancelEventData { internal ResourceWriteCancelEventData() { } 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 2659882c3b62f..7b211b2951592 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.19.0-beta.1 + 4.19.0 4.18.0 Microsoft Azure EventGrid;Event Grid;Event Grid Publishing; diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Customization/AcsRouterCommunicationError.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Customization/AcsRouterCommunicationError.cs new file mode 100644 index 0000000000000..d604d5329eb0f --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Customization/AcsRouterCommunicationError.cs @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + internal partial class AcsRouterCommunicationError + { + } +} \ No newline at end of file diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Customization/AcsRouterJobClassificationFailedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Customization/AcsRouterJobClassificationFailedEventData.cs new file mode 100644 index 0000000000000..2b3b041b92b8c --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Customization/AcsRouterJobClassificationFailedEventData.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Collections.Generic; +using System.Linq; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.RouterJobClassificationFailed event. + public partial class AcsRouterJobClassificationFailedEventData + { + /// List of Router Communication Errors. + [CodeGenMember("Errors")] + internal IReadOnlyList ErrorsInternal { get; } + + /// List of Router Communication Errors. + public IReadOnlyList Errors + { + get + { + if (_errors == null) + { + // Need to re-serialize to be able to deserialize as ResponseError with the internal properties populated. + var serialized = JsonSerializer.Serialize( + ErrorsInternal, + new JsonSerializerOptions + { + PropertyNamingPolicy = JsonNamingPolicy.CamelCase + }); + _errors = JsonSerializer.Deserialize>(serialized); + } + + return _errors; + } + } + + private List _errors; + } +} \ No newline at end of file diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Customization/AcsRouterWorkerSelector.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Customization/AcsRouterWorkerSelector.cs new file mode 100644 index 0000000000000..d092f9754a315 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Customization/AcsRouterWorkerSelector.cs @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using Azure.Core; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + /// Router Job Worker Selector. + public partial class AcsRouterWorkerSelector + { + internal float? TtlSeconds { get; } + + /// Router Job Worker Selector TTL. + public TimeSpan? TimeToLive => TtlSeconds.HasValue ? TimeSpan.FromSeconds(TtlSeconds.Value) : null; + } +} \ No newline at end of file diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/EventGridModelFactory.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/EventGridModelFactory.cs index 207f314f39de6..d46869293edf0 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/EventGridModelFactory.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/EventGridModelFactory.cs @@ -8,6 +8,7 @@ using System; using System.Collections.Generic; using System.Linq; +using Azure.Messaging.EventGrid.Models; using Azure.Messaging.EventGrid.SystemEvents; namespace Azure.Messaging.EventGrid @@ -1741,6 +1742,428 @@ public static AcsUserDisconnectedEventData AcsUserDisconnectedEventData(Communic return new AcsUserDisconnectedEventData(userCommunicationIdentifier); } + /// Initializes a new instance of AcsRouterJobCancelledEventData. + /// Router Event Job ID. + /// Router Event Channel Reference. + /// Router Event Channel ID. + /// Router Job events Queue Id. + /// Router Job events Labels. + /// Router Jobs events Tags. + /// Router Job Note. + /// Router Job Disposition Code. + /// A new instance for mocking. + public static AcsRouterJobCancelledEventData AcsRouterJobCancelledEventData(string jobId = null, string channelReference = null, string channelId = null, string queueId = null, IReadOnlyDictionary labels = null, IReadOnlyDictionary tags = null, string note = null, string dispositionCode = null) + { + labels ??= new Dictionary(); + tags ??= new Dictionary(); + + return new AcsRouterJobCancelledEventData(jobId, channelReference, channelId, queueId, labels, tags, note, dispositionCode); + } + + /// Initializes a new instance of AcsRouterJobEventData. + /// Router Event Job ID. + /// Router Event Channel Reference. + /// Router Event Channel ID. + /// Router Job events Queue Id. + /// Router Job events Labels. + /// Router Jobs events Tags. + /// A new instance for mocking. + public static AcsRouterJobEventData AcsRouterJobEventData(string jobId = null, string channelReference = null, string channelId = null, string queueId = null, IReadOnlyDictionary labels = null, IReadOnlyDictionary tags = null) + { + labels ??= new Dictionary(); + tags ??= new Dictionary(); + + return new AcsRouterJobEventData(jobId, channelReference, channelId, queueId, labels, tags); + } + + /// Initializes a new instance of AcsRouterEventData. + /// Router Event Job ID. + /// Router Event Channel Reference. + /// Router Event Channel ID. + /// A new instance for mocking. + public static AcsRouterEventData AcsRouterEventData(string jobId = null, string channelReference = null, string channelId = null) + { + return new AcsRouterEventData(jobId, channelReference, channelId); + } + + /// Initializes a new instance of AcsRouterJobClassifiedEventData. + /// Router Event Job ID. + /// Router Event Channel Reference. + /// Router Event Channel ID. + /// Router Job events Queue Id. + /// Router Job events Labels. + /// Router Jobs events Tags. + /// Router Job Queue Info. + /// Router Job Classification Policy Id. + /// Router Job Priority. + /// Router Job Attached Worker Selector. + /// A new instance for mocking. + public static AcsRouterJobClassifiedEventData AcsRouterJobClassifiedEventData(string jobId = null, string channelReference = null, string channelId = null, string queueId = null, IReadOnlyDictionary labels = null, IReadOnlyDictionary tags = null, AcsRouterQueueDetails queueDetails = null, string classificationPolicyId = null, int? priority = null, IEnumerable attachedWorkerSelectors = null) + { + labels ??= new Dictionary(); + tags ??= new Dictionary(); + attachedWorkerSelectors ??= new List(); + + return new AcsRouterJobClassifiedEventData(jobId, channelReference, channelId, queueId, labels, tags, queueDetails, classificationPolicyId, priority, attachedWorkerSelectors?.ToList()); + } + + /// Initializes a new instance of AcsRouterQueueDetails. + /// Router Queue Id. + /// Router Queue Name. + /// Router Queue Labels. + /// A new instance for mocking. + public static AcsRouterQueueDetails AcsRouterQueueDetails(string id = null, string name = null, IReadOnlyDictionary labels = null) + { + labels ??= new Dictionary(); + + return new AcsRouterQueueDetails(id, name, labels); + } + + /// Initializes a new instance of AcsRouterJobClosedEventData. + /// Router Event Job ID. + /// Router Event Channel Reference. + /// Router Event Channel ID. + /// Router Job events Queue Id. + /// Router Job events Labels. + /// Router Jobs events Tags. + /// Router Job Closed Assignment Id. + /// Router Job Closed Worker Id. + /// Router Job Closed Disposition Code. + /// A new instance for mocking. + public static AcsRouterJobClosedEventData AcsRouterJobClosedEventData(string jobId = null, string channelReference = null, string channelId = null, string queueId = null, IReadOnlyDictionary labels = null, IReadOnlyDictionary tags = null, string assignmentId = null, string workerId = null, string dispositionCode = null) + { + labels ??= new Dictionary(); + tags ??= new Dictionary(); + + return new AcsRouterJobClosedEventData(jobId, channelReference, channelId, queueId, labels, tags, assignmentId, workerId, dispositionCode); + } + + /// Initializes a new instance of AcsRouterJobCompletedEventData. + /// Router Event Job ID. + /// Router Event Channel Reference. + /// Router Event Channel ID. + /// Router Job events Queue Id. + /// Router Job events Labels. + /// Router Jobs events Tags. + /// Router Job Completed Assignment Id. + /// Router Job Completed Worker Id. + /// A new instance for mocking. + public static AcsRouterJobCompletedEventData AcsRouterJobCompletedEventData(string jobId = null, string channelReference = null, string channelId = null, string queueId = null, IReadOnlyDictionary labels = null, IReadOnlyDictionary tags = null, string assignmentId = null, string workerId = null) + { + labels ??= new Dictionary(); + tags ??= new Dictionary(); + + return new AcsRouterJobCompletedEventData(jobId, channelReference, channelId, queueId, labels, tags, assignmentId, workerId); + } + + /// Initializes a new instance of AcsRouterJobDeletedEventData. + /// Router Event Job ID. + /// Router Event Channel Reference. + /// Router Event Channel ID. + /// Router Job events Queue Id. + /// Router Job events Labels. + /// Router Jobs events Tags. + /// A new instance for mocking. + public static AcsRouterJobDeletedEventData AcsRouterJobDeletedEventData(string jobId = null, string channelReference = null, string channelId = null, string queueId = null, IReadOnlyDictionary labels = null, IReadOnlyDictionary tags = null) + { + labels ??= new Dictionary(); + tags ??= new Dictionary(); + + return new AcsRouterJobDeletedEventData(jobId, channelReference, channelId, queueId, labels, tags); + } + + /// Initializes a new instance of AcsRouterJobExceptionTriggeredEventData. + /// Router Event Job ID. + /// Router Event Channel Reference. + /// Router Event Channel ID. + /// Router Job events Queue Id. + /// Router Job events Labels. + /// Router Jobs events Tags. + /// Router Job Exception Triggered Rule Key. + /// Router Job Exception Triggered Rule Id. + /// A new instance for mocking. + public static AcsRouterJobExceptionTriggeredEventData AcsRouterJobExceptionTriggeredEventData(string jobId = null, string channelReference = null, string channelId = null, string queueId = null, IReadOnlyDictionary labels = null, IReadOnlyDictionary tags = null, string ruleKey = null, string exceptionRuleId = null) + { + labels ??= new Dictionary(); + tags ??= new Dictionary(); + + return new AcsRouterJobExceptionTriggeredEventData(jobId, channelReference, channelId, queueId, labels, tags, ruleKey, exceptionRuleId); + } + + /// Initializes a new instance of AcsRouterJobQueuedEventData. + /// Router Event Job ID. + /// Router Event Channel Reference. + /// Router Event Channel ID. + /// Router Job events Queue Id. + /// Router Job events Labels. + /// Router Jobs events Tags. + /// Router Job Priority. + /// Router Job Queued Attached Worker Selector. + /// Router Job Queued Requested Worker Selector. + /// A new instance for mocking. + public static AcsRouterJobQueuedEventData AcsRouterJobQueuedEventData(string jobId = null, string channelReference = null, string channelId = null, string queueId = null, IReadOnlyDictionary labels = null, IReadOnlyDictionary tags = null, int? priority = null, IEnumerable attachedWorkerSelectors = null, IEnumerable requestedWorkerSelectors = null) + { + labels ??= new Dictionary(); + tags ??= new Dictionary(); + attachedWorkerSelectors ??= new List(); + requestedWorkerSelectors ??= new List(); + + return new AcsRouterJobQueuedEventData(jobId, channelReference, channelId, queueId, labels, tags, priority, attachedWorkerSelectors?.ToList(), requestedWorkerSelectors?.ToList()); + } + + /// Initializes a new instance of AcsRouterJobReceivedEventData. + /// Router Event Job ID. + /// Router Event Channel Reference. + /// Router Event Channel ID. + /// Router Job events Queue Id. + /// Router Job events Labels. + /// Router Jobs events Tags. + /// Router Job Received Job Status. + /// Router Job Classification Policy Id. + /// Router Job Priority. + /// Router Job Received Requested Worker Selectors. + /// Router Job Received Scheduled Time in UTC. + /// Unavailable For Matching for Router Job Received. + /// A new instance for mocking. + public static AcsRouterJobReceivedEventData AcsRouterJobReceivedEventData(string jobId = null, string channelReference = null, string channelId = null, string queueId = null, IReadOnlyDictionary labels = null, IReadOnlyDictionary tags = null, AcsRouterJobStatus? jobStatus = null, string classificationPolicyId = null, int? priority = null, IEnumerable requestedWorkerSelectors = null, DateTimeOffset? scheduledOn = null, bool unavailableForMatching = default) + { + labels ??= new Dictionary(); + tags ??= new Dictionary(); + requestedWorkerSelectors ??= new List(); + + return new AcsRouterJobReceivedEventData(jobId, channelReference, channelId, queueId, labels, tags, jobStatus, classificationPolicyId, priority, requestedWorkerSelectors?.ToList(), scheduledOn, unavailableForMatching); + } + + /// Initializes a new instance of AcsRouterJobSchedulingFailedEventData. + /// Router Event Job ID. + /// Router Event Channel Reference. + /// Router Event Channel ID. + /// Router Job events Queue Id. + /// Router Job events Labels. + /// Router Jobs events Tags. + /// Router Job Priority. + /// Router Job Scheduling Failed Attached Worker Selector Expired. + /// Router Job Scheduling Failed Requested Worker Selector Expired. + /// Router Job Scheduling Failed Scheduled Time in UTC. + /// Router Job Scheduling Failed Reason. + /// A new instance for mocking. + public static AcsRouterJobSchedulingFailedEventData AcsRouterJobSchedulingFailedEventData(string jobId = null, string channelReference = null, string channelId = null, string queueId = null, IReadOnlyDictionary labels = null, IReadOnlyDictionary tags = null, int? priority = null, IEnumerable expiredAttachedWorkerSelectors = null, IEnumerable expiredRequestedWorkerSelectors = null, DateTimeOffset? scheduledOn = null, string failureReason = null) + { + labels ??= new Dictionary(); + tags ??= new Dictionary(); + expiredAttachedWorkerSelectors ??= new List(); + expiredRequestedWorkerSelectors ??= new List(); + + return new AcsRouterJobSchedulingFailedEventData(jobId, channelReference, channelId, queueId, labels, tags, priority, expiredAttachedWorkerSelectors?.ToList(), expiredRequestedWorkerSelectors?.ToList(), scheduledOn, failureReason); + } + + /// Initializes a new instance of AcsRouterJobUnassignedEventData. + /// Router Event Job ID. + /// Router Event Channel Reference. + /// Router Event Channel ID. + /// Router Job events Queue Id. + /// Router Job events Labels. + /// Router Jobs events Tags. + /// Router Job Unassigned Assignment Id. + /// Router Job Unassigned Worker Id. + /// A new instance for mocking. + public static AcsRouterJobUnassignedEventData AcsRouterJobUnassignedEventData(string jobId = null, string channelReference = null, string channelId = null, string queueId = null, IReadOnlyDictionary labels = null, IReadOnlyDictionary tags = null, string assignmentId = null, string workerId = null) + { + labels ??= new Dictionary(); + tags ??= new Dictionary(); + + return new AcsRouterJobUnassignedEventData(jobId, channelReference, channelId, queueId, labels, tags, assignmentId, workerId); + } + + /// Initializes a new instance of AcsRouterJobWaitingForActivationEventData. + /// Router Event Job ID. + /// Router Event Channel Reference. + /// Router Event Channel ID. + /// Router Job events Queue Id. + /// Router Job events Labels. + /// Router Jobs events Tags. + /// Router Job Waiting For Activation Priority. + /// Router Job Waiting For Activation Worker Selector Expired. + /// Router Job Waiting For Activation Requested Worker Selector Expired. + /// Router Job Waiting For Activation Scheduled Time in UTC. + /// Router Job Waiting For Activation Unavailable For Matching. + /// A new instance for mocking. + public static AcsRouterJobWaitingForActivationEventData AcsRouterJobWaitingForActivationEventData(string jobId = null, string channelReference = null, string channelId = null, string queueId = null, IReadOnlyDictionary labels = null, IReadOnlyDictionary tags = null, int? priority = null, IEnumerable expiredAttachedWorkerSelectors = null, IEnumerable expiredRequestedWorkerSelectors = null, DateTimeOffset? scheduledOn = null, bool unavailableForMatching = default) + { + labels ??= new Dictionary(); + tags ??= new Dictionary(); + expiredAttachedWorkerSelectors ??= new List(); + expiredRequestedWorkerSelectors ??= new List(); + + return new AcsRouterJobWaitingForActivationEventData(jobId, channelReference, channelId, queueId, labels, tags, priority, expiredAttachedWorkerSelectors?.ToList(), expiredRequestedWorkerSelectors?.ToList(), scheduledOn, unavailableForMatching); + } + + /// Initializes a new instance of AcsRouterJobWorkerSelectorsExpiredEventData. + /// Router Event Job ID. + /// Router Event Channel Reference. + /// Router Event Channel ID. + /// Router Job events Queue Id. + /// Router Job events Labels. + /// Router Jobs events Tags. + /// Router Job Worker Selectors Expired Requested Worker Selectors. + /// Router Job Worker Selectors Expired Attached Worker Selectors. + /// A new instance for mocking. + public static AcsRouterJobWorkerSelectorsExpiredEventData AcsRouterJobWorkerSelectorsExpiredEventData(string jobId = null, string channelReference = null, string channelId = null, string queueId = null, IReadOnlyDictionary labels = null, IReadOnlyDictionary tags = null, IEnumerable expiredRequestedWorkerSelectors = null, IEnumerable expiredAttachedWorkerSelectors = null) + { + labels ??= new Dictionary(); + tags ??= new Dictionary(); + expiredRequestedWorkerSelectors ??= new List(); + expiredAttachedWorkerSelectors ??= new List(); + + return new AcsRouterJobWorkerSelectorsExpiredEventData(jobId, channelReference, channelId, queueId, labels, tags, expiredRequestedWorkerSelectors?.ToList(), expiredAttachedWorkerSelectors?.ToList()); + } + + /// Initializes a new instance of AcsRouterWorkerDeletedEventData. + /// Router Event Job ID. + /// Router Event Channel Reference. + /// Router Event Channel ID. + /// Router Worker events Worker Id. + /// A new instance for mocking. + public static AcsRouterWorkerDeletedEventData AcsRouterWorkerDeletedEventData(string jobId = null, string channelReference = null, string channelId = null, string workerId = null) + { + return new AcsRouterWorkerDeletedEventData(jobId, channelReference, channelId, workerId); + } + + /// Initializes a new instance of AcsRouterWorkerEventData. + /// Router Event Job ID. + /// Router Event Channel Reference. + /// Router Event Channel ID. + /// Router Worker events Worker Id. + /// A new instance for mocking. + public static AcsRouterWorkerEventData AcsRouterWorkerEventData(string jobId = null, string channelReference = null, string channelId = null, string workerId = null) + { + return new AcsRouterWorkerEventData(jobId, channelReference, channelId, workerId); + } + + /// Initializes a new instance of AcsRouterWorkerDeregisteredEventData. + /// Router Worker Deregistered Worker Id. + /// A new instance for mocking. + public static AcsRouterWorkerDeregisteredEventData AcsRouterWorkerDeregisteredEventData(string workerId = null) + { + return new AcsRouterWorkerDeregisteredEventData(workerId); + } + + /// Initializes a new instance of AcsRouterWorkerOfferAcceptedEventData. + /// Router Event Job ID. + /// Router Event Channel Reference. + /// Router Event Channel ID. + /// Router Worker events Worker Id. + /// Router Worker Offer Accepted Queue Id. + /// Router Worker Offer Accepted Offer Id. + /// Router Worker Offer Accepted Assignment Id. + /// Router Worker Offer Accepted Job Priority. + /// Router Worker Offer Accepted Worker Labels. + /// Router Worker Offer Accepted Worker Tags. + /// Router Worker Offer Accepted Job Labels. + /// Router Worker Offer Accepted Job Tags. + /// A new instance for mocking. + public static AcsRouterWorkerOfferAcceptedEventData AcsRouterWorkerOfferAcceptedEventData(string jobId = null, string channelReference = null, string channelId = null, string workerId = null, string queueId = null, string offerId = null, string assignmentId = null, int? jobPriority = null, IReadOnlyDictionary workerLabels = null, IReadOnlyDictionary workerTags = null, IReadOnlyDictionary jobLabels = null, IReadOnlyDictionary jobTags = null) + { + workerLabels ??= new Dictionary(); + workerTags ??= new Dictionary(); + jobLabels ??= new Dictionary(); + jobTags ??= new Dictionary(); + + return new AcsRouterWorkerOfferAcceptedEventData(jobId, channelReference, channelId, workerId, queueId, offerId, assignmentId, jobPriority, workerLabels, workerTags, jobLabels, jobTags); + } + + /// Initializes a new instance of AcsRouterWorkerOfferDeclinedEventData. + /// Router Event Job ID. + /// Router Event Channel Reference. + /// Router Event Channel ID. + /// Router Worker events Worker Id. + /// Router Worker Offer Declined Queue Id. + /// Router Worker Offer Declined Offer Id. + /// A new instance for mocking. + public static AcsRouterWorkerOfferDeclinedEventData AcsRouterWorkerOfferDeclinedEventData(string jobId = null, string channelReference = null, string channelId = null, string workerId = null, string queueId = null, string offerId = null) + { + return new AcsRouterWorkerOfferDeclinedEventData(jobId, channelReference, channelId, workerId, queueId, offerId); + } + + /// Initializes a new instance of AcsRouterWorkerOfferExpiredEventData. + /// Router Event Job ID. + /// Router Event Channel Reference. + /// Router Event Channel ID. + /// Router Worker events Worker Id. + /// Router Worker Offer Expired Queue Id. + /// Router Worker Offer Expired Offer Id. + /// A new instance for mocking. + public static AcsRouterWorkerOfferExpiredEventData AcsRouterWorkerOfferExpiredEventData(string jobId = null, string channelReference = null, string channelId = null, string workerId = null, string queueId = null, string offerId = null) + { + return new AcsRouterWorkerOfferExpiredEventData(jobId, channelReference, channelId, workerId, queueId, offerId); + } + + /// Initializes a new instance of AcsRouterWorkerOfferIssuedEventData. + /// Router Event Job ID. + /// Router Event Channel Reference. + /// Router Event Channel ID. + /// Router Worker events Worker Id. + /// Router Worker Offer Issued Queue Id. + /// Router Worker Offer Issued Offer Id. + /// Router Worker Offer Issued Job Priority. + /// Router Worker Offer Issued Worker Labels. + /// Router Worker Offer Issued Time in UTC. + /// Router Worker Offer Issued Expiration Time in UTC. + /// Router Worker Offer Issued Worker Tags. + /// Router Worker Offer Issued Job Labels. + /// Router Worker Offer Issued Job Tags. + /// A new instance for mocking. + public static AcsRouterWorkerOfferIssuedEventData AcsRouterWorkerOfferIssuedEventData(string jobId = null, string channelReference = null, string channelId = null, string workerId = null, string queueId = null, string offerId = null, int? jobPriority = null, IReadOnlyDictionary workerLabels = null, DateTimeOffset? offeredOn = null, DateTimeOffset? expiresOn = null, IReadOnlyDictionary workerTags = null, IReadOnlyDictionary jobLabels = null, IReadOnlyDictionary jobTags = null) + { + workerLabels ??= new Dictionary(); + workerTags ??= new Dictionary(); + jobLabels ??= new Dictionary(); + jobTags ??= new Dictionary(); + + return new AcsRouterWorkerOfferIssuedEventData(jobId, channelReference, channelId, workerId, queueId, offerId, jobPriority, workerLabels, offeredOn, expiresOn, workerTags, jobLabels, jobTags); + } + + /// Initializes a new instance of AcsRouterWorkerOfferRevokedEventData. + /// Router Event Job ID. + /// Router Event Channel Reference. + /// Router Event Channel ID. + /// Router Worker events Worker Id. + /// Router Worker Offer Revoked Queue Id. + /// Router Worker Offer Revoked Offer Id. + /// A new instance for mocking. + public static AcsRouterWorkerOfferRevokedEventData AcsRouterWorkerOfferRevokedEventData(string jobId = null, string channelReference = null, string channelId = null, string workerId = null, string queueId = null, string offerId = null) + { + return new AcsRouterWorkerOfferRevokedEventData(jobId, channelReference, channelId, workerId, queueId, offerId); + } + + /// Initializes a new instance of AcsRouterWorkerRegisteredEventData. + /// Router Worker Registered Worker Id. + /// Router Worker Registered Queue Info. + /// Router Worker Registered Channel Configuration. + /// Router Worker Register Total Capacity. + /// Router Worker Registered Labels. + /// Router Worker Registered Tags. + /// A new instance for mocking. + public static AcsRouterWorkerRegisteredEventData AcsRouterWorkerRegisteredEventData(string workerId = null, IEnumerable queueAssignments = null, IEnumerable channelConfigurations = null, int? totalCapacity = null, IReadOnlyDictionary labels = null, IReadOnlyDictionary tags = null) + { + queueAssignments ??= new List(); + channelConfigurations ??= new List(); + labels ??= new Dictionary(); + tags ??= new Dictionary(); + + return new AcsRouterWorkerRegisteredEventData(workerId, queueAssignments?.ToList(), channelConfigurations?.ToList(), totalCapacity, labels, tags); + } + + /// Initializes a new instance of AcsRouterChannelConfiguration. + /// Channel ID for Router Job. + /// Capacity Cost Per Job for Router Job. + /// Max Number of Jobs for Router Job. + /// A new instance for mocking. + public static AcsRouterChannelConfiguration AcsRouterChannelConfiguration(string channelId = null, int? capacityCostPerJob = null, int? maxNumberOfJobs = null) + { + return new AcsRouterChannelConfiguration(channelId, capacityCostPerJob, maxNumberOfJobs); + } + /// Initializes a new instance of AcsChatMessageReceivedEventData. /// The communication identifier of the target user. /// The transaction id will be used as co-relation vector. @@ -2596,5 +3019,58 @@ public static HealthcareDicomImageDeletedEventData HealthcareDicomImageDeletedEv { return new HealthcareDicomImageDeletedEventData(partitionName, imageStudyInstanceUid, imageSeriesInstanceUid, imageSopInstanceUid, serviceHostName, sequenceNumber); } + + /// Initializes a new instance of ResourceNotificationsResourceUpdatedDetails. + /// id of the resource for which the event is being emitted. + /// name of the resource for which the event is being emitted. + /// the type of the resource for which the event is being emitted. + /// the location of the resource for which the event is being emitted. + /// the tags on the resource for which the event is being emitted. + /// properties in the payload of the resource for which the event is being emitted. + /// A new instance for mocking. + public static ResourceNotificationsResourceUpdatedDetails ResourceNotificationsResourceUpdatedDetails(string id = null, string name = null, string type = null, string location = null, string tags = null, IReadOnlyDictionary properties = null) + { + properties ??= new Dictionary(); + + return new ResourceNotificationsResourceUpdatedDetails(id, name, type, location, tags, properties); + } + + /// Initializes a new instance of ResourceNotificationsOperationalDetails. + /// Date and Time when resource was updated. + /// A new instance for mocking. + public static ResourceNotificationsOperationalDetails ResourceNotificationsOperationalDetails(DateTimeOffset? resourceEventTime = null) + { + return new ResourceNotificationsOperationalDetails(resourceEventTime); + } + + /// Initializes a new instance of ResourceNotificationsResourceUpdatedEventData. + /// resourceInfo details for update event. + /// details about operational info. + /// api version of the resource properties bag. + /// A new instance for mocking. + public static ResourceNotificationsResourceUpdatedEventData ResourceNotificationsResourceUpdatedEventData(ResourceNotificationsResourceUpdatedDetails resourceDetails = null, ResourceNotificationsOperationalDetails operationalDetails = null, string apiVersion = null) + { + return new ResourceNotificationsResourceUpdatedEventData(resourceDetails, operationalDetails, apiVersion); + } + + /// Initializes a new instance of ResourceNotificationsHealthResourcesAvailabilityStatusChangedEventData. + /// resourceInfo details for update event. + /// details about operational info. + /// api version of the resource properties bag. + /// A new instance for mocking. + public static ResourceNotificationsHealthResourcesAvailabilityStatusChangedEventData ResourceNotificationsHealthResourcesAvailabilityStatusChangedEventData(ResourceNotificationsResourceUpdatedDetails resourceDetails = null, ResourceNotificationsOperationalDetails operationalDetails = null, string apiVersion = null) + { + return new ResourceNotificationsHealthResourcesAvailabilityStatusChangedEventData(resourceDetails, operationalDetails, apiVersion); + } + + /// Initializes a new instance of ResourceNotificationsHealthResourcesAnnotatedEventData. + /// resourceInfo details for update event. + /// details about operational info. + /// api version of the resource properties bag. + /// A new instance for mocking. + public static ResourceNotificationsHealthResourcesAnnotatedEventData ResourceNotificationsHealthResourcesAnnotatedEventData(ResourceNotificationsResourceUpdatedDetails resourceDetails = null, ResourceNotificationsOperationalDetails operationalDetails = null, string apiVersion = null) + { + return new ResourceNotificationsHealthResourcesAnnotatedEventData(resourceDetails, operationalDetails, apiVersion); + } } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterChannelConfiguration.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterChannelConfiguration.Serialization.cs new file mode 100644 index 0000000000000..680bbdd0c8804 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterChannelConfiguration.Serialization.cs @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + public partial class AcsRouterChannelConfiguration + { + internal static AcsRouterChannelConfiguration DeserializeAcsRouterChannelConfiguration(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional channelId = default; + Optional capacityCostPerJob = default; + Optional maxNumberOfJobs = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("channelId"u8)) + { + channelId = property.Value.GetString(); + continue; + } + if (property.NameEquals("capacityCostPerJob"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + capacityCostPerJob = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("maxNumberOfJobs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + maxNumberOfJobs = property.Value.GetInt32(); + continue; + } + } + return new AcsRouterChannelConfiguration(channelId.Value, Optional.ToNullable(capacityCostPerJob), Optional.ToNullable(maxNumberOfJobs)); + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterChannelConfiguration.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterChannelConfiguration.cs new file mode 100644 index 0000000000000..11ce5018accbf --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterChannelConfiguration.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + /// Router Channel Configuration. + public partial class AcsRouterChannelConfiguration + { + /// Initializes a new instance of AcsRouterChannelConfiguration. + internal AcsRouterChannelConfiguration() + { + } + + /// Initializes a new instance of AcsRouterChannelConfiguration. + /// Channel ID for Router Job. + /// Capacity Cost Per Job for Router Job. + /// Max Number of Jobs for Router Job. + internal AcsRouterChannelConfiguration(string channelId, int? capacityCostPerJob, int? maxNumberOfJobs) + { + ChannelId = channelId; + CapacityCostPerJob = capacityCostPerJob; + MaxNumberOfJobs = maxNumberOfJobs; + } + + /// Channel ID for Router Job. + public string ChannelId { get; } + /// Capacity Cost Per Job for Router Job. + public int? CapacityCostPerJob { get; } + /// Max Number of Jobs for Router Job. + public int? MaxNumberOfJobs { get; } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterCommunicationError.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterCommunicationError.Serialization.cs new file mode 100644 index 0000000000000..cb33290b1ee76 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterCommunicationError.Serialization.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + internal partial class AcsRouterCommunicationError + { + internal static AcsRouterCommunicationError DeserializeAcsRouterCommunicationError(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional code = default; + Optional message = default; + Optional target = default; + Optional innererror = default; + Optional> details = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("code"u8)) + { + code = property.Value.GetString(); + continue; + } + if (property.NameEquals("message"u8)) + { + message = property.Value.GetString(); + continue; + } + if (property.NameEquals("target"u8)) + { + target = property.Value.GetString(); + continue; + } + if (property.NameEquals("innererror"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + innererror = DeserializeAcsRouterCommunicationError(property.Value); + continue; + } + if (property.NameEquals("details"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DeserializeAcsRouterCommunicationError(item)); + } + details = array; + continue; + } + } + return new AcsRouterCommunicationError(code.Value, message.Value, target.Value, innererror.Value, Optional.ToList(details)); + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterCommunicationError.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterCommunicationError.cs new file mode 100644 index 0000000000000..b878576811fdb --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterCommunicationError.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + /// Router Communication Error. + internal partial class AcsRouterCommunicationError + { + /// Initializes a new instance of AcsRouterCommunicationError. + internal AcsRouterCommunicationError() + { + Details = new ChangeTrackingList(); + } + + /// Initializes a new instance of AcsRouterCommunicationError. + /// Router Communication Error Code. + /// Router Communication Error Message. + /// Router Communication Error Target. + /// Router Communication Inner Error. + /// List of Router Communication Errors. + internal AcsRouterCommunicationError(string code, string message, string target, AcsRouterCommunicationError innererror, IReadOnlyList details) + { + Code = code; + Message = message; + Target = target; + Innererror = innererror; + Details = details; + } + + /// Router Communication Error Code. + public string Code { get; } + /// Router Communication Error Message. + public string Message { get; } + /// Router Communication Error Target. + public string Target { get; } + /// Router Communication Inner Error. + public AcsRouterCommunicationError Innererror { get; } + /// List of Router Communication Errors. + public IReadOnlyList Details { get; } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterEventData.Serialization.cs new file mode 100644 index 0000000000000..42fb0a87cede4 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterEventData.Serialization.cs @@ -0,0 +1,61 @@ +// 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; +using Azure.Core; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + [JsonConverter(typeof(AcsRouterEventDataConverter))] + public partial class AcsRouterEventData + { + internal static AcsRouterEventData DeserializeAcsRouterEventData(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional jobId = default; + Optional channelReference = default; + Optional channelId = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("jobId"u8)) + { + jobId = property.Value.GetString(); + continue; + } + if (property.NameEquals("channelReference"u8)) + { + channelReference = property.Value.GetString(); + continue; + } + if (property.NameEquals("channelId"u8)) + { + channelId = property.Value.GetString(); + continue; + } + } + return new AcsRouterEventData(jobId.Value, channelReference.Value, channelId.Value); + } + + internal partial class AcsRouterEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, AcsRouterEventData model, JsonSerializerOptions options) + { + throw new NotImplementedException(); + } + public override AcsRouterEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeAcsRouterEventData(document.RootElement); + } + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterEventData.cs new file mode 100644 index 0000000000000..19d4a8ffbe65b --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterEventData.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + /// Schema of common properties of all Router events. + public partial class AcsRouterEventData + { + /// Initializes a new instance of AcsRouterEventData. + internal AcsRouterEventData() + { + } + + /// Initializes a new instance of AcsRouterEventData. + /// Router Event Job ID. + /// Router Event Channel Reference. + /// Router Event Channel ID. + internal AcsRouterEventData(string jobId, string channelReference, string channelId) + { + JobId = jobId; + ChannelReference = channelReference; + ChannelId = channelId; + } + + /// Router Event Job ID. + public string JobId { get; } + /// Router Event Channel Reference. + public string ChannelReference { get; } + /// Router Event Channel ID. + public string ChannelId { get; } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterJobCancelledEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterJobCancelledEventData.Serialization.cs new file mode 100644 index 0000000000000..c6d915bfaff8e --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterJobCancelledEventData.Serialization.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using System.Text.Json.Serialization; +using Azure.Core; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + [JsonConverter(typeof(AcsRouterJobCancelledEventDataConverter))] + public partial class AcsRouterJobCancelledEventData + { + internal static AcsRouterJobCancelledEventData DeserializeAcsRouterJobCancelledEventData(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional note = default; + Optional dispositionCode = default; + Optional queueId = default; + Optional> labels = default; + Optional> tags = default; + Optional jobId = default; + Optional channelReference = default; + Optional channelId = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("note"u8)) + { + note = property.Value.GetString(); + continue; + } + if (property.NameEquals("dispositionCode"u8)) + { + dispositionCode = property.Value.GetString(); + continue; + } + if (property.NameEquals("queueId"u8)) + { + queueId = property.Value.GetString(); + continue; + } + if (property.NameEquals("labels"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + labels = dictionary; + continue; + } + if (property.NameEquals("tags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + if (property.NameEquals("jobId"u8)) + { + jobId = property.Value.GetString(); + continue; + } + if (property.NameEquals("channelReference"u8)) + { + channelReference = property.Value.GetString(); + continue; + } + if (property.NameEquals("channelId"u8)) + { + channelId = property.Value.GetString(); + continue; + } + } + return new AcsRouterJobCancelledEventData(jobId.Value, channelReference.Value, channelId.Value, queueId.Value, Optional.ToDictionary(labels), Optional.ToDictionary(tags), note.Value, dispositionCode.Value); + } + + internal partial class AcsRouterJobCancelledEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, AcsRouterJobCancelledEventData model, JsonSerializerOptions options) + { + throw new NotImplementedException(); + } + public override AcsRouterJobCancelledEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeAcsRouterJobCancelledEventData(document.RootElement); + } + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterJobCancelledEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterJobCancelledEventData.cs new file mode 100644 index 0000000000000..1a96986b24d13 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterJobCancelledEventData.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.RouterJobCancelled event. + public partial class AcsRouterJobCancelledEventData : AcsRouterJobEventData + { + /// Initializes a new instance of AcsRouterJobCancelledEventData. + internal AcsRouterJobCancelledEventData() + { + } + + /// Initializes a new instance of AcsRouterJobCancelledEventData. + /// Router Event Job ID. + /// Router Event Channel Reference. + /// Router Event Channel ID. + /// Router Job events Queue Id. + /// Router Job events Labels. + /// Router Jobs events Tags. + /// Router Job Note. + /// Router Job Disposition Code. + internal AcsRouterJobCancelledEventData(string jobId, string channelReference, string channelId, string queueId, IReadOnlyDictionary labels, IReadOnlyDictionary tags, string note, string dispositionCode) : base(jobId, channelReference, channelId, queueId, labels, tags) + { + Note = note; + DispositionCode = dispositionCode; + } + + /// Router Job Note. + public string Note { get; } + /// Router Job Disposition Code. + public string DispositionCode { get; } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterJobClassificationFailedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterJobClassificationFailedEventData.Serialization.cs new file mode 100644 index 0000000000000..d7e7935a5504c --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterJobClassificationFailedEventData.Serialization.cs @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using System.Text.Json.Serialization; +using Azure.Core; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + [JsonConverter(typeof(AcsRouterJobClassificationFailedEventDataConverter))] + public partial class AcsRouterJobClassificationFailedEventData + { + internal static AcsRouterJobClassificationFailedEventData DeserializeAcsRouterJobClassificationFailedEventData(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional classificationPolicyId = default; + Optional> errors = default; + Optional queueId = default; + Optional> labels = default; + Optional> tags = default; + Optional jobId = default; + Optional channelReference = default; + Optional channelId = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("classificationPolicyId"u8)) + { + classificationPolicyId = property.Value.GetString(); + continue; + } + if (property.NameEquals("errors"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(AcsRouterCommunicationError.DeserializeAcsRouterCommunicationError(item)); + } + errors = array; + continue; + } + if (property.NameEquals("queueId"u8)) + { + queueId = property.Value.GetString(); + continue; + } + if (property.NameEquals("labels"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + labels = dictionary; + continue; + } + if (property.NameEquals("tags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + if (property.NameEquals("jobId"u8)) + { + jobId = property.Value.GetString(); + continue; + } + if (property.NameEquals("channelReference"u8)) + { + channelReference = property.Value.GetString(); + continue; + } + if (property.NameEquals("channelId"u8)) + { + channelId = property.Value.GetString(); + continue; + } + } + return new AcsRouterJobClassificationFailedEventData(jobId.Value, channelReference.Value, channelId.Value, queueId.Value, Optional.ToDictionary(labels), Optional.ToDictionary(tags), classificationPolicyId.Value, Optional.ToList(errors)); + } + + internal partial class AcsRouterJobClassificationFailedEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, AcsRouterJobClassificationFailedEventData model, JsonSerializerOptions options) + { + throw new NotImplementedException(); + } + public override AcsRouterJobClassificationFailedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeAcsRouterJobClassificationFailedEventData(document.RootElement); + } + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterJobClassificationFailedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterJobClassificationFailedEventData.cs new file mode 100644 index 0000000000000..6056c0d2ab83d --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterJobClassificationFailedEventData.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.RouterJobClassificationFailed event. + public partial class AcsRouterJobClassificationFailedEventData : AcsRouterJobEventData + { + /// Initializes a new instance of AcsRouterJobClassificationFailedEventData. + internal AcsRouterJobClassificationFailedEventData() + { + ErrorsInternal = new ChangeTrackingList(); + } + + /// Initializes a new instance of AcsRouterJobClassificationFailedEventData. + /// Router Event Job ID. + /// Router Event Channel Reference. + /// Router Event Channel ID. + /// Router Job events Queue Id. + /// Router Job events Labels. + /// Router Jobs events Tags. + /// Router Job Classification Policy Id. + /// Router Job Classification Failed Errors. + internal AcsRouterJobClassificationFailedEventData(string jobId, string channelReference, string channelId, string queueId, IReadOnlyDictionary labels, IReadOnlyDictionary tags, string classificationPolicyId, IReadOnlyList errorsInternal) : base(jobId, channelReference, channelId, queueId, labels, tags) + { + ClassificationPolicyId = classificationPolicyId; + ErrorsInternal = errorsInternal; + } + + /// Router Job Classification Policy Id. + public string ClassificationPolicyId { get; } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterJobClassifiedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterJobClassifiedEventData.Serialization.cs new file mode 100644 index 0000000000000..389cbc7045335 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterJobClassifiedEventData.Serialization.cs @@ -0,0 +1,139 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using System.Text.Json.Serialization; +using Azure.Core; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + [JsonConverter(typeof(AcsRouterJobClassifiedEventDataConverter))] + public partial class AcsRouterJobClassifiedEventData + { + internal static AcsRouterJobClassifiedEventData DeserializeAcsRouterJobClassifiedEventData(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional queueDetails = default; + Optional classificationPolicyId = default; + Optional priority = default; + Optional> attachedWorkerSelectors = default; + Optional queueId = default; + Optional> labels = default; + Optional> tags = default; + Optional jobId = default; + Optional channelReference = default; + Optional channelId = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("queueDetails"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + queueDetails = AcsRouterQueueDetails.DeserializeAcsRouterQueueDetails(property.Value); + continue; + } + if (property.NameEquals("classificationPolicyId"u8)) + { + classificationPolicyId = property.Value.GetString(); + continue; + } + if (property.NameEquals("priority"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + priority = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("attachedWorkerSelectors"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(AcsRouterWorkerSelector.DeserializeAcsRouterWorkerSelector(item)); + } + attachedWorkerSelectors = array; + continue; + } + if (property.NameEquals("queueId"u8)) + { + queueId = property.Value.GetString(); + continue; + } + if (property.NameEquals("labels"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + labels = dictionary; + continue; + } + if (property.NameEquals("tags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + if (property.NameEquals("jobId"u8)) + { + jobId = property.Value.GetString(); + continue; + } + if (property.NameEquals("channelReference"u8)) + { + channelReference = property.Value.GetString(); + continue; + } + if (property.NameEquals("channelId"u8)) + { + channelId = property.Value.GetString(); + continue; + } + } + return new AcsRouterJobClassifiedEventData(jobId.Value, channelReference.Value, channelId.Value, queueId.Value, Optional.ToDictionary(labels), Optional.ToDictionary(tags), queueDetails.Value, classificationPolicyId.Value, Optional.ToNullable(priority), Optional.ToList(attachedWorkerSelectors)); + } + + internal partial class AcsRouterJobClassifiedEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, AcsRouterJobClassifiedEventData model, JsonSerializerOptions options) + { + throw new NotImplementedException(); + } + public override AcsRouterJobClassifiedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeAcsRouterJobClassifiedEventData(document.RootElement); + } + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterJobClassifiedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterJobClassifiedEventData.cs new file mode 100644 index 0000000000000..4a4bc7ae1551f --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterJobClassifiedEventData.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.RouterJobClassified event. + public partial class AcsRouterJobClassifiedEventData : AcsRouterJobEventData + { + /// Initializes a new instance of AcsRouterJobClassifiedEventData. + internal AcsRouterJobClassifiedEventData() + { + AttachedWorkerSelectors = new ChangeTrackingList(); + } + + /// Initializes a new instance of AcsRouterJobClassifiedEventData. + /// Router Event Job ID. + /// Router Event Channel Reference. + /// Router Event Channel ID. + /// Router Job events Queue Id. + /// Router Job events Labels. + /// Router Jobs events Tags. + /// Router Job Queue Info. + /// Router Job Classification Policy Id. + /// Router Job Priority. + /// Router Job Attached Worker Selector. + internal AcsRouterJobClassifiedEventData(string jobId, string channelReference, string channelId, string queueId, IReadOnlyDictionary labels, IReadOnlyDictionary tags, AcsRouterQueueDetails queueDetails, string classificationPolicyId, int? priority, IReadOnlyList attachedWorkerSelectors) : base(jobId, channelReference, channelId, queueId, labels, tags) + { + QueueDetails = queueDetails; + ClassificationPolicyId = classificationPolicyId; + Priority = priority; + AttachedWorkerSelectors = attachedWorkerSelectors; + } + + /// Router Job Queue Info. + public AcsRouterQueueDetails QueueDetails { get; } + /// Router Job Classification Policy Id. + public string ClassificationPolicyId { get; } + /// Router Job Priority. + public int? Priority { get; } + /// Router Job Attached Worker Selector. + public IReadOnlyList AttachedWorkerSelectors { get; } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterJobClosedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterJobClosedEventData.Serialization.cs new file mode 100644 index 0000000000000..800f54e7f7eba --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterJobClosedEventData.Serialization.cs @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using System.Text.Json.Serialization; +using Azure.Core; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + [JsonConverter(typeof(AcsRouterJobClosedEventDataConverter))] + public partial class AcsRouterJobClosedEventData + { + internal static AcsRouterJobClosedEventData DeserializeAcsRouterJobClosedEventData(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional assignmentId = default; + Optional workerId = default; + Optional dispositionCode = default; + Optional queueId = default; + Optional> labels = default; + Optional> tags = default; + Optional jobId = default; + Optional channelReference = default; + Optional channelId = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("assignmentId"u8)) + { + assignmentId = property.Value.GetString(); + continue; + } + if (property.NameEquals("workerId"u8)) + { + workerId = property.Value.GetString(); + continue; + } + if (property.NameEquals("dispositionCode"u8)) + { + dispositionCode = property.Value.GetString(); + continue; + } + if (property.NameEquals("queueId"u8)) + { + queueId = property.Value.GetString(); + continue; + } + if (property.NameEquals("labels"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + labels = dictionary; + continue; + } + if (property.NameEquals("tags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + if (property.NameEquals("jobId"u8)) + { + jobId = property.Value.GetString(); + continue; + } + if (property.NameEquals("channelReference"u8)) + { + channelReference = property.Value.GetString(); + continue; + } + if (property.NameEquals("channelId"u8)) + { + channelId = property.Value.GetString(); + continue; + } + } + return new AcsRouterJobClosedEventData(jobId.Value, channelReference.Value, channelId.Value, queueId.Value, Optional.ToDictionary(labels), Optional.ToDictionary(tags), assignmentId.Value, workerId.Value, dispositionCode.Value); + } + + internal partial class AcsRouterJobClosedEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, AcsRouterJobClosedEventData model, JsonSerializerOptions options) + { + throw new NotImplementedException(); + } + public override AcsRouterJobClosedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeAcsRouterJobClosedEventData(document.RootElement); + } + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterJobClosedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterJobClosedEventData.cs new file mode 100644 index 0000000000000..dde7aff46f74a --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterJobClosedEventData.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.RouterJobClosed event. + public partial class AcsRouterJobClosedEventData : AcsRouterJobEventData + { + /// Initializes a new instance of AcsRouterJobClosedEventData. + internal AcsRouterJobClosedEventData() + { + } + + /// Initializes a new instance of AcsRouterJobClosedEventData. + /// Router Event Job ID. + /// Router Event Channel Reference. + /// Router Event Channel ID. + /// Router Job events Queue Id. + /// Router Job events Labels. + /// Router Jobs events Tags. + /// Router Job Closed Assignment Id. + /// Router Job Closed Worker Id. + /// Router Job Closed Disposition Code. + internal AcsRouterJobClosedEventData(string jobId, string channelReference, string channelId, string queueId, IReadOnlyDictionary labels, IReadOnlyDictionary tags, string assignmentId, string workerId, string dispositionCode) : base(jobId, channelReference, channelId, queueId, labels, tags) + { + AssignmentId = assignmentId; + WorkerId = workerId; + DispositionCode = dispositionCode; + } + + /// Router Job Closed Assignment Id. + public string AssignmentId { get; } + /// Router Job Closed Worker Id. + public string WorkerId { get; } + /// Router Job Closed Disposition Code. + public string DispositionCode { get; } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterJobCompletedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterJobCompletedEventData.Serialization.cs new file mode 100644 index 0000000000000..5c276566d3018 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterJobCompletedEventData.Serialization.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using System.Text.Json.Serialization; +using Azure.Core; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + [JsonConverter(typeof(AcsRouterJobCompletedEventDataConverter))] + public partial class AcsRouterJobCompletedEventData + { + internal static AcsRouterJobCompletedEventData DeserializeAcsRouterJobCompletedEventData(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional assignmentId = default; + Optional workerId = default; + Optional queueId = default; + Optional> labels = default; + Optional> tags = default; + Optional jobId = default; + Optional channelReference = default; + Optional channelId = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("assignmentId"u8)) + { + assignmentId = property.Value.GetString(); + continue; + } + if (property.NameEquals("workerId"u8)) + { + workerId = property.Value.GetString(); + continue; + } + if (property.NameEquals("queueId"u8)) + { + queueId = property.Value.GetString(); + continue; + } + if (property.NameEquals("labels"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + labels = dictionary; + continue; + } + if (property.NameEquals("tags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + if (property.NameEquals("jobId"u8)) + { + jobId = property.Value.GetString(); + continue; + } + if (property.NameEquals("channelReference"u8)) + { + channelReference = property.Value.GetString(); + continue; + } + if (property.NameEquals("channelId"u8)) + { + channelId = property.Value.GetString(); + continue; + } + } + return new AcsRouterJobCompletedEventData(jobId.Value, channelReference.Value, channelId.Value, queueId.Value, Optional.ToDictionary(labels), Optional.ToDictionary(tags), assignmentId.Value, workerId.Value); + } + + internal partial class AcsRouterJobCompletedEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, AcsRouterJobCompletedEventData model, JsonSerializerOptions options) + { + throw new NotImplementedException(); + } + public override AcsRouterJobCompletedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeAcsRouterJobCompletedEventData(document.RootElement); + } + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterJobCompletedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterJobCompletedEventData.cs new file mode 100644 index 0000000000000..4d88acf5c7185 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterJobCompletedEventData.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.RouterJobCompleted event. + public partial class AcsRouterJobCompletedEventData : AcsRouterJobEventData + { + /// Initializes a new instance of AcsRouterJobCompletedEventData. + internal AcsRouterJobCompletedEventData() + { + } + + /// Initializes a new instance of AcsRouterJobCompletedEventData. + /// Router Event Job ID. + /// Router Event Channel Reference. + /// Router Event Channel ID. + /// Router Job events Queue Id. + /// Router Job events Labels. + /// Router Jobs events Tags. + /// Router Job Completed Assignment Id. + /// Router Job Completed Worker Id. + internal AcsRouterJobCompletedEventData(string jobId, string channelReference, string channelId, string queueId, IReadOnlyDictionary labels, IReadOnlyDictionary tags, string assignmentId, string workerId) : base(jobId, channelReference, channelId, queueId, labels, tags) + { + AssignmentId = assignmentId; + WorkerId = workerId; + } + + /// Router Job Completed Assignment Id. + public string AssignmentId { get; } + /// Router Job Completed Worker Id. + public string WorkerId { get; } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterJobDeletedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterJobDeletedEventData.Serialization.cs new file mode 100644 index 0000000000000..d6eb2480ec497 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterJobDeletedEventData.Serialization.cs @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using System.Text.Json.Serialization; +using Azure.Core; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + [JsonConverter(typeof(AcsRouterJobDeletedEventDataConverter))] + public partial class AcsRouterJobDeletedEventData + { + internal static AcsRouterJobDeletedEventData DeserializeAcsRouterJobDeletedEventData(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional queueId = default; + Optional> labels = default; + Optional> tags = default; + Optional jobId = default; + Optional channelReference = default; + Optional channelId = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("queueId"u8)) + { + queueId = property.Value.GetString(); + continue; + } + if (property.NameEquals("labels"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + labels = dictionary; + continue; + } + if (property.NameEquals("tags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + if (property.NameEquals("jobId"u8)) + { + jobId = property.Value.GetString(); + continue; + } + if (property.NameEquals("channelReference"u8)) + { + channelReference = property.Value.GetString(); + continue; + } + if (property.NameEquals("channelId"u8)) + { + channelId = property.Value.GetString(); + continue; + } + } + return new AcsRouterJobDeletedEventData(jobId.Value, channelReference.Value, channelId.Value, queueId.Value, Optional.ToDictionary(labels), Optional.ToDictionary(tags)); + } + + internal partial class AcsRouterJobDeletedEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, AcsRouterJobDeletedEventData model, JsonSerializerOptions options) + { + throw new NotImplementedException(); + } + public override AcsRouterJobDeletedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeAcsRouterJobDeletedEventData(document.RootElement); + } + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterJobDeletedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterJobDeletedEventData.cs new file mode 100644 index 0000000000000..ef9eecc463ecf --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterJobDeletedEventData.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.RouterJobDeleted event. + public partial class AcsRouterJobDeletedEventData : AcsRouterJobEventData + { + /// Initializes a new instance of AcsRouterJobDeletedEventData. + internal AcsRouterJobDeletedEventData() + { + } + + /// Initializes a new instance of AcsRouterJobDeletedEventData. + /// Router Event Job ID. + /// Router Event Channel Reference. + /// Router Event Channel ID. + /// Router Job events Queue Id. + /// Router Job events Labels. + /// Router Jobs events Tags. + internal AcsRouterJobDeletedEventData(string jobId, string channelReference, string channelId, string queueId, IReadOnlyDictionary labels, IReadOnlyDictionary tags) : base(jobId, channelReference, channelId, queueId, labels, tags) + { + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterJobEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterJobEventData.Serialization.cs new file mode 100644 index 0000000000000..8157b7d250185 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterJobEventData.Serialization.cs @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using System.Text.Json.Serialization; +using Azure.Core; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + [JsonConverter(typeof(AcsRouterJobEventDataConverter))] + public partial class AcsRouterJobEventData + { + internal static AcsRouterJobEventData DeserializeAcsRouterJobEventData(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional queueId = default; + Optional> labels = default; + Optional> tags = default; + Optional jobId = default; + Optional channelReference = default; + Optional channelId = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("queueId"u8)) + { + queueId = property.Value.GetString(); + continue; + } + if (property.NameEquals("labels"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + labels = dictionary; + continue; + } + if (property.NameEquals("tags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + if (property.NameEquals("jobId"u8)) + { + jobId = property.Value.GetString(); + continue; + } + if (property.NameEquals("channelReference"u8)) + { + channelReference = property.Value.GetString(); + continue; + } + if (property.NameEquals("channelId"u8)) + { + channelId = property.Value.GetString(); + continue; + } + } + return new AcsRouterJobEventData(jobId.Value, channelReference.Value, channelId.Value, queueId.Value, Optional.ToDictionary(labels), Optional.ToDictionary(tags)); + } + + internal partial class AcsRouterJobEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, AcsRouterJobEventData model, JsonSerializerOptions options) + { + throw new NotImplementedException(); + } + public override AcsRouterJobEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeAcsRouterJobEventData(document.RootElement); + } + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterJobEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterJobEventData.cs new file mode 100644 index 0000000000000..85dea89131564 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterJobEventData.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + /// Schema of common properties of all Router Job events. + public partial class AcsRouterJobEventData : AcsRouterEventData + { + /// Initializes a new instance of AcsRouterJobEventData. + internal AcsRouterJobEventData() + { + Labels = new ChangeTrackingDictionary(); + Tags = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of AcsRouterJobEventData. + /// Router Event Job ID. + /// Router Event Channel Reference. + /// Router Event Channel ID. + /// Router Job events Queue Id. + /// Router Job events Labels. + /// Router Jobs events Tags. + internal AcsRouterJobEventData(string jobId, string channelReference, string channelId, string queueId, IReadOnlyDictionary labels, IReadOnlyDictionary tags) : base(jobId, channelReference, channelId) + { + QueueId = queueId; + Labels = labels; + Tags = tags; + } + + /// Router Job events Queue Id. + public string QueueId { get; } + /// Router Job events Labels. + public IReadOnlyDictionary Labels { get; } + /// Router Jobs events Tags. + public IReadOnlyDictionary Tags { get; } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterJobExceptionTriggeredEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterJobExceptionTriggeredEventData.Serialization.cs new file mode 100644 index 0000000000000..304f14c18671c --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterJobExceptionTriggeredEventData.Serialization.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using System.Text.Json.Serialization; +using Azure.Core; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + [JsonConverter(typeof(AcsRouterJobExceptionTriggeredEventDataConverter))] + public partial class AcsRouterJobExceptionTriggeredEventData + { + internal static AcsRouterJobExceptionTriggeredEventData DeserializeAcsRouterJobExceptionTriggeredEventData(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional ruleKey = default; + Optional exceptionRuleId = default; + Optional queueId = default; + Optional> labels = default; + Optional> tags = default; + Optional jobId = default; + Optional channelReference = default; + Optional channelId = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("ruleKey"u8)) + { + ruleKey = property.Value.GetString(); + continue; + } + if (property.NameEquals("exceptionRuleId"u8)) + { + exceptionRuleId = property.Value.GetString(); + continue; + } + if (property.NameEquals("queueId"u8)) + { + queueId = property.Value.GetString(); + continue; + } + if (property.NameEquals("labels"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + labels = dictionary; + continue; + } + if (property.NameEquals("tags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + if (property.NameEquals("jobId"u8)) + { + jobId = property.Value.GetString(); + continue; + } + if (property.NameEquals("channelReference"u8)) + { + channelReference = property.Value.GetString(); + continue; + } + if (property.NameEquals("channelId"u8)) + { + channelId = property.Value.GetString(); + continue; + } + } + return new AcsRouterJobExceptionTriggeredEventData(jobId.Value, channelReference.Value, channelId.Value, queueId.Value, Optional.ToDictionary(labels), Optional.ToDictionary(tags), ruleKey.Value, exceptionRuleId.Value); + } + + internal partial class AcsRouterJobExceptionTriggeredEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, AcsRouterJobExceptionTriggeredEventData model, JsonSerializerOptions options) + { + throw new NotImplementedException(); + } + public override AcsRouterJobExceptionTriggeredEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeAcsRouterJobExceptionTriggeredEventData(document.RootElement); + } + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterJobExceptionTriggeredEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterJobExceptionTriggeredEventData.cs new file mode 100644 index 0000000000000..dec9c5ca360fe --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterJobExceptionTriggeredEventData.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.RouterJobExceptionTriggered event. + public partial class AcsRouterJobExceptionTriggeredEventData : AcsRouterJobEventData + { + /// Initializes a new instance of AcsRouterJobExceptionTriggeredEventData. + internal AcsRouterJobExceptionTriggeredEventData() + { + } + + /// Initializes a new instance of AcsRouterJobExceptionTriggeredEventData. + /// Router Event Job ID. + /// Router Event Channel Reference. + /// Router Event Channel ID. + /// Router Job events Queue Id. + /// Router Job events Labels. + /// Router Jobs events Tags. + /// Router Job Exception Triggered Rule Key. + /// Router Job Exception Triggered Rule Id. + internal AcsRouterJobExceptionTriggeredEventData(string jobId, string channelReference, string channelId, string queueId, IReadOnlyDictionary labels, IReadOnlyDictionary tags, string ruleKey, string exceptionRuleId) : base(jobId, channelReference, channelId, queueId, labels, tags) + { + RuleKey = ruleKey; + ExceptionRuleId = exceptionRuleId; + } + + /// Router Job Exception Triggered Rule Key. + public string RuleKey { get; } + /// Router Job Exception Triggered Rule Id. + public string ExceptionRuleId { get; } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterJobQueuedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterJobQueuedEventData.Serialization.cs new file mode 100644 index 0000000000000..665144712c0c1 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterJobQueuedEventData.Serialization.cs @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using System.Text.Json.Serialization; +using Azure.Core; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + [JsonConverter(typeof(AcsRouterJobQueuedEventDataConverter))] + public partial class AcsRouterJobQueuedEventData + { + internal static AcsRouterJobQueuedEventData DeserializeAcsRouterJobQueuedEventData(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional priority = default; + Optional> attachedWorkerSelectors = default; + Optional> requestedWorkerSelectors = default; + Optional queueId = default; + Optional> labels = default; + Optional> tags = default; + Optional jobId = default; + Optional channelReference = default; + Optional channelId = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("priority"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + priority = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("attachedWorkerSelectors"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(AcsRouterWorkerSelector.DeserializeAcsRouterWorkerSelector(item)); + } + attachedWorkerSelectors = array; + continue; + } + if (property.NameEquals("requestedWorkerSelectors"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(AcsRouterWorkerSelector.DeserializeAcsRouterWorkerSelector(item)); + } + requestedWorkerSelectors = array; + continue; + } + if (property.NameEquals("queueId"u8)) + { + queueId = property.Value.GetString(); + continue; + } + if (property.NameEquals("labels"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + labels = dictionary; + continue; + } + if (property.NameEquals("tags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + if (property.NameEquals("jobId"u8)) + { + jobId = property.Value.GetString(); + continue; + } + if (property.NameEquals("channelReference"u8)) + { + channelReference = property.Value.GetString(); + continue; + } + if (property.NameEquals("channelId"u8)) + { + channelId = property.Value.GetString(); + continue; + } + } + return new AcsRouterJobQueuedEventData(jobId.Value, channelReference.Value, channelId.Value, queueId.Value, Optional.ToDictionary(labels), Optional.ToDictionary(tags), Optional.ToNullable(priority), Optional.ToList(attachedWorkerSelectors), Optional.ToList(requestedWorkerSelectors)); + } + + internal partial class AcsRouterJobQueuedEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, AcsRouterJobQueuedEventData model, JsonSerializerOptions options) + { + throw new NotImplementedException(); + } + public override AcsRouterJobQueuedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeAcsRouterJobQueuedEventData(document.RootElement); + } + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterJobQueuedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterJobQueuedEventData.cs new file mode 100644 index 0000000000000..5c6732ee3f550 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterJobQueuedEventData.cs @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.RouterJobQueued event. + public partial class AcsRouterJobQueuedEventData : AcsRouterJobEventData + { + /// Initializes a new instance of AcsRouterJobQueuedEventData. + internal AcsRouterJobQueuedEventData() + { + AttachedWorkerSelectors = new ChangeTrackingList(); + RequestedWorkerSelectors = new ChangeTrackingList(); + } + + /// Initializes a new instance of AcsRouterJobQueuedEventData. + /// Router Event Job ID. + /// Router Event Channel Reference. + /// Router Event Channel ID. + /// Router Job events Queue Id. + /// Router Job events Labels. + /// Router Jobs events Tags. + /// Router Job Priority. + /// Router Job Queued Attached Worker Selector. + /// Router Job Queued Requested Worker Selector. + internal AcsRouterJobQueuedEventData(string jobId, string channelReference, string channelId, string queueId, IReadOnlyDictionary labels, IReadOnlyDictionary tags, int? priority, IReadOnlyList attachedWorkerSelectors, IReadOnlyList requestedWorkerSelectors) : base(jobId, channelReference, channelId, queueId, labels, tags) + { + Priority = priority; + AttachedWorkerSelectors = attachedWorkerSelectors; + RequestedWorkerSelectors = requestedWorkerSelectors; + } + + /// Router Job Priority. + public int? Priority { get; } + /// Router Job Queued Attached Worker Selector. + public IReadOnlyList AttachedWorkerSelectors { get; } + /// Router Job Queued Requested Worker Selector. + public IReadOnlyList RequestedWorkerSelectors { get; } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterJobReceivedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterJobReceivedEventData.Serialization.cs new file mode 100644 index 0000000000000..6d232c0c323e8 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterJobReceivedEventData.Serialization.cs @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using System.Text.Json.Serialization; +using Azure.Core; +using Azure.Messaging.EventGrid.Models; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + [JsonConverter(typeof(AcsRouterJobReceivedEventDataConverter))] + public partial class AcsRouterJobReceivedEventData + { + internal static AcsRouterJobReceivedEventData DeserializeAcsRouterJobReceivedEventData(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional jobStatus = default; + Optional classificationPolicyId = default; + Optional priority = default; + Optional> requestedWorkerSelectors = default; + Optional scheduledOn = default; + bool unavailableForMatching = default; + Optional queueId = default; + Optional> labels = default; + Optional> tags = default; + Optional jobId = default; + Optional channelReference = default; + Optional channelId = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("jobStatus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + jobStatus = new AcsRouterJobStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("classificationPolicyId"u8)) + { + classificationPolicyId = property.Value.GetString(); + continue; + } + if (property.NameEquals("priority"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + priority = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("requestedWorkerSelectors"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(AcsRouterWorkerSelector.DeserializeAcsRouterWorkerSelector(item)); + } + requestedWorkerSelectors = array; + continue; + } + if (property.NameEquals("scheduledOn"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + scheduledOn = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("unavailableForMatching"u8)) + { + unavailableForMatching = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("queueId"u8)) + { + queueId = property.Value.GetString(); + continue; + } + if (property.NameEquals("labels"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + labels = dictionary; + continue; + } + if (property.NameEquals("tags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + if (property.NameEquals("jobId"u8)) + { + jobId = property.Value.GetString(); + continue; + } + if (property.NameEquals("channelReference"u8)) + { + channelReference = property.Value.GetString(); + continue; + } + if (property.NameEquals("channelId"u8)) + { + channelId = property.Value.GetString(); + continue; + } + } + return new AcsRouterJobReceivedEventData(jobId.Value, channelReference.Value, channelId.Value, queueId.Value, Optional.ToDictionary(labels), Optional.ToDictionary(tags), Optional.ToNullable(jobStatus), classificationPolicyId.Value, Optional.ToNullable(priority), Optional.ToList(requestedWorkerSelectors), Optional.ToNullable(scheduledOn), unavailableForMatching); + } + + internal partial class AcsRouterJobReceivedEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, AcsRouterJobReceivedEventData model, JsonSerializerOptions options) + { + throw new NotImplementedException(); + } + public override AcsRouterJobReceivedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeAcsRouterJobReceivedEventData(document.RootElement); + } + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterJobReceivedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterJobReceivedEventData.cs new file mode 100644 index 0000000000000..3e0e38789325b --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterJobReceivedEventData.cs @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.Messaging.EventGrid.Models; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.RouterJobReceived event. + public partial class AcsRouterJobReceivedEventData : AcsRouterJobEventData + { + /// Initializes a new instance of AcsRouterJobReceivedEventData. + /// Unavailable For Matching for Router Job Received. + internal AcsRouterJobReceivedEventData(bool unavailableForMatching) + { + RequestedWorkerSelectors = new ChangeTrackingList(); + UnavailableForMatching = unavailableForMatching; + } + + /// Initializes a new instance of AcsRouterJobReceivedEventData. + /// Router Event Job ID. + /// Router Event Channel Reference. + /// Router Event Channel ID. + /// Router Job events Queue Id. + /// Router Job events Labels. + /// Router Jobs events Tags. + /// Router Job Received Job Status. + /// Router Job Classification Policy Id. + /// Router Job Priority. + /// Router Job Received Requested Worker Selectors. + /// Router Job Received Scheduled Time in UTC. + /// Unavailable For Matching for Router Job Received. + internal AcsRouterJobReceivedEventData(string jobId, string channelReference, string channelId, string queueId, IReadOnlyDictionary labels, IReadOnlyDictionary tags, AcsRouterJobStatus? jobStatus, string classificationPolicyId, int? priority, IReadOnlyList requestedWorkerSelectors, DateTimeOffset? scheduledOn, bool unavailableForMatching) : base(jobId, channelReference, channelId, queueId, labels, tags) + { + JobStatus = jobStatus; + ClassificationPolicyId = classificationPolicyId; + Priority = priority; + RequestedWorkerSelectors = requestedWorkerSelectors; + ScheduledOn = scheduledOn; + UnavailableForMatching = unavailableForMatching; + } + + /// Router Job Received Job Status. + public AcsRouterJobStatus? JobStatus { get; } + /// Router Job Classification Policy Id. + public string ClassificationPolicyId { get; } + /// Router Job Priority. + public int? Priority { get; } + /// Router Job Received Requested Worker Selectors. + public IReadOnlyList RequestedWorkerSelectors { get; } + /// Router Job Received Scheduled Time in UTC. + public DateTimeOffset? ScheduledOn { get; } + /// Unavailable For Matching for Router Job Received. + public bool UnavailableForMatching { get; } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterJobSchedulingFailedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterJobSchedulingFailedEventData.Serialization.cs new file mode 100644 index 0000000000000..9556c5d7ec6ef --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterJobSchedulingFailedEventData.Serialization.cs @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using System.Text.Json.Serialization; +using Azure.Core; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + [JsonConverter(typeof(AcsRouterJobSchedulingFailedEventDataConverter))] + public partial class AcsRouterJobSchedulingFailedEventData + { + internal static AcsRouterJobSchedulingFailedEventData DeserializeAcsRouterJobSchedulingFailedEventData(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional priority = default; + Optional> expiredAttachedWorkerSelectors = default; + Optional> expiredRequestedWorkerSelectors = default; + Optional scheduledOn = default; + Optional failureReason = default; + Optional queueId = default; + Optional> labels = default; + Optional> tags = default; + Optional jobId = default; + Optional channelReference = default; + Optional channelId = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("priority"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + priority = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("expiredAttachedWorkerSelectors"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(AcsRouterWorkerSelector.DeserializeAcsRouterWorkerSelector(item)); + } + expiredAttachedWorkerSelectors = array; + continue; + } + if (property.NameEquals("expiredRequestedWorkerSelectors"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(AcsRouterWorkerSelector.DeserializeAcsRouterWorkerSelector(item)); + } + expiredRequestedWorkerSelectors = array; + continue; + } + if (property.NameEquals("scheduledOn"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + scheduledOn = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("failureReason"u8)) + { + failureReason = property.Value.GetString(); + continue; + } + if (property.NameEquals("queueId"u8)) + { + queueId = property.Value.GetString(); + continue; + } + if (property.NameEquals("labels"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + labels = dictionary; + continue; + } + if (property.NameEquals("tags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + if (property.NameEquals("jobId"u8)) + { + jobId = property.Value.GetString(); + continue; + } + if (property.NameEquals("channelReference"u8)) + { + channelReference = property.Value.GetString(); + continue; + } + if (property.NameEquals("channelId"u8)) + { + channelId = property.Value.GetString(); + continue; + } + } + return new AcsRouterJobSchedulingFailedEventData(jobId.Value, channelReference.Value, channelId.Value, queueId.Value, Optional.ToDictionary(labels), Optional.ToDictionary(tags), Optional.ToNullable(priority), Optional.ToList(expiredAttachedWorkerSelectors), Optional.ToList(expiredRequestedWorkerSelectors), Optional.ToNullable(scheduledOn), failureReason.Value); + } + + internal partial class AcsRouterJobSchedulingFailedEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, AcsRouterJobSchedulingFailedEventData model, JsonSerializerOptions options) + { + throw new NotImplementedException(); + } + public override AcsRouterJobSchedulingFailedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeAcsRouterJobSchedulingFailedEventData(document.RootElement); + } + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterJobSchedulingFailedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterJobSchedulingFailedEventData.cs new file mode 100644 index 0000000000000..05099f19c2c5d --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterJobSchedulingFailedEventData.cs @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.RouterJobSchedulingFailed event. + public partial class AcsRouterJobSchedulingFailedEventData : AcsRouterJobEventData + { + /// Initializes a new instance of AcsRouterJobSchedulingFailedEventData. + internal AcsRouterJobSchedulingFailedEventData() + { + ExpiredAttachedWorkerSelectors = new ChangeTrackingList(); + ExpiredRequestedWorkerSelectors = new ChangeTrackingList(); + } + + /// Initializes a new instance of AcsRouterJobSchedulingFailedEventData. + /// Router Event Job ID. + /// Router Event Channel Reference. + /// Router Event Channel ID. + /// Router Job events Queue Id. + /// Router Job events Labels. + /// Router Jobs events Tags. + /// Router Job Priority. + /// Router Job Scheduling Failed Attached Worker Selector Expired. + /// Router Job Scheduling Failed Requested Worker Selector Expired. + /// Router Job Scheduling Failed Scheduled Time in UTC. + /// Router Job Scheduling Failed Reason. + internal AcsRouterJobSchedulingFailedEventData(string jobId, string channelReference, string channelId, string queueId, IReadOnlyDictionary labels, IReadOnlyDictionary tags, int? priority, IReadOnlyList expiredAttachedWorkerSelectors, IReadOnlyList expiredRequestedWorkerSelectors, DateTimeOffset? scheduledOn, string failureReason) : base(jobId, channelReference, channelId, queueId, labels, tags) + { + Priority = priority; + ExpiredAttachedWorkerSelectors = expiredAttachedWorkerSelectors; + ExpiredRequestedWorkerSelectors = expiredRequestedWorkerSelectors; + ScheduledOn = scheduledOn; + FailureReason = failureReason; + } + + /// Router Job Priority. + public int? Priority { get; } + /// Router Job Scheduling Failed Attached Worker Selector Expired. + public IReadOnlyList ExpiredAttachedWorkerSelectors { get; } + /// Router Job Scheduling Failed Requested Worker Selector Expired. + public IReadOnlyList ExpiredRequestedWorkerSelectors { get; } + /// Router Job Scheduling Failed Scheduled Time in UTC. + public DateTimeOffset? ScheduledOn { get; } + /// Router Job Scheduling Failed Reason. + public string FailureReason { get; } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterJobStatus.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterJobStatus.cs new file mode 100644 index 0000000000000..4e4178b97f90c --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterJobStatus.cs @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Messaging.EventGrid.Models +{ + /// Router Job Received Job Status. + public readonly partial struct AcsRouterJobStatus : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AcsRouterJobStatus(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string PendingClassificationValue = "PendingClassification"; + private const string QueuedValue = "Queued"; + private const string AssignedValue = "Assigned"; + private const string CompletedValue = "Completed"; + private const string ClosedValue = "Closed"; + private const string CancelledValue = "Cancelled"; + private const string ClassificationFailedValue = "ClassificationFailed"; + private const string CreatedValue = "Created"; + private const string PendingScheduleValue = "PendingSchedule"; + private const string ScheduledValue = "Scheduled"; + private const string ScheduleFailedValue = "ScheduleFailed"; + private const string WaitingForActivationValue = "WaitingForActivation"; + + /// PendingClassification. + public static AcsRouterJobStatus PendingClassification { get; } = new AcsRouterJobStatus(PendingClassificationValue); + /// Queued. + public static AcsRouterJobStatus Queued { get; } = new AcsRouterJobStatus(QueuedValue); + /// Assigned. + public static AcsRouterJobStatus Assigned { get; } = new AcsRouterJobStatus(AssignedValue); + /// Completed. + public static AcsRouterJobStatus Completed { get; } = new AcsRouterJobStatus(CompletedValue); + /// Closed. + public static AcsRouterJobStatus Closed { get; } = new AcsRouterJobStatus(ClosedValue); + /// Cancelled. + public static AcsRouterJobStatus Cancelled { get; } = new AcsRouterJobStatus(CancelledValue); + /// ClassificationFailed. + public static AcsRouterJobStatus ClassificationFailed { get; } = new AcsRouterJobStatus(ClassificationFailedValue); + /// Created. + public static AcsRouterJobStatus Created { get; } = new AcsRouterJobStatus(CreatedValue); + /// PendingSchedule. + public static AcsRouterJobStatus PendingSchedule { get; } = new AcsRouterJobStatus(PendingScheduleValue); + /// Scheduled. + public static AcsRouterJobStatus Scheduled { get; } = new AcsRouterJobStatus(ScheduledValue); + /// ScheduleFailed. + public static AcsRouterJobStatus ScheduleFailed { get; } = new AcsRouterJobStatus(ScheduleFailedValue); + /// WaitingForActivation. + public static AcsRouterJobStatus WaitingForActivation { get; } = new AcsRouterJobStatus(WaitingForActivationValue); + /// Determines if two values are the same. + public static bool operator ==(AcsRouterJobStatus left, AcsRouterJobStatus right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AcsRouterJobStatus left, AcsRouterJobStatus right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator AcsRouterJobStatus(string value) => new AcsRouterJobStatus(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AcsRouterJobStatus other && Equals(other); + /// + public bool Equals(AcsRouterJobStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterJobUnassignedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterJobUnassignedEventData.Serialization.cs new file mode 100644 index 0000000000000..434758b1ba2ad --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterJobUnassignedEventData.Serialization.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using System.Text.Json.Serialization; +using Azure.Core; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + [JsonConverter(typeof(AcsRouterJobUnassignedEventDataConverter))] + public partial class AcsRouterJobUnassignedEventData + { + internal static AcsRouterJobUnassignedEventData DeserializeAcsRouterJobUnassignedEventData(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional assignmentId = default; + Optional workerId = default; + Optional queueId = default; + Optional> labels = default; + Optional> tags = default; + Optional jobId = default; + Optional channelReference = default; + Optional channelId = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("assignmentId"u8)) + { + assignmentId = property.Value.GetString(); + continue; + } + if (property.NameEquals("workerId"u8)) + { + workerId = property.Value.GetString(); + continue; + } + if (property.NameEquals("queueId"u8)) + { + queueId = property.Value.GetString(); + continue; + } + if (property.NameEquals("labels"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + labels = dictionary; + continue; + } + if (property.NameEquals("tags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + if (property.NameEquals("jobId"u8)) + { + jobId = property.Value.GetString(); + continue; + } + if (property.NameEquals("channelReference"u8)) + { + channelReference = property.Value.GetString(); + continue; + } + if (property.NameEquals("channelId"u8)) + { + channelId = property.Value.GetString(); + continue; + } + } + return new AcsRouterJobUnassignedEventData(jobId.Value, channelReference.Value, channelId.Value, queueId.Value, Optional.ToDictionary(labels), Optional.ToDictionary(tags), assignmentId.Value, workerId.Value); + } + + internal partial class AcsRouterJobUnassignedEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, AcsRouterJobUnassignedEventData model, JsonSerializerOptions options) + { + throw new NotImplementedException(); + } + public override AcsRouterJobUnassignedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeAcsRouterJobUnassignedEventData(document.RootElement); + } + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterJobUnassignedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterJobUnassignedEventData.cs new file mode 100644 index 0000000000000..6292ccda401ba --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterJobUnassignedEventData.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.RouterJobUnassigned event. + public partial class AcsRouterJobUnassignedEventData : AcsRouterJobEventData + { + /// Initializes a new instance of AcsRouterJobUnassignedEventData. + internal AcsRouterJobUnassignedEventData() + { + } + + /// Initializes a new instance of AcsRouterJobUnassignedEventData. + /// Router Event Job ID. + /// Router Event Channel Reference. + /// Router Event Channel ID. + /// Router Job events Queue Id. + /// Router Job events Labels. + /// Router Jobs events Tags. + /// Router Job Unassigned Assignment Id. + /// Router Job Unassigned Worker Id. + internal AcsRouterJobUnassignedEventData(string jobId, string channelReference, string channelId, string queueId, IReadOnlyDictionary labels, IReadOnlyDictionary tags, string assignmentId, string workerId) : base(jobId, channelReference, channelId, queueId, labels, tags) + { + AssignmentId = assignmentId; + WorkerId = workerId; + } + + /// Router Job Unassigned Assignment Id. + public string AssignmentId { get; } + /// Router Job Unassigned Worker Id. + public string WorkerId { get; } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterJobWaitingForActivationEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterJobWaitingForActivationEventData.Serialization.cs new file mode 100644 index 0000000000000..637bc552a60be --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterJobWaitingForActivationEventData.Serialization.cs @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using System.Text.Json.Serialization; +using Azure.Core; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + [JsonConverter(typeof(AcsRouterJobWaitingForActivationEventDataConverter))] + public partial class AcsRouterJobWaitingForActivationEventData + { + internal static AcsRouterJobWaitingForActivationEventData DeserializeAcsRouterJobWaitingForActivationEventData(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional priority = default; + Optional> expiredAttachedWorkerSelectors = default; + Optional> expiredRequestedWorkerSelectors = default; + Optional scheduledOn = default; + bool unavailableForMatching = default; + Optional queueId = default; + Optional> labels = default; + Optional> tags = default; + Optional jobId = default; + Optional channelReference = default; + Optional channelId = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("priority"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + priority = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("expiredAttachedWorkerSelectors"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(AcsRouterWorkerSelector.DeserializeAcsRouterWorkerSelector(item)); + } + expiredAttachedWorkerSelectors = array; + continue; + } + if (property.NameEquals("expiredRequestedWorkerSelectors"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(AcsRouterWorkerSelector.DeserializeAcsRouterWorkerSelector(item)); + } + expiredRequestedWorkerSelectors = array; + continue; + } + if (property.NameEquals("scheduledOn"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + scheduledOn = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("unavailableForMatching"u8)) + { + unavailableForMatching = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("queueId"u8)) + { + queueId = property.Value.GetString(); + continue; + } + if (property.NameEquals("labels"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + labels = dictionary; + continue; + } + if (property.NameEquals("tags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + if (property.NameEquals("jobId"u8)) + { + jobId = property.Value.GetString(); + continue; + } + if (property.NameEquals("channelReference"u8)) + { + channelReference = property.Value.GetString(); + continue; + } + if (property.NameEquals("channelId"u8)) + { + channelId = property.Value.GetString(); + continue; + } + } + return new AcsRouterJobWaitingForActivationEventData(jobId.Value, channelReference.Value, channelId.Value, queueId.Value, Optional.ToDictionary(labels), Optional.ToDictionary(tags), Optional.ToNullable(priority), Optional.ToList(expiredAttachedWorkerSelectors), Optional.ToList(expiredRequestedWorkerSelectors), Optional.ToNullable(scheduledOn), unavailableForMatching); + } + + internal partial class AcsRouterJobWaitingForActivationEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, AcsRouterJobWaitingForActivationEventData model, JsonSerializerOptions options) + { + throw new NotImplementedException(); + } + public override AcsRouterJobWaitingForActivationEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeAcsRouterJobWaitingForActivationEventData(document.RootElement); + } + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterJobWaitingForActivationEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterJobWaitingForActivationEventData.cs new file mode 100644 index 0000000000000..464e97430c378 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterJobWaitingForActivationEventData.cs @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.RouterJobWaitingForActivation event. + public partial class AcsRouterJobWaitingForActivationEventData : AcsRouterJobEventData + { + /// Initializes a new instance of AcsRouterJobWaitingForActivationEventData. + /// Router Job Waiting For Activation Unavailable For Matching. + internal AcsRouterJobWaitingForActivationEventData(bool unavailableForMatching) + { + ExpiredAttachedWorkerSelectors = new ChangeTrackingList(); + ExpiredRequestedWorkerSelectors = new ChangeTrackingList(); + UnavailableForMatching = unavailableForMatching; + } + + /// Initializes a new instance of AcsRouterJobWaitingForActivationEventData. + /// Router Event Job ID. + /// Router Event Channel Reference. + /// Router Event Channel ID. + /// Router Job events Queue Id. + /// Router Job events Labels. + /// Router Jobs events Tags. + /// Router Job Waiting For Activation Priority. + /// Router Job Waiting For Activation Worker Selector Expired. + /// Router Job Waiting For Activation Requested Worker Selector Expired. + /// Router Job Waiting For Activation Scheduled Time in UTC. + /// Router Job Waiting For Activation Unavailable For Matching. + internal AcsRouterJobWaitingForActivationEventData(string jobId, string channelReference, string channelId, string queueId, IReadOnlyDictionary labels, IReadOnlyDictionary tags, int? priority, IReadOnlyList expiredAttachedWorkerSelectors, IReadOnlyList expiredRequestedWorkerSelectors, DateTimeOffset? scheduledOn, bool unavailableForMatching) : base(jobId, channelReference, channelId, queueId, labels, tags) + { + Priority = priority; + ExpiredAttachedWorkerSelectors = expiredAttachedWorkerSelectors; + ExpiredRequestedWorkerSelectors = expiredRequestedWorkerSelectors; + ScheduledOn = scheduledOn; + UnavailableForMatching = unavailableForMatching; + } + + /// Router Job Waiting For Activation Priority. + public int? Priority { get; } + /// Router Job Waiting For Activation Worker Selector Expired. + public IReadOnlyList ExpiredAttachedWorkerSelectors { get; } + /// Router Job Waiting For Activation Requested Worker Selector Expired. + public IReadOnlyList ExpiredRequestedWorkerSelectors { get; } + /// Router Job Waiting For Activation Scheduled Time in UTC. + public DateTimeOffset? ScheduledOn { get; } + /// Router Job Waiting For Activation Unavailable For Matching. + public bool UnavailableForMatching { get; } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterJobWorkerSelectorsExpiredEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterJobWorkerSelectorsExpiredEventData.Serialization.cs new file mode 100644 index 0000000000000..26847debd40e7 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterJobWorkerSelectorsExpiredEventData.Serialization.cs @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using System.Text.Json.Serialization; +using Azure.Core; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + [JsonConverter(typeof(AcsRouterJobWorkerSelectorsExpiredEventDataConverter))] + public partial class AcsRouterJobWorkerSelectorsExpiredEventData + { + internal static AcsRouterJobWorkerSelectorsExpiredEventData DeserializeAcsRouterJobWorkerSelectorsExpiredEventData(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional> expiredRequestedWorkerSelectors = default; + Optional> expiredAttachedWorkerSelectors = default; + Optional queueId = default; + Optional> labels = default; + Optional> tags = default; + Optional jobId = default; + Optional channelReference = default; + Optional channelId = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("expiredRequestedWorkerSelectors"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(AcsRouterWorkerSelector.DeserializeAcsRouterWorkerSelector(item)); + } + expiredRequestedWorkerSelectors = array; + continue; + } + if (property.NameEquals("expiredAttachedWorkerSelectors"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(AcsRouterWorkerSelector.DeserializeAcsRouterWorkerSelector(item)); + } + expiredAttachedWorkerSelectors = array; + continue; + } + if (property.NameEquals("queueId"u8)) + { + queueId = property.Value.GetString(); + continue; + } + if (property.NameEquals("labels"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + labels = dictionary; + continue; + } + if (property.NameEquals("tags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + if (property.NameEquals("jobId"u8)) + { + jobId = property.Value.GetString(); + continue; + } + if (property.NameEquals("channelReference"u8)) + { + channelReference = property.Value.GetString(); + continue; + } + if (property.NameEquals("channelId"u8)) + { + channelId = property.Value.GetString(); + continue; + } + } + return new AcsRouterJobWorkerSelectorsExpiredEventData(jobId.Value, channelReference.Value, channelId.Value, queueId.Value, Optional.ToDictionary(labels), Optional.ToDictionary(tags), Optional.ToList(expiredRequestedWorkerSelectors), Optional.ToList(expiredAttachedWorkerSelectors)); + } + + internal partial class AcsRouterJobWorkerSelectorsExpiredEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, AcsRouterJobWorkerSelectorsExpiredEventData model, JsonSerializerOptions options) + { + throw new NotImplementedException(); + } + public override AcsRouterJobWorkerSelectorsExpiredEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeAcsRouterJobWorkerSelectorsExpiredEventData(document.RootElement); + } + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterJobWorkerSelectorsExpiredEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterJobWorkerSelectorsExpiredEventData.cs new file mode 100644 index 0000000000000..bf81aac43af28 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterJobWorkerSelectorsExpiredEventData.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.RouterJobWorkerSelectorsExpired event. + public partial class AcsRouterJobWorkerSelectorsExpiredEventData : AcsRouterJobEventData + { + /// Initializes a new instance of AcsRouterJobWorkerSelectorsExpiredEventData. + internal AcsRouterJobWorkerSelectorsExpiredEventData() + { + ExpiredRequestedWorkerSelectors = new ChangeTrackingList(); + ExpiredAttachedWorkerSelectors = new ChangeTrackingList(); + } + + /// Initializes a new instance of AcsRouterJobWorkerSelectorsExpiredEventData. + /// Router Event Job ID. + /// Router Event Channel Reference. + /// Router Event Channel ID. + /// Router Job events Queue Id. + /// Router Job events Labels. + /// Router Jobs events Tags. + /// Router Job Worker Selectors Expired Requested Worker Selectors. + /// Router Job Worker Selectors Expired Attached Worker Selectors. + internal AcsRouterJobWorkerSelectorsExpiredEventData(string jobId, string channelReference, string channelId, string queueId, IReadOnlyDictionary labels, IReadOnlyDictionary tags, IReadOnlyList expiredRequestedWorkerSelectors, IReadOnlyList expiredAttachedWorkerSelectors) : base(jobId, channelReference, channelId, queueId, labels, tags) + { + ExpiredRequestedWorkerSelectors = expiredRequestedWorkerSelectors; + ExpiredAttachedWorkerSelectors = expiredAttachedWorkerSelectors; + } + + /// Router Job Worker Selectors Expired Requested Worker Selectors. + public IReadOnlyList ExpiredRequestedWorkerSelectors { get; } + /// Router Job Worker Selectors Expired Attached Worker Selectors. + public IReadOnlyList ExpiredAttachedWorkerSelectors { get; } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterLabelOperator.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterLabelOperator.cs new file mode 100644 index 0000000000000..d96162d8dd625 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterLabelOperator.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Messaging.EventGrid.Models +{ + /// Router Job Worker Selector Label Operator. + public readonly partial struct AcsRouterLabelOperator : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AcsRouterLabelOperator(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string EqualValue = "Equal"; + private const string NotEqualValue = "NotEqual"; + private const string GreaterValue = "Greater"; + private const string LessValue = "Less"; + private const string GreaterThanOrEqualValue = "GreaterThanOrEqual"; + private const string LessThanOrEqualValue = "LessThanOrEqual"; + + /// =. + public static AcsRouterLabelOperator Equal { get; } = new AcsRouterLabelOperator(EqualValue); + /// !=. + public static AcsRouterLabelOperator NotEqual { get; } = new AcsRouterLabelOperator(NotEqualValue); + /// >. + public static AcsRouterLabelOperator Greater { get; } = new AcsRouterLabelOperator(GreaterValue); + /// <. + public static AcsRouterLabelOperator Less { get; } = new AcsRouterLabelOperator(LessValue); + /// >=. + public static AcsRouterLabelOperator GreaterThanOrEqual { get; } = new AcsRouterLabelOperator(GreaterThanOrEqualValue); + /// <=. + public static AcsRouterLabelOperator LessThanOrEqual { get; } = new AcsRouterLabelOperator(LessThanOrEqualValue); + /// Determines if two values are the same. + public static bool operator ==(AcsRouterLabelOperator left, AcsRouterLabelOperator right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AcsRouterLabelOperator left, AcsRouterLabelOperator right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator AcsRouterLabelOperator(string value) => new AcsRouterLabelOperator(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AcsRouterLabelOperator other && Equals(other); + /// + public bool Equals(AcsRouterLabelOperator other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterQueueDetails.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterQueueDetails.Serialization.cs new file mode 100644 index 0000000000000..1abce516a03a2 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterQueueDetails.Serialization.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + public partial class AcsRouterQueueDetails + { + internal static AcsRouterQueueDetails DeserializeAcsRouterQueueDetails(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional id = default; + Optional name = default; + Optional> labels = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("labels"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + labels = dictionary; + continue; + } + } + return new AcsRouterQueueDetails(id.Value, name.Value, Optional.ToDictionary(labels)); + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterQueueDetails.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterQueueDetails.cs new file mode 100644 index 0000000000000..9c4f3ed83a028 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterQueueDetails.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + /// Router Queue Details. + public partial class AcsRouterQueueDetails + { + /// Initializes a new instance of AcsRouterQueueDetails. + internal AcsRouterQueueDetails() + { + Labels = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of AcsRouterQueueDetails. + /// Router Queue Id. + /// Router Queue Name. + /// Router Queue Labels. + internal AcsRouterQueueDetails(string id, string name, IReadOnlyDictionary labels) + { + Id = id; + Name = name; + Labels = labels; + } + + /// Router Queue Id. + public string Id { get; } + /// Router Queue Name. + public string Name { get; } + /// Router Queue Labels. + public IReadOnlyDictionary Labels { get; } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterWorkerDeletedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterWorkerDeletedEventData.Serialization.cs new file mode 100644 index 0000000000000..c8652cc7a95f9 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterWorkerDeletedEventData.Serialization.cs @@ -0,0 +1,67 @@ +// 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; +using Azure.Core; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + [JsonConverter(typeof(AcsRouterWorkerDeletedEventDataConverter))] + public partial class AcsRouterWorkerDeletedEventData + { + internal static AcsRouterWorkerDeletedEventData DeserializeAcsRouterWorkerDeletedEventData(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional workerId = default; + Optional jobId = default; + Optional channelReference = default; + Optional channelId = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("workerId"u8)) + { + workerId = property.Value.GetString(); + continue; + } + if (property.NameEquals("jobId"u8)) + { + jobId = property.Value.GetString(); + continue; + } + if (property.NameEquals("channelReference"u8)) + { + channelReference = property.Value.GetString(); + continue; + } + if (property.NameEquals("channelId"u8)) + { + channelId = property.Value.GetString(); + continue; + } + } + return new AcsRouterWorkerDeletedEventData(jobId.Value, channelReference.Value, channelId.Value, workerId.Value); + } + + internal partial class AcsRouterWorkerDeletedEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, AcsRouterWorkerDeletedEventData model, JsonSerializerOptions options) + { + throw new NotImplementedException(); + } + public override AcsRouterWorkerDeletedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeAcsRouterWorkerDeletedEventData(document.RootElement); + } + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterWorkerDeletedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterWorkerDeletedEventData.cs new file mode 100644 index 0000000000000..58a370b4c45ae --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterWorkerDeletedEventData.cs @@ -0,0 +1,27 @@ +// 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 EventGridEvent for a Microsoft.Communication.RouterWorkerDeleted event. + public partial class AcsRouterWorkerDeletedEventData : AcsRouterWorkerEventData + { + /// Initializes a new instance of AcsRouterWorkerDeletedEventData. + internal AcsRouterWorkerDeletedEventData() + { + } + + /// Initializes a new instance of AcsRouterWorkerDeletedEventData. + /// Router Event Job ID. + /// Router Event Channel Reference. + /// Router Event Channel ID. + /// Router Worker events Worker Id. + internal AcsRouterWorkerDeletedEventData(string jobId, string channelReference, string channelId, string workerId) : base(jobId, channelReference, channelId, workerId) + { + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterWorkerDeregisteredEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterWorkerDeregisteredEventData.Serialization.cs new file mode 100644 index 0000000000000..9b63f3dfb1e43 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterWorkerDeregisteredEventData.Serialization.cs @@ -0,0 +1,49 @@ +// 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; +using Azure.Core; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + [JsonConverter(typeof(AcsRouterWorkerDeregisteredEventDataConverter))] + public partial class AcsRouterWorkerDeregisteredEventData + { + internal static AcsRouterWorkerDeregisteredEventData DeserializeAcsRouterWorkerDeregisteredEventData(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional workerId = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("workerId"u8)) + { + workerId = property.Value.GetString(); + continue; + } + } + return new AcsRouterWorkerDeregisteredEventData(workerId.Value); + } + + internal partial class AcsRouterWorkerDeregisteredEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, AcsRouterWorkerDeregisteredEventData model, JsonSerializerOptions options) + { + throw new NotImplementedException(); + } + public override AcsRouterWorkerDeregisteredEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeAcsRouterWorkerDeregisteredEventData(document.RootElement); + } + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterWorkerDeregisteredEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterWorkerDeregisteredEventData.cs new file mode 100644 index 0000000000000..9db283f9bf673 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterWorkerDeregisteredEventData.cs @@ -0,0 +1,28 @@ +// 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 EventGridEvent for a Microsoft.Communication.RouterWorkerDeregistered event. + public partial class AcsRouterWorkerDeregisteredEventData + { + /// Initializes a new instance of AcsRouterWorkerDeregisteredEventData. + internal AcsRouterWorkerDeregisteredEventData() + { + } + + /// Initializes a new instance of AcsRouterWorkerDeregisteredEventData. + /// Router Worker Deregistered Worker Id. + internal AcsRouterWorkerDeregisteredEventData(string workerId) + { + WorkerId = workerId; + } + + /// Router Worker Deregistered Worker Id. + public string WorkerId { get; } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterWorkerEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterWorkerEventData.Serialization.cs new file mode 100644 index 0000000000000..5f8f9d3e28013 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterWorkerEventData.Serialization.cs @@ -0,0 +1,67 @@ +// 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; +using Azure.Core; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + [JsonConverter(typeof(AcsRouterWorkerEventDataConverter))] + public partial class AcsRouterWorkerEventData + { + internal static AcsRouterWorkerEventData DeserializeAcsRouterWorkerEventData(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional workerId = default; + Optional jobId = default; + Optional channelReference = default; + Optional channelId = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("workerId"u8)) + { + workerId = property.Value.GetString(); + continue; + } + if (property.NameEquals("jobId"u8)) + { + jobId = property.Value.GetString(); + continue; + } + if (property.NameEquals("channelReference"u8)) + { + channelReference = property.Value.GetString(); + continue; + } + if (property.NameEquals("channelId"u8)) + { + channelId = property.Value.GetString(); + continue; + } + } + return new AcsRouterWorkerEventData(jobId.Value, channelReference.Value, channelId.Value, workerId.Value); + } + + internal partial class AcsRouterWorkerEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, AcsRouterWorkerEventData model, JsonSerializerOptions options) + { + throw new NotImplementedException(); + } + public override AcsRouterWorkerEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeAcsRouterWorkerEventData(document.RootElement); + } + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterWorkerEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterWorkerEventData.cs new file mode 100644 index 0000000000000..c1f87ca9ab02c --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterWorkerEventData.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + /// Schema of common properties of all Router Worker events. + public partial class AcsRouterWorkerEventData : AcsRouterEventData + { + /// Initializes a new instance of AcsRouterWorkerEventData. + internal AcsRouterWorkerEventData() + { + } + + /// Initializes a new instance of AcsRouterWorkerEventData. + /// Router Event Job ID. + /// Router Event Channel Reference. + /// Router Event Channel ID. + /// Router Worker events Worker Id. + internal AcsRouterWorkerEventData(string jobId, string channelReference, string channelId, string workerId) : base(jobId, channelReference, channelId) + { + WorkerId = workerId; + } + + /// Router Worker events Worker Id. + public string WorkerId { get; } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterWorkerOfferAcceptedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterWorkerOfferAcceptedEventData.Serialization.cs new file mode 100644 index 0000000000000..0824739781f6a --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterWorkerOfferAcceptedEventData.Serialization.cs @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using System.Text.Json.Serialization; +using Azure.Core; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + [JsonConverter(typeof(AcsRouterWorkerOfferAcceptedEventDataConverter))] + public partial class AcsRouterWorkerOfferAcceptedEventData + { + internal static AcsRouterWorkerOfferAcceptedEventData DeserializeAcsRouterWorkerOfferAcceptedEventData(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional queueId = default; + Optional offerId = default; + Optional assignmentId = default; + Optional jobPriority = default; + Optional> workerLabels = default; + Optional> workerTags = default; + Optional> jobLabels = default; + Optional> jobTags = default; + Optional workerId = default; + Optional jobId = default; + Optional channelReference = default; + Optional channelId = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("queueId"u8)) + { + queueId = property.Value.GetString(); + continue; + } + if (property.NameEquals("offerId"u8)) + { + offerId = property.Value.GetString(); + continue; + } + if (property.NameEquals("assignmentId"u8)) + { + assignmentId = property.Value.GetString(); + continue; + } + if (property.NameEquals("jobPriority"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + jobPriority = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("workerLabels"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + workerLabels = dictionary; + continue; + } + if (property.NameEquals("workerTags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + workerTags = dictionary; + continue; + } + if (property.NameEquals("jobLabels"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + jobLabels = dictionary; + continue; + } + if (property.NameEquals("jobTags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + jobTags = dictionary; + continue; + } + if (property.NameEquals("workerId"u8)) + { + workerId = property.Value.GetString(); + continue; + } + if (property.NameEquals("jobId"u8)) + { + jobId = property.Value.GetString(); + continue; + } + if (property.NameEquals("channelReference"u8)) + { + channelReference = property.Value.GetString(); + continue; + } + if (property.NameEquals("channelId"u8)) + { + channelId = property.Value.GetString(); + continue; + } + } + return new AcsRouterWorkerOfferAcceptedEventData(jobId.Value, channelReference.Value, channelId.Value, workerId.Value, queueId.Value, offerId.Value, assignmentId.Value, Optional.ToNullable(jobPriority), Optional.ToDictionary(workerLabels), Optional.ToDictionary(workerTags), Optional.ToDictionary(jobLabels), Optional.ToDictionary(jobTags)); + } + + internal partial class AcsRouterWorkerOfferAcceptedEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, AcsRouterWorkerOfferAcceptedEventData model, JsonSerializerOptions options) + { + throw new NotImplementedException(); + } + public override AcsRouterWorkerOfferAcceptedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeAcsRouterWorkerOfferAcceptedEventData(document.RootElement); + } + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterWorkerOfferAcceptedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterWorkerOfferAcceptedEventData.cs new file mode 100644 index 0000000000000..d702d1264512b --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterWorkerOfferAcceptedEventData.cs @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.RouterWorkerOfferAccepted event. + public partial class AcsRouterWorkerOfferAcceptedEventData : AcsRouterWorkerEventData + { + /// Initializes a new instance of AcsRouterWorkerOfferAcceptedEventData. + internal AcsRouterWorkerOfferAcceptedEventData() + { + WorkerLabels = new ChangeTrackingDictionary(); + WorkerTags = new ChangeTrackingDictionary(); + JobLabels = new ChangeTrackingDictionary(); + JobTags = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of AcsRouterWorkerOfferAcceptedEventData. + /// Router Event Job ID. + /// Router Event Channel Reference. + /// Router Event Channel ID. + /// Router Worker events Worker Id. + /// Router Worker Offer Accepted Queue Id. + /// Router Worker Offer Accepted Offer Id. + /// Router Worker Offer Accepted Assignment Id. + /// Router Worker Offer Accepted Job Priority. + /// Router Worker Offer Accepted Worker Labels. + /// Router Worker Offer Accepted Worker Tags. + /// Router Worker Offer Accepted Job Labels. + /// Router Worker Offer Accepted Job Tags. + internal AcsRouterWorkerOfferAcceptedEventData(string jobId, string channelReference, string channelId, string workerId, string queueId, string offerId, string assignmentId, int? jobPriority, IReadOnlyDictionary workerLabels, IReadOnlyDictionary workerTags, IReadOnlyDictionary jobLabels, IReadOnlyDictionary jobTags) : base(jobId, channelReference, channelId, workerId) + { + QueueId = queueId; + OfferId = offerId; + AssignmentId = assignmentId; + JobPriority = jobPriority; + WorkerLabels = workerLabels; + WorkerTags = workerTags; + JobLabels = jobLabels; + JobTags = jobTags; + } + + /// Router Worker Offer Accepted Queue Id. + public string QueueId { get; } + /// Router Worker Offer Accepted Offer Id. + public string OfferId { get; } + /// Router Worker Offer Accepted Assignment Id. + public string AssignmentId { get; } + /// Router Worker Offer Accepted Job Priority. + public int? JobPriority { get; } + /// Router Worker Offer Accepted Worker Labels. + public IReadOnlyDictionary WorkerLabels { get; } + /// Router Worker Offer Accepted Worker Tags. + public IReadOnlyDictionary WorkerTags { get; } + /// Router Worker Offer Accepted Job Labels. + public IReadOnlyDictionary JobLabels { get; } + /// Router Worker Offer Accepted Job Tags. + public IReadOnlyDictionary JobTags { get; } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterWorkerOfferDeclinedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterWorkerOfferDeclinedEventData.Serialization.cs new file mode 100644 index 0000000000000..8af5dd7d02635 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterWorkerOfferDeclinedEventData.Serialization.cs @@ -0,0 +1,79 @@ +// 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; +using Azure.Core; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + [JsonConverter(typeof(AcsRouterWorkerOfferDeclinedEventDataConverter))] + public partial class AcsRouterWorkerOfferDeclinedEventData + { + internal static AcsRouterWorkerOfferDeclinedEventData DeserializeAcsRouterWorkerOfferDeclinedEventData(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional queueId = default; + Optional offerId = default; + Optional workerId = default; + Optional jobId = default; + Optional channelReference = default; + Optional channelId = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("queueId"u8)) + { + queueId = property.Value.GetString(); + continue; + } + if (property.NameEquals("offerId"u8)) + { + offerId = property.Value.GetString(); + continue; + } + if (property.NameEquals("workerId"u8)) + { + workerId = property.Value.GetString(); + continue; + } + if (property.NameEquals("jobId"u8)) + { + jobId = property.Value.GetString(); + continue; + } + if (property.NameEquals("channelReference"u8)) + { + channelReference = property.Value.GetString(); + continue; + } + if (property.NameEquals("channelId"u8)) + { + channelId = property.Value.GetString(); + continue; + } + } + return new AcsRouterWorkerOfferDeclinedEventData(jobId.Value, channelReference.Value, channelId.Value, workerId.Value, queueId.Value, offerId.Value); + } + + internal partial class AcsRouterWorkerOfferDeclinedEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, AcsRouterWorkerOfferDeclinedEventData model, JsonSerializerOptions options) + { + throw new NotImplementedException(); + } + public override AcsRouterWorkerOfferDeclinedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeAcsRouterWorkerOfferDeclinedEventData(document.RootElement); + } + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterWorkerOfferDeclinedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterWorkerOfferDeclinedEventData.cs new file mode 100644 index 0000000000000..d8f3ac9e2a28a --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterWorkerOfferDeclinedEventData.cs @@ -0,0 +1,36 @@ +// 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 EventGridEvent for a Microsoft.Communication.RouterWorkerOfferDeclined event. + public partial class AcsRouterWorkerOfferDeclinedEventData : AcsRouterWorkerEventData + { + /// Initializes a new instance of AcsRouterWorkerOfferDeclinedEventData. + internal AcsRouterWorkerOfferDeclinedEventData() + { + } + + /// Initializes a new instance of AcsRouterWorkerOfferDeclinedEventData. + /// Router Event Job ID. + /// Router Event Channel Reference. + /// Router Event Channel ID. + /// Router Worker events Worker Id. + /// Router Worker Offer Declined Queue Id. + /// Router Worker Offer Declined Offer Id. + internal AcsRouterWorkerOfferDeclinedEventData(string jobId, string channelReference, string channelId, string workerId, string queueId, string offerId) : base(jobId, channelReference, channelId, workerId) + { + QueueId = queueId; + OfferId = offerId; + } + + /// Router Worker Offer Declined Queue Id. + public string QueueId { get; } + /// Router Worker Offer Declined Offer Id. + public string OfferId { get; } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterWorkerOfferExpiredEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterWorkerOfferExpiredEventData.Serialization.cs new file mode 100644 index 0000000000000..8b34dfefcf547 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterWorkerOfferExpiredEventData.Serialization.cs @@ -0,0 +1,79 @@ +// 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; +using Azure.Core; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + [JsonConverter(typeof(AcsRouterWorkerOfferExpiredEventDataConverter))] + public partial class AcsRouterWorkerOfferExpiredEventData + { + internal static AcsRouterWorkerOfferExpiredEventData DeserializeAcsRouterWorkerOfferExpiredEventData(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional queueId = default; + Optional offerId = default; + Optional workerId = default; + Optional jobId = default; + Optional channelReference = default; + Optional channelId = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("queueId"u8)) + { + queueId = property.Value.GetString(); + continue; + } + if (property.NameEquals("offerId"u8)) + { + offerId = property.Value.GetString(); + continue; + } + if (property.NameEquals("workerId"u8)) + { + workerId = property.Value.GetString(); + continue; + } + if (property.NameEquals("jobId"u8)) + { + jobId = property.Value.GetString(); + continue; + } + if (property.NameEquals("channelReference"u8)) + { + channelReference = property.Value.GetString(); + continue; + } + if (property.NameEquals("channelId"u8)) + { + channelId = property.Value.GetString(); + continue; + } + } + return new AcsRouterWorkerOfferExpiredEventData(jobId.Value, channelReference.Value, channelId.Value, workerId.Value, queueId.Value, offerId.Value); + } + + internal partial class AcsRouterWorkerOfferExpiredEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, AcsRouterWorkerOfferExpiredEventData model, JsonSerializerOptions options) + { + throw new NotImplementedException(); + } + public override AcsRouterWorkerOfferExpiredEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeAcsRouterWorkerOfferExpiredEventData(document.RootElement); + } + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterWorkerOfferExpiredEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterWorkerOfferExpiredEventData.cs new file mode 100644 index 0000000000000..ac66b6d370967 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterWorkerOfferExpiredEventData.cs @@ -0,0 +1,36 @@ +// 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 EventGridEvent for a Microsoft.Communication.RouterWorkerOfferExpired event. + public partial class AcsRouterWorkerOfferExpiredEventData : AcsRouterWorkerEventData + { + /// Initializes a new instance of AcsRouterWorkerOfferExpiredEventData. + internal AcsRouterWorkerOfferExpiredEventData() + { + } + + /// Initializes a new instance of AcsRouterWorkerOfferExpiredEventData. + /// Router Event Job ID. + /// Router Event Channel Reference. + /// Router Event Channel ID. + /// Router Worker events Worker Id. + /// Router Worker Offer Expired Queue Id. + /// Router Worker Offer Expired Offer Id. + internal AcsRouterWorkerOfferExpiredEventData(string jobId, string channelReference, string channelId, string workerId, string queueId, string offerId) : base(jobId, channelReference, channelId, workerId) + { + QueueId = queueId; + OfferId = offerId; + } + + /// Router Worker Offer Expired Queue Id. + public string QueueId { get; } + /// Router Worker Offer Expired Offer Id. + public string OfferId { get; } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterWorkerOfferIssuedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterWorkerOfferIssuedEventData.Serialization.cs new file mode 100644 index 0000000000000..16db995bb9d90 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterWorkerOfferIssuedEventData.Serialization.cs @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using System.Text.Json.Serialization; +using Azure.Core; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + [JsonConverter(typeof(AcsRouterWorkerOfferIssuedEventDataConverter))] + public partial class AcsRouterWorkerOfferIssuedEventData + { + internal static AcsRouterWorkerOfferIssuedEventData DeserializeAcsRouterWorkerOfferIssuedEventData(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional queueId = default; + Optional offerId = default; + Optional jobPriority = default; + Optional> workerLabels = default; + Optional offeredOn = default; + Optional expiresOn = default; + Optional> workerTags = default; + Optional> jobLabels = default; + Optional> jobTags = default; + Optional workerId = default; + Optional jobId = default; + Optional channelReference = default; + Optional channelId = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("queueId"u8)) + { + queueId = property.Value.GetString(); + continue; + } + if (property.NameEquals("offerId"u8)) + { + offerId = property.Value.GetString(); + continue; + } + if (property.NameEquals("jobPriority"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + jobPriority = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("workerLabels"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + workerLabels = dictionary; + continue; + } + if (property.NameEquals("offeredOn"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + offeredOn = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("expiresOn"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + expiresOn = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("workerTags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + workerTags = dictionary; + continue; + } + if (property.NameEquals("jobLabels"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + jobLabels = dictionary; + continue; + } + if (property.NameEquals("jobTags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + jobTags = dictionary; + continue; + } + if (property.NameEquals("workerId"u8)) + { + workerId = property.Value.GetString(); + continue; + } + if (property.NameEquals("jobId"u8)) + { + jobId = property.Value.GetString(); + continue; + } + if (property.NameEquals("channelReference"u8)) + { + channelReference = property.Value.GetString(); + continue; + } + if (property.NameEquals("channelId"u8)) + { + channelId = property.Value.GetString(); + continue; + } + } + return new AcsRouterWorkerOfferIssuedEventData(jobId.Value, channelReference.Value, channelId.Value, workerId.Value, queueId.Value, offerId.Value, Optional.ToNullable(jobPriority), Optional.ToDictionary(workerLabels), Optional.ToNullable(offeredOn), Optional.ToNullable(expiresOn), Optional.ToDictionary(workerTags), Optional.ToDictionary(jobLabels), Optional.ToDictionary(jobTags)); + } + + internal partial class AcsRouterWorkerOfferIssuedEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, AcsRouterWorkerOfferIssuedEventData model, JsonSerializerOptions options) + { + throw new NotImplementedException(); + } + public override AcsRouterWorkerOfferIssuedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeAcsRouterWorkerOfferIssuedEventData(document.RootElement); + } + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterWorkerOfferIssuedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterWorkerOfferIssuedEventData.cs new file mode 100644 index 0000000000000..80870a608e5cf --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterWorkerOfferIssuedEventData.cs @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.RouterWorkerOfferIssued event. + public partial class AcsRouterWorkerOfferIssuedEventData : AcsRouterWorkerEventData + { + /// Initializes a new instance of AcsRouterWorkerOfferIssuedEventData. + internal AcsRouterWorkerOfferIssuedEventData() + { + WorkerLabels = new ChangeTrackingDictionary(); + WorkerTags = new ChangeTrackingDictionary(); + JobLabels = new ChangeTrackingDictionary(); + JobTags = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of AcsRouterWorkerOfferIssuedEventData. + /// Router Event Job ID. + /// Router Event Channel Reference. + /// Router Event Channel ID. + /// Router Worker events Worker Id. + /// Router Worker Offer Issued Queue Id. + /// Router Worker Offer Issued Offer Id. + /// Router Worker Offer Issued Job Priority. + /// Router Worker Offer Issued Worker Labels. + /// Router Worker Offer Issued Time in UTC. + /// Router Worker Offer Issued Expiration Time in UTC. + /// Router Worker Offer Issued Worker Tags. + /// Router Worker Offer Issued Job Labels. + /// Router Worker Offer Issued Job Tags. + internal AcsRouterWorkerOfferIssuedEventData(string jobId, string channelReference, string channelId, string workerId, string queueId, string offerId, int? jobPriority, IReadOnlyDictionary workerLabels, DateTimeOffset? offeredOn, DateTimeOffset? expiresOn, IReadOnlyDictionary workerTags, IReadOnlyDictionary jobLabels, IReadOnlyDictionary jobTags) : base(jobId, channelReference, channelId, workerId) + { + QueueId = queueId; + OfferId = offerId; + JobPriority = jobPriority; + WorkerLabels = workerLabels; + OfferedOn = offeredOn; + ExpiresOn = expiresOn; + WorkerTags = workerTags; + JobLabels = jobLabels; + JobTags = jobTags; + } + + /// Router Worker Offer Issued Queue Id. + public string QueueId { get; } + /// Router Worker Offer Issued Offer Id. + public string OfferId { get; } + /// Router Worker Offer Issued Job Priority. + public int? JobPriority { get; } + /// Router Worker Offer Issued Worker Labels. + public IReadOnlyDictionary WorkerLabels { get; } + /// Router Worker Offer Issued Time in UTC. + public DateTimeOffset? OfferedOn { get; } + /// Router Worker Offer Issued Expiration Time in UTC. + public DateTimeOffset? ExpiresOn { get; } + /// Router Worker Offer Issued Worker Tags. + public IReadOnlyDictionary WorkerTags { get; } + /// Router Worker Offer Issued Job Labels. + public IReadOnlyDictionary JobLabels { get; } + /// Router Worker Offer Issued Job Tags. + public IReadOnlyDictionary JobTags { get; } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterWorkerOfferRevokedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterWorkerOfferRevokedEventData.Serialization.cs new file mode 100644 index 0000000000000..50dcd0ca4bc0e --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterWorkerOfferRevokedEventData.Serialization.cs @@ -0,0 +1,79 @@ +// 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; +using Azure.Core; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + [JsonConverter(typeof(AcsRouterWorkerOfferRevokedEventDataConverter))] + public partial class AcsRouterWorkerOfferRevokedEventData + { + internal static AcsRouterWorkerOfferRevokedEventData DeserializeAcsRouterWorkerOfferRevokedEventData(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional queueId = default; + Optional offerId = default; + Optional workerId = default; + Optional jobId = default; + Optional channelReference = default; + Optional channelId = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("queueId"u8)) + { + queueId = property.Value.GetString(); + continue; + } + if (property.NameEquals("offerId"u8)) + { + offerId = property.Value.GetString(); + continue; + } + if (property.NameEquals("workerId"u8)) + { + workerId = property.Value.GetString(); + continue; + } + if (property.NameEquals("jobId"u8)) + { + jobId = property.Value.GetString(); + continue; + } + if (property.NameEquals("channelReference"u8)) + { + channelReference = property.Value.GetString(); + continue; + } + if (property.NameEquals("channelId"u8)) + { + channelId = property.Value.GetString(); + continue; + } + } + return new AcsRouterWorkerOfferRevokedEventData(jobId.Value, channelReference.Value, channelId.Value, workerId.Value, queueId.Value, offerId.Value); + } + + internal partial class AcsRouterWorkerOfferRevokedEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, AcsRouterWorkerOfferRevokedEventData model, JsonSerializerOptions options) + { + throw new NotImplementedException(); + } + public override AcsRouterWorkerOfferRevokedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeAcsRouterWorkerOfferRevokedEventData(document.RootElement); + } + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterWorkerOfferRevokedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterWorkerOfferRevokedEventData.cs new file mode 100644 index 0000000000000..12bde5d2a6ef3 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterWorkerOfferRevokedEventData.cs @@ -0,0 +1,36 @@ +// 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 EventGridEvent for a Microsoft.Communication.RouterWorkerOfferRevoked event. + public partial class AcsRouterWorkerOfferRevokedEventData : AcsRouterWorkerEventData + { + /// Initializes a new instance of AcsRouterWorkerOfferRevokedEventData. + internal AcsRouterWorkerOfferRevokedEventData() + { + } + + /// Initializes a new instance of AcsRouterWorkerOfferRevokedEventData. + /// Router Event Job ID. + /// Router Event Channel Reference. + /// Router Event Channel ID. + /// Router Worker events Worker Id. + /// Router Worker Offer Revoked Queue Id. + /// Router Worker Offer Revoked Offer Id. + internal AcsRouterWorkerOfferRevokedEventData(string jobId, string channelReference, string channelId, string workerId, string queueId, string offerId) : base(jobId, channelReference, channelId, workerId) + { + QueueId = queueId; + OfferId = offerId; + } + + /// Router Worker Offer Revoked Queue Id. + public string QueueId { get; } + /// Router Worker Offer Revoked Offer Id. + public string OfferId { get; } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterWorkerRegisteredEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterWorkerRegisteredEventData.Serialization.cs new file mode 100644 index 0000000000000..030a4a63d0447 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterWorkerRegisteredEventData.Serialization.cs @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using System.Text.Json.Serialization; +using Azure.Core; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + [JsonConverter(typeof(AcsRouterWorkerRegisteredEventDataConverter))] + public partial class AcsRouterWorkerRegisteredEventData + { + internal static AcsRouterWorkerRegisteredEventData DeserializeAcsRouterWorkerRegisteredEventData(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional workerId = default; + Optional> queueAssignments = default; + Optional> channelConfigurations = default; + Optional totalCapacity = default; + Optional> labels = default; + Optional> tags = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("workerId"u8)) + { + workerId = property.Value.GetString(); + continue; + } + if (property.NameEquals("queueAssignments"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(AcsRouterQueueDetails.DeserializeAcsRouterQueueDetails(item)); + } + queueAssignments = array; + continue; + } + if (property.NameEquals("channelConfigurations"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(AcsRouterChannelConfiguration.DeserializeAcsRouterChannelConfiguration(item)); + } + channelConfigurations = array; + continue; + } + if (property.NameEquals("totalCapacity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + totalCapacity = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("labels"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + labels = dictionary; + continue; + } + if (property.NameEquals("tags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + } + return new AcsRouterWorkerRegisteredEventData(workerId.Value, Optional.ToList(queueAssignments), Optional.ToList(channelConfigurations), Optional.ToNullable(totalCapacity), Optional.ToDictionary(labels), Optional.ToDictionary(tags)); + } + + internal partial class AcsRouterWorkerRegisteredEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, AcsRouterWorkerRegisteredEventData model, JsonSerializerOptions options) + { + throw new NotImplementedException(); + } + public override AcsRouterWorkerRegisteredEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeAcsRouterWorkerRegisteredEventData(document.RootElement); + } + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterWorkerRegisteredEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterWorkerRegisteredEventData.cs new file mode 100644 index 0000000000000..138eea6592014 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterWorkerRegisteredEventData.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + /// Schema of the Data property of an EventGridEvent for a Microsoft.Communication.RouterWorkerRegistered event. + public partial class AcsRouterWorkerRegisteredEventData + { + /// Initializes a new instance of AcsRouterWorkerRegisteredEventData. + internal AcsRouterWorkerRegisteredEventData() + { + QueueAssignments = new ChangeTrackingList(); + ChannelConfigurations = new ChangeTrackingList(); + Labels = new ChangeTrackingDictionary(); + Tags = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of AcsRouterWorkerRegisteredEventData. + /// Router Worker Registered Worker Id. + /// Router Worker Registered Queue Info. + /// Router Worker Registered Channel Configuration. + /// Router Worker Register Total Capacity. + /// Router Worker Registered Labels. + /// Router Worker Registered Tags. + internal AcsRouterWorkerRegisteredEventData(string workerId, IReadOnlyList queueAssignments, IReadOnlyList channelConfigurations, int? totalCapacity, IReadOnlyDictionary labels, IReadOnlyDictionary tags) + { + WorkerId = workerId; + QueueAssignments = queueAssignments; + ChannelConfigurations = channelConfigurations; + TotalCapacity = totalCapacity; + Labels = labels; + Tags = tags; + } + + /// Router Worker Registered Worker Id. + public string WorkerId { get; } + /// Router Worker Registered Queue Info. + public IReadOnlyList QueueAssignments { get; } + /// Router Worker Registered Channel Configuration. + public IReadOnlyList ChannelConfigurations { get; } + /// Router Worker Register Total Capacity. + public int? TotalCapacity { get; } + /// Router Worker Registered Labels. + public IReadOnlyDictionary Labels { get; } + /// Router Worker Registered Tags. + public IReadOnlyDictionary Tags { get; } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterWorkerSelector.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterWorkerSelector.Serialization.cs new file mode 100644 index 0000000000000..e34099632404b --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterWorkerSelector.Serialization.cs @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using Azure.Core; +using Azure.Messaging.EventGrid.Models; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + public partial class AcsRouterWorkerSelector + { + internal static AcsRouterWorkerSelector DeserializeAcsRouterWorkerSelector(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional key = default; + Optional labelOperator = default; + Optional labelValue = default; + Optional ttlSeconds = default; + Optional state = default; + Optional expirationTime = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("key"u8)) + { + key = property.Value.GetString(); + continue; + } + if (property.NameEquals("labelOperator"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + labelOperator = new AcsRouterLabelOperator(property.Value.GetString()); + continue; + } + if (property.NameEquals("labelValue"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + labelValue = property.Value.GetObject(); + continue; + } + if (property.NameEquals("ttlSeconds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + ttlSeconds = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("state"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + state = new AcsRouterWorkerSelectorState(property.Value.GetString()); + continue; + } + if (property.NameEquals("expirationTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + expirationTime = property.Value.GetDateTimeOffset("O"); + continue; + } + } + return new AcsRouterWorkerSelector(key.Value, Optional.ToNullable(labelOperator), labelValue.Value, Optional.ToNullable(ttlSeconds), Optional.ToNullable(state), Optional.ToNullable(expirationTime)); + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterWorkerSelector.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterWorkerSelector.cs new file mode 100644 index 0000000000000..463205d1f9c3a --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterWorkerSelector.cs @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Messaging.EventGrid.Models; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + /// Router Job Worker Selector. + public partial class AcsRouterWorkerSelector + { + /// Initializes a new instance of AcsRouterWorkerSelector. + internal AcsRouterWorkerSelector() + { + } + + /// Initializes a new instance of AcsRouterWorkerSelector. + /// Router Job Worker Selector Key. + /// Router Job Worker Selector Label Operator. + /// Router Job Worker Selector Value. + /// Router Job Worker Selector Time to Live in Seconds. + /// Router Job Worker Selector State. + /// Router Job Worker Selector Expiration Time. + internal AcsRouterWorkerSelector(string key, AcsRouterLabelOperator? labelOperator, object labelValue, float? ttlSeconds, AcsRouterWorkerSelectorState? state, DateTimeOffset? expirationTime) + { + Key = key; + LabelOperator = labelOperator; + LabelValue = labelValue; + TtlSeconds = ttlSeconds; + State = state; + ExpirationTime = expirationTime; + } + + /// Router Job Worker Selector Key. + public string Key { get; } + /// Router Job Worker Selector Label Operator. + public AcsRouterLabelOperator? LabelOperator { get; } + /// Router Job Worker Selector Value. + public object LabelValue { get; } + /// Router Job Worker Selector State. + public AcsRouterWorkerSelectorState? State { get; } + /// Router Job Worker Selector Expiration Time. + public DateTimeOffset? ExpirationTime { get; } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterWorkerSelectorState.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterWorkerSelectorState.cs new file mode 100644 index 0000000000000..31d73348c3390 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsRouterWorkerSelectorState.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Messaging.EventGrid.Models +{ + /// Router Job Worker Selector State. + public readonly partial struct AcsRouterWorkerSelectorState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AcsRouterWorkerSelectorState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ActiveValue = "active"; + private const string ExpiredValue = "expired"; + + /// Router Job Worker Selector is Active. + public static AcsRouterWorkerSelectorState Active { get; } = new AcsRouterWorkerSelectorState(ActiveValue); + /// Router Job Worker Selector has Expire. + public static AcsRouterWorkerSelectorState Expired { get; } = new AcsRouterWorkerSelectorState(ExpiredValue); + /// Determines if two values are the same. + public static bool operator ==(AcsRouterWorkerSelectorState left, AcsRouterWorkerSelectorState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AcsRouterWorkerSelectorState left, AcsRouterWorkerSelectorState right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator AcsRouterWorkerSelectorState(string value) => new AcsRouterWorkerSelectorState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AcsRouterWorkerSelectorState other && Equals(other); + /// + public bool Equals(AcsRouterWorkerSelectorState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ResourceNotificationsHealthResourcesAnnotatedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ResourceNotificationsHealthResourcesAnnotatedEventData.Serialization.cs new file mode 100644 index 0000000000000..913413a370f42 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ResourceNotificationsHealthResourcesAnnotatedEventData.Serialization.cs @@ -0,0 +1,69 @@ +// 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; +using Azure.Core; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + [JsonConverter(typeof(ResourceNotificationsHealthResourcesAnnotatedEventDataConverter))] + public partial class ResourceNotificationsHealthResourcesAnnotatedEventData + { + internal static ResourceNotificationsHealthResourcesAnnotatedEventData DeserializeResourceNotificationsHealthResourcesAnnotatedEventData(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional resourceInfo = default; + Optional operationalInfo = default; + Optional 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 ResourceNotificationsHealthResourcesAnnotatedEventData(resourceInfo.Value, operationalInfo.Value, apiVersion.Value); + } + + internal partial class ResourceNotificationsHealthResourcesAnnotatedEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, ResourceNotificationsHealthResourcesAnnotatedEventData model, JsonSerializerOptions options) + { + throw new NotImplementedException(); + } + public override ResourceNotificationsHealthResourcesAnnotatedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeResourceNotificationsHealthResourcesAnnotatedEventData(document.RootElement); + } + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ResourceNotificationsHealthResourcesAnnotatedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ResourceNotificationsHealthResourcesAnnotatedEventData.cs new file mode 100644 index 0000000000000..764ee4c4923d5 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ResourceNotificationsHealthResourcesAnnotatedEventData.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 EventGridEvent for a Microsoft.ResourceNotifications.HealthResources.ResourceAnnotated event. + public partial class ResourceNotificationsHealthResourcesAnnotatedEventData : ResourceNotificationsResourceUpdatedEventData + { + /// Initializes a new instance of ResourceNotificationsHealthResourcesAnnotatedEventData. + internal ResourceNotificationsHealthResourcesAnnotatedEventData() + { + } + + /// Initializes a new instance of ResourceNotificationsHealthResourcesAnnotatedEventData. + /// resourceInfo details for update event. + /// details about operational info. + /// api version of the resource properties bag. + internal ResourceNotificationsHealthResourcesAnnotatedEventData(ResourceNotificationsResourceUpdatedDetails resourceDetails, ResourceNotificationsOperationalDetails operationalDetails, string apiVersion) : base(resourceDetails, operationalDetails, apiVersion) + { + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ResourceNotificationsHealthResourcesAvailabilityStatusChangedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ResourceNotificationsHealthResourcesAvailabilityStatusChangedEventData.Serialization.cs new file mode 100644 index 0000000000000..10306793903e1 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ResourceNotificationsHealthResourcesAvailabilityStatusChangedEventData.Serialization.cs @@ -0,0 +1,69 @@ +// 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; +using Azure.Core; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + [JsonConverter(typeof(ResourceNotificationsHealthResourcesAvailabilityStatusChangedEventDataConverter))] + public partial class ResourceNotificationsHealthResourcesAvailabilityStatusChangedEventData + { + internal static ResourceNotificationsHealthResourcesAvailabilityStatusChangedEventData DeserializeResourceNotificationsHealthResourcesAvailabilityStatusChangedEventData(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional resourceInfo = default; + Optional operationalInfo = default; + Optional 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 ResourceNotificationsHealthResourcesAvailabilityStatusChangedEventData(resourceInfo.Value, operationalInfo.Value, apiVersion.Value); + } + + internal partial class ResourceNotificationsHealthResourcesAvailabilityStatusChangedEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, ResourceNotificationsHealthResourcesAvailabilityStatusChangedEventData model, JsonSerializerOptions options) + { + throw new NotImplementedException(); + } + public override ResourceNotificationsHealthResourcesAvailabilityStatusChangedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeResourceNotificationsHealthResourcesAvailabilityStatusChangedEventData(document.RootElement); + } + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ResourceNotificationsHealthResourcesAvailabilityStatusChangedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ResourceNotificationsHealthResourcesAvailabilityStatusChangedEventData.cs new file mode 100644 index 0000000000000..d1625882da631 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ResourceNotificationsHealthResourcesAvailabilityStatusChangedEventData.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 EventGridEvent for a Microsoft.ResourceNotifications.HealthResources.AvailabilityStatusChanged event. + public partial class ResourceNotificationsHealthResourcesAvailabilityStatusChangedEventData : ResourceNotificationsResourceUpdatedEventData + { + /// Initializes a new instance of ResourceNotificationsHealthResourcesAvailabilityStatusChangedEventData. + internal ResourceNotificationsHealthResourcesAvailabilityStatusChangedEventData() + { + } + + /// Initializes a new instance of ResourceNotificationsHealthResourcesAvailabilityStatusChangedEventData. + /// resourceInfo details for update event. + /// details about operational info. + /// api version of the resource properties bag. + internal ResourceNotificationsHealthResourcesAvailabilityStatusChangedEventData(ResourceNotificationsResourceUpdatedDetails resourceDetails, ResourceNotificationsOperationalDetails operationalDetails, string apiVersion) : base(resourceDetails, operationalDetails, apiVersion) + { + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ResourceNotificationsOperationalDetails.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ResourceNotificationsOperationalDetails.Serialization.cs new file mode 100644 index 0000000000000..839ccc0fdfe8f --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ResourceNotificationsOperationalDetails.Serialization.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + public partial class ResourceNotificationsOperationalDetails + { + internal static ResourceNotificationsOperationalDetails DeserializeResourceNotificationsOperationalDetails(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional resourceEventTime = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("resourceEventTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + resourceEventTime = property.Value.GetDateTimeOffset("O"); + continue; + } + } + return new ResourceNotificationsOperationalDetails(Optional.ToNullable(resourceEventTime)); + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ResourceNotificationsOperationalDetails.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ResourceNotificationsOperationalDetails.cs new file mode 100644 index 0000000000000..097cfac13bfab --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ResourceNotificationsOperationalDetails.cs @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + /// details of operational info. + public partial class ResourceNotificationsOperationalDetails + { + /// Initializes a new instance of ResourceNotificationsOperationalDetails. + internal ResourceNotificationsOperationalDetails() + { + } + + /// Initializes a new instance of ResourceNotificationsOperationalDetails. + /// Date and Time when resource was updated. + internal ResourceNotificationsOperationalDetails(DateTimeOffset? resourceEventTime) + { + ResourceEventTime = resourceEventTime; + } + + /// Date and Time when resource was updated. + public DateTimeOffset? ResourceEventTime { get; } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ResourceNotificationsResourceUpdatedDetails.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ResourceNotificationsResourceUpdatedDetails.Serialization.cs new file mode 100644 index 0000000000000..dbb22f1a2a785 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ResourceNotificationsResourceUpdatedDetails.Serialization.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + public partial class ResourceNotificationsResourceUpdatedDetails + { + internal static ResourceNotificationsResourceUpdatedDetails DeserializeResourceNotificationsResourceUpdatedDetails(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional id = default; + Optional name = default; + Optional type = default; + Optional location = default; + Optional tags = default; + Optional> properties = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("location"u8)) + { + location = property.Value.GetString(); + continue; + } + if (property.NameEquals("tags"u8)) + { + tags = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + dictionary.Add(property0.Name, null); + } + else + { + dictionary.Add(property0.Name, property0.Value.GetObject()); + } + } + properties = dictionary; + continue; + } + } + return new ResourceNotificationsResourceUpdatedDetails(id.Value, name.Value, type.Value, location.Value, tags.Value, Optional.ToDictionary(properties)); + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ResourceNotificationsResourceUpdatedDetails.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ResourceNotificationsResourceUpdatedDetails.cs new file mode 100644 index 0000000000000..fb5f2be7f951a --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ResourceNotificationsResourceUpdatedDetails.cs @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + /// Describes the schema of the properties under resource info which are common across all ARN system topic events. + public partial class ResourceNotificationsResourceUpdatedDetails + { + /// Initializes a new instance of ResourceNotificationsResourceUpdatedDetails. + internal ResourceNotificationsResourceUpdatedDetails() + { + Properties = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of ResourceNotificationsResourceUpdatedDetails. + /// id of the resource for which the event is being emitted. + /// name of the resource for which the event is being emitted. + /// the type of the resource for which the event is being emitted. + /// the location of the resource for which the event is being emitted. + /// the tags on the resource for which the event is being emitted. + /// properties in the payload of the resource for which the event is being emitted. + internal ResourceNotificationsResourceUpdatedDetails(string id, string name, string type, string location, string tags, IReadOnlyDictionary properties) + { + Id = id; + Name = name; + Type = type; + Location = location; + Tags = tags; + Properties = properties; + } + + /// id of the resource for which the event is being emitted. + public string Id { get; } + /// name of the resource for which the event is being emitted. + public string Name { get; } + /// the type of the resource for which the event is being emitted. + public string Type { get; } + /// the location of the resource for which the event is being emitted. + public string Location { get; } + /// the tags on the resource for which the event is being emitted. + public string Tags { get; } + /// properties in the payload of the resource for which the event is being emitted. + public IReadOnlyDictionary Properties { get; } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ResourceNotificationsResourceUpdatedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ResourceNotificationsResourceUpdatedEventData.Serialization.cs new file mode 100644 index 0000000000000..70a72e8e8d5e6 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ResourceNotificationsResourceUpdatedEventData.Serialization.cs @@ -0,0 +1,69 @@ +// 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; +using Azure.Core; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + [JsonConverter(typeof(ResourceNotificationsResourceUpdatedEventDataConverter))] + public partial class ResourceNotificationsResourceUpdatedEventData + { + internal static ResourceNotificationsResourceUpdatedEventData DeserializeResourceNotificationsResourceUpdatedEventData(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional resourceInfo = default; + Optional operationalInfo = default; + Optional 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 ResourceNotificationsResourceUpdatedEventData(resourceInfo.Value, operationalInfo.Value, apiVersion.Value); + } + + internal partial class ResourceNotificationsResourceUpdatedEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, ResourceNotificationsResourceUpdatedEventData model, JsonSerializerOptions options) + { + throw new NotImplementedException(); + } + public override ResourceNotificationsResourceUpdatedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeResourceNotificationsResourceUpdatedEventData(document.RootElement); + } + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ResourceNotificationsResourceUpdatedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ResourceNotificationsResourceUpdatedEventData.cs new file mode 100644 index 0000000000000..eb1694603fc04 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/ResourceNotificationsResourceUpdatedEventData.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + /// Describes the schema of the common properties across all ARN system topic events. + public partial class ResourceNotificationsResourceUpdatedEventData + { + /// Initializes a new instance of ResourceNotificationsResourceUpdatedEventData. + internal ResourceNotificationsResourceUpdatedEventData() + { + } + + /// Initializes a new instance of ResourceNotificationsResourceUpdatedEventData. + /// resourceInfo details for update event. + /// details about operational info. + /// api version of the resource properties bag. + internal ResourceNotificationsResourceUpdatedEventData(ResourceNotificationsResourceUpdatedDetails resourceDetails, ResourceNotificationsOperationalDetails operationalDetails, string apiVersion) + { + ResourceDetails = resourceDetails; + OperationalDetails = operationalDetails; + ApiVersion = apiVersion; + } + + /// resourceInfo details for update event. + public ResourceNotificationsResourceUpdatedDetails ResourceDetails { get; } + /// details about operational info. + public ResourceNotificationsOperationalDetails OperationalDetails { get; } + /// api version of the resource properties bag. + public string ApiVersion { get; } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/autorest.md b/sdk/eventgrid/Azure.Messaging.EventGrid/src/autorest.md index d6cfbef814292..2677c9d90707d 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/20312e2b31df58f0ea7560e87062d62aa92f0a14/specification/eventgrid/data-plane/readme.md +require: https://github.com/Azure/azure-rest-api-specs/blob/3b6ae2ea162efb468a1de6742615e6c655c06e87/specification/eventgrid/data-plane/readme.md generation1-convenience-client: true model-factory-for-hlc: - MediaJobOutputAsset diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/tests/ConsumeEventTests.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/tests/ConsumeEventTests.cs index 99319c4deed5b..55499ea160186 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/tests/ConsumeEventTests.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/tests/ConsumeEventTests.cs @@ -3766,6 +3766,116 @@ public void ConsumeCloudEventAcsIncomingCallEvent() Assert.AreEqual("{incoming-call-contextValue}", incomingCallEvent.IncomingCallContext); Assert.AreEqual("correlationId", incomingCallEvent.CorrelationId); } + + [Test] + public void ConsumeCloudEventAcsRouterJobClassificationFailedEvent() + { + string requestContent = @"{ + ""id"": ""e80026e7-e298-46ba-bc42-dab0eda92581"", + ""source"": ""/subscriptions/{subscription-id}/resourceGroups/{group-name}/providers/Microsoft.Communication/communicationServices/{communication-services-resource-name}"", + ""subject"": ""job/{job-id}/channel/{channel-id}/classificationpolicy/{classificationpolicy-id}"", + ""data"": { + ""errors"": [ + { + ""code"": ""Failure"", + ""message"": ""Classification failed due to "", + ""target"": null, + ""innererror"": { + ""code"": ""InnerFailure"", + ""message"": ""Classification failed due to "", + ""target"": null}, + ""details"": null + } + ], + ""jobId"": ""7f1df17b-570b-4ae5-9cf5-fe6ff64cc712"", + ""channelReference"": ""test-abc"", + ""channelId"": ""FooVoiceChannelId"", + ""classificationPolicyId"": ""test-policy"", + ""labels"": { + ""Locale"": ""en-us"", + ""Segment"": ""Enterprise"", + ""Token"": ""FooToken"" + }, + ""tags"": { + ""Locale"": ""en-us"", + ""Segment"": ""Enterprise"", + ""Token"": ""FooToken"" + } + }, + ""type"": ""Microsoft.Communication.RouterJobClassificationFailed"", + ""specversion"": ""1.0"", + ""time"": ""2022-02-17T00:55:25.1736293Z"" + }"; + + CloudEvent[] events = CloudEvent.ParseMany(new BinaryData(requestContent)); + + Assert.NotNull(events); + events[0].TryGetSystemEventData(out object eventData); + var routerJobClassificationFailedEvent = eventData as AcsRouterJobClassificationFailedEventData; + Assert.IsNotNull(routerJobClassificationFailedEvent); + var errors = routerJobClassificationFailedEvent.Errors; + Assert.AreEqual(1, errors.Count); + Assert.AreEqual("Failure", errors[0].Code); + Assert.AreEqual("Classification failed due to ", errors[0].Message); + StringAssert.Contains("Inner Errors:", errors[0].ToString()); + } + + [Test] + public void ConsumeCloudEventAcsRouterJobQueuedEvent() + { + string requestContent = @"{ + ""id"": ""b6d8687a-5a1a-42ae-b8b5-ff7ec338c872"", + ""source"": ""/subscriptions/{subscription-id}/resourceGroups/{group-name}/providers/Microsoft.Communication/communicationServices/{communication-services-resource-name}"", + ""subject"": ""job/{job-id}/channel/{channel-id}/queue/{queue-id}"", + ""data"": { + ""jobId"": ""7f1df17b-570b-4ae5-9cf5-fe6ff64cc712"", + ""channelReference"": ""test-abc"", + ""channelId"": ""FooVoiceChannelId"", + ""queueId"": ""625fec06-ab81-4e60-b780-f364ed96ade1"", + ""priority"": 1, + ""labels"": { + ""Locale"": ""en-us"", + ""Segment"": ""Enterprise"", + ""Token"": ""FooToken"" + }, + ""tags"": { + ""Locale"": ""en-us"", + ""Segment"": ""Enterprise"", + ""Token"": ""FooToken"" + }, + ""requestedWorkerSelectors"": [ + { + ""key"": ""string"", + ""labelOperator"": ""equal"", + ""value"": 5, + ""ttlSeconds"": 1000 + } + ], + ""attachedWorkerSelectors"": [ + { + ""key"": ""string"", + ""labelOperator"": ""equal"", + ""value"": 5, + ""ttlSeconds"": 1000 + } + ] + }, + ""type"": ""Microsoft.Communication.RouterJobQueued"", + ""specversion"": ""1.0"", + ""time"": ""2022-02-17T00:55:25.1736293Z"" + }"; + + CloudEvent[] events = CloudEvent.ParseMany(new BinaryData(requestContent)); + + Assert.NotNull(events); + events[0].TryGetSystemEventData(out object eventData); + var routerJobQueuedEventData = eventData as AcsRouterJobQueuedEventData; + Assert.IsNotNull(routerJobQueuedEventData); + var selectors = routerJobQueuedEventData.AttachedWorkerSelectors; + Assert.AreEqual(1, selectors.Count); + Assert.AreEqual(TimeSpan.FromSeconds(1000), selectors[0].TimeToLive); + Assert.AreEqual(AcsRouterLabelOperator.Equal, selectors[0].LabelOperator); + } #endregion #region Health Data Services events @@ -4120,6 +4230,45 @@ public void ConsumeCloudEventDataBoxOrderCompleted() Assert.AreEqual(DateTimeOffset.Parse("2022-10-12T19:38:08.0218897Z"), dataBoxEvent.StageTime); } #endregion + #region Resource Notifications + + [Test] public void ConsumeCloudEventHealthResourcesAvailiabilityStatusChangedEvent() + { + string requestContent = @"{ + ""id"": ""1fb6fa94-d965-4306-abeq-4810f0774e97"", + ""source"": ""/subscriptions/{subscription-id}"", + ""subject"": ""/subscriptions/{subscription-id}/resourceGroups/{rg-name}/providers/Microsoft.Compute/virtualMachines/{vm-name}"", + ""data"": { + ""resourceInfo"": { + ""id"": ""/subscriptions/{subscription-id}/resourceGroups/{rg-name}/providers/Microsoft.Compute/virtualMachines/{vm-name}/providers/Microsoft.ResourceHealth/availabilityStatuses/{event-id}"", + ""name"": ""{event-id}"", + ""type"": ""Microsoft.ResourceHealth/availabilityStatuses"", + ""properties"": { + ""targetResourceId"": ""/subscriptions/{subscription-id}/resourceGroups/{rg-name}/providers/Microsoft.Compute/virtualMachines/{vm-name}"", + ""targetResourceType"": ""Microsoft.Compute/virtualMachines"", + ""occurredTime"": ""2023-07-24T19:20:37.9245071Z"", + ""previousAvailabilityState"": ""Unavailable"", + ""availabilityState"": ""Available"" + } + }, + ""operationalInfo"": { + ""resourceEventTime"": ""2023-07-24T19:20:37.9245071Z"" + }, + ""apiVersion"": ""2023-12-01"" + }, + ""type"": ""Microsoft.ResourceNotifications.HealthResources.AvailabilityStatusChanged"", + ""specversion"": ""1.0"", + ""time"": ""2023-07-24T19:20:37.9245071Z"" + }"; + CloudEvent[] events = CloudEvent.ParseMany(new BinaryData(requestContent)); + + Assert.NotNull(events); + Assert.True(events[0].TryGetSystemEventData(out object eventData)); + var availabilityStatusChangedEventData = eventData as ResourceNotificationsHealthResourcesAvailabilityStatusChangedEventData; + Assert.IsNotNull(availabilityStatusChangedEventData); + Assert.AreEqual("{event-id}", availabilityStatusChangedEventData.ResourceDetails.Name); + } + #endregion #endregion } }